powerlines 0.19.4 → 0.20.0

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 (269) hide show
  1. package/dist/api.cjs +2 -2
  2. package/dist/api.d.cts +2 -2
  3. package/dist/api.d.ts +2 -2
  4. package/dist/api.js +1 -1
  5. package/dist/astro.cjs +8 -8
  6. package/dist/astro.d.cts +1 -1
  7. package/dist/astro.d.ts +1 -1
  8. package/dist/astro.js +5 -5
  9. package/dist/{chunk-JPWBN72J.js → chunk-24AZZCCW.js} +1 -1
  10. package/dist/{chunk-HI3LNK6Q.js → chunk-2KGMZZ36.js} +1 -1
  11. package/dist/{chunk-BHPTTRBA.js → chunk-2QGVOWKM.js} +16 -11
  12. package/dist/{chunk-AEJIVPUZ.js → chunk-4KCSCJ6E.js} +1 -1
  13. package/dist/{chunk-ULFJBFI7.cjs → chunk-6UVRB3IN.cjs} +3 -3
  14. package/dist/{chunk-RR7EC4RF.js → chunk-A2EZ3M22.js} +1 -1
  15. package/dist/{chunk-ZOUGUAQY.cjs → chunk-CTSV5JAF.cjs} +18 -13
  16. package/dist/{chunk-GFINPIIK.js → chunk-F4TS44KB.js} +3 -4
  17. package/dist/{chunk-I4LLZ5BI.js → chunk-FBMQTOMN.js} +1 -1
  18. package/dist/{chunk-PAJB5K7A.js → chunk-FYKDALJL.js} +3 -2
  19. package/dist/{chunk-MCDMY6GK.cjs → chunk-IHWRGHX6.cjs} +2 -2
  20. package/dist/{chunk-7HKTQSUG.cjs → chunk-IMMNZSFZ.cjs} +4 -3
  21. package/dist/{chunk-VICSRRKQ.js → chunk-JKF342AW.js} +2 -2
  22. package/dist/{chunk-LIXKMZW5.cjs → chunk-KL7HP7JM.cjs} +2 -2
  23. package/dist/{chunk-5PRY6OJM.cjs → chunk-LM6YBGC6.cjs} +2 -2
  24. package/dist/{chunk-KMELWYHW.cjs → chunk-MOH4CWHN.cjs} +3 -4
  25. package/dist/{chunk-YQZXG4X6.cjs → chunk-MZQXGWUK.cjs} +2 -2
  26. package/dist/{chunk-BSGWY4AP.cjs → chunk-OQNYDN5F.cjs} +2 -2
  27. package/dist/{chunk-X5LPEBDE.cjs → chunk-P3BP6LXC.cjs} +2 -2
  28. package/dist/{chunk-HEG6IAVR.js → chunk-QH3M5FBF.js} +1 -1
  29. package/dist/chunk-SECEPZQ3.cjs +32 -0
  30. package/dist/{chunk-GQM2JCO3.js → chunk-SIEHJFKB.js} +2 -2
  31. package/dist/{chunk-TK6CN2KT.cjs → chunk-T4AJOD6A.cjs} +4 -4
  32. package/dist/chunk-TY3QAXEY.js +105 -0
  33. package/dist/{chunk-OJSRHKHW.js → chunk-VSZXQLMI.js} +1 -1
  34. package/dist/{chunk-A3FMGMBV.cjs → chunk-VVFIZVYE.cjs} +2 -2
  35. package/dist/{chunk-Z63SQZUB.cjs → chunk-VXF37DA2.cjs} +4 -4
  36. package/dist/chunk-WE7PLY4H.cjs +111 -0
  37. package/dist/{chunk-MLAYLHZO.js → chunk-WRP6ANCC.js} +1 -1
  38. package/dist/chunk-XBS3AHAK.js +29 -0
  39. package/dist/config.d.cts +1 -1
  40. package/dist/config.d.ts +1 -1
  41. package/dist/esbuild.cjs +7 -7
  42. package/dist/esbuild.d.cts +1 -1
  43. package/dist/esbuild.d.ts +1 -1
  44. package/dist/esbuild.js +4 -4
  45. package/dist/farm.cjs +3 -3
  46. package/dist/farm.d.cts +1 -1
  47. package/dist/farm.d.ts +1 -1
  48. package/dist/farm.js +2 -2
  49. package/dist/{hooks-Bq2jUAKs.d.ts → hooks-BBZyf9CN.d.ts} +1 -1
  50. package/dist/{hooks-C6t50M6a.d.cts → hooks-CUxY7WKY.d.cts} +1 -1
  51. package/dist/index.cjs +18 -18
  52. package/dist/index.d.cts +2 -2
  53. package/dist/index.d.ts +2 -2
  54. package/dist/index.js +16 -16
  55. package/dist/lib/build/esbuild.cjs +4 -4
  56. package/dist/lib/build/esbuild.d.cts +3 -3
  57. package/dist/lib/build/esbuild.d.ts +3 -3
  58. package/dist/lib/build/esbuild.js +1 -1
  59. package/dist/lib/build/index.cjs +33 -33
  60. package/dist/lib/build/index.d.cts +3 -3
  61. package/dist/lib/build/index.d.ts +3 -3
  62. package/dist/lib/build/index.js +8 -8
  63. package/dist/lib/build/rolldown.cjs +3 -3
  64. package/dist/lib/build/rolldown.d.cts +1 -1
  65. package/dist/lib/build/rolldown.d.ts +1 -1
  66. package/dist/lib/build/rolldown.js +2 -2
  67. package/dist/lib/build/rollup.cjs +3 -3
  68. package/dist/lib/build/rollup.d.cts +1 -1
  69. package/dist/lib/build/rollup.d.ts +1 -1
  70. package/dist/lib/build/rollup.js +1 -1
  71. package/dist/lib/build/rspack.cjs +2 -2
  72. package/dist/lib/build/rspack.d.cts +1 -1
  73. package/dist/lib/build/rspack.d.ts +1 -1
  74. package/dist/lib/build/rspack.js +1 -1
  75. package/dist/lib/build/tsup.cjs +5 -5
  76. package/dist/lib/build/tsup.d.cts +1 -1
  77. package/dist/lib/build/tsup.d.ts +1 -1
  78. package/dist/lib/build/tsup.js +2 -2
  79. package/dist/lib/build/unbuild.cjs +5 -5
  80. package/dist/lib/build/unbuild.d.cts +2 -2
  81. package/dist/lib/build/unbuild.d.ts +2 -2
  82. package/dist/lib/build/unbuild.js +2 -2
  83. package/dist/lib/build/vite.cjs +4 -4
  84. package/dist/lib/build/vite.d.cts +1 -1
  85. package/dist/lib/build/vite.d.ts +1 -1
  86. package/dist/lib/build/vite.js +2 -2
  87. package/dist/lib/build/webpack.cjs +2 -2
  88. package/dist/lib/build/webpack.d.cts +1 -1
  89. package/dist/lib/build/webpack.d.ts +1 -1
  90. package/dist/lib/build/webpack.js +1 -1
  91. package/dist/lib/{chunk-7OHD3BD4.js → chunk-4QRL5CNE.js} +1 -5
  92. package/dist/lib/{chunk-5ASXKB2V.js → chunk-4RUHX7LV.js} +1 -1
  93. package/dist/lib/{chunk-KXCEN6Y4.js → chunk-5SP6QZLX.js} +1 -1
  94. package/dist/lib/{chunk-GBICSIXP.cjs → chunk-ARCFV3IJ.cjs} +7 -8
  95. package/dist/lib/{chunk-5EXW3ZRC.cjs → chunk-CLV4J4L7.cjs} +26 -4
  96. package/dist/lib/{chunk-ADKYAHF5.js → chunk-DFRWBQQT.js} +33 -12
  97. package/dist/lib/{chunk-F7IDAYLH.cjs → chunk-FGYAS4NB.cjs} +1 -5
  98. package/dist/lib/{chunk-MVSXEH4P.cjs → chunk-H7V7EPB2.cjs} +6 -9
  99. package/dist/lib/{chunk-LSZT4OD3.cjs → chunk-HIY6WOU3.cjs} +3 -3
  100. package/dist/lib/{chunk-ESNHFT4V.cjs → chunk-IBONIIAZ.cjs} +10 -10
  101. package/dist/lib/{chunk-47WZIAPZ.js → chunk-IXREPTHZ.js} +5 -8
  102. package/dist/lib/chunk-K4FER6YK.cjs +125 -0
  103. package/dist/lib/{chunk-LJ4WO7TW.cjs → chunk-MWA3DWY5.cjs} +36 -13
  104. package/dist/lib/{chunk-YKSKJTO3.js → chunk-NU4GDWLL.js} +2 -2
  105. package/dist/lib/{chunk-37W2ZDLA.cjs → chunk-O36FCQM6.cjs} +2 -2
  106. package/dist/lib/{chunk-ET5QBFGZ.cjs → chunk-O5LNKYQV.cjs} +2 -2
  107. package/dist/lib/{chunk-SYHVP3OW.js → chunk-OI2V6L7D.js} +24 -4
  108. package/dist/lib/{chunk-JB2JJXGW.js → chunk-S5F4DE65.js} +1 -1
  109. package/dist/lib/{chunk-N66R6SPI.js → chunk-TTKY3DR4.js} +7 -8
  110. package/dist/lib/{chunk-N2EGPL2L.js → chunk-WWNNBLU7.js} +9 -9
  111. package/dist/lib/{chunk-AOKLB4V2.cjs → chunk-Y2BHXV33.cjs} +1 -1
  112. package/dist/lib/chunk-ZJNDT3GX.js +117 -0
  113. package/dist/lib/{config-gWvjY0K0.d.ts → config-Bag1Ft7u.d.ts} +139 -53
  114. package/dist/lib/{config-B8PZKdIr.d.cts → config-DN8Ad0lv.d.cts} +139 -53
  115. package/dist/lib/config-file.d.cts +1 -1
  116. package/dist/lib/config-file.d.ts +1 -1
  117. package/dist/lib/create-program.d.cts +1 -1
  118. package/dist/lib/create-program.d.ts +1 -1
  119. package/dist/lib/entry.d.cts +1 -1
  120. package/dist/lib/entry.d.ts +1 -1
  121. package/dist/lib/{hooks-BL4stJLn.d.ts → hooks-BVnPAWgt.d.ts} +1 -1
  122. package/dist/lib/{hooks-DnWcaiLo.d.cts → hooks-H2P-7xA4.d.cts} +1 -1
  123. package/dist/lib/index.cjs +95 -95
  124. package/dist/lib/index.d.cts +2 -2
  125. package/dist/lib/index.d.ts +2 -2
  126. package/dist/lib/index.js +15 -15
  127. package/dist/lib/logger.d.cts +1 -1
  128. package/dist/lib/logger.d.ts +1 -1
  129. package/dist/lib/typescript/compiler-host.d.cts +1 -1
  130. package/dist/lib/typescript/compiler-host.d.ts +1 -1
  131. package/dist/lib/typescript/import-transformer.d.cts +1 -1
  132. package/dist/lib/typescript/import-transformer.d.ts +1 -1
  133. package/dist/lib/typescript/index.d.cts +1 -1
  134. package/dist/lib/typescript/index.d.ts +1 -1
  135. package/dist/lib/typescript/program.d.cts +1 -1
  136. package/dist/lib/typescript/program.d.ts +1 -1
  137. package/dist/lib/unplugin/factory.cjs +6 -6
  138. package/dist/lib/unplugin/factory.d.cts +2 -2
  139. package/dist/lib/unplugin/factory.d.ts +2 -2
  140. package/dist/lib/unplugin/factory.js +5 -5
  141. package/dist/lib/unplugin/index.cjs +10 -10
  142. package/dist/lib/unplugin/index.d.cts +2 -2
  143. package/dist/lib/unplugin/index.d.ts +2 -2
  144. package/dist/lib/unplugin/index.js +6 -6
  145. package/dist/lib/unplugin/plugin.cjs +3 -3
  146. package/dist/lib/unplugin/plugin.d.cts +1 -1
  147. package/dist/lib/unplugin/plugin.d.ts +1 -1
  148. package/dist/lib/unplugin/plugin.js +2 -2
  149. package/dist/lib/unplugin/resolve-id.d.cts +1 -1
  150. package/dist/lib/unplugin/resolve-id.d.ts +1 -1
  151. package/dist/lib/utilities/bundle.cjs +3 -3
  152. package/dist/lib/utilities/bundle.d.cts +1 -1
  153. package/dist/lib/utilities/bundle.d.ts +1 -1
  154. package/dist/lib/utilities/bundle.js +2 -2
  155. package/dist/lib/utilities/cache.d.cts +1 -1
  156. package/dist/lib/utilities/cache.d.ts +1 -1
  157. package/dist/lib/utilities/file-header.d.cts +1 -1
  158. package/dist/lib/utilities/file-header.d.ts +1 -1
  159. package/dist/lib/utilities/index.cjs +29 -29
  160. package/dist/lib/utilities/index.d.cts +1 -1
  161. package/dist/lib/utilities/index.d.ts +1 -1
  162. package/dist/lib/utilities/index.js +7 -7
  163. package/dist/lib/utilities/meta.d.cts +1 -1
  164. package/dist/lib/utilities/meta.d.ts +1 -1
  165. package/dist/lib/utilities/resolve-path.d.cts +1 -1
  166. package/dist/lib/utilities/resolve-path.d.ts +1 -1
  167. package/dist/lib/utilities/resolve.cjs +4 -4
  168. package/dist/lib/utilities/resolve.d.cts +1 -1
  169. package/dist/lib/utilities/resolve.d.ts +1 -1
  170. package/dist/lib/utilities/resolve.js +3 -3
  171. package/dist/lib/utilities/source-file.d.cts +1 -1
  172. package/dist/lib/utilities/source-file.d.ts +1 -1
  173. package/dist/lib/utilities/source-map.d.cts +1 -1
  174. package/dist/lib/utilities/source-map.d.ts +1 -1
  175. package/dist/lib/utilities/worker.d.cts +1 -1
  176. package/dist/lib/utilities/worker.d.ts +1 -1
  177. package/dist/lib/utilities/write-file.d.cts +1 -1
  178. package/dist/lib/utilities/write-file.d.ts +1 -1
  179. package/dist/next.cjs +7 -7
  180. package/dist/next.js +4 -4
  181. package/dist/nuxt.cjs +9 -9
  182. package/dist/nuxt.js +6 -6
  183. package/dist/plugin-utils/chunk-J33TXWF6.js +12 -0
  184. package/dist/plugin-utils/chunk-QP6OJWFG.cjs +14 -0
  185. package/dist/plugin-utils/{config-48EWGWXq.d.cts → config-pwKiZvzJ.d.cts} +138 -52
  186. package/dist/plugin-utils/{config-48EWGWXq.d.ts → config-pwKiZvzJ.d.ts} +138 -52
  187. package/dist/plugin-utils/enforce.d.cts +1 -1
  188. package/dist/plugin-utils/enforce.d.ts +1 -1
  189. package/dist/plugin-utils/extend.d.cts +1 -1
  190. package/dist/plugin-utils/extend.d.ts +1 -1
  191. package/dist/plugin-utils/get-config-path.d.cts +2 -2
  192. package/dist/plugin-utils/get-config-path.d.ts +2 -2
  193. package/dist/plugin-utils/helpers.d.cts +3 -3
  194. package/dist/plugin-utils/helpers.d.ts +3 -3
  195. package/dist/plugin-utils/index.cjs +2 -2
  196. package/dist/plugin-utils/index.d.cts +1 -1
  197. package/dist/plugin-utils/index.d.ts +1 -1
  198. package/dist/plugin-utils/index.js +1 -1
  199. package/dist/plugin-utils/merge.d.cts +1 -1
  200. package/dist/plugin-utils/merge.d.ts +1 -1
  201. package/dist/plugin-utils/paths.cjs +2 -2
  202. package/dist/plugin-utils/paths.d.cts +3 -2
  203. package/dist/plugin-utils/paths.d.ts +3 -2
  204. package/dist/plugin-utils/paths.js +1 -1
  205. package/dist/{resolved-J7a2Aeuk.d.ts → resolved-Sxyrlt6g.d.ts} +68 -52
  206. package/dist/{resolved-B41SbjnS.d.cts → resolved-ohMN-3VJ.d.cts} +68 -52
  207. package/dist/rolldown.cjs +6 -6
  208. package/dist/rolldown.d.cts +1 -1
  209. package/dist/rolldown.d.ts +1 -1
  210. package/dist/rolldown.js +3 -3
  211. package/dist/rollup.cjs +6 -6
  212. package/dist/rollup.d.cts +1 -1
  213. package/dist/rollup.d.ts +1 -1
  214. package/dist/rollup.js +3 -3
  215. package/dist/rspack.cjs +6 -6
  216. package/dist/rspack.d.cts +1 -1
  217. package/dist/rspack.d.ts +1 -1
  218. package/dist/rspack.js +3 -3
  219. package/dist/tsup.cjs +8 -8
  220. package/dist/tsup.js +5 -5
  221. package/dist/types/babel.d.cts +1 -1
  222. package/dist/types/babel.d.ts +1 -1
  223. package/dist/types/build.d.cts +76 -6
  224. package/dist/types/build.d.ts +76 -6
  225. package/dist/types/commands.d.cts +1 -1
  226. package/dist/types/commands.d.ts +1 -1
  227. package/dist/types/config.d.cts +1 -1
  228. package/dist/types/config.d.ts +1 -1
  229. package/dist/types/context.d.cts +2 -2
  230. package/dist/types/context.d.ts +2 -2
  231. package/dist/types/hooks.d.cts +1 -1
  232. package/dist/types/hooks.d.ts +1 -1
  233. package/dist/types/index.d.cts +1 -1
  234. package/dist/types/index.d.ts +1 -1
  235. package/dist/types/internal.d.cts +2 -2
  236. package/dist/types/internal.d.ts +2 -2
  237. package/dist/types/plugin.d.cts +1 -1
  238. package/dist/types/plugin.d.ts +1 -1
  239. package/dist/types/resolved.d.cts +1 -1
  240. package/dist/types/resolved.d.ts +1 -1
  241. package/dist/types/unplugin.d.cts +1 -1
  242. package/dist/types/unplugin.d.ts +1 -1
  243. package/dist/unloader.cjs +6 -6
  244. package/dist/unloader.d.cts +3 -3
  245. package/dist/unloader.d.ts +3 -3
  246. package/dist/unloader.js +3 -3
  247. package/dist/unplugin.cjs +18 -18
  248. package/dist/unplugin.d.cts +4 -4
  249. package/dist/unplugin.d.ts +4 -4
  250. package/dist/unplugin.js +15 -15
  251. package/dist/vite.cjs +7 -7
  252. package/dist/vite.d.cts +1 -1
  253. package/dist/vite.d.ts +1 -1
  254. package/dist/vite.js +4 -4
  255. package/dist/webpack.cjs +6 -6
  256. package/dist/webpack.d.cts +1 -1
  257. package/dist/webpack.d.ts +1 -1
  258. package/dist/webpack.js +3 -3
  259. package/package.json +14 -12
  260. package/dist/chunk-CWCEYGLM.js +0 -43
  261. package/dist/chunk-F5NKLRZD.cjs +0 -49
  262. package/dist/chunk-RDMLGFIT.js +0 -29
  263. package/dist/chunk-XDLLDHRY.cjs +0 -32
  264. package/dist/lib/chunk-POOHWK7C.cjs +0 -63
  265. package/dist/lib/chunk-VLHOYZG2.js +0 -55
  266. package/dist/plugin-utils/chunk-2HFS2OOG.cjs +0 -14
  267. package/dist/plugin-utils/chunk-CVZA2RT3.js +0 -12
  268. package/dist/lib/{chunk-QJZZF22Y.js → chunk-7Y5MJRWF.js} +1 -1
  269. package/dist/lib/{chunk-MLILHOLG.cjs → chunk-UDJ37BEE.cjs} +1 -1
@@ -21,7 +21,7 @@ import { Jiti } from 'jiti';
21
21
  import MagicString, { SourceMap } from 'magic-string';
22
22
  import { ParserOptions, ParseResult } from 'oxc-parser';
23
23
  import { Range } from 'semver';
24
- import { TransformResult as TransformResult$1, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginBuildContext, UnpluginMessage } from 'unplugin';
24
+ import { TransformResult as TransformResult$1, ExternalIdResult, HookFilter, UnpluginOptions, UnpluginContext, UnpluginMessage, UnpluginBuildContext } from 'unplugin';
25
25
  import { ArrayValues } from '@stryke/types/array';
26
26
  import { P as ParsedTypeScriptConfig, T as TSConfig } from './tsconfig-Bz-CiFqD.cjs';
27
27
  import { PrimitiveJsonValue } from '@stryke/json/types';
@@ -39,6 +39,73 @@ interface BuildConfig {
39
39
  * @defaultValue "neutral"
40
40
  */
41
41
  platform?: "node" | "browser" | "neutral";
42
+ /**
43
+ * Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
44
+ *
45
+ * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
46
+ */
47
+ mainFields?: string[];
48
+ /**
49
+ * Array of strings indicating what conditions should be used for module resolution.
50
+ */
51
+ conditions?: string[];
52
+ /**
53
+ * Array of strings indicating what file extensions should be used for module resolution.
54
+ *
55
+ * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
56
+ */
57
+ extensions?: string[];
58
+ /**
59
+ * Array of strings indicating what modules should be deduplicated to a single version in the build.
60
+ *
61
+ * @remarks
62
+ * This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
63
+ */
64
+ dedupe?: string[];
65
+ /**
66
+ * Array of strings or regular expressions that indicate what modules are builtin for the environment.
67
+ */
68
+ builtins?: (string | RegExp)[];
69
+ /**
70
+ * Define global variable replacements.
71
+ *
72
+ * @remarks
73
+ * This option allows you to specify global constants that will be replaced in the code during the build process. It is similar to the `define` option in esbuild and Vite, enabling you to replace specific identifiers with constant expressions at build time.
74
+ *
75
+ * @example
76
+ * ```ts
77
+ * {
78
+ * define: {
79
+ * __VERSION__: '"1.0.0"',
80
+ * __DEV__: 'process.env.NODE_ENV !== "production"'
81
+ * }
82
+ * }
83
+ * ```
84
+ *
85
+ * @see https://esbuild.github.io/api/#define
86
+ * @see https://vitejs.dev/config/build-options.html#define
87
+ * @see https://github.com/rollup/plugins/tree/master/packages/replace
88
+ */
89
+ define?: Record<string, any>;
90
+ /**
91
+ * Global variables that will have import statements injected where necessary
92
+ *
93
+ * @remarks
94
+ * This option allows you to specify global variables that should be automatically imported from specified modules whenever they are used in the code. This is particularly useful for polyfilling Node.js globals in a browser environment.
95
+ *
96
+ * @example
97
+ * ```ts
98
+ * {
99
+ * inject: {
100
+ * process: 'process/browser',
101
+ * Buffer: ['buffer', 'Buffer'],
102
+ * }
103
+ * }
104
+ * ```
105
+ *
106
+ * @see https://github.com/rollup/plugins/tree/master/packages/inject
107
+ */
108
+ inject?: Record<string, string | string[]>;
42
109
  /**
43
110
  * The alias mappings to use for module resolution during the build process.
44
111
  *
@@ -54,6 +121,8 @@ interface BuildConfig {
54
121
  * }
55
122
  * }
56
123
  * ```
124
+ *
125
+ * @see https://github.com/rollup/plugins/tree/master/packages/alias
57
126
  */
58
127
  alias?: Record<string, string>;
59
128
  /**
@@ -72,15 +141,16 @@ interface BuildConfig {
72
141
  */
73
142
  skipNodeModulesBundle?: boolean;
74
143
  /**
75
- * Should the Powerlines processes skip the `"prepare"` task prior to building?
144
+ * An optional set of override options to apply to the selected build variant.
76
145
  *
77
- * @defaultValue false
146
+ * @remarks
147
+ * This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
78
148
  */
79
- skipPrepare?: boolean;
149
+ override?: Record<string, any>;
80
150
  }
81
- type BuildResolvedConfig = BuildConfig;
82
- type ESBuildBuildConfig = Omit<BuildOptions, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
83
- type ESBuildResolvedBuildConfig = BuildOptions & BuildResolvedConfig;
151
+ type BuildResolvedConfig = Omit<BuildConfig, "override">;
152
+ type ESBuildBuildConfig = Omit<BuildOptions, "entryPoints" | "sourceRoot" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel"> & BuildConfig;
153
+ type ESBuildResolvedBuildConfig = Omit<BuildOptions, "inject"> & BuildResolvedConfig;
84
154
  type ViteBuildConfig = Omit<UserConfig$1, "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw" | "environments" | "output"> & BuildConfig;
85
155
  type ViteResolvedBuildConfig = UserConfig$1 & BuildResolvedConfig;
86
156
  type WebpackBuildConfig = Omit<Configuration, "name" | "entry" | "entryPoints" | "tsconfig" | "tsconfigRaw"> & BuildConfig;
@@ -117,7 +187,7 @@ interface ResolvedEntryTypeDefinition extends TypeDefinition {
117
187
  */
118
188
  output?: string;
119
189
  }
120
- type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview" | "mainFields" | "extensions"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr" | "mainFields" | "extensions">> & {
190
+ type EnvironmentResolvedConfig = Omit<EnvironmentConfig, "consumer" | "mode" | "ssr" | "preview"> & Required<Pick<EnvironmentConfig, "consumer" | "mode" | "ssr">> & {
121
191
  /**
122
192
  * The name of the environment
123
193
  */
@@ -134,7 +204,7 @@ type OutputResolvedConfig = Required<Omit<OutputConfig, "assets"> & {
134
204
  /**
135
205
  * The resolved options for the Powerlines project configuration.
136
206
  */
137
- type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "override" | "root" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "override" | "framework">> & {
207
+ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "platform" | "tsconfig" | "lint" | "test" | "build" | "transform" | "variant" | "type" | "output" | "logLevel" | "framework"> & Required<Pick<TUserConfig, "name" | "title" | "plugins" | "mode" | "environments" | "tsconfig" | "lint" | "test" | "build" | "transform" | "framework">> & {
138
208
  /**
139
209
  * The configuration options that were provided inline to the Powerlines CLI.
140
210
  */
@@ -165,6 +235,13 @@ type ResolvedConfig<TUserConfig extends UserConfig = UserConfig> = Omit<TUserCon
165
235
  * The output configuration options to use for the build process
166
236
  */
167
237
  output: OutputResolvedConfig;
238
+ /**
239
+ * Configuration provided to build processes
240
+ *
241
+ * @remarks
242
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
243
+ */
244
+ build: Omit<TUserConfig["build"], "override"> & Required<Pick<Required<TUserConfig["build"]>, "override">>;
168
245
  /**
169
246
  * The log level to use for the Powerlines processes.
170
247
  *
@@ -205,6 +282,10 @@ interface GenerateTypesResult {
205
282
  directives?: string[];
206
283
  code: string;
207
284
  }
285
+ type DeepPartial<T> = {
286
+ [K in keyof T]?: DeepPartial<T[K]>;
287
+ };
288
+ type ConfigResult<TContext extends PluginContext = PluginContext> = DeepPartial<TContext["config"]> & Record<string, any>;
208
289
  interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext> extends Record<CommandType, (this: TContext) => MaybePromise<void>> {
209
290
  /**
210
291
  * A function that returns configuration options to be merged with the build context's options.
@@ -220,7 +301,7 @@ interface BasePluginHookFunctions<TContext extends PluginContext = PluginContext
220
301
  * @param config - The partial configuration object to be modified.
221
302
  * @returns A promise that resolves to a partial configuration object.
222
303
  */
223
- config: (this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>;
304
+ config: (this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>;
224
305
  /**
225
306
  * Modify environment configs before it's resolved. The hook can either mutate the passed-in environment config directly, or return a partial config object that will be deeply merged into existing config.
226
307
  *
@@ -328,7 +409,7 @@ type PluginHooks<TContext extends PluginContext = PluginContext> = {
328
409
  * @param config - The partial configuration object to be modified.
329
410
  * @returns A promise that resolves to a partial configuration object.
330
411
  */
331
- config: PluginHook<(this: Context<TContext["config"]>) => MaybePromise<Partial<TContext["config"]["userConfig"]>>> | Partial<TContext["config"]["userConfig"]>;
412
+ config: PluginHook<(this: UnresolvedContext<TContext["config"]>) => MaybePromise<ConfigResult<TContext>>> | ConfigResult<TContext>;
332
413
  /**
333
414
  * A hook that is called to transform the source code.
334
415
  *
@@ -902,7 +983,13 @@ interface InitContextOptions {
902
983
  */
903
984
  isHighPriority: boolean;
904
985
  }
905
- interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
986
+ /**
987
+ * The unresolved Powerlines context.
988
+ *
989
+ * @remarks
990
+ * This context is used before the user configuration has been fully resolved after the `config`.
991
+ */
992
+ interface UnresolvedContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
906
993
  /**
907
994
  * The Storm workspace configuration
908
995
  */
@@ -910,7 +997,10 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
910
997
  /**
911
998
  * An object containing the options provided to Powerlines
912
999
  */
913
- config: TResolvedConfig;
1000
+ config: Omit<TResolvedConfig["userConfig"], "build" | "output"> & Required<Pick<TResolvedConfig["userConfig"], "build" | "output">> & {
1001
+ projectRoot: NonUndefined<TResolvedConfig["userConfig"]["root"]>;
1002
+ output: TResolvedConfig["output"];
1003
+ };
914
1004
  /**
915
1005
  * A logging function for the Powerlines engine
916
1006
  */
@@ -1067,6 +1157,12 @@ interface Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> {
1067
1157
  */
1068
1158
  extendLog: (name: string) => LogFn;
1069
1159
  }
1160
+ type Context<TResolvedConfig extends ResolvedConfig = ResolvedConfig> = Omit<UnresolvedContext<TResolvedConfig>, "config"> & {
1161
+ /**
1162
+ * The fully resolved Powerlines configuration
1163
+ */
1164
+ config: TResolvedConfig;
1165
+ };
1070
1166
  interface APIContext<TResolvedConfig extends ResolvedConfig = ResolvedConfig> extends Context<TResolvedConfig> {
1071
1167
  /**
1072
1168
  * The expected plugins options for the Powerlines project.
@@ -1301,24 +1397,33 @@ interface BaseConfig {
1301
1397
  * The entry point(s) for the application
1302
1398
  */
1303
1399
  entry?: TypeDefinitionParameter | TypeDefinitionParameter[];
1400
+ /**
1401
+ * Configuration for the output of the build process
1402
+ */
1403
+ output?: OutputConfig;
1304
1404
  /**
1305
1405
  * Configuration for linting the source code
1406
+ *
1407
+ * @remarks
1408
+ * If set to `false`, linting will be disabled.
1306
1409
  */
1307
1410
  lint?: Record<string, any> | false;
1308
1411
  /**
1309
1412
  * Configuration for testing the source code
1413
+ *
1414
+ * @remarks
1415
+ * If set to `false`, testing will be disabled.
1310
1416
  */
1311
1417
  test?: Record<string, any> | false;
1312
- /**
1313
- * Configuration for the output of the build process
1314
- */
1315
- output?: OutputConfig;
1316
1418
  /**
1317
1419
  * Configuration for the transformation of the source code
1318
1420
  */
1319
1421
  transform?: Record<string, any>;
1320
1422
  /**
1321
- * Options to to provide to the build process
1423
+ * Configuration provided to build processes
1424
+ *
1425
+ * @remarks
1426
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
1322
1427
  */
1323
1428
  build?: BuildConfig;
1324
1429
  /**
@@ -1348,37 +1453,6 @@ interface BaseConfig {
1348
1453
  tsconfigRaw?: TSConfig;
1349
1454
  }
1350
1455
  interface EnvironmentConfig extends BaseConfig {
1351
- /**
1352
- * Array of strings indicating the order in which fields in a package.json file should be resolved to determine the entry point for a module.
1353
- *
1354
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
1355
- */
1356
- mainFields?: string[];
1357
- /**
1358
- * Array of strings indicating what conditions should be used for module resolution.
1359
- */
1360
- conditions?: string[];
1361
- /**
1362
- * Array of strings indicating what conditions should be used for external modules.
1363
- */
1364
- externalConditions?: string[];
1365
- /**
1366
- * Array of strings indicating what file extensions should be used for module resolution.
1367
- *
1368
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
1369
- */
1370
- extensions?: string[];
1371
- /**
1372
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
1373
- *
1374
- * @remarks
1375
- * This option is useful for ensuring that only one version of a module is included in the bundle, which can help reduce bundle size and avoid conflicts.
1376
- */
1377
- dedupe?: string[];
1378
- /**
1379
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
1380
- */
1381
- builtins?: (string | RegExp)[];
1382
1456
  /**
1383
1457
  * Configuration options for the preview server
1384
1458
  */
@@ -1451,14 +1525,26 @@ interface CommonUserConfig extends BaseConfig {
1451
1525
  */
1452
1526
  framework?: string;
1453
1527
  }
1454
- type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = CommonUserConfig & {
1455
- build?: TBuildConfig & {
1528
+ type UserConfig<TBuildConfig extends BuildConfig = BuildConfig, TBuildResolvedConfig extends BuildResolvedConfig = BuildResolvedConfig, TBuildVariant extends string = any> = Omit<CommonUserConfig, "build"> & {
1529
+ /**
1530
+ * Configuration provided to build processes
1531
+ *
1532
+ * @remarks
1533
+ * This configuration can be used by plugins during the `build` command. It will generally contain options specific to the selected {@link BuildVariant | build variant}.
1534
+ */
1535
+ build: Omit<TBuildConfig, "override"> & {
1456
1536
  /**
1457
1537
  * The build variant being used by the Powerlines engine.
1458
1538
  */
1459
1539
  variant?: TBuildVariant;
1540
+ /**
1541
+ * An optional set of override options to apply to the selected build variant.
1542
+ *
1543
+ * @remarks
1544
+ * This option allows you to provide configuration options with the guarantee that they will **not** be overridden and will take precedence over other build configurations.
1545
+ */
1546
+ override?: Partial<TBuildResolvedConfig>;
1460
1547
  };
1461
- override?: Partial<TBuildResolvedConfig>;
1462
1548
  };
1463
1549
  type WebpackUserConfig = UserConfig<WebpackBuildConfig, WebpackResolvedBuildConfig, "webpack">;
1464
1550
  type RspackUserConfig = UserConfig<RspackBuildConfig, RspackResolvedBuildConfig, "rspack">;
@@ -1539,4 +1625,4 @@ type ReleaseInlineConfig<TUserConfig extends UserConfig = UserConfig> = InlineCo
1539
1625
  command: "release";
1540
1626
  };
1541
1627
 
1542
- export type { APIContext as A, BuildVariant as B, Context as C, DocsInlineConfig as D, ESBuildResolvedBuildConfig as E, HookKeys as H, InferHookParameters as I, LogFn as L, MetaInfo as M, NewInlineConfig as N, PowerlinesCommand as P, ResolvedEntryTypeDefinition as R, SourceFile as S, TransformResult as T, UnbuildBuildConfig as U, ViteResolvedBuildConfig as V, WorkspaceConfig as W, ParsedUserConfig as a, WorkerProcess as b, RolldownResolvedBuildConfig as c, RollupResolvedBuildConfig as d, TsupBuildConfig as e, TsupResolvedBuildConfig as f, PluginContext as g, SelectHooksOptions as h, ResolvedConfig as i, EnvironmentContext as j, InferHookReturnType as k, UnbuildResolvedBuildConfig as l, InferUnpluginVariant as m, BuildPlugin as n, InferResolvedConfig as o, UnpluginBuildVariant as p, InferUserConfig as q, InitialUserConfig as r, PrepareInlineConfig as s, CleanInlineConfig as t, BuildInlineConfig as u, LintInlineConfig as v, ReleaseInlineConfig as w };
1628
+ export type { APIContext as A, BuildVariant as B, Context as C, DocsInlineConfig as D, ESBuildResolvedBuildConfig as E, HookKeys as H, InferHookParameters as I, LogFn as L, MetaInfo as M, NewInlineConfig as N, PowerlinesCommand as P, ResolvedEntryTypeDefinition as R, SelectHooksOptions as S, TsupBuildConfig as T, UnbuildBuildConfig as U, ViteResolvedBuildConfig as V, WorkspaceConfig as W, ParsedUserConfig as a, RolldownResolvedBuildConfig as b, RollupResolvedBuildConfig as c, TsupResolvedBuildConfig as d, PluginContext as e, SourceFile as f, TransformResult as g, WorkerProcess as h, ResolvedConfig as i, EnvironmentContext as j, InferHookReturnType as k, UnbuildResolvedBuildConfig as l, InferUnpluginVariant as m, BuildPlugin as n, InferResolvedConfig as o, UnpluginBuildVariant as p, InferUserConfig as q, InitialUserConfig as r, PrepareInlineConfig as s, CleanInlineConfig as t, BuildInlineConfig as u, LintInlineConfig as v, ReleaseInlineConfig as w };
@@ -1,5 +1,5 @@
1
1
  import { Jiti } from 'jiti';
2
- import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-B8PZKdIr.cjs';
2
+ import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-DN8Ad0lv.cjs';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,5 +1,5 @@
1
1
  import { Jiti } from 'jiti';
2
- import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-gWvjY0K0.js';
2
+ import { C as Context, W as WorkspaceConfig, P as PowerlinesCommand, a as ParsedUserConfig } from './config-Bag1Ft7u.js';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,5 +1,5 @@
1
1
  import { Project } from 'ts-morph';
2
- import { C as Context } from './config-B8PZKdIr.cjs';
2
+ import { C as Context } from './config-DN8Ad0lv.cjs';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,5 +1,5 @@
1
1
  import { Project } from 'ts-morph';
2
- import { C as Context } from './config-gWvjY0K0.js';
2
+ import { C as Context } from './config-Bag1Ft7u.js';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,5 +1,5 @@
1
1
  import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configuration';
2
- import { C as Context, R as ResolvedEntryTypeDefinition } from './config-B8PZKdIr.cjs';
2
+ import { C as Context, R as ResolvedEntryTypeDefinition } from './config-DN8Ad0lv.cjs';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,5 +1,5 @@
1
1
  import { TypeDefinition, TypeDefinitionParameter } from '@stryke/types/configuration';
2
- import { C as Context, R as ResolvedEntryTypeDefinition } from './config-gWvjY0K0.js';
2
+ import { C as Context, R as ResolvedEntryTypeDefinition } from './config-Bag1Ft7u.js';
3
3
  import '@storm-software/build-tools/types';
4
4
  import '@storm-software/config-tools/types';
5
5
  import '@storm-software/config/types';
@@ -1,4 +1,4 @@
1
- import { h as SelectHooksOptions } from './config-gWvjY0K0.js';
1
+ import { S as SelectHooksOptions } from './config-Bag1Ft7u.js';
2
2
 
3
3
  type CallHookOptions = SelectHooksOptions & ({
4
4
  /**
@@ -1,4 +1,4 @@
1
- import { h as SelectHooksOptions } from './config-B8PZKdIr.cjs';
1
+ import { S as SelectHooksOptions } from './config-DN8Ad0lv.cjs';
2
2
 
3
3
  type CallHookOptions = SelectHooksOptions & ({
4
4
  /**