svelte2tsx 0.6.17 → 0.6.18

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 +5 -5
  2. package/index.mjs +5 -5
  3. package/package.json +1 -1
package/index.js CHANGED
@@ -6428,15 +6428,15 @@ async function createTsCompilerHost(options, svelteMap) {
6428
6428
  async function createSvelteMap(config) {
6429
6429
  const svelteFiles = new Map();
6430
6430
  function add(path) {
6431
- var _a, _b;
6432
6431
  const code = ts.sys.readFile(path, 'utf-8');
6433
- const isTsFile = // svelte-preprocess allows default languages
6434
- ['ts', 'typescript'].includes((_b = (_a = config.preprocess) === null || _a === void 0 ? void 0 : _a.defaultLanguages) === null || _b === void 0 ? void 0 : _b.script) ||
6435
- /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
6432
+ const isTsFile = /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
6436
6433
  const transformed = svelte2tsx(code, {
6437
6434
  filename: path,
6438
6435
  isTsFile,
6439
- mode: 'dts'
6436
+ mode: 'dts',
6437
+ noSvelteComponentTyped: config.svelteShimsPath
6438
+ .replace(/\\/g, '/')
6439
+ .endsWith('svelte2tsx/svelte-shims-v4.d.ts')
6440
6440
  }).code;
6441
6441
  svelteFiles.set(path, transformed);
6442
6442
  return isTsFile;
package/index.mjs CHANGED
@@ -6408,15 +6408,15 @@ async function createTsCompilerHost(options, svelteMap) {
6408
6408
  async function createSvelteMap(config) {
6409
6409
  const svelteFiles = new Map();
6410
6410
  function add(path) {
6411
- var _a, _b;
6412
6411
  const code = ts.sys.readFile(path, 'utf-8');
6413
- const isTsFile = // svelte-preprocess allows default languages
6414
- ['ts', 'typescript'].includes((_b = (_a = config.preprocess) === null || _a === void 0 ? void 0 : _a.defaultLanguages) === null || _b === void 0 ? void 0 : _b.script) ||
6415
- /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
6412
+ const isTsFile = /<script\s+[^>]*?lang=('|")(ts|typescript)('|")/.test(code);
6416
6413
  const transformed = svelte2tsx(code, {
6417
6414
  filename: path,
6418
6415
  isTsFile,
6419
- mode: 'dts'
6416
+ mode: 'dts',
6417
+ noSvelteComponentTyped: config.svelteShimsPath
6418
+ .replace(/\\/g, '/')
6419
+ .endsWith('svelte2tsx/svelte-shims-v4.d.ts')
6420
6420
  }).code;
6421
6421
  svelteFiles.set(path, transformed);
6422
6422
  return isTsFile;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte2tsx",
3
- "version": "0.6.17",
3
+ "version": "0.6.18",
4
4
  "description": "Convert Svelte components to TSX for type checking",
5
5
  "author": "David Pershouse",
6
6
  "license": "MIT",