From dc7892c565f5a5dfdb28887f4470cd867b300ca4 Mon Sep 17 00:00:00 2001 From: jycouet Date: Fri, 19 Dec 2025 19:50:48 +0100 Subject: [PATCH 1/2] remove tsx & CI using node 24 --- .github/workflows/docs-preview-create.yml | 2 +- .github/workflows/sync-docs.yml | 2 +- apps/svelte.dev/package.json | 3 +-- packages/site-kit/src/lib/markdown/index.ts | 4 ++-- packages/site-kit/src/lib/markdown/preprocess.ts | 4 ++-- packages/site-kit/src/lib/markdown/renderer.ts | 2 +- packages/site-kit/tsconfig.json | 3 ++- pnpm-lock.yaml | 8 ++++---- 8 files changed, 14 insertions(+), 14 deletions(-) diff --git a/.github/workflows/docs-preview-create.yml b/.github/workflows/docs-preview-create.yml index 4f6f5a283e..7b1074558c 100644 --- a/.github/workflows/docs-preview-create.yml +++ b/.github/workflows/docs-preview-create.yml @@ -47,7 +47,7 @@ jobs: - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile diff --git a/.github/workflows/sync-docs.yml b/.github/workflows/sync-docs.yml index 79b5a9727f..01f683a622 100644 --- a/.github/workflows/sync-docs.yml +++ b/.github/workflows/sync-docs.yml @@ -20,7 +20,7 @@ jobs: - uses: pnpm/action-setup@v4 - uses: actions/setup-node@v4 with: - node-version: 22 + node-version: 24 cache: pnpm - run: pnpm install --frozen-lockfile diff --git a/apps/svelte.dev/package.json b/apps/svelte.dev/package.json index c64e02ec2b..04e9eca6a1 100644 --- a/apps/svelte.dev/package.json +++ b/apps/svelte.dev/package.json @@ -13,7 +13,7 @@ "check": "node scripts/update.js && svelte-kit sync && svelte-check", "format": "prettier --write .", "lint": "prettier --check .", - "sync-docs": "tsx scripts/sync-docs/index.ts", + "sync-docs": "node scripts/sync-docs/index.ts", "sync-packages": "node scripts/sync-packages/index.ts" }, "dependencies": { @@ -79,7 +79,6 @@ "svelte-check": "^4.3.1", "svelte-preprocess": "^6.0.3", "tiny-glob": "^0.2.9", - "tsx": "^4.19.0", "typescript": "^5.5.4", "valibot": "^1.1.0", "vite": "^7.0.4", diff --git a/packages/site-kit/src/lib/markdown/index.ts b/packages/site-kit/src/lib/markdown/index.ts index eca67cde79..a523e1d603 100644 --- a/packages/site-kit/src/lib/markdown/index.ts +++ b/packages/site-kit/src/lib/markdown/index.ts @@ -1,6 +1,6 @@ -export { render_content_markdown } from './renderer'; +export { render_content_markdown } from './renderer.ts'; -export { transform, slugify, clean, strip_origin } from './utils'; +export { transform, slugify, clean, strip_origin } from './utils.ts'; // TODO none of these really belong here export type Modules = Array<{ diff --git a/packages/site-kit/src/lib/markdown/preprocess.ts b/packages/site-kit/src/lib/markdown/preprocess.ts index 4d9eded6c1..740c1dd8b9 100644 --- a/packages/site-kit/src/lib/markdown/preprocess.ts +++ b/packages/site-kit/src/lib/markdown/preprocess.ts @@ -1,7 +1,7 @@ import fs from 'node:fs'; import path from 'node:path'; -import { SHIKI_LANGUAGE_MAP, strip_origin } from './utils'; -import type { Declaration, TypeElement, Modules } from './index'; +import { SHIKI_LANGUAGE_MAP, strip_origin } from './utils.ts'; +import type { Declaration, TypeElement, Modules } from './index.ts'; /** * Replace module/export placeholders during `sync-docs` diff --git a/packages/site-kit/src/lib/markdown/renderer.ts b/packages/site-kit/src/lib/markdown/renderer.ts index aaafcdfbe3..e8e678fc5c 100644 --- a/packages/site-kit/src/lib/markdown/renderer.ts +++ b/packages/site-kit/src/lib/markdown/renderer.ts @@ -9,7 +9,7 @@ import { createHighlighterCore } from 'shiki/core'; import { createOnigurumaEngine } from 'shiki/engine/oniguruma'; import { createCssVariablesTheme } from 'shiki'; import { transformerTwoslash } from '@shikijs/twoslash'; -import { SHIKI_LANGUAGE_MAP, slugify, smart_quotes, transform } from './utils'; +import { SHIKI_LANGUAGE_MAP, slugify, smart_quotes, transform } from './utils.ts'; interface SnippetOptions { file: string | null; diff --git a/packages/site-kit/tsconfig.json b/packages/site-kit/tsconfig.json index 2c3ab4f38f..36b910f512 100644 --- a/packages/site-kit/tsconfig.json +++ b/packages/site-kit/tsconfig.json @@ -11,7 +11,8 @@ "moduleResolution": "bundler", "module": "esnext", "target": "esnext", - "skipLibCheck": true // TODO remove once vite-plugin-svelte exposes PluginOptions + "skipLibCheck": true, // TODO remove once vite-plugin-svelte exposes PluginOptions + "rewriteRelativeImportExtensions": true }, "include": ["./src/**/*.js", "./src/**/*.ts", "./src/**/*.svelte"] } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 566da21973..dac7765697 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -195,9 +195,6 @@ importers: tiny-glob: specifier: ^0.2.9 version: 0.2.9 - tsx: - specifier: ^4.19.0 - version: 4.20.4 typescript: specifier: ^5.5.4 version: 5.8.2 @@ -4789,6 +4786,7 @@ snapshots: get-tsconfig@4.10.1: dependencies: resolve-pkg-maps: 1.0.0 + optional: true gifwrap@0.10.1: dependencies: @@ -5312,7 +5310,8 @@ snapshots: resolve-from@5.0.0: {} - resolve-pkg-maps@1.0.0: {} + resolve-pkg-maps@1.0.0: + optional: true resolve.exports@2.0.2: {} @@ -5659,6 +5658,7 @@ snapshots: get-tsconfig: 4.10.1 optionalDependencies: fsevents: 2.3.3 + optional: true twoslash-protocol@0.3.1: {} From 8d2210ef5c8dda2e7ff090e643c221c256e29280 Mon Sep 17 00:00:00 2001 From: jycouet Date: Fri, 19 Dec 2025 20:06:28 +0100 Subject: [PATCH 2/2] rewriteRelativeImportExtensions --- apps/svelte.dev/scripts/sync-docs/index.ts | 1 + apps/svelte.dev/tsconfig.json | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/svelte.dev/scripts/sync-docs/index.ts b/apps/svelte.dev/scripts/sync-docs/index.ts index 91d024f64f..b271dc21af 100644 --- a/apps/svelte.dev/scripts/sync-docs/index.ts +++ b/apps/svelte.dev/scripts/sync-docs/index.ts @@ -3,6 +3,7 @@ import { preprocess } from '@sveltejs/site-kit/markdown/preprocess'; import path from 'node:path'; import fs from 'node:fs'; import { parseArgs } from 'node:util'; +import process from 'node:process'; import ts from 'typescript'; import glob from 'tiny-glob/sync.js'; import chokidar from 'chokidar'; diff --git a/apps/svelte.dev/tsconfig.json b/apps/svelte.dev/tsconfig.json index fc93cbd940..c58b41a431 100644 --- a/apps/svelte.dev/tsconfig.json +++ b/apps/svelte.dev/tsconfig.json @@ -9,7 +9,8 @@ "skipLibCheck": true, "sourceMap": true, "strict": true, - "moduleResolution": "bundler" + "moduleResolution": "bundler", + "rewriteRelativeImportExtensions": true } // Path aliases are handled by https://kit.svelte.dev/docs/configuration#alias // except $lib which is handled by https://kit.svelte.dev/docs/configuration#files