@xylabs/ts-scripts-yarn3 3.0.84 → 3.0.86

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,64 @@ 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
36
  var import_tsc_prog = require("tsc-prog");
26
37
  var import_typescript = require("typescript");
27
38
  var import_getCompilerOptions = require("./getCompilerOptions");
28
- const packageCompileTscNoEmit = (params) => {
29
- const pkg = process.env.INIT_CWD;
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)({
36
- declaration: false,
37
- declarationMap: false,
49
+ const compilerOptions = {
50
+ ...(0, import_getCompilerOptions.getCompilerOptions)({
51
+ declaration: true,
52
+ declarationMap: true,
53
+ emitDeclarationOnly: true,
38
54
  esModuleInterop: true,
39
- noEmit: true,
40
- skipLibCheck: false,
41
- sourceMap: false
55
+ outDir: "dist",
56
+ rootDir: "src",
57
+ skipDefaultLibCheck: true,
58
+ skipLibCheck: true,
59
+ sourceMap: true
42
60
  }),
61
+ ...compilerOptionsParam ?? {}
62
+ };
63
+ const program = (0, import_tsc_prog.createProgramFromConfig)({
64
+ basePath: pkg ?? (0, import_process.cwd)(),
65
+ compilerOptions,
43
66
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
44
67
  include: ["src"]
45
- }).emit();
46
- return result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
68
+ });
69
+ console.log(`noEmit-Program: [${pkg ?? (0, import_process.cwd)()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
70
+ const results = (0, import_typescript.getPreEmitDiagnostics)(program);
71
+ results.forEach((diag) => {
72
+ var _a;
73
+ const lineAndChar = diag.file ? (0, import_typescript.getLineAndCharacterOfPosition)(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
74
+ console.log(import_chalk.default.cyan(`${pkg}/${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
75
+ console.log((0, import_typescript.formatDiagnosticsWithColorAndContext)([diag], formatHost));
76
+ });
77
+ return results.reduce((prev, diag) => prev + diag.category === import_typescript.DiagnosticCategory.Error ? 1 : 0, 0);
47
78
  };
48
79
  // Annotate the CommonJS export names for ESM import in node:
49
80
  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 { 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(`${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,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,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,52 @@
1
+ import chalk from "chalk";
1
2
  import { cwd } from "process";
2
3
  import { createProgramFromConfig } from "tsc-prog";
3
- import { DiagnosticCategory } from "typescript";
4
+ import {
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
+ const packageCompileTscNoEmit = (params, compilerOptionsParam) => {
12
+ const pkg = process.env.INIT_CWD ?? cwd();
13
+ const formatHost = {
14
+ getCanonicalFileName: (fileName) => fileName,
15
+ getCurrentDirectory: () => pkg,
16
+ getNewLine: () => "\n"
17
+ };
7
18
  if (params == null ? void 0 : params.verbose) {
8
19
  console.log(`Compiling with NoEmit TSC [${pkg}]`);
9
20
  }
10
- const result = createProgramFromConfig({
11
- basePath: pkg ?? cwd(),
12
- compilerOptions: getCompilerOptions({
13
- declaration: false,
14
- declarationMap: false,
21
+ const compilerOptions = {
22
+ ...getCompilerOptions({
23
+ declaration: true,
24
+ declarationMap: true,
25
+ emitDeclarationOnly: true,
15
26
  esModuleInterop: true,
16
- noEmit: true,
17
- skipLibCheck: false,
18
- sourceMap: false
27
+ outDir: "dist",
28
+ rootDir: "src",
29
+ skipDefaultLibCheck: true,
30
+ skipLibCheck: true,
31
+ sourceMap: true
19
32
  }),
33
+ ...compilerOptionsParam ?? {}
34
+ };
35
+ const program = createProgramFromConfig({
36
+ basePath: pkg ?? cwd(),
37
+ compilerOptions,
20
38
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
21
39
  include: ["src"]
22
- }).emit();
23
- return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length;
40
+ });
41
+ console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`);
42
+ const results = getPreEmitDiagnostics(program);
43
+ results.forEach((diag) => {
44
+ var _a;
45
+ const lineAndChar = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 };
46
+ console.log(chalk.cyan(`${pkg}/${(_a = diag.file) == null ? void 0 : _a.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`));
47
+ console.log(formatDiagnosticsWithColorAndContext([diag], formatHost));
48
+ });
49
+ return results.reduce((prev, diag) => prev + diag.category === DiagnosticCategory.Error ? 1 : 0, 0);
24
50
  };
25
51
  export {
26
52
  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 { 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(`${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,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,QA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AAI,CAAC;AACtG;","names":[]}
@@ -38,7 +38,7 @@ 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
  }
@@ -49,6 +49,8 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
49
49
  emitDeclarationOnly: true,
50
50
  esModuleInterop: true,
51
51
  outDir: "dist",
52
+ rootDir: "src",
53
+ skipDefaultLibCheck: true,
52
54
  skipLibCheck: true,
53
55
  sourceMap: true
54
56
  }),
@@ -60,7 +62,7 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
60
62
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
61
63
  include: ["src"]
62
64
  }).emit();
63
- const diagResults = result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
65
+ const diagResults = result.diagnostics.length;
64
66
  result.diagnostics.forEach((diag) => {
65
67
  var _a, _b, _c;
66
68
  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;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esContent":["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;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,qBAAoB;AACpB,sBAAiE;AACjE,wBAAo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K,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,7 +5,7 @@ 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
  }
@@ -16,6 +16,8 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
16
16
  emitDeclarationOnly: true,
17
17
  esModuleInterop: true,
18
18
  outDir: "dist",
19
+ rootDir: "src",
20
+ skipDefaultLibCheck: true,
19
21
  skipLibCheck: true,
20
22
  sourceMap: true
21
23
  }),
@@ -27,7 +29,7 @@ const packageCompileTscTypes = async (params, compilerOptionsParam, generateMts
27
29
  exclude: ["dist", "docs", "**/*.spec.*", "**/*.stories.*", "src/**/spec/**/*"],
28
30
  include: ["src"]
29
31
  }).emit();
30
- const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length;
32
+ const diagResults = result.diagnostics.length;
31
33
  result.diagnostics.forEach((diag) => {
32
34
  var _a, _b, _c;
33
35
  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,I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,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 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 (generateM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,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.86",
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.86",
115
+ "@xylabs/tsconfig": "^3.0.86",
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.86"
175
175
  }
@@ -1,30 +1,63 @@
1
+ import chalk from 'chalk'
1
2
  import { cwd } from 'process'
2
3
  import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
3
- import { DiagnosticCategory } from 'typescript'
4
+ import {
5
+ CompilerOptions,
6
+ DiagnosticCategory,
7
+ FormatDiagnosticsHost,
8
+ formatDiagnosticsWithColorAndContext,
9
+ getLineAndCharacterOfPosition,
10
+ getPreEmitDiagnostics,
11
+ LineAndCharacter,
12
+ } from 'typescript'
4
13
 
5
14
  import { CompileParams } from './CompileParams'
6
15
  import { getCompilerOptions } from './getCompilerOptions'
7
16
 
8
- export const packageCompileTscNoEmit = (params?: CompileParams): number => {
9
- const pkg = process.env.INIT_CWD
17
+ export const packageCompileTscNoEmit = (params?: CompileParams, compilerOptionsParam?: CompilerOptions): number => {
18
+ const pkg = process.env.INIT_CWD ?? cwd()
19
+
20
+ const formatHost: FormatDiagnosticsHost = {
21
+ getCanonicalFileName: (fileName) => fileName,
22
+ getCurrentDirectory: () => pkg,
23
+ getNewLine: () => '\n',
24
+ }
10
25
 
11
26
  if (params?.verbose) {
12
27
  console.log(`Compiling with NoEmit TSC [${pkg}]`)
13
28
  }
14
29
 
15
- const result = createProgramFromConfig({
16
- basePath: pkg ?? cwd(),
17
- compilerOptions: getCompilerOptions({
18
- declaration: false,
19
- declarationMap: false,
30
+ const compilerOptions = {
31
+ ...getCompilerOptions({
32
+ declaration: true,
33
+ declarationMap: true,
34
+ emitDeclarationOnly: true,
20
35
  esModuleInterop: true,
21
- noEmit: true,
22
- skipLibCheck: false,
23
- sourceMap: false,
24
- }) as TsConfigCompilerOptions,
36
+ outDir: 'dist',
37
+ rootDir: 'src',
38
+ skipDefaultLibCheck: true,
39
+ skipLibCheck: true,
40
+ sourceMap: true,
41
+ }),
42
+ ...(compilerOptionsParam ?? {}),
43
+ } as TsConfigCompilerOptions
44
+
45
+ const program = createProgramFromConfig({
46
+ basePath: pkg ?? cwd(),
47
+ compilerOptions,
25
48
  exclude: ['dist', 'docs', '**/*.spec.*', '**/*.stories.*', 'src/**/spec/**/*'],
26
49
  include: ['src'],
27
- }).emit()
50
+ })
51
+
52
+ console.log(`noEmit-Program: [${pkg ?? cwd()}] ${JSON.stringify(program.getSourceFiles().length, null, 2)}`)
53
+
54
+ const results = getPreEmitDiagnostics(program)
55
+
56
+ results.forEach((diag) => {
57
+ const lineAndChar: LineAndCharacter = diag.file ? getLineAndCharacterOfPosition(diag.file, diag.start ?? 0) : { character: 0, line: 0 }
58
+ console.log(chalk.cyan(`${pkg}/${diag.file?.fileName}:${lineAndChar.line + 1}:${lineAndChar.character + 1}`))
59
+ console.log(formatDiagnosticsWithColorAndContext([diag], formatHost))
60
+ })
28
61
 
29
- return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length
62
+ return results.reduce((prev, diag) => (prev + diag.category === DiagnosticCategory.Error ? 1 : 0), 0)
30
63
  }
@@ -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}]`)
@@ -21,6 +21,8 @@ export const packageCompileTscTypes = async (params?: CompileParams, compilerOpt
21
21
  emitDeclarationOnly: true,
22
22
  esModuleInterop: true,
23
23
  outDir: 'dist',
24
+ rootDir: 'src',
25
+ skipDefaultLibCheck: true,
24
26
  skipLibCheck: true,
25
27
  sourceMap: true,
26
28
  }),
@@ -34,7 +36,7 @@ export const packageCompileTscTypes = async (params?: CompileParams, compilerOpt
34
36
  include: ['src'],
35
37
  }).emit()
36
38
 
37
- const diagResults = result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length
39
+ const diagResults = result.diagnostics.length
38
40
  result.diagnostics.forEach((diag) => {
39
41
  switch (diag.category) {
40
42
  case DiagnosticCategory.Error: