@xylabs/ts-scripts-yarn3 3.0.23 → 3.0.24

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.
@@ -23,12 +23,17 @@ __export(tscTypes_exports, {
23
23
  module.exports = __toCommonJS(tscTypes_exports);
24
24
  var import_process = require("process");
25
25
  var import_tsc_prog = require("tsc-prog");
26
+ var import_typescript = require("typescript");
26
27
  var import_lib = require("../../../lib");
27
28
  var import_copyTypeFiles = require("./copyTypeFiles");
28
29
  var import_getCompilerOptions = require("./getCompilerOptions");
29
30
  const packageCompileTscTypes = async (params) => {
30
31
  const pkg = process.env.INIT_CWD;
31
- const buildOptions = {
32
+ const config = await (0, import_lib.loadConfig)(params);
33
+ if (config.verbose) {
34
+ console.log(`Compiling types with TSC [${pkg}]`);
35
+ }
36
+ const result = (0, import_tsc_prog.createProgramFromConfig)({
32
37
  basePath: pkg ?? (0, import_process.cwd)(),
33
38
  compilerOptions: (0, import_getCompilerOptions.getCompilerOptions)({
34
39
  declaration: true,
@@ -39,16 +44,12 @@ const packageCompileTscTypes = async (params) => {
39
44
  skipLibCheck: true,
40
45
  sourceMap: true
41
46
  }),
42
- exclude: ["dist", "docs", "*.spec.*", "src/**/spec/**/*"],
47
+ configFilePath: "tsconfig.json",
48
+ exclude: ["dist", "docs", "**/*.spec.*", "src/**/spec/**/*"],
43
49
  include: ["src"]
44
- };
45
- const config = await (0, import_lib.loadConfig)(params);
46
- if (config.verbose) {
47
- console.log(`Compiling types with TSC [${pkg}]`);
48
- }
49
- (0, import_tsc_prog.build)(buildOptions);
50
+ }).emit();
50
51
  await (0, import_copyTypeFiles.copyTypeFiles)();
51
- return 0;
52
+ return result.diagnostics.map((value) => value.category === import_typescript.DiagnosticCategory.Error).length;
52
53
  };
53
54
  // Annotate the CommonJS export names for ESM import in node:
54
55
  0 && (module.exports = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { build, BuildOptions, TsConfigCompilerOptions } from 'tsc-prog'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n const buildOptions: BuildOptions = {\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '*.spec.*', 'src/**/spec/**/*'],\n include: ['src'],\n }\n\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n build(buildOptions)\n await copyTypeFiles()\n return 0\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoB;AACpB,sBAA6D;AAE7D,iBAA2B;AAE3B,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,WAA4C;AACvF,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,eAA6B;AAAA,IACjC,UAAU,WAAO,oBAAI;AAAA,IACrB,qBAAiB,8CAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,YAAY,kBAAkB;AAAA,IACxD,SAAS,CAAC,KAAK;AAAA,EACjB;AAEA,QAAM,SAAS,UAAM,uBAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,6BAAM,YAAY;AAClB,YAAM,oCAAc;AACpB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }) as TsConfigCompilerOptions,\n configFilePath: 'tsconfig.json',\n exclude: ['dist', 'docs', '**/*.spec.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n await copyTypeFiles()\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;AAEnC,iBAA2B;AAE3B,2BAA8B;AAC9B,gCAAmC;AAE5B,MAAM,yBAAyB,OAAO,WAA4C;AACvF,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,SAAS,UAAM,uBAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,aAAS,yCAAwB;AAAA,IACrC,UAAU,WAAO,oBAAI;AAAA,IACrB,qBAAiB,8CAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,gBAAgB;AAAA,IAChB,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB;AAAA,IAC3D,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,YAAM,oCAAc;AACpB,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,qCAAmB,KAAK,EAAE;AACxF;","names":[]}
@@ -1,11 +1,16 @@
1
1
  import { cwd } from "process";
2
- import { build } from "tsc-prog";
2
+ import { createProgramFromConfig } from "tsc-prog";
3
+ import { DiagnosticCategory } from "typescript";
3
4
  import { loadConfig } from "../../../lib";
4
5
  import { copyTypeFiles } from "./copyTypeFiles";
5
6
  import { getCompilerOptions } from "./getCompilerOptions";
6
7
  const packageCompileTscTypes = async (params) => {
7
8
  const pkg = process.env.INIT_CWD;
8
- const buildOptions = {
9
+ const config = await loadConfig(params);
10
+ if (config.verbose) {
11
+ console.log(`Compiling types with TSC [${pkg}]`);
12
+ }
13
+ const result = createProgramFromConfig({
9
14
  basePath: pkg ?? cwd(),
10
15
  compilerOptions: getCompilerOptions({
11
16
  declaration: true,
@@ -16,16 +21,12 @@ const packageCompileTscTypes = async (params) => {
16
21
  skipLibCheck: true,
17
22
  sourceMap: true
18
23
  }),
19
- exclude: ["dist", "docs", "*.spec.*", "src/**/spec/**/*"],
24
+ configFilePath: "tsconfig.json",
25
+ exclude: ["dist", "docs", "**/*.spec.*", "src/**/spec/**/*"],
20
26
  include: ["src"]
21
- };
22
- const config = await loadConfig(params);
23
- if (config.verbose) {
24
- console.log(`Compiling types with TSC [${pkg}]`);
25
- }
26
- build(buildOptions);
27
+ }).emit();
27
28
  await copyTypeFiles();
28
- return 0;
29
+ return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length;
29
30
  };
30
31
  export {
31
32
  packageCompileTscTypes
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { build, BuildOptions, TsConfigCompilerOptions } from 'tsc-prog'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n const buildOptions: BuildOptions = {\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }) as TsConfigCompilerOptions,\n exclude: ['dist', 'docs', '*.spec.*', 'src/**/spec/**/*'],\n include: ['src'],\n }\n\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n build(buildOptions)\n await copyTypeFiles()\n return 0\n}\n"],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,aAAoD;AAE7D,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAE5B,MAAM,yBAAyB,OAAO,WAA4C;AACvF,QAAM,MAAM,QAAQ,IAAI;AACxB,QAAM,eAA6B;AAAA,IACjC,UAAU,OAAO,IAAI;AAAA,IACrB,iBAAiB,mBAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,SAAS,CAAC,QAAQ,QAAQ,YAAY,kBAAkB;AAAA,IACxD,SAAS,CAAC,KAAK;AAAA,EACjB;AAEA,QAAM,SAAS,MAAM,WAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,YAAY;AAClB,QAAM,cAAc;AACpB,SAAO;AACT;","names":[]}
1
+ {"version":3,"sources":["../../../../src/actions/package/compile/tscTypes.ts"],"sourcesContent":["import { cwd } from 'process'\nimport { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'\nimport { DiagnosticCategory } from 'typescript'\n\nimport { loadConfig } from '../../../lib'\nimport { CompileParams } from './CompileParams'\nimport { copyTypeFiles } from './copyTypeFiles'\nimport { getCompilerOptions } from './getCompilerOptions'\n\nexport const packageCompileTscTypes = async (params?: CompileParams): Promise<number> => {\n const pkg = process.env.INIT_CWD\n\n const config = await loadConfig(params)\n if (config.verbose) {\n console.log(`Compiling types with TSC [${pkg}]`)\n }\n\n const result = createProgramFromConfig({\n basePath: pkg ?? cwd(),\n compilerOptions: getCompilerOptions({\n declaration: true,\n declarationMap: true,\n emitDeclarationOnly: true,\n esModuleInterop: true,\n outDir: 'dist',\n skipLibCheck: true,\n sourceMap: true,\n }) as TsConfigCompilerOptions,\n configFilePath: 'tsconfig.json',\n exclude: ['dist', 'docs', '**/*.spec.*', 'src/**/spec/**/*'],\n include: ['src'],\n }).emit()\n\n await copyTypeFiles()\n return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length\n}\n"],"mappings":"AAAA,SAAS,WAAW;AACpB,SAAS,+BAAwD;AACjE,SAAS,0BAA0B;AAEnC,SAAS,kBAAkB;AAE3B,SAAS,qBAAqB;AAC9B,SAAS,0BAA0B;AAE5B,MAAM,yBAAyB,OAAO,WAA4C;AACvF,QAAM,MAAM,QAAQ,IAAI;AAExB,QAAM,SAAS,MAAM,WAAW,MAAM;AACtC,MAAI,OAAO,SAAS;AAClB,YAAQ,IAAI,6BAA6B,GAAG,GAAG;AAAA,EACjD;AAEA,QAAM,SAAS,wBAAwB;AAAA,IACrC,UAAU,OAAO,IAAI;AAAA,IACrB,iBAAiB,mBAAmB;AAAA,MAClC,aAAa;AAAA,MACb,gBAAgB;AAAA,MAChB,qBAAqB;AAAA,MACrB,iBAAiB;AAAA,MACjB,QAAQ;AAAA,MACR,cAAc;AAAA,MACd,WAAW;AAAA,IACb,CAAC;AAAA,IACD,gBAAgB;AAAA,IAChB,SAAS,CAAC,QAAQ,QAAQ,eAAe,kBAAkB;AAAA,IAC3D,SAAS,CAAC,KAAK;AAAA,EACjB,CAAC,EAAE,KAAK;AAER,QAAM,cAAc;AACpB,SAAO,OAAO,YAAY,IAAI,CAAC,UAAU,MAAM,aAAa,mBAAmB,KAAK,EAAE;AACxF;","names":[]}
package/package.json CHANGED
@@ -66,7 +66,7 @@
66
66
  "@types/yargs": "^17.0.24",
67
67
  "@typescript-eslint/eslint-plugin": "^6.7.0",
68
68
  "@typescript-eslint/parser": "^6.7.0",
69
- "@xylabs/tsconfig": "~3.0.23",
69
+ "@xylabs/tsconfig": "~3.0.24",
70
70
  "chalk": "^4.1.2",
71
71
  "cosmiconfig": "^8.3.6",
72
72
  "cpy": "^8.1.2",
@@ -110,8 +110,8 @@
110
110
  "@types/license-checker": "^25.0.4",
111
111
  "@types/lodash": "^4.14.198",
112
112
  "@types/parse-git-config": "^3.0.1",
113
- "@xylabs/eslint-config": "^3.0.23",
114
- "@xylabs/tsconfig": "^3.0.23",
113
+ "@xylabs/eslint-config": "^3.0.24",
114
+ "@xylabs/tsconfig": "^3.0.24",
115
115
  "publint": "^0.2.2",
116
116
  "typescript": "^5.2.2"
117
117
  },
@@ -168,5 +168,5 @@
168
168
  "package-clean": "echo Not cleaning..."
169
169
  },
170
170
  "sideEffects": false,
171
- "version": "3.0.23"
171
+ "version": "3.0.24"
172
172
  }
@@ -1,5 +1,6 @@
1
1
  import { cwd } from 'process'
2
- import { build, BuildOptions, TsConfigCompilerOptions } from 'tsc-prog'
2
+ import { createProgramFromConfig, TsConfigCompilerOptions } from 'tsc-prog'
3
+ import { DiagnosticCategory } from 'typescript'
3
4
 
4
5
  import { loadConfig } from '../../../lib'
5
6
  import { CompileParams } from './CompileParams'
@@ -8,7 +9,13 @@ import { getCompilerOptions } from './getCompilerOptions'
8
9
 
9
10
  export const packageCompileTscTypes = async (params?: CompileParams): Promise<number> => {
10
11
  const pkg = process.env.INIT_CWD
11
- const buildOptions: BuildOptions = {
12
+
13
+ const config = await loadConfig(params)
14
+ if (config.verbose) {
15
+ console.log(`Compiling types with TSC [${pkg}]`)
16
+ }
17
+
18
+ const result = createProgramFromConfig({
12
19
  basePath: pkg ?? cwd(),
13
20
  compilerOptions: getCompilerOptions({
14
21
  declaration: true,
@@ -19,16 +26,11 @@ export const packageCompileTscTypes = async (params?: CompileParams): Promise<nu
19
26
  skipLibCheck: true,
20
27
  sourceMap: true,
21
28
  }) as TsConfigCompilerOptions,
22
- exclude: ['dist', 'docs', '*.spec.*', 'src/**/spec/**/*'],
29
+ configFilePath: 'tsconfig.json',
30
+ exclude: ['dist', 'docs', '**/*.spec.*', 'src/**/spec/**/*'],
23
31
  include: ['src'],
24
- }
25
-
26
- const config = await loadConfig(params)
27
- if (config.verbose) {
28
- console.log(`Compiling types with TSC [${pkg}]`)
29
- }
32
+ }).emit()
30
33
 
31
- build(buildOptions)
32
34
  await copyTypeFiles()
33
- return 0
35
+ return result.diagnostics.map((value) => value.category === DiagnosticCategory.Error).length
34
36
  }