From 5fd318dbcbbe5f4569aee9304d93af02beb76e93 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 21 Nov 2023 16:08:51 +0100 Subject: [PATCH 1/3] fix: overwrite nodenext option when transpiling transpileModule treats NodeNext as CommonJS because it doesn't read the package.json. Therefore we need to override it. Also see https://github.com/microsoft/TypeScript/issues/53022 (the filename workaround doesn't work). Fixes #11086 --- .changeset/wild-rats-sell.md | 5 +++++ packages/package/src/typescript.js | 10 +++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 .changeset/wild-rats-sell.md diff --git a/.changeset/wild-rats-sell.md b/.changeset/wild-rats-sell.md new file mode 100644 index 000000000000..8fca26bbf87d --- /dev/null +++ b/.changeset/wild-rats-sell.md @@ -0,0 +1,5 @@ +--- +'@sveltejs/package': patch +--- + +fix: overwrite nodenext option when transpiling diff --git a/packages/package/src/typescript.js b/packages/package/src/typescript.js index 7c02e63ffc5a..df84b1d1f60c 100644 --- a/packages/package/src/typescript.js +++ b/packages/package/src/typescript.js @@ -67,8 +67,16 @@ export async function emit_dts(input, output, cwd, alias, files) { */ export async function transpile_ts(filename, source) { const ts = await try_load_ts(); + const options = load_tsconfig(filename, ts); + // transpileModule treats NodeNext as CommonJS because it doesn't read the package.json. Therefore we need to override it. + // Also see https://github.com/microsoft/TypeScript/issues/53022 (the filename workaround doesn't work). return ts.transpileModule(source, { - compilerOptions: load_tsconfig(filename, ts), + compilerOptions: { + ...options, + target: ts.ScriptTarget.ESNext, + module: ts.ModuleKind.ESNext, + moduleResolution: ts.ModuleResolutionKind.NodeJs // switch this to bundler in the next major, although it probably doesn't make a difference + }, fileName: filename }).outputText; } From 3550e6c3be3c7112fbdf0ff0e92b4b64c761db16 Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Tue, 21 Nov 2023 16:47:08 +0100 Subject: [PATCH 2/3] test, bump svelte-preprocess --- packages/kit/package.json | 2 +- packages/package/package.json | 2 +- packages/package/src/typescript.js | 1 - .../typescript-nodenext/expected/Test.svelte | 8 ++ .../expected/Test.svelte.d.ts | 23 ++++++ .../typescript-nodenext/expected/index.d.ts | 1 + .../typescript-nodenext/expected/index.js | 1 + .../fixtures/typescript-nodenext/package.json | 16 ++++ .../typescript-nodenext/src/lib/Test.svelte | 9 +++ .../typescript-nodenext/src/lib/index.ts | 1 + .../typescript-nodenext/svelte.config.js | 5 ++ .../typescript-nodenext/tsconfig.json | 7 ++ packages/package/test/index.js | 4 + pnpm-lock.yaml | 74 +++++++++---------- 14 files changed, 114 insertions(+), 40 deletions(-) create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte.d.ts create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/index.d.ts create mode 100644 packages/package/test/fixtures/typescript-nodenext/expected/index.js create mode 100644 packages/package/test/fixtures/typescript-nodenext/package.json create mode 100644 packages/package/test/fixtures/typescript-nodenext/src/lib/Test.svelte create mode 100644 packages/package/test/fixtures/typescript-nodenext/src/lib/index.ts create mode 100644 packages/package/test/fixtures/typescript-nodenext/svelte.config.js create mode 100644 packages/package/test/fixtures/typescript-nodenext/tsconfig.json diff --git a/packages/kit/package.json b/packages/kit/package.json index 096af04a83c2..a1ee137dd612 100644 --- a/packages/kit/package.json +++ b/packages/kit/package.json @@ -34,7 +34,7 @@ "dts-buddy": "^0.2.4", "rollup": "^3.29.4", "svelte": "^4.2.2", - "svelte-preprocess": "^5.0.4", + "svelte-preprocess": "^5.1.1", "typescript": "^4.9.4", "vite": "^4.4.9", "vitest": "^0.34.5" diff --git a/packages/package/package.json b/packages/package/package.json index fc67a95a2de7..33a8ed168614 100644 --- a/packages/package/package.json +++ b/packages/package/package.json @@ -21,7 +21,7 @@ "@types/node": "^16.18.6", "@types/semver": "^7.5.0", "svelte": "^4.2.2", - "svelte-preprocess": "^5.0.4", + "svelte-preprocess": "^5.1.1", "typescript": "^4.9.4", "uvu": "^0.5.6" }, diff --git a/packages/package/src/typescript.js b/packages/package/src/typescript.js index df84b1d1f60c..5d1e79878f57 100644 --- a/packages/package/src/typescript.js +++ b/packages/package/src/typescript.js @@ -73,7 +73,6 @@ export async function transpile_ts(filename, source) { return ts.transpileModule(source, { compilerOptions: { ...options, - target: ts.ScriptTarget.ESNext, module: ts.ModuleKind.ESNext, moduleResolution: ts.ModuleResolutionKind.NodeJs // switch this to bundler in the next major, although it probably doesn't make a difference }, diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte b/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte new file mode 100644 index 000000000000..661b1b8276b0 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte @@ -0,0 +1,8 @@ + + + diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte.d.ts b/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte.d.ts new file mode 100644 index 000000000000..c390c41778f5 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/Test.svelte.d.ts @@ -0,0 +1,23 @@ +import { SvelteComponent } from 'svelte'; +declare const __propDef: { + props: { + astring?: string; + }; + events: { + event: CustomEvent; + } & { + [evt: string]: CustomEvent; + }; + slots: { + default: { + astring: string; + }; + }; +}; +export type TestProps = typeof __propDef.props; +export type TestEvents = typeof __propDef.events; +export type TestSlots = typeof __propDef.slots; +export default class Test extends SvelteComponent { + get astring(): string; +} +export {}; diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/index.d.ts b/packages/package/test/fixtures/typescript-nodenext/expected/index.d.ts new file mode 100644 index 000000000000..4c44188c3648 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/index.d.ts @@ -0,0 +1 @@ +export { default as Test } from './Test.svelte'; diff --git a/packages/package/test/fixtures/typescript-nodenext/expected/index.js b/packages/package/test/fixtures/typescript-nodenext/expected/index.js new file mode 100644 index 000000000000..4c44188c3648 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/expected/index.js @@ -0,0 +1 @@ +export { default as Test } from './Test.svelte'; diff --git a/packages/package/test/fixtures/typescript-nodenext/package.json b/packages/package/test/fixtures/typescript-nodenext/package.json new file mode 100644 index 000000000000..d55abe5867ee --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/package.json @@ -0,0 +1,16 @@ +{ + "name": "typescript-nodenext", + "private": true, + "version": "1.0.0", + "description": "typescript package using nodenext", + "type": "module", + "peerDependencies": { + "svelte": "^4.0.0" + }, + "exports": { + ".": { + "types": "./dist/index.d.ts", + "svelte": "./dist/index.js" + } + } +} diff --git a/packages/package/test/fixtures/typescript-nodenext/src/lib/Test.svelte b/packages/package/test/fixtures/typescript-nodenext/src/lib/Test.svelte new file mode 100644 index 000000000000..9ad736f2323d --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/src/lib/Test.svelte @@ -0,0 +1,9 @@ + + + diff --git a/packages/package/test/fixtures/typescript-nodenext/src/lib/index.ts b/packages/package/test/fixtures/typescript-nodenext/src/lib/index.ts new file mode 100644 index 000000000000..4c44188c3648 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/src/lib/index.ts @@ -0,0 +1 @@ +export { default as Test } from './Test.svelte'; diff --git a/packages/package/test/fixtures/typescript-nodenext/svelte.config.js b/packages/package/test/fixtures/typescript-nodenext/svelte.config.js new file mode 100644 index 000000000000..6998f839a272 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/svelte.config.js @@ -0,0 +1,5 @@ +import preprocess from 'svelte-preprocess'; + +export default { + preprocess: preprocess({}) +}; diff --git a/packages/package/test/fixtures/typescript-nodenext/tsconfig.json b/packages/package/test/fixtures/typescript-nodenext/tsconfig.json new file mode 100644 index 000000000000..b2f060f0d1e8 --- /dev/null +++ b/packages/package/test/fixtures/typescript-nodenext/tsconfig.json @@ -0,0 +1,7 @@ +{ + "compilerOptions": { + "target": "ESNext", + "module": "NodeNext", + "moduleResolution": "NodeNext" + } +} diff --git a/packages/package/test/index.js b/packages/package/test/index.js index 3128aa73962c..9996e4a48e02 100644 --- a/packages/package/test/index.js +++ b/packages/package/test/index.js @@ -127,6 +127,10 @@ test('create standard package with typescript', async () => { await test_make_package('typescript'); }); +test('create standard package with typescript using nodenext', async () => { + await test_make_package('typescript-nodenext'); +}); + test('create package and assets are not tampered', async () => { await test_make_package('assets'); }); diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 511fc40f0d5f..942422ca97a0 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -22,13 +22,13 @@ importers: version: 15.0.1(rollup@3.29.4) '@sveltejs/eslint-config': specifier: ^6.0.4 - version: 6.0.4(@typescript-eslint/eslint-plugin@6.0.0)(@typescript-eslint/parser@6.10.0)(eslint-config-prettier@9.0.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.52.0)(typescript@4.9.4) + version: 6.0.4(@typescript-eslint/eslint-plugin@6.0.0)(@typescript-eslint/parser@6.12.0)(eslint-config-prettier@9.0.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.52.0)(typescript@4.9.4) '@svitejs/changesets-changelog-github-compact': specifier: ^1.1.0 version: 1.1.0 '@typescript-eslint/eslint-plugin': specifier: ^6.0.0 - version: 6.0.0(@typescript-eslint/parser@6.10.0)(eslint@8.52.0)(typescript@4.9.4) + version: 6.0.0(@typescript-eslint/parser@6.12.0)(eslint@8.52.0)(typescript@4.9.4) eslint: specifier: ^8.52.0 version: 8.52.0 @@ -460,8 +460,8 @@ importers: specifier: ^4.2.2 version: 4.2.2 svelte-preprocess: - specifier: ^5.0.4 - version: 5.0.4(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4) + specifier: ^5.1.1 + version: 5.1.1(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4) typescript: specifier: ^4.9.4 version: 4.9.4 @@ -996,8 +996,8 @@ importers: specifier: ^4.2.2 version: 4.2.2 svelte-preprocess: - specifier: ^5.0.4 - version: 5.0.4(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4) + specifier: ^5.1.1 + version: 5.1.1(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4) typescript: specifier: ^4.9.4 version: 4.9.4 @@ -2034,7 +2034,7 @@ packages: resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==} dev: true - /@sveltejs/eslint-config@6.0.4(@typescript-eslint/eslint-plugin@6.0.0)(@typescript-eslint/parser@6.10.0)(eslint-config-prettier@9.0.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.52.0)(typescript@4.9.4): + /@sveltejs/eslint-config@6.0.4(@typescript-eslint/eslint-plugin@6.0.0)(@typescript-eslint/parser@6.12.0)(eslint-config-prettier@9.0.0)(eslint-plugin-svelte@2.31.0)(eslint-plugin-unicorn@49.0.0)(eslint@8.52.0)(typescript@4.9.4): resolution: {integrity: sha512-U9pwmDs+DbmsnCgTfu6Bacdwqn0DuI1IQNSiQqTgzVyYfaaj+zy9ZoQCiJfxFBGXHkklyXuRHp0KMx346N0lcQ==} peerDependencies: '@typescript-eslint/eslint-plugin': '>= 5' @@ -2045,8 +2045,8 @@ packages: eslint-plugin-unicorn: '>= 47' typescript: '>= 4' dependencies: - '@typescript-eslint/eslint-plugin': 6.0.0(@typescript-eslint/parser@6.10.0)(eslint@8.52.0)(typescript@4.9.4) - '@typescript-eslint/parser': 6.10.0(eslint@8.52.0)(typescript@4.9.4) + '@typescript-eslint/eslint-plugin': 6.0.0(@typescript-eslint/parser@6.12.0)(eslint@8.52.0)(typescript@4.9.4) + '@typescript-eslint/parser': 6.12.0(eslint@8.52.0)(typescript@4.9.4) eslint: 8.52.0 eslint-config-prettier: 9.0.0(eslint@8.52.0) eslint-plugin-svelte: 2.31.0(eslint@8.52.0)(svelte@4.2.2) @@ -2226,7 +2226,7 @@ packages: '@types/node': 16.18.6 dev: true - /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.10.0)(eslint@8.52.0)(typescript@4.9.4): + /@typescript-eslint/eslint-plugin@6.0.0(@typescript-eslint/parser@6.12.0)(eslint@8.52.0)(typescript@4.9.4): resolution: {integrity: sha512-xuv6ghKGoiq856Bww/yVYnXGsKa588kY3M0XK7uUW/3fJNNULKRfZfSBkMTSpqGG/8ZCXCadfh8G/z/B4aqS/A==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -2238,7 +2238,7 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.6.2 - '@typescript-eslint/parser': 6.10.0(eslint@8.52.0)(typescript@4.9.4) + '@typescript-eslint/parser': 6.12.0(eslint@8.52.0)(typescript@4.9.4) '@typescript-eslint/scope-manager': 6.0.0 '@typescript-eslint/type-utils': 6.0.0(eslint@8.52.0)(typescript@4.9.4) '@typescript-eslint/utils': 6.0.0(eslint@8.52.0)(typescript@4.9.4) @@ -2257,8 +2257,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@6.10.0(eslint@8.52.0)(typescript@4.9.4): - resolution: {integrity: sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==} + /@typescript-eslint/parser@6.12.0(eslint@8.52.0)(typescript@4.9.4): + resolution: {integrity: sha512-s8/jNFPKPNRmXEnNXfuo1gemBdVmpQsK1pcu+QIvuNJuhFzGrpD7WjOcvDc/+uEdfzSYpNu7U/+MmbScjoQ6vg==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 @@ -2267,10 +2267,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 6.10.0 - '@typescript-eslint/types': 6.10.0 - '@typescript-eslint/typescript-estree': 6.10.0(typescript@4.9.4) - '@typescript-eslint/visitor-keys': 6.10.0 + '@typescript-eslint/scope-manager': 6.12.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/typescript-estree': 6.12.0(typescript@4.9.4) + '@typescript-eslint/visitor-keys': 6.12.0 debug: 4.3.4 eslint: 8.52.0 typescript: 4.9.4 @@ -2286,12 +2286,12 @@ packages: '@typescript-eslint/visitor-keys': 6.0.0 dev: true - /@typescript-eslint/scope-manager@6.10.0: - resolution: {integrity: sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==} + /@typescript-eslint/scope-manager@6.12.0: + resolution: {integrity: sha512-5gUvjg+XdSj8pcetdL9eXJzQNTl3RD7LgUiYTl8Aabdi8hFkaGSYnaS6BLc0BGNaDH+tVzVwmKtWvu0jLgWVbw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.10.0 - '@typescript-eslint/visitor-keys': 6.10.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/visitor-keys': 6.12.0 dev: true /@typescript-eslint/type-utils@6.0.0(eslint@8.52.0)(typescript@4.9.4): @@ -2319,8 +2319,8 @@ packages: engines: {node: ^16.0.0 || >=18.0.0} dev: true - /@typescript-eslint/types@6.10.0: - resolution: {integrity: sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==} + /@typescript-eslint/types@6.12.0: + resolution: {integrity: sha512-MA16p/+WxM5JG/F3RTpRIcuOghWO30//VEOvzubM8zuOOBYXsP+IfjoCXXiIfy2Ta8FRh9+IO9QLlaFQUU+10Q==} engines: {node: ^16.0.0 || >=18.0.0} dev: true @@ -2345,8 +2345,8 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@6.10.0(typescript@4.9.4): - resolution: {integrity: sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==} + /@typescript-eslint/typescript-estree@6.12.0(typescript@4.9.4): + resolution: {integrity: sha512-vw9E2P9+3UUWzhgjyyVczLWxZ3GuQNT7QpnIY3o5OMeLO/c8oHljGc8ZpryBMIyympiAAaKgw9e5Hl9dCWFOYw==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: typescript: '*' @@ -2354,8 +2354,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 6.10.0 - '@typescript-eslint/visitor-keys': 6.10.0 + '@typescript-eslint/types': 6.12.0 + '@typescript-eslint/visitor-keys': 6.12.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -2394,11 +2394,11 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@6.10.0: - resolution: {integrity: sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==} + /@typescript-eslint/visitor-keys@6.12.0: + resolution: {integrity: sha512-rg3BizTZHF1k3ipn8gfrzDXXSFKyOEB5zxYXInQ6z0hUvmQlhaZQzK+YmHmNViMA9HzW5Q9+bPPt90bU6GQwyw==} engines: {node: ^16.0.0 || >=18.0.0} dependencies: - '@typescript-eslint/types': 6.10.0 + '@typescript-eslint/types': 6.12.0 eslint-visitor-keys: 3.4.3 dev: true @@ -5744,7 +5744,7 @@ packages: picocolors: 1.0.0 sade: 1.8.1 svelte: 4.2.2 - svelte-preprocess: 5.0.4(postcss@8.4.31)(svelte@4.2.2)(typescript@5.0.4) + svelte-preprocess: 5.1.1(postcss@8.4.31)(svelte@4.2.2)(typescript@5.0.4) typescript: 5.0.4 transitivePeerDependencies: - '@babel/core' @@ -5801,8 +5801,8 @@ packages: svelte: 4.2.2 dev: false - /svelte-preprocess@5.0.4(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4): - resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} + /svelte-preprocess@5.1.1(postcss@8.4.31)(svelte@4.2.2)(typescript@4.9.4): + resolution: {integrity: sha512-p/Dp4hmrBW5mrCCq29lEMFpIJT2FZsRlouxEc5qpbOmXRbaFs7clLs8oKPwD3xCFyZfv1bIhvOzpQkhMEVQdMw==} engines: {node: '>= 14.10.0'} requiresBuild: true peerDependencies: @@ -5815,7 +5815,7 @@ packages: sass: ^1.26.8 stylus: ^0.55.0 sugarss: ^2.0.0 || ^3.0.0 || ^4.0.0 - svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 + svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 typescript: '>=3.9.5 || ^4.0.0 || ^5.0.0' peerDependenciesMeta: '@babel/core': @@ -5849,8 +5849,8 @@ packages: typescript: 4.9.4 dev: true - /svelte-preprocess@5.0.4(postcss@8.4.31)(svelte@4.2.2)(typescript@5.0.4): - resolution: {integrity: sha512-ABia2QegosxOGsVlsSBJvoWeXy1wUKSfF7SWJdTjLAbx/Y3SrVevvvbFNQqrSJw89+lNSsM58SipmZJ5SRi5iw==} + /svelte-preprocess@5.1.1(postcss@8.4.31)(svelte@4.2.2)(typescript@5.0.4): + resolution: {integrity: sha512-p/Dp4hmrBW5mrCCq29lEMFpIJT2FZsRlouxEc5qpbOmXRbaFs7clLs8oKPwD3xCFyZfv1bIhvOzpQkhMEVQdMw==} engines: {node: '>= 14.10.0'} requiresBuild: true peerDependencies: @@ -5863,7 +5863,7 @@ packages: sass: ^1.26.8 stylus: ^0.55.0 sugarss: ^2.0.0 || ^3.0.0 || ^4.0.0 - svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 + svelte: ^3.23.0 || ^4.0.0-next.0 || ^4.0.0 || ^5.0.0-next.0 typescript: '>=3.9.5 || ^4.0.0 || ^5.0.0' peerDependenciesMeta: '@babel/core': From 9162fdda7d3b2af73296383e89ca39fbc470620c Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Wed, 22 Nov 2023 10:39:14 +0100 Subject: [PATCH 3/3] rename stuff --- .../expected/Plain.svelte | 0 .../expected/Plain.svelte.d.ts | 0 .../expected/Test.svelte | 0 .../expected/Test.svelte.d.ts | 0 .../expected/Test2.svelte | 0 .../expected/Test2.svelte.d.ts | 0 .../{typescript => typescript-esnext}/expected/foo.d.ts | 0 .../{typescript => typescript-esnext}/expected/index.d.ts | 0 .../{typescript => typescript-esnext}/expected/index.js | 0 .../{typescript => typescript-esnext}/expected/utils.d.ts | 0 .../{typescript => typescript-esnext}/expected/utils.js | 0 .../{typescript => typescript-esnext}/package.json | 2 +- .../src/lib/Plain.svelte | 0 .../{typescript => typescript-esnext}/src/lib/Test.svelte | 0 .../src/lib/Test2.svelte | 0 .../{typescript => typescript-esnext}/src/lib/foo.d.ts | 0 .../{typescript => typescript-esnext}/src/lib/index.ts | 0 .../{typescript => typescript-esnext}/src/lib/utils.ts | 0 .../{typescript => typescript-esnext}/svelte.config.js | 0 .../{typescript => typescript-esnext}/tsconfig.json | 0 packages/package/test/index.js | 8 ++++---- 21 files changed, 5 insertions(+), 5 deletions(-) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Plain.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Plain.svelte.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Test.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Test.svelte.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Test2.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/Test2.svelte.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/foo.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/index.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/index.js (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/utils.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/expected/utils.js (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/package.json (81%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/Plain.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/Test.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/Test2.svelte (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/foo.d.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/index.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/src/lib/utils.ts (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/svelte.config.js (100%) rename packages/package/test/fixtures/{typescript => typescript-esnext}/tsconfig.json (100%) diff --git a/packages/package/test/fixtures/typescript/expected/Plain.svelte b/packages/package/test/fixtures/typescript-esnext/expected/Plain.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Plain.svelte rename to packages/package/test/fixtures/typescript-esnext/expected/Plain.svelte diff --git a/packages/package/test/fixtures/typescript/expected/Plain.svelte.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/Plain.svelte.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Plain.svelte.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/Plain.svelte.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/Test.svelte b/packages/package/test/fixtures/typescript-esnext/expected/Test.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Test.svelte rename to packages/package/test/fixtures/typescript-esnext/expected/Test.svelte diff --git a/packages/package/test/fixtures/typescript/expected/Test.svelte.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/Test.svelte.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Test.svelte.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/Test.svelte.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/Test2.svelte b/packages/package/test/fixtures/typescript-esnext/expected/Test2.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Test2.svelte rename to packages/package/test/fixtures/typescript-esnext/expected/Test2.svelte diff --git a/packages/package/test/fixtures/typescript/expected/Test2.svelte.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/Test2.svelte.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/Test2.svelte.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/Test2.svelte.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/foo.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/foo.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/foo.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/foo.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/index.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/index.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/index.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/index.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/index.js b/packages/package/test/fixtures/typescript-esnext/expected/index.js similarity index 100% rename from packages/package/test/fixtures/typescript/expected/index.js rename to packages/package/test/fixtures/typescript-esnext/expected/index.js diff --git a/packages/package/test/fixtures/typescript/expected/utils.d.ts b/packages/package/test/fixtures/typescript-esnext/expected/utils.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/expected/utils.d.ts rename to packages/package/test/fixtures/typescript-esnext/expected/utils.d.ts diff --git a/packages/package/test/fixtures/typescript/expected/utils.js b/packages/package/test/fixtures/typescript-esnext/expected/utils.js similarity index 100% rename from packages/package/test/fixtures/typescript/expected/utils.js rename to packages/package/test/fixtures/typescript-esnext/expected/utils.js diff --git a/packages/package/test/fixtures/typescript/package.json b/packages/package/test/fixtures/typescript-esnext/package.json similarity index 81% rename from packages/package/test/fixtures/typescript/package.json rename to packages/package/test/fixtures/typescript-esnext/package.json index 3d104f4558c7..6dac2ac90c18 100644 --- a/packages/package/test/fixtures/typescript/package.json +++ b/packages/package/test/fixtures/typescript-esnext/package.json @@ -2,7 +2,7 @@ "name": "typescript", "private": true, "version": "1.0.0", - "description": "standard typescript package", + "description": "typescript package using esnext", "type": "module", "peerDependencies": { "svelte": "^4.0.0" diff --git a/packages/package/test/fixtures/typescript/src/lib/Plain.svelte b/packages/package/test/fixtures/typescript-esnext/src/lib/Plain.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/Plain.svelte rename to packages/package/test/fixtures/typescript-esnext/src/lib/Plain.svelte diff --git a/packages/package/test/fixtures/typescript/src/lib/Test.svelte b/packages/package/test/fixtures/typescript-esnext/src/lib/Test.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/Test.svelte rename to packages/package/test/fixtures/typescript-esnext/src/lib/Test.svelte diff --git a/packages/package/test/fixtures/typescript/src/lib/Test2.svelte b/packages/package/test/fixtures/typescript-esnext/src/lib/Test2.svelte similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/Test2.svelte rename to packages/package/test/fixtures/typescript-esnext/src/lib/Test2.svelte diff --git a/packages/package/test/fixtures/typescript/src/lib/foo.d.ts b/packages/package/test/fixtures/typescript-esnext/src/lib/foo.d.ts similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/foo.d.ts rename to packages/package/test/fixtures/typescript-esnext/src/lib/foo.d.ts diff --git a/packages/package/test/fixtures/typescript/src/lib/index.ts b/packages/package/test/fixtures/typescript-esnext/src/lib/index.ts similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/index.ts rename to packages/package/test/fixtures/typescript-esnext/src/lib/index.ts diff --git a/packages/package/test/fixtures/typescript/src/lib/utils.ts b/packages/package/test/fixtures/typescript-esnext/src/lib/utils.ts similarity index 100% rename from packages/package/test/fixtures/typescript/src/lib/utils.ts rename to packages/package/test/fixtures/typescript-esnext/src/lib/utils.ts diff --git a/packages/package/test/fixtures/typescript/svelte.config.js b/packages/package/test/fixtures/typescript-esnext/svelte.config.js similarity index 100% rename from packages/package/test/fixtures/typescript/svelte.config.js rename to packages/package/test/fixtures/typescript-esnext/svelte.config.js diff --git a/packages/package/test/fixtures/typescript/tsconfig.json b/packages/package/test/fixtures/typescript-esnext/tsconfig.json similarity index 100% rename from packages/package/test/fixtures/typescript/tsconfig.json rename to packages/package/test/fixtures/typescript-esnext/tsconfig.json diff --git a/packages/package/test/index.js b/packages/package/test/index.js index 9996e4a48e02..ec323577817b 100644 --- a/packages/package/test/index.js +++ b/packages/package/test/index.js @@ -117,17 +117,17 @@ for (const dir of fs.readdirSync(join(__dirname, 'errors'))) { }); } -test('create standard package with javascript', async () => { +test('create package with javascript', async () => { // should also preserve filename casing // should also correctly handle nested folders await test_make_package('javascript'); }); -test('create standard package with typescript', async () => { - await test_make_package('typescript'); +test('create package with typescript using esnext', async () => { + await test_make_package('typescript-esnext'); }); -test('create standard package with typescript using nodenext', async () => { +test('create package with typescript using nodenext', async () => { await test_make_package('typescript-nodenext'); });