Skip to content

Commit

Permalink
Bumps Node requirements from 14 to 18 (#5445)
Browse files Browse the repository at this point in the history
**What's the problem this PR addresses?**

We're still supporting Node 14, but it has reached end of life. Node 16
is still maintained, but will reach an early end of life in October, so
I think it's reasonable to drop it now rather than publish a major
release just for that.

**How did you fix it?**

Bumps the requirements from `14.16` to `18.12` (first LTS from the 18.x
release line).

**Checklist**
<!--- Don't worry if you miss something, chores are automatically
tested. -->
<!--- This checklist exists to help you remember doing the chores when
you submit a PR. -->
<!--- Put an `x` in all the boxes that apply. -->
- [x] I have read the [Contributing
Guide](https://yarnpkg.com/advanced/contributing).

<!-- See
https://yarnpkg.com/advanced/contributing#preparing-your-pr-to-be-released
for more details. -->
<!-- Check with `yarn version check` and fix with `yarn version check
-i` -->
- [x] I have set the packages that need to be released for my changes to
be effective.

<!-- The "Testing chores" workflow validates that your PR follows our
guidelines. -->
<!-- If it doesn't pass, click on it to see details as to what your PR
might be missing. -->
- [x] I will check that all automated PR checks pass before the PR gets
reviewed.

---------

Co-authored-by: Kristoffer K <[email protected]>
  • Loading branch information
arcanis and merceyz authored Jun 24, 2023
1 parent 69ecb99 commit a006471
Show file tree
Hide file tree
Showing 76 changed files with 194 additions and 316 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/integration-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,19 +201,20 @@ jobs:
fail-fast: false
matrix:
# We run the ubuntu tests on multiple Node versions with 2 shards since they're the fastest.
node: [14, 16, 18, 19]
# https://github.com/nodejs/node/issues/48444
node: [18, 19, 20.2]
platform: [ubuntu-latest]
shard: ['1/2', '2/2']
# We run the rest of the tests on the minimum Node version we support with 3 shards.
include:
# Windows tests
- {node: 14, platform: windows-latest, shard: 1/3}
- {node: 14, platform: windows-latest, shard: 2/3}
- {node: 14, platform: windows-latest, shard: 3/3}
- {node: 18, platform: windows-latest, shard: 1/3}
- {node: 18, platform: windows-latest, shard: 2/3}
- {node: 18, platform: windows-latest, shard: 3/3}
# macOS tests
- {node: 14, platform: macos-latest, shard: 1/3}
- {node: 14, platform: macos-latest, shard: 2/3}
- {node: 14, platform: macos-latest, shard: 3/3}
- {node: 18, platform: macos-latest, shard: 1/3}
- {node: 18, platform: macos-latest, shard: 2/3}
- {node: 18, platform: macos-latest, shard: 3/3}

name: '${{matrix.platform}} w/ Node.js ${{matrix.node}}.x (${{matrix.shard}})'
runs-on: ${{matrix.platform}}
Expand Down
92 changes: 44 additions & 48 deletions .pnp.cjs

Large diffs are not rendered by default.

65 changes: 15 additions & 50 deletions .pnp.loader.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 41 additions & 0 deletions .yarn/versions/da27efee.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
releases:
"@yarnpkg/builder": major
"@yarnpkg/cli": major
"@yarnpkg/core": major
"@yarnpkg/doctor": major
"@yarnpkg/eslint-config": major
"@yarnpkg/extensions": major
"@yarnpkg/fslib": major
"@yarnpkg/libui": major
"@yarnpkg/libzip": major
"@yarnpkg/nm": major
"@yarnpkg/parsers": major
"@yarnpkg/plugin-compat": major
"@yarnpkg/plugin-constraints": major
"@yarnpkg/plugin-dlx": major
"@yarnpkg/plugin-essentials": major
"@yarnpkg/plugin-exec": major
"@yarnpkg/plugin-file": major
"@yarnpkg/plugin-git": major
"@yarnpkg/plugin-github": major
"@yarnpkg/plugin-http": major
"@yarnpkg/plugin-init": major
"@yarnpkg/plugin-interactive-tools": major
"@yarnpkg/plugin-link": major
"@yarnpkg/plugin-nm": major
"@yarnpkg/plugin-npm": major
"@yarnpkg/plugin-npm-cli": major
"@yarnpkg/plugin-pack": major
"@yarnpkg/plugin-patch": major
"@yarnpkg/plugin-pnp": major
"@yarnpkg/plugin-pnpm": major
"@yarnpkg/plugin-stage": major
"@yarnpkg/plugin-typescript": major
"@yarnpkg/plugin-version": major
"@yarnpkg/plugin-workspace-tools": major
"@yarnpkg/pnp": major
"@yarnpkg/pnpify": major
"@yarnpkg/sdks": major
"@yarnpkg/shell": major
"@yarnpkg/types": major
vscode-zipfs: major
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Yarn now accepts sponsorships! Please give a look at our [OpenCollective](https:

### **Major Changes**

- With Node.js 16's End of Life [approaching fast](https://nodejs.org/en/blog/announcements/nodejs16-eol), we dropped support for Node.js versions lower than 18.12.
- Some important defaults have changed:
- `yarn set version` will now skip generating the `yarnPath` configuration on new projects if it detects you're using [Corepack](https://nodejs.org/api/corepack.html).
- `yarn init` will no longer use zero-install by default.
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module.exports = {
targets: {
node: `14.15.0`,
node: `18.12.0`,
},
presets: [
[`@babel/preset-env`, {modules: `commonjs`}],
Expand Down
2 changes: 1 addition & 1 deletion constraints.pro
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ gen_enforced_field(WorkspaceCwd, 'license', 'BSD-2-Clause').

% This rule will enforce that all packages must have an correct engines.node field
% Keep in sync with the range inside packages/yarnpkg-cli/sources/main.ts
gen_enforced_field(WorkspaceCwd, 'engines.node', '>=14.15.0').
gen_enforced_field(WorkspaceCwd, 'engines.node', '>=18.12.0').

% Required to make the package work with the GitHub Package Registry
gen_enforced_field(WorkspaceCwd, 'repository.type', 'git').
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,6 @@
"directory": "."
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
2 changes: 1 addition & 1 deletion packages/acceptance-tests/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"directory": "packages/acceptance-tests"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
2 changes: 1 addition & 1 deletion packages/acceptance-tests/pkg-tests-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"directory": "packages/acceptance-tests/pkg-tests-core"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"dependencies": {
"typanion": "^3.12.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/acceptance-tests/pkg-tests-fixtures/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@
"directory": "packages/acceptance-tests/pkg-tests-fixtures"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
2 changes: 1 addition & 1 deletion packages/acceptance-tests/pkg-tests-specs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"tslib": "^2.4.0"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
30 changes: 3 additions & 27 deletions packages/acceptance-tests/pkg-tests-specs/sources/pnp-esm.test.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import {Filename, npath, ppath, xfs} from '@yarnpkg/fslib';
import * as loaderFlags from '@yarnpkg/pnp/sources/esm-loader/loaderFlags';
import {pathToFileURL} from 'url';

describe(`Plug'n'Play - ESM`, () => {
Expand Down Expand Up @@ -219,30 +218,7 @@ describe(`Plug'n'Play - ESM`, () => {
),
);

(loaderFlags.HAS_UNFLAGGED_JSON_MODULES === false ? test : test.skip)(
`it should not resolve JSON modules without --experimental-json-modules`,
makeTemporaryEnv(
{
type: `module`,
},
async ({path, run, source}) => {
await expect(run(`install`)).resolves.toMatchObject({code: 0});

await xfs.writeFilePromise(
ppath.join(path, `index.js`),
`import './foo.json';`,
);
await xfs.writeFilePromise(ppath.join(path, `foo.json`), `{"name": "foo"}`);

await expect(run(`node`, `./index.js`)).rejects.toMatchObject({
code: 1,
stderr: expect.stringContaining(`Unknown file extension`),
});
},
),
);

(loaderFlags.HAS_UNFLAGGED_JSON_MODULES ? test : test.skip)(
test(
`it should not resolve JSON modules without an import assertion`,
makeTemporaryEnv(
{
Expand All @@ -265,7 +241,7 @@ describe(`Plug'n'Play - ESM`, () => {
),
);

(loaderFlags.HAS_UNFLAGGED_JSON_MODULES ? test : test.skip)(
test(
`it should resolve JSON modules with an import assertion`,
makeTemporaryEnv(
{
Expand Down Expand Up @@ -972,7 +948,7 @@ describe(`Plug'n'Play - ESM`, () => {
),
);

(loaderFlags.ALLOWS_NON_FILE_PARENT ? test : test.skip)(
test(
`it should allow importing files regardless of parent URL`,
makeTemporaryEnv(
{
Expand Down
2 changes: 1 addition & 1 deletion packages/docusaurus/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
]
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"license": "BSD-2-Clause",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,6 @@
"directory": "packages/eslint-config"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"react": "*"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"license": "BSD-2-Clause",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby/gatsby-plugin-clipanion-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"gatsby": "^3.7.0"
},
"engines": {
"node": ">=14.15.0"
"node": ">=18.12.0"
},
"license": "BSD-2-Clause",
"repository": {
Expand Down
Loading

0 comments on commit a006471

Please sign in to comment.