From 1fc5ed41b765ed8b49fee5b0bf1eaf7aa9a21de9 Mon Sep 17 00:00:00 2001 From: Norbert de Langen Date: Tue, 10 Oct 2023 14:58:34 +0200 Subject: [PATCH] upgrade to node18 in a backwards compatible way --- .circleci/config.yml | 4 +- .github/workflows/generate-sandboxes-main.yml | 2 +- .github/workflows/generate-sandboxes-next.yml | 2 +- .github/workflows/tests-unit.yml | 7 +- .nvmrc | 2 +- code/addons/interactions/package.json | 2 +- code/builders/builder-vite/package.json | 2 +- code/builders/builder-webpack5/package.json | 2 +- code/frameworks/angular/package.json | 2 +- code/frameworks/html-vite/package.json | 2 +- code/frameworks/html-webpack5/package.json | 2 +- code/frameworks/nextjs/package.json | 2 +- code/frameworks/preact-vite/package.json | 2 +- code/frameworks/preact-webpack5/package.json | 2 +- code/frameworks/react-vite/package.json | 2 +- code/frameworks/react-webpack5/package.json | 2 +- code/frameworks/server-webpack5/package.json | 2 +- code/frameworks/svelte-vite/package.json | 2 +- code/frameworks/sveltekit/package.json | 2 +- code/frameworks/vue-webpack5/package.json | 2 +- code/frameworks/vue3-vite/package.json | 2 +- code/frameworks/vue3-webpack5/package.json | 2 +- .../web-components-vite/package.json | 2 +- .../web-components-webpack5/package.json | 2 +- .../fixes/nodejs-requirement.test.ts | 5 ++ code/lib/cli/src/link.ts | 2 +- code/lib/core-common/package.json | 2 +- code/lib/core-server/package.json | 2 +- code/lib/core-webpack/package.json | 2 +- code/lib/theming/package.json | 2 +- code/lib/types/package.json | 2 +- code/package.json | 4 +- code/presets/create-react-app/package.json | 2 +- code/presets/html-webpack/package.json | 2 +- code/presets/preact-webpack/package.json | 2 +- code/presets/react-webpack/package.json | 2 +- code/presets/server-webpack/package.json | 2 +- code/presets/vue-webpack/package.json | 2 +- code/presets/vue3-webpack/package.json | 2 +- .../web-components-webpack/package.json | 2 +- code/renderers/react/package.json | 2 +- code/renderers/web-components/package.json | 2 +- code/yarn.lock | 78 +++++++++---------- .../test-runner-local-build-workflow.yml.mdx | 2 +- ...-runner-with-deploy-event-workflow.yml.mdx | 2 +- scripts/.babelrc.js | 2 +- scripts/package.json | 4 +- scripts/yarn.lock | 4 +- 48 files changed, 96 insertions(+), 92 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 617cdac42c28..9b03dd3739bc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -17,7 +17,7 @@ executors: default: 'small' working_directory: /tmp/storybook docker: - - image: cimg/node:16.20.0 + - image: cimg/node:18.18.0 environment: NODE_OPTIONS: --max_old_space_size=6144 resource_class: <> @@ -30,7 +30,7 @@ executors: default: 'small' working_directory: /tmp/storybook docker: - - image: cimg/node:16.20.0-browsers + - image: cimg/node:18.18.0-browsers environment: NODE_OPTIONS: --max_old_space_size=6144 resource_class: <> diff --git a/.github/workflows/generate-sandboxes-main.yml b/.github/workflows/generate-sandboxes-main.yml index 474542495848..a99b2288cf0c 100644 --- a/.github/workflows/generate-sandboxes-main.yml +++ b/.github/workflows/generate-sandboxes-main.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' - uses: actions/checkout@v3 with: ref: main diff --git a/.github/workflows/generate-sandboxes-next.yml b/.github/workflows/generate-sandboxes-next.yml index c20f5491ef30..91515e0862e9 100644 --- a/.github/workflows/generate-sandboxes-next.yml +++ b/.github/workflows/generate-sandboxes-next.yml @@ -21,7 +21,7 @@ jobs: steps: - uses: actions/setup-node@v3 with: - node-version: 16 + node-version-file: '.nvmrc' - uses: actions/checkout@v3 with: ref: next diff --git a/.github/workflows/tests-unit.yml b/.github/workflows/tests-unit.yml index 6c355ec1714b..650d40d3ff10 100644 --- a/.github/workflows/tests-unit.yml +++ b/.github/workflows/tests-unit.yml @@ -9,19 +9,18 @@ on: jobs: build: - name: Core Unit Tests node-${{ matrix.node_version }}, ${{ matrix.os }} + name: Core Unit Tests, ${{ matrix.os }} strategy: fail-fast: false matrix: os: [windows-latest] - node_version: [16] runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 - - name: Set node version to ${{ matrix.node_version }} + - name: Set node version uses: actions/setup-node@v3 with: - node-version: ${{ matrix.node_version }} + node-version-file: '.nvmrc' - name: install and compile run: yarn task --task compile --start-from=auto --no-link - name: test diff --git a/.nvmrc b/.nvmrc index 59ea99ee63cb..4a58985bb483 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -16.20 +18.18 diff --git a/code/addons/interactions/package.json b/code/addons/interactions/package.json index 76fc4f5e7357..963a4e19e142 100644 --- a/code/addons/interactions/package.json +++ b/code/addons/interactions/package.json @@ -91,7 +91,7 @@ "@devtools-ds/object-inspector": "^1.1.2", "@storybook/jest": "next", "@storybook/testing-library": "next", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "formik": "^2.2.9", "typescript": "~4.9.3" }, diff --git a/code/builders/builder-vite/package.json b/code/builders/builder-vite/package.json index c20a8164300c..c5faa0453b67 100644 --- a/code/builders/builder-vite/package.json +++ b/code/builders/builder-vite/package.json @@ -62,7 +62,7 @@ }, "devDependencies": { "@types/express": "^4.17.13", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "glob": "^10.0.0", "rollup": "^3.20.1", "slash": "^5.0.0", diff --git a/code/builders/builder-webpack5/package.json b/code/builders/builder-webpack5/package.json index 94933ce1d438..8662e84ff190 100644 --- a/code/builders/builder-webpack5/package.json +++ b/code/builders/builder-webpack5/package.json @@ -66,7 +66,7 @@ "@storybook/preview": "workspace:*", "@storybook/preview-api": "workspace:*", "@swc/core": "^1.3.82", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/semver": "^7.3.4", "babel-loader": "^9.0.0", "babel-plugin-named-exports-order": "^0.0.2", diff --git a/code/frameworks/angular/package.json b/code/frameworks/angular/package.json index 03d6fb7bf296..e51bd6912e00 100644 --- a/code/frameworks/angular/package.json +++ b/code/frameworks/angular/package.json @@ -51,7 +51,7 @@ "@storybook/preview-api": "workspace:*", "@storybook/telemetry": "workspace:*", "@storybook/types": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", "@types/semver": "^7.3.4", diff --git a/code/frameworks/html-vite/package.json b/code/frameworks/html-vite/package.json index 892adcbdb666..912bb381d147 100644 --- a/code/frameworks/html-vite/package.json +++ b/code/frameworks/html-vite/package.json @@ -57,7 +57,7 @@ "magic-string": "^0.30.0" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3" }, "engines": { diff --git a/code/frameworks/html-webpack5/package.json b/code/frameworks/html-webpack5/package.json index 601565d96553..b7f8385597be 100644 --- a/code/frameworks/html-webpack5/package.json +++ b/code/frameworks/html-webpack5/package.json @@ -52,7 +52,7 @@ "@storybook/global": "^5.0.0", "@storybook/html": "workspace:*", "@storybook/preset-html-webpack": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/frameworks/nextjs/package.json b/code/frameworks/nextjs/package.json index 8bf4f92136a2..33fd5427e83d 100644 --- a/code/frameworks/nextjs/package.json +++ b/code/frameworks/nextjs/package.json @@ -95,7 +95,7 @@ "@storybook/preset-react-webpack": "workspace:*", "@storybook/preview-api": "workspace:*", "@storybook/react": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "css-loader": "^6.7.3", "find-up": "^5.0.0", "fs-extra": "^11.1.0", diff --git a/code/frameworks/preact-vite/package.json b/code/frameworks/preact-vite/package.json index 1090b72af835..845adbbce1b6 100644 --- a/code/frameworks/preact-vite/package.json +++ b/code/frameworks/preact-vite/package.json @@ -52,7 +52,7 @@ "@storybook/preact": "workspace:*" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3", "vite": "^4.0.0" }, diff --git a/code/frameworks/preact-webpack5/package.json b/code/frameworks/preact-webpack5/package.json index e719f43cd5ea..94d7855f70bd 100644 --- a/code/frameworks/preact-webpack5/package.json +++ b/code/frameworks/preact-webpack5/package.json @@ -51,7 +51,7 @@ "@storybook/core-common": "workspace:*", "@storybook/preact": "workspace:*", "@storybook/preset-preact-webpack": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "preact": "^10.5.13", diff --git a/code/frameworks/react-vite/package.json b/code/frameworks/react-vite/package.json index 56f36bdc4505..d790ff016b9d 100644 --- a/code/frameworks/react-vite/package.json +++ b/code/frameworks/react-vite/package.json @@ -56,7 +56,7 @@ "react-docgen": "^6.0.2" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3", "vite": "^4.0.0" }, diff --git a/code/frameworks/react-webpack5/package.json b/code/frameworks/react-webpack5/package.json index 899296f95257..c2824a89292d 100644 --- a/code/frameworks/react-webpack5/package.json +++ b/code/frameworks/react-webpack5/package.json @@ -50,7 +50,7 @@ "@storybook/builder-webpack5": "workspace:*", "@storybook/preset-react-webpack": "workspace:*", "@storybook/react": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "jest-specific-snapshot": "^8.0.0" diff --git a/code/frameworks/server-webpack5/package.json b/code/frameworks/server-webpack5/package.json index 01defb610f9e..2e45e7c5d356 100644 --- a/code/frameworks/server-webpack5/package.json +++ b/code/frameworks/server-webpack5/package.json @@ -51,7 +51,7 @@ "@storybook/core-common": "workspace:*", "@storybook/preset-server-webpack": "workspace:*", "@storybook/server": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "typescript": "~4.9.3" diff --git a/code/frameworks/svelte-vite/package.json b/code/frameworks/svelte-vite/package.json index b5e71b75978f..9e98f5a68858 100644 --- a/code/frameworks/svelte-vite/package.json +++ b/code/frameworks/svelte-vite/package.json @@ -56,7 +56,7 @@ "ts-dedent": "^2.2.0" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "svelte": "^4.0.0", "typescript": "~4.9.3", "vite": "^4.0.0" diff --git a/code/frameworks/sveltekit/package.json b/code/frameworks/sveltekit/package.json index 4e528dc944c9..99996c2ecb31 100644 --- a/code/frameworks/sveltekit/package.json +++ b/code/frameworks/sveltekit/package.json @@ -55,7 +55,7 @@ "@storybook/svelte-vite": "workspace:*" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "^4.9.3", "vite": "^4.0.0" }, diff --git a/code/frameworks/vue-webpack5/package.json b/code/frameworks/vue-webpack5/package.json index 979688d6e381..31cf2befa97e 100644 --- a/code/frameworks/vue-webpack5/package.json +++ b/code/frameworks/vue-webpack5/package.json @@ -51,7 +51,7 @@ "@storybook/core-common": "workspace:*", "@storybook/preset-vue-webpack": "workspace:*", "@storybook/vue": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "typescript": "~4.9.3", diff --git a/code/frameworks/vue3-vite/package.json b/code/frameworks/vue3-vite/package.json index 432c782b0a04..cc70a2915a25 100644 --- a/code/frameworks/vue3-vite/package.json +++ b/code/frameworks/vue3-vite/package.json @@ -55,7 +55,7 @@ "vue-docgen-api": "^4.40.0" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3", "vite": "^4.0.0" }, diff --git a/code/frameworks/vue3-webpack5/package.json b/code/frameworks/vue3-webpack5/package.json index 88830e05e559..aac61c51b0c3 100644 --- a/code/frameworks/vue3-webpack5/package.json +++ b/code/frameworks/vue3-webpack5/package.json @@ -51,7 +51,7 @@ "@storybook/core-common": "workspace:*", "@storybook/preset-vue3-webpack": "workspace:*", "@storybook/vue3": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "@vue/compiler-sfc": "3.0.0", diff --git a/code/frameworks/web-components-vite/package.json b/code/frameworks/web-components-vite/package.json index 5f9104483890..89dcc86acac8 100644 --- a/code/frameworks/web-components-vite/package.json +++ b/code/frameworks/web-components-vite/package.json @@ -54,7 +54,7 @@ "magic-string": "^0.30.0" }, "devDependencies": { - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3" }, "peerDependencies": { diff --git a/code/frameworks/web-components-webpack5/package.json b/code/frameworks/web-components-webpack5/package.json index a7c172a70388..5301efc1a31d 100644 --- a/code/frameworks/web-components-webpack5/package.json +++ b/code/frameworks/web-components-webpack5/package.json @@ -55,7 +55,7 @@ "@storybook/core-common": "workspace:*", "@storybook/preset-web-components-webpack": "workspace:*", "@storybook/web-components": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "lit": "2.3.1", diff --git a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts index d86b266b6081..721aa49772c7 100644 --- a/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts +++ b/code/lib/cli/src/automigrate/fixes/nodejs-requirement.test.ts @@ -38,6 +38,11 @@ describe('nodejs-requirement fix', () => { await expect(check({})).resolves.toBeNull(); }); + it('skips when node >= 18.0.0', async () => { + mockNodeVersion('18.0.0'); + await expect(check({})).resolves.toBeNull(); + }); + it('prompts when node <= 16.0.0', async () => { mockNodeVersion('14.0.0'); await expect(check({})).resolves.toEqual({ nodeVersion: '14.0.0' }); diff --git a/code/lib/cli/src/link.ts b/code/lib/cli/src/link.ts index 3a61eb02a147..b00b04b8035e 100644 --- a/code/lib/cli/src/link.ts +++ b/code/lib/cli/src/link.ts @@ -105,7 +105,7 @@ export const link = async ({ target, local, start }: LinkOptions) => { } // ensure that linking is possible - await exec(`yarn add @types/node@16`, { cwd: reproDir }); + await exec(`yarn add @types/node@18`, { cwd: reproDir }); if (start) { logger.info(`Running ${reproName} storybook`); diff --git a/code/lib/core-common/package.json b/code/lib/core-common/package.json index 4b7d3e777fd5..aca8375d84f2 100644 --- a/code/lib/core-common/package.json +++ b/code/lib/core-common/package.json @@ -48,7 +48,7 @@ "@storybook/node-logger": "workspace:*", "@storybook/types": "workspace:*", "@types/find-cache-dir": "^3.2.1", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/node-fetch": "^2.6.4", "@types/pretty-hrtime": "^1.0.0", "chalk": "^4.1.0", diff --git a/code/lib/core-server/package.json b/code/lib/core-server/package.json index cb7a42f3f07a..ad893185ea12 100644 --- a/code/lib/core-server/package.json +++ b/code/lib/core-server/package.json @@ -76,7 +76,7 @@ "@storybook/telemetry": "workspace:*", "@storybook/types": "workspace:*", "@types/detect-port": "^1.3.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/pretty-hrtime": "^1.0.0", "@types/semver": "^7.3.4", "better-opn": "^3.0.2", diff --git a/code/lib/core-webpack/package.json b/code/lib/core-webpack/package.json index d621ab88b06d..04497fd2cba7 100644 --- a/code/lib/core-webpack/package.json +++ b/code/lib/core-webpack/package.json @@ -47,7 +47,7 @@ "@storybook/core-common": "workspace:*", "@storybook/node-logger": "workspace:*", "@storybook/types": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "ts-dedent": "^2.0.0" }, "devDependencies": { diff --git a/code/lib/theming/package.json b/code/lib/theming/package.json index 4b4c29614b0d..40d9e5d6e435 100644 --- a/code/lib/theming/package.json +++ b/code/lib/theming/package.json @@ -60,7 +60,7 @@ "@emotion/react": "^11.10.4", "@emotion/styled": "^11.10.4", "@types/fs-extra": "^11.0.1", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "deep-object-diff": "^1.1.0", "fs-extra": "^11.1.0", "polished": "^4.2.2", diff --git a/code/lib/types/package.json b/code/lib/types/package.json index 263c3d7fcc79..37269a233f3b 100644 --- a/code/lib/types/package.json +++ b/code/lib/types/package.json @@ -52,7 +52,7 @@ "devDependencies": { "@storybook/csf": "^0.1.0", "@types/fs-extra": "^11.0.1", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3" }, "publishConfig": { diff --git a/code/package.json b/code/package.json index 2cbba9109ae0..53dbc4866166 100644 --- a/code/package.json +++ b/code/package.json @@ -205,7 +205,7 @@ "@types/express": "^4.17.11", "@types/fs-extra": "^11.0.1", "@types/lodash": "^4.14.167", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/react": "^16.14.34", "@types/react-dom": "^16.9.14", "@types/semver": "^7.3.4", @@ -288,7 +288,7 @@ }, "packageManager": "yarn@3.5.1", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" }, "collective": { "type": "opencollective", diff --git a/code/presets/create-react-app/package.json b/code/presets/create-react-app/package.json index 1fb9244d2b41..65cb01397b35 100644 --- a/code/presets/create-react-app/package.json +++ b/code/presets/create-react-app/package.json @@ -59,7 +59,7 @@ }, "devDependencies": { "@storybook/node-logger": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "typescript": "~4.9.3" }, "peerDependencies": { diff --git a/code/presets/html-webpack/package.json b/code/presets/html-webpack/package.json index 326f623663b9..9a60a82aaa59 100644 --- a/code/presets/html-webpack/package.json +++ b/code/presets/html-webpack/package.json @@ -50,7 +50,7 @@ }, "dependencies": { "@storybook/core-webpack": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "html-loader": "^3.1.0", "webpack": "5" }, diff --git a/code/presets/preact-webpack/package.json b/code/presets/preact-webpack/package.json index 3894f3c84696..39ee253465c2 100644 --- a/code/presets/preact-webpack/package.json +++ b/code/presets/preact-webpack/package.json @@ -52,7 +52,7 @@ "@babel/plugin-transform-react-jsx": "^7.22.5", "@babel/preset-typescript": "^7.22.5", "@storybook/core-webpack": "workspace:*", - "@types/node": "^16.0.0" + "@types/node": "^18.0.0" }, "devDependencies": { "preact": "^10.5.13", diff --git a/code/presets/react-webpack/package.json b/code/presets/react-webpack/package.json index 4471b944e093..332896742991 100644 --- a/code/presets/react-webpack/package.json +++ b/code/presets/react-webpack/package.json @@ -72,7 +72,7 @@ "@storybook/node-logger": "workspace:*", "@storybook/react": "workspace:*", "@storybook/react-docgen-typescript-plugin": "1.0.6--canary.9.0c3f3b7.0", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/semver": "^7.3.4", "babel-plugin-add-react-displayname": "^0.0.5", "babel-plugin-react-docgen": "^4.2.1", diff --git a/code/presets/server-webpack/package.json b/code/presets/server-webpack/package.json index 13da8091ab46..38b7a4dd53cb 100644 --- a/code/presets/server-webpack/package.json +++ b/code/presets/server-webpack/package.json @@ -58,7 +58,7 @@ "@storybook/core-webpack": "workspace:*", "@storybook/global": "^5.0.0", "@storybook/server": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "safe-identifier": "^0.4.1", "ts-dedent": "^2.0.0", "yaml-loader": "^0.8.0" diff --git a/code/presets/vue-webpack/package.json b/code/presets/vue-webpack/package.json index 0aaf1b2b48f1..08c244e55b28 100644 --- a/code/presets/vue-webpack/package.json +++ b/code/presets/vue-webpack/package.json @@ -61,7 +61,7 @@ "dependencies": { "@storybook/core-webpack": "workspace:*", "@storybook/docs-tools": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.44.23", "vue-docgen-loader": "^1.5.1", diff --git a/code/presets/vue3-webpack/package.json b/code/presets/vue3-webpack/package.json index 8368d0f7f1a8..6b2dcaf62b63 100644 --- a/code/presets/vue3-webpack/package.json +++ b/code/presets/vue3-webpack/package.json @@ -61,7 +61,7 @@ "dependencies": { "@storybook/core-webpack": "workspace:*", "@storybook/docs-tools": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "ts-loader": "^9.2.8", "vue-docgen-api": "^4.46.0", "vue-docgen-loader": "^1.5.1", diff --git a/code/presets/web-components-webpack/package.json b/code/presets/web-components-webpack/package.json index 29cca0ef340d..26ef2710ab56 100644 --- a/code/presets/web-components-webpack/package.json +++ b/code/presets/web-components-webpack/package.json @@ -56,7 +56,7 @@ "@babel/plugin-syntax-import-meta": "^7.10.4", "@babel/preset-env": "^7.22.9", "@storybook/core-webpack": "workspace:*", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "babel-loader": "^7.0.0 || ^8.0.0 || ^9.0.0", "babel-plugin-bundled-import-meta": "^0.3.1" }, diff --git a/code/renderers/react/package.json b/code/renderers/react/package.json index 2bfe26f1b76b..6578d02d65fc 100644 --- a/code/renderers/react/package.json +++ b/code/renderers/react/package.json @@ -62,7 +62,7 @@ "@storybook/types": "workspace:*", "@types/escodegen": "^0.0.6", "@types/estree": "^0.0.51", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "acorn": "^7.4.1", "acorn-jsx": "^5.3.1", "acorn-walk": "^7.2.0", diff --git a/code/renderers/web-components/package.json b/code/renderers/web-components/package.json index 1a857d6a2880..577bd14559c1 100644 --- a/code/renderers/web-components/package.json +++ b/code/renderers/web-components/package.json @@ -64,7 +64,7 @@ }, "devDependencies": { "@types/cross-spawn": "^6.0.2", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "cross-spawn": "^7.0.3", "lit": "2.3.1", "typescript": "~4.9.3", diff --git a/code/yarn.lock b/code/yarn.lock index 3c200a7a8a38..a758346ffb19 100644 --- a/code/yarn.lock +++ b/code/yarn.lock @@ -6001,7 +6001,7 @@ __metadata: "@storybook/testing-library": next "@storybook/theming": "workspace:*" "@storybook/types": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 formik: ^2.2.9 jest-mock: ^27.0.6 polished: ^4.2.2 @@ -6383,7 +6383,7 @@ __metadata: "@storybook/telemetry": "workspace:*" "@storybook/types": "workspace:*" "@types/cross-spawn": ^6.0.2 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/react": ^16.14.34 "@types/react-dom": ^16.9.14 "@types/semver": ^7.3.4 @@ -6551,7 +6551,7 @@ __metadata: "@storybook/types": "workspace:*" "@types/express": ^4.17.13 "@types/find-cache-dir": ^3.2.1 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 browser-assert: ^1.2.1 es-module-lexer: ^0.9.3 express: ^4.17.3 @@ -6592,7 +6592,7 @@ __metadata: "@storybook/preview": "workspace:*" "@storybook/preview-api": "workspace:*" "@swc/core": ^1.3.82 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/pretty-hrtime": ^1.0.0 "@types/semver": ^7.3.4 "@types/terser-webpack-plugin": ^5.2.0 @@ -6840,7 +6840,7 @@ __metadata: "@types/find-cache-dir": ^3.2.1 "@types/fs-extra": ^11.0.1 "@types/mock-fs": ^4.13.1 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/node-fetch": ^2.6.4 "@types/picomatch": ^2.3.0 "@types/pretty-hrtime": ^1.0.0 @@ -6899,7 +6899,7 @@ __metadata: "@types/compression": ^1.7.0 "@types/detect-port": ^1.3.0 "@types/ip": ^1.1.0 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/node-fetch": ^2.5.7 "@types/pretty-hrtime": ^1.0.0 "@types/semver": ^7.3.4 @@ -6942,7 +6942,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/types": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 ts-dedent: ^2.0.0 typescript: ~4.9.3 webpack: 5 @@ -7107,7 +7107,7 @@ __metadata: "@storybook/html": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/preview-web": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 languageName: unknown @@ -7122,7 +7122,7 @@ __metadata: "@storybook/global": ^5.0.0 "@storybook/html": "workspace:*" "@storybook/preset-html-webpack": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 typescript: ~4.9.3 peerDependencies: "@babel/core": "*" @@ -7317,7 +7317,7 @@ __metadata: "@types/babel__core": ^7 "@types/babel__plugin-transform-runtime": ^7 "@types/babel__preset-env": ^7 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 css-loader: ^6.7.3 find-up: ^5.0.0 fs-extra: ^11.1.0 @@ -7387,7 +7387,7 @@ __metadata: "@preact/preset-vite": ^2.0.0 "@storybook/builder-vite": "workspace:*" "@storybook/preact": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 typescript: ~4.9.3 vite: ^4.0.0 peerDependencies: @@ -7404,7 +7404,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/preact": "workspace:*" "@storybook/preset-preact-webpack": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 preact: ^10.5.13 typescript: ~4.9.3 peerDependencies: @@ -7440,7 +7440,7 @@ __metadata: "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 "@storybook/types": "workspace:*" "@types/babel__core": ^7.1.7 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 babel-plugin-react-docgen: ^4.1.0 pnp-webpack-plugin: ^1.7.0 semver: ^7.3.5 @@ -7456,7 +7456,7 @@ __metadata: resolution: "@storybook/preset-html-webpack@workspace:presets/html-webpack" dependencies: "@storybook/core-webpack": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 html-loader: ^3.1.0 typescript: ~4.9.3 webpack: 5 @@ -7472,7 +7472,7 @@ __metadata: "@babel/plugin-transform-react-jsx": ^7.22.5 "@babel/preset-typescript": ^7.22.5 "@storybook/core-webpack": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 preact: ^10.5.13 typescript: ~4.9.3 peerDependencies: @@ -7493,7 +7493,7 @@ __metadata: "@storybook/node-logger": "workspace:*" "@storybook/react": "workspace:*" "@storybook/react-docgen-typescript-plugin": 1.0.6--canary.9.0c3f3b7.0 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/semver": ^7.3.4 babel-plugin-add-react-displayname: ^0.0.5 babel-plugin-react-docgen: ^4.2.1 @@ -7522,7 +7522,7 @@ __metadata: "@storybook/core-webpack": "workspace:*" "@storybook/global": ^5.0.0 "@storybook/server": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 fs-extra: ^11.1.0 jest-specific-snapshot: ^8.0.0 safe-identifier: ^0.4.1 @@ -7557,7 +7557,7 @@ __metadata: dependencies: "@storybook/core-webpack": "workspace:*" "@storybook/docs-tools": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 ts-loader: ^9.2.8 typescript: ~4.9.3 vue: ^2.6.12 @@ -7582,7 +7582,7 @@ __metadata: dependencies: "@storybook/core-webpack": "workspace:*" "@storybook/docs-tools": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@vue/compiler-sfc": ^3.2.33 ts-loader: ^9.2.8 typescript: ~4.9.3 @@ -7607,7 +7607,7 @@ __metadata: "@babel/plugin-syntax-import-meta": ^7.10.4 "@babel/preset-env": ^7.22.9 "@storybook/core-webpack": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 babel-loader: ^7.0.0 || ^8.0.0 || ^9.0.0 babel-plugin-bundled-import-meta: ^0.3.1 lit: 2.3.1 @@ -7704,7 +7704,7 @@ __metadata: "@rollup/pluginutils": ^5.0.2 "@storybook/builder-vite": "workspace:*" "@storybook/react": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@vitejs/plugin-react": ^3.0.1 magic-string: ^0.30.0 react-docgen: ^6.0.2 @@ -7724,7 +7724,7 @@ __metadata: "@storybook/builder-webpack5": "workspace:*" "@storybook/preset-react-webpack": "workspace:*" "@storybook/react": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 jest-specific-snapshot: ^8.0.0 peerDependencies: "@babel/core": ^7.22.0 @@ -7753,7 +7753,7 @@ __metadata: "@storybook/types": "workspace:*" "@types/escodegen": ^0.0.6 "@types/estree": ^0.0.51 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/util-deprecate": ^1.0.0 acorn: ^7.4.1 acorn-jsx: ^5.3.1 @@ -7896,7 +7896,7 @@ __metadata: "@types/express": ^4.17.11 "@types/fs-extra": ^11.0.1 "@types/lodash": ^4.14.167 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/react": ^16.14.34 "@types/react-dom": ^16.9.14 "@types/semver": ^7.3.4 @@ -7998,7 +7998,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/preset-server-webpack": "workspace:*" "@storybook/server": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 typescript: ~4.9.3 peerDependencies: react: ^16.8.0 || ^17.0.0 || ^18.0.0 @@ -8058,7 +8058,7 @@ __metadata: "@storybook/node-logger": "workspace:*" "@storybook/svelte": "workspace:*" "@sveltejs/vite-plugin-svelte": ^2.4.2 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 magic-string: ^0.30.0 svelte: ^4.0.0 sveltedoc-parser: ^4.2.1 @@ -8120,7 +8120,7 @@ __metadata: "@storybook/builder-vite": "workspace:*" "@storybook/svelte": "workspace:*" "@storybook/svelte-vite": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 typescript: ^4.9.3 vite: ^4.0.0 peerDependencies: @@ -8185,7 +8185,7 @@ __metadata: "@storybook/client-logger": "workspace:*" "@storybook/global": ^5.0.0 "@types/fs-extra": ^11.0.1 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 deep-object-diff: ^1.1.0 fs-extra: ^11.1.0 memoizerific: ^1.11.3 @@ -8207,7 +8207,7 @@ __metadata: "@types/babel__core": ^7.0.0 "@types/express": ^4.7.0 "@types/fs-extra": ^11.0.1 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 file-system-cache: 2.3.0 typescript: ~4.9.3 languageName: unknown @@ -8242,7 +8242,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/preset-vue-webpack": "workspace:*" "@storybook/vue": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 typescript: ~4.9.3 vue: ^2.6.12 vue-loader: ^15.7.0 @@ -8266,7 +8266,7 @@ __metadata: "@storybook/builder-vite": "workspace:*" "@storybook/core-server": "workspace:*" "@storybook/vue3": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@vitejs/plugin-vue": ^4.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 @@ -8287,7 +8287,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/preset-vue3-webpack": "workspace:*" "@storybook/vue3": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@vue/compiler-sfc": 3.0.0 typescript: ~4.9.3 vue: 3.0.0 @@ -8361,7 +8361,7 @@ __metadata: "@storybook/core-server": "workspace:*" "@storybook/node-logger": "workspace:*" "@storybook/web-components": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 magic-string: ^0.30.0 typescript: ~4.9.3 peerDependencies: @@ -8379,7 +8379,7 @@ __metadata: "@storybook/core-common": "workspace:*" "@storybook/preset-web-components-webpack": "workspace:*" "@storybook/web-components": "workspace:*" - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 lit: 2.3.1 typescript: ~4.9.3 peerDependencies: @@ -8401,7 +8401,7 @@ __metadata: "@storybook/preview-api": "workspace:*" "@storybook/types": "workspace:*" "@types/cross-spawn": ^6.0.2 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 cross-spawn: ^7.0.3 lit: 2.3.1 tiny-invariant: ^1.3.1 @@ -9501,10 +9501,10 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:^16.0.0": - version: 16.18.57 - resolution: "@types/node@npm:16.18.57" - checksum: 191cfb12fde8c882f1d982a07302f7b87cda7b93ec227b0607f908f3b3b11c5ff96bbed613f370818ea60a8a98140962b193324bdadff679bd5ca75d04407e60 +"@types/node@npm:^18.0.0": + version: 18.18.4 + resolution: "@types/node@npm:18.18.4" + checksum: 17891f8b8fd107813eaea0dce58d2008173f3c90df4f5998da3d01d6b225e9908922156ac83240b0230d3813f1a29b5f7e065a2aa993285af062e3a3779f88dd languageName: node linkType: hard diff --git a/docs/snippets/common/test-runner-local-build-workflow.yml.mdx b/docs/snippets/common/test-runner-local-build-workflow.yml.mdx index 000ccf44ba14..40443a0e7f67 100644 --- a/docs/snippets/common/test-runner-local-build-workflow.yml.mdx +++ b/docs/snippets/common/test-runner-local-build-workflow.yml.mdx @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version-file: '.nvmrc' - name: Install dependencies run: yarn - name: Install Playwright diff --git a/docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx b/docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx index ff965af6f45d..b79f70920e43 100644 --- a/docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx +++ b/docs/snippets/common/test-runner-with-deploy-event-workflow.yml.mdx @@ -12,7 +12,7 @@ jobs: - uses: actions/checkout@v3 - uses: actions/setup-node@v3 with: - node-version: '16.x' + node-version-file: '.nvmrc' - name: Install dependencies run: yarn - name: Install Playwright diff --git a/scripts/.babelrc.js b/scripts/.babelrc.js index 508d8180dc10..31016fd42625 100644 --- a/scripts/.babelrc.js +++ b/scripts/.babelrc.js @@ -9,7 +9,7 @@ module.exports = { shippedProposals: true, useBuiltIns: 'usage', corejs: '3', - targets: { node: '16' }, + targets: { node: '18' }, }, ], ], diff --git a/scripts/package.json b/scripts/package.json index f220b8f88742..b6020c436390 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -93,7 +93,7 @@ "@types/fs-extra": "^11.0.1", "@types/http-server": "^0.12.1", "@types/lodash": "^4", - "@types/node": "^16.0.0", + "@types/node": "^18.0.0", "@types/node-fetch": "^2.5.7", "@types/prettier": "^2", "@types/pretty-hrtime": "^1.0.0", @@ -203,6 +203,6 @@ }, "packageManager": "yarn@3.3.0", "engines": { - "node": ">=16.0.0" + "node": ">=18.0.0" } } diff --git a/scripts/yarn.lock b/scripts/yarn.lock index f9d17fe543a8..504a13091f02 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2970,7 +2970,7 @@ __metadata: "@types/fs-extra": ^11.0.1 "@types/http-server": ^0.12.1 "@types/lodash": ^4 - "@types/node": ^16.0.0 + "@types/node": ^18.0.0 "@types/node-fetch": ^2.5.7 "@types/prettier": ^2 "@types/pretty-hrtime": ^1.0.0 @@ -3711,7 +3711,7 @@ __metadata: languageName: node linkType: hard -"@types/node@npm:*, @types/node@npm:>= 8, @types/node@npm:^16.0.0": +"@types/node@npm:*, @types/node@npm:>= 8": version: 16.18.50 resolution: "@types/node@npm:16.18.50" checksum: 4fc76918cc4e09d6cf087b385a1e2283580b1a88518f309764365cbdbdc28cdf48a77a5615ac4ce28dccee078b3da79442a032cc8aa312406943754144938cdb