powerlines 0.40.1 → 0.40.3

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 (137) hide show
  1. package/dist/{api-D1TJOJXE.mjs → api-C9xtrjcq.mjs} +105 -57
  2. package/dist/api-C9xtrjcq.mjs.map +1 -0
  3. package/dist/{api-CMgoAQum.cjs → api-CW410d4B.cjs} +104 -56
  4. package/dist/astro.cjs +5 -5
  5. package/dist/astro.d.cts +1 -1
  6. package/dist/astro.d.mts +5 -5
  7. package/dist/astro.mjs +5 -5
  8. package/dist/{config-CY-rNoQX.d.cts → config-BNcBL0tI.d.cts} +23 -1
  9. package/dist/config-BNcBL0tI.d.cts.map +1 -0
  10. package/dist/{config-BYUOZn2-.d.mts → config-Bu97tgeF.d.cts} +2 -2
  11. package/dist/{config-BYUOZn2-.d.mts.map → config-Bu97tgeF.d.cts.map} +1 -1
  12. package/dist/{config-tAvhtoU3.d.cts → config-D2cqq84p.d.mts} +2 -2
  13. package/dist/{config-tAvhtoU3.d.cts.map → config-D2cqq84p.d.mts.map} +1 -1
  14. package/dist/{config-B76VxuFj.d.mts → config-jcYnkMvq.d.mts} +23 -1
  15. package/dist/config-jcYnkMvq.d.mts.map +1 -0
  16. package/dist/config.d.cts +1 -1
  17. package/dist/config.d.mts +2 -2
  18. package/dist/context/index.cjs +3 -3
  19. package/dist/context/index.d.cts +21 -1
  20. package/dist/context/index.d.cts.map +1 -1
  21. package/dist/context/index.d.mts +24 -4
  22. package/dist/context/index.d.mts.map +1 -1
  23. package/dist/context/index.mjs +3 -3
  24. package/dist/{esbuild-B8xqzmmF.cjs → esbuild-CiPqZPkA.cjs} +2 -2
  25. package/dist/{esbuild-Bo7TrGmt.mjs → esbuild-DQAGVDY_.mjs} +3 -3
  26. package/dist/{esbuild-Bo7TrGmt.mjs.map → esbuild-DQAGVDY_.mjs.map} +1 -1
  27. package/dist/esbuild.cjs +5 -5
  28. package/dist/esbuild.d.cts +1 -1
  29. package/dist/esbuild.d.mts +4 -4
  30. package/dist/esbuild.mjs +5 -5
  31. package/dist/farm.cjs +3 -3
  32. package/dist/farm.d.cts +1 -1
  33. package/dist/farm.d.mts +4 -4
  34. package/dist/farm.mjs +3 -3
  35. package/dist/{index-C60deASW.d.mts → index-4WNH8dg3.d.mts} +2 -2
  36. package/dist/{index-C60deASW.d.mts.map → index-4WNH8dg3.d.mts.map} +1 -1
  37. package/dist/{index-Dqk6Rh9U.d.mts → index-BjLkEvse.d.mts} +3 -3
  38. package/dist/{index-Dqk6Rh9U.d.mts.map → index-BjLkEvse.d.mts.map} +1 -1
  39. package/dist/{index-DkZkdzSQ.d.cts → index-Cie2X8UH.d.cts} +2 -2
  40. package/dist/{index-DkZkdzSQ.d.cts.map → index-Cie2X8UH.d.cts.map} +1 -1
  41. package/dist/{write-file-gkuvUoFn.d.cts → index-DP6juTGE.d.mts} +35 -6
  42. package/dist/index-DP6juTGE.d.mts.map +1 -0
  43. package/dist/index.cjs +3 -3
  44. package/dist/index.d.cts +6 -6
  45. package/dist/index.d.mts +6 -6
  46. package/dist/index.mjs +3 -3
  47. package/dist/next.cjs +4 -4
  48. package/dist/next.mjs +4 -4
  49. package/dist/nuxt.cjs +6 -6
  50. package/dist/nuxt.d.cts +1 -1
  51. package/dist/nuxt.d.mts +4 -4
  52. package/dist/nuxt.mjs +6 -6
  53. package/dist/{plugin-DE7BXFkV.d.mts → plugin-CO_BQ0th.d.cts} +2 -2
  54. package/dist/{plugin-DE7BXFkV.d.mts.map → plugin-CO_BQ0th.d.cts.map} +1 -1
  55. package/dist/{plugin-CPi1BC54.d.cts → plugin-CvPFipli.d.cts} +3 -3
  56. package/dist/{plugin-CPi1BC54.d.cts.map → plugin-CvPFipli.d.cts.map} +1 -1
  57. package/dist/plugin-utils.d.cts +3 -3
  58. package/dist/plugin-utils.d.cts.map +1 -1
  59. package/dist/plugin-utils.d.mts +7 -7
  60. package/dist/plugin-utils.d.mts.map +1 -1
  61. package/dist/{plugin-XET4WKK4.d.cts → plugin-xJ2LIFca.d.mts} +2 -2
  62. package/dist/{plugin-XET4WKK4.d.cts.map → plugin-xJ2LIFca.d.mts.map} +1 -1
  63. package/dist/{resolve-options-B1gzDFxb.cjs → resolve-options-BQnTgg3V.cjs} +1 -1
  64. package/dist/{resolve-options-Ym_q-Hb7.mjs → resolve-options-DHL3RM8F.mjs} +2 -2
  65. package/dist/{resolve-options-Ym_q-Hb7.mjs.map → resolve-options-DHL3RM8F.mjs.map} +1 -1
  66. package/dist/{rolldown-HYYWYM2Y.mjs → rolldown-B2frMllJ.mjs} +2 -2
  67. package/dist/{rolldown-HYYWYM2Y.mjs.map → rolldown-B2frMllJ.mjs.map} +1 -1
  68. package/dist/{rolldown-1g-LKcc6.cjs → rolldown-Cop6Gb8O.cjs} +1 -1
  69. package/dist/rolldown.cjs +4 -4
  70. package/dist/rolldown.d.cts +1 -1
  71. package/dist/rolldown.d.mts +4 -4
  72. package/dist/rolldown.mjs +4 -4
  73. package/dist/rollup.cjs +3 -3
  74. package/dist/rollup.d.cts +1 -1
  75. package/dist/rollup.d.mts +4 -4
  76. package/dist/rollup.mjs +3 -3
  77. package/dist/rspack.cjs +3 -3
  78. package/dist/rspack.d.cts +1 -1
  79. package/dist/rspack.d.mts +4 -4
  80. package/dist/rspack.mjs +3 -3
  81. package/dist/storage/index.cjs +3 -1
  82. package/dist/storage/index.d.cts +1 -1
  83. package/dist/storage/index.d.cts.map +1 -1
  84. package/dist/storage/index.d.mts +4 -4
  85. package/dist/storage/index.d.mts.map +1 -1
  86. package/dist/storage/index.mjs +3 -1
  87. package/dist/tsdown.cjs +4 -4
  88. package/dist/tsdown.d.cts +1 -1
  89. package/dist/tsdown.d.mts +4 -4
  90. package/dist/tsdown.mjs +4 -4
  91. package/dist/tsup.cjs +5 -5
  92. package/dist/tsup.d.cts +1 -1
  93. package/dist/tsup.d.mts +4 -4
  94. package/dist/tsup.mjs +5 -5
  95. package/dist/typescript/index.d.cts +1 -1
  96. package/dist/typescript/index.d.mts +4 -4
  97. package/dist/unloader.cjs +3 -3
  98. package/dist/unloader.d.cts +1 -1
  99. package/dist/unloader.d.mts +4 -4
  100. package/dist/unloader.mjs +3 -3
  101. package/dist/unplugin.cjs +3 -3
  102. package/dist/unplugin.d.cts +2 -2
  103. package/dist/unplugin.d.mts +4 -4
  104. package/dist/unplugin.mjs +3 -3
  105. package/dist/{utils-CxKWmhs2.cjs → utils-BbDma_5Y.cjs} +54 -9
  106. package/dist/{utils-RU0EjpzP.mjs → utils-DoQcX7Sk.mjs} +40 -7
  107. package/dist/{utils-RU0EjpzP.mjs.map → utils-DoQcX7Sk.mjs.map} +1 -1
  108. package/dist/utils.cjs +4 -2
  109. package/dist/utils.d.cts +2 -2
  110. package/dist/utils.d.mts +3 -3
  111. package/dist/utils.mjs +2 -2
  112. package/dist/{virtual-D8bn8LRN.cjs → virtual-B1MLgqnQ.cjs} +10 -2
  113. package/dist/{virtual-D-9vfvVY.mjs → virtual-B9imjOqe.mjs} +11 -3
  114. package/dist/virtual-B9imjOqe.mjs.map +1 -0
  115. package/dist/{vite-C6OXShid.cjs → vite-7nY8fpz4.cjs} +2 -2
  116. package/dist/{vite-BKmkglFo.mjs → vite-C5AaWEV1.mjs} +3 -3
  117. package/dist/{vite-BKmkglFo.mjs.map → vite-C5AaWEV1.mjs.map} +1 -1
  118. package/dist/vite.cjs +5 -5
  119. package/dist/vite.d.cts +2 -2
  120. package/dist/vite.d.mts +5 -5
  121. package/dist/vite.mjs +5 -5
  122. package/dist/{webpack-L3DT059U.cjs → webpack-DAKZgaMR.cjs} +1 -1
  123. package/dist/{webpack-DZvno7jS.mjs → webpack-L68CX5gk.mjs} +2 -2
  124. package/dist/{webpack-DZvno7jS.mjs.map → webpack-L68CX5gk.mjs.map} +1 -1
  125. package/dist/webpack.cjs +4 -4
  126. package/dist/webpack.d.cts +1 -1
  127. package/dist/webpack.d.mts +4 -4
  128. package/dist/webpack.mjs +4 -4
  129. package/dist/{index-TMfRNrCg.d.mts → write-file-DKA8GehT.d.cts} +35 -6
  130. package/dist/write-file-DKA8GehT.d.cts.map +1 -0
  131. package/package.json +28 -28
  132. package/dist/api-D1TJOJXE.mjs.map +0 -1
  133. package/dist/config-B76VxuFj.d.mts.map +0 -1
  134. package/dist/config-CY-rNoQX.d.cts.map +0 -1
  135. package/dist/index-TMfRNrCg.d.mts.map +0 -1
  136. package/dist/virtual-D-9vfvVY.mjs.map +0 -1
  137. package/dist/write-file-gkuvUoFn.d.cts.map +0 -1
@@ -4,8 +4,8 @@ import { a as UNPLUGIN_BUILDER_VARIANTS, i as PLUGIN_NON_HOOK_FIELDS } from "./p
4
4
  import { n as format, r as formatFolder, t as replacePathTokens } from "./paths-CS8ecCnW.mjs";
5
5
  import { c as DEFAULT_ENVIRONMENT, l as GLOBAL_ENVIRONMENT, n as ROOT_HASH_LENGTH, t as CACHE_HASH_LENGTH } from "./constants-cXxSHhNp.mjs";
6
6
  import { n as loadUserConfigFile, r as loadWorkspaceConfig } from "./config-D4Fh2gQL.mjs";
7
- import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-D-9vfvVY.mjs";
8
- import { a as getString, c as createLog, f as isTypeDefinition, g as resolveInputsSync, l as extendLog, s as getFileHeader, u as getUniqueInputs } from "./utils-RU0EjpzP.mjs";
7
+ import { a as getString, d as extendLog, f as getUniqueInputs, l as getTypescriptFileHeader, m as isTypeDefinition, u as createLog, v as resolveInputsSync } from "./utils-DoQcX7Sk.mjs";
8
+ import { n as FileSystemStorageAdapter, t as VirtualStorageAdapter } from "./virtual-B9imjOqe.mjs";
9
9
  import { getWorkspaceRoot, relativeToWorkspaceRoot } from "@stryke/fs/get-workspace-root";
10
10
  import { formatLogMessage } from "@storm-software/config-tools/logger/console";
11
11
  import { toArray } from "@stryke/convert/to-array";
@@ -70,7 +70,7 @@ import { setParseImpl } from "unplugin";
70
70
 
71
71
  //#region package.json
72
72
  var name = "powerlines";
73
- var version = "0.40.1";
73
+ var version = "0.40.3";
74
74
 
75
75
  //#endregion
76
76
  //#region src/_internal/helpers/generate-types.ts
@@ -1828,6 +1828,12 @@ var PowerlinesContext = class PowerlinesContext {
1828
1828
  return joinPaths$1(this.artifactsPath, "entry");
1829
1829
  }
1830
1830
  /**
1831
+ * Get the path to the infrastructure modules used by the project
1832
+ */
1833
+ get infrastructurePath() {
1834
+ return joinPaths$1(this.artifactsPath, "infrastructure");
1835
+ }
1836
+ /**
1831
1837
  * Get the path to the data directory for the project
1832
1838
  */
1833
1839
  get dataPath() {
@@ -2034,7 +2040,7 @@ var PowerlinesContext = class PowerlinesContext {
2034
2040
  if (alias) moduleId = alias.replacement;
2035
2041
  } else if (isSetObject(this.config.resolve.alias) && this.config.resolve.alias[id]) moduleId = this.config.resolve.alias[id];
2036
2042
  }
2037
- if (this.fs.isVirtual(moduleId)) {
2043
+ if (this.fs.isVirtual(moduleId) || importer && this.fs.isVirtual(importer)) {
2038
2044
  const result = await this.fs.resolve(moduleId, importer, {
2039
2045
  conditions: this.config.resolve.conditions,
2040
2046
  extensions: this.config.resolve.extensions,
@@ -2207,6 +2213,36 @@ var PowerlinesContext = class PowerlinesContext {
2207
2213
  } }));
2208
2214
  }
2209
2215
  /**
2216
+ * Resolves a builtin virtual file and writes it to the VFS if it does not already exist
2217
+ *
2218
+ * @param code - The source code of the builtin file
2219
+ * @param id - The unique identifier of the builtin file
2220
+ * @param options - Optional write file options
2221
+ */
2222
+ async emitInfrastructure(code, id, options = {}) {
2223
+ if (!this.infrastructurePath) throw new Error(`The infrastructure path is not set. Cannot emit infrastructure file with id "${id}".`);
2224
+ if (!isSetString(id)) throw new Error(`The infrastructure id must be a non-empty string. Received: ${String(id)}`);
2225
+ return this.emit(code, appendPath(id, this.infrastructurePath), defu(options, { meta: {
2226
+ type: "infrastructure",
2227
+ id
2228
+ } }));
2229
+ }
2230
+ /**
2231
+ * Synchronously resolves an infrastructure virtual file and writes it to the VFS if it does not already exist
2232
+ *
2233
+ * @param code - The source code of the infrastructure file
2234
+ * @param id - The unique identifier of the infrastructure file
2235
+ * @param options - Optional write file options
2236
+ */
2237
+ emitInfrastructureSync(code, id, options = {}) {
2238
+ if (!this.infrastructurePath) throw new Error(`The infrastructure path is not set. Cannot emit infrastructure file with id "${id}".`);
2239
+ if (!isSetString(id)) throw new Error(`The infrastructure id must be a non-empty string. Received: ${String(id)}`);
2240
+ return this.emitSync(code, appendPath(id, this.infrastructurePath), defu(options, { meta: {
2241
+ type: "infrastructure",
2242
+ id
2243
+ } }));
2244
+ }
2245
+ /**
2210
2246
  * Update the context using a new user configuration options
2211
2247
  *
2212
2248
  * @param userConfig - The new user configuration options.
@@ -2525,58 +2561,70 @@ function isUnpluginBuilderVariant(str) {
2525
2561
  function createUnpluginModuleResolutionFunctions(context, options = {}) {
2526
2562
  const ctx = context;
2527
2563
  let prefix = "";
2528
- if (options.prefix !== false) prefix = options.prefix ?? "\0";
2529
- async function resolveId(id, importer, opts = { isEntry: false }) {
2530
- let result = await ctx.$$internal.callHook("resolveId", {
2531
- sequential: true,
2532
- result: "first",
2533
- order: "pre"
2534
- }, id, importer, opts);
2535
- if (result) return result;
2536
- result = await ctx.$$internal.callHook("resolveId", {
2537
- sequential: true,
2538
- result: "first",
2539
- order: "normal"
2540
- }, id, importer, opts);
2541
- if (result) return result;
2542
- result = await ctx.resolve(id, importer, opts);
2543
- if (result) return result;
2544
- result = await ctx.$$internal.callHook("resolveId", {
2545
- sequential: true,
2546
- result: "first",
2547
- order: "post"
2548
- }, id, importer, opts);
2549
- if (isSetString(result)) return `${prefix}${result}`;
2550
- else if (isSetObject(result)) return {
2551
- ...result,
2552
- id: `${prefix}${result.id}`
2553
- };
2554
- return null;
2555
- }
2556
- async function load(id) {
2557
- let result = await ctx.$$internal.callHook("load", {
2558
- sequential: true,
2559
- result: "first",
2560
- order: "pre"
2561
- }, id);
2562
- if (result) return result;
2563
- result = await ctx.$$internal.callHook("load", {
2564
- sequential: true,
2565
- result: "first",
2566
- order: "normal"
2567
- }, id);
2568
- if (result) return result;
2569
- result = await ctx.load(id);
2570
- if (result) return result;
2571
- return ctx.$$internal.callHook("load", {
2572
- sequential: true,
2573
- result: "first",
2574
- order: "post"
2575
- }, id);
2576
- }
2564
+ if (options.prefix === true) prefix = "\0";
2565
+ else if (isSetString(options.prefix)) prefix = options.prefix;
2577
2566
  return {
2578
- resolveId,
2579
- load
2567
+ async resolveId(id, importer, opts = { isEntry: false }) {
2568
+ let result = await ctx.$$internal.callHook("resolveId", {
2569
+ sequential: true,
2570
+ result: "first",
2571
+ order: "pre"
2572
+ }, id, importer, opts);
2573
+ if (isSetString(result)) return `${prefix}${result}`;
2574
+ else if (isSetObject(result)) return {
2575
+ ...result,
2576
+ id: `${prefix}${result.id}`
2577
+ };
2578
+ result = await ctx.$$internal.callHook("resolveId", {
2579
+ sequential: true,
2580
+ result: "first",
2581
+ order: "normal"
2582
+ }, id, importer, opts);
2583
+ if (isSetString(result)) return `${prefix}${result}`;
2584
+ else if (isSetObject(result)) return {
2585
+ ...result,
2586
+ id: `${prefix}${result.id}`
2587
+ };
2588
+ result = await ctx.resolve(id, importer, opts);
2589
+ if (isSetString(result)) return `${prefix}${result}`;
2590
+ else if (isSetObject(result)) return {
2591
+ ...result,
2592
+ id: `${prefix}${result.id}`
2593
+ };
2594
+ result = await ctx.$$internal.callHook("resolveId", {
2595
+ sequential: true,
2596
+ result: "first",
2597
+ order: "post"
2598
+ }, id, importer, opts);
2599
+ if (isSetString(result)) return `${prefix}${result}`;
2600
+ else if (isSetObject(result)) return {
2601
+ ...result,
2602
+ id: `${prefix}${result.id}`
2603
+ };
2604
+ return null;
2605
+ },
2606
+ async load(id) {
2607
+ const moduleId = prefix ? id.replace(new RegExp(`^${prefix}*`, "g"), "") : id;
2608
+ let result = await ctx.$$internal.callHook("load", {
2609
+ sequential: true,
2610
+ result: "first",
2611
+ order: "pre"
2612
+ }, moduleId);
2613
+ if (result) return result;
2614
+ result = await ctx.$$internal.callHook("load", {
2615
+ sequential: true,
2616
+ result: "first",
2617
+ order: "normal"
2618
+ }, moduleId);
2619
+ if (result) return result;
2620
+ result = await ctx.load(moduleId);
2621
+ if (result) return result;
2622
+ return ctx.$$internal.callHook("load", {
2623
+ sequential: true,
2624
+ result: "first",
2625
+ order: "post"
2626
+ }, moduleId);
2627
+ }
2580
2628
  };
2581
2629
  }
2582
2630
 
@@ -3350,7 +3398,7 @@ var PowerlinesAPI = class PowerlinesAPI {
3350
3398
  }
3351
3399
  if (isSetString(types?.trim()) || directives.length > 0) await context.fs.write(context.dtsPath, `${directives.length > 0 ? `${directives.map((directive) => `/// <reference types="${directive}" />`).join("\n")}
3352
3400
 
3353
- ` : ""}${getFileHeader(context, {
3401
+ ` : ""}${getTypescriptFileHeader(context, {
3354
3402
  directive: null,
3355
3403
  prettierIgnore: false
3356
3404
  })}
@@ -3729,4 +3777,4 @@ Note: Please ensure the plugin package's default export is a class that extends
3729
3777
 
3730
3778
  //#endregion
3731
3779
  export { _capnpFileId as _, createUnpluginFactory as a, createUnpluginModuleResolutionFunctions as c, PowerlinesContext as d, FileId as f, FileSystem as g, FileStorage as h, createPluginContext as i, combineContexts as l, FileMetadata_KeyValuePair as m, PowerlinesAPIContext as n, createUnplugin as o, FileMetadata as p, PowerlinesEnvironmentContext as r, createUnpluginResolver as s, PowerlinesAPI as t, isUnpluginBuilderVariant as u, name as v, version as y };
3732
- //# sourceMappingURL=api-D1TJOJXE.mjs.map
3780
+ //# sourceMappingURL=api-C9xtrjcq.mjs.map