Skip to content

Commit d347047

Browse files
committed
Merge remote-tracking branch 'makenew/master'
2 parents 8326532 + 9a89bb8 commit d347047

File tree

14 files changed

+24086
-7172
lines changed

14 files changed

+24086
-7172
lines changed

.devcontainer/Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG VARIANT="16"
2+
3+
FROM mcr.microsoft.com/vscode/devcontainers/javascript-node:${VARIANT}
4+
5+
USER node
6+
WORKDIR /home/node
7+
8+
RUN mkdir -p .config/git \
9+
&& echo ".vscode/*" >> .config/git/ignore \
10+
&& echo "*.code-workspace" >> .config/git/ignore \
11+
&& echo ".history/" >> .config/git/ignore

.devcontainer/devcontainer.json

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
{
22
"name": "Node.js",
3-
"image": "mcr.microsoft.com/vscode/devcontainers/javascript-node:0-14",
3+
"build": {
4+
"dockerfile": "Dockerfile",
5+
"args": {
6+
"VARIANT": "16"
7+
}
8+
},
49
"extensions": [
10+
"ms-vsliveshare.vsliveshare",
511
"dbaeumer.vscode-eslint",
612
"EditorConfig.EditorConfig",
713
"esbenp.prettier-vscode"
814
],
9-
"postCreateCommand": "yarn install",
15+
"postCreateCommand": "npm install",
1016
"remoteUser": "node"
1117
}

.github/actions/setup/action.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
name: Setup
3+
description: Setup Node.js and install dependencies.
4+
5+
inputs:
6+
node_version:
7+
description: The Node.js version
8+
required: false
9+
default: '16'
10+
registry_url:
11+
description: The Node.js package registry URL.
12+
required: false
13+
default: https://registry.npmjs.org
14+
15+
runs:
16+
using: composite
17+
steps:
18+
- name: Setup Node.js
19+
uses: actions/setup-node@v2
20+
with:
21+
cache: npm
22+
node-version: ${{ inputs.node_version }}
23+
registry-url: ${{ inputs.registry_url }}
24+
- name: Install dependencies
25+
shell: bash
26+
run: npm ci

.github/workflows/format.yml

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -13,53 +13,28 @@ on:
1313
jobs:
1414
fix:
1515
runs-on: ubuntu-20.04
16+
timeout-minutes: 30
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@v2
1920
with:
2021
ref: ${{ github.head_ref }}
2122
token: ${{ secrets.GH_TOKEN }}
2223
- name: Import GPG key
23-
uses: crazy-max/ghaction-import-gpg@v3
24-
id: import_gpg
24+
uses: crazy-max/ghaction-import-gpg@v4
2525
with:
26-
git-user-signingkey: true
27-
git-commit-gpgsign: true
28-
git-committer-name: ${{ secrets.GIT_USER_NAME }}
29-
git-committer-email: ${{ secrets.GIT_USER_EMAIL }}
30-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
26+
git_user_signingkey: true
27+
git_commit_gpgsign: true
28+
git_committer_name: ${{ secrets.GIT_USER_NAME }}
29+
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
30+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
3131
passphrase: ${{ secrets.GPG_PASSPHRASE }}
32-
- name: Setup Node.js
33-
uses: actions/setup-node@v2
34-
with:
35-
node-version: '14'
36-
registry-url: https://npm.pkg.github.com
37-
scope: '@${{ github.repository_owner }}'
38-
- name: Get yarn cache directory
39-
id: yarn-cache-dir
40-
run: echo "::set-output name=dir::$(yarn cache dir)"
41-
- name: Yarn cache
42-
uses: actions/cache@v2
43-
with:
44-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
45-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
46-
restore-keys: |
47-
${{ runner.os }}-yarn-
48-
- name: Node modules cache
49-
uses: actions/cache@v2
50-
with:
51-
path: node_modules
52-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
53-
restore-keys: |
54-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
55-
- name: Install dependencies
56-
run: yarn install --frozen-lockfile --non-interactive
57-
env:
58-
NODE_AUTH_TOKEN: ${{ secrets.GH_TOKEN }}
32+
- name: Setup
33+
uses: ./.github/actions/setup
5934
- name: Format
60-
run: yarn run format
35+
run: npm run format
6136
- name: Commit
62-
uses: stefanzweifel/git-auto-commit-action@v4.8.0
37+
uses: stefanzweifel/git-auto-commit-action@v4
6338
with:
6439
commit_message: Run format
6540
commit_user_name: ${{ secrets.GIT_USER_NAME }}

.github/workflows/main.yml

Lines changed: 12 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -9,69 +9,35 @@ on:
99
jobs:
1010
test:
1111
runs-on: ubuntu-20.04
12+
timeout-minutes: 30
1213
strategy:
1314
matrix:
1415
node:
1516
- '14'
17+
- '16'
1618
steps:
1719
- name: Checkout
1820
uses: actions/checkout@v2
19-
- name: Setup Node.js
20-
uses: actions/setup-node@v2
21+
- name: Setup
22+
uses: ./.github/actions/setup
2123
with:
22-
node-version: ${{ matrix.node }}
23-
- name: Get yarn cache directory
24-
id: yarn-cache-dir
25-
run: echo "::set-output name=dir::$(yarn cache dir)"
26-
- name: Yarn cache
27-
uses: actions/cache@v2
28-
with:
29-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
30-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
31-
restore-keys: |
32-
${{ runner.os }}-yarn-
33-
- name: Node modules cache
34-
uses: actions/cache@v2
35-
with:
36-
path: node_modules
37-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
38-
restore-keys: |
39-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
40-
- name: Install dependencies
41-
run: yarn install --frozen-lockfile --non-interactive
24+
node_version: ${{ matrix.node }}
4225
- name: Test
43-
run: yarn test
26+
run: npm test
4427
lint:
4528
runs-on: ubuntu-20.04
29+
timeout-minutes: 30
4630
strategy:
4731
matrix:
4832
node:
4933
- '14'
34+
- '16'
5035
steps:
5136
- name: Checkout
5237
uses: actions/checkout@v2
53-
- name: Setup Node.js
54-
uses: actions/setup-node@v2
55-
with:
56-
node-version: ${{ matrix.node }}
57-
- name: Get yarn cache directory
58-
id: yarn-cache-dir
59-
run: echo "::set-output name=dir::$(yarn cache dir)"
60-
- name: Yarn cache
61-
uses: actions/cache@v2
62-
with:
63-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
64-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
65-
restore-keys: |
66-
${{ runner.os }}-yarn-
67-
- name: Node modules cache
68-
uses: actions/cache@v2
38+
- name: Setup
39+
uses: ./.github/actions/setup
6940
with:
70-
path: node_modules
71-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
72-
restore-keys: |
73-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
74-
- name: Install dependencies
75-
run: yarn install --frozen-lockfile --non-interactive
41+
node_version: ${{ matrix.node }}
7642
- name: Lint
77-
run: yarn run lint
43+
run: npm run lint

.github/workflows/publish.yml

Lines changed: 13 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -9,46 +9,20 @@ on:
99
jobs:
1010
npm:
1111
runs-on: ubuntu-20.04
12+
timeout-minutes: 30
1213
steps:
1314
- name: Checkout
1415
uses: actions/checkout@v2
15-
- name: Setup Node.js
16-
uses: actions/setup-node@v2
16+
- name: Setup
17+
uses: ./.github/actions/setup
1718
with:
18-
node-version: '14'
19-
registry-url: https://registry.npmjs.org
20-
- name: Check version
21-
id: version
22-
run: |
23-
echo "::set-output name=name::$(jq -r '.name' package.json)"
24-
echo "::set-output name=current::$(jq -r '.version' package.json)"
25-
echo "::set-output name=published::$(npm view $(jq -r '.name' package.json)@$(jq -r '.version' package.json) version)"
26-
env:
27-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
28-
- name: Get yarn cache directory
29-
id: yarn-cache-dir
30-
run: echo "::set-output name=dir::$(yarn cache dir)"
31-
- name: Yarn cache
32-
uses: actions/cache@v2
33-
with:
34-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
35-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
36-
restore-keys: |
37-
${{ runner.os }}-yarn-
38-
- name: Node modules cache
39-
uses: actions/cache@v2
19+
node_version: '14'
20+
- name: Publish
21+
uses: JS-DevTools/npm-publish@v1
4022
with:
41-
path: node_modules
42-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
43-
restore-keys: |
44-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
45-
- name: Install dependencies
46-
run: yarn install --frozen-lockfile --non-interactive
47-
- name: Publish ${{ steps.version.outputs.name }}@${{ steps.version.outputs.current }}
48-
if: ${{ endsWith(github.ref, format('v{0}', steps.version.outputs.published)) == false }}
49-
run: npm publish --access public
50-
env:
51-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
23+
access: public
24+
token: ${{ secrets.NPM_TOKEN }}
25+
5226
docs:
5327
runs-on: ubuntu-20.04
5428
steps:
@@ -78,35 +52,16 @@ jobs:
7852
git-committer-email: ${{ secrets.GIT_USER_EMAIL }}
7953
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
8054
passphrase: ${{ secrets.GPG_PASSPHRASE }}
81-
- name: Setup Node.js
82-
uses: actions/setup-node@v2
83-
with:
84-
node-version: '14'
85-
- name: Get yarn cache directory
86-
id: yarn-cache-dir
87-
run: echo "::set-output name=dir::$(yarn cache dir)"
88-
- name: Yarn cache
89-
uses: actions/cache@v2
90-
with:
91-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
92-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
93-
restore-keys: |
94-
${{ runner.os }}-yarn-
95-
- name: Node modules cache
96-
uses: actions/cache@v2
55+
- name: Setup
56+
uses: ./.github/actions/setup
9757
with:
98-
path: node_modules
99-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
100-
restore-keys: |
101-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
102-
- name: Install dependencies
103-
run: yarn install --frozen-lockfile --non-interactive
58+
node_version: '14'
10459
- name: Get version
10560
id: version
10661
run: |
10762
echo "::set-output name=current::$(jq -r '.version' package.json)"
10863
- name: Documentation
109-
run: yarn run docs:build
64+
run: npm run docs:build
11065
- name: Publish ${{ steps.version.outputs.current }}
11166
uses: peaceiris/actions-gh-pages@v3
11267
with:

.github/workflows/version.yml

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
jobs:
1414
release:
1515
runs-on: ubuntu-20.04
16+
timeout-minutes: 30
1617
steps:
1718
- name: Checkout
1819
uses: actions/checkout@v2
@@ -29,39 +30,16 @@ jobs:
2930
git remote set-url --push origin "https://${GH_USER}:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
3031
git config user.name "$GIT_USER_NAME"
3132
git config user.email "$GIT_USER_EMAIL"
32-
npm config set sign-git-tag true
3333
- name: Import GPG key
34-
uses: crazy-max/ghaction-import-gpg@v3
35-
id: import_gpg
34+
uses: crazy-max/ghaction-import-gpg@v4
3635
with:
37-
git-user-signingkey: true
38-
git-commit-gpgsign: true
39-
git-committer-name: ${{ secrets.GIT_USER_NAME }}
40-
git-committer-email: ${{ secrets.GIT_USER_EMAIL }}
41-
gpg-private-key: ${{ secrets.GPG_PRIVATE_KEY }}
36+
git_user_signingkey: true
37+
git_commit_gpgsign: true
38+
git_committer_name: ${{ secrets.GIT_USER_NAME }}
39+
git_committer_email: ${{ secrets.GIT_USER_EMAIL }}
40+
gpg_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
4241
passphrase: ${{ secrets.GPG_PASSPHRASE }}
43-
- name: Setup Node.js
44-
uses: actions/setup-node@v2
45-
with:
46-
node-version: '14'
47-
- name: Get yarn cache directory
48-
id: yarn-cache-dir
49-
run: echo "::set-output name=dir::$(yarn cache dir)"
50-
- name: Yarn cache
51-
uses: actions/cache@v2
52-
with:
53-
path: ${{ steps.yarn-cache-dir.outputs.dir }}
54-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
55-
restore-keys: |
56-
${{ runner.os }}-yarn-
57-
- name: Node modules cache
58-
uses: actions/cache@v2
59-
with:
60-
path: node_modules
61-
key: ${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
62-
restore-keys: |
63-
${{ runner.os }}-node_modules-${{ hashFiles('**/yarn.lock') }}
64-
- name: Install dependencies
65-
run: yarn install --frozen-lockfile --non-interactive
42+
- name: Setup
43+
uses: ./.github/actions/setup
6644
- name: Cut ${{ github.event.inputs.version }}${{ github.event.client_payload.version }} version
67-
run: npm version ${{ github.event.inputs.version }}${{ github.event.client_payload.version }}
45+
run: npm version --sign-git-tag=true ${{ github.event.inputs.version }}${{ github.event.client_payload.version }}

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ examples/local.json
2525
# Temporary development files
2626
tmp
2727

28-
# npm lockfile (only yarn.lock supported)
29-
package-lock.json
28+
# Yarn lockfile (only package-lock.json supported)
29+
yarn.lock
3030

3131
# Logs
3232
logs

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
lts/fermium
1+
lts/gallium

0 commit comments

Comments
 (0)