diff --git a/.changeset/rotten-penguins-hope.md b/.changeset/rotten-penguins-hope.md new file mode 100644 index 000000000000..e350d1710d38 --- /dev/null +++ b/.changeset/rotten-penguins-hope.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/adapter-node': major +--- + +breaking: remove polyfill option. fetch APIs will now always come from the platform being used. File and crypto APIs will be polyfilled if not available diff --git a/.changeset/thick-suits-help.md b/.changeset/thick-suits-help.md new file mode 100644 index 000000000000..bad5030bd008 --- /dev/null +++ b/.changeset/thick-suits-help.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/kit': major +--- + +breaking: require Node 18.13 or newer diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 159422c2655c..fe1e605eab54 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -26,7 +26,7 @@ jobs: - uses: pnpm/action-setup@v2.4.0 - uses: actions/setup-node@v4 with: - node-version: '16.x' + node-version: '18.x' cache: pnpm - run: pnpm install --frozen-lockfile - run: pnpm run lint @@ -39,9 +39,6 @@ jobs: fail-fast: false matrix: include: - - node-version: 16 - os: ubuntu-latest - e2e-browser: 'chromium' - node-version: 18 os: ubuntu-latest e2e-browser: 'chromium' @@ -79,27 +76,27 @@ jobs: fail-fast: false matrix: include: - - node-version: 16 + - node-version: 18 os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166 e2e-browser: 'chromium' mode: 'dev' - - node-version: 16 + - node-version: 18 os: ubuntu-latest e2e-browser: 'firefox' mode: 'dev' - - node-version: 16 + - node-version: 18 os: macOS-latest e2e-browser: 'webkit' mode: 'dev' - - node-version: 16 + - node-version: 18 os: windows-2019 # slowness reported on newer versions https://github.com/actions/runner-images/issues/5166 e2e-browser: 'chromium' mode: 'build' - - node-version: 16 + - node-version: 18 os: ubuntu-latest e2e-browser: 'firefox' mode: 'build' - - node-version: 16 + - node-version: 18 os: macOS-latest e2e-browser: 'webkit' mode: 'build' @@ -134,7 +131,7 @@ jobs: - uses: pnpm/action-setup@v2.4.0 - uses: actions/setup-node@v4 with: - node-version: 16 + node-version: 18 cache: pnpm - run: pnpm install --frozen-lockfile - run: cd packages/kit && pnpm prepublishOnly diff --git a/documentation/docs/25-build-and-deploy/40-adapter-node.md b/documentation/docs/25-build-and-deploy/40-adapter-node.md index f3c04bfa85c3..8736968e1a31 100644 --- a/documentation/docs/25-build-and-deploy/40-adapter-node.md +++ b/documentation/docs/25-build-and-deploy/40-adapter-node.md @@ -131,8 +131,7 @@ export default { // default options are shown out: 'build', precompress: false, - envPrefix: '', - polyfill: true + envPrefix: '' }) } }; @@ -161,12 +160,6 @@ MY_CUSTOM_ORIGIN=https://my.site \ node build ``` -### polyfill - -Controls whether your build will load polyfills for missing modules. It defaults to `true`, and should only be disabled when using Node 18.11 or greater. - -Note: to use Node's built-in `crypto` global with Node 18 you will need to use the `--experimental-global-webcrypto` flag. This flag is not required with Node 20. - ## Custom server The adapter creates two files in your build directory — `index.js` and `handler.js`. Running `index.js` — e.g. `node build`, if you use the default build directory — will start a server on the configured port. diff --git a/packages/adapter-auto/package.json b/packages/adapter-auto/package.json index 36b3c2e9b590..61c5c0878d73 100644 --- a/packages/adapter-auto/package.json +++ b/packages/adapter-auto/package.json @@ -32,7 +32,7 @@ "devDependencies": { "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "typescript": "^5.3.2" }, "dependencies": { diff --git a/packages/adapter-cloudflare-workers/package.json b/packages/adapter-cloudflare-workers/package.json index 20175f8dcac6..971a622c242d 100644 --- a/packages/adapter-cloudflare-workers/package.json +++ b/packages/adapter-cloudflare-workers/package.json @@ -36,7 +36,7 @@ }, "devDependencies": { "@cloudflare/kv-asset-handler": "^0.3.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "typescript": "^5.3.2" }, "peerDependencies": { diff --git a/packages/adapter-cloudflare/package.json b/packages/adapter-cloudflare/package.json index 5386bd737467..976c87ce2ebe 100644 --- a/packages/adapter-cloudflare/package.json +++ b/packages/adapter-cloudflare/package.json @@ -37,7 +37,7 @@ "worktop": "0.8.0-next.15" }, "devDependencies": { - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "@types/ws": "^8.5.3", "typescript": "^5.3.2" }, diff --git a/packages/adapter-netlify/package.json b/packages/adapter-netlify/package.json index 135e3f62c755..66ec5cf37aef 100644 --- a/packages/adapter-netlify/package.json +++ b/packages/adapter-netlify/package.json @@ -44,7 +44,7 @@ "@rollup/plugin-node-resolve": "^15.2.3", "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "@types/set-cookie-parser": "^2.4.2", "rollup": "^4.2.0", "typescript": "^5.3.2", diff --git a/packages/adapter-node/index.d.ts b/packages/adapter-node/index.d.ts index 12ea6273dd66..d32510e25186 100644 --- a/packages/adapter-node/index.d.ts +++ b/packages/adapter-node/index.d.ts @@ -9,7 +9,6 @@ interface AdapterOptions { out?: string; precompress?: boolean; envPrefix?: string; - polyfill?: boolean; } export default function plugin(options?: AdapterOptions): Adapter; diff --git a/packages/adapter-node/index.js b/packages/adapter-node/index.js index cee513d34b90..4cd8d42cbe29 100644 --- a/packages/adapter-node/index.js +++ b/packages/adapter-node/index.js @@ -9,7 +9,7 @@ const files = fileURLToPath(new URL('./files', import.meta.url).href); /** @type {import('./index.js').default} */ export default function (opts = {}) { - const { out = 'build', precompress, envPrefix = '', polyfill = true } = opts; + const { out = 'build', precompress, envPrefix = '' } = opts; return { name: '@sveltejs/adapter-node', @@ -86,11 +86,6 @@ export default function (opts = {}) { ENV_PREFIX: JSON.stringify(envPrefix) } }); - - // If polyfills aren't wanted then clear the file - if (!polyfill) { - writeFileSync(`${out}/shims.js`, '', 'utf-8'); - } } }; } diff --git a/packages/adapter-node/package.json b/packages/adapter-node/package.json index 8a1623a89f94..f1a9383a480e 100644 --- a/packages/adapter-node/package.json +++ b/packages/adapter-node/package.json @@ -36,7 +36,7 @@ "@polka/url": "^1.0.0-next.24", "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "c8": "^8.0.0", "polka": "^1.0.0-next.24", "sirv": "^2.0.3", diff --git a/packages/adapter-static/package.json b/packages/adapter-static/package.json index 072f0bb4181e..d8bb191c1d1e 100644 --- a/packages/adapter-static/package.json +++ b/packages/adapter-static/package.json @@ -33,7 +33,7 @@ "@playwright/test": "1.30.0", "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "sirv": "^2.0.3", "svelte": "^4.2.7", "typescript": "^5.3.2", diff --git a/packages/adapter-vercel/package.json b/packages/adapter-vercel/package.json index 0c2eaf0cc532..5eb37cf01358 100644 --- a/packages/adapter-vercel/package.json +++ b/packages/adapter-vercel/package.json @@ -37,7 +37,7 @@ "devDependencies": { "@sveltejs/kit": "workspace:^", "@sveltejs/vite-plugin-svelte": "^3.0.0", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "typescript": "^5.3.2", "vitest": "^0.34.5" }, diff --git a/packages/enhanced-img/package.json b/packages/enhanced-img/package.json index 19e96e71aebf..4d55c20ce2aa 100644 --- a/packages/enhanced-img/package.json +++ b/packages/enhanced-img/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@types/estree": "^1.0.2", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "estree-walker": "^3.0.3", "rollup": "^4.2.0", "svelte": "^4.2.7", diff --git a/packages/kit/package.json b/packages/kit/package.json index ca6968e4f5f3..0b86a0f9dddd 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -21,14 +21,13 @@ "sade": "^1.8.1", "set-cookie-parser": "^2.6.0", "sirv": "^2.0.2", - "tiny-glob": "^0.2.9", - "undici": "~5.26.2" + "tiny-glob": "^0.2.9" }, "devDependencies": { "@playwright/test": "1.30.0", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/connect": "^3.4.35", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "@types/sade": "^1.7.4", "@types/set-cookie-parser": "^2.4.2", "dts-buddy": "^0.4.1", @@ -96,6 +95,6 @@ }, "types": "types/index.d.ts", "engines": { - "node": "^16.14 || >=18" + "node": ">=18.13" } } diff --git a/packages/kit/src/core/postbuild/analyse.js b/packages/kit/src/core/postbuild/analyse.js index c311dfe43337..47d859d88bd2 100644 --- a/packages/kit/src/core/postbuild/analyse.js +++ b/packages/kit/src/core/postbuild/analyse.js @@ -10,7 +10,6 @@ import { } from '../../utils/exports.js'; import { load_config } from '../config/index.js'; import { forked } from '../../utils/fork.js'; -import { should_polyfill } from '../../utils/platform.js'; import { installPolyfills } from '../../exports/node/polyfills.js'; import { resolvePath } from '../../exports/index.js'; import { ENDPOINT_METHODS } from '../../constants.js'; @@ -36,9 +35,7 @@ async function analyse({ manifest_path, env }) { /** @type {import('types').ServerInternalModule} */ const internal = await import(pathToFileURL(`${server_root}/server/internal.js`).href); - if (should_polyfill) { - installPolyfills(); - } + installPolyfills(); // configure `import { building } from '$app/environment'` — // essential we do this before analysing the code diff --git a/packages/kit/src/core/postbuild/prerender.js b/packages/kit/src/core/postbuild/prerender.js index e64b7f852364..84d663c390c1 100644 --- a/packages/kit/src/core/postbuild/prerender.js +++ b/packages/kit/src/core/postbuild/prerender.js @@ -3,7 +3,6 @@ import { dirname, join } from 'node:path'; import { pathToFileURL } from 'node:url'; import { installPolyfills } from '../../exports/node/polyfills.js'; import { mkdirp, posixify, walk } from '../../utils/filesystem.js'; -import { should_polyfill } from '../../utils/platform.js'; import { decode_uri, is_root_relative, resolve } from '../../utils/url.js'; import { escape_html_attr } from '../../utils/escape.js'; import { logger } from '../utils.js'; @@ -94,9 +93,7 @@ async function prerender({ out, manifest_path, metadata, verbose, env }) { /** @type {import('types').Logger} */ const log = logger({ verbose }); - if (should_polyfill) { - installPolyfills(); - } + installPolyfills(); /** @type {Map} */ const saved = new Map(); diff --git a/packages/kit/src/exports/node/polyfills.js b/packages/kit/src/exports/node/polyfills.js index 46d5e71bce02..347c68cea2e9 100644 --- a/packages/kit/src/exports/node/polyfills.js +++ b/packages/kit/src/exports/node/polyfills.js @@ -1,54 +1,25 @@ -import { ReadableStream, TransformStream, WritableStream } from 'node:stream/web'; import buffer from 'node:buffer'; import { webcrypto as crypto } from 'node:crypto'; -import { fetch, Response, Request, Headers, FormData, File as UndiciFile } from 'undici'; // `buffer.File` was added in Node 18.13.0 while the `File` global was added in Node 20.0.0 -const File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File ?? UndiciFile; +const File = /** @type {import('node:buffer') & { File?: File}} */ (buffer).File; /** @type {Record} */ -const globals_post_node_18_11 = { +const globals = { crypto, File }; -/** @type {Record} */ -// TODO: remove this once we only support Node 18.11+ (the version multipart/form-data was added) -const globals_pre_node_18_11 = { - crypto, - fetch, - Response, - Request, - Headers, - ReadableStream, - TransformStream, - WritableStream, - FormData, - File -}; - // exported for dev/preview and node environments /** * Make various web APIs available as globals: * - `crypto` - * - `fetch` (only in node < 18.11) - * - `Headers` (only in node < 18.11) - * - `Request` (only in node < 18.11) - * - `Response` (only in node < 18.11) + * - `File` */ export function installPolyfills() { - // Be defensive (we don't know in which environments this is called) and always apply if something goes wrong - let globals = globals_pre_node_18_11; - try { - const version = process.versions.node.split('.').map((n) => parseInt(n, 10)); - if ((version[0] === 18 && version[1] >= 11) || version[0] > 18) { - globals = globals_post_node_18_11; - } - } catch (e) { - // ignore - } - for (const name in globals) { + if (name in globalThis) continue; + Object.defineProperty(globalThis, name, { enumerable: true, configurable: true, diff --git a/packages/kit/src/exports/vite/dev/index.js b/packages/kit/src/exports/vite/dev/index.js index a70be05c9cc8..257fd69e2526 100644 --- a/packages/kit/src/exports/vite/dev/index.js +++ b/packages/kit/src/exports/vite/dev/index.js @@ -8,7 +8,6 @@ import { getRequest, setResponse } from '../../../exports/node/index.js'; import { installPolyfills } from '../../../exports/node/polyfills.js'; import { coalesce_to_error } from '../../../utils/error.js'; import { posixify, resolve_entry, to_fs } from '../../../utils/filesystem.js'; -import { should_polyfill } from '../../../utils/platform.js'; import { load_error_page } from '../../../core/config/index.js'; import { SVELTE_KIT_ASSETS } from '../../../constants.js'; import * as sync from '../../../core/sync/sync.js'; @@ -26,9 +25,7 @@ const cwd = process.cwd(); * @return {Promise void>>} */ export async function dev(vite, vite_config, svelte_config) { - if (should_polyfill) { - installPolyfills(); - } + installPolyfills(); const fetch = globalThis.fetch; globalThis.fetch = (info, init) => { diff --git a/packages/kit/src/exports/vite/preview/index.js b/packages/kit/src/exports/vite/preview/index.js index 4c1eab435b93..e86df8a0da08 100644 --- a/packages/kit/src/exports/vite/preview/index.js +++ b/packages/kit/src/exports/vite/preview/index.js @@ -7,7 +7,6 @@ import { loadEnv, normalizePath } from 'vite'; import { getRequest, setResponse } from '../../../exports/node/index.js'; import { installPolyfills } from '../../../exports/node/polyfills.js'; import { SVELTE_KIT_ASSETS } from '../../../constants.js'; -import { should_polyfill } from '../../../utils/platform.js'; /** @typedef {import('http').IncomingMessage} Req */ /** @typedef {import('http').ServerResponse} Res */ @@ -19,9 +18,7 @@ import { should_polyfill } from '../../../utils/platform.js'; * @param {import('types').ValidatedConfig} svelte_config */ export async function preview(vite, vite_config, svelte_config) { - if (should_polyfill) { - installPolyfills(); - } + installPolyfills(); const { paths } = svelte_config.kit; const assets = paths.assets ? SVELTE_KIT_ASSETS : paths.base; diff --git a/packages/kit/src/runtime/server/page/csp.spec.js b/packages/kit/src/runtime/server/page/csp.spec.js index 9747053dae67..66ea28085d2c 100644 --- a/packages/kit/src/runtime/server/page/csp.spec.js +++ b/packages/kit/src/runtime/server/page/csp.spec.js @@ -2,8 +2,11 @@ import { webcrypto } from 'node:crypto'; import { assert, beforeAll, test } from 'vitest'; import { Csp } from './csp.js'; -// @ts-expect-error -globalThis.crypto = webcrypto; +// TODO: remove after bumping peer dependency to require Node 20 +if (!globalThis.crypto) { + // @ts-expect-error + globalThis.crypto = webcrypto; +} beforeAll(() => { // @ts-expect-error diff --git a/packages/kit/src/utils/platform.js b/packages/kit/src/utils/platform.js deleted file mode 100644 index e32dd5f5abce..000000000000 --- a/packages/kit/src/utils/platform.js +++ /dev/null @@ -1 +0,0 @@ -export const should_polyfill = typeof Deno === 'undefined' && typeof Bun === 'undefined'; diff --git a/packages/kit/test/apps/basics/test/server.test.js b/packages/kit/test/apps/basics/test/server.test.js index 50f1d47341e0..82594eab8c02 100644 --- a/packages/kit/test/apps/basics/test/server.test.js +++ b/packages/kit/test/apps/basics/test/server.test.js @@ -1,6 +1,5 @@ import { expect } from '@playwright/test'; import { test } from '../../../utils.js'; -import { fetch } from 'undici'; import { createHash, randomBytes } from 'node:crypto'; /** @typedef {import('@playwright/test').Response} Response */ diff --git a/packages/migrate/package.json b/packages/migrate/package.json index a78a2b239fd2..53c730fb2209 100644 --- a/packages/migrate/package.json +++ b/packages/migrate/package.json @@ -33,7 +33,7 @@ "typescript": "^5.3.2" }, "devDependencies": { - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "@types/prompts": "^2.4.1", "@types/semver": "^7.5.0", "prettier": "^3.1.0", diff --git a/packages/package/package.json b/packages/package/package.json index ca54b5bd43a5..645805228027 100644 --- a/packages/package/package.json +++ b/packages/package/package.json @@ -18,7 +18,7 @@ "svelte2tsx": "~0.6.19" }, "devDependencies": { - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "@types/semver": "^7.5.0", "svelte": "^4.2.7", "svelte-preprocess": "^5.1.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1cbf335dd6e9..01b50760fb1e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -58,8 +58,8 @@ importers: specifier: ^3.0.0 version: 3.0.1(svelte@4.2.7)(vite@5.0.4) '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 typescript: specifier: ^5.3.2 version: 5.3.2 @@ -80,8 +80,8 @@ importers: version: 0.8.0-next.15 devDependencies: '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 '@types/ws': specifier: ^8.5.3 version: 8.5.3 @@ -108,8 +108,8 @@ importers: specifier: ^0.3.0 version: 0.3.0 '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 typescript: specifier: ^5.3.2 version: 5.3.2 @@ -145,8 +145,8 @@ importers: specifier: ^3.0.0 version: 3.0.1(svelte@4.2.7)(vite@5.0.4) '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 '@types/set-cookie-parser': specifier: ^2.4.2 version: 2.4.2 @@ -185,8 +185,8 @@ importers: specifier: ^3.0.0 version: 3.0.1(svelte@4.2.7)(vite@5.0.4) '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 c8: specifier: ^8.0.0 version: 8.0.0 @@ -215,8 +215,8 @@ importers: specifier: ^3.0.0 version: 3.0.1(svelte@4.2.7)(vite@5.0.4) '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 sirv: specifier: ^2.0.3 version: 2.0.3 @@ -228,7 +228,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/adapter-static/test/apps/prerendered: devDependencies: @@ -246,7 +246,7 @@ importers: version: 4.2.7 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/adapter-static/test/apps/spa: devDependencies: @@ -267,7 +267,7 @@ importers: version: 4.2.7 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/adapter-vercel: dependencies: @@ -285,8 +285,8 @@ importers: specifier: ^3.0.0 version: 3.0.1(svelte@4.2.7)(vite@5.0.4) '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 typescript: specifier: ^5.3.2 version: 5.3.2 @@ -360,7 +360,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/create-svelte/templates/skeleton: devDependencies: @@ -384,8 +384,8 @@ importers: specifier: ^1.0.2 version: 1.0.3 '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 estree-walker: specifier: ^3.0.3 version: 3.0.3 @@ -400,7 +400,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.0 version: 0.34.5(playwright@1.30.0) @@ -440,9 +440,6 @@ importers: tiny-glob: specifier: ^0.2.9 version: 0.2.9 - undici: - specifier: ~5.26.2 - version: 5.26.3 devDependencies: '@playwright/test': specifier: 1.30.0 @@ -454,8 +451,8 @@ importers: specifier: ^3.4.35 version: 3.4.35 '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 '@types/sade': specifier: ^1.7.4 version: 1.7.4 @@ -479,7 +476,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.5 version: 0.34.5(playwright@1.30.0) @@ -512,7 +509,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/basics: devDependencies: @@ -539,7 +536,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/dev-only: devDependencies: @@ -563,7 +560,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/embed: devDependencies: @@ -587,7 +584,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/options: devDependencies: @@ -611,7 +608,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/options-2: devDependencies: @@ -638,7 +635,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/apps/writes: devDependencies: @@ -662,7 +659,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors: devDependencies: @@ -692,7 +689,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/prerenderable-incorrect-fragment: devDependencies: @@ -716,7 +713,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/prerenderable-not-prerendered: devDependencies: @@ -740,7 +737,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/private-dynamic-env: devDependencies: @@ -761,7 +758,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/private-dynamic-env-dynamic-import: devDependencies: @@ -782,7 +779,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/private-static-env: devDependencies: @@ -806,7 +803,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/private-static-env-dynamic-import: devDependencies: @@ -827,7 +824,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/server-only-folder: devDependencies: @@ -848,7 +845,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/server-only-folder-dynamic-import: devDependencies: @@ -869,7 +866,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/server-only-module: devDependencies: @@ -890,7 +887,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/server-only-module-dynamic-import: devDependencies: @@ -911,7 +908,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/build-errors/apps/syntax-error: devDependencies: @@ -932,7 +929,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) packages/kit/test/prerendering/basics: devDependencies: @@ -953,7 +950,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.5 version: 0.34.5(playwright@1.30.0) @@ -977,7 +974,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.5 version: 0.34.5(playwright@1.30.0) @@ -1001,7 +998,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.5 version: 0.34.5(playwright@1.30.0) @@ -1031,8 +1028,8 @@ importers: version: 5.3.2 devDependencies: '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 '@types/prompts': specifier: ^2.4.1 version: 2.4.1 @@ -1065,8 +1062,8 @@ importers: version: 0.6.19(svelte@4.2.7)(typescript@5.3.2) devDependencies: '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 '@types/semver': specifier: ^7.5.0 version: 7.5.0 @@ -1102,7 +1099,7 @@ importers: version: 5.3.2 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) sites/kit.svelte.dev: dependencies: @@ -1138,8 +1135,8 @@ importers: specifier: ^3.0.4 version: 3.0.4 '@types/node': - specifier: ^16.18.6 - version: 16.18.6 + specifier: ^18.19.1 + version: 18.19.2 browserslist: specifier: ^4.21.10 version: 4.21.10 @@ -1178,7 +1175,7 @@ importers: version: 5.0.4 vite: specifier: ^5.0.4 - version: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + version: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitest: specifier: ^0.34.5 version: 0.34.5(lightningcss@1.21.8)(playwright@1.30.0) @@ -2089,11 +2086,6 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@fastify/busboy@2.0.0: - resolution: {integrity: sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==} - engines: {node: '>=14'} - dev: false - /@fontsource/fira-mono@5.0.5: resolution: {integrity: sha512-R5HaONNjI8zzZgjATOrtDhhl58U19OslqNOanPpiHqXV8XWKmFqRF1hIekrWemLfpSTK1WO3wyNcFMZMwkKhlA==} dev: false @@ -2447,7 +2439,7 @@ packages: engines: {node: '>=14'} hasBin: true dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 playwright-core: 1.30.0 dev: true @@ -2752,7 +2744,7 @@ packages: '@sveltejs/vite-plugin-svelte': 3.0.1(svelte@4.2.7)(vite@5.0.4) debug: 4.3.4 svelte: 4.2.7 - vite: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) transitivePeerDependencies: - supports-color dev: true @@ -2771,7 +2763,7 @@ packages: magic-string: 0.30.5 svelte: 4.2.7 svelte-hmr: 0.15.3(svelte@4.2.7) - vite: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) vitefu: 0.2.5(vite@5.0.4) transitivePeerDependencies: - supports-color @@ -2809,7 +2801,7 @@ packages: /@types/connect@3.4.35: resolution: {integrity: sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==} dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 dev: true /@types/cookie@0.6.0: @@ -2862,8 +2854,10 @@ packages: resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} dev: true - /@types/node@16.18.6: - resolution: {integrity: sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==} + /@types/node@18.19.2: + resolution: {integrity: sha512-6wzfBdbWpe8QykUkXBjtmO3zITA0A3FIjoy+in0Y2K4KrCiRhNYJIdwAPDffZ3G6GnaKaSLSEa9ZuORLfEoiwg==} + dependencies: + undici-types: 5.26.5 dev: true /@types/normalize-package-data@2.4.1: @@ -2873,7 +2867,7 @@ packages: /@types/prompts@2.4.1: resolution: {integrity: sha512-1Mqzhzi9W5KlooNE4o0JwSXGUDeQXKldbGn9NO4tpxwZbHXYd+WcKpCksG2lbhH7U9I9LigfsdVsP2QAY0lNPA==} dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 dev: true /@types/pug@2.0.6: @@ -2896,13 +2890,13 @@ packages: /@types/set-cookie-parser@2.4.2: resolution: {integrity: sha512-fBZgytwhYAUkj/jC/FAV4RQ5EerRup1YQsXQCh8rZfiHkc4UahC192oH0smGwsXol3cL3A5oETuAHeQHmhXM4w==} dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 dev: true /@types/ws@8.5.3: resolution: {integrity: sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==} dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 dev: true /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.13.1)(eslint@8.52.0)(typescript@5.3.2): @@ -6821,12 +6815,9 @@ packages: which-boxed-primitive: 1.0.2 dev: true - /undici@5.26.3: - resolution: {integrity: sha512-H7n2zmKEWgOllKkIUkLvFmsJQj062lSm3uA4EYApG8gLuiOM0/go9bIoC3HVaSnfg4xunowDE2i9p8drkXuvDw==} - engines: {node: '>=14.0'} - dependencies: - '@fastify/busboy': 2.0.0 - dev: false + /undici-types@5.26.5: + resolution: {integrity: sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==} + dev: true /universalify@0.1.2: resolution: {integrity: sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==} @@ -6894,7 +6885,7 @@ packages: - rollup dev: false - /vite-node@0.34.5(@types/node@16.18.6): + /vite-node@0.34.5(@types/node@18.19.2): resolution: {integrity: sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6904,7 +6895,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 4.4.9(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 4.4.9(@types/node@18.19.2)(lightningcss@1.21.8) transitivePeerDependencies: - '@types/node' - less @@ -6916,7 +6907,7 @@ packages: - terser dev: true - /vite-node@0.34.5(@types/node@16.18.6)(lightningcss@1.21.8): + /vite-node@0.34.5(@types/node@18.19.2)(lightningcss@1.21.8): resolution: {integrity: sha512-RNZ+DwbCvDoI5CbCSQSyRyzDTfFvFauvMs6Yq4ObJROKlIKuat1KgSX/Ako5rlDMfVCyMcpMRMTkJBxd6z8YRA==} engines: {node: '>=v14.18.0'} hasBin: true @@ -6926,7 +6917,7 @@ packages: mlly: 1.4.2 pathe: 1.1.1 picocolors: 1.0.0 - vite: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) transitivePeerDependencies: - '@types/node' - less @@ -6938,7 +6929,7 @@ packages: - terser dev: true - /vite@4.4.9(@types/node@16.18.6)(lightningcss@1.21.8): + /vite@4.4.9(@types/node@18.19.2)(lightningcss@1.21.8): resolution: {integrity: sha512-2mbUn2LlUmNASWwSCNSJ/EG2HuSRTnVNaydp6vMCm5VIqJsjMfbIWtbH2kDuwUVW5mMUKKZvGPX/rqeqVvv1XA==} engines: {node: ^14.18.0 || >=16.0.0} hasBin: true @@ -6966,7 +6957,7 @@ packages: terser: optional: true dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 esbuild: 0.18.20 lightningcss: 1.21.8 postcss: 8.4.31 @@ -6975,7 +6966,7 @@ packages: fsevents: 2.3.3 dev: true - /vite@5.0.4(@types/node@16.18.6)(lightningcss@1.21.8): + /vite@5.0.4(@types/node@18.19.2)(lightningcss@1.21.8): resolution: {integrity: sha512-RzAr8LSvM8lmhB4tQ5OPcBhpjOZRZjuxv9zO5UcxeoY2bd3kP3Ticd40Qma9/BqZ8JS96Ll/jeBX9u+LJZrhVg==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true @@ -7003,7 +6994,7 @@ packages: terser: optional: true dependencies: - '@types/node': 16.18.6 + '@types/node': 18.19.2 esbuild: 0.19.8 lightningcss: 1.21.8 postcss: 8.4.31 @@ -7020,7 +7011,7 @@ packages: vite: optional: true dependencies: - vite: 5.0.4(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 5.0.4(@types/node@18.19.2)(lightningcss@1.21.8) dev: true /vitest@0.34.5(lightningcss@1.21.8)(playwright@1.30.0): @@ -7056,7 +7047,7 @@ packages: dependencies: '@types/chai': 4.3.6 '@types/chai-subset': 1.3.3 - '@types/node': 16.18.6 + '@types/node': 18.19.2 '@vitest/expect': 0.34.5 '@vitest/runner': 0.34.5 '@vitest/snapshot': 0.34.5 @@ -7076,8 +7067,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.4.9(@types/node@16.18.6)(lightningcss@1.21.8) - vite-node: 0.34.5(@types/node@16.18.6)(lightningcss@1.21.8) + vite: 4.4.9(@types/node@18.19.2)(lightningcss@1.21.8) + vite-node: 0.34.5(@types/node@18.19.2)(lightningcss@1.21.8) why-is-node-running: 2.2.2 transitivePeerDependencies: - less @@ -7122,7 +7113,7 @@ packages: dependencies: '@types/chai': 4.3.6 '@types/chai-subset': 1.3.3 - '@types/node': 16.18.6 + '@types/node': 18.19.2 '@vitest/expect': 0.34.5 '@vitest/runner': 0.34.5 '@vitest/snapshot': 0.34.5 @@ -7142,8 +7133,8 @@ packages: strip-literal: 1.3.0 tinybench: 2.5.0 tinypool: 0.7.0 - vite: 4.4.9(@types/node@16.18.6)(lightningcss@1.21.8) - vite-node: 0.34.5(@types/node@16.18.6) + vite: 4.4.9(@types/node@18.19.2)(lightningcss@1.21.8) + vite-node: 0.34.5(@types/node@18.19.2) why-is-node-running: 2.2.2 transitivePeerDependencies: - less diff --git a/sites/kit.svelte.dev/package.json b/sites/kit.svelte.dev/package.json index 1ed2a905edb4..5f995a8bc77d 100644 --- a/sites/kit.svelte.dev/package.json +++ b/sites/kit.svelte.dev/package.json @@ -20,7 +20,7 @@ "@sveltejs/site-kit": "6.0.0-next.52", "@sveltejs/vite-plugin-svelte": "^3.0.0", "@types/d3-geo": "^3.0.4", - "@types/node": "^16.18.6", + "@types/node": "^18.19.1", "browserslist": "^4.21.10", "flexsearch": "^0.7.31", "lightningcss": "^1.21.8", diff --git a/sites/kit.svelte.dev/scripts/types/index.js b/sites/kit.svelte.dev/scripts/types/index.js index a415d67d12c4..838360d66e44 100644 --- a/sites/kit.svelte.dev/scripts/types/index.js +++ b/sites/kit.svelte.dev/scripts/types/index.js @@ -65,7 +65,14 @@ async function get_types(code, statements) { // @ts-ignore const jsDoc = statement.jsDoc[0]; - comment = jsDoc.comment; + // `@link` JSDoc tags (and maybe others?) turn this property into an array, which we need to join manually + if (Array.isArray(jsDoc.comment)) { + comment = jsDoc.comment + .map(({ name, text }) => (name ? `\`${name.escapedText}\`` : text)) + .join(''); + } else { + comment = jsDoc.comment; + } if (jsDoc?.tags?.[0]?.tagName?.escapedText === 'deprecated') { deprecated_notice = jsDoc.tags[0].comment;