Skip to content

Commit e8d0779

Browse files
authored
V2 (#10)
* back to npm * update to year only * bump dev node * switch to github actions * switch to ts and webpack * drop node8 for eslint and update docs * improve file structure and docs
1 parent fe14a68 commit e8d0779

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6394
-3866
lines changed

.eslintrc.js

Lines changed: 19 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,24 @@
11
module.exports = {
2-
"env": {
3-
"es6": true,
4-
"node": true
2+
env: {
3+
node: true,
4+
es6: true,
55
},
6-
"extends": "eslint:recommended",
7-
"parserOptions": {
8-
"ecmaVersion": 8,
9-
"sourceType": "module"
6+
parser: '@typescript-eslint/parser',
7+
extends: [
8+
'plugin:@typescript-eslint/recommended',
9+
],
10+
parserOptions: {
11+
ecmaVersion: 2018,
12+
sourceType: 'module',
1013
},
11-
"rules": {
12-
"indent": [
13-
"error",
14-
2
14+
rules: {
15+
'@typescript-eslint/no-inferrable-types': 0,
16+
'@typescript-eslint/no-unused-vars': [
17+
'warn', {
18+
vars: 'all',
19+
args: 'none',
20+
}
1521
],
16-
"linebreak-style": [
17-
"error",
18-
"unix"
19-
],
20-
"quotes": [
21-
"error",
22-
"single"
23-
],
24-
"semi": [
25-
"error",
26-
"always"
27-
],
28-
"no-console": 0,
29-
"no-unused-vars": ["error", { "args": "none" }],
30-
"indent": ["error", 2, { "SwitchCase": 1 }],
31-
}
22+
'no-undef': 2,
23+
},
3224
};

.github/workflows/publish.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: Publish
2+
3+
env:
4+
NODE_VERSION: 12
5+
6+
on:
7+
release:
8+
types: [published]
9+
10+
jobs:
11+
spec:
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v1
15+
- uses: actions/setup-node@v1
16+
with:
17+
node-version: ${{ env.NODE_VERSION }}
18+
registry-url: https://registry.npmjs.org/
19+
# Log versions
20+
- run: npm --version; node --version
21+
- run: echo "PKG_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
22+
# Assert release tag version matches the version we're publishing
23+
# NOTE: release tags **must** start with a lowercase "v" and then version
24+
- run: |
25+
if [ "v${{env.PKG_VERSION}}" != "${{ github.event.release.tag_name }}" ]; then
26+
echo 'Error! Package version "v${{env.PKG_VERSION}}" does not match tag version "${{ github.event.release.tag_name }}"'
27+
exit 1
28+
fi
29+
- run: echo 'Publishing version - ${{env.PKG_VERSION}}'
30+
- run: npm ci
31+
- run: npm publish --dry-run
32+
env:
33+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}

.github/workflows/test.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
# all branches
6+
branches:
7+
- '**'
8+
# no tags
9+
tags-ignore:
10+
- '**'
11+
12+
jobs:
13+
testlib:
14+
runs-on: ubuntu-latest
15+
strategy:
16+
matrix:
17+
node-version: [10.x, 12.x, 14.x, 15.x]
18+
steps:
19+
- uses: actions/checkout@v2
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
# Log versions
25+
- run: npm --version; node --version
26+
- run: npm ci
27+
# make sure tests pass
28+
- run: npm test
29+
# make sure we can build successfully
30+
- run: npm run build

.gitignore

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ node_modules
3232
# Optional REPL history
3333
.node_repl_history
3434

35+
dist
36+
3537
.DS_Store
3638
Thumbs.db
37-
38-
.reify-cache
39-
.nyc_output
40-
coverage

.mocharc.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
module.exports = {
2+
ignore: [
3+
'./test/__tests__/**/*',
4+
],
5+
require: [
6+
'./test/__tests__/mocha.js',
7+
'ts-node/register',
8+
],
9+
extension: [
10+
'ts',
11+
],
12+
}

.npmignore

Lines changed: 0 additions & 16 deletions
This file was deleted.

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8
1+
12

.travis.yml

Lines changed: 0 additions & 13 deletions
This file was deleted.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2017 Cory Mawhorter
3+
Copyright (c) 2021 Cory Mawhorter
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

0 commit comments

Comments
 (0)