From afbbc4d5bfafc1779bac00b41c2a1cb1c90f2808 Mon Sep 17 00:00:00 2001 From: Erika <3019731+Princesseuh@users.noreply.github.com> Date: Mon, 6 Mar 2023 19:57:16 +0100 Subject: [PATCH] Update compilation target for Node 16 (#6213) * config(esbuild): Update esbuild target to node16 * config(package): Update root package.json node engine * config(tsconfig): Update all the tsconfigs module and targets * chore: changeset * chore: remove unneeded file --- .changeset/wicked-pumpkins-punch.md | 30 +++++++++++++++++++ package.json | 2 +- packages/astro-prism/tsconfig.json | 4 +-- packages/astro-rss/tsconfig.json | 4 +-- packages/astro/tsconfig.json | 4 +-- packages/create-astro/tsconfig.json | 4 +-- packages/integrations/alpinejs/tsconfig.json | 4 +-- .../integrations/cloudflare/tsconfig.json | 4 +-- packages/integrations/deno/tsconfig.json | 4 +-- packages/integrations/image/tsconfig.json | 4 +-- packages/integrations/lit/tsconfig.json | 4 +-- packages/integrations/mdx/tsconfig.json | 4 +-- packages/integrations/netlify/tsconfig.json | 4 +-- packages/integrations/node/tsconfig.json | 4 +-- packages/integrations/partytown/tsconfig.json | 4 +-- packages/integrations/preact/tsconfig.json | 4 +-- packages/integrations/prefetch/tsconfig.json | 4 +-- packages/integrations/react/tsconfig.json | 4 +-- packages/integrations/sitemap/tsconfig.json | 4 +-- packages/integrations/solid/tsconfig.json | 4 +-- packages/integrations/svelte/tsconfig.json | 4 +-- packages/integrations/tailwind/tsconfig.json | 4 +-- .../integrations/turbolinks/tsconfig.json | 4 +-- packages/integrations/vercel/tsconfig.json | 4 +-- packages/integrations/vue/tsconfig.json | 4 +-- packages/markdown/remark/tsconfig.json | 4 +-- packages/telemetry/tsconfig.json | 4 +-- packages/webapi/tsconfig.json | 2 +- scripts/cmd/build.js | 6 ++-- 29 files changed, 85 insertions(+), 55 deletions(-) create mode 100644 .changeset/wicked-pumpkins-punch.md diff --git a/.changeset/wicked-pumpkins-punch.md b/.changeset/wicked-pumpkins-punch.md new file mode 100644 index 000000000000..5fc693b7de6e --- /dev/null +++ b/.changeset/wicked-pumpkins-punch.md @@ -0,0 +1,30 @@ +--- +'astro': minor +'@astrojs/prism': minor +'@astrojs/rss': minor +'create-astro': minor +'@astrojs/alpinejs': minor +'@astrojs/cloudflare': minor +'@astrojs/deno': minor +'@astrojs/image': minor +'@astrojs/lit': minor +'@astrojs/mdx': minor +'@astrojs/netlify': minor +'@astrojs/node': minor +'@astrojs/partytown': minor +'@astrojs/preact': minor +'@astrojs/prefetch': minor +'@astrojs/react': minor +'@astrojs/sitemap': minor +'@astrojs/solid-js': minor +'@astrojs/svelte': minor +'@astrojs/tailwind': minor +'@astrojs/turbolinks': minor +'@astrojs/vercel': minor +'@astrojs/vue': minor +'@astrojs/markdown-remark': minor +'@astrojs/telemetry': minor +'@astrojs/webapi': minor +--- + +Updated compilation settings to disable downlevelling for Node 14 diff --git a/package.json b/package.json index 7ca43f566a8c..d40062f8fe5a 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "packages/astro/test/fixtures/static build/pkg" ], "engines": { - "node": "^14.18.0 || >=16.12.0", + "node": ">=16.12.0", "pnpm": ">=7.9.5" }, "packageManager": "pnpm@7.12.2", diff --git a/packages/astro-prism/tsconfig.json b/packages/astro-prism/tsconfig.json index c56abb57e775..569016e9d844 100644 --- a/packages/astro-prism/tsconfig.json +++ b/packages/astro-prism/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2020", - "module": "ES2020", + "target": "ES2021", + "module": "ES2022", "outDir": "./dist" } } diff --git a/packages/astro-rss/tsconfig.json b/packages/astro-rss/tsconfig.json index 563e8cbfe186..f9da2a5bd15d 100644 --- a/packages/astro-rss/tsconfig.json +++ b/packages/astro-rss/tsconfig.json @@ -3,9 +3,9 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020", + "target": "ES2021", "strictNullChecks": true } } diff --git a/packages/astro/tsconfig.json b/packages/astro/tsconfig.json index 6be154d55c79..23ac0c78b62b 100644 --- a/packages/astro/tsconfig.json +++ b/packages/astro/tsconfig.json @@ -4,8 +4,8 @@ "compilerOptions": { "allowJs": true, "declarationDir": "./dist", - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/create-astro/tsconfig.json b/packages/create-astro/tsconfig.json index 25bf60c24d0c..720167fad4a1 100644 --- a/packages/create-astro/tsconfig.json +++ b/packages/create-astro/tsconfig.json @@ -5,8 +5,8 @@ "allowJs": true, "emitDeclarationOnly": false, "noEmit": true, - "target": "ES2020", - "module": "ES2020", + "target": "ES2021", + "module": "ES2022", "outDir": "./dist", "declarationDir": "./dist/types" } diff --git a/packages/integrations/alpinejs/tsconfig.json b/packages/integrations/alpinejs/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/alpinejs/tsconfig.json +++ b/packages/integrations/alpinejs/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/cloudflare/tsconfig.json b/packages/integrations/cloudflare/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/cloudflare/tsconfig.json +++ b/packages/integrations/cloudflare/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/deno/tsconfig.json b/packages/integrations/deno/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/deno/tsconfig.json +++ b/packages/integrations/deno/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/image/tsconfig.json b/packages/integrations/image/tsconfig.json index 083703f01f30..56b6b4e2d75e 100644 --- a/packages/integrations/image/tsconfig.json +++ b/packages/integrations/image/tsconfig.json @@ -3,9 +3,9 @@ "include": ["src", "types.d.ts"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020", + "target": "ES2021", "typeRoots": ["node_modules/@types", "node_modules/@netlify"] } } diff --git a/packages/integrations/lit/tsconfig.json b/packages/integrations/lit/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/lit/tsconfig.json +++ b/packages/integrations/lit/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/mdx/tsconfig.json b/packages/integrations/mdx/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/mdx/tsconfig.json +++ b/packages/integrations/mdx/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/netlify/tsconfig.json b/packages/integrations/netlify/tsconfig.json index 372a414e6be5..9f96de7cd0ed 100644 --- a/packages/integrations/netlify/tsconfig.json +++ b/packages/integrations/netlify/tsconfig.json @@ -3,9 +3,9 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020", + "target": "ES2021", "typeRoots": ["node_modules/@types", "node_modules/@netlify"] } } diff --git a/packages/integrations/node/tsconfig.json b/packages/integrations/node/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/node/tsconfig.json +++ b/packages/integrations/node/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/partytown/tsconfig.json b/packages/integrations/partytown/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/partytown/tsconfig.json +++ b/packages/integrations/partytown/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/preact/tsconfig.json b/packages/integrations/preact/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/preact/tsconfig.json +++ b/packages/integrations/preact/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/prefetch/tsconfig.json b/packages/integrations/prefetch/tsconfig.json index ae0c4a8762d1..194a092ff4e2 100644 --- a/packages/integrations/prefetch/tsconfig.json +++ b/packages/integrations/prefetch/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src", "@types"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/react/tsconfig.json b/packages/integrations/react/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/react/tsconfig.json +++ b/packages/integrations/react/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/sitemap/tsconfig.json b/packages/integrations/sitemap/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/sitemap/tsconfig.json +++ b/packages/integrations/sitemap/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/solid/tsconfig.json b/packages/integrations/solid/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/solid/tsconfig.json +++ b/packages/integrations/solid/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/svelte/tsconfig.json b/packages/integrations/svelte/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/svelte/tsconfig.json +++ b/packages/integrations/svelte/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/tailwind/tsconfig.json b/packages/integrations/tailwind/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/tailwind/tsconfig.json +++ b/packages/integrations/tailwind/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/turbolinks/tsconfig.json b/packages/integrations/turbolinks/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/turbolinks/tsconfig.json +++ b/packages/integrations/turbolinks/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/vercel/tsconfig.json b/packages/integrations/vercel/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/vercel/tsconfig.json +++ b/packages/integrations/vercel/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/integrations/vue/tsconfig.json b/packages/integrations/vue/tsconfig.json index 44baf375c882..64d4ef454384 100644 --- a/packages/integrations/vue/tsconfig.json +++ b/packages/integrations/vue/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "module": "ES2020", + "module": "ES2022", "outDir": "./dist", - "target": "ES2020" + "target": "ES2021" } } diff --git a/packages/markdown/remark/tsconfig.json b/packages/markdown/remark/tsconfig.json index 50b8aad01314..dcf815105c91 100644 --- a/packages/markdown/remark/tsconfig.json +++ b/packages/markdown/remark/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2020", - "module": "ES2020", + "target": "ES2021", + "module": "ES2022", "outDir": "./dist" } } diff --git a/packages/telemetry/tsconfig.json b/packages/telemetry/tsconfig.json index 8ee4c8711e01..b35c3d2449ed 100644 --- a/packages/telemetry/tsconfig.json +++ b/packages/telemetry/tsconfig.json @@ -3,8 +3,8 @@ "include": ["src"], "compilerOptions": { "allowJs": true, - "target": "ES2020", - "module": "ES2020", + "target": "ES2021", + "module": "ES2022", "outDir": "./dist", "declarationDir": "./dist/types" } diff --git a/packages/webapi/tsconfig.json b/packages/webapi/tsconfig.json index 60799f6aec7a..2d7e33d823ba 100644 --- a/packages/webapi/tsconfig.json +++ b/packages/webapi/tsconfig.json @@ -3,7 +3,7 @@ "exclude": ["node_modules"], "compilerOptions": { "target": "ES2021", - "module": "ES2020", + "module": "ES2022", "moduleResolution": "node", "esModuleInterop": true, "declaration": true, diff --git a/scripts/cmd/build.js b/scripts/cmd/build.js index 599d22d93ace..dee636b17b3f 100644 --- a/scripts/cmd/build.js +++ b/scripts/cmd/build.js @@ -1,9 +1,9 @@ -import esbuild from 'esbuild'; -import svelte from '../utils/svelte-plugin.js'; import { deleteAsync } from 'del'; +import esbuild from 'esbuild'; import { promises as fs } from 'fs'; import { dim, green, red, yellow } from 'kleur/colors'; import glob from 'tiny-glob'; +import svelte from '../utils/svelte-plugin.js'; import prebuild from './prebuild.js'; /** @type {import('esbuild').BuildOptions} */ @@ -11,7 +11,7 @@ const defaultConfig = { minify: false, format: 'esm', platform: 'node', - target: 'node14', + target: 'node16', sourcemap: false, sourcesContent: false, };