Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

maximize back compat #354

Merged
merged 4 commits into from
Jun 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 24 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,28 @@
"@babel/preset-flow"
],
"plugins": [
"@babel/plugin-transform-flow-strip-types"
]
"@babel/plugin-transform-flow-strip-types",
],
"env": {
"test": {
"plugins": [
["module-resolver", {
"root": ["./__tests__"],
"alias": {
"^axobject-query/src/(.*)": "./lib/\\1",
}
}]
]
},
"development": {
"plugins": [
["module-resolver", {
"root": ["./src"],
"alias": {
"^axobject-query/src/(.*)": "./src/\\1",
}
}]
]
},
}
}
2 changes: 0 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,8 @@
],
"extends": [
"eslint:recommended",
"plugin:jest/recommended"
],
"env": {
"mocha": true,
"node": true
}
}
Expand Down
73 changes: 22 additions & 51 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,75 +6,46 @@ on:
- "!dependabot/**"
pull_request:
workflow_dispatch:

jobs:
jest:
name: Jest (Node v${{ matrix.node }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node: [14, 16, 17]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load Node version ${{ matrix.node }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Npm Install
run: npm ci
- name: Run Jest
run: npm run test:ci
- name: Run Coveralls
uses: coverallsapp/github-action@1.1.3
if: matrix.node == '16'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./reports/lcov.info
tests:
uses: ljharb/actions/.github/workflows/node.yml@main
with:
range: '>= 0.8'
type: majors
build-command: npm run build:tests
build-output-dir: __tests-built__,lib
ljharb marked this conversation as resolved.
Show resolved Hide resolved
command: npm run tests-built

flow:
name: Flow type checking
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load Node
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this do that's different from the standard actions/setup-node?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It supports a wider range of node versions, and handles a lot of edge cases for npm installing in older ones. It also uses nvm to install node, and nvm install-latest-npm, which is the only way I'm aware of to reliably get the latest possible working version of npm on older nodes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easy way to sneak a backdoor in lol

with:
cache: npm
- name: Npm Install
run: npm ci
use-npm-ci: true
- name: Flow type check
run: npm run flow

eslint:
name: ESLint (Node v${{ matrix.node }})
name: ESLint
runs-on: ubuntu-latest
strategy:
matrix:
node: [16]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load Node version ${{ matrix.node }}
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
with:
node-version: ${{ matrix.node }}
cache: npm
- name: Npm Install
run: npm ci
use-npm-ci: true
- name: Run ESLint
run: npm run lint

diff-breakUpAriaJSON:
name: Compare JSON to src output
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Load Node version
uses: actions/setup-node@v3
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
with:
cache: npm
- name: Npm Install
run: npm ci
use-npm-ci: true
- name: Run diff check for the breakUpAriaJSON script
run: node scripts/buildModelModules.js && git diff --exit-code -- src
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ node_modules/
lib/
reports/
docs/
.nyc_output/
coverage/
__tests-built__/
13 changes: 13 additions & 0 deletions .nycrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"all": true,
"check-coverage": false,
"reporter": ["text-summary", "text", "html", "json"],
"lines": 86,
"statements": 85.93,
"functions": 82.43,
"branches": 76.06,
"exclude": [
"coverage",
"test"
]
}
272 changes: 143 additions & 129 deletions __tests__/src/AXObjectElementMap-test.js

Large diffs are not rendered by default.

Loading
Loading