From 6f9526b8b0e16f6226309e7ad2322aca4ba8f0d9 Mon Sep 17 00:00:00 2001 From: Simon H <5968653+dummdidumm@users.noreply.github.com> Date: Fri, 12 Jan 2024 16:10:22 +0100 Subject: [PATCH] chore: bump svelte2tsx dependency (#11619) * chore: bump svelte2tsx dependency ...to support generating types for `.svelte.ts` files Related: https://github.com/sveltejs/language-tools/issues/2241 * peer dep 5.0 * lint --------- Co-authored-by: Rich Harris --- .changeset/gold-cycles-whisper.md | 5 +++++ packages/package/package.json | 4 ++-- .../test/fixtures/javascript/expected/internal/index.d.ts | 1 + .../test/fixtures/javascript/expected/internal/index.js | 1 + .../javascript/expected/internal/runes.svelte.d.ts | 1 + .../fixtures/javascript/expected/internal/runes.svelte.js | 1 + .../test/fixtures/javascript/src/lib/internal/index.js | 1 + .../fixtures/javascript/src/lib/internal/runes.svelte.js | 1 + .../fixtures/typescript-esnext/expected/runes.svelte.d.ts | 1 + .../fixtures/typescript-esnext/expected/runes.svelte.js | 1 + .../fixtures/typescript-esnext/src/lib/runes.svelte.ts | 1 + .../typescript-nodenext/expected/runes.svelte.d.ts | 1 + .../fixtures/typescript-nodenext/expected/runes.svelte.js | 1 + .../fixtures/typescript-nodenext/src/lib/runes.svelte.ts | 1 + pnpm-lock.yaml | 8 ++++---- 15 files changed, 23 insertions(+), 6 deletions(-) create mode 100644 .changeset/gold-cycles-whisper.md create mode 100644 packages/package/test/fixtures/javascript/expected/internal/runes.svelte.d.ts create mode 100644 packages/package/test/fixtures/javascript/expected/internal/runes.svelte.js create mode 100644 packages/package/test/fixtures/javascript/src/lib/internal/runes.svelte.js create mode 100644 packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.d.ts create mode 100644 packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.js create mode 100644 packages/package/test/fixtures/typescript-esnext/src/lib/runes.svelte.ts create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.d.ts create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.js create mode 100644 packages/package/test/fixtures/typescript-nodenext/src/lib/runes.svelte.ts diff --git a/.changeset/gold-cycles-whisper.md b/.changeset/gold-cycles-whisper.md new file mode 100644 index 000000000000..5df4623bcc28 --- /dev/null +++ b/.changeset/gold-cycles-whisper.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/package': patch +--- + +chore: bump svelte2tsx dependency to support generating types for `.svelte.js/ts` files diff --git a/packages/package/package.json b/packages/package/package.json index 535e5016897a..1ee20f44bf2a 100644 --- a/packages/package/package.json +++ b/packages/package/package.json @@ -15,7 +15,7 @@ "kleur": "^4.1.5", "sade": "^1.8.1", "semver": "^7.5.4", - "svelte2tsx": "~0.6.27" + "svelte2tsx": "~0.7.0" }, "devDependencies": { "@sveltejs/vite-plugin-svelte": "^3.0.1", @@ -27,7 +27,7 @@ "uvu": "^0.5.6" }, "peerDependencies": { - "svelte": "^3.44.0 || ^4.0.0" + "svelte": "^3.44.0 || ^4.0.0 || ^5.0.0-next.1" }, "bin": { "svelte-package": "svelte-package.js" diff --git a/packages/package/test/fixtures/javascript/expected/internal/index.d.ts b/packages/package/test/fixtures/javascript/expected/internal/index.d.ts index e60ad9862f02..69325fd26bd1 100644 --- a/packages/package/test/fixtures/javascript/expected/internal/index.d.ts +++ b/packages/package/test/fixtures/javascript/expected/internal/index.d.ts @@ -1 +1,2 @@ export const foo: 'bar'; +export { x } from "./runes.svelte.js"; diff --git a/packages/package/test/fixtures/javascript/expected/internal/index.js b/packages/package/test/fixtures/javascript/expected/internal/index.js index c155820bf773..b7dfdd870f1b 100644 --- a/packages/package/test/fixtures/javascript/expected/internal/index.js +++ b/packages/package/test/fixtures/javascript/expected/internal/index.js @@ -1 +1,2 @@ export const foo = 'bar'; +export { x } from './runes.svelte.js'; diff --git a/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.d.ts b/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.d.ts new file mode 100644 index 000000000000..ce5b9032906e --- /dev/null +++ b/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.d.ts @@ -0,0 +1 @@ +export const x: true; diff --git a/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.js b/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.js new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/javascript/expected/internal/runes.svelte.js @@ -0,0 +1 @@ +export const x = true; diff --git a/packages/package/test/fixtures/javascript/src/lib/internal/index.js b/packages/package/test/fixtures/javascript/src/lib/internal/index.js index c155820bf773..b7dfdd870f1b 100644 --- a/packages/package/test/fixtures/javascript/src/lib/internal/index.js +++ b/packages/package/test/fixtures/javascript/src/lib/internal/index.js @@ -1 +1,2 @@ export const foo = 'bar'; +export { x } from './runes.svelte.js'; diff --git a/packages/package/test/fixtures/javascript/src/lib/internal/runes.svelte.js b/packages/package/test/fixtures/javascript/src/lib/internal/runes.svelte.js new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/javascript/src/lib/internal/runes.svelte.js @@ -0,0 +1 @@ +export const x = true; diff --git a/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.d.ts new file mode 100644 index 000000000000..2b17805f4351 --- /dev/null +++ b/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.d.ts @@ -0,0 +1 @@ +export declare const x = true; diff --git a/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.js b/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.js new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/typescript-esnext/expected/runes.svelte.js @@ -0,0 +1 @@ +export const x = true; diff --git a/packages/package/test/fixtures/typescript-esnext/src/lib/runes.svelte.ts b/packages/package/test/fixtures/typescript-esnext/src/lib/runes.svelte.ts new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/typescript-esnext/src/lib/runes.svelte.ts @@ -0,0 +1 @@ +export const x = true; diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.d.ts b/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.d.ts new file mode 100644 index 000000000000..2b17805f4351 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.d.ts @@ -0,0 +1 @@ +export declare const x = true; diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.js b/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.js new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/runes.svelte.js @@ -0,0 +1 @@ +export const x = true; diff --git a/packages/package/test/fixtures/typescript-nodenext/src/lib/runes.svelte.ts b/packages/package/test/fixtures/typescript-nodenext/src/lib/runes.svelte.ts new file mode 100644 index 000000000000..30dc55a73230 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/src/lib/runes.svelte.ts @@ -0,0 +1 @@ +export const x = true; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 01ce55b2995d..04135897fe95 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -1133,8 +1133,8 @@ importers: specifier: ^7.5.4 version: 7.5.4 svelte2tsx: - specifier: ~0.6.27 - version: 0.6.27(svelte@4.2.8)(typescript@5.3.3) + specifier: ~0.7.0 + version: 0.7.0(svelte@4.2.8)(typescript@5.3.3) devDependencies: '@sveltejs/vite-plugin-svelte': specifier: ^3.0.1 @@ -6049,8 +6049,8 @@ packages: typescript: 5.3.3 dev: true - /svelte2tsx@0.6.27(svelte@4.2.8)(typescript@5.3.3): - resolution: {integrity: sha512-E1uPW1o6VsbRz+nUk3fznZ2lSmCITAJoNu8AYefWSvIwE2pSB01i5sId4RMbWNzfcwCQl1DcgGShCPcldl4rvg==} + /svelte2tsx@0.7.0(svelte@4.2.8)(typescript@5.3.3): + resolution: {integrity: sha512-qAelcydnmuiDvD1HsrWi23RWx24RZTKRv6n4JaGC/pkoJfbLkJPQT2wa1qN0ZyfKTNLSyoj2FW9z62l/AUzUNA==} peerDependencies: svelte: ^3.55 || ^4.0.0-next.0 || ^4.0 || ^5.0.0-next.0 typescript: ^4.9.4 || ^5.0.0