@marko/type-check 3.0.5 → 3.1.0
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/dist/cli.js +26 -12
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -323,7 +323,31 @@ function run(opts) {
|
|
|
323
323
|
if (processor) {
|
|
324
324
|
if (isSourceMapExtensionReg.test(fileName)) return;
|
|
325
325
|
const [sourceFile] = sourceFiles;
|
|
326
|
-
const processorExt =
|
|
326
|
+
const processorExt = import_language_tools.Processors.getProcessorExtension(
|
|
327
|
+
sourceFile.fileName
|
|
328
|
+
);
|
|
329
|
+
const extracted = extractCache.get(
|
|
330
|
+
getCanonicalFileName(sourceFile.fileName)
|
|
331
|
+
);
|
|
332
|
+
const printContext = {
|
|
333
|
+
extracted,
|
|
334
|
+
printer,
|
|
335
|
+
typeChecker,
|
|
336
|
+
sourceFile,
|
|
337
|
+
formatSettings: report.formatSettings
|
|
338
|
+
};
|
|
339
|
+
if (processorExt.indexOf(".", 1) !== -1) {
|
|
340
|
+
if (!fileName.endsWith(import_tsserverlibrary.default.Extension.Dts)) return;
|
|
341
|
+
_writeFile(
|
|
342
|
+
fileName,
|
|
343
|
+
processor.printTypes(printContext).code,
|
|
344
|
+
writeByteOrderMark,
|
|
345
|
+
onError,
|
|
346
|
+
sourceFiles,
|
|
347
|
+
data
|
|
348
|
+
);
|
|
349
|
+
return;
|
|
350
|
+
}
|
|
327
351
|
const inDtsExt = processorExt + import_tsserverlibrary.default.Extension.Dts;
|
|
328
352
|
const inJsExt = processorExt + import_tsserverlibrary.default.Extension.Js;
|
|
329
353
|
const inExt = fileName.endsWith(inDtsExt) ? inDtsExt : fileName.endsWith(inJsExt) ? inJsExt : void 0;
|
|
@@ -351,16 +375,6 @@ function run(opts) {
|
|
|
351
375
|
}
|
|
352
376
|
outFileName = fileName.slice(0, -inExt.length) + (isDts ? ".d" : "") + processorExt;
|
|
353
377
|
}
|
|
354
|
-
const extracted = extractCache.get(
|
|
355
|
-
getCanonicalFileName(sourceFile.fileName)
|
|
356
|
-
);
|
|
357
|
-
const printContext = {
|
|
358
|
-
extracted,
|
|
359
|
-
printer,
|
|
360
|
-
typeChecker,
|
|
361
|
-
sourceFile,
|
|
362
|
-
formatSettings: report.formatSettings
|
|
363
|
-
};
|
|
364
378
|
_writeFile(
|
|
365
379
|
outFileName,
|
|
366
380
|
isDts ? processor.printTypes(printContext).code : processor.print(printContext).code,
|
|
@@ -399,7 +413,7 @@ function run(opts) {
|
|
|
399
413
|
host: solutionHost
|
|
400
414
|
});
|
|
401
415
|
const getProcessor = (fileName) => {
|
|
402
|
-
const ext =
|
|
416
|
+
const ext = import_language_tools.Processors.getProcessorExtension(fileName);
|
|
403
417
|
return ext ? processors[ext] : void 0;
|
|
404
418
|
};
|
|
405
419
|
solutionHost.getParsedCommandLine = (fileName) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@marko/type-check",
|
|
3
|
-
"version": "3.0
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "A CLI to type check Marko projects",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"type-check",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@luxass/strip-json-comments": "^1.4.0",
|
|
33
33
|
"@marko/compiler": "^5.39.66",
|
|
34
|
-
"@marko/language-tools": "^2.
|
|
34
|
+
"@marko/language-tools": "^2.6.0",
|
|
35
35
|
"arg": "^5.0.2",
|
|
36
36
|
"kleur": "^4.1.5",
|
|
37
37
|
"typescript": "^6.0.3"
|