@powerlines/plugin-env 0.14.4 → 0.14.6

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 (230) hide show
  1. package/dist/{_virtual/rolldown_runtime.mjs → chunk-D1UamjDs.mjs} +1 -1
  2. package/dist/components/docs.cjs +1 -1
  3. package/dist/components/docs.d.cts +1 -8
  4. package/dist/components/docs.d.mts +1 -8
  5. package/dist/components/docs.mjs +1 -1
  6. package/dist/components/env.cjs +1 -34
  7. package/dist/components/env.d.cts +1 -19
  8. package/dist/components/env.d.mts +1 -19
  9. package/dist/components/env.mjs +1 -31
  10. package/dist/components/index.cjs +1 -1
  11. package/dist/components/index.d.cts +3 -2
  12. package/dist/components/index.d.mts +3 -2
  13. package/dist/components/index.mjs +1 -1
  14. package/dist/components-ByVHjWXF.mjs +1 -0
  15. package/dist/components-C9bYrQVK.cjs +0 -0
  16. package/dist/create-reflection-resource-BtYlphp1.mjs +17 -0
  17. package/dist/create-reflection-resource-CdrQyUuT.cjs +17 -0
  18. package/dist/docs-CKCRAUnO.d.mts +9 -0
  19. package/dist/docs-CMoOO30q.mjs +1 -0
  20. package/dist/docs-CdtUw4WA.d.cts +9 -0
  21. package/dist/docs-DWXbRrEK.cjs +1 -0
  22. package/dist/env-Bwys2dqb.mjs +31 -0
  23. package/dist/env-COWzTupf.d.cts +20 -0
  24. package/dist/env-DqPOEUEu.d.mts +20 -0
  25. package/dist/env-mhFQyGk4.cjs +34 -0
  26. package/dist/index-B_e8BwCm.d.cts +1 -0
  27. package/dist/index-CW2WHUXP.d.mts +1 -0
  28. package/dist/index-DCQ5Y2ED.d.mts +1 -0
  29. package/dist/index-DWPDThxu.d.cts +1 -0
  30. package/dist/index.cjs +8 -4
  31. package/dist/index.d.cts +185 -12
  32. package/dist/index.d.mts +185 -17
  33. package/dist/index.mjs +8 -4
  34. package/dist/{deepkit/schemas/reflection.d.mts → plugin-CuDS8_K8.d.mts} +261 -1
  35. package/dist/plugin-CyRU_Pln.mjs +1 -0
  36. package/dist/plugin-D5qyQPqC.cjs +0 -0
  37. package/dist/{deepkit/schemas/reflection.d.cts → plugin-vBgCrEuY.d.cts} +260 -1
  38. package/dist/runtime-Bisl_1Ja.cjs +0 -0
  39. package/dist/runtime-CRLPiOqf.d.mts +2499 -0
  40. package/dist/runtime-g_eXGBBi.mjs +1 -0
  41. package/dist/runtime-rhT2IfSg.d.cts +2497 -0
  42. package/dist/types/index.cjs +1 -0
  43. package/dist/types/index.d.cts +3 -2
  44. package/dist/types/index.d.mts +3 -2
  45. package/dist/types/index.mjs +1 -1
  46. package/dist/types/plugin.cjs +1 -0
  47. package/dist/types/plugin.d.cts +2 -148
  48. package/dist/types/plugin.d.mts +2 -149
  49. package/dist/types/plugin.mjs +1 -1
  50. package/dist/types/runtime.cjs +1 -0
  51. package/dist/types/runtime.d.cts +1 -793
  52. package/dist/types/runtime.d.mts +1 -793
  53. package/dist/types/runtime.mjs +1 -1
  54. package/dist/types-DMh7K7VC.mjs +1 -0
  55. package/dist/types-MYBaygjr.cjs +0 -0
  56. package/package.json +10 -8
  57. package/dist/_virtual/rolldown_runtime.cjs +0 -1
  58. package/dist/alloy/src/core/components/output.cjs +0 -1
  59. package/dist/alloy/src/core/components/output.mjs +0 -1
  60. package/dist/alloy/src/core/components/single-line-comment.cjs +0 -1
  61. package/dist/alloy/src/core/components/single-line-comment.mjs +0 -1
  62. package/dist/alloy/src/core/components/source-file.cjs +0 -1
  63. package/dist/alloy/src/core/components/source-file.d.cts +0 -22
  64. package/dist/alloy/src/core/components/source-file.d.mts +0 -22
  65. package/dist/alloy/src/core/components/source-file.mjs +0 -1
  66. package/dist/alloy/src/core/contexts/context.cjs +0 -1
  67. package/dist/alloy/src/core/contexts/context.mjs +0 -1
  68. package/dist/alloy/src/core/contexts/reflection.cjs +0 -1
  69. package/dist/alloy/src/core/contexts/reflection.mjs +0 -1
  70. package/dist/alloy/src/create-plugin.cjs +0 -2
  71. package/dist/alloy/src/create-plugin.mjs +0 -2
  72. package/dist/alloy/src/helpers/refkey.cjs +0 -1
  73. package/dist/alloy/src/helpers/refkey.mjs +0 -1
  74. package/dist/alloy/src/markdown/components/markdown-file.cjs +0 -1
  75. package/dist/alloy/src/markdown/components/markdown-file.mjs +0 -1
  76. package/dist/alloy/src/markdown/components/markdown-table.cjs +0 -1
  77. package/dist/alloy/src/markdown/components/markdown-table.mjs +0 -1
  78. package/dist/alloy/src/markdown/contexts/markdown-table.cjs +0 -1
  79. package/dist/alloy/src/markdown/contexts/markdown-table.mjs +0 -1
  80. package/dist/alloy/src/types/components.d.cts +0 -19
  81. package/dist/alloy/src/types/components.d.mts +0 -23
  82. package/dist/alloy/src/typescript/components/builtin-file.cjs +0 -1
  83. package/dist/alloy/src/typescript/components/builtin-file.d.cts +0 -25
  84. package/dist/alloy/src/typescript/components/builtin-file.d.mts +0 -26
  85. package/dist/alloy/src/typescript/components/builtin-file.mjs +0 -1
  86. package/dist/alloy/src/typescript/components/tsdoc-reflection.cjs +0 -1
  87. package/dist/alloy/src/typescript/components/tsdoc-reflection.mjs +0 -1
  88. package/dist/alloy/src/typescript/components/tsdoc.cjs +0 -1
  89. package/dist/alloy/src/typescript/components/tsdoc.d.cts +0 -27
  90. package/dist/alloy/src/typescript/components/tsdoc.d.mts +0 -28
  91. package/dist/alloy/src/typescript/components/tsdoc.mjs +0 -1
  92. package/dist/alloy/src/typescript/components/typescript-file.cjs +0 -1
  93. package/dist/alloy/src/typescript/components/typescript-file.d.cts +0 -14
  94. package/dist/alloy/src/typescript/components/typescript-file.d.mts +0 -15
  95. package/dist/alloy/src/typescript/components/typescript-file.mjs +0 -1
  96. package/dist/alloy/src/typescript/components/typescript-interface.cjs +0 -1
  97. package/dist/alloy/src/typescript/components/typescript-interface.d.cts +0 -11
  98. package/dist/alloy/src/typescript/components/typescript-interface.d.mts +0 -12
  99. package/dist/alloy/src/typescript/components/typescript-interface.mjs +0 -1
  100. package/dist/alloy/src/typescript/components/typescript-object.cjs +0 -1
  101. package/dist/alloy/src/typescript/components/typescript-object.mjs +0 -1
  102. package/dist/babel/index.cjs +0 -1
  103. package/dist/babel/index.d.cts +0 -2
  104. package/dist/babel/index.d.mts +0 -2
  105. package/dist/babel/index.mjs +0 -1
  106. package/dist/babel/plugin.cjs +0 -5
  107. package/dist/babel/plugin.d.cts +0 -7
  108. package/dist/babel/plugin.d.mts +0 -9
  109. package/dist/babel/plugin.mjs +0 -5
  110. package/dist/deepkit/schemas/reflection.cjs +0 -1
  111. package/dist/deepkit/schemas/reflection.mjs +0 -1
  112. package/dist/deepkit/schemas/reflection2.cjs +0 -1
  113. package/dist/deepkit/schemas/reflection2.mjs +0 -1
  114. package/dist/deepkit/src/capnp.cjs +0 -1
  115. package/dist/deepkit/src/capnp.mjs +0 -1
  116. package/dist/deepkit/src/esbuild-plugin.cjs +0 -4
  117. package/dist/deepkit/src/esbuild-plugin.mjs +0 -4
  118. package/dist/deepkit/src/reflect-type.cjs +0 -1
  119. package/dist/deepkit/src/reflect-type.mjs +0 -1
  120. package/dist/deepkit/src/resolve-reflections.cjs +0 -1
  121. package/dist/deepkit/src/resolve-reflections.mjs +0 -1
  122. package/dist/deepkit/src/transformer.cjs +0 -1
  123. package/dist/deepkit/src/transformer.mjs +0 -1
  124. package/dist/deepkit/src/transpile.cjs +0 -1
  125. package/dist/deepkit/src/transpile.mjs +0 -1
  126. package/dist/deepkit/src/types.d.cts +0 -10
  127. package/dist/deepkit/src/types.d.mts +0 -10
  128. package/dist/deepkit/src/utilities.cjs +0 -1
  129. package/dist/deepkit/src/utilities.mjs +0 -1
  130. package/dist/deepkit/src/vendor/type-compiler/index.cjs +0 -1
  131. package/dist/deepkit/src/vendor/type-compiler/index.mjs +0 -1
  132. package/dist/deepkit/src/vendor/type.cjs +0 -1
  133. package/dist/deepkit/src/vendor/type.d.cts +0 -7
  134. package/dist/deepkit/src/vendor/type.d.mts +0 -7
  135. package/dist/deepkit/src/vendor/type.mjs +0 -1
  136. package/dist/helpers/automd-generator.cjs +0 -1
  137. package/dist/helpers/automd-generator.d.cts +0 -14
  138. package/dist/helpers/automd-generator.d.mts +0 -14
  139. package/dist/helpers/automd-generator.mjs +0 -1
  140. package/dist/helpers/create-reflection-resource.cjs +0 -1
  141. package/dist/helpers/create-reflection-resource.d.cts +0 -15
  142. package/dist/helpers/create-reflection-resource.d.mts +0 -15
  143. package/dist/helpers/create-reflection-resource.mjs +0 -1
  144. package/dist/helpers/index.cjs +0 -1
  145. package/dist/helpers/index.d.cts +0 -7
  146. package/dist/helpers/index.d.mts +0 -7
  147. package/dist/helpers/index.mjs +0 -1
  148. package/dist/helpers/load.cjs +0 -1
  149. package/dist/helpers/load.d.cts +0 -35
  150. package/dist/helpers/load.d.mts +0 -36
  151. package/dist/helpers/load.mjs +0 -1
  152. package/dist/helpers/persistence.cjs +0 -1
  153. package/dist/helpers/persistence.d.cts +0 -84
  154. package/dist/helpers/persistence.d.mts +0 -84
  155. package/dist/helpers/persistence.mjs +0 -1
  156. package/dist/helpers/reflect.cjs +0 -1
  157. package/dist/helpers/reflect.d.cts +0 -46
  158. package/dist/helpers/reflect.d.mts +0 -46
  159. package/dist/helpers/reflect.mjs +0 -1
  160. package/dist/helpers/source-file-env.cjs +0 -1
  161. package/dist/helpers/source-file-env.d.cts +0 -8
  162. package/dist/helpers/source-file-env.d.mts +0 -8
  163. package/dist/helpers/source-file-env.mjs +0 -1
  164. package/dist/helpers/template-helpers.cjs +0 -1
  165. package/dist/helpers/template-helpers.d.cts +0 -15
  166. package/dist/helpers/template-helpers.d.mts +0 -15
  167. package/dist/helpers/template-helpers.mjs +0 -1
  168. package/dist/plugin-automd/src/index.cjs +0 -1
  169. package/dist/plugin-automd/src/index.mjs +0 -1
  170. package/dist/plugin-automd/src/types/plugin.d.cts +0 -38
  171. package/dist/plugin-automd/src/types/plugin.d.mts +0 -40
  172. package/dist/plugin-automd/src/types/toc.d.cts +0 -33
  173. package/dist/plugin-automd/src/types/toc.d.mts +0 -33
  174. package/dist/plugin-babel/src/helpers/ast-utils.cjs +0 -1
  175. package/dist/plugin-babel/src/helpers/ast-utils.mjs +0 -1
  176. package/dist/plugin-babel/src/helpers/create-plugin.cjs +0 -1
  177. package/dist/plugin-babel/src/helpers/create-plugin.mjs +0 -1
  178. package/dist/plugin-babel/src/helpers/filters.cjs +0 -1
  179. package/dist/plugin-babel/src/helpers/filters.mjs +0 -1
  180. package/dist/plugin-babel/src/helpers/index.cjs +0 -1
  181. package/dist/plugin-babel/src/helpers/index.mjs +0 -1
  182. package/dist/plugin-babel/src/helpers/module-helpers.cjs +0 -1
  183. package/dist/plugin-babel/src/helpers/module-helpers.mjs +0 -1
  184. package/dist/plugin-babel/src/helpers/options.cjs +0 -1
  185. package/dist/plugin-babel/src/helpers/options.mjs +0 -1
  186. package/dist/plugin-babel/src/index.cjs +0 -1
  187. package/dist/plugin-babel/src/index.mjs +0 -1
  188. package/dist/plugin-babel/src/types/index.d.mts +0 -1
  189. package/dist/plugin-babel/src/types/plugin.d.cts +0 -15
  190. package/dist/plugin-babel/src/types/plugin.d.mts +0 -15
  191. package/dist/powerlines/schemas/fs.d.mts +0 -1
  192. package/dist/powerlines/src/api.d.mts +0 -7
  193. package/dist/powerlines/src/index.d.mts +0 -12
  194. package/dist/powerlines/src/internal/helpers/hooks.d.mts +0 -5
  195. package/dist/powerlines/src/lib/build/esbuild.cjs +0 -14
  196. package/dist/powerlines/src/lib/build/esbuild.mjs +0 -14
  197. package/dist/powerlines/src/lib/entry.cjs +0 -1
  198. package/dist/powerlines/src/lib/entry.mjs +0 -1
  199. package/dist/powerlines/src/lib/logger.cjs +0 -1
  200. package/dist/powerlines/src/lib/logger.mjs +0 -1
  201. package/dist/powerlines/src/lib/utilities/bundle.cjs +0 -1
  202. package/dist/powerlines/src/lib/utilities/bundle.mjs +0 -1
  203. package/dist/powerlines/src/lib/utilities/resolve.cjs +0 -1
  204. package/dist/powerlines/src/lib/utilities/resolve.mjs +0 -1
  205. package/dist/powerlines/src/plugin-utils/helpers.cjs +0 -1
  206. package/dist/powerlines/src/plugin-utils/helpers.mjs +0 -1
  207. package/dist/powerlines/src/plugin-utils/paths.cjs +0 -1
  208. package/dist/powerlines/src/plugin-utils/paths.mjs +0 -1
  209. package/dist/powerlines/src/types/api.d.mts +0 -5
  210. package/dist/powerlines/src/types/babel.d.cts +0 -23
  211. package/dist/powerlines/src/types/babel.d.mts +0 -23
  212. package/dist/powerlines/src/types/build.d.cts +0 -145
  213. package/dist/powerlines/src/types/build.d.mts +0 -147
  214. package/dist/powerlines/src/types/commands.d.cts +0 -8
  215. package/dist/powerlines/src/types/commands.d.mts +0 -9
  216. package/dist/powerlines/src/types/config.d.cts +0 -368
  217. package/dist/powerlines/src/types/config.d.mts +0 -369
  218. package/dist/powerlines/src/types/context.d.cts +0 -373
  219. package/dist/powerlines/src/types/context.d.mts +0 -375
  220. package/dist/powerlines/src/types/fs.d.cts +0 -458
  221. package/dist/powerlines/src/types/fs.d.mts +0 -458
  222. package/dist/powerlines/src/types/hooks.d.mts +0 -2
  223. package/dist/powerlines/src/types/index.d.mts +0 -12
  224. package/dist/powerlines/src/types/plugin.d.cts +0 -232
  225. package/dist/powerlines/src/types/plugin.d.mts +0 -232
  226. package/dist/powerlines/src/types/resolved.d.cts +0 -82
  227. package/dist/powerlines/src/types/resolved.d.mts +0 -83
  228. package/dist/powerlines/src/types/tsconfig.d.cts +0 -69
  229. package/dist/powerlines/src/types/tsconfig.d.mts +0 -69
  230. package/dist/powerlines/src/types/unplugin.d.mts +0 -7
@@ -1 +0,0 @@
1
- import{getPluginName as e}from"./filters.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import n from"chalk";import{isFunction as r}from"@stryke/type-checks/is-function";function i(e,t){try{return Array.isArray(t)&&t.length>0&&t[0]?r(t[0])?t[0](e):t[0]:r(t)?t(e):t}catch{return t[0]}}function a(a,o,s,c){if(Array.isArray(c)&&c.length>0&&c[0]){if(c.length>2&&c[2]&&r(c[2])&&!c[2](o,s)){a.log(t.TRACE,`Skipping filtered Babel plugin ${n.bold.cyanBright(e(c)||`unnamed`)} for ${s}`);return}return c.length>2?[i(a,c),c[1],c[2]]:[i(a,c),c[1],null]}return[i(a,c),{},null]}export{a as resolveBabelPlugin,i as resolvePluginFunction};
@@ -1 +0,0 @@
1
- const e=require(`../../_virtual/rolldown_runtime.cjs`),t=require(`./helpers/create-plugin.cjs`),n=require(`./helpers/module-helpers.cjs`),r=require(`./helpers/filters.cjs`),i=require(`./helpers/options.cjs`);require(`./helpers/index.cjs`);let a=require(`defu`);a=e.__toESM(a);let o=require(`@storm-software/config-tools/types`),s=require(`@stryke/path/is-parent-path`),c=require(`@stryke/type-checks/is-set-object`),l=require(`@babel/core`),u=require(`@stryke/path/file-path-fns`);const d=(e={})=>({name:`babel`,config(){if((0,c.isSetObject)(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=(0,a.default)(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(t,n){if((0,s.isParentPath)(n,this.powerlinesPath)||t.includes(`/* @storm-ignore */`)||t.includes(`/* @storm-disable */`))return this.log(o.LogLevelLabel.TRACE,`Skipping Babel transformation for: ${n}`),{code:t,id:n};this.log(o.LogLevelLabel.TRACE,`Babel transforming file: ${n}`);let c=this.config.transform.babel.plugins.map(e=>i.resolveBabelPlugin(this,t,n,e)).filter((e,t,n)=>e&&!r.isDuplicatePlugin(n,e)),d=this.config.transform.babel.presets.map(e=>i.resolveBabelPlugin(this,t,n,e)).filter((e,t,n)=>e&&!r.isDuplicatePlugin(n,e));if(Array.isArray(c)&&c.length===0&&Array.isArray(d)&&d.length===0)return{code:t,id:n};[`ts`,`cts`,`mts`,`tsx`].includes((0,u.findFileExtensionSafe)(n))&&!r.isDuplicatePlugin(c,`@babel/plugin-syntax-typescript`)&&!r.isDuplicatePlugin(d,`@babel/preset-typescript`)&&c.unshift([`@babel/plugin-syntax-typescript`,{isTSX:(0,u.findFileExtension)(n)===`.tsx`}]);let f=await(0,l.transformAsync)(t,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:n,plugins:c.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:d.map(t=>Array.isArray(t)&&t.length>=2?[t[0],(0,a.default)(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!f?.code)throw Error(`Powerlines - Babel plugin failed to compile ${n}`);return{code:f.code,id:n}}});var f=d;exports.default=f;
@@ -1 +0,0 @@
1
- import{createBabelPlugin as e}from"./helpers/create-plugin.mjs";import{addImport as t,addImportsToProgram as n}from"./helpers/module-helpers.mjs";import{getPluginName as r,isDuplicatePlugin as i}from"./helpers/filters.mjs";import{resolveBabelPlugin as a,resolvePluginFunction as o}from"./helpers/options.mjs";import"./helpers/index.mjs";import s from"defu";import{LogLevelLabel as c}from"@storm-software/config-tools/types";import{isParentPath as l}from"@stryke/path/is-parent-path";import{isSetObject as u}from"@stryke/type-checks/is-set-object";import{transformAsync as d}from"@babel/core";import{findFileExtension as f,findFileExtensionSafe as p}from"@stryke/path/file-path-fns";var m=(e={})=>({name:`babel`,config(){if(u(e))return{transform:{babel:e}}},configResolved:{order:`pre`,handler(){this.devDependencies[`@babel/core`]=`^7.28.4`,this.config.transform.babel=s(this.config.transform.babel??{},{plugins:[],presets:[]})}},async transform(t,n){if(l(n,this.powerlinesPath)||t.includes(`/* @storm-ignore */`)||t.includes(`/* @storm-disable */`))return this.log(c.TRACE,`Skipping Babel transformation for: ${n}`),{code:t,id:n};this.log(c.TRACE,`Babel transforming file: ${n}`);let r=this.config.transform.babel.plugins.map(e=>a(this,t,n,e)).filter((e,t,n)=>e&&!i(n,e)),o=this.config.transform.babel.presets.map(e=>a(this,t,n,e)).filter((e,t,n)=>e&&!i(n,e));if(Array.isArray(r)&&r.length===0&&Array.isArray(o)&&o.length===0)return{code:t,id:n};[`ts`,`cts`,`mts`,`tsx`].includes(p(n))&&!i(r,`@babel/plugin-syntax-typescript`)&&!i(o,`@babel/preset-typescript`)&&r.unshift([`@babel/plugin-syntax-typescript`,{isTSX:f(n)===`.tsx`}]);let u=await d(t,{highlightCode:!0,code:!0,ast:!1,cloneInputAst:!1,comments:!0,sourceType:`module`,configFile:!1,babelrc:!1,envName:this.config.mode,caller:{name:this.config.framework},...this.config.transform.babel??{},filename:n,plugins:r.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean),presets:o.map(t=>Array.isArray(t)&&t.length>=2?[t[0],s(t.length>1&&t[1]?t[1]:{},{options:e})]:t).filter(Boolean)});if(!u?.code)throw Error(`Powerlines - Babel plugin failed to compile ${n}`);return{code:u.code,id:n}}});export{m as default};
@@ -1 +0,0 @@
1
- import { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig } from "./plugin.mjs";
@@ -1,15 +0,0 @@
1
- import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.cjs";
2
- import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.cjs";
3
- import { PluginContext } from "../../../powerlines/src/types/context.cjs";
4
-
5
- //#region ../plugin-babel/src/types/plugin.d.ts
6
- type BabelPluginOptions = Partial<BabelUserConfig>;
7
- type BabelPluginUserConfig = UserConfig;
8
- interface BabelPluginResolvedConfig extends ResolvedConfig {
9
- transform: {
10
- babel: BabelResolvedConfig;
11
- };
12
- }
13
- type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
14
- //#endregion
15
- export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
@@ -1,15 +0,0 @@
1
- import { BabelResolvedConfig, ResolvedConfig } from "../../../powerlines/src/types/resolved.mjs";
2
- import { BabelUserConfig, UserConfig } from "../../../powerlines/src/types/config.mjs";
3
- import { PluginContext } from "../../../powerlines/src/types/context.mjs";
4
-
5
- //#region ../plugin-babel/src/types/plugin.d.ts
6
- type BabelPluginOptions = Partial<BabelUserConfig>;
7
- type BabelPluginUserConfig = UserConfig;
8
- interface BabelPluginResolvedConfig extends ResolvedConfig {
9
- transform: {
10
- babel: BabelResolvedConfig;
11
- };
12
- }
13
- type BabelPluginContext<TResolvedConfig extends BabelPluginResolvedConfig = BabelPluginResolvedConfig> = PluginContext<TResolvedConfig>;
14
- //#endregion
15
- export { BabelPluginContext, BabelPluginOptions, BabelPluginResolvedConfig, BabelPluginUserConfig };
@@ -1 +0,0 @@
1
- import "@stryke/capnp";
@@ -1,7 +0,0 @@
1
- import "./types/resolved.mjs";
2
- import "./types/config.mjs";
3
- import "./types/hooks.mjs";
4
- import "./types/context.mjs";
5
- import "./internal/helpers/hooks.mjs";
6
- import "./types/api.mjs";
7
- import "./types/index.mjs";
@@ -1,12 +0,0 @@
1
- import { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn } from "./types/babel.mjs";
2
- import { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant } from "./types/build.mjs";
3
- import { ResolveOptions, StorageAdapter, StoragePort, StoragePreset, VirtualFile, VirtualFileData, VirtualFileMetadata, VirtualFileSystemInterface, WriteOptions } from "./types/fs.mjs";
4
- import { CommandType, SUPPORTED_COMMANDS } from "./types/commands.mjs";
5
- import { BabelResolvedConfig, EnvironmentResolvedConfig, OutputResolvedConfig, ResolvedAssetGlob, ResolvedConfig, ResolvedEntryTypeDefinition } from "./types/resolved.mjs";
6
- import { BasePluginHookFunctions, BuildPlugin, ConfigResult, Plugin, PluginBuildPlugins, PluginHook, PluginHookObject, PluginHooks, TypesResult } from "./types/plugin.mjs";
7
- import { DeepkitOptions, ParsedTypeScriptConfig, RawReflectionMode, ReflectionLevel, ReflectionMode, TSCompilerOptions, TSConfig } from "./types/tsconfig.mjs";
8
- import { BabelUserConfig, BaseConfig, CommonUserConfig, DeployConfig, EnvironmentConfig, InlineConfig, LogFn, OutputConfig, PluginConfig, PluginConfigObject, PluginConfigTuple, PluginFactory, PowerlinesCommand, ProjectType, UserConfig, WorkspaceConfig } from "./types/config.mjs";
9
- import { BuildPluginContext, Context, EmitEntryOptions, FetchOptions, InitContextOptions, LogLevel, MetaInfo, ParseOptions, PluginContext, Resolver, TransformResult, UnresolvedContext } from "./types/context.mjs";
10
- import "./types/index.mjs";
11
- import "./api.mjs";
12
- import "../schemas/fs.mjs";
@@ -1,5 +0,0 @@
1
- import "../../types/resolved.mjs";
2
- import "../../types/hooks.mjs";
3
- import "../../types/context.mjs";
4
- import { ArrayValues } from "@stryke/types/array";
5
- import { MaybePromise } from "@stryke/types/base";
@@ -1,14 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`);require(`../entry.cjs`);let t=require(`@stryke/path/join-paths`),n=require(`defu`);n=e.__toESM(n);let r=require(`@stryke/helpers/omit`),i=require(`@stryke/path/replace`),a=require(`@stryke/string-format/camel-case`),o=require(`@stryke/type-checks/is-string`);const s={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function c(e){let i=e.config.build.override.inject??e.config.build.inject;return i&&Object.keys(i).length>0&&e.fs.writeSync((0,t.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`),Object.entries(i).map(([e,t])=>{if(t)if(Array.isArray(t)){if((0,a.camelCase)(e)!==e){if(t.length===1)return`
2
- import ${(0,a.camelCase)(e)} from "${t[0]}";
3
- export { ${(0,a.camelCase)(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${(0,a.camelCase)(e)}`:`{ ${t[1]} as ${(0,a.camelCase)(e)} }`} from "${t[0]}";
5
- export { ${(0,a.camelCase)(e)} as "${e}" }`}else if(t.length===1)return`
6
- import ${e} from "${t[0]}";
7
- export { ${e} };`;else if(t.length>1)return`
8
- import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if((0,a.camelCase)(e)!==e)return`
10
- import ${(0,a.camelCase)(e)} from "${t[0]}";
11
- export { ${(0,a.camelCase)(e)} as "${e}" }`;else return`
12
- import ${e} from "${t}";
13
- export { ${e} };`;return``}).join(`
14
- `)),(0,n.default)({alias:e.builtins.reduce((t,n)=>{if(!t[n]){let r=e.fs.ids[n];r&&(t[n]=r)}return t},e.config.build.alias?Array.isArray(e.config.build.alias)?e.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):e.config.build.alias:{}),inject:i&&Object.keys(i).length>0?[(0,t.joinPaths)(e.workspaceConfig.workspaceRoot,e.config.projectRoot,e.artifactsPath,`inject-shim.js`)]:void 0},e.config.build.variant===`esbuild`?(0,r.omit)(e.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},e.config.build.variant===`esbuild`?(0,r.omit)(e.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:e.config.build.mainFields,conditions:e.config.build.conditions,define:e.config.build.define,resolveExtensions:e.config.build.extensions,packages:e.config.build.skipNodeModulesBundle?`external`:e.config.build.variant===`esbuild`?e.config.build.packages:void 0,format:Array.isArray(e.config.output.format)?e.config.output.format[0]:e.config.output.format,platform:e.config.build.platform,treeShaking:!!e.config.build?.treeshake||e.config.build?.treeShaking,outdir:e.config.output.buildPath,tsconfig:e.tsconfig.tsconfigFilePath,minify:e.config.mode!==`development`,metafile:e.config.mode===`development`,sourcemap:e.config.mode===`development`},s)}exports.extractESBuildConfig=c;
@@ -1,14 +0,0 @@
1
- import"../entry.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import t from"defu";import{omit as n}from"@stryke/helpers/omit";import{replacePath as r}from"@stryke/path/replace";import{camelCase as i}from"@stryke/string-format/camel-case";import{isString as a}from"@stryke/type-checks/is-string";const o={target:`esnext`,platform:`neutral`,format:`esm`,write:!0,minify:!0,sourcemap:!1,bundle:!0,treeShaking:!0,keepNames:!0,splitting:!0,logLevel:`silent`};function s(r){let a=r.config.build.override.inject??r.config.build.inject;return a&&Object.keys(a).length>0&&r.fs.writeSync(e(r.workspaceConfig.workspaceRoot,r.config.projectRoot,r.artifactsPath,`inject-shim.js`),Object.entries(a).map(([e,t])=>{if(t)if(Array.isArray(t)){if(i(e)!==e){if(t.length===1)return`
2
- import ${i(e)} from "${t[0]}";
3
- export { ${i(e)} as "${e}" }`;if(t.length>1)return`
4
- import ${t[1]===`*`?`* as ${i(e)}`:`{ ${t[1]} as ${i(e)} }`} from "${t[0]}";
5
- export { ${i(e)} as "${e}" }`}else if(t.length===1)return`
6
- import ${e} from "${t[0]}";
7
- export { ${e} };`;else if(t.length>1)return`
8
- import ${t[1]===`*`?`* as ${e}`:`{ ${t[1]} as ${e} }`} from "${t[0]}";
9
- export { ${e} };`}else if(i(e)!==e)return`
10
- import ${i(e)} from "${t[0]}";
11
- export { ${i(e)} as "${e}" }`;else return`
12
- import ${e} from "${t}";
13
- export { ${e} };`;return``}).join(`
14
- `)),t({alias:r.builtins.reduce((e,t)=>{if(!e[t]){let n=r.fs.ids[t];n&&(e[t]=n)}return e},r.config.build.alias?Array.isArray(r.config.build.alias)?r.config.build.alias.reduce((e,t)=>(e[t.find.toString()]||(e[t.find.toString()]=t.replacement),e),{}):r.config.build.alias:{}),inject:a&&Object.keys(a).length>0?[e(r.workspaceConfig.workspaceRoot,r.config.projectRoot,r.artifactsPath,`inject-shim.js`)]:void 0},r.config.build.variant===`esbuild`?n(r.config.build.override,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`]):{},r.config.build.variant===`esbuild`?n(r.config.build,[`alias`,`inject`,`external`,`noExternal`,`skipNodeModulesBundle`,`extensions`,`variant`,`override`]):{},{mainFields:r.config.build.mainFields,conditions:r.config.build.conditions,define:r.config.build.define,resolveExtensions:r.config.build.extensions,packages:r.config.build.skipNodeModulesBundle?`external`:r.config.build.variant===`esbuild`?r.config.build.packages:void 0,format:Array.isArray(r.config.output.format)?r.config.output.format[0]:r.config.output.format,platform:r.config.build.platform,treeShaking:!!r.config.build?.treeshake||r.config.build?.treeShaking,outdir:r.config.output.buildPath,tsconfig:r.tsconfig.tsconfigFilePath,minify:r.config.mode!==`development`,metafile:r.config.mode===`development`,sourcemap:r.config.mode===`development`},o)}export{s as extractESBuildConfig};
@@ -1 +0,0 @@
1
- require(`../plugin-utils/paths.cjs`);let e=require(`@stryke/path/join-paths`),t=require(`@stryke/convert/parse-type-definition`),n=require(`@stryke/type-checks/is-set-string`),r=require(`@stryke/path/replace`),i=require(`@stryke/type-checks/is-string`),a=require(`@stryke/convert/to-array`),o=require(`@stryke/fs/is-file`),s=require(`@stryke/fs/list-files`);require(`@stryke/hash/murmurhash`);let c=require(`@stryke/helpers/get-unique`),l=require(`@stryke/path/append`);
@@ -1 +0,0 @@
1
- import"../plugin-utils/paths.mjs";import{joinPaths as e}from"@stryke/path/join-paths";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";import{replacePath as r}from"@stryke/path/replace";import{isString as i}from"@stryke/type-checks/is-string";import{toArray as a}from"@stryke/convert/to-array";import"@stryke/fs/is-file";import{listFiles as o}from"@stryke/fs/list-files";import"@stryke/hash/murmurhash";import{getUniqueBy as s}from"@stryke/helpers/get-unique";import{appendPath as c}from"@stryke/path/append";export{};
@@ -1 +0,0 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/string-format/title-case`),n=require(`@storm-software/config-tools/types`),r=require(`chalk`);r=e.__toESM(r),require(`@storm-software/config-tools/logger`),require(`@storm-software/config-tools/utilities/colors`),require(`@stryke/helpers/noop`);const i=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`],a=(e,n)=>(a,...o)=>e(a,` ${r.default.inverse.hex(i[n.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%i.length]||i[0])(` ${(0,t.titleCase)(n)} `)} ${o.join(` `)} `);exports.extendLog=a;
@@ -1 +0,0 @@
1
- import{titleCase as e}from"@stryke/string-format/title-case";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import n from"chalk";import"@storm-software/config-tools/logger";import"@storm-software/config-tools/utilities/colors";import"@stryke/helpers/noop";const r=[`#00A0DD`,`#6FCE4E`,`#FBBF24`,`#F43F5E`,`#3B82F6`,`#A855F7`,`#469592`,`#288EDF`,`#10B981`,`#EF4444`,`#F0EC56`,`#F472B6`,`#22D3EE`,`#EAB308`,`#84CC16`,`#F87171`,`#0EA5E9`,`#D946EF`,`#FACC15`,`#34D399`],i=(t,i)=>(a,...o)=>t(a,` ${n.inverse.hex(r[i.split(``).map(e=>e.charCodeAt(0)).reduce((e,t)=>e+t,0)%r.length]||r[0])(` ${e(i)} `)} ${o.join(` `)} `);export{i as extendLog};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`../build/esbuild.cjs`);let n=require(`@storm-software/config-tools/types`),r=require(`esbuild`);async function i(e,i,a={}){let o=await e.fs.resolve(i);if(!o||!e.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await(0,r.build)({...t.extractESBuildConfig(e),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&e.log(n.LogLevelLabel.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}exports.bundle=i;
@@ -1 +0,0 @@
1
- import{extractESBuildConfig as e}from"../build/esbuild.mjs";import{LogLevelLabel as t}from"@storm-software/config-tools/types";import{build as n}from"esbuild";async function r(r,i,a={}){let o=await r.fs.resolve(i);if(!o||!r.fs.existsSync(o))throw Error(`Module not found: "${i}". Please check the path and try again.`);let s=await n({...e(r),entryPoints:[o],write:!1,sourcemap:!1,splitting:!1,treeShaking:!1,bundle:!0,...a});if(s.errors.length>0)throw Error(`Failed to transpile ${i}: ${s.errors.map(e=>e.text).join(`, `)}`);if(s.warnings.length>0&&r.log(t.WARN,`Warnings while transpiling ${i}: ${s.warnings.map(e=>e.text).join(`, `)}`),!s.outputFiles||s.outputFiles.filter(Boolean).length===0)throw Error(`No output files generated for ${i}. Please check the configuration and try again.`);return s.outputFiles.filter(Boolean)[0]}export{r as bundle};
@@ -1 +0,0 @@
1
- const e=require(`../../../../_virtual/rolldown_runtime.cjs`),t=require(`./bundle.cjs`);let n=require(`@stryke/convert/parse-type-definition`),r=require(`@stryke/type-checks/is-set-string`);async function i(e,i,a={}){let o;o=(0,r.isSetString)(i)?(0,n.parseTypeDefinition)(i):i;let s=await t.bundle(e,o.file,a),c=await e.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}exports.resolve=i;
@@ -1 +0,0 @@
1
- import{bundle as e}from"./bundle.mjs";import{parseTypeDefinition as t}from"@stryke/convert/parse-type-definition";import{isSetString as n}from"@stryke/type-checks/is-set-string";async function r(r,i,a={}){let o;o=n(i)?t(i):i;let s=await e(r,o.file,a),c=await r.resolver.evalModule(s.text,{filename:s.path,forceTranspile:!0}),l=o.name;return l||=`default`,c[l]??c[`__Ω${l}`]}export{r as resolve};
@@ -1 +0,0 @@
1
- const e=require(`../../../_virtual/rolldown_runtime.cjs`);let t=require(`@stryke/type-checks/is-set-string`),n=require(`@stryke/type-checks/is-set-object`),r=require(`@stryke/type-checks/is-undefined`),i=require(`@stryke/type-checks/is-function`);function a(e){return(0,i.isFunction)(e)||(0,n.isSetObject)(e)&&`handler`in e&&(0,i.isFunction)(e.handler)}function o(e){return(0,n.isSetObject)(e)&&`handler`in e&&(0,i.isFunction)(e.handler)}function s(e){return a(e)||o(e)}function c(e){return(0,i.isFunction)(e)?e:e.handler}exports.getHookHandler=c,exports.isPluginHook=s,exports.isPluginHookFunction=a,exports.isPluginHookObject=o;
@@ -1 +0,0 @@
1
- import{isSetString as e}from"@stryke/type-checks/is-set-string";import{isSetObject as t}from"@stryke/type-checks/is-set-object";import{isUndefined as n}from"@stryke/type-checks/is-undefined";import{isFunction as r}from"@stryke/type-checks/is-function";function i(e){return r(e)||t(e)&&`handler`in e&&r(e.handler)}function a(e){return t(e)&&`handler`in e&&r(e.handler)}function o(e){return i(e)||a(e)}function s(e){return r(e)?e:e.handler}export{s as getHookHandler,o as isPluginHook,i as isPluginHookFunction,a as isPluginHookObject};
@@ -1 +0,0 @@
1
- let e=require(`@stryke/path/replace`);
@@ -1 +0,0 @@
1
- import{replacePath as e}from"@stryke/path/replace";export{};
@@ -1,5 +0,0 @@
1
- import "./resolved.mjs";
2
- import "./config.mjs";
3
- import "./hooks.mjs";
4
- import "./context.mjs";
5
- import "../internal/helpers/hooks.mjs";
@@ -1,23 +0,0 @@
1
- import { LogFn } from "./config.cjs";
2
- import { Context } from "./context.cjs";
3
- import { PluginItem, PluginObj, PluginPass } from "@babel/core";
4
- import { BabelAPI } from "@babel/helper-plugin-utils";
5
-
6
- //#region ../powerlines/src/types/babel.d.ts
7
-
8
- type BabelPluginPass<TState = unknown> = PluginPass & TState;
9
- type BabelTransformPluginFilter = (code: string, id: string) => boolean;
10
- type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
11
- name: string;
12
- log: LogFn;
13
- api: BabelAPI;
14
- options: TOptions;
15
- context: TContext;
16
- dirname: string;
17
- }) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
18
- $$name: string;
19
- };
20
- type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
21
- type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
22
- //#endregion
23
- export { BabelTransformPluginOptions, DeclareBabelTransformPluginReturn };
@@ -1,23 +0,0 @@
1
- import { LogFn } from "./config.mjs";
2
- import { Context } from "./context.mjs";
3
- import { BabelAPI } from "@babel/helper-plugin-utils";
4
- import { PluginItem, PluginObj, PluginPass } from "@babel/core";
5
-
6
- //#region ../powerlines/src/types/babel.d.ts
7
-
8
- type BabelPluginPass<TState = unknown> = PluginPass & TState;
9
- type BabelTransformPluginFilter = (code: string, id: string) => boolean;
10
- type BabelTransformPlugin<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = ((context: TContext) => (options: {
11
- name: string;
12
- log: LogFn;
13
- api: BabelAPI;
14
- options: TOptions;
15
- context: TContext;
16
- dirname: string;
17
- }) => PluginObj<TOptions & BabelPluginPass<TState>>) & {
18
- $$name: string;
19
- };
20
- type BabelTransformPluginOptions<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = unknown> = PluginItem | BabelTransformPlugin<TContext, TOptions, TState> | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions] | [BabelTransformPlugin<TContext, TOptions, TState>, TOptions, BabelTransformPluginFilter];
21
- type DeclareBabelTransformPluginReturn<TContext extends Context = Context, TOptions extends Record<string, any> = Record<string, any>, TState = any> = Omit<BabelTransformPlugin<TContext, TOptions, TState>, "$$name"> & Required<Pick<BabelTransformPlugin<TContext, TOptions, TState>, "$$name">>;
22
- //#endregion
23
- export { BabelPluginPass, BabelTransformPlugin, BabelTransformPluginFilter, BabelTransformPluginOptions, DeclareBabelTransformPluginReturn };
@@ -1,145 +0,0 @@
1
- //#region ../powerlines/src/types/build.d.ts
2
-
3
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
4
- interface BuildConfig {
5
- /**
6
- * The platform to build the project for
7
- *
8
- * @defaultValue "neutral"
9
- */
10
- platform?: "node" | "browser" | "neutral";
11
- /**
12
- * Array of strings indicating the polyfills to include for the build.
13
- *
14
- * @remarks
15
- * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
16
- *
17
- * @example
18
- * ```ts
19
- * {
20
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
21
- * }
22
- * ```
23
- */
24
- polyfill?: string[];
25
- /**
26
- * 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.
27
- *
28
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
29
- */
30
- mainFields?: string[];
31
- /**
32
- * Array of strings indicating what conditions should be used for module resolution.
33
- */
34
- conditions?: string[];
35
- /**
36
- * Array of strings indicating what file extensions should be used for module resolution.
37
- *
38
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
39
- */
40
- extensions?: string[];
41
- /**
42
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
43
- *
44
- * @remarks
45
- * 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.
46
- */
47
- dedupe?: string[];
48
- /**
49
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
50
- */
51
- builtins?: (string | RegExp)[];
52
- /**
53
- * Define global variable replacements.
54
- *
55
- * @remarks
56
- * 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.
57
- *
58
- * @example
59
- * ```ts
60
- * {
61
- * define: {
62
- * __VERSION__: '"1.0.0"',
63
- * __DEV__: 'process.env.NODE_ENV !== "production"'
64
- * }
65
- * }
66
- * ```
67
- *
68
- * @see https://esbuild.github.io/api/#define
69
- * @see https://vitejs.dev/config/build-options.html#define
70
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
71
- */
72
- define?: Record<string, any>;
73
- /**
74
- * Global variables that will have import statements injected where necessary
75
- *
76
- * @remarks
77
- * 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.
78
- *
79
- * @example
80
- * ```ts
81
- * {
82
- * inject: {
83
- * process: 'process/browser',
84
- * Buffer: ['buffer', 'Buffer'],
85
- * }
86
- * }
87
- * ```
88
- *
89
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
90
- */
91
- inject?: Record<string, string | string[]>;
92
- /**
93
- * The alias mappings to use for module resolution during the build process.
94
- *
95
- * @remarks
96
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
97
- *
98
- * @example
99
- * ```ts
100
- * {
101
- * alias: {
102
- * "@utils": "./src/utils",
103
- * "@components": "./src/components"
104
- * }
105
- * }
106
- * ```
107
- *
108
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
109
- */
110
- alias?: Record<string, string> | Array<{
111
- find: string | RegExp;
112
- replacement: string;
113
- }>;
114
- /**
115
- * A list of modules that should not be bundled, even if they are external dependencies.
116
- *
117
- * @remarks
118
- * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
119
- */
120
- external?: (string | RegExp)[];
121
- /**
122
- * A list of modules that should always be bundled, even if they are external dependencies.
123
- */
124
- noExternal?: (string | RegExp)[];
125
- /**
126
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
127
- */
128
- skipNodeModulesBundle?: boolean;
129
- /**
130
- * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime. Otherwise, it is statically replaced as an empty object.
131
- *
132
- * @defaultValue false
133
- */
134
- keepProcessEnv?: boolean;
135
- /**
136
- * An optional set of override options to apply to the selected build variant.
137
- *
138
- * @remarks
139
- * 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.
140
- */
141
- override?: Record<string, any>;
142
- }
143
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
144
- //#endregion
145
- export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
@@ -1,147 +0,0 @@
1
- import "esbuild";
2
-
3
- //#region ../powerlines/src/types/build.d.ts
4
-
5
- type UnpluginBuildVariant = "rollup" | "webpack" | "rspack" | "vite" | "esbuild" | "farm" | "unloader" | "rolldown";
6
- interface BuildConfig {
7
- /**
8
- * The platform to build the project for
9
- *
10
- * @defaultValue "neutral"
11
- */
12
- platform?: "node" | "browser" | "neutral";
13
- /**
14
- * Array of strings indicating the polyfills to include for the build.
15
- *
16
- * @remarks
17
- * This option allows you to specify which polyfills should be included in the build process to ensure compatibility with the target environment. The paths for the polyfills can use placeholder tokens (the `replacePathTokens` helper function will be used to resolve the actual values).
18
- *
19
- * @example
20
- * ```ts
21
- * {
22
- * polyfill: ['{projectRoot}/custom-polyfill.ts']
23
- * }
24
- * ```
25
- */
26
- polyfill?: string[];
27
- /**
28
- * 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.
29
- *
30
- * @defaultValue `['browser', 'module', 'jsnext:main', 'jsnext']`
31
- */
32
- mainFields?: string[];
33
- /**
34
- * Array of strings indicating what conditions should be used for module resolution.
35
- */
36
- conditions?: string[];
37
- /**
38
- * Array of strings indicating what file extensions should be used for module resolution.
39
- *
40
- * @defaultValue `['.mjs', '.js', '.mts', '.ts', '.jsx', '.tsx', '.json']`
41
- */
42
- extensions?: string[];
43
- /**
44
- * Array of strings indicating what modules should be deduplicated to a single version in the build.
45
- *
46
- * @remarks
47
- * 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.
48
- */
49
- dedupe?: string[];
50
- /**
51
- * Array of strings or regular expressions that indicate what modules are builtin for the environment.
52
- */
53
- builtins?: (string | RegExp)[];
54
- /**
55
- * Define global variable replacements.
56
- *
57
- * @remarks
58
- * 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.
59
- *
60
- * @example
61
- * ```ts
62
- * {
63
- * define: {
64
- * __VERSION__: '"1.0.0"',
65
- * __DEV__: 'process.env.NODE_ENV !== "production"'
66
- * }
67
- * }
68
- * ```
69
- *
70
- * @see https://esbuild.github.io/api/#define
71
- * @see https://vitejs.dev/config/build-options.html#define
72
- * @see https://github.com/rollup/plugins/tree/master/packages/replace
73
- */
74
- define?: Record<string, any>;
75
- /**
76
- * Global variables that will have import statements injected where necessary
77
- *
78
- * @remarks
79
- * 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.
80
- *
81
- * @example
82
- * ```ts
83
- * {
84
- * inject: {
85
- * process: 'process/browser',
86
- * Buffer: ['buffer', 'Buffer'],
87
- * }
88
- * }
89
- * ```
90
- *
91
- * @see https://github.com/rollup/plugins/tree/master/packages/inject
92
- */
93
- inject?: Record<string, string | string[]>;
94
- /**
95
- * The alias mappings to use for module resolution during the build process.
96
- *
97
- * @remarks
98
- * This option allows you to define custom path aliases for modules, which can be useful for simplifying imports and managing dependencies.
99
- *
100
- * @example
101
- * ```ts
102
- * {
103
- * alias: {
104
- * "@utils": "./src/utils",
105
- * "@components": "./src/components"
106
- * }
107
- * }
108
- * ```
109
- *
110
- * @see https://github.com/rollup/plugins/tree/master/packages/alias
111
- */
112
- alias?: Record<string, string> | Array<{
113
- find: string | RegExp;
114
- replacement: string;
115
- }>;
116
- /**
117
- * A list of modules that should not be bundled, even if they are external dependencies.
118
- *
119
- * @remarks
120
- * This option is useful for excluding specific modules from the bundle, such as Node.js built-in modules or other libraries that should not be bundled.
121
- */
122
- external?: (string | RegExp)[];
123
- /**
124
- * A list of modules that should always be bundled, even if they are external dependencies.
125
- */
126
- noExternal?: (string | RegExp)[];
127
- /**
128
- * Should the Powerlines CLI processes skip bundling the `node_modules` directory?
129
- */
130
- skipNodeModulesBundle?: boolean;
131
- /**
132
- * If true, `process.env` referenced in code will be preserved as-is and evaluated in runtime. Otherwise, it is statically replaced as an empty object.
133
- *
134
- * @defaultValue false
135
- */
136
- keepProcessEnv?: boolean;
137
- /**
138
- * An optional set of override options to apply to the selected build variant.
139
- *
140
- * @remarks
141
- * 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.
142
- */
143
- override?: Record<string, any>;
144
- }
145
- type BuildResolvedConfig = Omit<BuildConfig, "override">;
146
- //#endregion
147
- export { BuildConfig, BuildResolvedConfig, UnpluginBuildVariant };
@@ -1,8 +0,0 @@
1
- import { ArrayValues } from "@stryke/types/array";
2
- import { MaybePromise } from "@stryke/types/base";
3
-
4
- //#region ../powerlines/src/types/commands.d.ts
5
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
6
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
7
- //#endregion
8
- export { CommandType };
@@ -1,9 +0,0 @@
1
- import "./context.mjs";
2
- import { ArrayValues } from "@stryke/types/array";
3
- import { MaybePromise } from "@stryke/types/base";
4
-
5
- //#region ../powerlines/src/types/commands.d.ts
6
- declare const SUPPORTED_COMMANDS: readonly ["new", "clean", "prepare", "lint", "test", "build", "docs", "deploy", "finalize"];
7
- type CommandType = ArrayValues<typeof SUPPORTED_COMMANDS>;
8
- //#endregion
9
- export { CommandType, SUPPORTED_COMMANDS };