powerlines 0.24.2 → 0.24.4

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 (63) 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-EXQM3KGH.js → chunk-3GIUBMCO.js} +1 -1
  6. package/dist/{chunk-ZEE73BCY.js → chunk-72IKSCJB.js} +1 -1
  7. package/dist/{chunk-ZT2J55YE.js → chunk-FYRK42WJ.js} +15 -22
  8. package/dist/{chunk-FGH3MZTQ.cjs → chunk-M2RYLU4O.cjs} +36 -43
  9. package/dist/{chunk-H74SWU2C.js → chunk-MPNS4WJG.js} +1 -1
  10. package/dist/{chunk-FPB2O7FD.cjs → chunk-QXH7GHN2.cjs} +2 -2
  11. package/dist/{chunk-HTGCHSLH.cjs → chunk-VM5QO2QI.cjs} +2 -2
  12. package/dist/{chunk-7V3LWCLB.js → chunk-WHQHVACG.js} +1 -1
  13. package/dist/{chunk-2TWFBWKA.cjs → chunk-YSHE2L5C.cjs} +3 -3
  14. package/dist/{chunk-TIBYAWZZ.cjs → chunk-YVKPBIAR.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-7CVPZOH4.js → chunk-3HVJF7CD.js} +2 -2
  22. package/dist/lib/{chunk-MS3CD2U6.cjs → chunk-ICO2ZK64.cjs} +42 -41
  23. package/dist/lib/{chunk-CGRHZJY5.js → chunk-IG4PBAEY.js} +11 -10
  24. package/dist/lib/{chunk-AA6RBP44.cjs → chunk-INSBEK3W.cjs} +10 -10
  25. package/dist/lib/{chunk-DFW5FGEO.js → chunk-LDMWUKGL.js} +1 -1
  26. package/dist/lib/{chunk-RNHKEPFD.cjs → chunk-PPUZYUCI.cjs} +5 -12
  27. package/dist/lib/{chunk-KFWMKDJQ.js → chunk-RJLPU6PQ.js} +6 -13
  28. package/dist/lib/{chunk-VMLQATMA.cjs → chunk-VSN5AZP5.cjs} +4 -4
  29. package/dist/lib/contexts/api-context.cjs +4 -4
  30. package/dist/lib/contexts/api-context.js +3 -3
  31. package/dist/lib/contexts/context.cjs +2 -2
  32. package/dist/lib/contexts/context.js +1 -1
  33. package/dist/lib/contexts/environment-context.cjs +3 -3
  34. package/dist/lib/contexts/environment-context.js +2 -2
  35. package/dist/lib/contexts/index.cjs +6 -6
  36. package/dist/lib/contexts/index.js +3 -3
  37. package/dist/lib/index.cjs +9 -9
  38. package/dist/lib/index.js +4 -4
  39. package/dist/lib/unplugin/factory.cjs +5 -5
  40. package/dist/lib/unplugin/factory.js +4 -4
  41. package/dist/lib/unplugin/index.cjs +5 -5
  42. package/dist/lib/unplugin/index.js +4 -4
  43. package/dist/next.cjs +4 -4
  44. package/dist/next.js +3 -3
  45. package/dist/nuxt.cjs +6 -6
  46. package/dist/nuxt.js +4 -4
  47. package/dist/rolldown.cjs +3 -3
  48. package/dist/rolldown.js +2 -2
  49. package/dist/rollup.cjs +3 -3
  50. package/dist/rollup.js +2 -2
  51. package/dist/rspack.cjs +3 -3
  52. package/dist/rspack.js +2 -2
  53. package/dist/tsup.cjs +4 -4
  54. package/dist/tsup.js +3 -3
  55. package/dist/unloader.cjs +3 -3
  56. package/dist/unloader.js +2 -2
  57. package/dist/unplugin.cjs +5 -5
  58. package/dist/unplugin.js +3 -3
  59. package/dist/vite.cjs +6 -6
  60. package/dist/vite.js +3 -3
  61. package/dist/webpack.cjs +6 -6
  62. package/dist/webpack.js +3 -3
  63. package/package.json +14 -14
@@ -3,9 +3,9 @@
3
3
  var chunk2NZADVP5_cjs = require('./chunk-2NZADVP5.cjs');
4
4
  var chunk4NHFXDTQ_cjs = require('./chunk-4NHFXDTQ.cjs');
5
5
  var chunkBQU53ZNB_cjs = require('./chunk-BQU53ZNB.cjs');
6
- var chunkVMLQATMA_cjs = require('./chunk-VMLQATMA.cjs');
6
+ var chunkVSN5AZP5_cjs = require('./chunk-VSN5AZP5.cjs');
7
7
  var chunkB3EE3VHZ_cjs = require('./chunk-B3EE3VHZ.cjs');
8
- var chunkRNHKEPFD_cjs = require('./chunk-RNHKEPFD.cjs');
8
+ var chunkPPUZYUCI_cjs = require('./chunk-PPUZYUCI.cjs');
9
9
  var chunk7VJ42H2I_cjs = require('./chunk-7VJ42H2I.cjs');
10
10
  var chunkJA4HSQRN_cjs = require('./chunk-JA4HSQRN.cjs');
11
11
  var chunk3OCI4TH7_cjs = require('./chunk-3OCI4TH7.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,27 @@ ${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);
271
+ const tsconfig = chunkBQU53ZNB_cjs.getParsedTypeScriptConfig(context.workspaceConfig.workspaceRoot, context.config.projectRoot, context.config.tsconfig, context.config.tsconfigRaw);
272
272
  const tsconfigFilePath = chunkBQU53ZNB_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
275
  if (tsconfigJson.reflection !== true) {
278
276
  tsconfigJson.reflection = true;
279
277
  }
280
- if (tsconfig$1.options.experimentalDecorators !== true) {
278
+ if (tsconfig.options.experimentalDecorators !== true) {
281
279
  tsconfigJson.compilerOptions.experimentalDecorators = true;
282
280
  }
283
- if (tsconfig$1.options.emitDecoratorMetadata !== true) {
281
+ if (tsconfig.options.emitDecoratorMetadata !== true) {
284
282
  tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
285
283
  }
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));
284
+ if (context.config.output.dts !== false) {
285
+ 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);
286
+ 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") {
287
+ context.config.output.dts = joinPaths.joinPaths(context.config.output.dts, "powerlines.d.ts");
288
+ }
289
+ 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));
289
290
  if (!tsconfigJson.include?.some((filePattern) => chunkBQU53ZNB_cjs.isIncludeMatchFound(filePattern, [
290
- dtsFilePath,
291
+ String(context.config.output.dts),
291
292
  dtsRelativePath,
292
293
  "storm.d.ts"
293
294
  ]))) {
@@ -295,7 +296,7 @@ async function resolveTsconfigChanges(context) {
295
296
  tsconfigJson.include.push(dtsRelativePath.startsWith("./") ? dtsRelativePath.slice(2) : dtsRelativePath);
296
297
  }
297
298
  }
298
- if (!tsconfig$1.options.lib?.some((lib) => [
299
+ if (!tsconfig.options.lib?.some((lib) => [
299
300
  "lib.esnext.d.ts",
300
301
  "lib.es2021.d.ts",
301
302
  "lib.es2022.d.ts",
@@ -304,68 +305,68 @@ async function resolveTsconfigChanges(context) {
304
305
  tsconfigJson.compilerOptions.lib ??= [];
305
306
  tsconfigJson.compilerOptions.lib.push("esnext");
306
307
  }
307
- if (tsconfig$1.options.module !== ts__default.default.ModuleKind.ESNext) {
308
+ if (tsconfig.options.module !== ts__default.default.ModuleKind.ESNext) {
308
309
  tsconfigJson.compilerOptions.module = "ESNext";
309
310
  }
310
- if (!tsconfig$1.options.target || ![
311
+ if (!tsconfig.options.target || ![
311
312
  ts__default.default.ScriptTarget.ESNext,
312
313
  ts__default.default.ScriptTarget.ES2024,
313
314
  ts__default.default.ScriptTarget.ES2023,
314
315
  ts__default.default.ScriptTarget.ES2022,
315
316
  ts__default.default.ScriptTarget.ES2021
316
- ].includes(tsconfig$1.options.target)) {
317
+ ].includes(tsconfig.options.target)) {
317
318
  tsconfigJson.compilerOptions.target = "ESNext";
318
319
  }
319
- if (tsconfig$1.options.moduleResolution !== ts__default.default.ModuleResolutionKind.Bundler) {
320
+ if (tsconfig.options.moduleResolution !== ts__default.default.ModuleResolutionKind.Bundler) {
320
321
  tsconfigJson.compilerOptions.moduleResolution = "Bundler";
321
322
  }
322
- if (tsconfig$1.options.moduleDetection !== ts__default.default.ModuleDetectionKind.Force) {
323
+ if (tsconfig.options.moduleDetection !== ts__default.default.ModuleDetectionKind.Force) {
323
324
  tsconfigJson.compilerOptions.moduleDetection = "force";
324
325
  }
325
- if (tsconfig$1.options.allowSyntheticDefaultImports !== true) {
326
+ if (tsconfig.options.allowSyntheticDefaultImports !== true) {
326
327
  tsconfigJson.compilerOptions.allowSyntheticDefaultImports = true;
327
328
  }
328
- if (tsconfig$1.options.noImplicitOverride !== true) {
329
+ if (tsconfig.options.noImplicitOverride !== true) {
329
330
  tsconfigJson.compilerOptions.noImplicitOverride = true;
330
331
  }
331
- if (tsconfig$1.options.noUncheckedIndexedAccess !== true) {
332
+ if (tsconfig.options.noUncheckedIndexedAccess !== true) {
332
333
  tsconfigJson.compilerOptions.noUncheckedIndexedAccess = true;
333
334
  }
334
- if (tsconfig$1.options.skipLibCheck !== true) {
335
+ if (tsconfig.options.skipLibCheck !== true) {
335
336
  tsconfigJson.compilerOptions.skipLibCheck = true;
336
337
  }
337
- if (tsconfig$1.options.resolveJsonModule !== true) {
338
+ if (tsconfig.options.resolveJsonModule !== true) {
338
339
  tsconfigJson.compilerOptions.resolveJsonModule = true;
339
340
  }
340
- if (tsconfig$1.options.isolatedModules !== true) {
341
+ if (tsconfig.options.isolatedModules !== true) {
341
342
  tsconfigJson.compilerOptions.isolatedModules = true;
342
343
  }
343
- if (tsconfig$1.options.verbatimModuleSyntax !== false) {
344
+ if (tsconfig.options.verbatimModuleSyntax !== false) {
344
345
  tsconfigJson.compilerOptions.verbatimModuleSyntax = false;
345
346
  }
346
- if (tsconfig$1.options.allowJs !== true) {
347
+ if (tsconfig.options.allowJs !== true) {
347
348
  tsconfigJson.compilerOptions.allowJs = true;
348
349
  }
349
- if (tsconfig$1.options.esModuleInterop !== true) {
350
+ if (tsconfig.options.esModuleInterop !== true) {
350
351
  tsconfigJson.compilerOptions.esModuleInterop = true;
351
352
  }
352
- if (tsconfig$1.options.declaration !== true) {
353
+ if (tsconfig.options.declaration !== true) {
353
354
  tsconfigJson.compilerOptions.declaration = true;
354
355
  }
355
356
  if (context.environment.consumer === "client") {
356
- if (tsconfig$1.options.jsx !== ts__default.default.JsxEmit.ReactJSX) {
357
+ if (tsconfig.options.jsx !== ts__default.default.JsxEmit.ReactJSX) {
357
358
  tsconfigJson.compilerOptions.jsx = "react-jsx";
358
359
  }
359
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
360
+ if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom")) {
360
361
  tsconfigJson.compilerOptions.lib ??= [];
361
362
  tsconfigJson.compilerOptions.lib.push("dom");
362
363
  }
363
- if (!tsconfig$1.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
364
+ if (!tsconfig.options.lib?.some((lib) => lib.toLowerCase() !== "dom.iterable")) {
364
365
  tsconfigJson.compilerOptions.lib ??= [];
365
366
  tsconfigJson.compilerOptions.lib.push("dom.iterable");
366
367
  }
367
368
  } else if (context.config.build.platform === "node") {
368
- if (!tsconfig$1.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
369
+ if (!tsconfig.options.types?.some((type) => type.toLowerCase() === "node" || type.toLowerCase() === "@types/node")) {
369
370
  tsconfigJson.compilerOptions.types ??= [];
370
371
  tsconfigJson.compilerOptions.types.push("node");
371
372
  }
@@ -470,7 +471,7 @@ var PowerlinesAPI = class _PowerlinesAPI {
470
471
  * Initialize the Powerlines API
471
472
  */
472
473
  static async from(workspaceRoot, config) {
473
- const api = new _PowerlinesAPI(await chunkVMLQATMA_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
474
+ const api = new _PowerlinesAPI(await chunkVSN5AZP5_cjs.PowerlinesAPIContext.from(workspaceRoot, config));
474
475
  api.#context.$$internal.api = api;
475
476
  for (const plugin of api.context.config.plugins ?? []) {
476
477
  await api.#addPlugin(plugin);
@@ -801,7 +802,7 @@ ${formatTypes(generatedTypes)}
801
802
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution started");
802
803
  await this.#executeEnvironments(async (context) => {
803
804
  await this.callHook(context, "finalize");
804
- context.fs[chunkRNHKEPFD_cjs.__VFS_REVERT__]();
805
+ context.fs[chunkPPUZYUCI_cjs.__VFS_REVERT__]();
805
806
  await context.fs.dispose();
806
807
  });
807
808
  this.context.log(types.LogLevelLabel.TRACE, "Powerlines finalize execution completed");
@@ -966,11 +967,11 @@ ${formatTypes(generatedTypes)}
966
967
  if (isPromise.isPromiseLike(config)) {
967
968
  awaited = await Promise.resolve(config);
968
969
  }
969
- if (!chunkRNHKEPFD_cjs.isPluginConfig(awaited)) {
970
+ if (!chunkPPUZYUCI_cjs.isPluginConfig(awaited)) {
970
971
  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
972
  }
972
973
  let plugin;
973
- if (chunkRNHKEPFD_cjs.isPlugin(awaited)) {
974
+ if (chunkPPUZYUCI_cjs.isPlugin(awaited)) {
974
975
  plugin = awaited;
975
976
  } else if (isFunction.isFunction(awaited)) {
976
977
  plugin = await Promise.resolve(awaited());
@@ -981,10 +982,10 @@ ${formatTypes(generatedTypes)}
981
982
  } else {
982
983
  plugin = resolved;
983
984
  }
984
- } else if (chunkRNHKEPFD_cjs.isPluginConfigTuple(awaited) || chunkRNHKEPFD_cjs.isPluginConfigObject(awaited)) {
985
+ } else if (chunkPPUZYUCI_cjs.isPluginConfigTuple(awaited) || chunkPPUZYUCI_cjs.isPluginConfigObject(awaited)) {
985
986
  let pluginConfig;
986
987
  let pluginOptions;
987
- if (chunkRNHKEPFD_cjs.isPluginConfigTuple(awaited)) {
988
+ if (chunkPPUZYUCI_cjs.isPluginConfigTuple(awaited)) {
988
989
  pluginConfig = awaited[0];
989
990
  pluginOptions = awaited?.length === 2 ? awaited[1] : void 0;
990
991
  } else {
@@ -1000,17 +1001,17 @@ ${formatTypes(generatedTypes)}
1000
1001
  }
1001
1002
  } else if (isFunction.isFunction(pluginConfig)) {
1002
1003
  plugin = await Promise.resolve(pluginConfig(pluginOptions));
1003
- } else if (chunkRNHKEPFD_cjs.isPlugin(pluginConfig)) {
1004
+ } else if (chunkPPUZYUCI_cjs.isPlugin(pluginConfig)) {
1004
1005
  plugin = pluginConfig;
1005
1006
  }
1006
1007
  }
1007
1008
  if (!plugin) {
1008
1009
  throw new Error(`The plugin configuration ${JSON.stringify(awaited)} is invalid. This configuration must point to a valid Powerlines plugin module.`);
1009
1010
  }
1010
- if (!chunkRNHKEPFD_cjs.isPlugin(plugin)) {
1011
+ if (!chunkPPUZYUCI_cjs.isPlugin(plugin)) {
1011
1012
  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
1013
  }
1013
- if (chunkRNHKEPFD_cjs.checkDedupe(plugin, this.context.plugins)) {
1014
+ if (chunkPPUZYUCI_cjs.checkDedupe(plugin, this.context.plugins)) {
1014
1015
  this.context.log(types.LogLevelLabel.TRACE, `Duplicate ${chalk2__default.default.bold.cyanBright(plugin.name)} plugin dependency detected - Skipping initialization.`);
1015
1016
  return null;
1016
1017
  }
@@ -1,9 +1,9 @@
1
1
  import { writeFile } from './chunk-TANQDHYY.js';
2
2
  import { getFileHeader } from './chunk-GANVMM73.js';
3
3
  import { getParsedTypeScriptConfig, getTsconfigFilePath, isIncludeMatchFound } from './chunk-YOENMDZY.js';
4
- import { PowerlinesAPIContext } from './chunk-7CVPZOH4.js';
4
+ import { PowerlinesAPIContext } from './chunk-3HVJF7CD.js';
5
5
  import { callHook } from './chunk-KFJCWNVG.js';
6
- import { __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-KFWMKDJQ.js';
6
+ import { __VFS_REVERT__, isPluginConfig, isPlugin, isPluginConfigTuple, isPluginConfigObject, checkDedupe } from './chunk-RJLPU6PQ.js';
7
7
  import { writeMetaFile } from './chunk-FQLZZYYO.js';
8
8
  import { createLog } from './chunk-ENRLU4UR.js';
9
9
  import { getString } from './chunk-M263EZ4F.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,8 +245,6 @@ 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
248
  if (tsconfigJson.reflection !== true) {
251
249
  tsconfigJson.reflection = true;
252
250
  }
@@ -256,11 +254,14 @@ async function resolveTsconfigChanges(context) {
256
254
  if (tsconfig.options.emitDecoratorMetadata !== true) {
257
255
  tsconfigJson.compilerOptions.emitDecoratorMetadata = true;
258
256
  }
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));
257
+ if (context.config.output.dts !== false) {
258
+ 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);
259
+ if (findFileExtension(context.config.output.dts) !== "d.ts" && findFileExtension(context.config.output.dts) !== "d.cts" && findFileExtension(context.config.output.dts) !== "d.mts") {
260
+ context.config.output.dts = joinPaths(context.config.output.dts, "powerlines.d.ts");
261
+ }
262
+ const dtsRelativePath = joinPaths(relativePath(joinPaths(context.workspaceConfig.workspaceRoot, context.config.projectRoot), findFilePath(context.config.output.dts)), findFileName(context.config.output.dts));
262
263
  if (!tsconfigJson.include?.some((filePattern) => isIncludeMatchFound(filePattern, [
263
- dtsFilePath,
264
+ String(context.config.output.dts),
264
265
  dtsRelativePath,
265
266
  "storm.d.ts"
266
267
  ]))) {
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  var chunkB3EE3VHZ_cjs = require('./chunk-B3EE3VHZ.cjs');
4
- var chunkRNHKEPFD_cjs = require('./chunk-RNHKEPFD.cjs');
4
+ var chunkPPUZYUCI_cjs = require('./chunk-PPUZYUCI.cjs');
5
5
  var chunkUSNT2KNT_cjs = require('./chunk-USNT2KNT.cjs');
6
6
  var resolve = require('@stryke/fs/resolve');
7
7
  var isFunction = require('@stryke/type-checks/is-function');
@@ -17,7 +17,7 @@ var PLUGIN_NON_HOOK_FIELDS = [
17
17
  ];
18
18
 
19
19
  // src/lib/contexts/environment-context.ts
20
- var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends chunkRNHKEPFD_cjs.PowerlinesContext {
20
+ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends chunkPPUZYUCI_cjs.PowerlinesContext {
21
21
  static {
22
22
  chunkUSNT2KNT_cjs.__name(this, "PowerlinesEnvironmentContext");
23
23
  }
@@ -65,7 +65,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
65
65
  if (!result || isObject.isObject(result) && Object.keys(result).length === 0) {
66
66
  return;
67
67
  }
68
- resolvedPlugin = chunkRNHKEPFD_cjs.isPlugin(result) ? result : plugin;
68
+ resolvedPlugin = chunkPPUZYUCI_cjs.isPlugin(result) ? result : plugin;
69
69
  }
70
70
  const context = chunkB3EE3VHZ_cjs.createPluginContext(resolvedPlugin, this);
71
71
  this.plugins.push({
@@ -75,28 +75,28 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
75
75
  this.#hooks = Object.keys(resolvedPlugin).filter((key) => !PLUGIN_NON_HOOK_FIELDS.includes(key)).reduce((ret, key) => {
76
76
  const hook = key;
77
77
  const pluginHook = resolvedPlugin[hook];
78
- if (!chunkRNHKEPFD_cjs.isPluginHook(pluginHook)) {
78
+ if (!chunkPPUZYUCI_cjs.isPluginHook(pluginHook)) {
79
79
  return ret;
80
80
  }
81
- if (!chunkRNHKEPFD_cjs.isHookExternal(hook)) {
81
+ if (!chunkPPUZYUCI_cjs.isHookExternal(hook)) {
82
82
  ret[hook] ??= {};
83
83
  if (resolvedPlugin.enforce) {
84
84
  ret[hook][`${resolvedPlugin.enforce}Enforced`] ??= [];
85
- chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${resolvedPlugin.enforce}Enforced`]);
85
+ chunkPPUZYUCI_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${resolvedPlugin.enforce}Enforced`]);
86
86
  return ret;
87
87
  }
88
88
  if (isFunction.isFunction(pluginHook) || !pluginHook.order) {
89
89
  ret[hook].normal ??= [];
90
- chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook].normal);
90
+ chunkPPUZYUCI_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook].normal);
91
91
  return ret;
92
92
  }
93
93
  ret[hook][`${pluginHook.order}Ordered`] ??= [];
94
- chunkRNHKEPFD_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${pluginHook.order}Ordered`]);
94
+ chunkPPUZYUCI_cjs.addPluginHook(context, resolvedPlugin, pluginHook, ret[hook][`${pluginHook.order}Ordered`]);
95
95
  } else {
96
96
  ret[hook] ??= [];
97
97
  ret[hook].push({
98
98
  plugin: resolvedPlugin,
99
- hook: chunkRNHKEPFD_cjs.getHookHandler(pluginHook).bind(context)
99
+ hook: chunkPPUZYUCI_cjs.getHookHandler(pluginHook).bind(context)
100
100
  });
101
101
  }
102
102
  return ret;
@@ -108,7 +108,7 @@ var PowerlinesEnvironmentContext = class _PowerlinesEnvironmentContext extends c
108
108
  selectHooks(hook, options) {
109
109
  const handlers = [];
110
110
  if (this.hooks[hook]) {
111
- if (!chunkRNHKEPFD_cjs.isHookExternal(hook)) {
111
+ if (!chunkPPUZYUCI_cjs.isHookExternal(hook)) {
112
112
  const hooks = this.hooks[hook];
113
113
  if (options?.order) {
114
114
  if (options?.order === "pre") {
@@ -1,5 +1,5 @@
1
1
  import { createPluginContext } from './chunk-KFJCWNVG.js';
2
- import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-KFWMKDJQ.js';
2
+ import { PowerlinesContext, isPlugin, isPluginHook, isHookExternal, addPluginHook, getHookHandler } from './chunk-RJLPU6PQ.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';
@@ -45,6 +45,7 @@ var flatCache = require('flat-cache');
45
45
  var buffer$1 = require('buffer');
46
46
  var _fs = require('fs');
47
47
  var prettier = require('prettier');
48
+ var slash = require('@stryke/path/slash');
48
49
  var isParentPath = require('@stryke/path/is-parent-path');
49
50
  var memfs = require('memfs');
50
51
  var unionfs = require('unionfs');
@@ -410,16 +411,8 @@ function isVirtualFileData(obj) {
410
411
  return !!(isSetObject.isSetObject(obj) && "code" in obj && obj.code);
411
412
  }
412
413
  chunkUSNT2KNT_cjs.__name(isVirtualFileData, "isVirtualFileData");
413
- var FILE_PREFIX = "file://";
414
- function toFilePath(pathOrUrl) {
415
- if (!pathOrUrl) {
416
- throw new Error("No Path or URL provided to Virtual File System");
417
- }
418
- let result = pathOrUrl.toString();
419
- if (result.startsWith(FILE_PREFIX)) {
420
- result = result.slice(FILE_PREFIX.length);
421
- }
422
- return result;
414
+ function toFilePath(path) {
415
+ return correctPath.correctPath(slash.slash(path?.toString() || ".").replace(/^file:\/\//, ""));
423
416
  }
424
417
  chunkUSNT2KNT_cjs.__name(toFilePath, "toFilePath");
425
418
  var FS_METHODS = [
@@ -1483,8 +1476,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
1483
1476
  paths.push(importer);
1484
1477
  }
1485
1478
  paths.push(this.#context.workspaceConfig.workspaceRoot);
1486
- paths.push(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, this.#context.config.projectRoot));
1487
- paths.push(joinPaths.joinPaths(this.#context.workspaceConfig.workspaceRoot, this.#context.config.sourceRoot));
1479
+ paths.push(append.appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
1480
+ paths.push(append.appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
1488
1481
  paths.push(...Object.keys(this.#context.tsconfig.options.paths ?? {}).filter((tsconfigPath) => id.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig.options.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => append.appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
1489
1482
  for (const combination of resolve.getResolutionCombinations(id, {
1490
1483
  paths
@@ -35,7 +35,7 @@ import { isUndefined } from '@stryke/type-checks/is-undefined';
35
35
  import * as $ from '@stryke/capnp';
36
36
  import { bufferToString } from '@stryke/convert/buffer-to-string';
37
37
  import { readFileBuffer, readFileBufferSync, writeFileBuffer } from '@stryke/fs/buffer';
38
- import { toAbsolutePath } from '@stryke/path/correct-path';
38
+ import { toAbsolutePath, correctPath } from '@stryke/path/correct-path';
39
39
  import { findFilePath, findFileDotExtensionSafe } from '@stryke/path/file-path-fns';
40
40
  import { prettyBytes } from '@stryke/string-format/pretty-bytes';
41
41
  import { isBuffer } from '@stryke/type-checks/is-buffer';
@@ -43,6 +43,7 @@ import { create } from 'flat-cache';
43
43
  import { Blob } from 'node:buffer';
44
44
  import _fs from 'node:fs';
45
45
  import { resolveConfig, format } from 'prettier';
46
+ import { slash } from '@stryke/path/slash';
46
47
  import { isParentPath } from '@stryke/path/is-parent-path';
47
48
  import { Volume } from 'memfs';
48
49
  import { Union } from 'unionfs';
@@ -384,16 +385,8 @@ function isVirtualFileData(obj) {
384
385
  return !!(isSetObject(obj) && "code" in obj && obj.code);
385
386
  }
386
387
  __name(isVirtualFileData, "isVirtualFileData");
387
- var FILE_PREFIX = "file://";
388
- function toFilePath(pathOrUrl) {
389
- if (!pathOrUrl) {
390
- throw new Error("No Path or URL provided to Virtual File System");
391
- }
392
- let result = pathOrUrl.toString();
393
- if (result.startsWith(FILE_PREFIX)) {
394
- result = result.slice(FILE_PREFIX.length);
395
- }
396
- return result;
388
+ function toFilePath(path) {
389
+ return correctPath(slash(path?.toString() || ".").replace(/^file:\/\//, ""));
397
390
  }
398
391
  __name(toFilePath, "toFilePath");
399
392
  var FS_METHODS = [
@@ -1457,8 +1450,8 @@ var VirtualFileSystem = class _VirtualFileSystem {
1457
1450
  paths.push(importer);
1458
1451
  }
1459
1452
  paths.push(this.#context.workspaceConfig.workspaceRoot);
1460
- paths.push(joinPaths$1(this.#context.workspaceConfig.workspaceRoot, this.#context.config.projectRoot));
1461
- paths.push(joinPaths$1(this.#context.workspaceConfig.workspaceRoot, this.#context.config.sourceRoot));
1453
+ paths.push(appendPath(this.#context.config.projectRoot, this.#context.workspaceConfig.workspaceRoot));
1454
+ paths.push(appendPath(this.#context.config.sourceRoot, this.#context.workspaceConfig.workspaceRoot));
1462
1455
  paths.push(...Object.keys(this.#context.tsconfig.options.paths ?? {}).filter((tsconfigPath) => id.startsWith(tsconfigPath.replace(/\*$/, ""))).map((tsconfigPath) => this.#context.tsconfig.options.paths?.[tsconfigPath]).flat().filter(Boolean).map((tsconfigPath) => appendPath(tsconfigPath, this.#context.workspaceConfig.workspaceRoot)));
1463
1456
  for (const combination of getResolutionCombinations(id, {
1464
1457
  paths
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
- var chunkAA6RBP44_cjs = require('./chunk-AA6RBP44.cjs');
4
- var chunkRNHKEPFD_cjs = require('./chunk-RNHKEPFD.cjs');
3
+ var chunkINSBEK3W_cjs = require('./chunk-INSBEK3W.cjs');
4
+ var chunkPPUZYUCI_cjs = require('./chunk-PPUZYUCI.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 chunkRNHKEPFD_cjs.PowerlinesContext {
67
+ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkPPUZYUCI_cjs.PowerlinesContext {
68
68
  static {
69
69
  chunkUSNT2KNT_cjs.__name(this, "PowerlinesAPIContext");
70
70
  }
@@ -127,7 +127,7 @@ var PowerlinesAPIContext = class _PowerlinesAPIContext extends chunkRNHKEPFD_cjs
127
127
  if (this.environments[environment.name]) {
128
128
  context = this.environments[environment.name];
129
129
  } else {
130
- context = await chunkAA6RBP44_cjs.PowerlinesEnvironmentContext.fromConfig(this.workspaceConfig, this.config);
130
+ context = await chunkINSBEK3W_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);
@@ -1,9 +1,9 @@
1
1
  'use strict';
2
2
 
3
- var chunkVMLQATMA_cjs = require('../chunk-VMLQATMA.cjs');
4
- require('../chunk-AA6RBP44.cjs');
3
+ var chunkVSN5AZP5_cjs = require('../chunk-VSN5AZP5.cjs');
4
+ require('../chunk-INSBEK3W.cjs');
5
5
  require('../chunk-B3EE3VHZ.cjs');
6
- require('../chunk-RNHKEPFD.cjs');
6
+ require('../chunk-PPUZYUCI.cjs');
7
7
  require('../chunk-7VJ42H2I.cjs');
8
8
  require('../chunk-SAS5EPBD.cjs');
9
9
  require('../chunk-K3NBD5LL.cjs');
@@ -15,5 +15,5 @@ require('../chunk-USNT2KNT.cjs');
15
15
 
16
16
  Object.defineProperty(exports, "PowerlinesAPIContext", {
17
17
  enumerable: true,
18
- get: function () { return chunkVMLQATMA_cjs.PowerlinesAPIContext; }
18
+ get: function () { return chunkVSN5AZP5_cjs.PowerlinesAPIContext; }
19
19
  });
@@ -1,7 +1,7 @@
1
- export { PowerlinesAPIContext } from '../chunk-7CVPZOH4.js';
2
- import '../chunk-DFW5FGEO.js';
1
+ export { PowerlinesAPIContext } from '../chunk-3HVJF7CD.js';
2
+ import '../chunk-LDMWUKGL.js';
3
3
  import '../chunk-KFJCWNVG.js';
4
- import '../chunk-KFWMKDJQ.js';
4
+ import '../chunk-RJLPU6PQ.js';
5
5
  import '../chunk-FQLZZYYO.js';
6
6
  import '../chunk-YQ3ODCHV.js';
7
7
  import '../chunk-XBM7FHNK.js';
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var chunkRNHKEPFD_cjs = require('../chunk-RNHKEPFD.cjs');
3
+ var chunkPPUZYUCI_cjs = require('../chunk-PPUZYUCI.cjs');
4
4
  require('../chunk-7VJ42H2I.cjs');
5
5
  require('../chunk-SAS5EPBD.cjs');
6
6
  require('../chunk-K3NBD5LL.cjs');
@@ -12,5 +12,5 @@ require('../chunk-USNT2KNT.cjs');
12
12
 
13
13
  Object.defineProperty(exports, "PowerlinesContext", {
14
14
  enumerable: true,
15
- get: function () { return chunkRNHKEPFD_cjs.PowerlinesContext; }
15
+ get: function () { return chunkPPUZYUCI_cjs.PowerlinesContext; }
16
16
  });
@@ -1,4 +1,4 @@
1
- export { PowerlinesContext } from '../chunk-KFWMKDJQ.js';
1
+ export { PowerlinesContext } from '../chunk-RJLPU6PQ.js';
2
2
  import '../chunk-FQLZZYYO.js';
3
3
  import '../chunk-YQ3ODCHV.js';
4
4
  import '../chunk-XBM7FHNK.js';
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- var chunkAA6RBP44_cjs = require('../chunk-AA6RBP44.cjs');
3
+ var chunkINSBEK3W_cjs = require('../chunk-INSBEK3W.cjs');
4
4
  require('../chunk-B3EE3VHZ.cjs');
5
- require('../chunk-RNHKEPFD.cjs');
5
+ require('../chunk-PPUZYUCI.cjs');
6
6
  require('../chunk-7VJ42H2I.cjs');
7
7
  require('../chunk-SAS5EPBD.cjs');
8
8
  require('../chunk-K3NBD5LL.cjs');
@@ -14,5 +14,5 @@ require('../chunk-USNT2KNT.cjs');
14
14
 
15
15
  Object.defineProperty(exports, "PowerlinesEnvironmentContext", {
16
16
  enumerable: true,
17
- get: function () { return chunkAA6RBP44_cjs.PowerlinesEnvironmentContext; }
17
+ get: function () { return chunkINSBEK3W_cjs.PowerlinesEnvironmentContext; }
18
18
  });
@@ -1,6 +1,6 @@
1
- export { PowerlinesEnvironmentContext } from '../chunk-DFW5FGEO.js';
1
+ export { PowerlinesEnvironmentContext } from '../chunk-LDMWUKGL.js';
2
2
  import '../chunk-KFJCWNVG.js';
3
- import '../chunk-KFWMKDJQ.js';
3
+ import '../chunk-RJLPU6PQ.js';
4
4
  import '../chunk-FQLZZYYO.js';
5
5
  import '../chunk-YQ3ODCHV.js';
6
6
  import '../chunk-XBM7FHNK.js';
@@ -1,10 +1,10 @@
1
1
  'use strict';
2
2
 
3
3
  require('../chunk-35FGUJFD.cjs');
4
- var chunkVMLQATMA_cjs = require('../chunk-VMLQATMA.cjs');
5
- var chunkAA6RBP44_cjs = require('../chunk-AA6RBP44.cjs');
4
+ var chunkVSN5AZP5_cjs = require('../chunk-VSN5AZP5.cjs');
5
+ var chunkINSBEK3W_cjs = require('../chunk-INSBEK3W.cjs');
6
6
  var chunkB3EE3VHZ_cjs = require('../chunk-B3EE3VHZ.cjs');
7
- var chunkRNHKEPFD_cjs = require('../chunk-RNHKEPFD.cjs');
7
+ var chunkPPUZYUCI_cjs = require('../chunk-PPUZYUCI.cjs');
8
8
  require('../chunk-7VJ42H2I.cjs');
9
9
  require('../chunk-SAS5EPBD.cjs');
10
10
  require('../chunk-K3NBD5LL.cjs');
@@ -16,11 +16,11 @@ require('../chunk-USNT2KNT.cjs');
16
16
 
17
17
  Object.defineProperty(exports, "PowerlinesAPIContext", {
18
18
  enumerable: true,
19
- get: function () { return chunkVMLQATMA_cjs.PowerlinesAPIContext; }
19
+ get: function () { return chunkVSN5AZP5_cjs.PowerlinesAPIContext; }
20
20
  });
21
21
  Object.defineProperty(exports, "PowerlinesEnvironmentContext", {
22
22
  enumerable: true,
23
- get: function () { return chunkAA6RBP44_cjs.PowerlinesEnvironmentContext; }
23
+ get: function () { return chunkINSBEK3W_cjs.PowerlinesEnvironmentContext; }
24
24
  });
25
25
  Object.defineProperty(exports, "createPluginContext", {
26
26
  enumerable: true,
@@ -28,5 +28,5 @@ Object.defineProperty(exports, "createPluginContext", {
28
28
  });
29
29
  Object.defineProperty(exports, "PowerlinesContext", {
30
30
  enumerable: true,
31
- get: function () { return chunkRNHKEPFD_cjs.PowerlinesContext; }
31
+ get: function () { return chunkPPUZYUCI_cjs.PowerlinesContext; }
32
32
  });
@@ -1,8 +1,8 @@
1
1
  import '../chunk-NYNHNTHT.js';
2
- export { PowerlinesAPIContext } from '../chunk-7CVPZOH4.js';
3
- export { PowerlinesEnvironmentContext } from '../chunk-DFW5FGEO.js';
2
+ export { PowerlinesAPIContext } from '../chunk-3HVJF7CD.js';
3
+ export { PowerlinesEnvironmentContext } from '../chunk-LDMWUKGL.js';
4
4
  export { createPluginContext } from '../chunk-KFJCWNVG.js';
5
- export { PowerlinesContext } from '../chunk-KFWMKDJQ.js';
5
+ export { PowerlinesContext } from '../chunk-RJLPU6PQ.js';
6
6
  import '../chunk-FQLZZYYO.js';
7
7
  import '../chunk-YQ3ODCHV.js';
8
8
  import '../chunk-XBM7FHNK.js';