@xylabs/ts-scripts-yarn3 3.0.85 → 3.0.87
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/actions/package/compile/tscNoEmit.js +14 -22
- package/dist/actions/package/compile/tscNoEmit.js.map +1 -1
- package/dist/actions/package/compile/tscNoEmit.mjs +14 -23
- package/dist/actions/package/compile/tscNoEmit.mjs.map +1 -1
- package/dist/actions/package/compile/tscTypes.js +0 -1
- package/dist/actions/package/compile/tscTypes.js.map +1 -1
- package/dist/actions/package/compile/tscTypes.mjs +0 -1
- package/dist/actions/package/compile/tscTypes.mjs.map +1 -1
- package/package.json +4 -4
- package/src/actions/package/compile/tscNoEmit.ts +15 -28
- package/src/actions/package/compile/tscTypes.ts +0 -1
|
@@ -33,9 +33,9 @@ __export(tscNoEmit_exports, {
|
|
|
33
33
|
module.exports = __toCommonJS(tscNoEmit_exports);
|
|
34
34
|
var import_chalk = __toESM(require("chalk"));
|
|
35
35
|
var import_process = require("process");
|
|
36
|
+
var import_tsc_prog = require("tsc-prog");
|
|
36
37
|
var import_typescript = require("typescript");
|
|
37
38
|
var import_getCompilerOptions = require("./getCompilerOptions");
|
|
38
|
-
var import_inputs = require("./inputs");
|
|
39
39
|
const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
|
|
40
40
|
const pkg = process.env.INIT_CWD ?? (0, import_process.cwd)();
|
|
41
41
|
const formatHost = {
|
|
@@ -46,40 +46,32 @@ const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
|
|
|
46
46
|
if (params == null ? void 0 : params.verbose) {
|
|
47
47
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
48
48
|
}
|
|
49
|
-
const
|
|
49
|
+
const compilerOptions = {
|
|
50
50
|
...(0, import_getCompilerOptions.getCompilerOptions)({
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
emitDeclarationOnly: false,
|
|
56
|
-
noEmit: true,
|
|
51
|
+
declaration: true,
|
|
52
|
+
declarationMap: true,
|
|
53
|
+
emitDeclarationOnly: true,
|
|
54
|
+
esModuleInterop: true,
|
|
57
55
|
outDir: "dist",
|
|
58
56
|
rootDir: "src",
|
|
59
57
|
skipDefaultLibCheck: true,
|
|
60
58
|
skipLibCheck: true,
|
|
61
|
-
sourceMap:
|
|
62
|
-
strict: true,
|
|
63
|
-
strictBindCallApply: true,
|
|
64
|
-
strictFunctionTypes: true,
|
|
65
|
-
strictNullChecks: true,
|
|
66
|
-
strictPropertyInitialization: true
|
|
59
|
+
sourceMap: true
|
|
67
60
|
}),
|
|
68
61
|
...compilerOptionsParam ?? {}
|
|
69
62
|
};
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
};
|
|
76
|
-
const program = (0, import_typescript.createProgram)(programOptions);
|
|
63
|
+
const program = (0, import_tsc_prog.createProgramFromConfig)({
|
|
64
|
+
basePath: pkg ?? (0, import_process.cwd)(),
|
|
65
|
+
compilerOptions,
|
|
66
|
+
exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
|
|
67
|
+
include: ["src"]
|
|
68
|
+
});
|
|
77
69
|
console.log(`noEmit-Program: [${pkg ?? (0, import_process.cwd)()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
|
|
78
70
|
const results = (0, import_typescript.getPreEmitDiagnostics)(program);
|
|
79
71
|
results.forEach((diag) => {
|
|
80
72
|
var _a;
|
|
81
73
|
const lineAndChar = diag.file ? (0, import_typescript.getLineAndCharacterOfPosition)(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
|
|
82
|
-
console.log(import_chalk.default.cyan(`${
|
|
74
|
+
console.log(import_chalk.default.cyan(`${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
83
75
|
console.log((0, import_typescript.formatDiagnosticsWithColorAndContext)([diag], formatHost));
|
|
84
76
|
});
|
|
85
77
|
return results.reduce((prev, diag) => prev + diag.category === import_typescript.DiagnosticCategory.Error ? 1 : 0, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport {\n CompilerOptions,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport {\n CompilerOptions,\n DiagnosticCategory,\n FormatDiagnosticsHost,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n LineAndCharacter,\n} from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsParam?: CompilerOptions): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n const formatHost: FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: () => pkg,\n getNewLine: () => '\\n',\n }\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n })\n\n console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`)\n\n const results = getPreEmitDiagnostics(program)\n\n results.forEach((diag) => {\n const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }\n console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))\n console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))\n })\n\n return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAQO;AAGP,gCAAmC;AAE5B,MAAM,0BAA0B,CAAC,QAAwB,yBAAmD;AACjH,QAAM,MAAM,QAAQ,IAAI,gBAAY,oBAAI;AAExC,QAAM,aAAoC;AAAA,IACxC,sBAAsB,CAAC,aAAa;AAAA,IACpC,qBAAqB,MAAM;AAAA,IAC3B,YAAY,MAAM;AAAA,EACpB;AAEA,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,kBAAkB;AAAA,IACtB,OAAG,8CAAmB;AAAA,MACpB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,QAAM,cAAU,yCAAwB;AAAA,IACtC,UAAU,WAAO,oBAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC;AAED,UAAQ,IAAI,oBAAoB,WAAO,oBAAI,CAAC,KAAK,KAAK,UAAU,QAAQ,eAAe,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE;AAE3G,QAAM,cAAU,yCAAsB,OAAO;AAE7C,UAAQ,QAAQ,CAAC,SAAS;AAvD5B;AAwDI,UAAM,cAAgC,KAAK,WAAO,iDAA8B,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE;AACtI,YAAQ,IAAI,aAAAA,QAAM,KAAK,IAAG,UAAK,SAAL,mBAAW,QAAQ,IAAI,YAAY,OAAO,CAAC,IAAI,YAAY,YAAY,CAAC,EAAE,CAAC;AACrG,YAAQ,QAAI,wDAAqC,CAAC,IAAI,GAAG,UAAU,CAAC;AAAA,EACtE,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM,SAAU,OAAO,KAAK,aAAa,qCAAmB,QAAQ,IAAI,GAAI,CAAC;AACtG;","names":["chalk"]}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import chalk from "chalk";
|
|
2
2
|
import { cwd } from "process";
|
|
3
|
+
import { createProgramFromConfig } from "tsc-prog";
|
|
3
4
|
import {
|
|
4
|
-
createProgram,
|
|
5
5
|
DiagnosticCategory,
|
|
6
6
|
formatDiagnosticsWithColorAndContext,
|
|
7
7
|
getLineAndCharacterOfPosition,
|
|
8
8
|
getPreEmitDiagnostics
|
|
9
9
|
} from "typescript";
|
|
10
10
|
import { getCompilerOptions } from "./getCompilerOptions";
|
|
11
|
-
import { getAllInputs2 } from "./inputs";
|
|
12
11
|
const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
|
|
13
12
|
const pkg = process.env.INIT_CWD ?? cwd();
|
|
14
13
|
const formatHost = {
|
|
@@ -19,40 +18,32 @@ const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
|
|
|
19
18
|
if (params == null ? void 0 : params.verbose) {
|
|
20
19
|
console.log(`Compiling with NoEmit TSC [${pkg}]`);
|
|
21
20
|
}
|
|
22
|
-
const
|
|
21
|
+
const compilerOptions = {
|
|
23
22
|
...getCompilerOptions({
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
emitDeclarationOnly: false,
|
|
29
|
-
noEmit: true,
|
|
23
|
+
declaration: true,
|
|
24
|
+
declarationMap: true,
|
|
25
|
+
emitDeclarationOnly: true,
|
|
26
|
+
esModuleInterop: true,
|
|
30
27
|
outDir: "dist",
|
|
31
28
|
rootDir: "src",
|
|
32
29
|
skipDefaultLibCheck: true,
|
|
33
30
|
skipLibCheck: true,
|
|
34
|
-
sourceMap:
|
|
35
|
-
strict: true,
|
|
36
|
-
strictBindCallApply: true,
|
|
37
|
-
strictFunctionTypes: true,
|
|
38
|
-
strictNullChecks: true,
|
|
39
|
-
strictPropertyInitialization: true
|
|
31
|
+
sourceMap: true
|
|
40
32
|
}),
|
|
41
33
|
...compilerOptionsParam ?? {}
|
|
42
34
|
};
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
};
|
|
49
|
-
const program = createProgram(programOptions);
|
|
35
|
+
const program = createProgramFromConfig({
|
|
36
|
+
basePath: pkg ?? cwd(),
|
|
37
|
+
compilerOptions,
|
|
38
|
+
exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
|
|
39
|
+
include: ["src"]
|
|
40
|
+
});
|
|
50
41
|
console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
|
|
51
42
|
const results = getPreEmitDiagnostics(program);
|
|
52
43
|
results.forEach((diag) => {
|
|
53
44
|
var _a;
|
|
54
45
|
const lineAndChar = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
|
|
55
|
-
console.log(chalk.cyan(`${
|
|
46
|
+
console.log(chalk.cyan(`${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
|
|
56
47
|
console.log(formatDiagnosticsWithColorAndContext([diag], formatHost));
|
|
57
48
|
});
|
|
58
49
|
return results.reduce((prev, diag) => prev + diag.category === DiagnosticCategory.Error ? 1 : 0, 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport {\n CompilerOptions,\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport {\n CompilerOptions,\n DiagnosticCategory,\n FormatDiagnosticsHost,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n LineAndCharacter,\n} from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsParam?: CompilerOptions): number => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n const formatHost: FormatDiagnosticsHost = {\n getCanonicalFileName: (fileName) => fileName,\n getCurrentDirectory: () => pkg,\n getNewLine: () => '\\n',\n }\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const program = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n })\n\n console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`)\n\n const results = getPreEmitDiagnostics(program)\n\n results.forEach((diag) => {\n const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }\n console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))\n console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))\n })\n\n return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0)\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE;AAAA,EAEE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAGP,SAAS,0BAA0B;AAE5B,MAAM,0BAA0B,CAAC,QAAwB,yBAAmD;AACjH,QAAM,MAAM,QAAQ,IAAI,YAAY,IAAI;AAExC,QAAM,aAAoC;AAAA,IACxC,sBAAsB,CAAC,aAAa;AAAA,IACpC,qBAAqB,MAAM;AAAA,IAC3B,YAAY,MAAM;AAAA,EACpB;AAEA,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,kBAAkB;AAAA,IACtB,GAAG,mBAAmB;AAAA,MACpB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,QAAM,UAAU,wBAAwB;AAAA,IACtC,UAAU,OAAO,IAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC;AAED,UAAQ,IAAI,oBAAoB,OAAO,IAAI,CAAC,KAAK,KAAK,UAAU,QAAQ,eAAe,EAAE,QAAQ,MAAM,CAAC,CAAC,EAAE;AAE3G,QAAM,UAAU,sBAAsB,OAAO;AAE7C,UAAQ,QAAQ,CAAC,SAAS;AAvD5B;AAwDI,UAAM,cAAgC,KAAK,OAAO,8BAA8B,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE;AACtI,YAAQ,IAAI,MAAM,KAAK,IAAG,UAAK,SAAL,mBAAW,QAAQ,IAAI,YAAY,OAAO,CAAC,IAAI,YAAY,YAAY,CAAC,EAAE,CAAC;AACrG,YAAQ,IAAI,qCAAqC,CAAC,IAAI,GAAG,UAAU,CAAC;AAAA,EACtE,CAAC;AAED,SAAO,QAAQ,OAAO,CAAC,MAAM,SAAU,OAAO,KAAK,aAAa,mBAAmB,QAAQ,IAAI,GAAI,CAAC;AACtG;","names":[]}
|
|
@@ -44,7 +44,6 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
|
|
|
44
44
|
}
|
|
45
45
|
const compilerOptions = {
|
|
46
46
|
...(0, import_getCompilerOptions.getCompilerOptions)({
|
|
47
|
-
baseUrl: pkg,
|
|
48
47
|
declaration: true,
|
|
49
48
|
declarationMap: true,
|
|
50
49
|
emitDeclarationOnly: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n const diagResults = result.diagnostics.length\n result.diagnostics.forEach((diag) => {\n switch (diag.category) {\n case DiagnosticCategory.Error:\n console.error(chalk.red(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Warning:\n console.error(chalk.yellow(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Suggestion:\n console.error(chalk.white(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n }\n })\n if (generateMts) {\n await copyTypeFiles(compilerOptions)\n }\n return diagResults\n}\n"],"mappings":";;;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M,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,aAAAA,QAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,qCAAmB;AACtB,gBAAQ,MAAM,aAAAA,QAAM,MAAM,KAAK,WAAW,CAAC;AAC3C,gBAAQ,MAAM,aAAAA,QAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,aAAAA,QAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,IACJ;AAAA,EACF,CAAC;AACD,MAAI,aAAa;AACf,cAAM,oCAAc,eAAe;AAAA,EACrC;AACA,SAAO;AACT;","names":["chalk"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n
|
|
1
|
+
{"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { CompilerOptions, DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {\n const pkg = process.env.INIT_CWD ?? cwd()\n\n if (params?.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const compilerOptions = {\n ...getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: true,\n }),\n ...(compilerOptionsParam ?? {}),\n } as TsConfigCompilerOptions\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n const diagResults = result.diagnostics.length\n result.diagnostics.forEach((diag) => {\n switch (diag.category) {\n case DiagnosticCategory.Error:\n console.error(chalk.red(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Warning:\n console.error(chalk.yellow(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n case DiagnosticCategory.Suggestion:\n console.error(chalk.white(diag.messageText))\n console.error(chalk.grey(pkg))\n console.error(chalk.blue(diag.file?.fileName))\n break\n }\n })\n if (generateMts) {\n await copyTypeFiles(compilerOptions)\n }\n return diagResults\n}\n"],"mappings":"AAAA,OAAO,WAAW;AAClB,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE,SAA0B,0BAA0B;AAGpD,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAE5B,MAAM,yBAAyB,OAAO,QAAwB,sBAAwC,cAAc,SAA0B;AACnJ,QAAM,MAAM,QAAQ,IAAI,YAAY,IAAI;AAExC,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,kBAAkB;AAAA,IACtB,GAAG,mBAAmB;AAAA,MACpB,aAAa;AAAA,MACb,gBAAgB;AA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": "^17.0.26",
|
|
67
67
|
"@typescript-eslint/eslint-plugin": "^6.7.3",
|
|
68
68
|
"@typescript-eslint/parser": "^6.7.3",
|
|
69
|
-
"@xylabs/tsconfig": "~3.0.
|
|
69
|
+
"@xylabs/tsconfig": "~3.0.87",
|
|
70
70
|
"chalk": "^4.1.2",
|
|
71
71
|
"cosmiconfig": "^8.3.6",
|
|
72
72
|
"cpy": "^8.1.2",
|
|
@@ -111,8 +111,8 @@
|
|
|
111
111
|
"@types/license-checker": "^25.0.4",
|
|
112
112
|
"@types/lodash": "^4.14.199",
|
|
113
113
|
"@types/parse-git-config": "^3.0.2",
|
|
114
|
-
"@xylabs/eslint-config": "^3.0.
|
|
115
|
-
"@xylabs/tsconfig": "^3.0.
|
|
114
|
+
"@xylabs/eslint-config": "^3.0.87",
|
|
115
|
+
"@xylabs/tsconfig": "^3.0.87",
|
|
116
116
|
"publint": "^0.2.3",
|
|
117
117
|
"typescript": "^5.2.2"
|
|
118
118
|
},
|
|
@@ -171,5 +171,5 @@
|
|
|
171
171
|
"package-clean": "echo Not cleaning..."
|
|
172
172
|
},
|
|
173
173
|
"sideEffects": false,
|
|
174
|
-
"version": "3.0.
|
|
174
|
+
"version": "3.0.87"
|
|
175
175
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import chalk from 'chalk'
|
|
2
2
|
import { cwd } from 'process'
|
|
3
|
+
import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
|
|
3
4
|
import {
|
|
4
5
|
CompilerOptions,
|
|
5
|
-
createProgram,
|
|
6
|
-
CreateProgramOptions,
|
|
7
6
|
DiagnosticCategory,
|
|
8
7
|
FormatDiagnosticsHost,
|
|
9
8
|
formatDiagnosticsWithColorAndContext,
|
|
@@ -14,7 +13,6 @@ import {
|
|
|
14
13
|
|
|
15
14
|
import { CompileParams } from './CompileParams'
|
|
16
15
|
import { getCompilerOptions } from './getCompilerOptions'
|
|
17
|
-
import { getAllInputs2 } from './inputs'
|
|
18
16
|
|
|
19
17
|
export const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsParam?: CompilerOptions): number => {
|
|
20
18
|
const pkg = process.env.INIT_CWD ?? cwd()
|
|
@@ -29,38 +27,27 @@ export const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsP
|
|
|
29
27
|
console.log(`Compiling with NoEmit TSC [${pkg}]`)
|
|
30
28
|
}
|
|
31
29
|
|
|
32
|
-
const
|
|
30
|
+
const compilerOptions = {
|
|
33
31
|
...getCompilerOptions({
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
emitDeclarationOnly: false,
|
|
39
|
-
noEmit: true,
|
|
32
|
+
declaration: true,
|
|
33
|
+
declarationMap: true,
|
|
34
|
+
emitDeclarationOnly: true,
|
|
35
|
+
esModuleInterop: true,
|
|
40
36
|
outDir: 'dist',
|
|
41
37
|
rootDir: 'src',
|
|
42
38
|
skipDefaultLibCheck: true,
|
|
43
39
|
skipLibCheck: true,
|
|
44
|
-
sourceMap:
|
|
45
|
-
strict: true,
|
|
46
|
-
strictBindCallApply: true,
|
|
47
|
-
strictFunctionTypes: true,
|
|
48
|
-
strictNullChecks: true,
|
|
49
|
-
strictPropertyInitialization: true,
|
|
40
|
+
sourceMap: true,
|
|
50
41
|
}),
|
|
51
42
|
...(compilerOptionsParam ?? {}),
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
delete options['moduleResolution']
|
|
55
|
-
|
|
56
|
-
const rootNames = getAllInputs2(options.rootDir ?? 'src')
|
|
43
|
+
} as TsConfigCompilerOptions
|
|
57
44
|
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
const program = createProgramFromConfig({
|
|
46
|
+
basePath: pkg ?? cwd(),
|
|
47
|
+
compilerOptions,
|
|
48
|
+
exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],
|
|
49
|
+
include: ['src'],
|
|
50
|
+
})
|
|
64
51
|
|
|
65
52
|
console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`)
|
|
66
53
|
|
|
@@ -68,7 +55,7 @@ export const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsP
|
|
|
68
55
|
|
|
69
56
|
results.forEach((diag) => {
|
|
70
57
|
const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }
|
|
71
|
-
console.log(chalk.cyan(`${
|
|
58
|
+
console.log(chalk.cyan(`${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))
|
|
72
59
|
console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))
|
|
73
60
|
})
|
|
74
61
|
|