Skip to content

Commit 59518b0

Browse files
authored
Merge branch 'master' into ok-err-status
2 parents 57f779e + 5c8fb1e commit 59518b0

Some content is hidden

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

86 files changed

+8870
-6162
lines changed

.commitlintrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['@commitlint/config-conventional']
3+
};

.dist.babelrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@
66
}
77
}]
88
],
9-
"sourceMaps": "inline"
9+
"sourceMaps": "inline",
10+
"comments": false
1011
}

.dist.eslintrc

+26-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"extends": ["eslint:recommended"],
2+
"extends": ["eslint:recommended", "plugin:compat/recommended"],
33
"env": {
44
"node": false,
55
"browser": true,
@@ -8,6 +8,14 @@
88
},
99
"plugins": ["compat"],
1010
"rules": {
11+
"node/no-unsupported-features/es-builtins": ["error", {
12+
"version": ">=8.0.0",
13+
"ignores": [
14+
"Atomics",
15+
"BigInt",
16+
"SharedArrayBuffer"
17+
]
18+
}],
1119
"compat/compat": "error",
1220
"no-console": "off",
1321
"no-empty": "off",
@@ -19,7 +27,13 @@
1927
"no-cond-assign": "off",
2028
"no-redeclare": "off",
2129
"node/no-exports-assign": "off",
22-
"no-unsafe-finally": "off"
30+
"no-unsafe-finally": "off",
31+
"complexity": ["error", 10000],
32+
"max-statements": "off",
33+
"no-constant-condition": "off",
34+
"no-control-regex": "off",
35+
"no-fallthrough": "off",
36+
"operator-linebreak": "off"
2337
},
2438
"globals": {
2539
"regeneratorRuntime": "writable"
@@ -31,7 +45,16 @@
3145
"Symbol",
3246
"Object.getOwnPropertySymbols",
3347
"Object.setPrototypeOf",
34-
"Set"
48+
"Set",
49+
"Math.trunc",
50+
"BigInt",
51+
"Map",
52+
"Reflect",
53+
"WeakMap",
54+
"WeakRef",
55+
"WeakSet",
56+
"Atomics",
57+
"SharedArrayBuffer"
3558
]
3659
}
3760
}

.eslintrc

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"extends": [
3+
"eslint:recommended",
4+
"plugin:node/recommended"
5+
],
6+
"env": {
7+
"node": true,
8+
"browser": true,
9+
"es6": true
10+
},
11+
"parserOptions": {
12+
"ecmaVersion": 2021
13+
},
14+
"overrides": [
15+
{
16+
"files": "test/**/*.js",
17+
"env": {
18+
"mocha": true
19+
},
20+
"rules": {
21+
"no-prototype-builtins": "off",
22+
"node/no-deprecated-api": "warn",
23+
"node/no-extraneous-require": "warn",
24+
"no-unused-vars": "warn"
25+
}
26+
}
27+
],
28+
"rules": {
29+
"node/no-unsupported-features/node-builtins": "off",
30+
"node/no-unsupported-features/es-syntax": "off",
31+
"node/no-exports-assign": "off"
32+
},
33+
"globals": {
34+
"ActiveXObject": "readonly"
35+
}
36+
37+
38+
}

.github/FUNDING.yml

-4
This file was deleted.

.github/workflows/ci.yml

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
env:
5+
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
6+
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
include:
14+
- node-version: 10.x
15+
test-on-old-node: 1
16+
- node-version: 12.x
17+
# test-on-brower: 1
18+
- node-version: 14.x
19+
- node-version: 16.x
20+
steps:
21+
- uses: actions/checkout@v2
22+
23+
- name: Install Node - ${{ matrix.node-version }}
24+
uses: actions/setup-node@v2
25+
with:
26+
node-version: ${{ matrix.node-version }}
27+
- name: Cache node modules
28+
uses: actions/cache@v2
29+
env:
30+
cache-name: cache-node-modules
31+
with:
32+
# npm cache files are stored in `~/.npm` on Linux/macOS
33+
path: ~/.npm
34+
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
35+
- name: Install Dependencies On Old Node ${{ matrix.node-version }}
36+
if: ${{ matrix.test-on-old-node == '1' }}
37+
run: yarn install --ignore-optional --ignore-scripts
38+
- name: Install Dependencies On Node ${{ matrix.node-version }}
39+
if: ${{ matrix.test-on-old-node != '1' }}
40+
run: yarn install
41+
- name: Build
42+
run: npm run build
43+
- name: Build On Old Node
44+
if: ${{ matrix.test-on-old-node == '1' }}
45+
run: npm run build:test
46+
- name: Test On Node ${{ matrix.node-version }}
47+
env:
48+
BROWSER: ${{ matrix.test-on-brower }}
49+
HTTP2_TEST_DISABLED: ${{ matrix.http2-test-disabled }}
50+
OLD_NODE_TEST: ${{ matrix.test-on-old-node }}
51+
run: |
52+
if [ "$OLD_NODE_TEST" = "1" ]; then
53+
make test
54+
else
55+
npm run lint
56+
make test
57+
fi
58+
- name: Coverage On Node ${{ matrix.node-version }}
59+
run:
60+
npm run coverage

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.vscode
12
build
23
lib-cov
34
coverage.html

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
yarn commitlint --edit $1

.husky/pre-commit

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
yarn lint-staged && yarn test

.lib.babelrc

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"presets": [
3-
["@babel/env", {
4-
"targets": {
5-
"node": "6.4.0",
6-
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
7-
}
8-
}]
9-
],
10-
"sourceMaps": "inline"
11-
}
2+
"presets": [
3+
["@babel/env", {
4+
"targets": {
5+
"node": "6.4.0",
6+
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
7+
}
8+
}]
9+
],
10+
"sourceMaps": "inline"
11+
}

.lib.eslintrc

+7-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
"no-console": "off",
99
"no-unused-vars": "off",
1010
"no-empty": "off",
11-
"node/no-unsupported-features/node-builtins": "off",
1211
"no-func-assign": "off",
1312
"no-global-assign": ["error", {"exceptions": ["exports"]}],
1413
"no-fallthrough": "off",
@@ -22,6 +21,13 @@
2221
"globals": {
2322
"ActiveXObject": "readable"
2423
}
24+
},
25+
{
26+
"files": [ "lib/node/http2wrapper.js" ],
27+
"rules": {
28+
"node/no-unsupported-features/es-builtins": "off",
29+
"node/no-unsupported-features/node-builtins": "off"
30+
}
2531
}
2632
]
2733
}

.lintstagedrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
"*.md": filenames => filenames.map(filename => `remark ${filename} -qfo`),
3+
'package.json': 'fixpack',
4+
'*.js': 'xo --fix'
5+
};

.npmignore

-12
This file was deleted.

.prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
bracketSpacing: true,
4+
trailingComma: 'none'
5+
};

.remarkrc.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: ['preset-github']
3+
};

.test.babelrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"presets": [
3+
["@babel/env", {
4+
"targets": {
5+
"node": "6.4.0",
6+
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
7+
}
8+
}]
9+
],
10+
"plugins": [
11+
["@babel/transform-runtime"]
12+
],
13+
"parserOpts": {
14+
"allowReturnOutsideFunction": true
15+
},
16+
"sourceMaps": "inline"
17+
}

.travis.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
sudo: false
22
language: node_js
33
node_js:
4+
- '18'
5+
- '16'
6+
- '14'
47
- '12'
5-
- '10'
68
after_success: npm run coverage
79

810
env:

.xo-config.js

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
module.exports = {
2+
prettier: true,
3+
space: true,
4+
nodeVersion: false,
5+
extends: [
6+
'xo-lass',
7+
],
8+
envs: [
9+
'node',
10+
'browser',
11+
],
12+
overrides: [
13+
{
14+
files: 'test/**/*.js',
15+
envs: [
16+
'mocha',
17+
],
18+
rules: {
19+
'block-scoped-var': 'warn',
20+
complexity: 'warn',
21+
'default-case': 'warn',
22+
eqeqeq: 'warn',
23+
'func-name-matching': 'warn',
24+
'func-names': 'warn',
25+
'guard-for-in': 'warn',
26+
'handle-callback-err': 'warn',
27+
'import/no-extraneous-dependencies': 'warn',
28+
'import/no-unassigned-import': 'warn',
29+
'import/order': 'warn',
30+
'max-nested-callbacks': 'warn',
31+
'new-cap': 'warn',
32+
'no-eq-null': 'warn',
33+
'no-extend-native': 'warn',
34+
'no-implicit-coercion': 'warn',
35+
'no-multi-assign': 'warn',
36+
'no-negated-condition': 'warn',
37+
'no-prototype-builtins': 'warn',
38+
'no-redeclare': 'warn',
39+
'no-undef': 'warn',
40+
'no-unused-expressions': 'warn',
41+
'no-unused-vars': 'warn',
42+
'no-use-extend-native/no-use-extend-native': 'warn',
43+
'no-useless-escape': 'warn',
44+
'no-var': 'warn',
45+
'no-void': 'warn',
46+
'node/no-deprecated-api': 'warn',
47+
'prefer-rest-params': 'warn',
48+
'prefer-spread': 'warn',
49+
'unicorn/filename-case': 'warn',
50+
'valid-jsdoc': 'warn',
51+
'node/no-path-concat': 'warn',
52+
'unicorn/no-empty-file': 'warn',
53+
},
54+
},
55+
],
56+
rules: {
57+
'unicorn/prevent-abbreviations': [
58+
'warn',
59+
{
60+
replacements: {
61+
res: false,
62+
args: false,
63+
fn: false,
64+
err: false,
65+
e: false,
66+
i: false,
67+
},
68+
},
69+
],
70+
'no-bitwise': 'warn',
71+
'node/prefer-global/buffer': 'warn',
72+
'node/prefer-global/process': 'warn',
73+
'unicorn/no-new-array': 'warn',
74+
'unicorn/no-this-assignment': 'warn',
75+
'unicorn/prefer-spread': 'warn',
76+
'unicorn/catch-error-name': 'warn',
77+
'unicorn/prefer-code-point': 'warn',
78+
'node/no-unsupported-features': [
79+
'error',
80+
{
81+
version: 8,
82+
ignores: [
83+
'syntax',
84+
],
85+
},
86+
],
87+
},
88+
globals: [
89+
'ActiveXObject',
90+
],
91+
};

0 commit comments

Comments
 (0)