@powerlines/plugin-esbuild 0.13.309 → 0.13.311

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 (45) hide show
  1. package/dist/{bundle-Bx7Mimeh.d.cts → bundle-CGOgHuWO.d.cts} +2 -2
  2. package/dist/{bundle-Bx7Mimeh.d.cts.map → bundle-CGOgHuWO.d.cts.map} +1 -1
  3. package/dist/bundle-D6QqCoyO.mjs.map +1 -1
  4. package/dist/{bundle-UTFhPSjU.d.mts → bundle-z2FneKY-.d.mts} +2 -2
  5. package/dist/{bundle-UTFhPSjU.d.mts.map → bundle-z2FneKY-.d.mts.map} +1 -1
  6. package/dist/helpers/bundle.d.cts +1 -1
  7. package/dist/helpers/bundle.d.mts +1 -1
  8. package/dist/helpers/index.d.cts +5 -5
  9. package/dist/helpers/index.d.mts +5 -5
  10. package/dist/helpers/resolve-options.d.cts +1 -1
  11. package/dist/helpers/resolve-options.d.mts +1 -1
  12. package/dist/helpers/resolve.d.cts +1 -1
  13. package/dist/helpers/resolve.d.mts +1 -1
  14. package/dist/helpers/unplugin.d.cts +2 -2
  15. package/dist/helpers/unplugin.d.mts +2 -2
  16. package/dist/index.d.cts +11 -6
  17. package/dist/index.d.cts.map +1 -1
  18. package/dist/index.d.mts +11 -6
  19. package/dist/index.d.mts.map +1 -1
  20. package/dist/index.mjs.map +1 -1
  21. package/dist/{plugin-fp0p1CCy.d.cts → plugin-7iQtkKC4.d.cts} +2 -2
  22. package/dist/{plugin-Bivts13R.d.mts.map → plugin-7iQtkKC4.d.cts.map} +1 -1
  23. package/dist/{plugin-Bivts13R.d.mts → plugin-B823wBIx.d.mts} +2 -2
  24. package/dist/{plugin-fp0p1CCy.d.cts.map → plugin-B823wBIx.d.mts.map} +1 -1
  25. package/dist/resolve-C8OzoP-s.mjs.map +1 -1
  26. package/dist/{resolve-BU3nddJ7.d.mts → resolve-Cy71IFTt.d.mts} +2 -2
  27. package/dist/{resolve-BU3nddJ7.d.mts.map → resolve-Cy71IFTt.d.mts.map} +1 -1
  28. package/dist/{resolve-BUiEAXVB.d.cts → resolve-DaXV27Bb.d.cts} +2 -2
  29. package/dist/{resolve-BUiEAXVB.d.cts.map → resolve-DaXV27Bb.d.cts.map} +1 -1
  30. package/dist/resolve-options-C-213jz6.mjs.map +1 -1
  31. package/dist/{resolve-options-CpEoapmL.d.mts → resolve-options-Dv4d9qj2.d.cts} +2 -2
  32. package/dist/{resolve-options-CpEoapmL.d.mts.map → resolve-options-Dv4d9qj2.d.cts.map} +1 -1
  33. package/dist/{resolve-options-DSHX7AUS.d.cts → resolve-options-XG5mcDGc.d.mts} +2 -2
  34. package/dist/{resolve-options-DSHX7AUS.d.cts.map → resolve-options-XG5mcDGc.d.mts.map} +1 -1
  35. package/dist/types/index.d.cts +1 -1
  36. package/dist/types/index.d.mts +1 -1
  37. package/dist/types/plugin.d.cts +1 -1
  38. package/dist/types/plugin.d.mts +1 -1
  39. package/dist/{unplugin-Cf7hyWQE.d.cts → unplugin-BiqKxCQ7.d.mts} +2 -2
  40. package/dist/unplugin-BiqKxCQ7.d.mts.map +1 -0
  41. package/dist/{unplugin-Csi4d8gj.d.mts → unplugin-DYA9P9Jn.d.cts} +2 -2
  42. package/dist/unplugin-DYA9P9Jn.d.cts.map +1 -0
  43. package/package.json +3 -3
  44. package/dist/unplugin-Cf7hyWQE.d.cts.map +0 -1
  45. package/dist/unplugin-Csi4d8gj.d.mts.map +0 -1
@@ -1,4 +1,4 @@
1
- import { PluginContext } from "@powerlines/core/types/context";
1
+ import { PluginContext } from "@powerlines/core";
2
2
  import { BuildOptions, OutputFile } from "esbuild";
3
3
 
4
4
  //#region src/helpers/bundle.d.ts
@@ -14,4 +14,4 @@ import { BuildOptions, OutputFile } from "esbuild";
14
14
  declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions>): Promise<OutputFile>;
15
15
  //#endregion
16
16
  export { bundle as t };
17
- //# sourceMappingURL=bundle-Bx7Mimeh.d.cts.map
17
+ //# sourceMappingURL=bundle-CGOgHuWO.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-Bx7Mimeh.d.cts","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;;;;;;AAIU,iBAJY,MAAA,CAIZ,OAAA,EAHC,aAGD,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,UAAD,CAAA"}
1
+ {"version":3,"file":"bundle-CGOgHuWO.d.cts","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;;;;;;AAIU,iBAJY,MAAA,CAIZ,OAAA,EAHC,aAGD,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,UAAD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-D6QqCoyO.mjs","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { PluginContext } from \"@powerlines/core/types/context\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build(\n defu(\n {\n ...resolveOptions(context),\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: false,\n bundle: true,\n packages: \"bundle\",\n platform: \"node\",\n logLevel: \"silent\",\n ...overrides\n } as BuildOptions,\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, `${findFileName(file)} Bundler`)\n )({})\n ]\n }\n )\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,eAAsB,OACpB,SACA,MACA,YAAmC,EAAE,EAChB;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,KAAK;AAC3C,KAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,KAAK,CACvC,OAAM,IAAI,MACR,sBAAsB,KAAK,yCAC5B;CAGH,MAAM,SAAS,MAAM,MACnB,KACE;EACE,GAAG,eAAe,QAAQ;EAC1B,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG;EACJ,EACD,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS,GAAG,aAAa,KAAK,CAAC,UAAU,CACjE,CAAC,EAAE,CAAC,CACN,EACF,CACF,CACF;AACD,KAAI,OAAO,OAAO,SAAS,EACzB,OAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,KAAK,CACxB,KAAK,KAAK,GACd;AAEH,KAAI,OAAO,SAAS,SAAS,EAC3B,SAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,KAAK,CAC5B,KAAK,KAAK,GACd;AAEH,KAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,QAAQ,CAAC,WAAW,EACvE,OAAM,IAAI,MACR,iCACE,KACD,iDACF;AAGH,QAAO,OAAO,YAAY,OAAO,QAAQ,CAAC"}
1
+ {"version":3,"file":"bundle-D6QqCoyO.mjs","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build(\n defu(\n {\n ...resolveOptions(context),\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: false,\n bundle: true,\n packages: \"bundle\",\n platform: \"node\",\n logLevel: \"silent\",\n ...overrides\n } as BuildOptions,\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, `${findFileName(file)} Bundler`)\n )({})\n ]\n }\n )\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,eAAsB,OACpB,SACA,MACA,YAAmC,EAAE,EAChB;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,KAAK;AAC3C,KAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,KAAK,CACvC,OAAM,IAAI,MACR,sBAAsB,KAAK,yCAC5B;CAGH,MAAM,SAAS,MAAM,MACnB,KACE;EACE,GAAG,eAAe,QAAQ;EAC1B,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG;EACJ,EACD,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS,GAAG,aAAa,KAAK,CAAC,UAAU,CACjE,CAAC,EAAE,CAAC,CACN,EACF,CACF,CACF;AACD,KAAI,OAAO,OAAO,SAAS,EACzB,OAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,KAAK,CACxB,KAAK,KAAK,GACd;AAEH,KAAI,OAAO,SAAS,SAAS,EAC3B,SAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,KAAK,CAC5B,KAAK,KAAK,GACd;AAEH,KAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,QAAQ,CAAC,WAAW,EACvE,OAAM,IAAI,MACR,iCACE,KACD,iDACF;AAGH,QAAO,OAAO,YAAY,OAAO,QAAQ,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { BuildOptions, OutputFile } from "esbuild";
2
- import { PluginContext } from "@powerlines/core/types/context";
2
+ import { PluginContext } from "@powerlines/core";
3
3
 
4
4
  //#region src/helpers/bundle.d.ts
5
5
 
@@ -14,4 +14,4 @@ import { PluginContext } from "@powerlines/core/types/context";
14
14
  declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions>): Promise<OutputFile>;
15
15
  //#endregion
16
16
  export { bundle as t };
17
- //# sourceMappingURL=bundle-UTFhPSjU.d.mts.map
17
+ //# sourceMappingURL=bundle-z2FneKY-.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-UTFhPSjU.d.mts","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;;;;;;AAIU,iBAJY,MAAA,CAIZ,OAAA,EAHC,aAGD,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,UAAD,CAAA"}
1
+ {"version":3,"file":"bundle-z2FneKY-.d.mts","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":[],"mappings":";;;;;;;AAkCA;;;;;;AAIU,iBAJY,MAAA,CAIZ,OAAA,EAHC,aAGD,EAAA,IAAA,EAAA,MAAA,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,UAAD,CAAA"}
@@ -1,2 +1,2 @@
1
- import { t as bundle } from "../bundle-Bx7Mimeh.cjs";
1
+ import { t as bundle } from "../bundle-CGOgHuWO.cjs";
2
2
  export { bundle };
@@ -1,2 +1,2 @@
1
- import { t as bundle } from "../bundle-UTFhPSjU.mjs";
1
+ import { t as bundle } from "../bundle-z2FneKY-.mjs";
2
2
  export { bundle };
@@ -1,8 +1,8 @@
1
- import { t as bundle } from "../bundle-Bx7Mimeh.cjs";
2
- import { n as resolveModule, t as resolve } from "../resolve-BUiEAXVB.cjs";
3
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-DSHX7AUS.cjs";
1
+ import { t as bundle } from "../bundle-CGOgHuWO.cjs";
2
+ import { n as resolveModule, t as resolve } from "../resolve-DaXV27Bb.cjs";
3
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-Dv4d9qj2.cjs";
4
4
  import "../build-Br4iCJ5d.cjs";
5
- import "../plugin-fp0p1CCy.cjs";
6
- import { t as createEsbuildPlugin } from "../unplugin-Cf7hyWQE.cjs";
5
+ import "../plugin-7iQtkKC4.cjs";
6
+ import { t as createEsbuildPlugin } from "../unplugin-DYA9P9Jn.cjs";
7
7
  import "../index-DeEmP3Jc.cjs";
8
8
  export { DEFAULT_ESBUILD_CONFIG, bundle, createEsbuildPlugin, resolve, resolveEntry, resolveModule, resolveOptions };
@@ -1,8 +1,8 @@
1
- import { t as bundle } from "../bundle-UTFhPSjU.mjs";
2
- import { n as resolveModule, t as resolve } from "../resolve-BU3nddJ7.mjs";
3
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-CpEoapmL.mjs";
1
+ import { t as bundle } from "../bundle-z2FneKY-.mjs";
2
+ import { n as resolveModule, t as resolve } from "../resolve-Cy71IFTt.mjs";
3
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-XG5mcDGc.mjs";
4
4
  import "../build-CrohITJo.mjs";
5
- import "../plugin-Bivts13R.mjs";
6
- import { t as createEsbuildPlugin } from "../unplugin-Csi4d8gj.mjs";
5
+ import "../plugin-B823wBIx.mjs";
6
+ import { t as createEsbuildPlugin } from "../unplugin-BiqKxCQ7.mjs";
7
7
  import "../index-ClXLQ1fw.mjs";
8
8
  export { DEFAULT_ESBUILD_CONFIG, bundle, createEsbuildPlugin, resolve, resolveEntry, resolveModule, resolveOptions };
@@ -1,2 +1,2 @@
1
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-DSHX7AUS.cjs";
1
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-Dv4d9qj2.cjs";
2
2
  export { DEFAULT_ESBUILD_CONFIG, resolveEntry, resolveOptions };
@@ -1,2 +1,2 @@
1
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-CpEoapmL.mjs";
1
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-XG5mcDGc.mjs";
2
2
  export { DEFAULT_ESBUILD_CONFIG, resolveEntry, resolveOptions };
@@ -1,2 +1,2 @@
1
- import { n as resolveModule, t as resolve } from "../resolve-BUiEAXVB.cjs";
1
+ import { n as resolveModule, t as resolve } from "../resolve-DaXV27Bb.cjs";
2
2
  export { resolve, resolveModule };
@@ -1,2 +1,2 @@
1
- import { n as resolveModule, t as resolve } from "../resolve-BU3nddJ7.mjs";
1
+ import { n as resolveModule, t as resolve } from "../resolve-Cy71IFTt.mjs";
2
2
  export { resolve, resolveModule };
@@ -1,4 +1,4 @@
1
1
  import "../build-Br4iCJ5d.cjs";
2
- import "../plugin-fp0p1CCy.cjs";
3
- import { t as createEsbuildPlugin } from "../unplugin-Cf7hyWQE.cjs";
2
+ import "../plugin-7iQtkKC4.cjs";
3
+ import { t as createEsbuildPlugin } from "../unplugin-DYA9P9Jn.cjs";
4
4
  export { createEsbuildPlugin };
@@ -1,4 +1,4 @@
1
1
  import "../build-CrohITJo.mjs";
2
- import "../plugin-Bivts13R.mjs";
3
- import { t as createEsbuildPlugin } from "../unplugin-Csi4d8gj.mjs";
2
+ import "../plugin-B823wBIx.mjs";
3
+ import { t as createEsbuildPlugin } from "../unplugin-BiqKxCQ7.mjs";
4
4
  export { createEsbuildPlugin };
package/dist/index.d.cts CHANGED
@@ -1,14 +1,19 @@
1
- import { t as bundle } from "./bundle-Bx7Mimeh.cjs";
2
- import { n as resolveModule, t as resolve } from "./resolve-BUiEAXVB.cjs";
3
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-DSHX7AUS.cjs";
1
+ import { t as bundle } from "./bundle-CGOgHuWO.cjs";
2
+ import { n as resolveModule, t as resolve } from "./resolve-DaXV27Bb.cjs";
3
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-Dv4d9qj2.cjs";
4
4
  import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "./build-Br4iCJ5d.cjs";
5
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "./plugin-fp0p1CCy.cjs";
6
- import { t as createEsbuildPlugin } from "./unplugin-Cf7hyWQE.cjs";
5
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "./plugin-7iQtkKC4.cjs";
6
+ import { t as createEsbuildPlugin } from "./unplugin-DYA9P9Jn.cjs";
7
7
  import "./index-DeEmP3Jc.cjs";
8
8
  import "./index-sQecLSpR.cjs";
9
- import { Plugin } from "@powerlines/core/types";
9
+ import { Plugin } from "@powerlines/core";
10
10
 
11
11
  //#region src/index.d.ts
12
+ declare module "@powerlines/core" {
13
+ interface BaseConfig {
14
+ esbuild?: EsbuildPluginOptions;
15
+ }
16
+ }
12
17
  /**
13
18
  * A Powerlines plugin to assist in developing other Powerlines plugins.
14
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;cAuCa,0BACM,uBAAuB,gCAE/B,yBACR,OAAO"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAsCc;;;;;AAJU;AAAA,cAWX,MAXW,EAAA,CAAA,iBAYL,oBAZK,GAYkB,oBAZlB,CAAA,CAAA,OAAA,CAAA,EAcb,oBAda,EAAA,GAerB,MAfqB,CAed,QAfc,CAAA"}
package/dist/index.d.mts CHANGED
@@ -1,14 +1,19 @@
1
- import { t as bundle } from "./bundle-UTFhPSjU.mjs";
2
- import { n as resolveModule, t as resolve } from "./resolve-BU3nddJ7.mjs";
3
- import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-CpEoapmL.mjs";
1
+ import { t as bundle } from "./bundle-z2FneKY-.mjs";
2
+ import { n as resolveModule, t as resolve } from "./resolve-Cy71IFTt.mjs";
3
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-XG5mcDGc.mjs";
4
4
  import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "./build-CrohITJo.mjs";
5
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "./plugin-Bivts13R.mjs";
6
- import { t as createEsbuildPlugin } from "./unplugin-Csi4d8gj.mjs";
5
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "./plugin-B823wBIx.mjs";
6
+ import { t as createEsbuildPlugin } from "./unplugin-BiqKxCQ7.mjs";
7
7
  import "./index-ClXLQ1fw.mjs";
8
8
  import "./index-DJOHDG5e.mjs";
9
- import { Plugin } from "@powerlines/core/types";
9
+ import { Plugin } from "@powerlines/core";
10
10
 
11
11
  //#region src/index.d.ts
12
+ declare module "@powerlines/core" {
13
+ interface BaseConfig {
14
+ esbuild?: EsbuildPluginOptions;
15
+ }
16
+ }
12
17
  /**
13
18
  * A Powerlines plugin to assist in developing other Powerlines plugins.
14
19
  */
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;cAuCa,0BACM,uBAAuB,gCAE/B,yBACR,OAAO"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;cAsCc;;;;;AAJU;AAAA,cAWX,MAXW,EAAA,CAAA,iBAYL,oBAZK,GAYkB,oBAZlB,CAAA,CAAA,OAAA,CAAA,EAcb,oBAda,EAAA,GAerB,MAfqB,CAed,QAfc,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Plugin } from \"@powerlines/core/types\";\nimport defu from \"defu\";\nimport { build } from \"esbuild\";\nimport {\n DEFAULT_ESBUILD_CONFIG,\n resolveEntry,\n resolveOptions\n} from \"./helpers/resolve-options\";\nimport { createEsbuildPlugin } from \"./helpers/unplugin\";\nimport {\n EsbuildPluginContext,\n EsbuildPluginOptions,\n EsbuildPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends EsbuildPluginContext = EsbuildPluginContext\n>(\n options: EsbuildPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"esbuild\",\n config() {\n return {\n output: {\n format: [\"esm\"]\n },\n build: {\n ...DEFAULT_ESBUILD_CONFIG,\n ...options,\n variant: \"esbuild\"\n }\n } as Partial<EsbuildPluginUserConfig>;\n },\n async build() {\n await build(\n defu(\n {\n entryPoints: resolveEntry(this, this.entry),\n plugins: [createEsbuildPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;AAuCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,MAAM,EAChB;IACD,OAAO;KACL,GAAG;KACH,GAAG;KACH,SAAS;KACV;IACF;;EAEH,MAAM,QAAQ;AACZ,SAAM,MACJ,KACE;IACE,aAAa,aAAa,MAAM,KAAK,MAAM;IAC3C,SAAS,CAAC,oBAAoB,KAAK,CAAC;IACrC,EACD,eAAe,KAAK,CACrB,CACF;;EAEJ;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Plugin } from \"@powerlines/core\";\nimport defu from \"defu\";\nimport { build } from \"esbuild\";\nimport {\n DEFAULT_ESBUILD_CONFIG,\n resolveEntry,\n resolveOptions\n} from \"./helpers/resolve-options\";\nimport { createEsbuildPlugin } from \"./helpers/unplugin\";\nimport {\n EsbuildPluginContext,\n EsbuildPluginOptions,\n EsbuildPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface BaseConfig {\n esbuild?: EsbuildPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends EsbuildPluginContext = EsbuildPluginContext\n>(\n options: EsbuildPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"esbuild\",\n config() {\n return {\n output: {\n format: [\"esm\"]\n },\n build: {\n ...DEFAULT_ESBUILD_CONFIG,\n ...options,\n variant: \"esbuild\"\n }\n } as Partial<EsbuildPluginUserConfig>;\n },\n async build() {\n await build(\n defu(\n {\n entryPoints: resolveEntry(this, this.entry),\n plugins: [createEsbuildPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;;;;AA6CA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,MAAM,EAChB;IACD,OAAO;KACL,GAAG;KACH,GAAG;KACH,SAAS;KACV;IACF;;EAEH,MAAM,QAAQ;AACZ,SAAM,MACJ,KACE;IACE,aAAa,aAAa,MAAM,KAAK,MAAM;IAC3C,SAAS,CAAC,oBAAoB,KAAK,CAAC;IACrC,EACD,eAAe,KAAK,CACrB,CACF;;EAEJ;;AAGH,kBAAe"}
@@ -1,5 +1,5 @@
1
1
  import { t as EsbuildOptions } from "./build-Br4iCJ5d.cjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type EsbuildPluginOptions = Partial<EsbuildOptions>;
@@ -16,4 +16,4 @@ declare type __ΩEsbuildPluginResolvedConfig = any[];
16
16
  declare type __ΩEsbuildPluginContext = any[];
17
17
  //#endregion
18
18
  export { __ΩEsbuildPluginContext as a, __ΩEsbuildPluginUserConfig as c, EsbuildPluginUserConfig as i, EsbuildPluginOptions as n, __ΩEsbuildPluginOptions as o, EsbuildPluginResolvedConfig as r, __ΩEsbuildPluginResolvedConfig as s, EsbuildPluginContext as t };
19
- //# sourceMappingURL=plugin-fp0p1CCy.d.cts.map
19
+ //# sourceMappingURL=plugin-7iQtkKC4.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-Bivts13R.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"plugin-7iQtkKC4.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
@@ -1,5 +1,5 @@
1
1
  import { t as EsbuildOptions } from "./build-CrohITJo.mjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
5
5
  type EsbuildPluginOptions = Partial<EsbuildOptions>;
@@ -16,4 +16,4 @@ declare type __ΩEsbuildPluginResolvedConfig = any[];
16
16
  declare type __ΩEsbuildPluginContext = any[];
17
17
  //#endregion
18
18
  export { __ΩEsbuildPluginContext as a, __ΩEsbuildPluginUserConfig as c, EsbuildPluginUserConfig as i, EsbuildPluginOptions as n, __ΩEsbuildPluginOptions as o, EsbuildPluginResolvedConfig as r, __ΩEsbuildPluginResolvedConfig as s, EsbuildPluginContext as t };
19
- //# sourceMappingURL=plugin-Bivts13R.d.mts.map
19
+ //# sourceMappingURL=plugin-B823wBIx.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-fp0p1CCy.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"plugin-B823wBIx.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-C8OzoP-s.mjs","names":["typeDefinition!: TypeDefinition","resolved: any"],"sources":["../src/helpers/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginContext } from \"@powerlines/core/types\";\nimport { bundle } from \"@powerlines/plugin-esbuild/helpers/bundle\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { BuildOptions } from \"esbuild\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<TResult>(\n context: PluginContext,\n type: TypeDefinitionParameter,\n overrides: Partial<BuildOptions> = {}\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle(context, typeDefinition.file, overrides);\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n forceTranspile: true\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel === \"debug\" ||\n context.config.logLevel === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel === \"debug\" ||\n context.config.logLevel === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<TResult>(\n context: PluginContext,\n type: TypeDefinitionParameter,\n overrides: Partial<BuildOptions> = {}\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const resolved = await resolveModule<Record<string, any>>(\n context,\n typeDefinition,\n overrides\n );\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n typeDefinition.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n typeDefinition.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,eAAsB,cACpB,SACA,MACA,YAAmC,EAAE,EACnB;CAClB,IAAIA;AACJ,KAAI,YAAY,KAAK,CACnB,kBAAiB,oBAAoB,KAAK;KAE1C,kBAAiB;CAGnB,MAAM,SAAS,MAAM,OAAO,SAAS,eAAe,MAAM,UAAU;CAEpE,IAAIC;AACJ,KAAI;AACF,aAAW,MAAM,QAAQ,SAAS,WAAW,OAAO,MAAM;GACxD,UAAU,OAAO;GACjB,gBAAgB;GACjB,CAAC;UACK,OAAO;AACd,MACE,YAAa,MAAgB,QAAQ,qBACrC,IAAI,OACF,uBAAuB,QAAQ,OAAO,aAAa,aAAa,MACjE,EAAC,KAAM,MAAgB,QAAQ,EAChC;GACA,MAAM,aAAc,MAAgB,QAAQ,sBAC1C,IAAI,OACF,wBAAwB,QAAQ,OAAO,aAAa,aAAa,OAClE,CACF,GAAG;AACJ,SAAM,IAAI,MACR,eAAe,WAAW,4CACxB,eAAe,KAChB,uHACC,QAAQ,OAAO,aAAa,WAC5B,QAAQ,OAAO,aAAa,UACxB;;;EAGZ,OAAO,SACK,KAEP;;AAGH,QAAM,IAAI,MACR,8CACE,eAAe,KAChB,YAAa,MAAgB,UAC5B,QAAQ,OAAO,aAAa,WAC5B,QAAQ,OAAO,aAAa,UACxB;;;EAGV,OAAO,SACG,KAEP;;AAGH,QAAO;;;;;;;;;;AAWT,eAAsB,QACpB,SACA,MACA,YAAmC,EAAE,EACnB;CAClB,IAAID;AACJ,KAAI,YAAY,KAAK,CACnB,kBAAiB,oBAAoB,KAAK;KAE1C,kBAAiB;CAGnB,MAAM,WAAW,MAAM,cACrB,SACA,gBACA,UACD;CAED,IAAI,aAAa,eAAe;AAChC,KAAI,CAAC,WACH,cAAa;CAGf,MAAM,iBAAiB,SAAS,eAAe,SAAS,MAAM;AAC9D,KAAI,mBAAmB,OACrB,OAAM,IAAI,MACR,eAAe,WAAW,kCACxB,eAAe,KAChB,YACC,OAAO,KAAK,SAAS,CAAC,WAAW,IAC7B,gFACE,eAAe,KAChB,kBAAkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,SACD,CAAC,KACA,KACD,CAAC,kEAET;AAGH,QAAO"}
1
+ {"version":3,"file":"resolve-C8OzoP-s.mjs","names":["typeDefinition!: TypeDefinition","resolved: any"],"sources":["../src/helpers/resolve.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { PluginContext } from \"@powerlines/core\";\nimport { bundle } from \"@powerlines/plugin-esbuild/helpers/bundle\";\nimport { parseTypeDefinition } from \"@stryke/convert/parse-type-definition\";\nimport { isSetString } from \"@stryke/type-checks/is-set-string\";\nimport {\n TypeDefinition,\n TypeDefinitionParameter\n} from \"@stryke/types/configuration\";\nimport { BuildOptions } from \"esbuild\";\n\n/**\n * Compiles a type definition to a module and returns the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolveModule<TResult>(\n context: PluginContext,\n type: TypeDefinitionParameter,\n overrides: Partial<BuildOptions> = {}\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const result = await bundle(context, typeDefinition.file, overrides);\n\n let resolved: any;\n try {\n resolved = await context.resolver.evalModule(result.text, {\n filename: result.path,\n forceTranspile: true\n });\n } catch (error) {\n if (\n isSetString((error as Error).message) &&\n new RegExp(\n `Cannot find module '${context.config.framework || \"powerlines\"}:.*'`\n ).test((error as Error).message)\n ) {\n const moduleName = (error as Error).message.match(\n new RegExp(\n `Cannot find module '(${context.config.framework || \"powerlines\"}:.*)'`\n )\n )?.[1];\n throw new Error(\n `The module \"${moduleName}\" could not be resolved while evaluating \"${\n typeDefinition.file\n }\". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${\n context.config.logLevel === \"debug\" ||\n context.config.logLevel === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n throw new Error(\n `Failed to evaluate the bundled module for \"${\n typeDefinition.file\n }\". Error: ${(error as Error).message}${\n context.config.logLevel === \"debug\" ||\n context.config.logLevel === \"trace\"\n ? `\n\nBundle output for module:\n${result.text}`\n : \"\"\n }`\n );\n }\n\n return resolved;\n}\n\n/**\n * Compiles a type definition to a module and returns the specified export from the module.\n *\n * @param context - The context object containing the environment paths.\n * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the compiled module.\n */\nexport async function resolve<TResult>(\n context: PluginContext,\n type: TypeDefinitionParameter,\n overrides: Partial<BuildOptions> = {}\n): Promise<TResult> {\n let typeDefinition!: TypeDefinition;\n if (isSetString(type)) {\n typeDefinition = parseTypeDefinition(type) as TypeDefinition;\n } else {\n typeDefinition = type;\n }\n\n const resolved = await resolveModule<Record<string, any>>(\n context,\n typeDefinition,\n overrides\n );\n\n let exportName = typeDefinition.name;\n if (!exportName) {\n exportName = \"default\";\n }\n\n const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];\n if (resolvedExport === undefined) {\n throw new Error(\n `The export \"${exportName}\" could not be resolved in the \"${\n typeDefinition.file\n }\" module. ${\n Object.keys(resolved).length === 0\n ? `After bundling, no exports were found in the module. Please ensure that the \"${\n typeDefinition.file\n }\" module has a \"${exportName}\" export with the desired value.`\n : `After bundling, the available exports were: ${Object.keys(\n resolved\n ).join(\n \", \"\n )}. Please ensure that the export exists and is correctly named.`\n }`\n );\n }\n\n return resolvedExport;\n}\n"],"mappings":";;;;;;;;;;;;;AAoCA,eAAsB,cACpB,SACA,MACA,YAAmC,EAAE,EACnB;CAClB,IAAIA;AACJ,KAAI,YAAY,KAAK,CACnB,kBAAiB,oBAAoB,KAAK;KAE1C,kBAAiB;CAGnB,MAAM,SAAS,MAAM,OAAO,SAAS,eAAe,MAAM,UAAU;CAEpE,IAAIC;AACJ,KAAI;AACF,aAAW,MAAM,QAAQ,SAAS,WAAW,OAAO,MAAM;GACxD,UAAU,OAAO;GACjB,gBAAgB;GACjB,CAAC;UACK,OAAO;AACd,MACE,YAAa,MAAgB,QAAQ,qBACrC,IAAI,OACF,uBAAuB,QAAQ,OAAO,aAAa,aAAa,MACjE,EAAC,KAAM,MAAgB,QAAQ,EAChC;GACA,MAAM,aAAc,MAAgB,QAAQ,sBAC1C,IAAI,OACF,wBAAwB,QAAQ,OAAO,aAAa,aAAa,OAClE,CACF,GAAG;AACJ,SAAM,IAAI,MACR,eAAe,WAAW,4CACxB,eAAe,KAChB,uHACC,QAAQ,OAAO,aAAa,WAC5B,QAAQ,OAAO,aAAa,UACxB;;;EAGZ,OAAO,SACK,KAEP;;AAGH,QAAM,IAAI,MACR,8CACE,eAAe,KAChB,YAAa,MAAgB,UAC5B,QAAQ,OAAO,aAAa,WAC5B,QAAQ,OAAO,aAAa,UACxB;;;EAGV,OAAO,SACG,KAEP;;AAGH,QAAO;;;;;;;;;;AAWT,eAAsB,QACpB,SACA,MACA,YAAmC,EAAE,EACnB;CAClB,IAAID;AACJ,KAAI,YAAY,KAAK,CACnB,kBAAiB,oBAAoB,KAAK;KAE1C,kBAAiB;CAGnB,MAAM,WAAW,MAAM,cACrB,SACA,gBACA,UACD;CAED,IAAI,aAAa,eAAe;AAChC,KAAI,CAAC,WACH,cAAa;CAGf,MAAM,iBAAiB,SAAS,eAAe,SAAS,MAAM;AAC9D,KAAI,mBAAmB,OACrB,OAAM,IAAI,MACR,eAAe,WAAW,kCACxB,eAAe,KAChB,YACC,OAAO,KAAK,SAAS,CAAC,WAAW,IAC7B,gFACE,eAAe,KAChB,kBAAkB,WAAW,oCAC9B,+CAA+C,OAAO,KACpD,SACD,CAAC,KACA,KACD,CAAC,kEAET;AAGH,QAAO"}
@@ -1,5 +1,5 @@
1
1
  import { BuildOptions } from "esbuild";
2
- import { PluginContext } from "@powerlines/core/types";
2
+ import { PluginContext } from "@powerlines/core";
3
3
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
4
4
 
5
5
  //#region src/helpers/resolve.d.ts
@@ -24,4 +24,4 @@ declare function resolveModule<TResult>(context: PluginContext, type: TypeDefini
24
24
  declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
25
25
  //#endregion
26
26
  export { resolveModule as n, resolve as t };
27
- //# sourceMappingURL=resolve-BU3nddJ7.d.mts.map
27
+ //# sourceMappingURL=resolve-Cy71IFTt.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-BU3nddJ7.d.mts","names":[],"sources":["../src/helpers/resolve.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoCA;;;;;;AAIG,iBAJmB,aAInB,CAAA,OAAA,CAAA,CAAA,OAAA,EAHQ,aAGR,EAAA,IAAA,EAFK,uBAEL,EAAA,SAAA,CAAA,EADU,OACV,CADkB,YAClB,CAAA,CAAA,EAAA,OAAA,CAAQ,OAAR,CAAA;;AAqEH;;;;;;;AAIU,iBAJY,OAIZ,CAAA,OAAA,CAAA,CAAA,OAAA,EAHC,aAGD,EAAA,IAAA,EAFF,uBAEE,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,OAAD,CAAA"}
1
+ {"version":3,"file":"resolve-Cy71IFTt.d.mts","names":[],"sources":["../src/helpers/resolve.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoCA;;;;;;AAIG,iBAJmB,aAInB,CAAA,OAAA,CAAA,CAAA,OAAA,EAHQ,aAGR,EAAA,IAAA,EAFK,uBAEL,EAAA,SAAA,CAAA,EADU,OACV,CADkB,YAClB,CAAA,CAAA,EAAA,OAAA,CAAQ,OAAR,CAAA;;AAqEH;;;;;;;AAIU,iBAJY,OAIZ,CAAA,OAAA,CAAA,CAAA,OAAA,EAHC,aAGD,EAAA,IAAA,EAFF,uBAEE,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,OAAD,CAAA"}
@@ -1,5 +1,5 @@
1
+ import { PluginContext } from "@powerlines/core";
1
2
  import { BuildOptions } from "esbuild";
2
- import { PluginContext } from "@powerlines/core/types";
3
3
  import { TypeDefinitionParameter } from "@stryke/types/configuration";
4
4
 
5
5
  //#region src/helpers/resolve.d.ts
@@ -24,4 +24,4 @@ declare function resolveModule<TResult>(context: PluginContext, type: TypeDefini
24
24
  declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
25
25
  //#endregion
26
26
  export { resolveModule as n, resolve as t };
27
- //# sourceMappingURL=resolve-BUiEAXVB.d.cts.map
27
+ //# sourceMappingURL=resolve-DaXV27Bb.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-BUiEAXVB.d.cts","names":[],"sources":["../src/helpers/resolve.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoCA;;;;;;AAIG,iBAJmB,aAInB,CAAA,OAAA,CAAA,CAAA,OAAA,EAHQ,aAGR,EAAA,IAAA,EAFK,uBAEL,EAAA,SAAA,CAAA,EADU,OACV,CADkB,YAClB,CAAA,CAAA,EAAA,OAAA,CAAQ,OAAR,CAAA;;AAqEH;;;;;;;AAIU,iBAJY,OAIZ,CAAA,OAAA,CAAA,CAAA,OAAA,EAHC,aAGD,EAAA,IAAA,EAFF,uBAEE,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,OAAD,CAAA"}
1
+ {"version":3,"file":"resolve-DaXV27Bb.d.cts","names":[],"sources":["../src/helpers/resolve.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAoCA;;;;;;AAIG,iBAJmB,aAInB,CAAA,OAAA,CAAA,CAAA,OAAA,EAHQ,aAGR,EAAA,IAAA,EAFK,uBAEL,EAAA,SAAA,CAAA,EADU,OACV,CADkB,YAClB,CAAA,CAAA,EAAA,OAAA,CAAQ,OAAR,CAAA;;AAqEH;;;;;;;AAIU,iBAJY,OAIZ,CAAA,OAAA,CAAA,CAAA,OAAA,EAHC,aAGD,EAAA,IAAA,EAFF,uBAEE,EAAA,SAAA,CAAA,EADG,OACH,CADW,YACX,CAAA,CAAA,EAAP,OAAO,CAAC,OAAD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-options-C-213jz6.mjs","names":["DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport type {\n Context,\n ResolvedEntryTypeDefinition\n} from \"@powerlines/core/types\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { BuildOptions, Format, LogLevel, Platform } from \"esbuild\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[] = []\n): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n (context as EsbuildPluginContext).config?.esbuild\n ? (context as EsbuildPluginContext).config.esbuild\n : {},\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : (context as EsbuildPluginContext).config?.esbuild\n ? ((context as EsbuildPluginContext).config?.esbuild as BuildOptions)\n .packages\n : undefined,\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;AA+BA,MAAaA,yBAAgD;CAC3D,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,aAAa;CACb,WAAW;CACX,WAAW;CACX,UAAU;CACX;;;;;;;;AASD,SAAgB,aACd,SACA,cAAwD,EAAE,EAC7B;AAC7B,QAAO,YAAY,QAChB,KAAK,UAAU;AACd,MAAI,SAAS,MAAM,CACjB,KAAI,iBAAiB,YAAY,OAAO,QAAQ,OAAO,KAAK,CAAC,IAC3D,YAAY,OAAO,QAAQ,OAAO,KAAK;MAEzC,KAAI,MAAM,UAAU,mBAAmB,SAAS,MAAM,IAAI,MAAM;AAGlE,SAAO;IAET,EAAE,CACH;;;;;;;;AASH,SAAgB,eAAe,SAAgC;AAC7D,KAAI,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,EACvE,SAAQ,GAAG,UACT,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,EACD,OAAO,QAAQ,QAAQ,OAAO,OAAO,CAClC,KAAK,CAAC,KAAK,WAAW;AACrB,MAAI,MACF,KAAI,MAAM,QAAQ,MAAM,EACtB;OAAI,UAAU,IAAI,KAAK,KACrB;QAAI,MAAM,WAAW,EACnB,QAAO;SAChB,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;aACV,MAAM,SAAS,EACxB,QAAO;SAChB,MAAM,OAAO,MAAM,QAAQ,UAAU,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,UAAU,IAAI,CAAC,IAAI,SAAS,MAAM,GAAG;WACrG,UAAU,IAAI,CAAC,OAAO,IAAI;cAEZ,MAAM,WAAW,EAC1B,QAAO;SACd,IAAI,SAAS,MAAM,GAAG;WACpB,IAAI;YACU,MAAM,SAAS,EACxB,QAAO;SACd,MAAM,OAAO,MAAM,QAAQ,QAAQ,KAAK,MAAM,GAAG,MAAM,IAAI,IAAI,SAAS,MAAM,GAAG;WAC/E,IAAI;aAEQ,UAAU,IAAI,KAAK,IAC5B,QAAO;SACZ,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;MAEvB,QAAO;SACZ,IAAI,SAAS,MAAM;WACjB,IAAI;AAIL,SAAO;GACP,CACD,KAAK,KAAK,CACd;AAGH,QAAO,KACL;EACE,OAAO,QAAQ;EACf,QACE,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,IACjE,CACE,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,CACF,GACD;EACP,EACA,QAAiC,QAAQ,UACrC,QAAiC,OAAO,UACzC,EAAE,EACN;EACE,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,QAAQ,QAAQ,OAAO;EACvB,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,UAAU,QAAQ,OAAO,QAAQ,wBAC7B,aACC,QAAiC,QAAQ,WACtC,QAAiC,QAAQ,SACxC,WACH;EACN,QAAS,MAAM,QAAQ,QAAQ,OAAO,OAAO,OAAO,GAChD,QAAQ,OAAO,OAAO,OAAO,KAC7B,QAAQ,OAAO,OAAO;EAC1B,UAAU,QAAQ,OAAO;EACzB,QAAQ,QAAQ,OAAO,OAAO;EAC9B,UAAU,QAAQ,SAAS;EAC3B,QAAQ,QAAQ,OAAO,SAAS;EAChC,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,SAAS;EACpC,EACD,uBACD"}
1
+ {"version":3,"file":"resolve-options-C-213jz6.mjs","names":["DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { Context, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { replaceExtension, replacePath } from \"@stryke/path/replace\";\nimport { camelCase } from \"@stryke/string-format/camel-case\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { BuildOptions, Format, LogLevel, Platform } from \"esbuild\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\" as Platform,\n format: \"esm\" as Format,\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\" as LogLevel\n};\n\n/**\n * Resolves the entry options for esbuild.\n *\n * @param context - The build context.\n * @param entryPoints - The entry points to resolve.\n * @returns The resolved entry options.\n */\nexport function resolveEntry(\n context: Context,\n entryPoints: ResolvedEntryTypeDefinition[] | string[] = []\n): BuildOptions[\"entryPoints\"] {\n return entryPoints.reduce(\n (ret, entry) => {\n if (isString(entry)) {\n ret[replaceExtension(replacePath(entry, context.config.root))] =\n replacePath(entry, context.config.root);\n } else {\n ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;\n }\n\n return ret;\n },\n {} as Record<string, string>\n );\n}\n\n/**\n * Resolves the esbuild options.\n *\n * @param context - The build context.\n * @returns The resolved esbuild options.\n */\nexport function resolveOptions(context: Context): BuildOptions {\n if (context.config.inject && Object.keys(context.config.inject).length > 0) {\n context.fs.writeSync(\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n ),\n Object.entries(context.config.inject)\n .map(([key, value]) => {\n if (value) {\n if (Array.isArray(value)) {\n if (camelCase(key) !== key) {\n if (value.length === 1) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n }\n } else if (value.length === 1) {\n return `\nimport ${key} from \"${value[0]}\";\nexport { ${key} };`;\n } else if (value.length > 1) {\n return `\nimport ${value[1] === \"*\" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from \"${value[0]}\";\nexport { ${key} };`;\n }\n } else if (camelCase(key) !== key) {\n return `\nimport ${camelCase(key)} from \"${value[0]}\";\nexport { ${camelCase(key)} as \"${key}\" }`;\n } else {\n return `\nimport ${key} from \"${value}\";\nexport { ${key} };`;\n }\n }\n\n return \"\";\n })\n .join(\"\\n\")\n );\n }\n\n return defu(\n {\n alias: context.alias,\n inject:\n context.config.inject && Object.keys(context.config.inject).length > 0\n ? [\n joinPaths(\n context.workspaceConfig.workspaceRoot,\n context.config.root,\n context.artifactsPath,\n \"inject-shim.js\"\n )\n ]\n : undefined\n },\n (context as EsbuildPluginContext).config?.esbuild\n ? (context as EsbuildPluginContext).config.esbuild\n : {},\n {\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n resolveExtensions: context.config.resolve.extensions,\n packages: context.config.resolve.skipNodeModulesBundle\n ? \"external\"\n : (context as EsbuildPluginContext).config?.esbuild\n ? ((context as EsbuildPluginContext).config?.esbuild as BuildOptions)\n .packages\n : undefined,\n format: (Array.isArray(context.config.output.format)\n ? context.config.output.format[0]\n : context.config.output.format) as Format,\n platform: context.config.platform,\n outdir: context.config.output.buildPath,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.mode !== \"development\",\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;AA4BA,MAAaA,yBAAgD;CAC3D,QAAQ;CACR,UAAU;CACV,QAAQ;CACR,OAAO;CACP,QAAQ;CACR,WAAW;CACX,QAAQ;CACR,aAAa;CACb,WAAW;CACX,WAAW;CACX,UAAU;CACX;;;;;;;;AASD,SAAgB,aACd,SACA,cAAwD,EAAE,EAC7B;AAC7B,QAAO,YAAY,QAChB,KAAK,UAAU;AACd,MAAI,SAAS,MAAM,CACjB,KAAI,iBAAiB,YAAY,OAAO,QAAQ,OAAO,KAAK,CAAC,IAC3D,YAAY,OAAO,QAAQ,OAAO,KAAK;MAEzC,KAAI,MAAM,UAAU,mBAAmB,SAAS,MAAM,IAAI,MAAM;AAGlE,SAAO;IAET,EAAE,CACH;;;;;;;;AASH,SAAgB,eAAe,SAAgC;AAC7D,KAAI,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,EACvE,SAAQ,GAAG,UACT,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,EACD,OAAO,QAAQ,QAAQ,OAAO,OAAO,CAClC,KAAK,CAAC,KAAK,WAAW;AACrB,MAAI,MACF,KAAI,MAAM,QAAQ,MAAM,EACtB;OAAI,UAAU,IAAI,KAAK,KACrB;QAAI,MAAM,WAAW,EACnB,QAAO;SAChB,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;aACV,MAAM,SAAS,EACxB,QAAO;SAChB,MAAM,OAAO,MAAM,QAAQ,UAAU,IAAI,KAAK,KAAK,MAAM,GAAG,MAAM,UAAU,IAAI,CAAC,IAAI,SAAS,MAAM,GAAG;WACrG,UAAU,IAAI,CAAC,OAAO,IAAI;cAEZ,MAAM,WAAW,EAC1B,QAAO;SACd,IAAI,SAAS,MAAM,GAAG;WACpB,IAAI;YACU,MAAM,SAAS,EACxB,QAAO;SACd,MAAM,OAAO,MAAM,QAAQ,QAAQ,KAAK,MAAM,GAAG,MAAM,IAAI,IAAI,SAAS,MAAM,GAAG;WAC/E,IAAI;aAEQ,UAAU,IAAI,KAAK,IAC5B,QAAO;SACZ,UAAU,IAAI,CAAC,SAAS,MAAM,GAAG;WAC/B,UAAU,IAAI,CAAC,OAAO,IAAI;MAEvB,QAAO;SACZ,IAAI,SAAS,MAAM;WACjB,IAAI;AAIL,SAAO;GACP,CACD,KAAK,KAAK,CACd;AAGH,QAAO,KACL;EACE,OAAO,QAAQ;EACf,QACE,QAAQ,OAAO,UAAU,OAAO,KAAK,QAAQ,OAAO,OAAO,CAAC,SAAS,IACjE,CACE,UACE,QAAQ,gBAAgB,eACxB,QAAQ,OAAO,MACf,QAAQ,eACR,iBACD,CACF,GACD;EACP,EACA,QAAiC,QAAQ,UACrC,QAAiC,OAAO,UACzC,EAAE,EACN;EACE,YAAY,QAAQ,OAAO,QAAQ;EACnC,YAAY,QAAQ,OAAO,QAAQ;EACnC,QAAQ,QAAQ,OAAO;EACvB,mBAAmB,QAAQ,OAAO,QAAQ;EAC1C,UAAU,QAAQ,OAAO,QAAQ,wBAC7B,aACC,QAAiC,QAAQ,WACtC,QAAiC,QAAQ,SACxC,WACH;EACN,QAAS,MAAM,QAAQ,QAAQ,OAAO,OAAO,OAAO,GAChD,QAAQ,OAAO,OAAO,OAAO,KAC7B,QAAQ,OAAO,OAAO;EAC1B,UAAU,QAAQ,OAAO;EACzB,QAAQ,QAAQ,OAAO,OAAO;EAC9B,UAAU,QAAQ,SAAS;EAC3B,QAAQ,QAAQ,OAAO,SAAS;EAChC,UAAU,QAAQ,OAAO,SAAS;EAClC,WAAW,QAAQ,OAAO,SAAS;EACpC,EACD,uBACD"}
@@ -1,5 +1,5 @@
1
+ import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core";
1
2
  import { BuildOptions } from "esbuild";
2
- import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core/types";
3
3
 
4
4
  //#region src/helpers/resolve-options.d.ts
5
5
  declare const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>;
@@ -20,4 +20,4 @@ declare function resolveEntry(context: Context, entryPoints?: ResolvedEntryTypeD
20
20
  declare function resolveOptions(context: Context): BuildOptions;
21
21
  //#endregion
22
22
  export { resolveEntry as n, resolveOptions as r, DEFAULT_ESBUILD_CONFIG as t };
23
- //# sourceMappingURL=resolve-options-CpEoapmL.d.mts.map
23
+ //# sourceMappingURL=resolve-options-Dv4d9qj2.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-options-CpEoapmL.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA+Ba,wBAAwB,QAAQ;;AAA7C;AAqBA;;;;;AAyBgB,iBAzBA,YAAA,CAyBwB,OAAU,EAxBvC,OAwBuC,EAAY,WAAA,CAAA,EAvB/C,2BAuB+C,EAAA,GAAA,MAAA,EAAA,CAAA,EAtB3D,YAsB2D,CAAA,aAAA,CAAA;;;;;;;iBAA9C,cAAA,UAAwB,UAAU"}
1
+ {"version":3,"file":"resolve-options-Dv4d9qj2.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,wBAAwB,QAAQ;;AAA7C;AAqBA;;;;;AAyBgB,iBAzBA,YAAA,CAyBwB,OAAU,EAxBvC,OAwBuC,EAAY,WAAA,CAAA,EAvB/C,2BAuB+C,EAAA,GAAA,MAAA,EAAA,CAAA,EAtB3D,YAsB2D,CAAA,aAAA,CAAA;;;;;;;iBAA9C,cAAA,UAAwB,UAAU"}
@@ -1,5 +1,5 @@
1
1
  import { BuildOptions } from "esbuild";
2
- import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core/types";
2
+ import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core";
3
3
 
4
4
  //#region src/helpers/resolve-options.d.ts
5
5
  declare const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>;
@@ -20,4 +20,4 @@ declare function resolveEntry(context: Context, entryPoints?: ResolvedEntryTypeD
20
20
  declare function resolveOptions(context: Context): BuildOptions;
21
21
  //#endregion
22
22
  export { resolveEntry as n, resolveOptions as r, DEFAULT_ESBUILD_CONFIG as t };
23
- //# sourceMappingURL=resolve-options-DSHX7AUS.d.cts.map
23
+ //# sourceMappingURL=resolve-options-XG5mcDGc.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"resolve-options-DSHX7AUS.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA+Ba,wBAAwB,QAAQ;;AAA7C;AAqBA;;;;;AAyBgB,iBAzBA,YAAA,CAyBwB,OAAU,EAxBvC,OAwBuC,EAAY,WAAA,CAAA,EAvB/C,2BAuB+C,EAAA,GAAA,MAAA,EAAA,CAAA,EAtB3D,YAsB2D,CAAA,aAAA,CAAA;;;;;;;iBAA9C,cAAA,UAAwB,UAAU"}
1
+ {"version":3,"file":"resolve-options-XG5mcDGc.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;cA4Ba,wBAAwB,QAAQ;;AAA7C;AAqBA;;;;;AAyBgB,iBAzBA,YAAA,CAyBwB,OAAU,EAxBvC,OAwBuC,EAAY,WAAA,CAAA,EAvB/C,2BAuB+C,EAAA,GAAA,MAAA,EAAA,CAAA,EAtB3D,YAsB2D,CAAA,aAAA,CAAA;;;;;;;iBAA9C,cAAA,UAAwB,UAAU"}
@@ -1,4 +1,4 @@
1
1
  import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "../build-Br4iCJ5d.cjs";
2
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-fp0p1CCy.cjs";
2
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-7iQtkKC4.cjs";
3
3
  import "../index-sQecLSpR.cjs";
4
4
  export { EsbuildOptions, EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildOptions, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
@@ -1,4 +1,4 @@
1
1
  import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "../build-CrohITJo.mjs";
2
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-Bivts13R.mjs";
2
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-B823wBIx.mjs";
3
3
  import "../index-DJOHDG5e.mjs";
4
4
  export { EsbuildOptions, EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildOptions, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
@@ -1,3 +1,3 @@
1
1
  import "../build-Br4iCJ5d.cjs";
2
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-fp0p1CCy.cjs";
2
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-7iQtkKC4.cjs";
3
3
  export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
@@ -1,3 +1,3 @@
1
1
  import "../build-CrohITJo.mjs";
2
- import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-Bivts13R.mjs";
2
+ import { a as __ΩEsbuildPluginContext, c as __ΩEsbuildPluginUserConfig, i as EsbuildPluginUserConfig, n as EsbuildPluginOptions, o as __ΩEsbuildPluginOptions, r as EsbuildPluginResolvedConfig, s as __ΩEsbuildPluginResolvedConfig, t as EsbuildPluginContext } from "../plugin-B823wBIx.mjs";
3
3
  export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
@@ -1,8 +1,8 @@
1
- import { t as EsbuildPluginContext } from "./plugin-fp0p1CCy.cjs";
1
+ import { t as EsbuildPluginContext } from "./plugin-B823wBIx.mjs";
2
2
  import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/helpers/unplugin.d.ts
5
5
  declare function createEsbuildPlugin(context: EsbuildPluginContext): esbuild0.Plugin;
6
6
  //#endregion
7
7
  export { createEsbuildPlugin as t };
8
- //# sourceMappingURL=unplugin-Cf7hyWQE.d.cts.map
8
+ //# sourceMappingURL=unplugin-BiqKxCQ7.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-BiqKxCQ7.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}
@@ -1,8 +1,8 @@
1
- import { t as EsbuildPluginContext } from "./plugin-Bivts13R.mjs";
1
+ import { t as EsbuildPluginContext } from "./plugin-7iQtkKC4.cjs";
2
2
  import * as esbuild0 from "esbuild";
3
3
 
4
4
  //#region src/helpers/unplugin.d.ts
5
5
  declare function createEsbuildPlugin(context: EsbuildPluginContext): esbuild0.Plugin;
6
6
  //#endregion
7
7
  export { createEsbuildPlugin as t };
8
- //# sourceMappingURL=unplugin-Csi4d8gj.d.mts.map
8
+ //# sourceMappingURL=unplugin-DYA9P9Jn.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-DYA9P9Jn.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-esbuild",
3
- "version": "0.13.309",
3
+ "version": "0.13.311",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to build projects using esbuild.",
6
6
  "keywords": ["esbuild", "powerlines", "storm-software", "powerlines-plugin"],
@@ -83,7 +83,7 @@
83
83
  "peerDependencies": { "esbuild": ">=0.25.0" },
84
84
  "peerDependenciesMeta": { "esbuild": { "optional": false } },
85
85
  "dependencies": {
86
- "@powerlines/core": "^0.0.11",
86
+ "@powerlines/core": "^0.1.0",
87
87
  "@stryke/fs": "^0.33.43",
88
88
  "@stryke/path": "^0.26.6",
89
89
  "@stryke/type-checks": "^0.5.25",
@@ -94,5 +94,5 @@
94
94
  },
95
95
  "devDependencies": { "esbuild": "^0.25.12", "@types/node": "^25.3.3" },
96
96
  "publishConfig": { "access": "public" },
97
- "gitHead": "645a902416b92ae709b2ae786c21d3ec0be09258"
97
+ "gitHead": "e63eb5a0ecd0e5ee3e030388ad1c534b3ecb2136"
98
98
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-Cf7hyWQE.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-Csi4d8gj.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}