Skip to content

Commit

Permalink
[babel 8] Require Node.js ^16.20.0 || ^18.16.0 || >=20.0.0 (#15585)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Jun 1, 2023
1 parent 02bacf8 commit ecc819b
Show file tree
Hide file tree
Showing 162 changed files with 893 additions and 132 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Expand Up @@ -290,10 +290,10 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js 14.17
- name: Use Node.js 16.20
uses: actions/setup-node@v3
with:
node-version: "14.17" # Node.js 14.17 is the first LTS supported by Babel 8
node-version: "16.20" # Node.js 16.20 is the first LTS supported by Babel 8
cache: "yarn"
- name: Install
run: |
Expand Down
2 changes: 1 addition & 1 deletion babel.config.js
Expand Up @@ -69,7 +69,7 @@ module.exports = function (api) {

let transformRuntimeOptions;

const nodeVersion = bool(process.env.BABEL_8_BREAKING) ? "14.17" : "6.9";
const nodeVersion = bool(process.env.BABEL_8_BREAKING) ? "16.20" : "6.9";
// The vast majority of our src files are modules, but we use
// unambiguous to keep things simple until we get around to renaming
// the modules to be more easily distinguished from CommonJS
Expand Down
Expand Up @@ -32,7 +32,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
Expand Up @@ -32,7 +32,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
10 changes: 10 additions & 0 deletions constraints.pro
Expand Up @@ -29,6 +29,7 @@ gen_enforced_field(WorkspaceCwd, 'publishConfig.access', null) :-
workspace_field(WorkspaceCwd, 'private', true).

% Enforces the engines.node field for all workspaces except '@babel/eslint*'
% TODO(Babel 8): Enforce '^18.16.0 || >=20.0.0' for al workspaces
gen_enforced_field(WorkspaceCwd, 'engines.node', '>=6.9.0') :-
\+ workspace_field(WorkspaceCwd, 'private', true),
% Get the workspace name
Expand All @@ -47,6 +48,15 @@ gen_enforced_field(WorkspaceCwd, 'engines.node', '^10.13.0 || ^12.13.0 || >=14.0
% Only target '@babel/eslint*' workspaces
atom_concat('@babel/eslint', _, WorkspaceIdent).

% (Babel 8) Enforces the engines.node field for all workspaces except private ones
gen_enforced_field(WorkspaceCwd, 'conditions.BABEL_8_BREAKING.0.engines.node', '^16.20.0 || ^18.16.0 || >=20.0.0') :-
\+ workspace_field(WorkspaceCwd, 'private', true).

% Ensure that the BABEL_8_BREAKING condition has both 'yes' and 'no' cases
gen_enforced_field(WorkspaceCwd, 'conditions.BABEL_8_BREAKING.1', {}) :-
workspace_field(WorkspaceCwd, 'conditions.BABEL_8_BREAKING.0', _),
\+ workspace_field(WorkspaceCwd, 'conditions.BABEL_8_BREAKING.1', _).

% Removes the 'engines.node' field from private workspaces
gen_enforced_field(WorkspaceCwd, 'engines.node', null) :-
workspace_field(WorkspaceCwd, 'private', true).
Expand Down
10 changes: 10 additions & 0 deletions eslint/babel-eslint-parser/package.json
Expand Up @@ -40,5 +40,15 @@
"@babel/core": "workspace:^",
"dedent": "^0.7.0",
"eslint": "^8.22.0"
},
"conditions": {
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
10 changes: 10 additions & 0 deletions eslint/babel-eslint-plugin-development/package.json
Expand Up @@ -32,5 +32,15 @@
"homepage": "https://babel.dev/",
"devDependencies": {
"eslint": "^8.22.0"
},
"conditions": {
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
10 changes: 10 additions & 0 deletions eslint/babel-eslint-plugin/package.json
Expand Up @@ -42,5 +42,15 @@
"devDependencies": {
"clone-deep": "^4.0.1",
"eslint": "^8.22.0"
},
"conditions": {
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
6 changes: 5 additions & 1 deletion packages/babel-cli/package.json
Expand Up @@ -56,7 +56,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-code-frame/package.json
Expand Up @@ -26,7 +26,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
5 changes: 4 additions & 1 deletion packages/babel-compat-data/package.json
Expand Up @@ -18,7 +18,10 @@
"./plugins": "./plugins.js",
"./native-modules": "./native-modules.js",
"./overlapping-plugins": "./overlapping-plugins.js",
"./plugin-bugfixes": "./plugin-bugfixes.js"
"./plugin-bugfixes": "./plugin-bugfixes.js",
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
null
]
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-core/package.json
Expand Up @@ -88,6 +88,9 @@
"@babel/preset-typescript": {
"optional": true
}
},
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-generator/package.json
Expand Up @@ -35,7 +35,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-annotate-as-pure/package.json
Expand Up @@ -22,7 +22,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
Expand Up @@ -25,7 +25,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-builder-react-jsx/package.json
Expand Up @@ -27,7 +27,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
8 changes: 8 additions & 0 deletions packages/babel-helper-check-duplicate-nodes/package.json
Expand Up @@ -40,6 +40,14 @@
"type": "module"
},
null
],
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
8 changes: 8 additions & 0 deletions packages/babel-helper-compilation-targets/package.json
Expand Up @@ -47,6 +47,14 @@
"type": "module"
},
null
],
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
Expand Up @@ -42,7 +42,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
Expand Up @@ -34,7 +34,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
8 changes: 8 additions & 0 deletions packages/babel-helper-environment-visitor/package.json
Expand Up @@ -32,6 +32,14 @@
"type": "module"
},
null
],
"BABEL_8_BREAKING": [
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{}
]
}
}
6 changes: 5 additions & 1 deletion packages/babel-helper-fixtures/package.json
Expand Up @@ -25,7 +25,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-function-name/package.json
Expand Up @@ -23,7 +23,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-hoist-variables/package.json
Expand Up @@ -26,7 +26,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
Expand Up @@ -25,7 +25,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-module-imports/package.json
Expand Up @@ -26,7 +26,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-module-transforms/package.json
Expand Up @@ -29,7 +29,11 @@
},
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
6 changes: 5 additions & 1 deletion packages/babel-helper-optimise-call-expression/package.json
Expand Up @@ -26,7 +26,11 @@
"author": "The Babel Team (https://babel.dev/team)",
"conditions": {
"BABEL_8_BREAKING": [
null,
{
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
"exports": null
}
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-helper-plugin-test-runner/package.json
Expand Up @@ -43,6 +43,9 @@
"default": "./lib/index.js"
},
"./package.json": "./package.json"
},
"engines": {
"node": "^16.20.0 || ^18.16.0 || >=20.0.0"
}
},
{
Expand Down

0 comments on commit ecc819b

Please sign in to comment.