@powerlines/plugin-esbuild 0.13.307 → 0.13.309

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 (167) hide show
  1. package/dist/build-Br4iCJ5d.d.cts +8 -0
  2. package/dist/build-Br4iCJ5d.d.cts.map +1 -0
  3. package/dist/build-CQpSv6Qa.cjs +0 -0
  4. package/dist/build-CrohITJo.d.mts +8 -0
  5. package/dist/build-CrohITJo.d.mts.map +1 -0
  6. package/dist/build-DfzG3fLI.mjs +1 -0
  7. package/dist/bundle-Bx7Mimeh.d.cts +17 -0
  8. package/dist/bundle-Bx7Mimeh.d.cts.map +1 -0
  9. package/dist/bundle-D6QqCoyO.mjs +41 -0
  10. package/dist/bundle-D6QqCoyO.mjs.map +1 -0
  11. package/dist/bundle-DG12gVtZ.cjs +46 -0
  12. package/dist/bundle-UTFhPSjU.d.mts +17 -0
  13. package/dist/bundle-UTFhPSjU.d.mts.map +1 -0
  14. package/dist/helpers/bundle.cjs +3 -42
  15. package/dist/helpers/bundle.d.cts +2 -17
  16. package/dist/helpers/bundle.d.mts +2 -17
  17. package/dist/helpers/bundle.mjs +3 -41
  18. package/dist/helpers/index.cjs +12 -11
  19. package/dist/helpers/index.d.cts +7 -4
  20. package/dist/helpers/index.d.mts +7 -4
  21. package/dist/helpers/index.mjs +5 -4
  22. package/dist/helpers/resolve-options.cjs +4 -89
  23. package/dist/helpers/resolve-options.d.cts +2 -24
  24. package/dist/helpers/resolve-options.d.mts +2 -25
  25. package/dist/helpers/resolve-options.mjs +2 -86
  26. package/dist/helpers/resolve.cjs +3 -62
  27. package/dist/helpers/resolve.d.cts +2 -27
  28. package/dist/helpers/resolve.d.mts +2 -28
  29. package/dist/helpers/resolve.mjs +2 -61
  30. package/dist/helpers/unplugin.cjs +2 -11
  31. package/dist/helpers/unplugin.d.cts +4 -8
  32. package/dist/helpers/unplugin.d.mts +4 -8
  33. package/dist/helpers/unplugin.mjs +2 -11
  34. package/dist/helpers-BAUlPOQe.mjs +1 -0
  35. package/dist/helpers-CAF8Bmv1.cjs +0 -0
  36. package/dist/index-ClXLQ1fw.d.mts +1 -0
  37. package/dist/index-DJOHDG5e.d.mts +1 -0
  38. package/dist/index-DeEmP3Jc.d.cts +1 -0
  39. package/dist/index-sQecLSpR.d.cts +1 -0
  40. package/dist/index.cjs +20 -18
  41. package/dist/index.d.cts +9 -7
  42. package/dist/index.d.cts.map +1 -1
  43. package/dist/index.d.mts +9 -10
  44. package/dist/index.d.mts.map +1 -1
  45. package/dist/index.mjs +8 -5
  46. package/dist/index.mjs.map +1 -1
  47. package/dist/plugin-BL8TLixo.mjs +1 -0
  48. package/dist/plugin-Bivts13R.d.mts +19 -0
  49. package/dist/plugin-Bivts13R.d.mts.map +1 -0
  50. package/dist/plugin-OjUZLLkc.cjs +0 -0
  51. package/dist/plugin-fp0p1CCy.d.cts +19 -0
  52. package/dist/plugin-fp0p1CCy.d.cts.map +1 -0
  53. package/dist/resolve-BU3nddJ7.d.mts +27 -0
  54. package/dist/resolve-BU3nddJ7.d.mts.map +1 -0
  55. package/dist/resolve-BUiEAXVB.d.cts +27 -0
  56. package/dist/resolve-BUiEAXVB.d.cts.map +1 -0
  57. package/dist/resolve-C8OzoP-s.mjs +62 -0
  58. package/dist/resolve-C8OzoP-s.mjs.map +1 -0
  59. package/dist/resolve-CsStIaEj.cjs +73 -0
  60. package/dist/resolve-options-C-213jz6.mjs +87 -0
  61. package/dist/resolve-options-C-213jz6.mjs.map +1 -0
  62. package/dist/resolve-options-C3WIGKaG.cjs +137 -0
  63. package/dist/resolve-options-CpEoapmL.d.mts +23 -0
  64. package/dist/resolve-options-CpEoapmL.d.mts.map +1 -0
  65. package/dist/resolve-options-DSHX7AUS.d.cts +23 -0
  66. package/dist/resolve-options-DSHX7AUS.d.cts.map +1 -0
  67. package/dist/types/build.cjs +1 -0
  68. package/dist/types/build.d.cts +2 -8
  69. package/dist/types/build.d.mts +2 -8
  70. package/dist/types/build.mjs +2 -0
  71. package/dist/types/index.cjs +3 -0
  72. package/dist/types/index.d.cts +3 -2
  73. package/dist/types/index.d.mts +3 -2
  74. package/dist/types/index.mjs +4 -0
  75. package/dist/types/plugin.cjs +1 -0
  76. package/dist/types/plugin.d.cts +3 -20
  77. package/dist/types/plugin.d.mts +3 -21
  78. package/dist/types/plugin.mjs +2 -0
  79. package/dist/types-CvhspRRt.mjs +1 -0
  80. package/dist/types-DdloOYgD.cjs +0 -0
  81. package/dist/unplugin-CW_BVHFj.cjs +16 -0
  82. package/dist/unplugin-Cf7hyWQE.d.cts +8 -0
  83. package/dist/unplugin-Cf7hyWQE.d.cts.map +1 -0
  84. package/dist/unplugin-Csi4d8gj.d.mts +8 -0
  85. package/dist/unplugin-Csi4d8gj.d.mts.map +1 -0
  86. package/dist/unplugin-_Yvl6iM8.mjs +11 -0
  87. package/dist/unplugin-_Yvl6iM8.mjs.map +1 -0
  88. package/package.json +3 -3
  89. package/dist/_virtual/rolldown_runtime.cjs +0 -29
  90. package/dist/core/src/lib/entry.cjs +0 -22
  91. package/dist/core/src/lib/entry.mjs +0 -22
  92. package/dist/core/src/lib/entry.mjs.map +0 -1
  93. package/dist/core/src/lib/logger.cjs +0 -41
  94. package/dist/core/src/lib/logger.mjs +0 -40
  95. package/dist/core/src/lib/logger.mjs.map +0 -1
  96. package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
  97. package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
  98. package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
  99. package/dist/core/src/lib/unplugin/index.cjs +0 -3
  100. package/dist/core/src/lib/unplugin/index.mjs +0 -5
  101. package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
  102. package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
  103. package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
  104. package/dist/core/src/lib/unplugin/plugin.cjs +0 -104
  105. package/dist/core/src/lib/unplugin/plugin.mjs +0 -103
  106. package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
  107. package/dist/core/src/lib/utilities/source-file.cjs +0 -22
  108. package/dist/core/src/lib/utilities/source-file.mjs +0 -21
  109. package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
  110. package/dist/core/src/plugin-utils/paths.cjs +0 -2
  111. package/dist/core/src/plugin-utils/paths.mjs +0 -4
  112. package/dist/core/src/types/api.d.cts +0 -103
  113. package/dist/core/src/types/api.d.cts.map +0 -1
  114. package/dist/core/src/types/api.d.mts +0 -103
  115. package/dist/core/src/types/api.d.mts.map +0 -1
  116. package/dist/core/src/types/commands.d.cts +0 -9
  117. package/dist/core/src/types/commands.d.cts.map +0 -1
  118. package/dist/core/src/types/commands.d.mts +0 -10
  119. package/dist/core/src/types/commands.d.mts.map +0 -1
  120. package/dist/core/src/types/config.d.cts +0 -551
  121. package/dist/core/src/types/config.d.cts.map +0 -1
  122. package/dist/core/src/types/config.d.mts +0 -551
  123. package/dist/core/src/types/config.d.mts.map +0 -1
  124. package/dist/core/src/types/context.d.cts +0 -511
  125. package/dist/core/src/types/context.d.cts.map +0 -1
  126. package/dist/core/src/types/context.d.mts +0 -511
  127. package/dist/core/src/types/context.d.mts.map +0 -1
  128. package/dist/core/src/types/fs.d.cts +0 -487
  129. package/dist/core/src/types/fs.d.cts.map +0 -1
  130. package/dist/core/src/types/fs.d.mts +0 -487
  131. package/dist/core/src/types/fs.d.mts.map +0 -1
  132. package/dist/core/src/types/hooks.d.cts +0 -99
  133. package/dist/core/src/types/hooks.d.cts.map +0 -1
  134. package/dist/core/src/types/hooks.d.mts +0 -99
  135. package/dist/core/src/types/hooks.d.mts.map +0 -1
  136. package/dist/core/src/types/index.d.mts +0 -9
  137. package/dist/core/src/types/plugin.d.cts +0 -204
  138. package/dist/core/src/types/plugin.d.cts.map +0 -1
  139. package/dist/core/src/types/plugin.d.mts +0 -204
  140. package/dist/core/src/types/plugin.d.mts.map +0 -1
  141. package/dist/core/src/types/tsconfig.d.cts +0 -70
  142. package/dist/core/src/types/tsconfig.d.cts.map +0 -1
  143. package/dist/core/src/types/tsconfig.d.mts +0 -70
  144. package/dist/core/src/types/tsconfig.d.mts.map +0 -1
  145. package/dist/core/src/types/unplugin.cjs +0 -21
  146. package/dist/core/src/types/unplugin.d.cts +0 -24
  147. package/dist/core/src/types/unplugin.d.cts.map +0 -1
  148. package/dist/core/src/types/unplugin.d.mts +0 -25
  149. package/dist/core/src/types/unplugin.d.mts.map +0 -1
  150. package/dist/core/src/types/unplugin.mjs +0 -22
  151. package/dist/core/src/types/unplugin.mjs.map +0 -1
  152. package/dist/helpers/bundle.d.cts.map +0 -1
  153. package/dist/helpers/bundle.d.mts.map +0 -1
  154. package/dist/helpers/bundle.mjs.map +0 -1
  155. package/dist/helpers/resolve-options.d.cts.map +0 -1
  156. package/dist/helpers/resolve-options.d.mts.map +0 -1
  157. package/dist/helpers/resolve-options.mjs.map +0 -1
  158. package/dist/helpers/resolve.d.cts.map +0 -1
  159. package/dist/helpers/resolve.d.mts.map +0 -1
  160. package/dist/helpers/resolve.mjs.map +0 -1
  161. package/dist/helpers/unplugin.d.cts.map +0 -1
  162. package/dist/helpers/unplugin.d.mts.map +0 -1
  163. package/dist/helpers/unplugin.mjs.map +0 -1
  164. package/dist/types/build.d.cts.map +0 -1
  165. package/dist/types/build.d.mts.map +0 -1
  166. package/dist/types/plugin.d.cts.map +0 -1
  167. package/dist/types/plugin.d.mts.map +0 -1
@@ -1,63 +1,4 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_helpers_bundle = require('./bundle.cjs');
3
- let __stryke_convert_parse_type_definition = require("@stryke/convert/parse-type-definition");
4
- let __stryke_type_checks_is_set_string = require("@stryke/type-checks/is-set-string");
1
+ const require_resolve = require('../resolve-CsStIaEj.cjs');
5
2
 
6
- //#region src/helpers/resolve.ts
7
- /**
8
- * Compiles a type definition to a module and returns the module.
9
- *
10
- * @param context - The context object containing the environment paths.
11
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
- * @param overrides - Optional overrides for the ESBuild configuration.
13
- * @returns A promise that resolves to the compiled module.
14
- */
15
- async function resolveModule(context, type, overrides = {}) {
16
- let typeDefinition;
17
- if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
18
- else typeDefinition = type;
19
- const result = await require_helpers_bundle.bundle(context, typeDefinition.file, overrides);
20
- let resolved;
21
- try {
22
- resolved = await context.resolver.evalModule(result.text, {
23
- filename: result.path,
24
- forceTranspile: true
25
- });
26
- } catch (error) {
27
- if ((0, __stryke_type_checks_is_set_string.isSetString)(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
28
- const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
29
- throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
30
-
31
- Bundle output for module:
32
- ${result.text}` : ""}`);
33
- }
34
- throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
35
-
36
- Bundle output for module:
37
- ${result.text}` : ""}`);
38
- }
39
- return resolved;
40
- }
41
- /**
42
- * Compiles a type definition to a module and returns the specified export from the module.
43
- *
44
- * @param context - The context object containing the environment paths.
45
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
46
- * @param overrides - Optional overrides for the ESBuild configuration.
47
- * @returns A promise that resolves to the compiled module.
48
- */
49
- async function resolve(context, type, overrides = {}) {
50
- let typeDefinition;
51
- if ((0, __stryke_type_checks_is_set_string.isSetString)(type)) typeDefinition = (0, __stryke_convert_parse_type_definition.parseTypeDefinition)(type);
52
- else typeDefinition = type;
53
- const resolved = await resolveModule(context, typeDefinition, overrides);
54
- let exportName = typeDefinition.name;
55
- if (!exportName) exportName = "default";
56
- const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
57
- if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
58
- return resolvedExport;
59
- }
60
-
61
- //#endregion
62
- exports.resolve = resolve;
63
- exports.resolveModule = resolveModule;
3
+ exports.resolve = require_resolve.resolve;
4
+ exports.resolveModule = require_resolve.resolveModule;
@@ -1,27 +1,2 @@
1
- import { PluginContext } from "../core/src/types/context.cjs";
2
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
3
- import { BuildOptions } from "esbuild";
4
-
5
- //#region src/helpers/resolve.d.ts
6
-
7
- /**
8
- * Compiles a type definition to a module and returns the module.
9
- *
10
- * @param context - The context object containing the environment paths.
11
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
- * @param overrides - Optional overrides for the ESBuild configuration.
13
- * @returns A promise that resolves to the compiled module.
14
- */
15
- declare function resolveModule<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
16
- /**
17
- * Compiles a type definition to a module and returns the specified export from the module.
18
- *
19
- * @param context - The context object containing the environment paths.
20
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
21
- * @param overrides - Optional overrides for the ESBuild configuration.
22
- * @returns A promise that resolves to the compiled module.
23
- */
24
- declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
25
- //#endregion
26
- export { resolve, resolveModule };
27
- //# sourceMappingURL=resolve.d.cts.map
1
+ import { n as resolveModule, t as resolve } from "../resolve-BUiEAXVB.cjs";
2
+ export { resolve, resolveModule };
@@ -1,28 +1,2 @@
1
- import { PluginContext } from "../core/src/types/context.mjs";
2
- import "../core/src/types/index.mjs";
3
- import { BuildOptions } from "esbuild";
4
- import { TypeDefinitionParameter } from "@stryke/types/configuration";
5
-
6
- //#region src/helpers/resolve.d.ts
7
-
8
- /**
9
- * Compiles a type definition to a module and returns the module.
10
- *
11
- * @param context - The context object containing the environment paths.
12
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
13
- * @param overrides - Optional overrides for the ESBuild configuration.
14
- * @returns A promise that resolves to the compiled module.
15
- */
16
- declare function resolveModule<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
17
- /**
18
- * Compiles a type definition to a module and returns the specified export from the module.
19
- *
20
- * @param context - The context object containing the environment paths.
21
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
22
- * @param overrides - Optional overrides for the ESBuild configuration.
23
- * @returns A promise that resolves to the compiled module.
24
- */
25
- declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
26
- //#endregion
27
- export { resolve, resolveModule };
28
- //# sourceMappingURL=resolve.d.mts.map
1
+ import { n as resolveModule, t as resolve } from "../resolve-BU3nddJ7.mjs";
2
+ export { resolve, resolveModule };
@@ -1,62 +1,3 @@
1
- import { bundle } from "./bundle.mjs";
2
- import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
3
- import { isSetString } from "@stryke/type-checks/is-set-string";
1
+ import { n as resolveModule, t as resolve } from "../resolve-C8OzoP-s.mjs";
4
2
 
5
- //#region src/helpers/resolve.ts
6
- /**
7
- * Compiles a type definition to a module and returns the module.
8
- *
9
- * @param context - The context object containing the environment paths.
10
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
- * @param overrides - Optional overrides for the ESBuild configuration.
12
- * @returns A promise that resolves to the compiled module.
13
- */
14
- async function resolveModule(context, type, overrides = {}) {
15
- let typeDefinition;
16
- if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
- else typeDefinition = type;
18
- const result = await bundle(context, typeDefinition.file, overrides);
19
- let resolved;
20
- try {
21
- resolved = await context.resolver.evalModule(result.text, {
22
- filename: result.path,
23
- forceTranspile: true
24
- });
25
- } catch (error) {
26
- if (isSetString(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
27
- const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
28
- throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
29
-
30
- Bundle output for module:
31
- ${result.text}` : ""}`);
32
- }
33
- throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
34
-
35
- Bundle output for module:
36
- ${result.text}` : ""}`);
37
- }
38
- return resolved;
39
- }
40
- /**
41
- * Compiles a type definition to a module and returns the specified export from the module.
42
- *
43
- * @param context - The context object containing the environment paths.
44
- * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
45
- * @param overrides - Optional overrides for the ESBuild configuration.
46
- * @returns A promise that resolves to the compiled module.
47
- */
48
- async function resolve(context, type, overrides = {}) {
49
- let typeDefinition;
50
- if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
51
- else typeDefinition = type;
52
- const resolved = await resolveModule(context, typeDefinition, overrides);
53
- let exportName = typeDefinition.name;
54
- if (!exportName) exportName = "default";
55
- const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
56
- if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
57
- return resolvedExport;
58
- }
59
-
60
- //#endregion
61
- export { resolve, resolveModule };
62
- //# sourceMappingURL=resolve.mjs.map
3
+ export { resolve, resolveModule };
@@ -1,12 +1,3 @@
1
- const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
2
- const require_plugin = require('../core/src/lib/unplugin/plugin.cjs');
3
- require('../core/src/lib/unplugin/index.cjs');
4
- let unplugin = require("unplugin");
1
+ const require_unplugin = require('../unplugin-CW_BVHFj.cjs');
5
2
 
6
- //#region src/helpers/unplugin.ts
7
- function createEsbuildPlugin(context) {
8
- return (0, unplugin.createEsbuildPlugin)(require_plugin.createUnplugin(context))({});
9
- }
10
-
11
- //#endregion
12
- exports.createEsbuildPlugin = createEsbuildPlugin;
3
+ exports.createEsbuildPlugin = require_unplugin.createEsbuildPlugin;
@@ -1,8 +1,4 @@
1
- import { EsbuildPluginContext } from "../types/plugin.cjs";
2
- import * as esbuild0 from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createEsbuildPlugin(context: EsbuildPluginContext): esbuild0.Plugin;
6
- //#endregion
7
- export { createEsbuildPlugin };
8
- //# sourceMappingURL=unplugin.d.cts.map
1
+ import "../build-Br4iCJ5d.cjs";
2
+ import "../plugin-fp0p1CCy.cjs";
3
+ import { t as createEsbuildPlugin } from "../unplugin-Cf7hyWQE.cjs";
4
+ export { createEsbuildPlugin };
@@ -1,8 +1,4 @@
1
- import { EsbuildPluginContext } from "../types/plugin.mjs";
2
- import * as esbuild0 from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createEsbuildPlugin(context: EsbuildPluginContext): esbuild0.Plugin;
6
- //#endregion
7
- export { createEsbuildPlugin };
8
- //# sourceMappingURL=unplugin.d.mts.map
1
+ import "../build-CrohITJo.mjs";
2
+ import "../plugin-Bivts13R.mjs";
3
+ import { t as createEsbuildPlugin } from "../unplugin-Csi4d8gj.mjs";
4
+ export { createEsbuildPlugin };
@@ -1,12 +1,3 @@
1
- import { createUnplugin } from "../core/src/lib/unplugin/plugin.mjs";
2
- import "../core/src/lib/unplugin/index.mjs";
3
- import { createEsbuildPlugin as createEsbuildPlugin$1 } from "unplugin";
1
+ import { t as createEsbuildPlugin } from "../unplugin-_Yvl6iM8.mjs";
4
2
 
5
- //#region src/helpers/unplugin.ts
6
- function createEsbuildPlugin(context) {
7
- return createEsbuildPlugin$1(createUnplugin(context))({});
8
- }
9
-
10
- //#endregion
11
- export { createEsbuildPlugin };
12
- //# sourceMappingURL=unplugin.mjs.map
3
+ export { createEsbuildPlugin };
@@ -0,0 +1 @@
1
+ export { };
File without changes
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ export { };
package/dist/index.cjs CHANGED
@@ -1,12 +1,14 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
3
- const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
4
- const require_helpers_unplugin = require('./helpers/unplugin.cjs');
5
- const require_helpers_bundle = require('./helpers/bundle.cjs');
6
- const require_helpers_resolve = require('./helpers/resolve.cjs');
7
- require('./helpers/index.cjs');
2
+ const require_resolve_options = require('./resolve-options-C3WIGKaG.cjs');
3
+ const require_unplugin = require('./unplugin-CW_BVHFj.cjs');
4
+ const require_bundle = require('./bundle-DG12gVtZ.cjs');
5
+ const require_resolve = require('./resolve-CsStIaEj.cjs');
6
+ require('./helpers-CAF8Bmv1.cjs');
7
+ require('./build-CQpSv6Qa.cjs');
8
+ require('./plugin-OjUZLLkc.cjs');
9
+ require('./types-DdloOYgD.cjs');
8
10
  let defu = require("defu");
9
- defu = require_rolldown_runtime.__toESM(defu);
11
+ defu = require_resolve_options.__toESM(defu);
10
12
  let esbuild = require("esbuild");
11
13
 
12
14
  //#region src/index.ts
@@ -20,7 +22,7 @@ const plugin = (options = {}) => {
20
22
  return {
21
23
  output: { format: ["esm"] },
22
24
  build: {
23
- ...require_helpers_resolve_options.DEFAULT_ESBUILD_CONFIG,
25
+ ...require_resolve_options.DEFAULT_ESBUILD_CONFIG,
24
26
  ...options,
25
27
  variant: "esbuild"
26
28
  }
@@ -28,21 +30,21 @@ const plugin = (options = {}) => {
28
30
  },
29
31
  async build() {
30
32
  await (0, esbuild.build)((0, defu.default)({
31
- entryPoints: require_helpers_resolve_options.resolveEntry(this, this.entry),
32
- plugins: [require_helpers_unplugin.createEsbuildPlugin(this)]
33
- }, require_helpers_resolve_options.resolveOptions(this)));
33
+ entryPoints: require_resolve_options.resolveEntry(this, this.entry),
34
+ plugins: [require_unplugin.createEsbuildPlugin(this)]
35
+ }, require_resolve_options.resolveOptions(this)));
34
36
  }
35
37
  };
36
38
  };
37
39
  var src_default = plugin;
38
40
 
39
41
  //#endregion
40
- exports.DEFAULT_ESBUILD_CONFIG = require_helpers_resolve_options.DEFAULT_ESBUILD_CONFIG;
41
- exports.bundle = require_helpers_bundle.bundle;
42
- exports.createEsbuildPlugin = require_helpers_unplugin.createEsbuildPlugin;
42
+ exports.DEFAULT_ESBUILD_CONFIG = require_resolve_options.DEFAULT_ESBUILD_CONFIG;
43
+ exports.bundle = require_bundle.bundle;
44
+ exports.createEsbuildPlugin = require_unplugin.createEsbuildPlugin;
43
45
  exports.default = src_default;
44
46
  exports.plugin = plugin;
45
- exports.resolve = require_helpers_resolve.resolve;
46
- exports.resolveEntry = require_helpers_resolve_options.resolveEntry;
47
- exports.resolveModule = require_helpers_resolve.resolveModule;
48
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
47
+ exports.resolve = require_resolve.resolve;
48
+ exports.resolveEntry = require_resolve_options.resolveEntry;
49
+ exports.resolveModule = require_resolve.resolveModule;
50
+ exports.resolveOptions = require_resolve_options.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,10 +1,12 @@
1
- import { Plugin } from "./core/src/types/plugin.cjs";
2
- import { bundle } from "./helpers/bundle.cjs";
3
- import { resolve, resolveModule } from "./helpers/resolve.cjs";
4
- import { DEFAULT_ESBUILD_CONFIG, resolveEntry, resolveOptions } from "./helpers/resolve-options.cjs";
5
- import { EsbuildOptions, __ΩEsbuildOptions } from "./types/build.cjs";
6
- import { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig } from "./types/plugin.cjs";
7
- import { createEsbuildPlugin } from "./helpers/unplugin.cjs";
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";
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";
7
+ import "./index-DeEmP3Jc.cjs";
8
+ import "./index-sQecLSpR.cjs";
9
+ import { Plugin } from "@powerlines/core/types";
8
10
 
9
11
  //#region src/index.d.ts
10
12
  /**
@@ -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":";;;;;;;;;;;;;;cAuCa,0BACM,uBAAuB,gCAE/B,yBACR,OAAO"}
package/dist/index.d.mts CHANGED
@@ -1,13 +1,12 @@
1
- import { Plugin } from "./core/src/types/plugin.mjs";
2
- import { bundle } from "./helpers/bundle.mjs";
3
- import "./core/src/types/index.mjs";
4
- import { resolve, resolveModule } from "./helpers/resolve.mjs";
5
- import { DEFAULT_ESBUILD_CONFIG, resolveEntry, resolveOptions } from "./helpers/resolve-options.mjs";
6
- import { EsbuildOptions, __ΩEsbuildOptions } from "./types/build.mjs";
7
- import { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig } from "./types/plugin.mjs";
8
- import { createEsbuildPlugin } from "./helpers/unplugin.mjs";
9
- import "./helpers/index.mjs";
10
- import "./types/index.mjs";
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";
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";
7
+ import "./index-ClXLQ1fw.mjs";
8
+ import "./index-DJOHDG5e.mjs";
9
+ import { Plugin } from "@powerlines/core/types";
11
10
 
12
11
  //#region src/index.d.ts
13
12
  /**
@@ -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":";;;;;;;;;;;;;;cAuCa,0BACM,uBAAuB,gCAE/B,yBACR,OAAO"}
package/dist/index.mjs CHANGED
@@ -1,8 +1,11 @@
1
- import { DEFAULT_ESBUILD_CONFIG, resolveEntry, resolveOptions } from "./helpers/resolve-options.mjs";
2
- import { createEsbuildPlugin } from "./helpers/unplugin.mjs";
3
- import { bundle } from "./helpers/bundle.mjs";
4
- import { resolve, resolveModule } from "./helpers/resolve.mjs";
5
- import "./helpers/index.mjs";
1
+ import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-C-213jz6.mjs";
2
+ import { t as createEsbuildPlugin } from "./unplugin-_Yvl6iM8.mjs";
3
+ import { t as bundle } from "./bundle-D6QqCoyO.mjs";
4
+ import { n as resolveModule, t as resolve } from "./resolve-C8OzoP-s.mjs";
5
+ import "./helpers-BAUlPOQe.mjs";
6
+ import "./build-DfzG3fLI.mjs";
7
+ import "./plugin-BL8TLixo.mjs";
8
+ import "./types-CvhspRRt.mjs";
6
9
  import defu from "defu";
7
10
  import { build } from "esbuild";
8
11
 
@@ -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/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"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,19 @@
1
+ import { t as EsbuildOptions } from "./build-CrohITJo.mjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type EsbuildPluginOptions = Partial<EsbuildOptions>;
6
+ interface EsbuildPluginUserConfig extends UserConfig {
7
+ esbuild?: EsbuildPluginOptions;
8
+ }
9
+ interface EsbuildPluginResolvedConfig extends ResolvedConfig {
10
+ esbuild: EsbuildOptions;
11
+ }
12
+ type EsbuildPluginContext<TResolvedConfig extends EsbuildPluginResolvedConfig = EsbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩEsbuildPluginOptions = any[];
14
+ declare type __ΩEsbuildPluginUserConfig = any[];
15
+ declare type __ΩEsbuildPluginResolvedConfig = any[];
16
+ declare type __ΩEsbuildPluginContext = any[];
17
+ //#endregion
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
@@ -0,0 +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"}
File without changes
@@ -0,0 +1,19 @@
1
+ import { t as EsbuildOptions } from "./build-Br4iCJ5d.cjs";
2
+ import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
3
+
4
+ //#region src/types/plugin.d.ts
5
+ type EsbuildPluginOptions = Partial<EsbuildOptions>;
6
+ interface EsbuildPluginUserConfig extends UserConfig {
7
+ esbuild?: EsbuildPluginOptions;
8
+ }
9
+ interface EsbuildPluginResolvedConfig extends ResolvedConfig {
10
+ esbuild: EsbuildOptions;
11
+ }
12
+ type EsbuildPluginContext<TResolvedConfig extends EsbuildPluginResolvedConfig = EsbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
+ declare type __ΩEsbuildPluginOptions = any[];
14
+ declare type __ΩEsbuildPluginUserConfig = any[];
15
+ declare type __ΩEsbuildPluginResolvedConfig = any[];
16
+ declare type __ΩEsbuildPluginContext = any[];
17
+ //#endregion
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
@@ -0,0 +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"}
@@ -0,0 +1,27 @@
1
+ import { BuildOptions } from "esbuild";
2
+ import { PluginContext } from "@powerlines/core/types";
3
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
4
+
5
+ //#region src/helpers/resolve.d.ts
6
+
7
+ /**
8
+ * Compiles a type definition to a module and returns the module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the compiled module.
14
+ */
15
+ declare function resolveModule<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
16
+ /**
17
+ * Compiles a type definition to a module and returns the specified export from the module.
18
+ *
19
+ * @param context - The context object containing the environment paths.
20
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
21
+ * @param overrides - Optional overrides for the ESBuild configuration.
22
+ * @returns A promise that resolves to the compiled module.
23
+ */
24
+ declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
25
+ //#endregion
26
+ export { resolveModule as n, resolve as t };
27
+ //# sourceMappingURL=resolve-BU3nddJ7.d.mts.map
@@ -0,0 +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"}
@@ -0,0 +1,27 @@
1
+ import { BuildOptions } from "esbuild";
2
+ import { PluginContext } from "@powerlines/core/types";
3
+ import { TypeDefinitionParameter } from "@stryke/types/configuration";
4
+
5
+ //#region src/helpers/resolve.d.ts
6
+
7
+ /**
8
+ * Compiles a type definition to a module and returns the module.
9
+ *
10
+ * @param context - The context object containing the environment paths.
11
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
12
+ * @param overrides - Optional overrides for the ESBuild configuration.
13
+ * @returns A promise that resolves to the compiled module.
14
+ */
15
+ declare function resolveModule<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
16
+ /**
17
+ * Compiles a type definition to a module and returns the specified export from the module.
18
+ *
19
+ * @param context - The context object containing the environment paths.
20
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
21
+ * @param overrides - Optional overrides for the ESBuild configuration.
22
+ * @returns A promise that resolves to the compiled module.
23
+ */
24
+ declare function resolve<TResult>(context: PluginContext, type: TypeDefinitionParameter, overrides?: Partial<BuildOptions>): Promise<TResult>;
25
+ //#endregion
26
+ export { resolveModule as n, resolve as t };
27
+ //# sourceMappingURL=resolve-BUiEAXVB.d.cts.map
@@ -0,0 +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"}
@@ -0,0 +1,62 @@
1
+ import { bundle } from "@powerlines/plugin-esbuild/helpers/bundle";
2
+ import { parseTypeDefinition } from "@stryke/convert/parse-type-definition";
3
+ import { isSetString } from "@stryke/type-checks/is-set-string";
4
+
5
+ //#region src/helpers/resolve.ts
6
+ /**
7
+ * Compiles a type definition to a module and returns the module.
8
+ *
9
+ * @param context - The context object containing the environment paths.
10
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
11
+ * @param overrides - Optional overrides for the ESBuild configuration.
12
+ * @returns A promise that resolves to the compiled module.
13
+ */
14
+ async function resolveModule(context, type, overrides = {}) {
15
+ let typeDefinition;
16
+ if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
17
+ else typeDefinition = type;
18
+ const result = await bundle(context, typeDefinition.file, overrides);
19
+ let resolved;
20
+ try {
21
+ resolved = await context.resolver.evalModule(result.text, {
22
+ filename: result.path,
23
+ forceTranspile: true
24
+ });
25
+ } catch (error) {
26
+ if (isSetString(error.message) && (/* @__PURE__ */ new RegExp(`Cannot find module '${context.config.framework || "powerlines"}:.*'`)).test(error.message)) {
27
+ const moduleName = error.message.match(/* @__PURE__ */ new RegExp(`Cannot find module '(${context.config.framework || "powerlines"}:.*)'`))?.[1];
28
+ throw new Error(`The module "${moduleName}" could not be resolved while evaluating "${typeDefinition.file}". It is possible the required built-in modules have not yet been generated. Please check the order of your plugins. ${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
29
+
30
+ Bundle output for module:
31
+ ${result.text}` : ""}`);
32
+ }
33
+ throw new Error(`Failed to evaluate the bundled module for "${typeDefinition.file}". Error: ${error.message}${context.config.logLevel === "debug" || context.config.logLevel === "trace" ? `
34
+
35
+ Bundle output for module:
36
+ ${result.text}` : ""}`);
37
+ }
38
+ return resolved;
39
+ }
40
+ /**
41
+ * Compiles a type definition to a module and returns the specified export from the module.
42
+ *
43
+ * @param context - The context object containing the environment paths.
44
+ * @param type - The type definition to compile. This can be either a string or a {@link TypeDefinition} object.
45
+ * @param overrides - Optional overrides for the ESBuild configuration.
46
+ * @returns A promise that resolves to the compiled module.
47
+ */
48
+ async function resolve(context, type, overrides = {}) {
49
+ let typeDefinition;
50
+ if (isSetString(type)) typeDefinition = parseTypeDefinition(type);
51
+ else typeDefinition = type;
52
+ const resolved = await resolveModule(context, typeDefinition, overrides);
53
+ let exportName = typeDefinition.name;
54
+ if (!exportName) exportName = "default";
55
+ const resolvedExport = resolved[exportName] ?? resolved[`__Ω${exportName}`];
56
+ if (resolvedExport === void 0) throw new Error(`The export "${exportName}" could not be resolved in the "${typeDefinition.file}" module. ${Object.keys(resolved).length === 0 ? `After bundling, no exports were found in the module. Please ensure that the "${typeDefinition.file}" module has a "${exportName}" export with the desired value.` : `After bundling, the available exports were: ${Object.keys(resolved).join(", ")}. Please ensure that the export exists and is correctly named.`}`);
57
+ return resolvedExport;
58
+ }
59
+
60
+ //#endregion
61
+ export { resolveModule as n, resolve as t };
62
+ //# sourceMappingURL=resolve-C8OzoP-s.mjs.map