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

fix: bump minimum Node version to 16.17 #3339

Merged
merged 6 commits into from
Sep 10, 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
45 changes: 45 additions & 0 deletions .changeset/twelve-buses-prove.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
"@rnx-kit/metro-plugin-cyclic-dependencies-detector": major
"@rnx-kit/react-native-error-trace-decorator": major
"@rnx-kit/esbuild-plugin-import-path-remapper": major
"@rnx-kit/babel-plugin-import-path-remapper": major
"@rnx-kit/babel-preset-metro-react-native": major
"@rnx-kit/metro-plugin-duplicates-checker": major
"@rnx-kit/react-native-test-app-msal": major
"@rnx-kit/react-native-lazy-index": major
"@rnx-kit/third-party-notices": major
"@rnx-kit/tools-react-native": major
"@rnx-kit/typescript-service": major
"@rnx-kit/commitlint-lite": major
"@rnx-kit/metro-serializer": major
"@rnx-kit/tools-language": major
"@rnx-kit/metro-service": major
"@rnx-kit/metro-config": major
"@rnx-kit/bundle-diff": major
"@rnx-kit/align-deps": major
"@rnx-kit/tools-node": major
"@rnx-kit/tsconfig": major
"@rnx-kit/console": major
"@react-native-webapis/battery-status": minor
"@react-native-webapis/web-storage": minor
"@rnx-kit/esbuild-bundle-analyzer": minor
"@rnx-kit/metro-serializer-esbuild": minor
"@rnx-kit/rn-changelog-generator": minor
"@rnx-kit/metro-plugin-typescript": minor
"@rnx-kit/metro-resolver-symlinks": minor
"@rnx-kit/react-native-auth": minor
"@rnx-kit/react-native-host": minor
"@rnx-kit/patcher-rnmacos": minor
"@rnx-kit/tools-filesystem": minor
"@rnx-kit/tools-workspaces": minor
"@rnx-kit/eslint-plugin": minor
"@rnx-kit/tools-android": minor
"@rnx-kit/tools-windows": minor
"@rnx-kit/jest-preset": minor
"@rnx-kit/tools-apple": minor
"@rnx-kit/tools-shell": minor
"@rnx-kit/polyfills": minor
"@rnx-kit/config": minor
---

Bump minimum Node version to 16.17
6 changes: 3 additions & 3 deletions incubator/@react-native-webapis/battery-status/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/@react-native-webapis/battery-status"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"build": "rnx-kit-scripts build",
"format": "rnx-kit-scripts format",
Expand All @@ -53,5 +50,8 @@
"react-native": "^0.75.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"experimental": true
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "@rnx-kit/tsconfig/tsconfig.json",
"compilerOptions": {
"lib": ["ES2021", "DOM"]
},
"include": ["src"]
}
3 changes: 3 additions & 0 deletions incubator/@react-native-webapis/web-storage/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "@rnx-kit/tsconfig/tsconfig.json",
"compilerOptions": {
"lib": ["ES2021", "DOM"]
},
"include": ["src"]
}
3 changes: 3 additions & 0 deletions incubator/build-plugin-firebase/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=18.12"
},
"experimental": true
}
2 changes: 1 addition & 1 deletion incubator/commitlint-lite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"typescript": "^5.0.0"
},
"engines": {
"node": ">=14.18"
"node": ">=16.17"
},
"experimental": true
}
6 changes: 3 additions & 3 deletions incubator/esbuild-bundle-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/esbuild-bundle-analyzer"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"prepare": "echo '⚠️ esbuild-bundle-analyzer is EXPERIMENTAL - USE WITH CAUTION ⚠️'",
"build": "rnx-kit-scripts build",
Expand Down Expand Up @@ -53,6 +50,9 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
},
Expand Down
3 changes: 3 additions & 0 deletions incubator/ignore/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,8 @@
"type": "git",
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/ignore"
},
"engines": {
"node": ">=16.17"
}
}
6 changes: 3 additions & 3 deletions incubator/patcher-rnmacos/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/patcher-rnmacos"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"prepare": "echo '⚠️ patcher-rnmacos is EXPERIMENTAL - USE WITH CAUTION ⚠️'",
"build": "rnx-kit-scripts build",
Expand All @@ -50,6 +47,9 @@
"istextorbinary": "^3.3.0",
"winston": "^3.2.1"
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
}
Expand Down
6 changes: 3 additions & 3 deletions incubator/polyfills/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/polyfills"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"build": "rnx-kit-scripts build",
"format": "rnx-kit-scripts format",
Expand Down Expand Up @@ -56,6 +53,9 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"rnx-kit": {
"alignDeps": {
"requirements": {
Expand Down
6 changes: 3 additions & 3 deletions incubator/react-native-error-trace-decorator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/react-native-error-trace-decorator"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"build": "rnx-kit-scripts build",
"format": "rnx-kit-scripts format",
Expand All @@ -47,6 +44,9 @@
"source-map": "^0.5.6",
"yargs": "^16.0.0"
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
},
Expand Down
3 changes: 3 additions & 0 deletions incubator/react-native-test-app-msal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,8 @@
"@rnx-kit/react-native-auth": {
"optional": true
}
},
"engines": {
"node": ">=16.17"
}
}
6 changes: 3 additions & 3 deletions incubator/rn-changelog-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@
"url": "https://github.com/microsoft/rnx-kit",
"directory": "incubator/rn-changelog-generator"
},
"engines": {
"node": ">=14.15"
},
"scripts": {
"prepare": "echo '⚠️ rn-changelog-generator is EXPERIMENTAL - USE WITH CAUTION ⚠️'",
"build": "rnx-kit-scripts build",
Expand All @@ -49,6 +46,9 @@
"typescript": "^5.0.0",
"yargs": "^16.0.0"
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
}
Expand Down
2 changes: 1 addition & 1 deletion packages/align-deps/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
"yargs": "^16.0.0"
},
"engines": {
"node": ">=12.13"
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
Expand Down
3 changes: 3 additions & 0 deletions packages/babel-plugin-import-path-remapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,8 @@
"eslint": "^8.56.0",
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
}
}
3 changes: 3 additions & 0 deletions packages/babel-preset-metro-react-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"depcheck": {
"ignoreMatches": [
"@babel/plugin-transform-classes",
Expand Down
3 changes: 3 additions & 0 deletions packages/bundle-diff/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@
"eslint": "^8.56.0",
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
}
}
3 changes: 3 additions & 0 deletions packages/config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,8 @@
"metro": "^0.80.3",
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
}
}
3 changes: 3 additions & 0 deletions packages/console/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,8 @@
"eslint": "^8.56.0",
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
}
}
3 changes: 3 additions & 0 deletions packages/esbuild-plugin-import-path-remapper/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"depcheck": {
"ignorePatterns": [
"/test/__fixtures__/*"
Expand Down
3 changes: 3 additions & 0 deletions packages/eslint-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,8 @@
},
"devDependencies": {
"prettier": "^3.0.0"
},
"engines": {
"node": ">=16.17"
}
}
2 changes: 1 addition & 1 deletion packages/eslint-plugin/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@
"typescript": "^5.0.0"
},
"engines": {
"node": ">=12.13"
"node": ">=16.17"
},
"depcheck": {
"ignoreMatches": [
Expand Down
3 changes: 3 additions & 0 deletions packages/jest-preset/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,9 @@
"react"
]
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "./private/jest-preset.js"
}
Expand Down
3 changes: 3 additions & 0 deletions packages/metro-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@
"type-fest": "^4.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"depcheck": {
"ignoreMatches": [
"@babel/core",
Expand Down
6 changes: 3 additions & 3 deletions packages/metro-config/src/assetPluginForMonorepos.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* @returns {AssetData}
*/
function assetPlugin(assetData) {
assetData.httpServerLocation = assetData.httpServerLocation.replace(
/\.\.\//g,
assetData.httpServerLocation = assetData.httpServerLocation.replaceAll(
"../",
"@@/"
);
return assetData;
Expand Down Expand Up @@ -66,7 +66,7 @@ function enhanceMiddleware(middleware, server) {
return (req, res, next) => {
const { url } = req;
if (url && url.startsWith("/assets/")) {
req.url = url.replace(/@@\//g, "../");
req.url = url.replaceAll("@@/", "../");
}
// @ts-ignore Type differs depending on Node version
return middleware(req, res, next);
Expand Down
4 changes: 3 additions & 1 deletion packages/metro-config/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ function resolveUniqueModule(packageName, searchStartDir) {
// - path/to/node_modules/prop-types
const owningDir = path.dirname(result.slice(0, -packageName.length));
const escapedPath = owningDir.replace(/[+.\\]/g, "\\$&");
const escapedPackageName = path.normalize(packageName).replace(/\\/g, "\\\\");
const escapedPackageName = path
.normalize(packageName)
.replaceAll("\\", "\\\\");

const exclusionRE = new RegExp(
`(?<!${escapedPath})\\${path.sep}node_modules\\${path.sep}${escapedPackageName}\\${path.sep}.*`
Expand Down
2 changes: 1 addition & 1 deletion packages/metro-config/test/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ describe("@rnx-kit/metro-config", () => {
/__fixtures__[/\\]awesome-repo[/\\]packages[/\\]t-800$/,
];
const folders = defaultWatchFolders()
.map((path) => path.replace(/\\/g, "/"))
.map((path) => path.replaceAll("\\", "/"))
.sort();

for (let i = 0; i < folders.length; ++i) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,8 @@
"metro": "^0.80.3",
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
}
}
3 changes: 3 additions & 0 deletions packages/metro-plugin-duplicates-checker/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@
"prettier": "^3.0.0",
"typescript": "^5.0.0"
},
"engines": {
"node": ">=16.17"
},
"jest": {
"preset": "@rnx-kit/jest-preset/private"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ type ModuleInfo = {
export type ModuleMap = Record<string, Record<string, Set<string>>>;

export function normalizePath(p: string): string {
return p.replace(/webpack:\/\/\//g, "").replace(/[\\]+/g, "/");
return p.replaceAll("webpack:///", "").replace(/[\\]+/g, "/");
}

export function resolveModule(source: string): ModuleInfo {
Expand Down
Loading