diff --git a/.changeset/nice-otters-boil.md b/.changeset/nice-otters-boil.md new file mode 100644 index 000000000000..2d77ffea80d3 --- /dev/null +++ b/.changeset/nice-otters-boil.md @@ -0,0 +1,7 @@ +--- +'@sveltejs/adapter-node': patch +'create-svelte': patch +'@sveltejs/kit': patch +--- + +[breaking] drop Node 12 support diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ea4d7c8e81eb..12b4b2abf2df 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -38,8 +38,6 @@ jobs: node-version: [14] os: [ubuntu-latest, macOS-latest, windows-latest] include: - - node-version: 12 - os: ubuntu-latest - node-version: 16 os: ubuntu-latest steps: @@ -79,8 +77,6 @@ jobs: node-version: [14] os: [ubuntu-latest, macOS-latest, windows-latest] include: - - node-version: 12 - os: ubuntu-latest - node-version: 16 os: ubuntu-latest steps: diff --git a/packages/adapter-netlify/README.md b/packages/adapter-netlify/README.md index cf5d92ae0692..c03f63a697ed 100644 --- a/packages/adapter-netlify/README.md +++ b/packages/adapter-netlify/README.md @@ -8,7 +8,7 @@ This is very experimental; the adapter API isn't at all fleshed out, and things > ⚠️ For the time being, the latest version of adapter-netlify is at the @next tag. If you get the error `config.kit.adapter should be an object with an "adapt" method.`, this is a sign that you are using the wrong version (eg `1.0.0-next.0` instead of `1.0.0-next.9`). -> ⚠️ Netlify defaults to Node 12.16. SvelteKit requires Node v12.20 to build. You can pin the Node version with a `.node-version` or [`.nvmrc`](https://github.com/nvm-sh/nvm#nvmrc) file: `echo "14" > .nvmrc` or [set the `NODE_ENV` environment variable](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript). +> ⚠️ Netlify defaults to Node 12.16. SvelteKit requires Node v14.13 to build. You can pin the Node version with a `.node-version` or [`.nvmrc`](https://github.com/nvm-sh/nvm#nvmrc) file: `echo "14" > .nvmrc` or [set the `NODE_ENV` environment variable](https://docs.netlify.com/configure-builds/manage-dependencies/#node-js-and-javascript). ```bash npm i -D @sveltejs/adapter-netlify@next diff --git a/packages/adapter-node/README.md b/packages/adapter-node/README.md index 2a0ec3eec462..e846ce8543cd 100644 --- a/packages/adapter-node/README.md +++ b/packages/adapter-node/README.md @@ -109,7 +109,7 @@ The default options for this version are as follows: external: allProductionDependencies, // from package.json format: 'esm', platform: 'node', - target: 'node12', + target: 'node14', inject: ['pathTo/shims.js'], define: { esbuild_app_dir: `"${config.kit.appDir}"` diff --git a/packages/adapter-node/index.js b/packages/adapter-node/index.js index d651385f6ca0..3d2b258fb6a7 100644 --- a/packages/adapter-node/index.js +++ b/packages/adapter-node/index.js @@ -66,7 +66,7 @@ export default function ({ external: Object.keys(JSON.parse(readFileSync('package.json', 'utf8')).dependencies || {}), format: 'esm', platform: 'node', - target: 'node12', + target: 'node14', inject: [join(files, 'shims.js')], define: { APP_DIR: `"/${config.kit.appDir}/"` @@ -83,7 +83,7 @@ export default function ({ bundle: true, format: 'esm', platform: 'node', - target: 'node12', + target: 'node14', // external exclude workaround, see https://github.com/evanw/esbuild/issues/514 plugins: [ { diff --git a/packages/create-svelte/shared/+typescript/tsconfig.json b/packages/create-svelte/shared/+typescript/tsconfig.json index 773bd1f7d212..0555d526aa29 100644 --- a/packages/create-svelte/shared/+typescript/tsconfig.json +++ b/packages/create-svelte/shared/+typescript/tsconfig.json @@ -3,7 +3,7 @@ "moduleResolution": "node", "module": "es2020", "lib": ["es2020", "DOM"], - "target": "es2019", + "target": "es2020", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript to enforce using \`import type\` instead of \`import\` for Types. diff --git a/packages/create-svelte/templates/default/tsconfig.json b/packages/create-svelte/templates/default/tsconfig.json index d826f6ef8b89..c631cca85b46 100644 --- a/packages/create-svelte/templates/default/tsconfig.json +++ b/packages/create-svelte/templates/default/tsconfig.json @@ -3,7 +3,7 @@ "moduleResolution": "node", "module": "es2020", "lib": ["es2020"], - "target": "es2019", + "target": "es2020", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript to enforce using \`import type\` instead of \`import\` for Types. diff --git a/packages/kit/package.json b/packages/kit/package.json index e11e2bd270d1..860618c1c9bc 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -86,6 +86,6 @@ }, "types": "types/index.d.ts", "engines": { - "node": "^12.20 || >=14.13" + "node": ">=14.13" } } diff --git a/packages/kit/src/core/build/index.js b/packages/kit/src/core/build/index.js index 0921e1a809a0..c1bcd493b248 100644 --- a/packages/kit/src/core/build/index.js +++ b/packages/kit/src/core/build/index.js @@ -460,7 +460,7 @@ async function build_server( root: cwd, base: assets_base, build: { - target: 'es2018', + target: 'es2020', ssr: true, outDir: `${output_dir}/server`, polyfillDynamicImport: false, diff --git a/packages/kit/src/packaging/test/fixtures/resolve-alias/tsconfig.json b/packages/kit/src/packaging/test/fixtures/resolve-alias/tsconfig.json index 0f54c3906f8b..b011e4d18fa8 100644 --- a/packages/kit/src/packaging/test/fixtures/resolve-alias/tsconfig.json +++ b/packages/kit/src/packaging/test/fixtures/resolve-alias/tsconfig.json @@ -3,7 +3,7 @@ "moduleResolution": "node", "module": "es2020", "lib": ["es2020", "DOM"], - "target": "es2019", + "target": "es2020", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript to enforce using \`import type\` instead of \`import\` for Types. diff --git a/packages/kit/src/packaging/test/fixtures/typescript/tsconfig.json b/packages/kit/src/packaging/test/fixtures/typescript/tsconfig.json index 0f54c3906f8b..b011e4d18fa8 100644 --- a/packages/kit/src/packaging/test/fixtures/typescript/tsconfig.json +++ b/packages/kit/src/packaging/test/fixtures/typescript/tsconfig.json @@ -3,7 +3,7 @@ "moduleResolution": "node", "module": "es2020", "lib": ["es2020", "DOM"], - "target": "es2019", + "target": "es2020", /** svelte-preprocess cannot figure out whether you have a value or a type, so tell TypeScript to enforce using \`import type\` instead of \`import\` for Types.