Skip to content

Commit

Permalink
Merge branch 'master' into remove-old-hacks
Browse files Browse the repository at this point in the history
  • Loading branch information
titanism authored Jun 1, 2022
2 parents 0228b9e + 9c5966e commit 764412a
Show file tree
Hide file tree
Showing 73 changed files with 4,818 additions and 2,516 deletions.
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['@commitlint/config-conventional']
};
3 changes: 2 additions & 1 deletion .dist.babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
}
}]
],
"sourceMaps": "inline"
"sourceMaps": "inline",
"comments": false
}
28 changes: 25 additions & 3 deletions .dist.eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"extends": ["eslint:recommended"],
"extends": ["eslint:recommended", "plugin:compat/recommended"],
"env": {
"node": false,
"browser": true,
Expand All @@ -8,6 +8,14 @@
},
"plugins": ["compat"],
"rules": {
"node/no-unsupported-features/es-builtins": ["error", {
"version": ">=8.0.0",
"ignores": [
"Atomics",
"BigInt",
"SharedArrayBuffer"
]
}],
"compat/compat": "error",
"no-console": "off",
"no-empty": "off",
Expand All @@ -19,7 +27,13 @@
"no-cond-assign": "off",
"no-redeclare": "off",
"node/no-exports-assign": "off",
"no-unsafe-finally": "off"
"no-unsafe-finally": "off",
"complexity": ["error", 10000],
"max-statements": "off",
"no-constant-condition": "off",
"no-control-regex": "off",
"no-fallthrough": "off",
"operator-linebreak": "off"
},
"globals": {
"regeneratorRuntime": "writable"
Expand All @@ -32,7 +46,15 @@
"Object.getOwnPropertySymbols",
"Object.setPrototypeOf",
"Set",
"Math.trunc"
"Math.trunc",
"BigInt",
"Map",
"Reflect",
"WeakMap",
"WeakRef",
"WeakSet",
"Atomics",
"SharedArrayBuffer"
]
}
}
38 changes: 38 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
"extends": [
"eslint:recommended",
"plugin:node/recommended"
],
"env": {
"node": true,
"browser": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2021
},
"overrides": [
{
"files": "test/**/*.js",
"env": {
"mocha": true
},
"rules": {
"no-prototype-builtins": "off",
"node/no-deprecated-api": "warn",
"node/no-extraneous-require": "warn",
"no-unused-vars": "warn"
}
}
],
"rules": {
"node/no-unsupported-features/node-builtins": "off",
"node/no-unsupported-features/es-syntax": "off",
"node/no-exports-assign": "off"
},
"globals": {
"ActiveXObject": "readonly"
}


}
4 changes: 0 additions & 4 deletions .github/FUNDING.yml

This file was deleted.

60 changes: 60 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: CI
on: [push, pull_request]

env:
SAUCE_USERNAME: ${{ secrets.SAUCE_USERNAME }}
SAUCE_ACCESS_KEY: ${{ secrets.SAUCE_ACCESS_KEY }}

jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- node-version: 10.x
test-on-old-node: 1
- node-version: 12.x
# test-on-brower: 1
- node-version: 14.x
- node-version: 16.x
steps:
- uses: actions/checkout@v2

- name: Install Node - ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: cache-node-modules
with:
# npm cache files are stored in `~/.npm` on Linux/macOS
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
- name: Install Dependencies On Old Node ${{ matrix.node-version }}
if: ${{ matrix.test-on-old-node == '1' }}
run: yarn install --ignore-optional --ignore-scripts
- name: Install Dependencies On Node ${{ matrix.node-version }}
if: ${{ matrix.test-on-old-node != '1' }}
run: yarn install
- name: Build
run: npm run build
- name: Build On Old Node
if: ${{ matrix.test-on-old-node == '1' }}
run: npm run build:test
- name: Test On Node ${{ matrix.node-version }}
env:
BROWSER: ${{ matrix.test-on-brower }}
HTTP2_TEST_DISABLED: ${{ matrix.http2-test-disabled }}
OLD_NODE_TEST: ${{ matrix.test-on-old-node }}
run: |
if [ "$OLD_NODE_TEST" = "1" ]; then
make test
else
npm run lint
make test
fi
- name: Coverage On Node ${{ matrix.node-version }}
run:
npm run coverage
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.vscode
build
lib-cov
coverage.html
Expand Down
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname "$0")/_/husky.sh"

yarn commitlint --edit $1
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

yarn lint-staged && yarn test
20 changes: 10 additions & 10 deletions .lib.babelrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"sourceMaps": "inline"
}
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"sourceMaps": "inline"
}
8 changes: 7 additions & 1 deletion .lib.eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
"no-console": "off",
"no-unused-vars": "off",
"no-empty": "off",
"node/no-unsupported-features/node-builtins": "off",
"no-func-assign": "off",
"no-global-assign": ["error", {"exceptions": ["exports"]}],
"no-fallthrough": "off",
Expand All @@ -22,6 +21,13 @@
"globals": {
"ActiveXObject": "readable"
}
},
{
"files": [ "lib/node/http2wrapper.js" ],
"rules": {
"node/no-unsupported-features/es-builtins": "off",
"node/no-unsupported-features/node-builtins": "off"
}
}
]
}
5 changes: 5 additions & 0 deletions .lintstagedrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
"*.md": filenames => filenames.map(filename => `remark ${filename} -qfo`),
'package.json': 'fixpack',
'*.js': 'xo --fix'
};
12 changes: 0 additions & 12 deletions .npmignore

This file was deleted.

5 changes: 5 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
singleQuote: true,
bracketSpacing: true,
trailingComma: 'none'
};
3 changes: 3 additions & 0 deletions .remarkrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
plugins: ['preset-github']
};
17 changes: 17 additions & 0 deletions .test.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"presets": [
["@babel/env", {
"targets": {
"node": "6.4.0",
"browsers": [ "> 1%", "last 2 versions", "ie 9" ]
}
}]
],
"plugins": [
["@babel/transform-runtime"]
],
"parserOpts": {
"allowReturnOutsideFunction": true
},
"sourceMaps": "inline"
}
4 changes: 3 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
sudo: false
language: node_js
node_js:
- '18'
- '16'
- '14'
- '12'
- '10'
after_success: npm run coverage

env:
Expand Down
91 changes: 91 additions & 0 deletions .xo-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
module.exports = {
prettier: true,
space: true,
nodeVersion: false,
extends: [
'xo-lass',
],
envs: [
'node',
'browser',
],
overrides: [
{
files: 'test/**/*.js',
envs: [
'mocha',
],
rules: {
'block-scoped-var': 'warn',
complexity: 'warn',
'default-case': 'warn',
eqeqeq: 'warn',
'func-name-matching': 'warn',
'func-names': 'warn',
'guard-for-in': 'warn',
'handle-callback-err': 'warn',
'import/no-extraneous-dependencies': 'warn',
'import/no-unassigned-import': 'warn',
'import/order': 'warn',
'max-nested-callbacks': 'warn',
'new-cap': 'warn',
'no-eq-null': 'warn',
'no-extend-native': 'warn',
'no-implicit-coercion': 'warn',
'no-multi-assign': 'warn',
'no-negated-condition': 'warn',
'no-prototype-builtins': 'warn',
'no-redeclare': 'warn',
'no-undef': 'warn',
'no-unused-expressions': 'warn',
'no-unused-vars': 'warn',
'no-use-extend-native/no-use-extend-native': 'warn',
'no-useless-escape': 'warn',
'no-var': 'warn',
'no-void': 'warn',
'node/no-deprecated-api': 'warn',
'prefer-rest-params': 'warn',
'prefer-spread': 'warn',
'unicorn/filename-case': 'warn',
'valid-jsdoc': 'warn',
'node/no-path-concat': 'warn',
'unicorn/no-empty-file': 'warn',
},
},
],
rules: {
'unicorn/prevent-abbreviations': [
'warn',
{
replacements: {
res: false,
args: false,
fn: false,
err: false,
e: false,
i: false,
},
},
],
'no-bitwise': 'warn',
'node/prefer-global/buffer': 'warn',
'node/prefer-global/process': 'warn',
'unicorn/no-new-array': 'warn',
'unicorn/no-this-assignment': 'warn',
'unicorn/prefer-spread': 'warn',
'unicorn/catch-error-name': 'warn',
'unicorn/prefer-code-point': 'warn',
'node/no-unsupported-features': [
'error',
{
version: 8,
ignores: [
'syntax',
],
},
],
},
globals: [
'ActiveXObject',
],
};
Loading

0 comments on commit 764412a

Please sign in to comment.