@tsslint/core 1.3.1 → 1.3.2

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/lib/watch.js +18 -10
  2. package/package.json +3 -3
package/lib/watch.js CHANGED
@@ -84,23 +84,31 @@ async function watchConfigFile(configFilePath, onBuild, watch = true, createHash
84
84
  build.onStart(() => {
85
85
  start = Date.now();
86
86
  });
87
- build.onResolve({ filter: /^https?:\/\// }, async ({ path: url }) => {
88
- const cachePath = _path.join(outDir, url.split('://')[0], ...url.split('://')[1].split('/'));
87
+ build.onResolve({ filter: /^https?:\/\// }, async ({ path: importUrl }) => {
88
+ const cachePath = _path.join(outDir, importUrl.split('://')[0], ...importUrl.split('://')[1].split('/'));
89
89
  if (!fs.existsSync(cachePath)) {
90
- console.time('Download ' + url);
91
- const response = await fetch(url);
90
+ console.time('Download ' + importUrl);
91
+ const response = await fetch(importUrl);
92
92
  if (!response.ok) {
93
- throw new Error(`Failed to load ${url}`);
93
+ throw new Error(`Failed to load ${importUrl}`);
94
94
  }
95
- console.timeEnd('Download ' + url);
95
+ console.timeEnd('Download ' + importUrl);
96
96
  const text = await response.text();
97
97
  fs.mkdirSync(_path.dirname(cachePath), { recursive: true });
98
98
  fs.writeFileSync(cachePath, text, 'utf8');
99
99
  }
100
- return {
101
- path: cachePath,
102
- external: !isTsFile(cachePath),
103
- };
100
+ if (isTsFile(cachePath)) {
101
+ return {
102
+ path: cachePath,
103
+ external: false,
104
+ };
105
+ }
106
+ else {
107
+ return {
108
+ path: url.pathToFileURL(cachePath).toString(),
109
+ external: true,
110
+ };
111
+ }
104
112
  });
105
113
  build.onResolve({ filter: /.*/ }, ({ path, resolveDir }) => {
106
114
  if (!isTsFile(path)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsslint/core",
3
- "version": "1.3.1",
3
+ "version": "1.3.2",
4
4
  "license": "MIT",
5
5
  "files": [
6
6
  "**/*.js",
@@ -12,11 +12,11 @@
12
12
  "directory": "packages/core"
13
13
  },
14
14
  "dependencies": {
15
- "@tsslint/types": "1.3.1",
15
+ "@tsslint/types": "1.3.2",
16
16
  "error-stack-parser": "^2.1.4",
17
17
  "esbuild": ">=0.17.0",
18
18
  "minimatch": "^10.0.1",
19
19
  "source-map-support": "^0.5.21"
20
20
  },
21
- "gitHead": "ddc73232699ecd7b4e4bfe5c9b511254c5926986"
21
+ "gitHead": "5685591d29322054ecb4f8b94eb35eab370d8288"
22
22
  }