Skip to content

Commit

Permalink
Merge pull request #35 from microauth/next
Browse files Browse the repository at this point in the history
Next
  • Loading branch information
rockchalkwushock authored Mar 6, 2018
2 parents f9e5413 + dffe957 commit e7dbe02
Show file tree
Hide file tree
Showing 15 changed files with 2,283 additions and 1,955 deletions.
124 changes: 58 additions & 66 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,54 +1,58 @@
# TODO: greenkeepre.lockfile integration
# https://github.com/greenkeeperio/greenkeeper-lockfile
version: 2
jobs:
checkout_code:
docker:
- image: circleci/node:latest
- image: 'circleci/node:latest'
working_directory: ~/microauth-vkontakte
steps:
- checkout
- run: echo $CIRCLE_SHA1 > .circle-sha
- save_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
paths:
- ~/microauth-vkontakte
install_dependencies:
docker:
- image: circleci/node:latest
working_directory: ~/microauth-vkontakte
steps:
- run: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- attach_workspace:
at: ~/microauth-vkontakte
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- 'yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}'
- 'yarn-cache-{{ .Branch }}'
- yarn-cache-
- run: yarn install
- save_cache:
key: v1-dependencies-{{ checksum "yarn.lock" }}
paths:
- ~/microauth-vkontakte/.yarn-cache
test:
key: 'yarn-cache-{{ .Branch }}-{{ checksum "yarn.lock" }}'
paths: node_modules
- persist_to_workspace:
root: .
paths: .
validate_code:
docker:
- image: circleci/node:latest
- image: 'circleci/node:latest'
working_directory: ~/microauth-vkontakte
steps:
- run: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
# Install dependencies
- run: yarn install
# Using `nsp` check for vulnerabilities in package dependencies.
- run: yarn start validate.dependencies
# Validate the code through: linting, type-checking, & testing that will generate coverage.
- run: yarn start validate.withCoverage
# Report coverage to CodeCov.
- checkout
- attach_workspace:
at: ~/microauth-vkontakte
- run: yarn start validate
test_node_7:
docker:
- image: 'circleci/node:7'
working_directory: ~/microauth-vkontakte
steps:
- attach_workspace:
at: ~/microauth-vkontakte
- run: yarn test
test_node_8:
docker:
- image: 'circleci/node:8'
working_directory: ~/microauth-vkontakte
steps:
- attach_workspace:
at: ~/microauth-vkontakte
- run: yarn test
test_latest_and_report:
docker:
- image: 'circleci/node:latest'
working_directory: ~/microauth-vkontakte
steps:
- attach_workspace:
at: ~/microauth-vkontakte
- run: yarn start test.coverage
- run: yarn start reportCoverage
- store_artifacts:
path: ./coverage/clover.xml
Expand All @@ -60,49 +64,37 @@ jobs:
path: ./coverage/clover.xml
release:
docker:
- image: circleci/node:latest
- image: 'circleci/node:latest'
working_directory: ~/microauth-vkontakte
steps:
- run: echo $CIRCLE_SHA1 > .circle-sha
- restore_cache:
key: v1-repo-{{ checksum ".circle-sha" }}
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
- v1-dependencies-
- run: yarn install
# Build the './lib' for distribution.
- run: yarn start build
# Publish to NPM with `semantic-release`.
# NOTE REVIEW
# yarn start release || true will address failing builds when no changes
# are found by 'semantic-release pre'
# https://github.com/semantic-release/semantic-release/issues/449#issuecomment-332754125
- attach_workspace:
at: ~/microauth-vkontakte
- run: yarn start release || true
# Workflows
# https://circleci.com/docs/2.0/configuration-reference/#workflows
# https://circleci.com/docs/2.0/workflows/#branch-level-job-execution
workflows:
version: 2
test_and_release:
jobs:
- checkout_code
- install_dependencies:
- validate_code:
requires:
- checkout_code
- test:
- test_node_7:
requires:
- install_dependencies
- hold:
type: approval
- checkout_code
- validate_code
- test_node_8:
requires:
- test
filters:
branches:
only: master
- checkout_code
- validate_code
- test_latest_and_report:
requires:
- checkout_code
- validate_code
- release:
requires:
- hold
- test_node_7
- test_node_8
- test_latest_and_report
filters:
branches:
only: master
3 changes: 0 additions & 3 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
node_modules
npm-debug.log

# Flow
flow-typed

# Testing
coverage

Expand Down
6 changes: 0 additions & 6 deletions .eslintrc

This file was deleted.

4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- TODO Checked checkbox should look like this: [x] -->

- [ ] I have searched the [issues]() of this repository and believe that this is not a duplicate.
- [ ] I have searched the [issues](https://github.com/microauth/microauth-vkontakte/issues) of this repository and believe that this is not a duplicate.

## Expected Behavior

Expand All @@ -32,7 +32,7 @@

<!--- Include as many relevant details about the environment you experienced the bug in -->
| Tech | Version |
|-----------------|---------|
| --------------- | ------- |
| `micro` | |
| `node` | |
| `npm` or `yarn` | |
Expand Down
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ What issue is this in reference too?
$ git add -A
### confirm correct files are present.
$ git status
$ npm run commit || yarn commit
$ npm run cm || yarn cm
### If linting or testing fails fix and repeat.
### Fill in the pertinent information based on your changes in the commitizen log.
$ git push origin <branch>
Expand Down
30 changes: 8 additions & 22 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,42 +26,28 @@ Visit the [issue tracker](https://github.com/microauth/microauth-vkontakte/issue

Fork, then clone the repository:

```bash
git clone
```

### Building

Running the build.

```bash
npm start build
```sh
git clone https://github.com/microauth/microauth-vkontakte.git
```

### Linting & Testing

To run all at once, run the following:

```bash
npm run precommit
```

To run only tests:

```bash
npm test
```sh
yarn test
```

To run only linting:

```bash
npm run lint
```sh
yarn start lint
```

To continuously watch and run tests:

```bash
npm run test:watch
```sh
yarn start test.watch
```

## Docs
Expand Down
24 changes: 3 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

[![CircleCI](https://img.shields.io/circleci/project/github/microauth/microauth-vkontakte.svg?style=flat-square)](https://circleci.com/gh/microauth/microauth-vkontakte)
[![Codecov](https://img.shields.io/codecov/c/github/microauth/microauth-vkontakte.svg?style=flat-square)](https://codecov.io/gh/microauth/microauth-vkontakte)
[![NSP Status](https://nodesecurity.io/orgs/microauth/projects/0eefb70e-c3dd-4cd0-986f-ba26c0fbaca7/badge)](https://nodesecurity.io/orgs/microauth/projects/0eefb70e-c3dd-4cd0-986f-ba26c0fbaca7)
[![Known Vulnerabilities](https://snyk.io/test/github/microauth/microauth-vkontakte/badge.svg)](https://snyk.io/test/github/microauth/microauth-vkontakte)
[![Greenkeeper badge](https://badges.greenkeeper.io/microauth/microauth-vkontakte.svg)](https://greenkeeper.io/)

[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=flat-square)](http://commitizen.github.io/cz-cli/)
Expand All @@ -21,20 +19,6 @@

> Vkontakte OAuth for [`micro`](https://github.com/zeit/micro).
## Note to users

> At the time of writing this package the following are supported:
Feature | Node Version | Flags
---------|----------|---------
`async/await` | `^8.x.x` | no
`object rest properties` | `^8.4.0` | `8.2.1` with `--harmony`
`object spread properties` | `^8.4.0` | `8.2.1` with `--harmony`

Information from [Node Green](http://node.green/#ESNEXT-candidate--stage-3-).

> _I will remove the build process when these features become part of LTS._
## Running the example

1. Setup an account with [Zeit](https://zeit.co).
Expand All @@ -45,7 +29,7 @@ Information from [Node Green](http://node.green/#ESNEXT-candidate--stage-3-).

[![Deploy to now](https://deploy.now.sh/static/button.svg)](https://deploy.now.sh/?repo=https://github.com/microauth/microauth-vkontakte/tree/master/example&env=VK_APP_ID&env=VK_APP_SECRET)

You may also choose to run the example locally by cloning the repository & following these [instructions](https://github.com/microauth/microauth-vkontakte/example/#readme).
You may also choose to run the example locally by cloning the repository & following these [instructions](https://github.com/microauth/microauth-vkontakte/example).

## Usage

Expand Down Expand Up @@ -87,8 +71,6 @@ The options object you pass to `microAuthVkontakte` has predefined defaults in p

It is your responsibility as a developer to not expose your secure data publicly! Please use such packages as `dotenv` or `dotenv-safe` to manage your secure data through environment variables.

This package is tested for vulnerabilities to its dependencies by both [Node Security Platform (NSP)](https://nodesecurity.io) & [Snyk](https://snyk.io) to aid in maintaining the integrity of your projects.

## Contributing

Please read the [CONTRIBUTING.md](https://github.com/microauth/microauth-vkontakte/blob/master/CONTRIBUTING.md)
Expand All @@ -104,7 +86,7 @@ yarn test
To verify the package is in working order on your local machine you can run the below script. It will produces `./package`. You can then go into the `./example` directory and change the location in which `microauth-vkontakte` is being used:

```js
const microAuthVkontakte = require('../package/lib')
const microAuthVkontakte = require('../package/src')
```

```sh
Expand All @@ -121,7 +103,7 @@ yarn start package

<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
| [<img src="https://avatars2.githubusercontent.com/u/19720404?v=4" width="100px;"/><br /><sub>Cody Brunner</sub>](https://rcws-development.com/)<br />[💻](https://github.com/microauth/microauth-vkontakte/commits?author=rockchalkwushock "Code") [📖](https://github.com/microauth/microauth-vkontakte/commits?author=rockchalkwushock "Documentation") [💡](#example-rockchalkwushock "Examples") [⚠️](https://github.com/microauth/microauth-vkontakte/commits?author=rockchalkwushock "Tests") |
| :---: |
| :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------: |
<!-- ALL-CONTRIBUTORS-LIST:END -->
Thanks goes to these wonderful people ([emoji key](https://github.com/kentcdodds/all-contributors#emoji-key)):

Expand Down
5 changes: 2 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,14 @@
"version": "0.1.0",
"description": "Basic example for using this package.",
"main": "index.js",
"author":
"Cody Brunner <[email protected]> (https://rcws-development.com)",
"author": "Cody Brunner <[email protected]> (https://codybrunner.me)",
"license": "MIT",
"scripts": {
"now-start": "NODE_ENV=production micro",
"start": "NODE_ENV=development micro"
},
"dependencies": {
"micro": "~9.0.0",
"micro": "~9.1.0",
"microauth-vkontakte": "latest"
}
}
13 changes: 0 additions & 13 deletions jest.config.json

This file was deleted.

Loading

0 comments on commit e7dbe02

Please sign in to comment.