@xylabs/ts-scripts-yarn3 3.0.84 → 3.0.85

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.
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,35 +17,72 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
  var tscNoEmit_exports = {};
20
30
  __export(tscNoEmit_exports, {
21
31
  packageCompileTscNoEmit: () => packageCompileTscNoEmit
22
32
  });
23
33
  module.exports = __toCommonJS(tscNoEmit_exports);
34
+ var import_chalk = __toESM(require("chalk"));
24
35
  var import_process = require("process");
25
- var import_tsc_prog = require("tsc-prog");
26
36
  var import_typescript = require("typescript");
27
37
  var import_getCompilerOptions = require("./getCompilerOptions");
28
- const packageCompileTscNoEmit = (params) => {
29
- const pkg = process.env.INIT_CWD;
38
+ var import_inputs = require("./inputs");
39
+ const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
40
+ const pkg = process.env.INIT_CWD ?? (0, import_process.cwd)();
41
+ const formatHost = {
42
+ getCanonicalFileName: (fileName) => fileName,
43
+ getCurrentDirectory: () => pkg,
44
+ getNewLine: () => "\n"
45
+ };
30
46
  if (params == null ? void 0 : params.verbose) {
31
47
  console.log(`Compiling with NoEmit TSC [${pkg}]`);
32
48
  }
33
- const result = (0, import_tsc_prog.createProgramFromConfig)({
34
- basePath: pkg ?? (0, import_process.cwd)(),
35
- compilerOptions: (0, import_getCompilerOptions.getCompilerOptions)({
49
+ const options = {
50
+ ...(0, import_getCompilerOptions.getCompilerOptions)({
51
+ alwaysStrict: true,
52
+ baseUrl: pkg,
36
53
  declaration: false,
37
54
  declarationMap: false,
38
- esModuleInterop: true,
55
+ emitDeclarationOnly: false,
39
56
  noEmit: true,
40
- skipLibCheck: false,
41
- sourceMap: false
57
+ outDir: "dist",
58
+ rootDir: "src",
59
+ skipDefaultLibCheck: true,
60
+ skipLibCheck: true,
61
+ sourceMap: false,
62
+ strict: true,
63
+ strictBindCallApply: true,
64
+ strictFunctionTypes: true,
65
+ strictNullChecks: true,
66
+ strictPropertyInitialization: true
42
67
  }),
43
- exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
44
- include: ["src"]
45
- }).emit();
46
- return result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
68
+ ...compilerOptionsParam ?? {}
69
+ };
70
+ delete options["moduleResolution"];
71
+ const rootNames = (0, import_inputs.getAllInputs2)(options.rootDir ?? "src");
72
+ const programOptions = {
73
+ options,
74
+ rootNames
75
+ };
76
+ const program = (0, import_typescript.createProgram)(programOptions);
77
+ console.log(`noEmit-Program: [${pkg ?? (0, import_process.cwd)()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
78
+ const results = (0, import_typescript.getPreEmitDiagnostics)(program);
79
+ results.forEach((diag) => {
80
+ var _a;
81
+ const lineAndChar = diag.file ? (0, import_typescript.getLineAndCharacterOfPosition)(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
82
+ console.log(import_chalk.default.cyan(`${pkg}/${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
83
+ console.log((0, import_typescript.formatDiagnosticsWithColorAndContext)([diag], formatHost));
84
+ });
85
+ return results.reduce((prev, diag) => prev + diag.category === import_typescript.DiagnosticCategory.Error ? 1 : 0, 0);
47
86
  };
48
87
  // Annotate the CommonJS export names for ESM import in node:
49
88
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AACpB,sBAAiE;AACjE,wBAAmC;AAGnC,gCAAmC;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,aAAS,yCAAwB;AAAA,IACrC,UAAU,WAAO,oBAAI;AAAA,IACrB,qBAAiB,8CAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,qCAAmB,KAAK,EAAE;AACxF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport {\n CompilerOptions,\n createProgram,\n CreateProgramOptions,\n DiagnosticCategory,\n FormatDiagnosticsHost,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n LineAndCharacter,\n} from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs2 } from './inputs'\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 options: CompilerOptions = {\n ...getCompilerOptions({\n alwaysStrict: true,\n baseUrl: pkg,\n declaration: false,\n declarationMap: false,\n emitDeclarationOnly: false,\n noEmit: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: false,\n strict: true,\n strictBindCallApply: true,\n strictFunctionTypes: true,\n strictNullChecks: true,\n strictPropertyInitialization: true,\n }),\n ...(compilerOptionsParam ?? {}),\n }\n\n delete options['moduleResolution']\n\n const rootNames = getAllInputs2(options.rootDir ?? 'src')\n\n const programOptions: CreateProgramOptions = {\n options,\n rootNames,\n }\n\n const program = createProgram(programOptions)\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(`${pkg}/${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,wBAUO;AAGP,gCAAmC;AACnC,oBAA8B;AAEvB,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,UAA2B;AAAA,IAC/B,OAAG,8CAAmB;AAAA,MACpB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,qBAAqB;AAAA,MACrB,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,MAClB,8BAA8B;AAAA,IAChC,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,SAAO,QAAQ,kBAAkB;AAEjC,QAAM,gBAAY,6BAAc,QAAQ,WAAW,KAAK;AAExD,QAAM,iBAAuC;AAAA,IAC3C;AAAA,IACA;AAAA,EACF;AAEA,QAAM,cAAU,iCAAc,cAAc;AAE5C,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;AApE5B;AAqEI,UAAM,cAAgC,KAAK,WAAO,iDAA8B,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE;AACtI,YAAQ,IAAI,aAAAA,QAAM,KAAK,GAAG,GAAG,KAAI,UAAK,SAAL,mBAAW,QAAQ,IAAI,YAAY,OAAO,CAAC,IAAI,YAAY,YAAY,CAAC,EAAE,CAAC;AAC5G,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,26 +1,61 @@
1
+ import chalk from "chalk";
1
2
  import { cwd } from "process";
2
- import { createProgramFromConfig } from "tsc-prog";
3
- import { DiagnosticCategory } from "typescript";
3
+ import {
4
+ createProgram,
5
+ DiagnosticCategory,
6
+ formatDiagnosticsWithColorAndContext,
7
+ getLineAndCharacterOfPosition,
8
+ getPreEmitDiagnostics
9
+ } from "typescript";
4
10
  import { getCompilerOptions } from "./getCompilerOptions";
5
- const packageCompileTscNoEmit = (params) => {
6
- const pkg = process.env.INIT_CWD;
11
+ import { getAllInputs2 } from "./inputs";
12
+ const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
13
+ const pkg = process.env.INIT_CWD ?? cwd();
14
+ const formatHost = {
15
+ getCanonicalFileName: (fileName) => fileName,
16
+ getCurrentDirectory: () => pkg,
17
+ getNewLine: () => "\n"
18
+ };
7
19
  if (params == null ? void 0 : params.verbose) {
8
20
  console.log(`Compiling with NoEmit TSC [${pkg}]`);
9
21
  }
10
- const result = createProgramFromConfig({
11
- basePath: pkg ?? cwd(),
12
- compilerOptions: getCompilerOptions({
22
+ const options = {
23
+ ...getCompilerOptions({
24
+ alwaysStrict: true,
25
+ baseUrl: pkg,
13
26
  declaration: false,
14
27
  declarationMap: false,
15
- esModuleInterop: true,
28
+ emitDeclarationOnly: false,
16
29
  noEmit: true,
17
- skipLibCheck: false,
18
- sourceMap: false
30
+ outDir: "dist",
31
+ rootDir: "src",
32
+ skipDefaultLibCheck: true,
33
+ skipLibCheck: true,
34
+ sourceMap: false,
35
+ strict: true,
36
+ strictBindCallApply: true,
37
+ strictFunctionTypes: true,
38
+ strictNullChecks: true,
39
+ strictPropertyInitialization: true
19
40
  }),
20
- exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
21
- include: ["src"]
22
- }).emit();
23
- return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length;
41
+ ...compilerOptionsParam ?? {}
42
+ };
43
+ delete options["moduleResolution"];
44
+ const rootNames = getAllInputs2(options.rootDir ?? "src");
45
+ const programOptions = {
46
+ options,
47
+ rootNames
48
+ };
49
+ const program = createProgram(programOptions);
50
+ console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
51
+ const results = getPreEmitDiagnostics(program);
52
+ results.forEach((diag) => {
53
+ var _a;
54
+ const lineAndChar = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
55
+ console.log(chalk.cyan(`${pkg}/${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
56
+ console.log(formatDiagnosticsWithColorAndContext([diag], formatHost));
57
+ });
58
+ return results.reduce((prev, diag) => prev + diag.category === DiagnosticCategory.Error ? 1 : 0, 0);
24
59
  };
25
60
  export {
26
61
  packageCompileTscNoEmit
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscNoEmit = (params?: CompileParams): number => {\n const pkg = process.env.INIT_CWD\n\n if (params?.verbose) {\n console.log(`Compiling with NoEmit TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: false,\n declarationMap: false,\n esModuleInterop: true,\n noEmit: true,\n skipLibCheck: false,\n sourceMap: false,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE,SAAS,0BAA0B;AAGnC,SAAS,0BAA0B;AAE5B,MAAM,0BAA0B,CAAC,WAAmC;AACzE,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,8BAA8B,GAAG,GAAG;AAAA,EAClD;AAEA,QAAM,SAAS,wBAAwB;AAAA,IACrC,UAAU,OAAO,IAAI;AAAA,IACrB,iBAAiB,mBAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,mBAAmB,KAAK,EAAE;AACxF;","names":[]}
1
+ {"version":3,"sources":["../../../../src/actions/package/compile/tscNoEmit.ts"],"sourcesContent":["import chalk from 'chalk'\nimport { cwd } from 'process'\nimport {\n CompilerOptions,\n createProgram,\n CreateProgramOptions,\n DiagnosticCategory,\n FormatDiagnosticsHost,\n formatDiagnosticsWithColorAndContext,\n getLineAndCharacterOfPosition,\n getPreEmitDiagnostics,\n LineAndCharacter,\n} from 'typescript'\n\nimport { CompileParams } from './CompileParams'\nimport { getCompilerOptions } from './getCompilerOptions'\nimport { getAllInputs2 } from './inputs'\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 options: CompilerOptions = {\n ...getCompilerOptions({\n alwaysStrict: true,\n baseUrl: pkg,\n declaration: false,\n declarationMap: false,\n emitDeclarationOnly: false,\n noEmit: true,\n outDir: 'dist',\n rootDir: 'src',\n skipDefaultLibCheck: true,\n skipLibCheck: true,\n sourceMap: false,\n strict: true,\n strictBindCallApply: true,\n strictFunctionTypes: true,\n strictNullChecks: true,\n strictPropertyInitialization: true,\n }),\n ...(compilerOptionsParam ?? {}),\n }\n\n delete options['moduleResolution']\n\n const rootNames = getAllInputs2(options.rootDir ?? 'src')\n\n const programOptions: CreateProgramOptions = {\n options,\n rootNames,\n }\n\n const program = createProgram(programOptions)\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(`${pkg}/${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;AAAA,EAEE;AAAA,EAEA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,OAEK;AAGP,SAAS,0BAA0B;AACnC,SAAS,qBAAqB;AAEvB,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,UAA2B;AAAA,IAC/B,GAAG,mBAAmB;AAAA,MACpB,cAAc;AAAA,MACd,SAAS;AAAA,MACT,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,QAAQ;AAAA,MACR,QAAQ;AAAA,MACR,SAAS;AAAA,MACT,qBAAqB;AAAA,MACrB,cAAc;AAAA,MACd,WAAW;AAAA,MACX,QAAQ;AAAA,MACR,qBAAqB;AAAA,MACrB,qBAAqB;AAAA,MACrB,kBAAkB;AAAA,MAClB,8BAA8B;AAAA,IAChC,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,SAAO,QAAQ,kBAAkB;AAEjC,QAAM,YAAY,cAAc,QAAQ,WAAW,KAAK;AAExD,QAAM,iBAAuC;AAAA,IAC3C;AAAA,IACA;AAAA,EACF;AAEA,QAAM,UAAU,cAAc,cAAc;AAE5C,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;AApE5B;AAqEI,UAAM,cAAgC,KAAK,OAAO,8BAA8B,KAAK,MAAM,KAAK,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,EAAE;AACtI,YAAQ,IAAI,MAAM,KAAK,GAAG,GAAG,KAAI,UAAK,SAAL,mBAAW,QAAQ,IAAI,YAAY,OAAO,CAAC,IAAI,YAAY,YAAY,CAAC,EAAE,CAAC;AAC5G,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":[]}
@@ -38,17 +38,20 @@ var import_typescript = require("typescript");
38
38
  var import_copyTypeFiles = require("./copyTypeFiles");
39
39
  var import_getCompilerOptions = require("./getCompilerOptions");
40
40
  const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts = true) => {
41
- const pkg = process.env.INIT_CWD;
41
+ const pkg = process.env.INIT_CWD ?? (0, import_process.cwd)();
42
42
  if (params == null ? void 0 : params.verbose) {
43
43
  console.log(`Compiling types with TSC [${pkg}]`);
44
44
  }
45
45
  const compilerOptions = {
46
46
  ...(0, import_getCompilerOptions.getCompilerOptions)({
47
+ baseUrl: pkg,
47
48
  declaration: true,
48
49
  declarationMap: true,
49
50
  emitDeclarationOnly: true,
50
51
  esModuleInterop: true,
51
52
  outDir: "dist",
53
+ rootDir: "src",
54
+ skipDefaultLibCheck: true,
52
55
  skipLibCheck: true,
53
56
  sourceMap: true
54
57
  }),
@@ -60,7 +63,7 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
60
63
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
61
64
  include: ["src"]
62
65
  }).emit();
63
- const diagResults = result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
66
+ const diagResults = result.diagnostics.length;
64
67
  result.diagnostics.forEach((diag) => {
65
68
  var _a, _b, _c;
66
69
  switch (diag.category) {
@@ -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\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 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.map((value) => value.category === DiagnosticCategory.Error).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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAAoD;AAGpD,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,QAAwB,sBAAwC,cAAc,SAA0B;AACnJ,QAAM,MAAM,QAAQ,IAAI;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,kBAAkB;AAAA,IACtB,OAAG,8CAAmB;AAAA,MACpB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,QAAM,aAAS,yCAAwB;AAAA,IACrC,UAAU,WAAO,oBAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,QAAM,cAAc,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,qCAAmB,KAAK,EAAE;AACnG,SAAO,YAAY,QAAQ,CAAC,SAAS;AArCvC;AAsCI,YAAQ,KAAK,UAAU;AAAA,MACrB,KAAK,qCAAmB;AACtB,gBAAQ,MAAM,aAAAA,QAAM,IAAI,KAAK,WAAW,CAAC;AACzC,gBAAQ,MAAM,aAAAA,QAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,aAAAA,QAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,qCAAmB;AACtB,gBAAQ,MAAM,aAAAA,QAAM,OAAO,KAAK,WAAW,CAAC;AAC5C,gBAAQ,MAAM,aAAAA,QAAM,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
+ {"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 baseUrl: pkg,\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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAAoD;AAGpD,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,QAAwB,sBAAwC,cAAc,SAA0B;AACnJ,QAAM,MAAM,QAAQ,IAAI,gBAAY,oBAAI;AAExC,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,kBAAkB;AAAA,IACtB,OAAG,8CAAmB;AAAA,MACpB,SAAS;AAAA,MACT,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,aAAS,yCAAwB;AAAA,IACrC,UAAU,WAAO,oBAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,QAAM,cAAc,OAAO,YAAY;AACvC,SAAO,YAAY,QAAQ,CAAC,SAAS;AAxCvC;AAyCI,YAAQ,KAAK,UAAU;AAAA,MACrB,KAAK,qCAAmB;AACtB,gBAAQ,MAAM,aAAAA,QAAM,IAAI,KAAK,WAAW,CAAC;AACzC,gBAAQ,MAAM,aAAAA,QAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,aAAAA,QAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,qCAAmB;AACtB,gBAAQ,MAAM,aAAAA,QAAM,OAAO,KAAK,WAAW,CAAC;AAC5C,gBAAQ,MAAM,aAAAA,QAAM,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"]}
@@ -5,17 +5,20 @@ import { DiagnosticCategory } from "typescript";
5
5
  import { copyTypeFiles } from "./copyTypeFiles";
6
6
  import { getCompilerOptions } from "./getCompilerOptions";
7
7
  const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts = true) => {
8
- const pkg = process.env.INIT_CWD;
8
+ const pkg = process.env.INIT_CWD ?? cwd();
9
9
  if (params == null ? void 0 : params.verbose) {
10
10
  console.log(`Compiling types with TSC [${pkg}]`);
11
11
  }
12
12
  const compilerOptions = {
13
13
  ...getCompilerOptions({
14
+ baseUrl: pkg,
14
15
  declaration: true,
15
16
  declarationMap: true,
16
17
  emitDeclarationOnly: true,
17
18
  esModuleInterop: true,
18
19
  outDir: "dist",
20
+ rootDir: "src",
21
+ skipDefaultLibCheck: true,
19
22
  skipLibCheck: true,
20
23
  sourceMap: true
21
24
  }),
@@ -27,7 +30,7 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
27
30
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
28
31
  include: ["src"]
29
32
  }).emit();
30
- const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length;
33
+ const diagResults = result.diagnostics.length;
31
34
  result.diagnostics.forEach((diag) => {
32
35
  var _a, _b, _c;
33
36
  switch (diag.category) {
@@ -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\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 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.map((value) => value.category === DiagnosticCategory.Error).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;AAExB,MAAI,iCAAQ,SAAS;AACnB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,kBAAkB;AAAA,IACtB,GAAG,mBAAmB;AAAA,MACpB,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,GAAI,wBAAwB,CAAC;AAAA,EAC/B;AAEA,QAAM,SAAS,wBAAwB;AAAA,IACrC,UAAU,OAAO,IAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,QAAM,cAAc,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,mBAAmB,KAAK,EAAE;AACnG,SAAO,YAAY,QAAQ,CAAC,SAAS;AArCvC;AAsCI,YAAQ,KAAK,UAAU;AAAA,MACrB,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,IAAI,KAAK,WAAW,CAAC;AACzC,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,OAAO,KAAK,WAAW,CAAC;AAC5C,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,MAAM,KAAK,WAAW,CAAC;AAC3C,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,IACJ;AAAA,EACF,CAAC;AACD,MAAI,aAAa;AACf,UAAM,cAAc,eAAe;AAAA,EACrC;AACA,SAAO;AACT;","names":[]}
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 baseUrl: pkg,\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,SAAS;AAAA,MACT,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,SAAS,wBAAwB;AAAA,IACrC,UAAU,OAAO,IAAI;AAAA,IACrB;AAAA,IACA,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB,kBAAkB;AAAA,IAC7E,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,QAAM,cAAc,OAAO,YAAY;AACvC,SAAO,YAAY,QAAQ,CAAC,SAAS;AAxCvC;AAyCI,YAAQ,KAAK,UAAU;AAAA,MACrB,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,IAAI,KAAK,WAAW,CAAC;AACzC,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,OAAO,KAAK,WAAW,CAAC;AAC5C,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,MACF,KAAK,mBAAmB;AACtB,gBAAQ,MAAM,MAAM,MAAM,KAAK,WAAW,CAAC;AAC3C,gBAAQ,MAAM,MAAM,KAAK,GAAG,CAAC;AAC7B,gBAAQ,MAAM,MAAM,MAAK,UAAK,SAAL,mBAAW,QAAQ,CAAC;AAC7C;AAAA,IACJ;AAAA,EACF,CAAC;AACD,MAAI,aAAa;AACf,UAAM,cAAc,eAAe;AAAA,EACrC;AACA,SAAO;AACT;","names":[]}
package/package.json CHANGED
@@ -66,7 +66,7 @@
66
66
  "@types/yargs": "^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.84",
69
+ "@xylabs/tsconfig": "~3.0.85",
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.84",
115
- "@xylabs/tsconfig": "^3.0.84",
114
+ "@xylabs/eslint-config": "^3.0.85",
115
+ "@xylabs/tsconfig": "^3.0.85",
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.84"
174
+ "version": "3.0.85"
175
175
  }
@@ -1,30 +1,76 @@
1
+ import chalk from 'chalk'
1
2
  import { cwd } from 'process'
2
- import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
3
- import { DiagnosticCategory } from 'typescript'
3
+ import {
4
+ CompilerOptions,
5
+ createProgram,
6
+ CreateProgramOptions,
7
+ DiagnosticCategory,
8
+ FormatDiagnosticsHost,
9
+ formatDiagnosticsWithColorAndContext,
10
+ getLineAndCharacterOfPosition,
11
+ getPreEmitDiagnostics,
12
+ LineAndCharacter,
13
+ } from 'typescript'
4
14
 
5
15
  import { CompileParams } from './CompileParams'
6
16
  import { getCompilerOptions } from './getCompilerOptions'
17
+ import { getAllInputs2 } from './inputs'
7
18
 
8
- export const packageCompileTscNoEmit = (params?: CompileParams): number => {
9
- const pkg = process.env.INIT_CWD
19
+ export const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsParam?: CompilerOptions): number => {
20
+ const pkg = process.env.INIT_CWD ?? cwd()
21
+
22
+ const formatHost: FormatDiagnosticsHost = {
23
+ getCanonicalFileName: (fileName) => fileName,
24
+ getCurrentDirectory: () => pkg,
25
+ getNewLine: () => '\n',
26
+ }
10
27
 
11
28
  if (params?.verbose) {
12
29
  console.log(`Compiling with NoEmit TSC [${pkg}]`)
13
30
  }
14
31
 
15
- const result = createProgramFromConfig({
16
- basePath: pkg ?? cwd(),
17
- compilerOptions: getCompilerOptions({
32
+ const options: CompilerOptions = {
33
+ ...getCompilerOptions({
34
+ alwaysStrict: true,
35
+ baseUrl: pkg,
18
36
  declaration: false,
19
37
  declarationMap: false,
20
- esModuleInterop: true,
38
+ emitDeclarationOnly: false,
21
39
  noEmit: true,
22
- skipLibCheck: false,
40
+ outDir: 'dist',
41
+ rootDir: 'src',
42
+ skipDefaultLibCheck: true,
43
+ skipLibCheck: true,
23
44
  sourceMap: false,
24
- }) as TsConfigCompilerOptions,
25
- exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],
26
- include: ['src'],
27
- }).emit()
45
+ strict: true,
46
+ strictBindCallApply: true,
47
+ strictFunctionTypes: true,
48
+ strictNullChecks: true,
49
+ strictPropertyInitialization: true,
50
+ }),
51
+ ...(compilerOptionsParam ?? {}),
52
+ }
53
+
54
+ delete options['moduleResolution']
55
+
56
+ const rootNames = getAllInputs2(options.rootDir ?? 'src')
57
+
58
+ const programOptions: CreateProgramOptions = {
59
+ options,
60
+ rootNames,
61
+ }
62
+
63
+ const program = createProgram(programOptions)
64
+
65
+ console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`)
66
+
67
+ const results = getPreEmitDiagnostics(program)
68
+
69
+ results.forEach((diag) => {
70
+ const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }
71
+ console.log(chalk.cyan(`${pkg}/${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))
72
+ console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))
73
+ })
28
74
 
29
- return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length
75
+ return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0)
30
76
  }
@@ -8,7 +8,7 @@ import { copyTypeFiles } from './copyTypeFiles'
8
8
  import { getCompilerOptions } from './getCompilerOptions'
9
9
 
10
10
  export const packageCompileTscTypes = async (params?: CompileParams, compilerOptionsParam?: CompilerOptions, generateMts = true): Promise<number> => {
11
- const pkg = process.env.INIT_CWD
11
+ const pkg = process.env.INIT_CWD ?? cwd()
12
12
 
13
13
  if (params?.verbose) {
14
14
  console.log(`Compiling types with TSC [${pkg}]`)
@@ -16,11 +16,14 @@ export const packageCompileTscTypes = async (params?: CompileParams, compilerOpt
16
16
 
17
17
  const compilerOptions = {
18
18
  ...getCompilerOptions({
19
+ baseUrl: pkg,
19
20
  declaration: true,
20
21
  declarationMap: true,
21
22
  emitDeclarationOnly: true,
22
23
  esModuleInterop: true,
23
24
  outDir: 'dist',
25
+ rootDir: 'src',
26
+ skipDefaultLibCheck: true,
24
27
  skipLibCheck: true,
25
28
  sourceMap: true,
26
29
  }),
@@ -34,7 +37,7 @@ export const packageCompileTscTypes = async (params?: CompileParams, compilerOpt
34
37
  include: ['src'],
35
38
  }).emit()
36
39
 
37
- const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length
40
+ const diagResults = result.diagnostics.length
38
41
  result.diagnostics.forEach((diag) => {
39
42
  switch (diag.category) {
40
43
  case DiagnosticCategory.Error: