Skip to content

Commit

Permalink
V2 (#10)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
cmawhorter authored Apr 9, 2021
1 parent fe14a68 commit e8d0779
Show file tree
Hide file tree
Showing 47 changed files with 6,394 additions and 3,866 deletions.
46 changes: 19 additions & 27 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,32 +1,24 @@
module.exports = {
"env": {
"es6": true,
"node": true
env: {
node: true,
es6: true,
},
"extends": "eslint:recommended",
"parserOptions": {
"ecmaVersion": 8,
"sourceType": "module"
parser: '@typescript-eslint/parser',
extends: [
'plugin:@typescript-eslint/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
},
"rules": {
"indent": [
"error",
2
rules: {
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-unused-vars': [
'warn', {
vars: 'all',
args: 'none',
}
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
],
"no-console": 0,
"no-unused-vars": ["error", { "args": "none" }],
"indent": ["error", 2, { "SwitchCase": 1 }],
}
'no-undef': 2,
},
};
33 changes: 33 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Publish

env:
NODE_VERSION: 12

on:
release:
types: [published]

jobs:
spec:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
with:
node-version: ${{ env.NODE_VERSION }}
registry-url: https://registry.npmjs.org/
# Log versions
- run: npm --version; node --version
- run: echo "PKG_VERSION=$(jq -r .version package.json)" >> $GITHUB_ENV
# Assert release tag version matches the version we're publishing
# NOTE: release tags **must** start with a lowercase "v" and then version
- run: |
if [ "v${{env.PKG_VERSION}}" != "${{ github.event.release.tag_name }}" ]; then
echo 'Error! Package version "v${{env.PKG_VERSION}}" does not match tag version "${{ github.event.release.tag_name }}"'
exit 1
fi
- run: echo 'Publishing version - ${{env.PKG_VERSION}}'
- run: npm ci
- run: npm publish --dry-run
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test

on:
push:
# all branches
branches:
- '**'
# no tags
tags-ignore:
- '**'

jobs:
testlib:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x, 12.x, 14.x, 15.x]
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
# Log versions
- run: npm --version; node --version
- run: npm ci
# make sure tests pass
- run: npm test
# make sure we can build successfully
- run: npm run build
6 changes: 2 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ node_modules
# Optional REPL history
.node_repl_history

dist

.DS_Store
Thumbs.db

.reify-cache
.nyc_output
coverage
12 changes: 12 additions & 0 deletions .mocharc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
ignore: [
'./test/__tests__/**/*',
],
require: [
'./test/__tests__/mocha.js',
'ts-node/register',
],
extension: [
'ts',
],
}
16 changes: 0 additions & 16 deletions .npmignore

This file was deleted.

2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8
12
13 changes: 0 additions & 13 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2017 Cory Mawhorter
Copyright (c) 2021 Cory Mawhorter

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

0 comments on commit e8d0779

Please sign in to comment.