typescript-svelte-plugin 0.3.42 → 0.3.43

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 (2) hide show
  1. package/dist/src/index.js +6 -18
  2. package/package.json +3 -3
package/dist/src/index.js CHANGED
@@ -7,6 +7,7 @@ const svelte_snapshots_1 = require("./svelte-snapshots");
7
7
  const config_manager_1 = require("./config-manager");
8
8
  const project_svelte_files_1 = require("./project-svelte-files");
9
9
  const utils_1 = require("./utils");
10
+ const svelte2tsx_1 = require("svelte2tsx");
10
11
  function init(modules) {
11
12
  const configManager = new config_manager_1.ConfigManager();
12
13
  let resolvedSvelteTsxFiles;
@@ -133,24 +134,11 @@ function init(modules) {
133
134
  return resolvedSvelteTsxFiles;
134
135
  }
135
136
  const svelteTsPath = (0, path_1.dirname)(require.resolve('svelte2tsx'));
136
- const sveltePath = require.resolve('svelte/compiler', configFilePath ? { paths: [configFilePath] } : undefined);
137
- const VERSION = require(sveltePath).VERSION;
138
- const isSvelte3 = VERSION.split('.')[0] === '3';
139
- const svelteHtmlDeclaration = isSvelte3
140
- ? undefined
141
- : (0, path_1.join)((0, path_1.dirname)(sveltePath), 'svelte-html.d.ts');
142
- const svelteHtmlFallbackIfNotExist = svelteHtmlDeclaration && modules.typescript.sys.fileExists(svelteHtmlDeclaration)
143
- ? svelteHtmlDeclaration
144
- : './svelte-jsx-v4.d.ts';
145
- const svelteTsxFiles = (isSvelte3
146
- ? ['./svelte-shims.d.ts', './svelte-jsx.d.ts', './svelte-native-jsx.d.ts']
147
- : [
148
- './svelte-shims-v4.d.ts',
149
- svelteHtmlFallbackIfNotExist,
150
- './svelte-native-jsx.d.ts'
151
- ]).map((f) => modules.typescript.sys.resolvePath((0, path_1.resolve)(svelteTsPath, f)));
152
- resolvedSvelteTsxFiles = svelteTsxFiles;
153
- return svelteTsxFiles;
137
+ const svelteCompilerPath = require.resolve('svelte/compiler', configFilePath ? { paths: [configFilePath] } : undefined);
138
+ const sveltePath = (0, path_1.dirname)(require.resolve('svelte/package.json', configFilePath ? { paths: [configFilePath] } : undefined));
139
+ const VERSION = require(svelteCompilerPath).VERSION;
140
+ resolvedSvelteTsxFiles = svelte2tsx_1.internalHelpers.get_global_types(modules.typescript.sys, VERSION.split('.')[0] === '3', sveltePath, svelteTsPath, configFilePath);
141
+ return resolvedSvelteTsxFiles;
154
142
  }
155
143
  function isSvelteProjectWithCache(project) {
156
144
  const cached = isSvelteProjectCache.get(project.getProjectName());
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "typescript-svelte-plugin",
3
- "version": "0.3.42",
3
+ "version": "0.3.43",
4
4
  "description": "A TypeScript Plugin providing Svelte intellisense",
5
5
  "main": "dist/src/index.js",
6
6
  "keywords": [
@@ -18,12 +18,12 @@
18
18
  "license": "MIT",
19
19
  "devDependencies": {
20
20
  "@types/node": "^18.0.0",
21
- "typescript": "^5.5.2",
21
+ "typescript": "^5.6.3",
22
22
  "svelte": "^4.2.19"
23
23
  },
24
24
  "dependencies": {
25
25
  "@jridgewell/sourcemap-codec": "^1.5.0",
26
- "svelte2tsx": "~0.7.0"
26
+ "svelte2tsx": "~0.7.23"
27
27
  },
28
28
  "scripts": {
29
29
  "build": "tsc -p ./",