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/api.cjs CHANGED
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXFPLVPMF_cjs = require('./chunk-XFPLVPMF.cjs');
3
+ var chunkMWURGZO3_cjs = require('./chunk-MWURGZO3.cjs');
4
4
  require('./chunk-ETKZMGLN.cjs');
5
5
  require('./chunk-PAMSESZV.cjs');
6
6
  require('./chunk-AYKZK666.cjs');
@@ -10,5 +10,5 @@ require('./chunk-USNT2KNT.cjs');
10
10
 
11
11
  Object.defineProperty(exports, "PowerlinesAPI", {
12
12
  enumerable: true,
13
- get: function () { return chunkXFPLVPMF_cjs.PowerlinesAPI; }
13
+ get: function () { return chunkMWURGZO3_cjs.PowerlinesAPI; }
14
14
  });
package/dist/api.js CHANGED
@@ -1,4 +1,4 @@
1
- export { PowerlinesAPI } from './chunk-VO7UNY6U.js';
1
+ export { PowerlinesAPI } from './chunk-5VVIGLK7.js';
2
2
  import './chunk-JQCWV4DT.js';
3
3
  import './chunk-JKBJF3UI.js';
4
4
  import './chunk-VT7NVLLU.js';
package/dist/astro.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkWJQX2T36_cjs = require('./chunk-WJQX2T36.cjs');
5
+ var chunkTSGTSGEL_cjs = require('./chunk-TSGTSGEL.cjs');
6
6
  require('./chunk-5IBA5HC2.cjs');
7
- require('./chunk-37PJDPER.cjs');
8
- require('./chunk-XFPLVPMF.cjs');
7
+ require('./chunk-J42CWDHS.cjs');
8
+ require('./chunk-MWURGZO3.cjs');
9
9
  require('./chunk-ETKZMGLN.cjs');
10
10
  require('./chunk-PAMSESZV.cjs');
11
11
  require('./chunk-AYKZK666.cjs');
@@ -15,7 +15,7 @@ var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
15
15
  var astro = /* @__PURE__ */ chunkUSNT2KNT_cjs.__name((config) => ({
16
16
  vite: {
17
17
  plugins: [
18
- chunkWJQX2T36_cjs.vite_default(config)
18
+ chunkTSGTSGEL_cjs.vite_default(config)
19
19
  ]
20
20
  }
21
21
  }), "astro");
package/dist/astro.js CHANGED
@@ -1,7 +1,7 @@
1
- import { vite_default } from './chunk-MR2ARFN4.js';
1
+ import { vite_default } from './chunk-RUNRTWUD.js';
2
2
  import './chunk-VBR53KGY.js';
3
- import './chunk-AOAZS3KU.js';
4
- import './chunk-VO7UNY6U.js';
3
+ import './chunk-6F2RGMWO.js';
4
+ import './chunk-5VVIGLK7.js';
5
5
  import './chunk-JQCWV4DT.js';
6
6
  import './chunk-JKBJF3UI.js';
7
7
  import './chunk-VT7NVLLU.js';
@@ -1,5 +1,5 @@
1
1
  import { extractESBuildConfig } from './chunk-VBR53KGY.js';
2
- import { createUnpluginFactory } from './chunk-AOAZS3KU.js';
2
+ import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
3
3
  import { __name } from './chunk-SHUYVCID.js';
4
4
  import { isUndefined } from '@stryke/type-checks/is-undefined';
5
5
  import { createEsbuildPlugin } from 'unplugin';
@@ -32,9 +32,9 @@ import defu6, { defu } from 'defu';
32
32
  import { getPackageName, hasPackageVersion, getPackageVersion } from '@stryke/string-format/package';
33
33
  import { getObjectDiff } from '@donedeal0/superdiff';
34
34
  import { readJsonFile, readJsonFileSync } from '@stryke/fs/json';
35
- import { loadTsConfig } from '@stryke/fs/tsconfig';
36
35
  import { StormJSON } from '@stryke/json/storm-json';
37
- import { findFilePath, relativePath, findFileName, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
36
+ import { findFilePath, findFileExtension, relativePath, findFileName, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
37
+ import { isParentPath } from '@stryke/path/is-parent-path';
38
38
  import { titleCase } from '@stryke/string-format/title-case';
39
39
  import { writeFile as writeFile$1 } from '@stryke/fs/write-file';
40
40
  import { resolveConfig, format } from 'prettier';
@@ -69,7 +69,6 @@ import { getLogFn, getLogLevel } from '@storm-software/config-tools/logger';
69
69
  import { getColor } from '@storm-software/config-tools/utilities/colors';
70
70
  import { noop } from '@stryke/helpers/noop';
71
71
  import { slash } from '@stryke/path/slash';
72
- import { isParentPath } from '@stryke/path/is-parent-path';
73
72
  import { Volume } from 'memfs';
74
73
  import { Union } from 'unionfs';
75
74
  import { InMemoryFileSystemHost, Project } from 'ts-morph';
@@ -309,23 +308,39 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
309
308
  ]);
310
309
  }
311
310
  __name(installDependencies, "installDependencies");
312
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
311
+ function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
312
+ let tsconfigFilePath;
313
+ if (tsconfig) {
314
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
315
+ } else {
316
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
317
+ if (!tsconfigFilePath) {
318
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
319
+ if (!tsconfigFilePath) {
320
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
321
+ }
322
+ }
323
+ }
324
+ if (!tsconfigFilePath) {
325
+ throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
326
+ }
327
+ return tsconfigFilePath;
328
+ }
329
+ __name(getTsconfigFilePath, "getTsconfigFilePath");
330
+ function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
313
331
  let tsconfigFilePath = tsconfig;
314
332
  if (!existsSync(tsconfigFilePath)) {
315
333
  tsconfigFilePath = appendPath(tsconfig, projectRoot);
316
334
  if (!existsSync(tsconfigFilePath)) {
317
- tsconfigFilePath = appendPath(tsconfig, workspaceRoot);
335
+ tsconfigFilePath = appendPath(tsconfig, appendPath(projectRoot, workspaceRoot));
318
336
  if (!existsSync(tsconfigFilePath)) {
319
- tsconfigFilePath = appendPath(tsconfig, joinPaths$1(workspaceRoot, projectRoot));
320
- if (!existsSync(tsconfigFilePath)) {
321
- throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${appendPath(tsconfig, projectRoot)}, ${appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
322
- }
337
+ return void 0;
323
338
  }
324
339
  }
325
340
  }
326
341
  return tsconfigFilePath;
327
342
  }
328
- __name(getTsconfigFilePath, "getTsconfigFilePath");
343
+ __name(tryTsconfigFilePath, "tryTsconfigFilePath");
329
344
  function findMatch(tsconfigType, types, extensions = [
330
345
  ".ts",
331
346
  ".tsx",
@@ -416,22 +431,14 @@ async function resolveTsconfigChanges(context) {
416
431
  const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
417
432
  const tsconfigJson = await readJsonFile(tsconfigFilePath);
418
433
  tsconfigJson.compilerOptions ??= {};
419
- const extendedTsconfig = await loadTsConfig(tsconfigFilePath);
420
- extendedTsconfig.compilerOptions ??= {};
421
- if (tsconfigJson.reflection !== true) {
422
- tsconfigJson.reflection = true;
423
- }
424
- if (tsconfig.options.experimentalDecorators !== true) {
425
- tsconfigJson.compilerOptions.experimentalDecorators = true;
426
- }
427
- if (tsconfig.options.emitDecoratorMetadata !== true) {
428
- tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
429
- }
430
- if (context.config.output.dts) {
431
- const dtsFilePath = context.config.output.dts ? context.config.output.dts.startsWith(context.workspaceConfig.workspaceRoot) ? context.config.output.dts : joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.output.dts) : joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot, "storm.d.ts");
432
- const dtsRelativePath = joinPaths$1(relativePath(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(dtsFilePath)), findFileName(dtsFilePath));
434
+ if (context.config.output.dts !== false) {
435
+ 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);
436
+ if (findFileExtension(context.config.output.dts) !== "d.ts" && findFileExtension(context.config.output.dts) !== "d.cts" && findFileExtension(context.config.output.dts) !== "d.mts") {
437
+ context.config.output.dts = joinPaths$1(context.config.output.dts, "powerlines.d.ts");
438
+ }
439
+ const dtsRelativePath = joinPaths$1(relativePath(joinPaths$1(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(context.config.output.dts)), findFileName(context.config.output.dts));
433
440
  if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
434
- dtsFilePath,
441
+ String(context.config.output.dts),
435
442
  dtsRelativePath,
436
443
  "storm.d.ts"
437
444
  ]))) {
@@ -466,49 +473,13 @@ async function resolveTsconfigChanges(context) {
466
473
  if (tsconfig.options.moduleDetection !== ts2.ModuleDetectionKind.Force) {
467
474
  tsconfigJson.compilerOptions.moduleDetection = "force";
468
475
  }
469
- if (tsconfig.options.allowSyntheticDefaultImports !== true) {
470
- tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
471
- }
472
- if (tsconfig.options.noImplicitOverride !== true) {
473
- tsconfigJson.compilerOptions.noImplicitOverride = true;
474
- }
475
- if (tsconfig.options.noUncheckedIndexedAccess !== true) {
476
- tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
477
- }
478
- if (tsconfig.options.skipLibCheck !== true) {
479
- tsconfigJson.compilerOptions.skipLibCheck = true;
480
- }
481
- if (tsconfig.options.resolveJsonModule !== true) {
482
- tsconfigJson.compilerOptions.resolveJsonModule = true;
483
- }
484
- if (tsconfig.options.isolatedModules !== true) {
485
- tsconfigJson.compilerOptions.isolatedModules = true;
486
- }
487
- if (tsconfig.options.verbatimModuleSyntax !== false) {
488
- tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
489
- }
490
- if (tsconfig.options.allowJs !== true) {
491
- tsconfigJson.compilerOptions.allowJs = true;
492
- }
493
476
  if (tsconfig.options.esModuleInterop !== true) {
494
477
  tsconfigJson.compilerOptions.esModuleInterop = true;
495
478
  }
496
- if (tsconfig.options.declaration !== true) {
497
- tsconfigJson.compilerOptions.declaration = true;
479
+ if (tsconfig.options.isolatedModules !== true) {
480
+ tsconfigJson.compilerOptions.isolatedModules = true;
498
481
  }
499
- if (context.environment.consumer === "client") {
500
- if (tsconfig.options.jsx !== ts2.JsxEmit.ReactJSX) {
501
- tsconfigJson.compilerOptions.jsx = "react-jsx";
502
- }
503
- if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
504
- tsconfigJson.compilerOptions.lib ??= [];
505
- tsconfigJson.compilerOptions.lib.push("dom");
506
- }
507
- if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
508
- tsconfigJson.compilerOptions.lib ??= [];
509
- tsconfigJson.compilerOptions.lib.push("dom.iterable");
510
- }
511
- } else if (context.config.build.platform === "node") {
482
+ if (context.config.build.platform === "node") {
512
483
  if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
513
484
  tsconfigJson.compilerOptions.types ??= [];
514
485
  tsconfigJson.compilerOptions.types.push("node");
@@ -3017,6 +2988,7 @@ var PowerlinesContext = class _PowerlinesContext {
3017
2988
  userConfig
3018
2989
  });
3019
2990
  }
2991
+ this.config.tsconfig ??= getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
3020
2992
  if (isSetObject(config)) {
3021
2993
  this.resolvedConfig = defu6({
3022
2994
  inlineConfig: this.config.inlineConfig,
@@ -3032,7 +3004,6 @@ var PowerlinesContext = class _PowerlinesContext {
3032
3004
  name: this.projectJson?.name || this.packageJson?.name,
3033
3005
  version: this.packageJson?.version,
3034
3006
  description: this.packageJson?.description,
3035
- tsconfig: appendPath("tsconfig.json", cacheKey.projectRoot),
3036
3007
  sourceRoot: this.projectJson?.sourceRoot || appendPath("src", cacheKey.projectRoot),
3037
3008
  output: {
3038
3009
  outputPath: cacheKey.projectRoot ? joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
@@ -1,4 +1,4 @@
1
- import { createLog, PowerlinesAPI } from './chunk-VO7UNY6U.js';
1
+ import { createLog, PowerlinesAPI } from './chunk-5VVIGLK7.js';
2
2
  import { __name } from './chunk-SHUYVCID.js';
3
3
  import { LogLevelLabel } from '@storm-software/config-tools/types';
4
4
  import { getWorkspaceRoot } from '@stryke/fs/get-workspace-root';
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunk37PJDPER_cjs = require('./chunk-37PJDPER.cjs');
3
+ var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
4
4
  var unplugin = require('unplugin');
5
5
 
6
- var webpack = unplugin.createWebpackPlugin(chunk37PJDPER_cjs.createUnpluginFactory("webpack"));
6
+ var webpack = unplugin.createWebpackPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("webpack"));
7
7
  var webpack_default = webpack;
8
8
 
9
9
  exports.webpack = webpack;
@@ -1,4 +1,4 @@
1
- import { createUnpluginFactory } from './chunk-AOAZS3KU.js';
1
+ import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
2
2
  import { createWebpackPlugin } from 'unplugin';
3
3
 
4
4
  var webpack = createWebpackPlugin(createUnpluginFactory("webpack"));
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkXFPLVPMF_cjs = require('./chunk-XFPLVPMF.cjs');
3
+ var chunkMWURGZO3_cjs = require('./chunk-MWURGZO3.cjs');
4
4
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
5
5
  var types = require('@storm-software/config-tools/types');
6
6
  var getWorkspaceRoot = require('@stryke/fs/get-workspace-root');
@@ -26,7 +26,7 @@ chunkUSNT2KNT_cjs.__name(getString, "getString");
26
26
  // src/lib/unplugin/factory.ts
27
27
  function createUnpluginFactory(variant, decorate) {
28
28
  return (config, meta) => {
29
- const log = chunkXFPLVPMF_cjs.createLog("unplugin", config);
29
+ const log = chunkMWURGZO3_cjs.createLog("unplugin", config);
30
30
  log(types.LogLevelLabel.DEBUG, "Initializing Unplugin");
31
31
  try {
32
32
  const userConfig = {
@@ -38,7 +38,7 @@ function createUnpluginFactory(variant, decorate) {
38
38
  async function buildStart() {
39
39
  log(types.LogLevelLabel.DEBUG, "Powerlines build plugin starting...");
40
40
  const workspaceRoot = getWorkspaceRoot.getWorkspaceRoot(process.cwd());
41
- api = await chunkXFPLVPMF_cjs.PowerlinesAPI.from(workspaceRoot, userConfig);
41
+ api = await chunkMWURGZO3_cjs.PowerlinesAPI.from(workspaceRoot, userConfig);
42
42
  log(types.LogLevelLabel.DEBUG, "Preparing build artifacts for the Powerlines project...");
43
43
  await api.prepare({
44
44
  command: "build"
@@ -1,12 +1,12 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk5IBA5HC2_cjs = require('./chunk-5IBA5HC2.cjs');
4
- var chunk37PJDPER_cjs = require('./chunk-37PJDPER.cjs');
4
+ var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
5
5
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
6
6
  var isUndefined = require('@stryke/type-checks/is-undefined');
7
7
  var unplugin = require('unplugin');
8
8
 
9
- var esbuild = unplugin.createEsbuildPlugin(chunk37PJDPER_cjs.createUnpluginFactory("esbuild", (api, plugin) => {
9
+ var esbuild = unplugin.createEsbuildPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("esbuild", (api, plugin) => {
10
10
  return {
11
11
  ...plugin,
12
12
  esbuild: {
@@ -34,9 +34,9 @@ var defu6 = require('defu');
34
34
  var _package = require('@stryke/string-format/package');
35
35
  var superdiff = require('@donedeal0/superdiff');
36
36
  var json = require('@stryke/fs/json');
37
- var tsconfig = require('@stryke/fs/tsconfig');
38
37
  var stormJson = require('@stryke/json/storm-json');
39
38
  var filePathFns = require('@stryke/path/file-path-fns');
39
+ var isParentPath = require('@stryke/path/is-parent-path');
40
40
  var titleCase = require('@stryke/string-format/title-case');
41
41
  var writeFile$1 = require('@stryke/fs/write-file');
42
42
  var prettier = require('prettier');
@@ -71,7 +71,6 @@ var logger = require('@storm-software/config-tools/logger');
71
71
  var colors = require('@storm-software/config-tools/utilities/colors');
72
72
  var noop = require('@stryke/helpers/noop');
73
73
  var slash = require('@stryke/path/slash');
74
- var isParentPath = require('@stryke/path/is-parent-path');
75
74
  var memfs = require('memfs');
76
75
  var unionfs = require('unionfs');
77
76
  var tsMorph = require('ts-morph');
@@ -339,23 +338,39 @@ ${Object.entries(context.devDependencies).map(([name, version]) => `- ${name}@${
339
338
  ]);
340
339
  }
341
340
  chunkUSNT2KNT_cjs.__name(installDependencies, "installDependencies");
342
- function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig = "tsconfig.json") {
341
+ function getTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
342
+ let tsconfigFilePath;
343
+ if (tsconfig) {
344
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig);
345
+ } else {
346
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.app.json");
347
+ if (!tsconfigFilePath) {
348
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.lib.json");
349
+ if (!tsconfigFilePath) {
350
+ tsconfigFilePath = tryTsconfigFilePath(workspaceRoot, projectRoot, "tsconfig.json");
351
+ }
352
+ }
353
+ }
354
+ if (!tsconfigFilePath) {
355
+ throw new Error(`Cannot find the \`tsconfig.json\` configuration file for the project at ${projectRoot}.`);
356
+ }
357
+ return tsconfigFilePath;
358
+ }
359
+ chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
360
+ function tryTsconfigFilePath(workspaceRoot, projectRoot, tsconfig) {
343
361
  let tsconfigFilePath = tsconfig;
344
362
  if (!exists.existsSync(tsconfigFilePath)) {
345
363
  tsconfigFilePath = append.appendPath(tsconfig, projectRoot);
346
364
  if (!exists.existsSync(tsconfigFilePath)) {
347
- tsconfigFilePath = append.appendPath(tsconfig, workspaceRoot);
365
+ tsconfigFilePath = append.appendPath(tsconfig, append.appendPath(projectRoot, workspaceRoot));
348
366
  if (!exists.existsSync(tsconfigFilePath)) {
349
- tsconfigFilePath = append.appendPath(tsconfig, joinPaths.joinPaths(workspaceRoot, projectRoot));
350
- if (!exists.existsSync(tsconfigFilePath)) {
351
- throw new Error(`Cannot find the \`tsconfig.json\` configuration file at ${tsconfig}, ${append.appendPath(tsconfig, projectRoot)}, ${append.appendPath(tsconfig, workspaceRoot)}, or ${tsconfigFilePath}`);
352
- }
367
+ return void 0;
353
368
  }
354
369
  }
355
370
  }
356
371
  return tsconfigFilePath;
357
372
  }
358
- chunkUSNT2KNT_cjs.__name(getTsconfigFilePath, "getTsconfigFilePath");
373
+ chunkUSNT2KNT_cjs.__name(tryTsconfigFilePath, "tryTsconfigFilePath");
359
374
  function findMatch(tsconfigType, types, extensions = [
360
375
  ".ts",
361
376
  ".tsx",
@@ -442,26 +457,18 @@ chunkUSNT2KNT_cjs.__name(writeFile, "writeFile");
442
457
 
443
458
  // src/internal/helpers/resolve-tsconfig.ts
444
459
  async function resolveTsconfigChanges(context) {
445
- const tsconfig$1 = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
460
+ const tsconfig = getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
446
461
  const tsconfigFilePath = getTsconfigFilePath(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig);
447
462
  const tsconfigJson = await json.readJsonFile(tsconfigFilePath);
448
463
  tsconfigJson.compilerOptions ??= {};
449
- const extendedTsconfig = await tsconfig.loadTsConfig(tsconfigFilePath);
450
- extendedTsconfig.compilerOptions ??= {};
451
- if (tsconfigJson.reflection !== true) {
452
- tsconfigJson.reflection = true;
453
- }
454
- if (tsconfig$1.options.experimentalDecorators !== true) {
455
- tsconfigJson.compilerOptions.experimentalDecorators = true;
456
- }
457
- if (tsconfig$1.options.emitDecoratorMetadata !== true) {
458
- tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
459
- }
460
- if (context.config.output.dts) {
461
- 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");
462
- const dtsRelativePath = joinPaths.joinPaths(filePathFns.relativePath(joinPaths.joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), filePathFns.findFilePath(dtsFilePath)), filePathFns.findFileName(dtsFilePath));
464
+ if (context.config.output.dts !== false) {
465
+ 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);
466
+ 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") {
467
+ context.config.output.dts = joinPaths.joinPaths(context.config.output.dts, "powerlines.d.ts");
468
+ }
469
+ 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));
463
470
  if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
464
- dtsFilePath,
471
+ String(context.config.output.dts),
465
472
  dtsRelativePath,
466
473
  "storm.d.ts"
467
474
  ]))) {
@@ -469,7 +476,7 @@ async function resolveTsconfigChanges(context) {
469
476
  tsconfigJson.include.push(dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath);
470
477
  }
471
478
  }
472
- if (!tsconfig$1.options.lib?.some((lib) => [
479
+ if (!tsconfig.options.lib?.some((lib) => [
473
480
  "lib.esnext.d.ts",
474
481
  "lib.es2021.d.ts",
475
482
  "lib.es2022.d.ts",
@@ -478,68 +485,32 @@ async function resolveTsconfigChanges(context) {
478
485
  tsconfigJson.compilerOptions.lib ??= [];
479
486
  tsconfigJson.compilerOptions.lib.push("esnext");
480
487
  }
481
- if (tsconfig$1.options.module !== ts2__default.default.ModuleKind.ESNext) {
488
+ if (tsconfig.options.module !== ts2__default.default.ModuleKind.ESNext) {
482
489
  tsconfigJson.compilerOptions.module = "ESNext";
483
490
  }
484
- if (!tsconfig$1.options.target || ![
491
+ if (!tsconfig.options.target || ![
485
492
  ts2__default.default.ScriptTarget.ESNext,
486
493
  ts2__default.default.ScriptTarget.ES2024,
487
494
  ts2__default.default.ScriptTarget.ES2023,
488
495
  ts2__default.default.ScriptTarget.ES2022,
489
496
  ts2__default.default.ScriptTarget.ES2021
490
- ].includes(tsconfig$1.options.target)) {
497
+ ].includes(tsconfig.options.target)) {
491
498
  tsconfigJson.compilerOptions.target = "ESNext";
492
499
  }
493
- if (tsconfig$1.options.moduleResolution !== ts2__default.default.ModuleResolutionKind.Bundler) {
500
+ if (tsconfig.options.moduleResolution !== ts2__default.default.ModuleResolutionKind.Bundler) {
494
501
  tsconfigJson.compilerOptions.moduleResolution = "Bundler";
495
502
  }
496
- if (tsconfig$1.options.moduleDetection !== ts2__default.default.ModuleDetectionKind.Force) {
503
+ if (tsconfig.options.moduleDetection !== ts2__default.default.ModuleDetectionKind.Force) {
497
504
  tsconfigJson.compilerOptions.moduleDetection = "force";
498
505
  }
499
- if (tsconfig$1.options.allowSyntheticDefaultImports !== true) {
500
- tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
501
- }
502
- if (tsconfig$1.options.noImplicitOverride !== true) {
503
- tsconfigJson.compilerOptions.noImplicitOverride = true;
504
- }
505
- if (tsconfig$1.options.noUncheckedIndexedAccess !== true) {
506
- tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
507
- }
508
- if (tsconfig$1.options.skipLibCheck !== true) {
509
- tsconfigJson.compilerOptions.skipLibCheck = true;
510
- }
511
- if (tsconfig$1.options.resolveJsonModule !== true) {
512
- tsconfigJson.compilerOptions.resolveJsonModule = true;
513
- }
514
- if (tsconfig$1.options.isolatedModules !== true) {
515
- tsconfigJson.compilerOptions.isolatedModules = true;
516
- }
517
- if (tsconfig$1.options.verbatimModuleSyntax !== false) {
518
- tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
519
- }
520
- if (tsconfig$1.options.allowJs !== true) {
521
- tsconfigJson.compilerOptions.allowJs = true;
522
- }
523
- if (tsconfig$1.options.esModuleInterop !== true) {
506
+ if (tsconfig.options.esModuleInterop !== true) {
524
507
  tsconfigJson.compilerOptions.esModuleInterop = true;
525
508
  }
526
- if (tsconfig$1.options.declaration !== true) {
527
- tsconfigJson.compilerOptions.declaration = true;
509
+ if (tsconfig.options.isolatedModules !== true) {
510
+ tsconfigJson.compilerOptions.isolatedModules = true;
528
511
  }
529
- if (context.environment.consumer === "client") {
530
- if (tsconfig$1.options.jsx !== ts2__default.default.JsxEmit.ReactJSX) {
531
- tsconfigJson.compilerOptions.jsx = "react-jsx";
532
- }
533
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
534
- tsconfigJson.compilerOptions.lib ??= [];
535
- tsconfigJson.compilerOptions.lib.push("dom");
536
- }
537
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
538
- tsconfigJson.compilerOptions.lib ??= [];
539
- tsconfigJson.compilerOptions.lib.push("dom.iterable");
540
- }
541
- } else if (context.config.build.platform === "node") {
542
- if (!tsconfig$1.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
512
+ if (context.config.build.platform === "node") {
513
+ if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
543
514
  tsconfigJson.compilerOptions.types ??= [];
544
515
  tsconfigJson.compilerOptions.types.push("node");
545
516
  }
@@ -3047,6 +3018,7 @@ var PowerlinesContext = class _PowerlinesContext {
3047
3018
  userConfig
3048
3019
  });
3049
3020
  }
3021
+ this.config.tsconfig ??= getTsconfigFilePath(this.workspaceConfig.workspaceRoot, cacheKey.projectRoot, config.tsconfig);
3050
3022
  if (isSetObject.isSetObject(config)) {
3051
3023
  this.resolvedConfig = defu6__default.default({
3052
3024
  inlineConfig: this.config.inlineConfig,
@@ -3062,7 +3034,6 @@ var PowerlinesContext = class _PowerlinesContext {
3062
3034
  name: this.projectJson?.name || this.packageJson?.name,
3063
3035
  version: this.packageJson?.version,
3064
3036
  description: this.packageJson?.description,
3065
- tsconfig: append.appendPath("tsconfig.json", cacheKey.projectRoot),
3066
3037
  sourceRoot: this.projectJson?.sourceRoot || append.appendPath("src", cacheKey.projectRoot),
3067
3038
  output: {
3068
3039
  outputPath: cacheKey.projectRoot ? join.joinPaths(this.workspaceConfig?.directories?.build || "dist", cacheKey.projectRoot) : this.workspaceConfig?.directories?.build || "dist",
@@ -1,5 +1,5 @@
1
1
  import { extractESBuildConfig } from './chunk-VBR53KGY.js';
2
- import { createUnpluginFactory } from './chunk-AOAZS3KU.js';
2
+ import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
3
3
  import { __name } from './chunk-SHUYVCID.js';
4
4
  import { isDevelopmentMode, isTestMode } from '@stryke/env/environment-checks';
5
5
  import defu from 'defu';
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunk5IBA5HC2_cjs = require('./chunk-5IBA5HC2.cjs');
4
- var chunk37PJDPER_cjs = require('./chunk-37PJDPER.cjs');
4
+ var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
5
5
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
6
6
  var environmentChecks = require('@stryke/env/environment-checks');
7
7
  var defu = require('defu');
@@ -83,7 +83,7 @@ function extractViteConfig(context) {
83
83
  chunkUSNT2KNT_cjs.__name(extractViteConfig, "extractViteConfig");
84
84
 
85
85
  // src/vite.ts
86
- var vite = unplugin.createVitePlugin(chunk37PJDPER_cjs.createUnpluginFactory("vite", (api, plugin) => {
86
+ var vite = unplugin.createVitePlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("vite", (api, plugin) => {
87
87
  return {
88
88
  ...plugin,
89
89
  vite: {
package/dist/esbuild.cjs CHANGED
@@ -2,10 +2,10 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunkYWDLT2K5_cjs = require('./chunk-YWDLT2K5.cjs');
5
+ var chunkMBWFPGQL_cjs = require('./chunk-MBWFPGQL.cjs');
6
6
  require('./chunk-5IBA5HC2.cjs');
7
- require('./chunk-37PJDPER.cjs');
8
- require('./chunk-XFPLVPMF.cjs');
7
+ require('./chunk-J42CWDHS.cjs');
8
+ require('./chunk-MWURGZO3.cjs');
9
9
  require('./chunk-ETKZMGLN.cjs');
10
10
  require('./chunk-PAMSESZV.cjs');
11
11
  require('./chunk-AYKZK666.cjs');
@@ -15,13 +15,13 @@ require('./chunk-USNT2KNT.cjs');
15
15
 
16
16
  Object.defineProperty(exports, "default", {
17
17
  enumerable: true,
18
- get: function () { return chunkYWDLT2K5_cjs.esbuild_default; }
18
+ get: function () { return chunkMBWFPGQL_cjs.esbuild_default; }
19
19
  });
20
20
  Object.defineProperty(exports, "esbuild", {
21
21
  enumerable: true,
22
- get: function () { return chunkYWDLT2K5_cjs.esbuild; }
22
+ get: function () { return chunkMBWFPGQL_cjs.esbuild; }
23
23
  });
24
24
  Object.defineProperty(exports, "module.exports", {
25
25
  enumerable: true,
26
- get: function () { return chunkYWDLT2K5_cjs.esbuild; }
26
+ get: function () { return chunkMBWFPGQL_cjs.esbuild; }
27
27
  });
package/dist/esbuild.js CHANGED
@@ -1,7 +1,7 @@
1
- export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-2DHR5VPL.js';
1
+ export { esbuild_default as default, esbuild, esbuild as "module.exports" } from './chunk-4YOH66OR.js';
2
2
  import './chunk-VBR53KGY.js';
3
- import './chunk-AOAZS3KU.js';
4
- import './chunk-VO7UNY6U.js';
3
+ import './chunk-6F2RGMWO.js';
4
+ import './chunk-5VVIGLK7.js';
5
5
  import './chunk-JQCWV4DT.js';
6
6
  import './chunk-JKBJF3UI.js';
7
7
  import './chunk-VT7NVLLU.js';
package/dist/farm.cjs CHANGED
@@ -2,15 +2,15 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var chunk37PJDPER_cjs = require('./chunk-37PJDPER.cjs');
6
- require('./chunk-XFPLVPMF.cjs');
5
+ var chunkJ42CWDHS_cjs = require('./chunk-J42CWDHS.cjs');
6
+ require('./chunk-MWURGZO3.cjs');
7
7
  require('./chunk-ETKZMGLN.cjs');
8
8
  require('./chunk-PAMSESZV.cjs');
9
9
  require('./chunk-AYKZK666.cjs');
10
10
  require('./chunk-USNT2KNT.cjs');
11
11
  var unplugin = require('unplugin');
12
12
 
13
- var farm = unplugin.createFarmPlugin(chunk37PJDPER_cjs.createUnpluginFactory("farm"));
13
+ var farm = unplugin.createFarmPlugin(chunkJ42CWDHS_cjs.createUnpluginFactory("farm"));
14
14
  var farm_default = farm;
15
15
 
16
16
  exports.default = farm_default;
package/dist/farm.js CHANGED
@@ -1,5 +1,5 @@
1
- import { createUnpluginFactory } from './chunk-AOAZS3KU.js';
2
- import './chunk-VO7UNY6U.js';
1
+ import { createUnpluginFactory } from './chunk-6F2RGMWO.js';
2
+ import './chunk-5VVIGLK7.js';
3
3
  import './chunk-JQCWV4DT.js';
4
4
  import './chunk-JKBJF3UI.js';
5
5
  import './chunk-VT7NVLLU.js';