-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: deps update, refactor, rollup update
BREAKING CHANGE: potentially breaking interface changes for browser version
- Loading branch information
Showing
32 changed files
with
7,913 additions
and
10,744 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,4 @@ node_modules/ | |
static/ | ||
**/*.xxx.* | ||
dist/ | ||
benchmark/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,46 @@ | ||
module.exports = { | ||
extends: ['eslint:recommended', 'google'], | ||
parserOptions: { | ||
ecmaVersion: 2018, | ||
}, | ||
env: { | ||
es6: true, | ||
node: true, | ||
jest: false, | ||
}, | ||
extends: [ | ||
'eslint:recommended', | ||
'google', | ||
'prettier', | ||
'plugin:@typescript-eslint/eslint-recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'plugin:@typescript-eslint/recommended-requiring-type-checking', | ||
], | ||
globals: { | ||
Atomics: 'readonly', | ||
SharedArrayBuffer: 'readonly', | ||
}, | ||
parser: '@typescript-eslint/parser', | ||
parserOptions: { | ||
project: 'tsconfig.eslint.json', | ||
sourceType: 'module', | ||
}, | ||
plugins: ['prettier', 'sort-requires', '@typescript-eslint'], | ||
rules: { | ||
'new-cap': ['error', {capIsNewExceptions: ['ObjectId', 'Fastify']}], | ||
'max-len': [ | ||
'error', | ||
{ | ||
code: 80, | ||
comments: 999, | ||
ignoreComments: true, | ||
ignoreStrings: true, | ||
ignoreTrailingComments: true, | ||
ignoreUrls: true, | ||
ignoreTemplateLiterals: true, | ||
}, | ||
], | ||
indent: ['error', 2, {SwitchCase: 1}], | ||
'spaced-comment': ['error', 'always', {markers: ['/']}], | ||
'no-console': 'warn', | ||
'prettier/prettier': 'error', | ||
'@typescript-eslint/no-namespace': 'off', | ||
'valid-jsdoc': 'off', | ||
'require-jsdoc': 'off', | ||
'@typescript-eslint/no-explicit-any': 'off', | ||
'@typescript-eslint/ban-types': 'off', | ||
'no-invalid-this': 'off', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['**/__tests__/**/*', '**/test/**/*'], | ||
env: { | ||
jest: true, | ||
}, | ||
rules: { | ||
'require-jsdoc': 'off', | ||
'no-new-wrappers': 'off', | ||
}, | ||
}, | ||
], | ||
settings: {}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node | ||
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions | ||
|
||
name: build | ||
|
||
on: | ||
push: | ||
tags-ignore: | ||
- v[0-9]+.[0-9]+.[0-9]+ | ||
- v[0-9]+.[0-9]+.[0-9]+-rc.[0-9]+ | ||
branches: | ||
- master | ||
- next | ||
paths-ignore: | ||
- 'VERSION' | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x, 16.x] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Audit | ||
run: npm audit --production | ||
- name: Lint | ||
run: npm run lint --if-present | ||
- name: Test | ||
run: npm run unit --if-present -- --coverage | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
- name: Archive code coverage results | ||
if: matrix.node-version == '14.x' | ||
uses: actions/upload-artifact@v1 | ||
with: | ||
name: code-coverage-report | ||
path: coverage | ||
bump-version: | ||
name: Bump version | ||
runs-on: ubuntu-latest | ||
needs: build | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Store version | ||
run: npm run version:update | ||
- name: Commit version changes | ||
if: ${{ github.ref == 'refs/heads/master' }} | ||
run: | | ||
git config --global user.name 'Release Bot' | ||
git config --global user.email '[email protected]' | ||
npm run release | ||
- name: Commit version changes | ||
if: ${{ github.ref == 'refs/heads/next' }} | ||
run: | | ||
git config --global user.name 'Release Bot' | ||
git config --global user.email '[email protected]' | ||
npm run release -- --prerelease rc --skip.changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
on: | ||
workflow_run: | ||
workflows: | ||
- build | ||
types: | ||
- completed | ||
branches: | ||
- next | ||
|
||
name: Create Beta Release | ||
|
||
jobs: | ||
release: | ||
name: Release beta | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
ref: refs/heads/next | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- run: git fetch --prune --unshallow | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Get latest changelog | ||
id: Changelog | ||
run: | | ||
changelog=$(npm run --silent get-changelog | tail -n +1) | ||
echo $changelog | ||
changelog="${changelog//'%'/'%25'}" | ||
changelog="${changelog//$'\n'/'%0A'}" | ||
changelog="${changelog//$'\r'/'%0D'}" | ||
echo "::set-output name=changelog::$changelog" | ||
- name: Get release version | ||
id: release_type | ||
run: | | ||
RELEASE_VERSION=`cat VERSION` | ||
echo "::set-output name=version::$RELEASE_VERSION" | ||
- name: Create github release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.release_type.outputs.version }} | ||
release_name: Release ${{ steps.release_type.outputs.version }} | ||
body: | | ||
${{ steps.Changelog.outputs.changelog }} | ||
draft: false | ||
prerelease: true | ||
|
||
publish-npm: | ||
name: Publish to npm | ||
runs-on: ubuntu-latest | ||
needs: release | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
ref: refs/heads/next | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Publish | ||
run: npm publish --tag next | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
on: | ||
workflow_run: | ||
workflows: | ||
- build | ||
types: | ||
- completed | ||
branches: | ||
- master | ||
|
||
name: Create Release | ||
|
||
jobs: | ||
release: | ||
name: Release stable | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 50 | ||
ref: refs/heads/master | ||
- run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* | ||
- run: git fetch --prune --unshallow | ||
- name: Setup node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Get latest changelog | ||
id: Changelog | ||
run: | | ||
changelog=$(npm run --silent get-changelog -- --skipUnstable | tail -n +1) | ||
echo $changelog | ||
changelog="${changelog//'%'/'%25'}" | ||
changelog="${changelog//$'\n'/'%0A'}" | ||
changelog="${changelog//$'\r'/'%0D'}" | ||
echo "::set-output name=changelog::$changelog" | ||
- name: Get release version | ||
id: release_type | ||
run: | | ||
RELEASE_VERSION=`cat VERSION` | ||
echo "::set-output name=version::$RELEASE_VERSION" | ||
- name: Create github release | ||
id: create_release | ||
uses: actions/create-release@latest | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.release_type.outputs.version }} | ||
release_name: Release ${{ steps.release_type.outputs.version }} | ||
body: | | ||
${{ steps.Changelog.outputs.changelog }} | ||
draft: false | ||
prerelease: false | ||
|
||
publish-npm: | ||
name: Publish to npm | ||
runs-on: ubuntu-latest | ||
needs: release | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v1 | ||
with: | ||
node-version: 14 | ||
registry-url: https://registry.npmjs.org/ | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Publish | ||
run: npm publish --tag latest | ||
env: | ||
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}} | ||
# publish-gh: | ||
# name: Publish to github packages | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - uses: actions/setup-node@v1 | ||
# with: | ||
# node-version: 14 | ||
# registry-url: https://npm.pkg.github.com/ | ||
# - name: Install dependencies | ||
# run: npm ci | ||
# - name: Build | ||
# run: npm run build --if-present | ||
# - name: Get npm tag | ||
# id: npm_tag | ||
# run: | | ||
# NPM_TAG=$([[ ${{ github.ref }} == *"-rc"* ]] && echo "next" || echo "latest") | ||
# echo "::set-output name=tag::$NPM_TAG" | ||
# - run: npm publish --access public | ||
# env: | ||
# NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
name: verify-PR | ||
|
||
on: | ||
pull_request: | ||
branches: [master, next] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
strategy: | ||
matrix: | ||
node-version: [10.x, 12.x, 14.x, 16.x] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: ${{ matrix.node-version }} | ||
- name: Install dependencies | ||
run: npm ci | ||
- name: Build | ||
run: npm run build --if-present | ||
- name: Audit | ||
run: npm audit --production | ||
- name: lint | ||
uses: reviewdog/action-eslint@v1 | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
reporter: github-pr-review | ||
eslint_flags: '. --ext js,jsx,ts,tsx' | ||
- name: Test | ||
run: npm run unit --if-present | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
name: codecov-umbrella | ||
fail_ci_if_error: true | ||
verbose: true |
Oops, something went wrong.