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

feat: drop Node 4, 6, 8, 10, 12, 14 & 16 support #3091

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
65 changes: 7 additions & 58 deletions .github/workflows/native-wsl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
fail-fast: false
matrix:
os: [windows-2019]
node-version: [18, 16, 14, 12, 10, 8, 6, 4]
node-version: [22, 20, 18]
configuration: [wsl, native]

steps:
Expand All @@ -30,80 +30,29 @@ jobs:
if: matrix.configuration == 'wsl'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/master/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
nvm install --latest-npm ${{ matrix.node-version }}
if [ ${{ matrix.node-version }} -ge 4 ] && [ ${{ matrix.node-version }} -lt 6 ]; then
npm install eslint@4 --no-save --ignore-scripts
npm install
npm install [email protected] --no-save
npm uninstall @angular-eslint/template-parser @typescript-eslint/parser --no-save
fi
if [ ${{ matrix.node-version }} -ge 6 ] && [ ${{ matrix.node-version }} -lt 7 ]; then
npm install eslint@5 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install [email protected] @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 7 ] && [ ${{ matrix.node-version }} -lt 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm install [email protected] typescript-eslint-parser@20 --no-save
npm uninstall @angular-eslint/template-parser --no-save
fi
if [ ${{ matrix.node-version }} -eq 8 ]; then
npm install eslint@6 --no-save --ignore-scripts
npm install
npm uninstall @angular-eslint/template-parser --no-save
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -gt 8 ] && [ ${{ matrix.node-version }} -lt 10 ]; then
npm install eslint@7 --no-save --ignore-scripts
npm install
npm install @typescript-eslint/parser@3 --no-save
fi
if [ ${{ matrix.node-version }} -ge 10 ] && [ ${{ matrix.node-version }} -lt 12 ]; then
npm install
npm install @typescript-eslint/parser@4 --no-save
fi
if [ ${{ matrix.node-version }} -ge 12 ]; then
npm install
fi
npm install
npm run copy-metafiles
npm run pretest
npm run tests-only
- name: install dependencies for node <= 10
if: matrix.node-version <= '10' && matrix.configuration == 'native'
run: |
npm install --legacy-peer-deps
npm install eslint@7 --no-save
- name: Install dependencies for node > 10
if: matrix.node-version > '10' && matrix.configuration == 'native'
- name: Install dependencies in Native
if: matrix.configuration == 'native'
run: npm install

- name: install the latest version of nyc
- name: install the latest version of nyc in Native
if: matrix.configuration == 'native'
run: npm install nyc@latest --no-save

- name: copy metafiles for node <= 8
if: matrix.node-version <= 8 && matrix.configuration == 'native'
env:
ESLINT_VERSION: 6
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
- name: copy metafiles for Node > 8
if: matrix.node-version > 8 && matrix.configuration == 'native'
- name: copy metafiles in Native
if: matrix.configuration == 'native'
env:
ESLINT_VERSION: 7
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
run: |
npm run copy-metafiles
bash ./tests/dep-time-travel.sh 2>&1
Expand Down
160 changes: 0 additions & 160 deletions .github/workflows/node-4+.yml

This file was deleted.

85 changes: 85 additions & 0 deletions .github/workflows/node.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
name: 'Tests: node.js'

on: [pull_request, push]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}

permissions:
contents: read

jobs:
matrix:
runs-on: ubuntu-latest
outputs:
latest: ${{ steps.set-matrix.outputs.requireds }}
minors: ${{ steps.set-matrix.outputs.optionals }}
steps:
- uses: ljharb/actions/node/matrix@main
id: set-matrix
with:
versionsAsRoot: true
type: majors
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'

latest:
needs: [matrix]
name: 'majors'
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os:
- ubuntu-latest
- macos-latest
node-version: ${{ fromJson(needs.matrix.outputs.latest) }}
eslint:
- 9
- 8
- 7
- 6
- 5
- 4
- 3
- 2
include:
- node-version: 'lts/*'
os: ubuntu-latest
eslint: 7
env:
TS_PARSER: 4
- node-version: 'lts/*'
os: ubuntu-latest
eslint: 7
env:
TS_PARSER: 3
- node-version: 'lts/*'
os: ubuntu-latest
eslint: 7
env:
TS_PARSER: 2

steps:
- uses: actions/checkout@v4
- uses: ljharb/actions/node/install@main
continue-on-error: false
name: 'nvm install ${{ matrix.node-version }} && npm install, with eslint ${{ matrix.eslint }}'
env:
NPM_CONFIG_LEGACY_PEER_DEPS: false
ESLINT_VERSION: ${{ matrix.eslint }}
with:
node-version: ${{ matrix.node-version }}
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh
skip-ls-check: true
- run: npm run pretest
- run: npm run tests-only
- uses: codecov/[email protected]

node:
name: 'node 18+'
needs: [latest]
runs-on: ubuntu-latest
steps:
- run: 'echo tests completed'
5 changes: 2 additions & 3 deletions .github/workflows/packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
id: set-matrix
with:
type: 'majors'
preset: '>= 6' # preset: '>=4' # see https://github.com/import-js/eslint-plugin-import/issues/2053
preset: '^18.18.0 || ^20.9.0 || >=21.1.0'
versionsAsRoot: true

tests:
Expand All @@ -46,9 +46,8 @@ jobs:
- uses: ljharb/actions/node/install@main
name: 'nvm install ${{ matrix.node-version }} && npm install'
env:
NPM_CONFIG_LEGACY_PEER_DEPS: ${{ matrix.node-version == 11 && false || true }}
NPM_CONFIG_LEGACY_PEER_DEPS: false
ESLINT_VERSION: ${{ matrix.eslint }}
TRAVIS_NODE_VERSION: ${{ matrix.node-version }}
with:
node-version: ${{ matrix.node-version }}
after_install: npm run copy-metafiles && ./tests/dep-time-travel.sh && cd ${{ matrix.package }} && npm install
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"version": "2.31.0",
"description": "Import with sanity.",
"engines": {
"node": ">=4"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"main": "lib/index.js",
"directories": {
Expand Down
3 changes: 3 additions & 0 deletions resolvers/node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"chai": "^3.5.0",
"mocha": "^3.5.3",
"nyc": "^11.9.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
2 changes: 1 addition & 1 deletion resolvers/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,6 @@
"webpack": "https://gist.github.com/ljharb/9cdb687f3806f8e6cb8a365d0b7840eb"
},
"engines": {
"node": ">= 6"
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
}
}
Loading