ts-checker-rspack-plugin 1.5.3 → 1.6.1
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.
- package/lib/getDependenciesWorker.js +78 -30
- package/lib/getIssuesWorker.js +89 -34
- package/lib/index.js +102 -16
- package/lib/typescript/type-script-go-runner.d.ts +5 -7
- package/lib/typescript/worker/get-issues-worker.d.ts +6 -1
- package/lib/typescript/worker/lib/file-system/mem-file-system.d.ts +8 -1
- package/package.json +4 -6
|
@@ -90,32 +90,33 @@ require("node:os");
|
|
|
90
90
|
const worker_config_config = getRpcWorkerData();
|
|
91
91
|
const typescript_typescript = require(worker_config_config.typescriptPath);
|
|
92
92
|
new Map();
|
|
93
|
-
const
|
|
93
|
+
const external_node_module_namespaceObject = require("node:module");
|
|
94
94
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
95
95
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
96
96
|
const existsCache = new Map();
|
|
97
|
+
const normalizedPathCache = new Map();
|
|
97
98
|
const readStatsCache = new Map();
|
|
98
99
|
const readFileCache = new Map();
|
|
99
100
|
const readDirCache = new Map();
|
|
100
101
|
const realPathCache = new Map();
|
|
101
102
|
const realFileSystem = {
|
|
102
103
|
exists (path) {
|
|
103
|
-
return exists(
|
|
104
|
+
return exists(path);
|
|
104
105
|
},
|
|
105
106
|
readFile (path, encoding) {
|
|
106
|
-
return readFile(
|
|
107
|
+
return readFile(path, encoding);
|
|
107
108
|
},
|
|
108
109
|
readDir (path) {
|
|
109
|
-
return readDir(
|
|
110
|
+
return readDir(path);
|
|
110
111
|
},
|
|
111
112
|
readStats (path) {
|
|
112
|
-
return readStats(
|
|
113
|
+
return readStats(path);
|
|
113
114
|
},
|
|
114
115
|
realPath (path) {
|
|
115
116
|
return getRealPath(path);
|
|
116
117
|
},
|
|
117
118
|
normalizePath (path) {
|
|
118
|
-
return (
|
|
119
|
+
return normalizePath(path);
|
|
119
120
|
},
|
|
120
121
|
writeFile (path, data) {
|
|
121
122
|
writeFile(getRealPath(path), data);
|
|
@@ -131,6 +132,7 @@ const realFileSystem = {
|
|
|
131
132
|
},
|
|
132
133
|
clearCache () {
|
|
133
134
|
existsCache.clear();
|
|
135
|
+
normalizedPathCache.clear();
|
|
134
136
|
readStatsCache.clear();
|
|
135
137
|
readFileCache.clear();
|
|
136
138
|
readDirCache.clear();
|
|
@@ -138,19 +140,25 @@ const realFileSystem = {
|
|
|
138
140
|
}
|
|
139
141
|
};
|
|
140
142
|
function exists(path) {
|
|
141
|
-
const normalizedPath = (
|
|
142
|
-
|
|
143
|
-
|
|
143
|
+
const normalizedPath = normalizePath(path);
|
|
144
|
+
return existsNormalized(normalizedPath);
|
|
145
|
+
}
|
|
146
|
+
function existsNormalized(normalizedPath) {
|
|
147
|
+
const cached = existsCache.get(normalizedPath);
|
|
148
|
+
if (void 0 !== cached) return cached;
|
|
149
|
+
const result = external_node_fs_default().existsSync(normalizedPath);
|
|
150
|
+
existsCache.set(normalizedPath, result);
|
|
151
|
+
return result;
|
|
144
152
|
}
|
|
145
153
|
function readStats(path) {
|
|
146
|
-
const normalizedPath = (
|
|
154
|
+
const normalizedPath = normalizePath(path);
|
|
147
155
|
if (!readStatsCache.has(normalizedPath)) {
|
|
148
|
-
if (
|
|
156
|
+
if (existsNormalized(normalizedPath)) readStatsCache.set(normalizedPath, external_node_fs_default().statSync(normalizedPath));
|
|
149
157
|
}
|
|
150
158
|
return readStatsCache.get(normalizedPath);
|
|
151
159
|
}
|
|
152
160
|
function readFile(path, encoding) {
|
|
153
|
-
const normalizedPath = (
|
|
161
|
+
const normalizedPath = normalizePath(path);
|
|
154
162
|
if (!readFileCache.has(normalizedPath)) {
|
|
155
163
|
const stats = readStats(normalizedPath);
|
|
156
164
|
if (stats && stats.isFile()) readFileCache.set(normalizedPath, external_node_fs_default().readFileSync(normalizedPath, {
|
|
@@ -161,7 +169,7 @@ function readFile(path, encoding) {
|
|
|
161
169
|
return readFileCache.get(normalizedPath);
|
|
162
170
|
}
|
|
163
171
|
function readDir(path) {
|
|
164
|
-
const normalizedPath = (
|
|
172
|
+
const normalizedPath = normalizePath(path);
|
|
165
173
|
if (!readDirCache.has(normalizedPath)) {
|
|
166
174
|
const stats = readStats(normalizedPath);
|
|
167
175
|
if (stats && stats.isDirectory()) readDirCache.set(normalizedPath, external_node_fs_default().readdirSync(normalizedPath, {
|
|
@@ -172,13 +180,20 @@ function readDir(path) {
|
|
|
172
180
|
return readDirCache.get(normalizedPath) || [];
|
|
173
181
|
}
|
|
174
182
|
function getRealPath(path) {
|
|
175
|
-
const normalizedPath = (
|
|
183
|
+
const normalizedPath = normalizePath(path);
|
|
176
184
|
if (!realPathCache.has(normalizedPath)) {
|
|
177
185
|
let base = normalizedPath;
|
|
178
186
|
let nested = '';
|
|
179
187
|
while(base !== (0, external_node_path_namespaceObject.dirname)(base)){
|
|
180
|
-
|
|
181
|
-
|
|
188
|
+
const cachedBase = realPathCache.get(base);
|
|
189
|
+
if (cachedBase) {
|
|
190
|
+
realPathCache.set(normalizedPath, (0, external_node_path_namespaceObject.join)(cachedBase, nested));
|
|
191
|
+
break;
|
|
192
|
+
}
|
|
193
|
+
if (existsNormalized(base)) {
|
|
194
|
+
const realBase = normalizePath(realpath(base));
|
|
195
|
+
realPathCache.set(base, realBase);
|
|
196
|
+
realPathCache.set(normalizedPath, (0, external_node_path_namespaceObject.join)(realBase, nested));
|
|
182
197
|
break;
|
|
183
198
|
}
|
|
184
199
|
nested = (0, external_node_path_namespaceObject.join)((0, external_node_path_namespaceObject.basename)(base), nested);
|
|
@@ -187,8 +202,26 @@ function getRealPath(path) {
|
|
|
187
202
|
}
|
|
188
203
|
return realPathCache.get(normalizedPath) || normalizedPath;
|
|
189
204
|
}
|
|
190
|
-
function
|
|
205
|
+
function normalizePath(path) {
|
|
206
|
+
const cached = normalizedPathCache.get(path);
|
|
207
|
+
if (void 0 !== cached) return cached;
|
|
191
208
|
const normalizedPath = (0, external_node_path_namespaceObject.normalize)(path);
|
|
209
|
+
normalizedPathCache.set(path, normalizedPath);
|
|
210
|
+
return normalizedPath;
|
|
211
|
+
}
|
|
212
|
+
function fsRealPathHandlingLongPath(path) {
|
|
213
|
+
return path.length < 260 ? external_node_fs_default().realpathSync.native(path) : external_node_fs_default().realpathSync(path);
|
|
214
|
+
}
|
|
215
|
+
const fsRealpath = external_node_fs_default().realpathSync.native ? 'win32' === process.platform ? fsRealPathHandlingLongPath : external_node_fs_default().realpathSync.native : external_node_fs_default().realpathSync;
|
|
216
|
+
function realpath(path) {
|
|
217
|
+
try {
|
|
218
|
+
return fsRealpath(path);
|
|
219
|
+
} catch {
|
|
220
|
+
return path;
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
function createDir(path) {
|
|
224
|
+
const normalizedPath = normalizePath(path);
|
|
192
225
|
external_node_fs_default().mkdirSync(normalizedPath, {
|
|
193
226
|
recursive: true
|
|
194
227
|
});
|
|
@@ -197,7 +230,7 @@ function createDir(path) {
|
|
|
197
230
|
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
198
231
|
}
|
|
199
232
|
function writeFile(path, data) {
|
|
200
|
-
const normalizedPath = (
|
|
233
|
+
const normalizedPath = normalizePath(path);
|
|
201
234
|
if (!exists((0, external_node_path_namespaceObject.dirname)(normalizedPath))) createDir((0, external_node_path_namespaceObject.dirname)(normalizedPath));
|
|
202
235
|
external_node_fs_default().writeFileSync(normalizedPath, data);
|
|
203
236
|
existsCache.set(normalizedPath, true);
|
|
@@ -207,7 +240,7 @@ function writeFile(path, data) {
|
|
|
207
240
|
}
|
|
208
241
|
function deleteFile(path) {
|
|
209
242
|
if (exists(path)) {
|
|
210
|
-
const normalizedPath = (
|
|
243
|
+
const normalizedPath = normalizePath(path);
|
|
211
244
|
external_node_fs_default().unlinkSync(normalizedPath);
|
|
212
245
|
existsCache.set(normalizedPath, false);
|
|
213
246
|
if (readDirCache.has((0, external_node_path_namespaceObject.dirname)(normalizedPath))) readDirCache.delete((0, external_node_path_namespaceObject.dirname)(normalizedPath));
|
|
@@ -217,13 +250,24 @@ function deleteFile(path) {
|
|
|
217
250
|
}
|
|
218
251
|
function updateTimes(path, atime, mtime) {
|
|
219
252
|
if (exists(path)) {
|
|
220
|
-
const normalizedPath = (
|
|
221
|
-
external_node_fs_default().utimesSync(
|
|
253
|
+
const normalizedPath = normalizePath(path);
|
|
254
|
+
external_node_fs_default().utimesSync(normalizedPath, atime, mtime);
|
|
222
255
|
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
223
256
|
}
|
|
224
257
|
}
|
|
258
|
+
let hasChanges = false;
|
|
259
|
+
let mem;
|
|
260
|
+
const requireModule = (0, external_node_module_namespaceObject.createRequire)(__filename);
|
|
261
|
+
function getMemoryFileSystem() {
|
|
262
|
+
if (mem) return mem;
|
|
263
|
+
mem = requireModule('memfs').fs;
|
|
264
|
+
return mem;
|
|
265
|
+
}
|
|
225
266
|
const memFileSystem = {
|
|
226
267
|
...realFileSystem,
|
|
268
|
+
hasChanges () {
|
|
269
|
+
return hasChanges;
|
|
270
|
+
},
|
|
227
271
|
exists (path) {
|
|
228
272
|
return mem_file_system_exists(realFileSystem.realPath(path));
|
|
229
273
|
},
|
|
@@ -253,38 +297,42 @@ const memFileSystem = {
|
|
|
253
297
|
}
|
|
254
298
|
};
|
|
255
299
|
function mem_file_system_exists(path) {
|
|
256
|
-
return
|
|
300
|
+
return getMemoryFileSystem().existsSync(realFileSystem.normalizePath(path));
|
|
257
301
|
}
|
|
258
302
|
function mem_file_system_readStats(path) {
|
|
259
|
-
return mem_file_system_exists(path) ?
|
|
303
|
+
return mem_file_system_exists(path) ? getMemoryFileSystem().statSync(realFileSystem.normalizePath(path)) : void 0;
|
|
260
304
|
}
|
|
261
305
|
function mem_file_system_readFile(path, encoding) {
|
|
262
306
|
const stats = mem_file_system_readStats(path);
|
|
263
|
-
if (stats && stats.isFile()) return
|
|
307
|
+
if (stats && stats.isFile()) return getMemoryFileSystem().readFileSync(realFileSystem.normalizePath(path), {
|
|
264
308
|
encoding: encoding
|
|
265
309
|
}).toString();
|
|
266
310
|
}
|
|
267
311
|
function mem_file_system_readDir(path) {
|
|
268
312
|
const stats = mem_file_system_readStats(path);
|
|
269
|
-
if (stats && stats.isDirectory()) return
|
|
313
|
+
if (stats && stats.isDirectory()) return getMemoryFileSystem().readdirSync(realFileSystem.normalizePath(path), {
|
|
270
314
|
withFileTypes: true
|
|
271
315
|
});
|
|
272
316
|
return [];
|
|
273
317
|
}
|
|
274
318
|
function mem_file_system_createDir(path) {
|
|
275
|
-
|
|
319
|
+
hasChanges = true;
|
|
320
|
+
getMemoryFileSystem().mkdirSync(realFileSystem.normalizePath(path), {
|
|
276
321
|
recursive: true
|
|
277
322
|
});
|
|
278
323
|
}
|
|
279
324
|
function mem_file_system_writeFile(path, data) {
|
|
325
|
+
hasChanges = true;
|
|
280
326
|
if (!mem_file_system_exists((0, external_node_path_namespaceObject.dirname)(path))) mem_file_system_createDir((0, external_node_path_namespaceObject.dirname)(path));
|
|
281
|
-
|
|
327
|
+
getMemoryFileSystem().writeFileSync(realFileSystem.normalizePath(path), data);
|
|
282
328
|
}
|
|
283
329
|
function mem_file_system_deleteFile(path) {
|
|
284
|
-
|
|
330
|
+
hasChanges = true;
|
|
331
|
+
if (mem_file_system_exists(path)) getMemoryFileSystem().unlinkSync(realFileSystem.normalizePath(path));
|
|
285
332
|
}
|
|
286
333
|
function mem_file_system_updateTimes(path, atime, mtime) {
|
|
287
|
-
|
|
334
|
+
hasChanges = true;
|
|
335
|
+
if (mem_file_system_exists(path)) getMemoryFileSystem().utimesSync(realFileSystem.normalizePath(path), atime, mtime);
|
|
288
336
|
}
|
|
289
337
|
const passiveFileSystem = {
|
|
290
338
|
...memFileSystem,
|
|
@@ -509,7 +557,7 @@ function getReadFileSystem(path) {
|
|
|
509
557
|
return memFileSystem;
|
|
510
558
|
}
|
|
511
559
|
}
|
|
512
|
-
return passiveFileSystem;
|
|
560
|
+
return 'readonly' !== mode || memFileSystem.hasChanges() ? passiveFileSystem : realFileSystem;
|
|
513
561
|
}
|
|
514
562
|
function getWriteFileSystem(path) {
|
|
515
563
|
if ('write-references' === mode || 'write-tsbuildinfo' === mode && path.endsWith('.tsbuildinfo') || 'write-dts' === mode && [
|
package/lib/getIssuesWorker.js
CHANGED
|
@@ -205,32 +205,33 @@ function createIssueFromDiagnostic(diagnostic, defaultSeverity) {
|
|
|
205
205
|
function createIssuesFromDiagnostics(diagnostics, defaultSeverity) {
|
|
206
206
|
return deduplicateAndSortIssues(diagnostics.map((diagnostic)=>createIssueFromDiagnostic(diagnostic, defaultSeverity)));
|
|
207
207
|
}
|
|
208
|
-
const
|
|
208
|
+
const external_node_module_namespaceObject = require("node:module");
|
|
209
209
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
210
210
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
211
211
|
const existsCache = new Map();
|
|
212
|
+
const normalizedPathCache = new Map();
|
|
212
213
|
const readStatsCache = new Map();
|
|
213
214
|
const readFileCache = new Map();
|
|
214
215
|
const readDirCache = new Map();
|
|
215
216
|
const realPathCache = new Map();
|
|
216
217
|
const realFileSystem = {
|
|
217
218
|
exists (path) {
|
|
218
|
-
return exists(
|
|
219
|
+
return exists(path);
|
|
219
220
|
},
|
|
220
221
|
readFile (path, encoding) {
|
|
221
|
-
return readFile(
|
|
222
|
+
return readFile(path, encoding);
|
|
222
223
|
},
|
|
223
224
|
readDir (path) {
|
|
224
|
-
return readDir(
|
|
225
|
+
return readDir(path);
|
|
225
226
|
},
|
|
226
227
|
readStats (path) {
|
|
227
|
-
return readStats(
|
|
228
|
+
return readStats(path);
|
|
228
229
|
},
|
|
229
230
|
realPath (path) {
|
|
230
231
|
return getRealPath(path);
|
|
231
232
|
},
|
|
232
233
|
normalizePath (path) {
|
|
233
|
-
return (
|
|
234
|
+
return normalizePath(path);
|
|
234
235
|
},
|
|
235
236
|
writeFile (path, data) {
|
|
236
237
|
writeFile(getRealPath(path), data);
|
|
@@ -246,6 +247,7 @@ const realFileSystem = {
|
|
|
246
247
|
},
|
|
247
248
|
clearCache () {
|
|
248
249
|
existsCache.clear();
|
|
250
|
+
normalizedPathCache.clear();
|
|
249
251
|
readStatsCache.clear();
|
|
250
252
|
readFileCache.clear();
|
|
251
253
|
readDirCache.clear();
|
|
@@ -253,19 +255,25 @@ const realFileSystem = {
|
|
|
253
255
|
}
|
|
254
256
|
};
|
|
255
257
|
function exists(path) {
|
|
256
|
-
const normalizedPath = (
|
|
257
|
-
|
|
258
|
-
|
|
258
|
+
const normalizedPath = normalizePath(path);
|
|
259
|
+
return existsNormalized(normalizedPath);
|
|
260
|
+
}
|
|
261
|
+
function existsNormalized(normalizedPath) {
|
|
262
|
+
const cached = existsCache.get(normalizedPath);
|
|
263
|
+
if (void 0 !== cached) return cached;
|
|
264
|
+
const result = external_node_fs_default().existsSync(normalizedPath);
|
|
265
|
+
existsCache.set(normalizedPath, result);
|
|
266
|
+
return result;
|
|
259
267
|
}
|
|
260
268
|
function readStats(path) {
|
|
261
|
-
const normalizedPath = (
|
|
269
|
+
const normalizedPath = normalizePath(path);
|
|
262
270
|
if (!readStatsCache.has(normalizedPath)) {
|
|
263
|
-
if (
|
|
271
|
+
if (existsNormalized(normalizedPath)) readStatsCache.set(normalizedPath, external_node_fs_default().statSync(normalizedPath));
|
|
264
272
|
}
|
|
265
273
|
return readStatsCache.get(normalizedPath);
|
|
266
274
|
}
|
|
267
275
|
function readFile(path, encoding) {
|
|
268
|
-
const normalizedPath = (
|
|
276
|
+
const normalizedPath = normalizePath(path);
|
|
269
277
|
if (!readFileCache.has(normalizedPath)) {
|
|
270
278
|
const stats = readStats(normalizedPath);
|
|
271
279
|
if (stats && stats.isFile()) readFileCache.set(normalizedPath, external_node_fs_default().readFileSync(normalizedPath, {
|
|
@@ -276,7 +284,7 @@ function readFile(path, encoding) {
|
|
|
276
284
|
return readFileCache.get(normalizedPath);
|
|
277
285
|
}
|
|
278
286
|
function readDir(path) {
|
|
279
|
-
const normalizedPath = (
|
|
287
|
+
const normalizedPath = normalizePath(path);
|
|
280
288
|
if (!readDirCache.has(normalizedPath)) {
|
|
281
289
|
const stats = readStats(normalizedPath);
|
|
282
290
|
if (stats && stats.isDirectory()) readDirCache.set(normalizedPath, external_node_fs_default().readdirSync(normalizedPath, {
|
|
@@ -287,13 +295,20 @@ function readDir(path) {
|
|
|
287
295
|
return readDirCache.get(normalizedPath) || [];
|
|
288
296
|
}
|
|
289
297
|
function getRealPath(path) {
|
|
290
|
-
const normalizedPath = (
|
|
298
|
+
const normalizedPath = normalizePath(path);
|
|
291
299
|
if (!realPathCache.has(normalizedPath)) {
|
|
292
300
|
let base = normalizedPath;
|
|
293
301
|
let nested = '';
|
|
294
302
|
while(base !== (0, external_node_path_namespaceObject.dirname)(base)){
|
|
295
|
-
|
|
296
|
-
|
|
303
|
+
const cachedBase = realPathCache.get(base);
|
|
304
|
+
if (cachedBase) {
|
|
305
|
+
realPathCache.set(normalizedPath, (0, external_node_path_namespaceObject.join)(cachedBase, nested));
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
if (existsNormalized(base)) {
|
|
309
|
+
const realBase = normalizePath(realpath(base));
|
|
310
|
+
realPathCache.set(base, realBase);
|
|
311
|
+
realPathCache.set(normalizedPath, (0, external_node_path_namespaceObject.join)(realBase, nested));
|
|
297
312
|
break;
|
|
298
313
|
}
|
|
299
314
|
nested = (0, external_node_path_namespaceObject.join)((0, external_node_path_namespaceObject.basename)(base), nested);
|
|
@@ -302,8 +317,26 @@ function getRealPath(path) {
|
|
|
302
317
|
}
|
|
303
318
|
return realPathCache.get(normalizedPath) || normalizedPath;
|
|
304
319
|
}
|
|
305
|
-
function
|
|
320
|
+
function normalizePath(path) {
|
|
321
|
+
const cached = normalizedPathCache.get(path);
|
|
322
|
+
if (void 0 !== cached) return cached;
|
|
306
323
|
const normalizedPath = (0, external_node_path_namespaceObject.normalize)(path);
|
|
324
|
+
normalizedPathCache.set(path, normalizedPath);
|
|
325
|
+
return normalizedPath;
|
|
326
|
+
}
|
|
327
|
+
function fsRealPathHandlingLongPath(path) {
|
|
328
|
+
return path.length < 260 ? external_node_fs_default().realpathSync.native(path) : external_node_fs_default().realpathSync(path);
|
|
329
|
+
}
|
|
330
|
+
const fsRealpath = external_node_fs_default().realpathSync.native ? 'win32' === process.platform ? fsRealPathHandlingLongPath : external_node_fs_default().realpathSync.native : external_node_fs_default().realpathSync;
|
|
331
|
+
function realpath(path) {
|
|
332
|
+
try {
|
|
333
|
+
return fsRealpath(path);
|
|
334
|
+
} catch {
|
|
335
|
+
return path;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
function createDir(path) {
|
|
339
|
+
const normalizedPath = normalizePath(path);
|
|
307
340
|
external_node_fs_default().mkdirSync(normalizedPath, {
|
|
308
341
|
recursive: true
|
|
309
342
|
});
|
|
@@ -312,7 +345,7 @@ function createDir(path) {
|
|
|
312
345
|
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
313
346
|
}
|
|
314
347
|
function writeFile(path, data) {
|
|
315
|
-
const normalizedPath = (
|
|
348
|
+
const normalizedPath = normalizePath(path);
|
|
316
349
|
if (!exists((0, external_node_path_namespaceObject.dirname)(normalizedPath))) createDir((0, external_node_path_namespaceObject.dirname)(normalizedPath));
|
|
317
350
|
external_node_fs_default().writeFileSync(normalizedPath, data);
|
|
318
351
|
existsCache.set(normalizedPath, true);
|
|
@@ -322,7 +355,7 @@ function writeFile(path, data) {
|
|
|
322
355
|
}
|
|
323
356
|
function deleteFile(path) {
|
|
324
357
|
if (exists(path)) {
|
|
325
|
-
const normalizedPath = (
|
|
358
|
+
const normalizedPath = normalizePath(path);
|
|
326
359
|
external_node_fs_default().unlinkSync(normalizedPath);
|
|
327
360
|
existsCache.set(normalizedPath, false);
|
|
328
361
|
if (readDirCache.has((0, external_node_path_namespaceObject.dirname)(normalizedPath))) readDirCache.delete((0, external_node_path_namespaceObject.dirname)(normalizedPath));
|
|
@@ -332,13 +365,24 @@ function deleteFile(path) {
|
|
|
332
365
|
}
|
|
333
366
|
function updateTimes(path, atime, mtime) {
|
|
334
367
|
if (exists(path)) {
|
|
335
|
-
const normalizedPath = (
|
|
336
|
-
external_node_fs_default().utimesSync(
|
|
368
|
+
const normalizedPath = normalizePath(path);
|
|
369
|
+
external_node_fs_default().utimesSync(normalizedPath, atime, mtime);
|
|
337
370
|
if (readStatsCache.has(normalizedPath)) readStatsCache.delete(normalizedPath);
|
|
338
371
|
}
|
|
339
372
|
}
|
|
373
|
+
let hasChanges = false;
|
|
374
|
+
let mem;
|
|
375
|
+
const requireModule = (0, external_node_module_namespaceObject.createRequire)(__filename);
|
|
376
|
+
function getMemoryFileSystem() {
|
|
377
|
+
if (mem) return mem;
|
|
378
|
+
mem = requireModule('memfs').fs;
|
|
379
|
+
return mem;
|
|
380
|
+
}
|
|
340
381
|
const memFileSystem = {
|
|
341
382
|
...realFileSystem,
|
|
383
|
+
hasChanges () {
|
|
384
|
+
return hasChanges;
|
|
385
|
+
},
|
|
342
386
|
exists (path) {
|
|
343
387
|
return mem_file_system_exists(realFileSystem.realPath(path));
|
|
344
388
|
},
|
|
@@ -368,38 +412,42 @@ const memFileSystem = {
|
|
|
368
412
|
}
|
|
369
413
|
};
|
|
370
414
|
function mem_file_system_exists(path) {
|
|
371
|
-
return
|
|
415
|
+
return getMemoryFileSystem().existsSync(realFileSystem.normalizePath(path));
|
|
372
416
|
}
|
|
373
417
|
function mem_file_system_readStats(path) {
|
|
374
|
-
return mem_file_system_exists(path) ?
|
|
418
|
+
return mem_file_system_exists(path) ? getMemoryFileSystem().statSync(realFileSystem.normalizePath(path)) : void 0;
|
|
375
419
|
}
|
|
376
420
|
function mem_file_system_readFile(path, encoding) {
|
|
377
421
|
const stats = mem_file_system_readStats(path);
|
|
378
|
-
if (stats && stats.isFile()) return
|
|
422
|
+
if (stats && stats.isFile()) return getMemoryFileSystem().readFileSync(realFileSystem.normalizePath(path), {
|
|
379
423
|
encoding: encoding
|
|
380
424
|
}).toString();
|
|
381
425
|
}
|
|
382
426
|
function mem_file_system_readDir(path) {
|
|
383
427
|
const stats = mem_file_system_readStats(path);
|
|
384
|
-
if (stats && stats.isDirectory()) return
|
|
428
|
+
if (stats && stats.isDirectory()) return getMemoryFileSystem().readdirSync(realFileSystem.normalizePath(path), {
|
|
385
429
|
withFileTypes: true
|
|
386
430
|
});
|
|
387
431
|
return [];
|
|
388
432
|
}
|
|
389
433
|
function mem_file_system_createDir(path) {
|
|
390
|
-
|
|
434
|
+
hasChanges = true;
|
|
435
|
+
getMemoryFileSystem().mkdirSync(realFileSystem.normalizePath(path), {
|
|
391
436
|
recursive: true
|
|
392
437
|
});
|
|
393
438
|
}
|
|
394
439
|
function mem_file_system_writeFile(path, data) {
|
|
440
|
+
hasChanges = true;
|
|
395
441
|
if (!mem_file_system_exists((0, external_node_path_namespaceObject.dirname)(path))) mem_file_system_createDir((0, external_node_path_namespaceObject.dirname)(path));
|
|
396
|
-
|
|
442
|
+
getMemoryFileSystem().writeFileSync(realFileSystem.normalizePath(path), data);
|
|
397
443
|
}
|
|
398
444
|
function mem_file_system_deleteFile(path) {
|
|
399
|
-
|
|
445
|
+
hasChanges = true;
|
|
446
|
+
if (mem_file_system_exists(path)) getMemoryFileSystem().unlinkSync(realFileSystem.normalizePath(path));
|
|
400
447
|
}
|
|
401
448
|
function mem_file_system_updateTimes(path, atime, mtime) {
|
|
402
|
-
|
|
449
|
+
hasChanges = true;
|
|
450
|
+
if (mem_file_system_exists(path)) getMemoryFileSystem().utimesSync(realFileSystem.normalizePath(path), atime, mtime);
|
|
403
451
|
}
|
|
404
452
|
const passiveFileSystem = {
|
|
405
453
|
...memFileSystem,
|
|
@@ -624,7 +672,7 @@ function getReadFileSystem(path) {
|
|
|
624
672
|
return memFileSystem;
|
|
625
673
|
}
|
|
626
674
|
}
|
|
627
|
-
return passiveFileSystem;
|
|
675
|
+
return 'readonly' !== mode || memFileSystem.hasChanges() ? passiveFileSystem : realFileSystem;
|
|
628
676
|
}
|
|
629
677
|
function getWriteFileSystem(path) {
|
|
630
678
|
if ('write-references' === mode || 'write-tsbuildinfo' === mode && path.endsWith('.tsbuildinfo') || 'write-dts' === mode && [
|
|
@@ -1082,7 +1130,7 @@ function invalidateWatchProgram(withHost = false) {
|
|
|
1082
1130
|
function invalidateWatchProgramRootFileNames() {
|
|
1083
1131
|
shouldUpdateRootFiles = true;
|
|
1084
1132
|
}
|
|
1085
|
-
const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
1133
|
+
const getIssuesWorker = async (change, watching, defaultSeverity, withDependencies = false)=>{
|
|
1086
1134
|
system.invalidateCache();
|
|
1087
1135
|
if (didConfigFileChanged(change)) {
|
|
1088
1136
|
invalidateConfig();
|
|
@@ -1094,10 +1142,11 @@ const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
|
1094
1142
|
invalidateSolutionBuilder(true);
|
|
1095
1143
|
invalidateTsBuildInfo();
|
|
1096
1144
|
} else if (didDependenciesProbablyChanged(getDependencies(), change)) {
|
|
1145
|
+
const rootFilesChanged = didRootFilesChanged();
|
|
1097
1146
|
invalidateConfig();
|
|
1098
1147
|
invalidateDependencies();
|
|
1099
1148
|
invalidateArtifacts();
|
|
1100
|
-
if (
|
|
1149
|
+
if (rootFilesChanged) {
|
|
1101
1150
|
invalidateWatchProgramRootFileNames();
|
|
1102
1151
|
invalidateSolutionBuilder();
|
|
1103
1152
|
}
|
|
@@ -1105,7 +1154,10 @@ const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
|
1105
1154
|
registerArtifacts();
|
|
1106
1155
|
enablePerformanceIfNeeded();
|
|
1107
1156
|
const parseConfigIssues = getParseConfigIssues(defaultSeverity);
|
|
1108
|
-
if (parseConfigIssues.length) return
|
|
1157
|
+
if (parseConfigIssues.length) return {
|
|
1158
|
+
issues: parseConfigIssues,
|
|
1159
|
+
dependencies: withDependencies ? getDependencies() : void 0
|
|
1160
|
+
};
|
|
1109
1161
|
if (worker_config_config.build) useSolutionBuilder();
|
|
1110
1162
|
else if (watching) useWatchProgram();
|
|
1111
1163
|
else useProgram();
|
|
@@ -1120,7 +1172,10 @@ const getIssuesWorker = async (change, watching, defaultSeverity)=>{
|
|
|
1120
1172
|
dumpTracingLegendIfNeeded();
|
|
1121
1173
|
printPerformanceMeasuresIfNeeded();
|
|
1122
1174
|
disablePerformanceIfNeeded();
|
|
1123
|
-
return
|
|
1175
|
+
return {
|
|
1176
|
+
issues,
|
|
1177
|
+
dependencies: withDependencies ? getDependencies() : void 0
|
|
1178
|
+
};
|
|
1124
1179
|
};
|
|
1125
1180
|
exposeRpc(getIssuesWorker);
|
|
1126
1181
|
for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
package/lib/index.js
CHANGED
|
@@ -3721,6 +3721,7 @@ var __webpack_exports__ = {};
|
|
|
3721
3721
|
const external_node_fs_namespaceObject = require("node:fs");
|
|
3722
3722
|
var external_node_fs_default = /*#__PURE__*/ __webpack_require__.n(external_node_fs_namespaceObject);
|
|
3723
3723
|
const external_node_url_namespaceObject = require("node:url");
|
|
3724
|
+
const external_node_util_namespaceObject = require("node:util");
|
|
3724
3725
|
const TYPESCRIPT_PACKAGE = "typescript";
|
|
3725
3726
|
const TYPESCRIPT_PACKAGE_JSON = `${TYPESCRIPT_PACKAGE}/package.json`;
|
|
3726
3727
|
const TYPESCRIPT_PREVIEW_PACKAGE = "@typescript/native-preview";
|
|
@@ -3752,6 +3753,36 @@ var __webpack_exports__ = {};
|
|
|
3752
3753
|
args: []
|
|
3753
3754
|
};
|
|
3754
3755
|
}
|
|
3756
|
+
async function runTypeScriptGoShowConfig(executable, configFile) {
|
|
3757
|
+
const { stdout } = await (0, external_node_util_namespaceObject.promisify)(external_node_child_process_namespaceObject.execFile)(executable.command, [
|
|
3758
|
+
...executable.args,
|
|
3759
|
+
'--project',
|
|
3760
|
+
configFile,
|
|
3761
|
+
'--showConfig',
|
|
3762
|
+
'--pretty',
|
|
3763
|
+
'false'
|
|
3764
|
+
], {
|
|
3765
|
+
cwd: external_node_path_default().dirname(configFile),
|
|
3766
|
+
encoding: 'utf8',
|
|
3767
|
+
maxBuffer: 67108864
|
|
3768
|
+
});
|
|
3769
|
+
const parsedConfig = JSON.parse(stdout);
|
|
3770
|
+
if (!parsedConfig || 'object' != typeof parsedConfig || Array.isArray(parsedConfig)) throw new TypeError('Invalid tsgo --showConfig output.');
|
|
3771
|
+
return parsedConfig;
|
|
3772
|
+
}
|
|
3773
|
+
function toComparisonPath(file) {
|
|
3774
|
+
const normalizedPath = external_node_path_default().normalize(file);
|
|
3775
|
+
return 'win32' === process.platform ? normalizedPath.toLowerCase() : normalizedPath;
|
|
3776
|
+
}
|
|
3777
|
+
function shouldRefreshTypeScriptGoDependencies(dependencies, { changedFiles = [], deletedFiles = [] }) {
|
|
3778
|
+
if (!dependencies) return true;
|
|
3779
|
+
const dependencyKeys = dependencies.files.map(toComparisonPath);
|
|
3780
|
+
return changedFiles.some((file)=>{
|
|
3781
|
+
const key = toComparisonPath(file);
|
|
3782
|
+
const extension = external_node_path_default().extname(file).toLowerCase();
|
|
3783
|
+
return '.json' === extension || dependencies.extensions.includes(extension) && !dependencyKeys.includes(key);
|
|
3784
|
+
}) || deletedFiles.some((file)=>dependencyKeys.includes(toComparisonPath(file)));
|
|
3785
|
+
}
|
|
3755
3786
|
function createTypeScriptGoArgs(config) {
|
|
3756
3787
|
const args = config.build ? [
|
|
3757
3788
|
'--build',
|
|
@@ -3917,17 +3948,41 @@ var __webpack_exports__ = {};
|
|
|
3917
3948
|
});
|
|
3918
3949
|
});
|
|
3919
3950
|
}
|
|
3920
|
-
function getTypeScriptGoDependencies(config) {
|
|
3951
|
+
async function getTypeScriptGoDependencies(config) {
|
|
3952
|
+
const executable = await resolveTypeScriptGoExecutable(config);
|
|
3953
|
+
const files = new Set();
|
|
3954
|
+
const dirs = new Set();
|
|
3955
|
+
const excluded = new Set();
|
|
3956
|
+
const visitedConfigs = new Set();
|
|
3957
|
+
const collectConfigDependencies = async (configFile, fallbackRoot, collectExcluded)=>{
|
|
3958
|
+
const normalizedConfigFile = external_node_path_default().normalize(configFile);
|
|
3959
|
+
const configKey = toComparisonPath(normalizedConfigFile);
|
|
3960
|
+
if (visitedConfigs.has(configKey)) return;
|
|
3961
|
+
visitedConfigs.add(configKey);
|
|
3962
|
+
const configDir = external_node_path_default().dirname(normalizedConfigFile);
|
|
3963
|
+
const normalizedRoot = external_node_path_default().normalize(fallbackRoot);
|
|
3964
|
+
files.add(normalizedConfigFile);
|
|
3965
|
+
if (!Array.from(dirs).some((dir)=>'' === external_node_path_default().relative(dir, normalizedRoot) || isInsideAnotherPath(dir, normalizedRoot))) dirs.add(normalizedRoot);
|
|
3966
|
+
excluded.add(external_node_path_default().join(normalizedRoot, 'node_modules'));
|
|
3967
|
+
let parsedConfig;
|
|
3968
|
+
try {
|
|
3969
|
+
parsedConfig = await runTypeScriptGoShowConfig(executable, normalizedConfigFile);
|
|
3970
|
+
} catch {
|
|
3971
|
+
return;
|
|
3972
|
+
}
|
|
3973
|
+
for (const file of parsedConfig.files || [])files.add(external_node_path_default().normalize(external_node_path_default().resolve(configDir, file)));
|
|
3974
|
+
if (collectExcluded && !parsedConfig.references?.length) for (const exclude of parsedConfig.exclude || [])excluded.add(external_node_path_default().normalize(external_node_path_default().resolve(configDir, exclude)));
|
|
3975
|
+
for (const reference of parsedConfig.references || [])if (reference.path) {
|
|
3976
|
+
const resolvedReference = external_node_path_default().resolve(configDir, reference.path);
|
|
3977
|
+
const referenceConfig = '.json' === external_node_path_default().extname(resolvedReference).toLowerCase() ? resolvedReference : external_node_path_default().join(resolvedReference, 'tsconfig.json');
|
|
3978
|
+
await collectConfigDependencies(referenceConfig, external_node_path_default().dirname(referenceConfig), false);
|
|
3979
|
+
}
|
|
3980
|
+
};
|
|
3981
|
+
await collectConfigDependencies(config.configFile, config.context, true);
|
|
3921
3982
|
return {
|
|
3922
|
-
files:
|
|
3923
|
-
|
|
3924
|
-
|
|
3925
|
-
dirs: [
|
|
3926
|
-
config.context
|
|
3927
|
-
],
|
|
3928
|
-
excluded: [
|
|
3929
|
-
external_node_path_default().join(config.context, 'node_modules')
|
|
3930
|
-
],
|
|
3983
|
+
files: Array.from(files),
|
|
3984
|
+
dirs: Array.from(dirs),
|
|
3985
|
+
excluded: Array.from(excluded),
|
|
3931
3986
|
extensions: [
|
|
3932
3987
|
'.ts',
|
|
3933
3988
|
'.tsx',
|
|
@@ -4117,16 +4172,17 @@ var __webpack_exports__ = {};
|
|
|
4117
4172
|
].join('\n'));
|
|
4118
4173
|
}
|
|
4119
4174
|
state.aggregatedFilesChange = aggregatedFilesChange;
|
|
4120
|
-
|
|
4175
|
+
const reuseIssuesWorkerForDependencies = !state.watching || !config.async;
|
|
4176
|
+
const workerResultPromise = (state.issuesPromise || Promise.resolve()).catch(()=>void 0).then(()=>{
|
|
4121
4177
|
if (abortController.signal.aborted) return;
|
|
4122
4178
|
debug(`Submitting the getIssuesWorker to the pool, iteration ${iteration}.`);
|
|
4123
4179
|
return issuesPool.submit(async ()=>{
|
|
4124
4180
|
try {
|
|
4125
4181
|
debug(`Running the getIssuesWorker, iteration ${iteration}.`);
|
|
4126
|
-
const
|
|
4182
|
+
const result = await getIssuesWorker(aggregatedFilesChange, state.watching, config.issue.defaultSeverity, reuseIssuesWorkerForDependencies);
|
|
4127
4183
|
if (state.aggregatedFilesChange === aggregatedFilesChange) state.aggregatedFilesChange = void 0;
|
|
4128
4184
|
if (state.abortController === abortController) state.abortController = void 0;
|
|
4129
|
-
return
|
|
4185
|
+
return result;
|
|
4130
4186
|
} catch (error) {
|
|
4131
4187
|
hooks.error.call(error, compilation);
|
|
4132
4188
|
return;
|
|
@@ -4135,6 +4191,12 @@ var __webpack_exports__ = {};
|
|
|
4135
4191
|
}
|
|
4136
4192
|
}, abortController.signal);
|
|
4137
4193
|
});
|
|
4194
|
+
state.issuesPromise = workerResultPromise.then((result)=>result?.issues);
|
|
4195
|
+
if (reuseIssuesWorkerForDependencies) {
|
|
4196
|
+
debug(`Reusing dependencies from the getIssuesWorker, iteration ${iteration}.`);
|
|
4197
|
+
state.dependenciesPromise = workerResultPromise.then((result)=>result?.dependencies);
|
|
4198
|
+
return;
|
|
4199
|
+
}
|
|
4138
4200
|
debug(`Submitting the getDependenciesWorker to the pool, iteration ${iteration}.`);
|
|
4139
4201
|
state.dependenciesPromise = dependenciesPool.submit(async ()=>{
|
|
4140
4202
|
try {
|
|
@@ -4236,6 +4298,8 @@ var __webpack_exports__ = {};
|
|
|
4236
4298
|
const hooks = getPluginHooks(compiler);
|
|
4237
4299
|
const { log, debug } = getInfrastructureLogger(compiler);
|
|
4238
4300
|
let assertTypeScriptGoExecutablePromise;
|
|
4301
|
+
let dependenciesPromise;
|
|
4302
|
+
let dependenciesCacheGeneration = 0;
|
|
4239
4303
|
const assertTypeScriptGoExecutableOnce = async ()=>{
|
|
4240
4304
|
try {
|
|
4241
4305
|
if (!assertTypeScriptGoExecutablePromise) assertTypeScriptGoExecutablePromise = assertTypeScriptGoExecutable(config.typescript);
|
|
@@ -4310,8 +4374,24 @@ var __webpack_exports__ = {};
|
|
|
4310
4374
|
` Deleted files: ${JSON.stringify(filesChange.deletedFiles)}`
|
|
4311
4375
|
].join('\n'));
|
|
4312
4376
|
} else log('Calling tsgo for single check.');
|
|
4313
|
-
|
|
4314
|
-
|
|
4377
|
+
const cacheGeneration = ++dependenciesCacheGeneration;
|
|
4378
|
+
const startPromise = hooks.start.promise(filesChange, compilation);
|
|
4379
|
+
state.dependenciesPromise = startPromise.then((nextFilesChange)=>{
|
|
4380
|
+
if (cacheGeneration !== dependenciesCacheGeneration) return;
|
|
4381
|
+
if (state.watching && dependenciesPromise && !shouldRefreshTypeScriptGoDependencies(state.lastDependencies, nextFilesChange)) {
|
|
4382
|
+
debug(`Reusing cached tsgo dependencies, iteration ${iteration}.`);
|
|
4383
|
+
return dependenciesPromise;
|
|
4384
|
+
}
|
|
4385
|
+
const nextDependenciesPromise = getTypeScriptGoDependencies(config.typescript);
|
|
4386
|
+
if (state.watching) {
|
|
4387
|
+
dependenciesPromise = nextDependenciesPromise;
|
|
4388
|
+
nextDependenciesPromise.catch(()=>{
|
|
4389
|
+
if (dependenciesPromise === nextDependenciesPromise) dependenciesPromise = void 0;
|
|
4390
|
+
});
|
|
4391
|
+
}
|
|
4392
|
+
return nextDependenciesPromise;
|
|
4393
|
+
});
|
|
4394
|
+
filesChange = await startPromise;
|
|
4315
4395
|
let aggregatedFilesChange = filesChange;
|
|
4316
4396
|
if (state.aggregatedFilesChange) {
|
|
4317
4397
|
aggregatedFilesChange = aggregateFilesChanges([
|
|
@@ -4351,8 +4431,14 @@ var __webpack_exports__ = {};
|
|
|
4351
4431
|
state.abortController = void 0;
|
|
4352
4432
|
}
|
|
4353
4433
|
};
|
|
4354
|
-
compiler.hooks.watchClose.tap('TsCheckerRspackPlugin',
|
|
4434
|
+
compiler.hooks.watchClose.tap('TsCheckerRspackPlugin', ()=>{
|
|
4435
|
+
dependenciesCacheGeneration++;
|
|
4436
|
+
dependenciesPromise = void 0;
|
|
4437
|
+
abortTypeScriptGo();
|
|
4438
|
+
});
|
|
4355
4439
|
compiler.hooks.failed.tap('TsCheckerRspackPlugin', ()=>{
|
|
4440
|
+
dependenciesCacheGeneration++;
|
|
4441
|
+
dependenciesPromise = void 0;
|
|
4356
4442
|
if (!state.watching) abortTypeScriptGo();
|
|
4357
4443
|
});
|
|
4358
4444
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { FilesChange } from '../files-change';
|
|
2
|
+
import type { FilesMatch } from '../files-match';
|
|
1
3
|
import type { Issue, IssueDefaultSeverity } from '../issue';
|
|
2
4
|
import type { Logger } from '../logger';
|
|
3
5
|
import type { TypeScriptWorkerConfig } from './type-script-worker-config';
|
|
@@ -8,6 +10,7 @@ type TypeScriptGoExecutable = {
|
|
|
8
10
|
declare function resolveTypeScriptGoPackageJsonPath(config: TypeScriptWorkerConfig): string;
|
|
9
11
|
declare function resolveTypeScriptGoBinPath(config: TypeScriptWorkerConfig): Promise<string>;
|
|
10
12
|
declare function resolveTypeScriptGoExecutable(config: TypeScriptWorkerConfig): Promise<TypeScriptGoExecutable>;
|
|
13
|
+
declare function shouldRefreshTypeScriptGoDependencies(dependencies: FilesMatch | undefined, { changedFiles, deletedFiles }: FilesChange): boolean;
|
|
11
14
|
declare function createTypeScriptGoArgs(config: TypeScriptWorkerConfig): string[];
|
|
12
15
|
declare function getTypeScriptGoErrorCount(output: string): number | undefined;
|
|
13
16
|
declare function parseTypeScriptGoIssues(output: string, config: TypeScriptWorkerConfig, defaultSeverity?: IssueDefaultSeverity): Issue[];
|
|
@@ -15,10 +18,5 @@ declare function createTypeScriptGoExitIssues(output: string, signal: NodeJS.Sig
|
|
|
15
18
|
declare function isTypeScriptGoIssue(issue: Issue): boolean;
|
|
16
19
|
declare function isTypeScriptGoStatsError(error: unknown): boolean;
|
|
17
20
|
declare function runTypeScriptGo(config: TypeScriptWorkerConfig, logger: Pick<Logger, 'error'>, defaultSeverity?: IssueDefaultSeverity, signal?: AbortSignal): Promise<Issue[]>;
|
|
18
|
-
declare function getTypeScriptGoDependencies(config: TypeScriptWorkerConfig):
|
|
19
|
-
|
|
20
|
-
dirs: string[];
|
|
21
|
-
excluded: string[];
|
|
22
|
-
extensions: string[];
|
|
23
|
-
};
|
|
24
|
-
export { createTypeScriptGoArgs, createTypeScriptGoExitIssues, getTypeScriptGoDependencies, getTypeScriptGoErrorCount, isTypeScriptGoIssue, isTypeScriptGoStatsError, parseTypeScriptGoIssues, resolveTypeScriptGoExecutable, resolveTypeScriptGoBinPath, resolveTypeScriptGoPackageJsonPath, runTypeScriptGo, };
|
|
21
|
+
declare function getTypeScriptGoDependencies(config: TypeScriptWorkerConfig): Promise<FilesMatch>;
|
|
22
|
+
export { createTypeScriptGoArgs, createTypeScriptGoExitIssues, getTypeScriptGoDependencies, getTypeScriptGoErrorCount, isTypeScriptGoIssue, isTypeScriptGoStatsError, parseTypeScriptGoIssues, resolveTypeScriptGoExecutable, resolveTypeScriptGoBinPath, resolveTypeScriptGoPackageJsonPath, runTypeScriptGo, shouldRefreshTypeScriptGoDependencies, };
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { FilesChange } from '../../files-change';
|
|
2
|
+
import type { FilesMatch } from '../../files-match';
|
|
2
3
|
import type { Issue, IssueDefaultSeverity } from '../../issue';
|
|
3
|
-
|
|
4
|
+
interface GetIssuesWorkerResult {
|
|
5
|
+
issues: Issue[];
|
|
6
|
+
dependencies?: FilesMatch;
|
|
7
|
+
}
|
|
8
|
+
declare const getIssuesWorker: (change: FilesChange, watching: boolean, defaultSeverity: IssueDefaultSeverity, withDependencies?: boolean) => Promise<GetIssuesWorkerResult>;
|
|
4
9
|
export type GetIssuesWorker = typeof getIssuesWorker;
|
|
5
10
|
export {};
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { FileSystem } from './file-system';
|
|
2
|
+
interface MemFileSystem extends FileSystem {
|
|
3
|
+
/**
|
|
4
|
+
* Whether the in-memory layer may contain changes that should overlay files on disk.
|
|
5
|
+
*/
|
|
6
|
+
hasChanges(): boolean;
|
|
7
|
+
}
|
|
2
8
|
/**
|
|
3
9
|
* It's an implementation of FileSystem interface which reads and writes to the in-memory file system.
|
|
4
10
|
*/
|
|
5
|
-
export declare const memFileSystem:
|
|
11
|
+
export declare const memFileSystem: MemFileSystem;
|
|
12
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ts-checker-rspack-plugin",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.1",
|
|
4
4
|
"description": "Runs typescript type checker and linter on separate process.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"rspack",
|
|
@@ -37,14 +37,12 @@
|
|
|
37
37
|
"@rstest/core": "^0.11.2",
|
|
38
38
|
"@types/babel__code-frame": "^7.27.0",
|
|
39
39
|
"@types/is-glob": "^4.0.4",
|
|
40
|
-
"@types/mock-fs": "^4.13.4",
|
|
41
40
|
"@types/node": "^24.13.3",
|
|
42
41
|
"@typescript/native-preview": "7.0.0-dev.20260707.2",
|
|
43
42
|
"cross-env": "^10.1.0",
|
|
44
43
|
"husky": "^9.1.7",
|
|
45
44
|
"is-glob": "^4.0.3",
|
|
46
45
|
"minimatch": "^10.2.5",
|
|
47
|
-
"mock-fs": "^5.5.0",
|
|
48
46
|
"prettier": "^3.9.5",
|
|
49
47
|
"strip-ansi": "^7.2.0",
|
|
50
48
|
"typescript": "^6.0.3"
|
|
@@ -73,9 +71,9 @@
|
|
|
73
71
|
"lint": "rslint",
|
|
74
72
|
"lint:write": "rslint --fix",
|
|
75
73
|
"precommit": "pnpm build && pnpm test:unit",
|
|
76
|
-
"test": "pnpm build &&
|
|
77
|
-
"test:e2e": "
|
|
74
|
+
"test": "pnpm build && rstest",
|
|
75
|
+
"test:e2e": "rstest --project e2e",
|
|
78
76
|
"test:e2e:setup": "cd test/e2e && pnpm run setup",
|
|
79
|
-
"test:unit": "rstest --
|
|
77
|
+
"test:unit": "rstest --project unit"
|
|
80
78
|
}
|
|
81
79
|
}
|