svelte2tsx 0.6.9 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/index.js +8 -0
  2. package/index.mjs +8 -0
  3. package/package.json +2 -2
package/index.js CHANGED
@@ -6280,6 +6280,14 @@ async function createTsCompilerHost(options, svelteMap) {
6280
6280
  return resolveModuleName(moduleName, containingFile, compilerOptions);
6281
6281
  });
6282
6282
  };
6283
+ // @ts-expect-error remove once we bump dev dep to TS 5
6284
+ host.resolveModuleNameLiterals = (moduleLiterals, containingFile, _redirectedReference, compilerOptions) => {
6285
+ return moduleLiterals.map((moduleLiteral) => {
6286
+ return {
6287
+ resolvedModule: resolveModuleName(moduleLiteral.text, containingFile, compilerOptions)
6288
+ };
6289
+ });
6290
+ };
6283
6291
  function resolveModuleName(name, containingFile, compilerOptions) {
6284
6292
  // Delegate to the TS resolver first.
6285
6293
  // If that does not bring up anything, try the Svelte Module loader
package/index.mjs CHANGED
@@ -6260,6 +6260,14 @@ async function createTsCompilerHost(options, svelteMap) {
6260
6260
  return resolveModuleName(moduleName, containingFile, compilerOptions);
6261
6261
  });
6262
6262
  };
6263
+ // @ts-expect-error remove once we bump dev dep to TS 5
6264
+ host.resolveModuleNameLiterals = (moduleLiterals, containingFile, _redirectedReference, compilerOptions) => {
6265
+ return moduleLiterals.map((moduleLiteral) => {
6266
+ return {
6267
+ resolvedModule: resolveModuleName(moduleLiteral.text, containingFile, compilerOptions)
6268
+ };
6269
+ });
6270
+ };
6263
6271
  function resolveModuleName(name, containingFile, compilerOptions) {
6264
6272
  // Delegate to the TS resolver first.
6265
6273
  // If that does not bring up anything, try the Svelte Module loader
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte2tsx",
3
- "version": "0.6.9",
3
+ "version": "0.6.10",
4
4
  "description": "Convert Svelte components to TSX for type checking",
5
5
  "author": "David Pershouse",
6
6
  "license": "MIT",
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "peerDependencies": {
43
43
  "svelte": "^3.55",
44
- "typescript": "^4.9.4"
44
+ "typescript": "^4.9.4 || ^5.0.0"
45
45
  },
46
46
  "scripts": {
47
47
  "build": "rollup -c",