powerlines 0.24.3 → 0.24.5

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.
Files changed (77) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.js +1 -1
  3. package/dist/astro.cjs +4 -4
  4. package/dist/astro.js +3 -3
  5. package/dist/{chunk-2DHR5VPL.js → chunk-4YOH66OR.js} +1 -1
  6. package/dist/{chunk-VO7UNY6U.js → chunk-5VVIGLK7.js} +36 -65
  7. package/dist/{chunk-AOAZS3KU.js → chunk-6F2RGMWO.js} +1 -1
  8. package/dist/{chunk-DMV2VN3N.cjs → chunk-D7IZZTKR.cjs} +2 -2
  9. package/dist/{chunk-WG76FEAR.js → chunk-E2CYWY4C.js} +1 -1
  10. package/dist/{chunk-37PJDPER.cjs → chunk-J42CWDHS.cjs} +3 -3
  11. package/dist/{chunk-YWDLT2K5.cjs → chunk-MBWFPGQL.cjs} +2 -2
  12. package/dist/{chunk-XFPLVPMF.cjs → chunk-MWURGZO3.cjs} +44 -73
  13. package/dist/{chunk-MR2ARFN4.js → chunk-RUNRTWUD.js} +1 -1
  14. package/dist/{chunk-WJQX2T36.cjs → chunk-TSGTSGEL.cjs} +2 -2
  15. package/dist/esbuild.cjs +6 -6
  16. package/dist/esbuild.js +3 -3
  17. package/dist/farm.cjs +3 -3
  18. package/dist/farm.js +2 -2
  19. package/dist/index.cjs +11 -11
  20. package/dist/index.js +2 -2
  21. package/dist/lib/{chunk-LDMWUKGL.js → chunk-B6MVU5AR.js} +1 -1
  22. package/dist/lib/{chunk-VSN5AZP5.cjs → chunk-FSV2WXHS.cjs} +4 -4
  23. package/dist/lib/{chunk-BQU53ZNB.cjs → chunk-GA3RXX4R.cjs} +24 -7
  24. package/dist/lib/{chunk-3HVJF7CD.js → chunk-HQ7626MD.js} +2 -2
  25. package/dist/lib/{chunk-NKV4KVFI.js → chunk-IRIEW3X6.js} +15 -59
  26. package/dist/lib/{chunk-RJLPU6PQ.js → chunk-JFHYBGFE.js} +2 -1
  27. package/dist/lib/{chunk-PPUZYUCI.cjs → chunk-QOS4T645.cjs} +2 -1
  28. package/dist/lib/{chunk-4YERLWXX.cjs → chunk-SJCNXDNU.cjs} +38 -82
  29. package/dist/lib/{chunk-YOENMDZY.js → chunk-ZGMEHSNN.js} +24 -8
  30. package/dist/lib/{chunk-INSBEK3W.cjs → chunk-ZTI2BIQ4.cjs} +10 -10
  31. package/dist/lib/contexts/api-context.cjs +5 -4
  32. package/dist/lib/contexts/api-context.js +4 -3
  33. package/dist/lib/contexts/context.cjs +3 -2
  34. package/dist/lib/contexts/context.js +2 -1
  35. package/dist/lib/contexts/environment-context.cjs +4 -3
  36. package/dist/lib/contexts/environment-context.js +3 -2
  37. package/dist/lib/contexts/index.cjs +7 -6
  38. package/dist/lib/contexts/index.js +4 -3
  39. package/dist/lib/index.cjs +38 -34
  40. package/dist/lib/index.d.cts +1 -1
  41. package/dist/lib/index.d.ts +1 -1
  42. package/dist/lib/index.js +5 -5
  43. package/dist/lib/typescript/compiler-host.cjs +2 -2
  44. package/dist/lib/typescript/compiler-host.js +1 -1
  45. package/dist/lib/typescript/index.cjs +29 -25
  46. package/dist/lib/typescript/index.d.cts +1 -1
  47. package/dist/lib/typescript/index.d.ts +1 -1
  48. package/dist/lib/typescript/index.js +1 -1
  49. package/dist/lib/typescript/tsconfig.cjs +11 -7
  50. package/dist/lib/typescript/tsconfig.d.cts +11 -1
  51. package/dist/lib/typescript/tsconfig.d.ts +11 -1
  52. package/dist/lib/typescript/tsconfig.js +1 -1
  53. package/dist/lib/unplugin/factory.cjs +6 -6
  54. package/dist/lib/unplugin/factory.js +5 -5
  55. package/dist/lib/unplugin/index.cjs +6 -6
  56. package/dist/lib/unplugin/index.js +5 -5
  57. package/dist/next.cjs +4 -4
  58. package/dist/next.js +3 -3
  59. package/dist/nuxt.cjs +6 -6
  60. package/dist/nuxt.js +4 -4
  61. package/dist/rolldown.cjs +3 -3
  62. package/dist/rolldown.js +2 -2
  63. package/dist/rollup.cjs +3 -3
  64. package/dist/rollup.js +2 -2
  65. package/dist/rspack.cjs +3 -3
  66. package/dist/rspack.js +2 -2
  67. package/dist/tsup.cjs +4 -4
  68. package/dist/tsup.js +3 -3
  69. package/dist/unloader.cjs +3 -3
  70. package/dist/unloader.js +2 -2
  71. package/dist/unplugin.cjs +5 -5
  72. package/dist/unplugin.js +3 -3
  73. package/dist/vite.cjs +6 -6
  74. package/dist/vite.js +3 -3
  75. package/dist/webpack.cjs +6 -6
  76. package/dist/webpack.js +3 -3
  77. package/package.json +14 -14
package/dist/index.cjs CHANGED
@@ -14,14 +14,14 @@ require('./chunk-7GYTTM4M.cjs');
14
14
  var chunkXP7OML7S_cjs = require('./chunk-XP7OML7S.cjs');
15
15
  require('./chunk-HQFZ64VC.cjs');
16
16
  var chunkBUR2JQ6G_cjs = require('./chunk-BUR2JQ6G.cjs');
17
- var chunkXFPLVPMF_cjs = require('./chunk-XFPLVPMF.cjs');
17
+ var chunkMWURGZO3_cjs = require('./chunk-MWURGZO3.cjs');
18
18
  var chunkETKZMGLN_cjs = require('./chunk-ETKZMGLN.cjs');
19
19
  var chunkPAMSESZV_cjs = require('./chunk-PAMSESZV.cjs');
20
20
  var chunkAYKZK666_cjs = require('./chunk-AYKZK666.cjs');
21
21
  require('./chunk-USNT2KNT.cjs');
22
22
 
23
23
  // src/index.ts
24
- var index_default = chunkXFPLVPMF_cjs.PowerlinesAPI;
24
+ var index_default = chunkMWURGZO3_cjs.PowerlinesAPI;
25
25
 
26
26
  Object.defineProperty(exports, "LogLevel", {
27
27
  enumerable: true,
@@ -33,39 +33,39 @@ Object.defineProperty(exports, "defineConfig", {
33
33
  });
34
34
  Object.defineProperty(exports, "FileData", {
35
35
  enumerable: true,
36
- get: function () { return chunkXFPLVPMF_cjs.FileData; }
36
+ get: function () { return chunkMWURGZO3_cjs.FileData; }
37
37
  });
38
38
  Object.defineProperty(exports, "FileId", {
39
39
  enumerable: true,
40
- get: function () { return chunkXFPLVPMF_cjs.FileId; }
40
+ get: function () { return chunkMWURGZO3_cjs.FileId; }
41
41
  });
42
42
  Object.defineProperty(exports, "FileMetadata", {
43
43
  enumerable: true,
44
- get: function () { return chunkXFPLVPMF_cjs.FileMetadata; }
44
+ get: function () { return chunkMWURGZO3_cjs.FileMetadata; }
45
45
  });
46
46
  Object.defineProperty(exports, "FileMetadata_KeyValuePair", {
47
47
  enumerable: true,
48
- get: function () { return chunkXFPLVPMF_cjs.FileMetadata_KeyValuePair; }
48
+ get: function () { return chunkMWURGZO3_cjs.FileMetadata_KeyValuePair; }
49
49
  });
50
50
  Object.defineProperty(exports, "FileSystem", {
51
51
  enumerable: true,
52
- get: function () { return chunkXFPLVPMF_cjs.FileSystem; }
52
+ get: function () { return chunkMWURGZO3_cjs.FileSystem; }
53
53
  });
54
54
  Object.defineProperty(exports, "FileType", {
55
55
  enumerable: true,
56
- get: function () { return chunkXFPLVPMF_cjs.FileType; }
56
+ get: function () { return chunkMWURGZO3_cjs.FileType; }
57
57
  });
58
58
  Object.defineProperty(exports, "PowerlinesAPI", {
59
59
  enumerable: true,
60
- get: function () { return chunkXFPLVPMF_cjs.PowerlinesAPI; }
60
+ get: function () { return chunkMWURGZO3_cjs.PowerlinesAPI; }
61
61
  });
62
62
  Object.defineProperty(exports, "PreserveSignatureType", {
63
63
  enumerable: true,
64
- get: function () { return chunkXFPLVPMF_cjs.PreserveSignatureType; }
64
+ get: function () { return chunkMWURGZO3_cjs.PreserveSignatureType; }
65
65
  });
66
66
  Object.defineProperty(exports, "_capnpFileId", {
67
67
  enumerable: true,
68
- get: function () { return chunkXFPLVPMF_cjs._capnpFileId; }
68
+ get: function () { return chunkMWURGZO3_cjs._capnpFileId; }
69
69
  });
70
70
  Object.defineProperty(exports, "PLUGIN_NON_HOOK_FIELDS", {
71
71
  enumerable: true,
package/dist/index.js CHANGED
@@ -10,8 +10,8 @@ import './chunk-DRXFQCNC.js';
10
10
  export { LogLevel } from './chunk-W5X3ZEZ5.js';
11
11
  import './chunk-JGB5YQ2U.js';
12
12
  export { defineConfig } from './chunk-CJSGAITR.js';
13
- import { PowerlinesAPI } from './chunk-VO7UNY6U.js';
14
- export { FileData, FileId, FileMetadata, FileMetadata_KeyValuePair, FileSystem, FileType, PowerlinesAPI, PreserveSignatureType, _capnpFileId } from './chunk-VO7UNY6U.js';
13
+ import { PowerlinesAPI } from './chunk-5VVIGLK7.js';
14
+ export { FileData, FileId, FileMetadata, FileMetadata_KeyValuePair, FileSystem, FileType, PowerlinesAPI, PreserveSignatureType, _capnpFileId } from './chunk-5VVIGLK7.js';
15
15
  export { PLUGIN_NON_HOOK_FIELDS } from './chunk-JQCWV4DT.js';
16
16
  export { SUPPORTED_COMMANDS } from './chunk-JKBJF3UI.js';
17
17
  export { __VFS_PATCH__, __VFS_REVERT__ } from './chunk-VT7NVLLU.js';
@@ -1,5 +1,5 @@
1
1
  import { createPluginContext } from './chunk-KFJCWNVG.js';
2
- import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-RJLPU6PQ.js';
2
+ import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-JFHYBGFE.js';
3
3
  import { __name } from './chunk-SHUYVCID.js';
4
4
  import { resolvePackage } from '@stryke/fs/resolve';
5
5
  import { isFunction } from '@stryke/type-checks/is-function';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkINSBEK3W_cjs = require('./chunk-INSBEK3W.cjs');
4
- var chunkPPUZYUCI_cjs = require('./chunk-PPUZYUCI.cjs');
3
+ var chunkZTI2BIQ4_cjs = require('./chunk-ZTI2BIQ4.cjs');
4
+ var chunkQOS4T645_cjs = require('./chunk-QOS4T645.cjs');
5
5
  var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
6
6
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
7
7
  var types = require('@storm-software/config-tools/types');
@@ -64,7 +64,7 @@ function createDefaultEnvironment(userConfig) {
64
64
  chunkUSNT2KNT_cjs.__name(createDefaultEnvironment, "createDefaultEnvironment");
65
65
 
66
66
  // src/lib/contexts/api-context.ts
67
- var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkPPUZYUCI_cjs.PowerlinesContext {
67
+ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkQOS4T645_cjs.PowerlinesContext {
68
68
  static {
69
69
  chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
70
70
  }
@@ -127,7 +127,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkPPUZYUCI_cjs
127
127
  if (this.environments[environment.name]) {
128
128
  context = this.environments[environment.name];
129
129
  } else {
130
- context = await chunkINSBEK3W_cjs.PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
130
+ context = await chunkZTI2BIQ4_cjs.PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
131
131
  }
132
132
  if (isSetObject.isSetObject(this.config.inlineConfig)) {
133
133
  await context.withInlineConfig(this.config.inlineConfig);
@@ -13,23 +13,39 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
13
13
  var defu__default = /*#__PURE__*/_interopDefault(defu);
14
14
  var ts__default = /*#__PURE__*/_interopDefault(ts);
15
15
 
16
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
16
+ function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
17
+ let tsconfigFilePath;
18
+ if (tsconfig) {
19
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
20
+ } else {
21
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
22
+ if (!tsconfigFilePath) {
23
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
24
+ if (!tsconfigFilePath) {
25
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
26
+ }
27
+ }
28
+ }
29
+ if (!tsconfigFilePath) {
30
+ throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
31
+ }
32
+ return tsconfigFilePath;
33
+ }
34
+ chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
35
+ function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
17
36
  let tsconfigFilePath = tsconfig;
18
37
  if (!exists.existsSync(tsconfigFilePath)) {
19
38
  tsconfigFilePath = append.appendPath(tsconfig, projectRoot);
20
39
  if (!exists.existsSync(tsconfigFilePath)) {
21
- tsconfigFilePath = append.appendPath(tsconfig, workspaceRoot);
40
+ tsconfigFilePath = append.appendPath(tsconfig, append.appendPath(projectRoot, workspaceRoot));
22
41
  if (!exists.existsSync(tsconfigFilePath)) {
23
- tsconfigFilePath = append.appendPath(tsconfig, joinPaths.joinPaths(workspaceRoot, projectRoot));
24
- if (!exists.existsSync(tsconfigFilePath)) {
25
- throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${append.appendPath(tsconfig, projectRoot)}, ${append.appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
26
- }
42
+ return void 0;
27
43
  }
28
44
  }
29
45
  }
30
46
  return tsconfigFilePath;
31
47
  }
32
- chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
48
+ chunkUSNT2KNT_cjs.__name(tryTsconfigFilePath, "tryTsconfigFilePath");
33
49
  function findMatch(tsconfigType, types, extensions = [
34
50
  ".ts",
35
51
  ".tsx",
@@ -106,3 +122,4 @@ exports.getParsedTypeScriptConfig = getParsedTypeScriptConfig;
106
122
  exports.getTsconfigFilePath = getTsconfigFilePath;
107
123
  exports.isIncludeMatchFound = isIncludeMatchFound;
108
124
  exports.isMatchFound = isMatchFound;
125
+ exports.tryTsconfigFilePath = tryTsconfigFilePath;
@@ -1,5 +1,5 @@
1
- import { PowerlinesEnvironmentContext } from './chunk-LDMWUKGL.js';
2
- import { PowerlinesContext } from './chunk-RJLPU6PQ.js';
1
+ import { PowerlinesEnvironmentContext } from './chunk-B6MVU5AR.js';
2
+ import { PowerlinesContext } from './chunk-JFHYBGFE.js';
3
3
  import { loadWorkspaceConfig } from './chunk-XBM7FHNK.js';
4
4
  import { __name } from './chunk-SHUYVCID.js';
5
5
  import { LogLevelLabel } from '@storm-software/config-tools/types';
@@ -1,10 +1,10 @@
1
1
  import { writeFile } from './chunk-TANQDHYY.js';
2
2
  import { getFileHeader } from './chunk-GANVMM73.js';
3
- import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-YOENMDZY.js';
4
- import { PowerlinesAPIContext } from './chunk-3HVJF7CD.js';
3
+ import { PowerlinesAPIContext } from './chunk-HQ7626MD.js';
5
4
  import { callHook } from './chunk-KFJCWNVG.js';
6
- import { __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-RJLPU6PQ.js';
5
+ import { __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-JFHYBGFE.js';
7
6
  import { writeMetaFile } from './chunk-FQLZZYYO.js';
7
+ import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-ZGMEHSNN.js';
8
8
  import { createLog } from './chunk-ENRLU4UR.js';
9
9
  import { getString } from './chunk-M263EZ4F.js';
10
10
  import { __name } from './chunk-SHUYVCID.js';
@@ -38,9 +38,9 @@ import ts, { flattenDiagnosticMessageText } from 'typescript';
38
38
  import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
39
39
  import { getObjectDiff } from '@donedeal0/superdiff';
40
40
  import { readJsonFile } from '@stryke/fs/json';
41
- import { loadTsConfig } from '@stryke/fs/tsconfig';
42
41
  import { StormJSON } from '@stryke/json/storm-json';
43
- import { relativePath, findFilePath, findFileName } from '@stryke/path/file-path-fns';
42
+ import { findFileExtension, relativePath, findFilePath, findFileName } from '@stryke/path/file-path-fns';
43
+ import { isParentPath } from '@stryke/path/is-parent-path';
44
44
  import { titleCase } from '@stryke/string-format/title-case';
45
45
 
46
46
  function resolveModulePath(nodePath, state) {
@@ -245,22 +245,14 @@ async function resolveTsconfigChanges(context) {
245
245
  const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
246
246
  const tsconfigJson = await readJsonFile(tsconfigFilePath);
247
247
  tsconfigJson.compilerOptions ??= {};
248
- const extendedTsconfig = await loadTsConfig(tsconfigFilePath);
249
- extendedTsconfig.compilerOptions ??= {};
250
- if (tsconfigJson.reflection !== true) {
251
- tsconfigJson.reflection = true;
252
- }
253
- if (tsconfig.options.experimentalDecorators !== true) {
254
- tsconfigJson.compilerOptions.experimentalDecorators = true;
255
- }
256
- if (tsconfig.options.emitDecoratorMetadata !== true) {
257
- tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
258
- }
259
- if (context.config.output.dts) {
260
- const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
261
- const dtsRelativePath = joinPaths(relativePath(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(dtsFilePath)), findFileName(dtsFilePath));
248
+ if (context.config.output.dts !== false) {
249
+ context.config.output.dts = context.config.output.dts ? isParentPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) ? context.config.output.dts : appendPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) : appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot);
250
+ if (findFileExtension(context.config.output.dts) !== "d.ts" && findFileExtension(context.config.output.dts) !== "d.cts" && findFileExtension(context.config.output.dts) !== "d.mts") {
251
+ context.config.output.dts = joinPaths(context.config.output.dts, "powerlines.d.ts");
252
+ }
253
+ const dtsRelativePath = joinPaths(relativePath(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(context.config.output.dts)), findFileName(context.config.output.dts));
262
254
  if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
263
- dtsFilePath,
255
+ String(context.config.output.dts),
264
256
  dtsRelativePath,
265
257
  "storm.d.ts"
266
258
  ]))) {
@@ -295,49 +287,13 @@ async function resolveTsconfigChanges(context) {
295
287
  if (tsconfig.options.moduleDetection !== ts.ModuleDetectionKind.Force) {
296
288
  tsconfigJson.compilerOptions.moduleDetection = "force";
297
289
  }
298
- if (tsconfig.options.allowSyntheticDefaultImports !== true) {
299
- tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
300
- }
301
- if (tsconfig.options.noImplicitOverride !== true) {
302
- tsconfigJson.compilerOptions.noImplicitOverride = true;
303
- }
304
- if (tsconfig.options.noUncheckedIndexedAccess !== true) {
305
- tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
306
- }
307
- if (tsconfig.options.skipLibCheck !== true) {
308
- tsconfigJson.compilerOptions.skipLibCheck = true;
309
- }
310
- if (tsconfig.options.resolveJsonModule !== true) {
311
- tsconfigJson.compilerOptions.resolveJsonModule = true;
312
- }
313
- if (tsconfig.options.isolatedModules !== true) {
314
- tsconfigJson.compilerOptions.isolatedModules = true;
315
- }
316
- if (tsconfig.options.verbatimModuleSyntax !== false) {
317
- tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
318
- }
319
- if (tsconfig.options.allowJs !== true) {
320
- tsconfigJson.compilerOptions.allowJs = true;
321
- }
322
290
  if (tsconfig.options.esModuleInterop !== true) {
323
291
  tsconfigJson.compilerOptions.esModuleInterop = true;
324
292
  }
325
- if (tsconfig.options.declaration !== true) {
326
- tsconfigJson.compilerOptions.declaration = true;
293
+ if (tsconfig.options.isolatedModules !== true) {
294
+ tsconfigJson.compilerOptions.isolatedModules = true;
327
295
  }
328
- if (context.environment.consumer === "client") {
329
- if (tsconfig.options.jsx !== ts.JsxEmit.ReactJSX) {
330
- tsconfigJson.compilerOptions.jsx = "react-jsx";
331
- }
332
- if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
333
- tsconfigJson.compilerOptions.lib ??= [];
334
- tsconfigJson.compilerOptions.lib.push("dom");
335
- }
336
- if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
337
- tsconfigJson.compilerOptions.lib ??= [];
338
- tsconfigJson.compilerOptions.lib.push("dom.iterable");
339
- }
340
- } else if (context.config.build.platform === "node") {
296
+ if (context.config.build.platform === "node") {
341
297
  if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
342
298
  tsconfigJson.compilerOptions.types ??= [];
343
299
  tsconfigJson.compilerOptions.types.push("node");
@@ -1,4 +1,5 @@
1
1
  import { CACHE_HASH_LENGTH, PROJECT_ROOT_HASH_LENGTH, getPrefixedProjectRootHash } from './chunk-FQLZZYYO.js';
2
+ import { getTsconfigFilePath } from './chunk-ZGMEHSNN.js';
2
3
  import { createProgram } from './chunk-YQ3ODCHV.js';
3
4
  import { loadWorkspaceConfig, loadUserConfigFile } from './chunk-XBM7FHNK.js';
4
5
  import { extendLog, createLog } from './chunk-ENRLU4UR.js';
@@ -2179,6 +2180,7 @@ var PowerlinesContext = class _PowerlinesContext {
2179
2180
  userConfig
2180
2181
  });
2181
2182
  }
2183
+ this.config.tsconfig ??= getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
2182
2184
  if (isSetObject(config)) {
2183
2185
  this.resolvedConfig = defu2({
2184
2186
  inlineConfig: this.config.inlineConfig,
@@ -2194,7 +2196,6 @@ var PowerlinesContext = class _PowerlinesContext {
2194
2196
  name: this.projectJson?.name || this.packageJson?.name,
2195
2197
  version: this.packageJson?.version,
2196
2198
  description: this.packageJson?.description,
2197
- tsconfig: appendPath("tsconfig.json", cacheKey.projectRoot),
2198
2199
  sourceRoot: this.projectJson?.sourceRoot || appendPath("src", cacheKey.projectRoot),
2199
2200
  output: {
2200
2201
  outputPath: cacheKey.projectRoot ? joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
@@ -1,6 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk7VJ42H2I_cjs = require('./chunk-7VJ42H2I.cjs');
4
+ var chunkGA3RXX4R_cjs = require('./chunk-GA3RXX4R.cjs');
4
5
  var chunkSAS5EPBD_cjs = require('./chunk-SAS5EPBD.cjs');
5
6
  var chunkK3NBD5LL_cjs = require('./chunk-K3NBD5LL.cjs');
6
7
  var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
@@ -2205,6 +2206,7 @@ var PowerlinesContext = class _PowerlinesContext {
2205
2206
  userConfig
2206
2207
  });
2207
2208
  }
2209
+ this.config.tsconfig ??= chunkGA3RXX4R_cjs.getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
2208
2210
  if (isSetObject.isSetObject(config)) {
2209
2211
  this.resolvedConfig = defu2__default.default({
2210
2212
  inlineConfig: this.config.inlineConfig,
@@ -2220,7 +2222,6 @@ var PowerlinesContext = class _PowerlinesContext {
2220
2222
  name: this.projectJson?.name || this.packageJson?.name,
2221
2223
  version: this.packageJson?.version,
2222
2224
  description: this.packageJson?.description,
2223
- tsconfig: append.appendPath("tsconfig.json", cacheKey.projectRoot),
2224
2225
  sourceRoot: this.projectJson?.sourceRoot || append.appendPath("src", cacheKey.projectRoot),
2225
2226
  output: {
2226
2227
  outputPath: cacheKey.projectRoot ? join.joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
@@ -2,11 +2,11 @@
2
2
 
3
3
  var chunk2NZADVP5_cjs = require('./chunk-2NZADVP5.cjs');
4
4
  var chunk4NHFXDTQ_cjs = require('./chunk-4NHFXDTQ.cjs');
5
- var chunkBQU53ZNB_cjs = require('./chunk-BQU53ZNB.cjs');
6
- var chunkVSN5AZP5_cjs = require('./chunk-VSN5AZP5.cjs');
5
+ var chunkFSV2WXHS_cjs = require('./chunk-FSV2WXHS.cjs');
7
6
  var chunkB3EE3VHZ_cjs = require('./chunk-B3EE3VHZ.cjs');
8
- var chunkPPUZYUCI_cjs = require('./chunk-PPUZYUCI.cjs');
7
+ var chunkQOS4T645_cjs = require('./chunk-QOS4T645.cjs');
9
8
  var chunk7VJ42H2I_cjs = require('./chunk-7VJ42H2I.cjs');
9
+ var chunkGA3RXX4R_cjs = require('./chunk-GA3RXX4R.cjs');
10
10
  var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
11
11
  var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.cjs');
12
12
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
@@ -40,9 +40,9 @@ var ts = require('typescript');
40
40
  var _package = require('@stryke/string-format/package');
41
41
  var superdiff = require('@donedeal0/superdiff');
42
42
  var json = require('@stryke/fs/json');
43
- var tsconfig = require('@stryke/fs/tsconfig');
44
43
  var stormJson = require('@stryke/json/storm-json');
45
44
  var filePathFns = require('@stryke/path/file-path-fns');
45
+ var isParentPath = require('@stryke/path/is-parent-path');
46
46
  var titleCase = require('@stryke/string-format/title-case');
47
47
 
48
48
  function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
@@ -268,26 +268,18 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
268
268
  }
269
269
  chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
270
270
  async function resolveTsconfigChanges(context) {
271
- const tsconfig$1 = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
272
- const tsconfigFilePath = chunkBQU53ZNB_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
271
+ const tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
272
+ const tsconfigFilePath = chunkGA3RXX4R_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
273
273
  const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
274
274
  tsconfigJson.compilerOptions ??= {};
275
- const extendedTsconfig = await tsconfig.loadTsConfig(tsconfigFilePath);
276
- extendedTsconfig.compilerOptions ??= {};
277
- if (tsconfigJson.reflection !== true) {
278
- tsconfigJson.reflection = true;
279
- }
280
- if (tsconfig$1.options.experimentalDecorators !== true) {
281
- tsconfigJson.compilerOptions.experimentalDecorators = true;
282
- }
283
- if (tsconfig$1.options.emitDecoratorMetadata !== true) {
284
- tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
285
- }
286
- if (context.config.output.dts) {
287
- const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
288
- const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(dtsFilePath)), filePathFns.findFileName(dtsFilePath));
289
- if (!tsconfigJson.include?.some((filePattern) => chunkBQU53ZNB_cjs.isIncludeMatchFound(filePattern, [
290
- dtsFilePath,
275
+ if (context.config.output.dts !== false) {
276
+ context.config.output.dts = context.config.output.dts ? isParentPath.isParentPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) ? context.config.output.dts : append.appendPath(context.config.output.dts, context.workspaceConfig.workspaceRoot) : append.appendPath(context.config.projectRoot, context.workspaceConfig.workspaceRoot);
277
+ if (filePathFns.findFileExtension(context.config.output.dts) !== "d.ts" && filePathFns.findFileExtension(context.config.output.dts) !== "d.cts" && filePathFns.findFileExtension(context.config.output.dts) !== "d.mts") {
278
+ context.config.output.dts = joinPaths.joinPaths(context.config.output.dts, "powerlines.d.ts");
279
+ }
280
+ const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(context.config.output.dts)), filePathFns.findFileName(context.config.output.dts));
281
+ if (!tsconfigJson.include?.some((filePattern) => chunkGA3RXX4R_cjs.isIncludeMatchFound(filePattern, [
282
+ String(context.config.output.dts),
291
283
  dtsRelativePath,
292
284
  "storm.d.ts"
293
285
  ]))) {
@@ -295,7 +287,7 @@ async function resolveTsconfigChanges(context) {
295
287
  tsconfigJson.include.push(dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath);
296
288
  }
297
289
  }
298
- if (!tsconfig$1.options.lib?.some((lib) => [
290
+ if (!tsconfig.options.lib?.some((lib) => [
299
291
  "lib.esnext.d.ts",
300
292
  "lib.es2021.d.ts",
301
293
  "lib.es2022.d.ts",
@@ -304,68 +296,32 @@ async function resolveTsconfigChanges(context) {
304
296
  tsconfigJson.compilerOptions.lib ??= [];
305
297
  tsconfigJson.compilerOptions.lib.push("esnext");
306
298
  }
307
- if (tsconfig$1.options.module !== ts__default.default.ModuleKind.ESNext) {
299
+ if (tsconfig.options.module !== ts__default.default.ModuleKind.ESNext) {
308
300
  tsconfigJson.compilerOptions.module = "ESNext";
309
301
  }
310
- if (!tsconfig$1.options.target || ![
302
+ if (!tsconfig.options.target || ![
311
303
  ts__default.default.ScriptTarget.ESNext,
312
304
  ts__default.default.ScriptTarget.ES2024,
313
305
  ts__default.default.ScriptTarget.ES2023,
314
306
  ts__default.default.ScriptTarget.ES2022,
315
307
  ts__default.default.ScriptTarget.ES2021
316
- ].includes(tsconfig$1.options.target)) {
308
+ ].includes(tsconfig.options.target)) {
317
309
  tsconfigJson.compilerOptions.target = "ESNext";
318
310
  }
319
- if (tsconfig$1.options.moduleResolution !== ts__default.default.ModuleResolutionKind.Bundler) {
311
+ if (tsconfig.options.moduleResolution !== ts__default.default.ModuleResolutionKind.Bundler) {
320
312
  tsconfigJson.compilerOptions.moduleResolution = "Bundler";
321
313
  }
322
- if (tsconfig$1.options.moduleDetection !== ts__default.default.ModuleDetectionKind.Force) {
314
+ if (tsconfig.options.moduleDetection !== ts__default.default.ModuleDetectionKind.Force) {
323
315
  tsconfigJson.compilerOptions.moduleDetection = "force";
324
316
  }
325
- if (tsconfig$1.options.allowSyntheticDefaultImports !== true) {
326
- tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
327
- }
328
- if (tsconfig$1.options.noImplicitOverride !== true) {
329
- tsconfigJson.compilerOptions.noImplicitOverride = true;
330
- }
331
- if (tsconfig$1.options.noUncheckedIndexedAccess !== true) {
332
- tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
333
- }
334
- if (tsconfig$1.options.skipLibCheck !== true) {
335
- tsconfigJson.compilerOptions.skipLibCheck = true;
336
- }
337
- if (tsconfig$1.options.resolveJsonModule !== true) {
338
- tsconfigJson.compilerOptions.resolveJsonModule = true;
339
- }
340
- if (tsconfig$1.options.isolatedModules !== true) {
341
- tsconfigJson.compilerOptions.isolatedModules = true;
342
- }
343
- if (tsconfig$1.options.verbatimModuleSyntax !== false) {
344
- tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
345
- }
346
- if (tsconfig$1.options.allowJs !== true) {
347
- tsconfigJson.compilerOptions.allowJs = true;
348
- }
349
- if (tsconfig$1.options.esModuleInterop !== true) {
317
+ if (tsconfig.options.esModuleInterop !== true) {
350
318
  tsconfigJson.compilerOptions.esModuleInterop = true;
351
319
  }
352
- if (tsconfig$1.options.declaration !== true) {
353
- tsconfigJson.compilerOptions.declaration = true;
320
+ if (tsconfig.options.isolatedModules !== true) {
321
+ tsconfigJson.compilerOptions.isolatedModules = true;
354
322
  }
355
- if (context.environment.consumer === "client") {
356
- if (tsconfig$1.options.jsx !== ts__default.default.JsxEmit.ReactJSX) {
357
- tsconfigJson.compilerOptions.jsx = "react-jsx";
358
- }
359
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
360
- tsconfigJson.compilerOptions.lib ??= [];
361
- tsconfigJson.compilerOptions.lib.push("dom");
362
- }
363
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
364
- tsconfigJson.compilerOptions.lib ??= [];
365
- tsconfigJson.compilerOptions.lib.push("dom.iterable");
366
- }
367
- } else if (context.config.build.platform === "node") {
368
- if (!tsconfig$1.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
323
+ if (context.config.build.platform === "node") {
324
+ if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
369
325
  tsconfigJson.compilerOptions.types ??= [];
370
326
  tsconfigJson.compilerOptions.types.push("node");
371
327
  }
@@ -378,14 +334,14 @@ async function initializeTsconfig(context) {
378
334
  if (!packageFns.isPackageExists("typescript")) {
379
335
  throw new Error('The TypeScript package is not installed. Please install the package using the command: "npm install typescript --save-dev"');
380
336
  }
381
- const tsconfigFilePath = chunkBQU53ZNB_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
337
+ const tsconfigFilePath = chunkGA3RXX4R_cjs.getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
382
338
  context.tsconfig.originalTsconfigJson = await json.readJsonFile(tsconfigFilePath);
383
339
  context.tsconfig.tsconfigJson = await resolveTsconfigChanges(context);
384
340
  context.log(types.LogLevelLabel.TRACE, "Writing updated TypeScript configuration (tsconfig.json) file to disk.");
385
341
  await context.fs.writeFile(tsconfigFilePath, stormJson.StormJSON.stringify(context.tsconfig.tsconfigJson), {
386
342
  mode: "fs"
387
343
  });
388
- context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
344
+ context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw, context.tsconfig.originalTsconfigJson);
389
345
  }
390
346
  chunkUSNT2KNT_cjs.__name(initializeTsconfig, "initializeTsconfig");
391
347
  async function resolveTsconfig(context) {
@@ -434,7 +390,7 @@ async function resolveTsconfig(context) {
434
390
  `);
435
391
  }
436
392
  await chunk2NZADVP5_cjs.writeFile(context.log, context.tsconfig.tsconfigFilePath, stormJson.StormJSON.stringify(updateTsconfigJson));
437
- context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
393
+ context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
438
394
  if (!context.tsconfig) {
439
395
  throw new Error("Failed to parse the TypeScript configuration file.");
440
396
  }
@@ -470,7 +426,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
470
426
  * Initialize the Powerlines API
471
427
  */
472
428
  static async from(workspaceRoot, config) {
473
- const api = new _PowerlinesAPI(await chunkVSN5AZP5_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
429
+ const api = new _PowerlinesAPI(await chunkFSV2WXHS_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
474
430
  api.#context.$$internal.api = api;
475
431
  for (const plugin of api.context.config.plugins ?? []) {
476
432
  await api.#addPlugin(plugin);
@@ -623,7 +579,7 @@ ${formatTypes(generatedTypes)}
623
579
  mode: "fs"
624
580
  });
625
581
  }
626
- context.tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
582
+ context.tsconfig = chunkGA3RXX4R_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
627
583
  if (!context.tsconfig) {
628
584
  throw new Error("Failed to parse the TypeScript configuration file.");
629
585
  }
@@ -801,7 +757,7 @@ ${formatTypes(generatedTypes)}
801
757
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
802
758
  await this.#executeEnvironments(async (context) => {
803
759
  await this.callHook(context, "finalize");
804
- context.fs[chunkPPUZYUCI_cjs.__VFS_REVERT__]();
760
+ context.fs[chunkQOS4T645_cjs.__VFS_REVERT__]();
805
761
  await context.fs.dispose();
806
762
  });
807
763
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
@@ -966,11 +922,11 @@ ${formatTypes(generatedTypes)}
966
922
  if (isPromise.isPromiseLike(config)) {
967
923
  awaited = await Promise.resolve(config);
968
924
  }
969
- if (!chunkPPUZYUCI_cjs.isPluginConfig(awaited)) {
925
+ if (!chunkQOS4T645_cjs.isPluginConfig(awaited)) {
970
926
  throw new Error(`Invalid plugin specified in the configuration - ${JSON.stringify(awaited)}. Please ensure the value is a plugin name, an object with the \`plugin\` and \`props\` properties, or an instance of \`Plugin\`.`);
971
927
  }
972
928
  let plugin;
973
- if (chunkPPUZYUCI_cjs.isPlugin(awaited)) {
929
+ if (chunkQOS4T645_cjs.isPlugin(awaited)) {
974
930
  plugin = awaited;
975
931
  } else if (isFunction.isFunction(awaited)) {
976
932
  plugin = await Promise.resolve(awaited());
@@ -981,10 +937,10 @@ ${formatTypes(generatedTypes)}
981
937
  } else {
982
938
  plugin = resolved;
983
939
  }
984
- } else if (chunkPPUZYUCI_cjs.isPluginConfigTuple(awaited) || chunkPPUZYUCI_cjs.isPluginConfigObject(awaited)) {
940
+ } else if (chunkQOS4T645_cjs.isPluginConfigTuple(awaited) || chunkQOS4T645_cjs.isPluginConfigObject(awaited)) {
985
941
  let pluginConfig;
986
942
  let pluginOptions;
987
- if (chunkPPUZYUCI_cjs.isPluginConfigTuple(awaited)) {
943
+ if (chunkQOS4T645_cjs.isPluginConfigTuple(awaited)) {
988
944
  pluginConfig = awaited[0];
989
945
  pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
990
946
  } else {
@@ -1000,17 +956,17 @@ ${formatTypes(generatedTypes)}
1000
956
  }
1001
957
  } else if (isFunction.isFunction(pluginConfig)) {
1002
958
  plugin = await Promise.resolve(pluginConfig(pluginOptions));
1003
- } else if (chunkPPUZYUCI_cjs.isPlugin(pluginConfig)) {
959
+ } else if (chunkQOS4T645_cjs.isPlugin(pluginConfig)) {
1004
960
  plugin = pluginConfig;
1005
961
  }
1006
962
  }
1007
963
  if (!plugin) {
1008
964
  throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
1009
965
  }
1010
- if (!chunkPPUZYUCI_cjs.isPlugin(plugin)) {
966
+ if (!chunkQOS4T645_cjs.isPlugin(plugin)) {
1011
967
  throw new Error(`The plugin option ${JSON.stringify(plugin)} does not export a valid module. This configuration must point to a valid Powerlines plugin module.`);
1012
968
  }
1013
- if (chunkPPUZYUCI_cjs.checkDedupe(plugin, this.context.plugins)) {
969
+ if (chunkQOS4T645_cjs.checkDedupe(plugin, this.context.plugins)) {
1014
970
  this.context.log(types.LogLevelLabel.TRACE, `Duplicate ${chalk2__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
1015
971
  return null;
1016
972
  }
@@ -6,23 +6,39 @@ import { joinPaths } from '@stryke/path/join-paths';
6
6
  import defu from 'defu';
7
7
  import ts from 'typescript';
8
8
 
9
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
9
+ function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
10
+ let tsconfigFilePath;
11
+ if (tsconfig) {
12
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
13
+ } else {
14
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
15
+ if (!tsconfigFilePath) {
16
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
17
+ if (!tsconfigFilePath) {
18
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
19
+ }
20
+ }
21
+ }
22
+ if (!tsconfigFilePath) {
23
+ throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
24
+ }
25
+ return tsconfigFilePath;
26
+ }
27
+ __name(getTsconfigFilePath, "getTsconfigFilePath");
28
+ function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
10
29
  let tsconfigFilePath = tsconfig;
11
30
  if (!existsSync(tsconfigFilePath)) {
12
31
  tsconfigFilePath = appendPath(tsconfig, projectRoot);
13
32
  if (!existsSync(tsconfigFilePath)) {
14
- tsconfigFilePath = appendPath(tsconfig, workspaceRoot);
33
+ tsconfigFilePath = appendPath(tsconfig, appendPath(projectRoot, workspaceRoot));
15
34
  if (!existsSync(tsconfigFilePath)) {
16
- tsconfigFilePath = appendPath(tsconfig, joinPaths(workspaceRoot, projectRoot));
17
- if (!existsSync(tsconfigFilePath)) {
18
- throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${appendPath(tsconfig, projectRoot)}, ${appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
19
- }
35
+ return void 0;
20
36
  }
21
37
  }
22
38
  }
23
39
  return tsconfigFilePath;
24
40
  }
25
- __name(getTsconfigFilePath, "getTsconfigFilePath");
41
+ __name(tryTsconfigFilePath, "tryTsconfigFilePath");
26
42
  function findMatch(tsconfigType, types, extensions = [
27
43
  ".ts",
28
44
  ".tsx",
@@ -93,4 +109,4 @@ ${parsedCommandLine.errors.map((error) => `- ${(error.category !== void 0 && err
93
109
  }
94
110
  __name(getParsedTypeScriptConfig, "getParsedTypeScriptConfig");
95
111
 
96
- export { findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound };
112
+ export { findIncludeMatch, findMatch, getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound, isMatchFound, tryTsconfigFilePath };