Skip to content

Commit

Permalink
chore: repo maintenance (#1)
Browse files Browse the repository at this point in the history
- Add basic tests & coverage support
- Use public npm for h2-auto-push
- Package updates
- CircleCI integration
- License check
  • Loading branch information
jinwoo authored Jan 17, 2018
1 parent e99f551 commit 8bb866f
Show file tree
Hide file tree
Showing 9 changed files with 6,153 additions and 572 deletions.
65 changes: 65 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
---
release_tags: &release_tags
tags:
only: /^v\d+(\.\d+){2}(-.*)?$/

# "Include" for unit tests definition.
unit_tests: &unit_tests
steps:
- checkout
- run:
name: Install modules and dependencies.
command: npm install
- run:
name: Run unit tests.
command: npm test
- run:
name: Submit coverage data to codecov.
command: npm run codecov
when: always

version: 2.0
workflows:
version: 2
tests:
jobs:
- node8:
filters: *release_tags
- node9:
filters: *release_tags
- publish_npm:
requires:
- node8
- node9
filters:
branches:
ignore: /.*/
<<: *release_tags

jobs:
node8:
docker:
- image: node:8
user: node
<<: *unit_tests
node9:
docker:
- image: node:9
user: node
<<: *unit_tests

publish_npm:
docker:
- image: node:8
user: node
steps:
- checkout
- run:
name: Set NPM authentication.
command: echo "//registry.npmjs.org/:_authToken=${NPM_TOKEN}" > ~/.npmrc
- run:
name: Install modules and dependencies.
command: npm install
- run:
name: Publish the module to npm.
command: npm publish
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/.nyc_output
/.vscode
/build
/coverage
/node_modules
/.vscode
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ For more details, see the `h2-auto-push` package.

```javascript
import * as fastify from 'fastify';
import {staticService} from 'fastify-auto-push';
import {staticServe} from 'fastify-auto-push';
...
const app = fastify({https: {key, cert}, http2: true});
app.register(staticService, {root: 'path/to/static'});
app.register(staticServe, {root: 'path/to/static'});
...
```
5 changes: 5 additions & 0 deletions js-green-licenses.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"packageWhitelist": [
"bloomfilter" // Has LICENSE (BSD-3-Clause) but not listed in package.json
]
}
Loading

0 comments on commit 8bb866f

Please sign in to comment.