@powerlines/plugin-esbuild 0.13.307 → 0.13.308
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.
- package/dist/build-Br4iCJ5d.d.cts +8 -0
- package/dist/build-Br4iCJ5d.d.cts.map +1 -0
- package/dist/build-CQpSv6Qa.cjs +0 -0
- package/dist/build-CrohITJo.d.mts +8 -0
- package/dist/build-CrohITJo.d.mts.map +1 -0
- package/dist/build-DfzG3fLI.mjs +1 -0
- package/dist/bundle-Bx7Mimeh.d.cts +17 -0
- package/dist/bundle-Bx7Mimeh.d.cts.map +1 -0
- package/dist/bundle-D6QqCoyO.mjs +41 -0
- package/dist/bundle-D6QqCoyO.mjs.map +1 -0
- package/dist/bundle-DG12gVtZ.cjs +46 -0
- package/dist/bundle-UTFhPSjU.d.mts +17 -0
- package/dist/bundle-UTFhPSjU.d.mts.map +1 -0
- package/dist/helpers/bundle.cjs +3 -42
- package/dist/helpers/bundle.d.cts +2 -17
- package/dist/helpers/bundle.d.mts +2 -17
- package/dist/helpers/bundle.mjs +3 -41
- package/dist/helpers/index.cjs +12 -11
- package/dist/helpers/index.d.cts +7 -4
- package/dist/helpers/index.d.mts +7 -4
- package/dist/helpers/index.mjs +5 -4
- package/dist/helpers/resolve-options.cjs +4 -89
- package/dist/helpers/resolve-options.d.cts +2 -24
- package/dist/helpers/resolve-options.d.mts +2 -25
- package/dist/helpers/resolve-options.mjs +2 -86
- package/dist/helpers/resolve.cjs +3 -62
- package/dist/helpers/resolve.d.cts +2 -27
- package/dist/helpers/resolve.d.mts +2 -28
- package/dist/helpers/resolve.mjs +2 -61
- package/dist/helpers/unplugin.cjs +2 -11
- package/dist/helpers/unplugin.d.cts +4 -8
- package/dist/helpers/unplugin.d.mts +4 -8
- package/dist/helpers/unplugin.mjs +2 -11
- package/dist/helpers-BAUlPOQe.mjs +1 -0
- package/dist/helpers-CAF8Bmv1.cjs +0 -0
- package/dist/index-ClXLQ1fw.d.mts +1 -0
- package/dist/index-DJOHDG5e.d.mts +1 -0
- package/dist/index-DeEmP3Jc.d.cts +1 -0
- package/dist/index-sQecLSpR.d.cts +1 -0
- package/dist/index.cjs +20 -18
- package/dist/index.d.cts +9 -7
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +9 -10
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +8 -5
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-BL8TLixo.mjs +1 -0
- package/dist/plugin-Bivts13R.d.mts +19 -0
- package/dist/plugin-Bivts13R.d.mts.map +1 -0
- package/dist/plugin-OjUZLLkc.cjs +0 -0
- package/dist/plugin-fp0p1CCy.d.cts +19 -0
- package/dist/plugin-fp0p1CCy.d.cts.map +1 -0
- package/dist/resolve-BU3nddJ7.d.mts +27 -0
- package/dist/resolve-BU3nddJ7.d.mts.map +1 -0
- package/dist/resolve-BUiEAXVB.d.cts +27 -0
- package/dist/resolve-BUiEAXVB.d.cts.map +1 -0
- package/dist/resolve-C8OzoP-s.mjs +62 -0
- package/dist/resolve-C8OzoP-s.mjs.map +1 -0
- package/dist/resolve-CsStIaEj.cjs +73 -0
- package/dist/resolve-options-C-213jz6.mjs +87 -0
- package/dist/resolve-options-C-213jz6.mjs.map +1 -0
- package/dist/resolve-options-C3WIGKaG.cjs +137 -0
- package/dist/resolve-options-CpEoapmL.d.mts +23 -0
- package/dist/resolve-options-CpEoapmL.d.mts.map +1 -0
- package/dist/resolve-options-DSHX7AUS.d.cts +23 -0
- package/dist/resolve-options-DSHX7AUS.d.cts.map +1 -0
- package/dist/types/build.cjs +1 -0
- package/dist/types/build.d.cts +2 -8
- package/dist/types/build.d.mts +2 -8
- package/dist/types/build.mjs +2 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +3 -20
- package/dist/types/plugin.d.mts +3 -21
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-CvhspRRt.mjs +1 -0
- package/dist/types-DdloOYgD.cjs +0 -0
- package/dist/unplugin-CW_BVHFj.cjs +16 -0
- package/dist/unplugin-Cf7hyWQE.d.cts +8 -0
- package/dist/unplugin-Cf7hyWQE.d.cts.map +1 -0
- package/dist/unplugin-Csi4d8gj.d.mts +8 -0
- package/dist/unplugin-Csi4d8gj.d.mts.map +1 -0
- package/dist/unplugin-_Yvl6iM8.mjs +11 -0
- package/dist/unplugin-_Yvl6iM8.mjs.map +1 -0
- package/package.json +3 -3
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/core/src/lib/entry.cjs +0 -22
- package/dist/core/src/lib/entry.mjs +0 -22
- package/dist/core/src/lib/entry.mjs.map +0 -1
- package/dist/core/src/lib/logger.cjs +0 -41
- package/dist/core/src/lib/logger.mjs +0 -40
- package/dist/core/src/lib/logger.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/index.cjs +0 -3
- package/dist/core/src/lib/unplugin/index.mjs +0 -5
- package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/plugin.cjs +0 -104
- package/dist/core/src/lib/unplugin/plugin.mjs +0 -103
- package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
- package/dist/core/src/lib/utilities/source-file.cjs +0 -22
- package/dist/core/src/lib/utilities/source-file.mjs +0 -21
- package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
- package/dist/core/src/plugin-utils/paths.cjs +0 -2
- package/dist/core/src/plugin-utils/paths.mjs +0 -4
- package/dist/core/src/types/api.d.cts +0 -103
- package/dist/core/src/types/api.d.cts.map +0 -1
- package/dist/core/src/types/api.d.mts +0 -103
- package/dist/core/src/types/api.d.mts.map +0 -1
- package/dist/core/src/types/commands.d.cts +0 -9
- package/dist/core/src/types/commands.d.cts.map +0 -1
- package/dist/core/src/types/commands.d.mts +0 -10
- package/dist/core/src/types/commands.d.mts.map +0 -1
- package/dist/core/src/types/config.d.cts +0 -551
- package/dist/core/src/types/config.d.cts.map +0 -1
- package/dist/core/src/types/config.d.mts +0 -551
- package/dist/core/src/types/config.d.mts.map +0 -1
- package/dist/core/src/types/context.d.cts +0 -511
- package/dist/core/src/types/context.d.cts.map +0 -1
- package/dist/core/src/types/context.d.mts +0 -511
- package/dist/core/src/types/context.d.mts.map +0 -1
- package/dist/core/src/types/fs.d.cts +0 -487
- package/dist/core/src/types/fs.d.cts.map +0 -1
- package/dist/core/src/types/fs.d.mts +0 -487
- package/dist/core/src/types/fs.d.mts.map +0 -1
- package/dist/core/src/types/hooks.d.cts +0 -99
- package/dist/core/src/types/hooks.d.cts.map +0 -1
- package/dist/core/src/types/hooks.d.mts +0 -99
- package/dist/core/src/types/hooks.d.mts.map +0 -1
- package/dist/core/src/types/index.d.mts +0 -9
- package/dist/core/src/types/plugin.d.cts +0 -204
- package/dist/core/src/types/plugin.d.cts.map +0 -1
- package/dist/core/src/types/plugin.d.mts +0 -204
- package/dist/core/src/types/plugin.d.mts.map +0 -1
- package/dist/core/src/types/tsconfig.d.cts +0 -70
- package/dist/core/src/types/tsconfig.d.cts.map +0 -1
- package/dist/core/src/types/tsconfig.d.mts +0 -70
- package/dist/core/src/types/tsconfig.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.cjs +0 -21
- package/dist/core/src/types/unplugin.d.cts +0 -24
- package/dist/core/src/types/unplugin.d.cts.map +0 -1
- package/dist/core/src/types/unplugin.d.mts +0 -25
- package/dist/core/src/types/unplugin.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.mjs +0 -22
- package/dist/core/src/types/unplugin.mjs.map +0 -1
- package/dist/helpers/bundle.d.cts.map +0 -1
- package/dist/helpers/bundle.d.mts.map +0 -1
- package/dist/helpers/bundle.mjs.map +0 -1
- package/dist/helpers/resolve-options.d.cts.map +0 -1
- package/dist/helpers/resolve-options.d.mts.map +0 -1
- package/dist/helpers/resolve-options.mjs.map +0 -1
- package/dist/helpers/resolve.d.cts.map +0 -1
- package/dist/helpers/resolve.d.mts.map +0 -1
- package/dist/helpers/resolve.mjs.map +0 -1
- package/dist/helpers/unplugin.d.cts.map +0 -1
- package/dist/helpers/unplugin.d.mts.map +0 -1
- package/dist/helpers/unplugin.mjs.map +0 -1
- package/dist/types/build.d.cts.map +0 -1
- package/dist/types/build.d.mts.map +0 -1
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts.map +0 -1
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
const require_resolve_options = require('./resolve-options-C3WIGKaG.cjs');
|
|
2
|
+
let __powerlines_plugin_esbuild_helpers_bundle = require("@powerlines/plugin-esbuild/helpers/bundle");
|
|
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");
|
|
5
|
+
|
|
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 (0, __powerlines_plugin_esbuild_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
|
+
Object.defineProperty(exports, 'resolve', {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () {
|
|
65
|
+
return resolve;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
Object.defineProperty(exports, 'resolveModule', {
|
|
69
|
+
enumerable: true,
|
|
70
|
+
get: function () {
|
|
71
|
+
return resolveModule;
|
|
72
|
+
}
|
|
73
|
+
});
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import defu from "defu";
|
|
2
|
+
import { resolveEntryOutput } from "@powerlines/core/lib/entry";
|
|
3
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
+
import { replaceExtension, replacePath } from "@stryke/path/replace";
|
|
5
|
+
import { camelCase } from "@stryke/string-format/camel-case";
|
|
6
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
7
|
+
|
|
8
|
+
//#region src/helpers/resolve-options.ts
|
|
9
|
+
const DEFAULT_ESBUILD_CONFIG = {
|
|
10
|
+
target: "esnext",
|
|
11
|
+
platform: "neutral",
|
|
12
|
+
format: "esm",
|
|
13
|
+
write: true,
|
|
14
|
+
minify: true,
|
|
15
|
+
sourcemap: false,
|
|
16
|
+
bundle: true,
|
|
17
|
+
treeShaking: true,
|
|
18
|
+
keepNames: true,
|
|
19
|
+
splitting: true,
|
|
20
|
+
logLevel: "silent"
|
|
21
|
+
};
|
|
22
|
+
/**
|
|
23
|
+
* Resolves the entry options for esbuild.
|
|
24
|
+
*
|
|
25
|
+
* @param context - The build context.
|
|
26
|
+
* @param entryPoints - The entry points to resolve.
|
|
27
|
+
* @returns The resolved entry options.
|
|
28
|
+
*/
|
|
29
|
+
function resolveEntry(context, entryPoints = []) {
|
|
30
|
+
return entryPoints.reduce((ret, entry) => {
|
|
31
|
+
if (isString(entry)) ret[replaceExtension(replacePath(entry, context.config.root))] = replacePath(entry, context.config.root);
|
|
32
|
+
else ret[entry.output || resolveEntryOutput(context, entry)] = entry.file;
|
|
33
|
+
return ret;
|
|
34
|
+
}, {});
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Resolves the esbuild options.
|
|
38
|
+
*
|
|
39
|
+
* @param context - The build context.
|
|
40
|
+
* @returns The resolved esbuild options.
|
|
41
|
+
*/
|
|
42
|
+
function resolveOptions(context) {
|
|
43
|
+
if (context.config.inject && Object.keys(context.config.inject).length > 0) context.fs.writeSync(joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js"), Object.entries(context.config.inject).map(([key, value]) => {
|
|
44
|
+
if (value) if (Array.isArray(value)) {
|
|
45
|
+
if (camelCase(key) !== key) {
|
|
46
|
+
if (value.length === 1) return `
|
|
47
|
+
import ${camelCase(key)} from "${value[0]}";
|
|
48
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
49
|
+
else if (value.length > 1) return `
|
|
50
|
+
import ${value[1] === "*" ? `* as ${camelCase(key)}` : `{ ${value[1]} as ${camelCase(key)} }`} from "${value[0]}";
|
|
51
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
52
|
+
} else if (value.length === 1) return `
|
|
53
|
+
import ${key} from "${value[0]}";
|
|
54
|
+
export { ${key} };`;
|
|
55
|
+
else if (value.length > 1) return `
|
|
56
|
+
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
57
|
+
export { ${key} };`;
|
|
58
|
+
} else if (camelCase(key) !== key) return `
|
|
59
|
+
import ${camelCase(key)} from "${value[0]}";
|
|
60
|
+
export { ${camelCase(key)} as "${key}" }`;
|
|
61
|
+
else return `
|
|
62
|
+
import ${key} from "${value}";
|
|
63
|
+
export { ${key} };`;
|
|
64
|
+
return "";
|
|
65
|
+
}).join("\n"));
|
|
66
|
+
return defu({
|
|
67
|
+
alias: context.alias,
|
|
68
|
+
inject: context.config.inject && Object.keys(context.config.inject).length > 0 ? [joinPaths(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js")] : void 0
|
|
69
|
+
}, context.config?.esbuild ? context.config.esbuild : {}, {
|
|
70
|
+
mainFields: context.config.resolve.mainFields,
|
|
71
|
+
conditions: context.config.resolve.conditions,
|
|
72
|
+
define: context.config.define,
|
|
73
|
+
resolveExtensions: context.config.resolve.extensions,
|
|
74
|
+
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
75
|
+
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
76
|
+
platform: context.config.platform,
|
|
77
|
+
outdir: context.config.output.buildPath,
|
|
78
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
79
|
+
minify: context.config.mode !== "development",
|
|
80
|
+
metafile: context.config.mode === "development",
|
|
81
|
+
sourcemap: context.config.mode === "development"
|
|
82
|
+
}, DEFAULT_ESBUILD_CONFIG);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
//#endregion
|
|
86
|
+
export { resolveEntry as n, resolveOptions as r, DEFAULT_ESBUILD_CONFIG as t };
|
|
87
|
+
//# sourceMappingURL=resolve-options-C-213jz6.mjs.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
+
key = keys[i];
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
+
__defProp(to, key, {
|
|
14
|
+
get: ((k) => from[k]).bind(null, key),
|
|
15
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
return to;
|
|
21
|
+
};
|
|
22
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
+
value: mod,
|
|
24
|
+
enumerable: true
|
|
25
|
+
}) : target, mod));
|
|
26
|
+
|
|
27
|
+
//#endregion
|
|
28
|
+
let defu = require("defu");
|
|
29
|
+
defu = __toESM(defu);
|
|
30
|
+
let __powerlines_core_lib_entry = require("@powerlines/core/lib/entry");
|
|
31
|
+
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
32
|
+
let __stryke_path_replace = require("@stryke/path/replace");
|
|
33
|
+
let __stryke_string_format_camel_case = require("@stryke/string-format/camel-case");
|
|
34
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
35
|
+
|
|
36
|
+
//#region src/helpers/resolve-options.ts
|
|
37
|
+
const DEFAULT_ESBUILD_CONFIG = {
|
|
38
|
+
target: "esnext",
|
|
39
|
+
platform: "neutral",
|
|
40
|
+
format: "esm",
|
|
41
|
+
write: true,
|
|
42
|
+
minify: true,
|
|
43
|
+
sourcemap: false,
|
|
44
|
+
bundle: true,
|
|
45
|
+
treeShaking: true,
|
|
46
|
+
keepNames: true,
|
|
47
|
+
splitting: true,
|
|
48
|
+
logLevel: "silent"
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Resolves the entry options for esbuild.
|
|
52
|
+
*
|
|
53
|
+
* @param context - The build context.
|
|
54
|
+
* @param entryPoints - The entry points to resolve.
|
|
55
|
+
* @returns The resolved entry options.
|
|
56
|
+
*/
|
|
57
|
+
function resolveEntry(context, entryPoints = []) {
|
|
58
|
+
return entryPoints.reduce((ret, entry) => {
|
|
59
|
+
if ((0, __stryke_type_checks_is_string.isString)(entry)) ret[(0, __stryke_path_replace.replaceExtension)((0, __stryke_path_replace.replacePath)(entry, context.config.root))] = (0, __stryke_path_replace.replacePath)(entry, context.config.root);
|
|
60
|
+
else ret[entry.output || (0, __powerlines_core_lib_entry.resolveEntryOutput)(context, entry)] = entry.file;
|
|
61
|
+
return ret;
|
|
62
|
+
}, {});
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Resolves the esbuild options.
|
|
66
|
+
*
|
|
67
|
+
* @param context - The build context.
|
|
68
|
+
* @returns The resolved esbuild options.
|
|
69
|
+
*/
|
|
70
|
+
function resolveOptions(context) {
|
|
71
|
+
if (context.config.inject && Object.keys(context.config.inject).length > 0) context.fs.writeSync((0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js"), Object.entries(context.config.inject).map(([key, value]) => {
|
|
72
|
+
if (value) if (Array.isArray(value)) {
|
|
73
|
+
if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) {
|
|
74
|
+
if (value.length === 1) return `
|
|
75
|
+
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
76
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
77
|
+
else if (value.length > 1) return `
|
|
78
|
+
import ${value[1] === "*" ? `* as ${(0, __stryke_string_format_camel_case.camelCase)(key)}` : `{ ${value[1]} as ${(0, __stryke_string_format_camel_case.camelCase)(key)} }`} from "${value[0]}";
|
|
79
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
80
|
+
} else if (value.length === 1) return `
|
|
81
|
+
import ${key} from "${value[0]}";
|
|
82
|
+
export { ${key} };`;
|
|
83
|
+
else if (value.length > 1) return `
|
|
84
|
+
import ${value[1] === "*" ? `* as ${key}` : `{ ${value[1]} as ${key} }`} from "${value[0]}";
|
|
85
|
+
export { ${key} };`;
|
|
86
|
+
} else if ((0, __stryke_string_format_camel_case.camelCase)(key) !== key) return `
|
|
87
|
+
import ${(0, __stryke_string_format_camel_case.camelCase)(key)} from "${value[0]}";
|
|
88
|
+
export { ${(0, __stryke_string_format_camel_case.camelCase)(key)} as "${key}" }`;
|
|
89
|
+
else return `
|
|
90
|
+
import ${key} from "${value}";
|
|
91
|
+
export { ${key} };`;
|
|
92
|
+
return "";
|
|
93
|
+
}).join("\n"));
|
|
94
|
+
return (0, defu.default)({
|
|
95
|
+
alias: context.alias,
|
|
96
|
+
inject: context.config.inject && Object.keys(context.config.inject).length > 0 ? [(0, __stryke_path_join_paths.joinPaths)(context.workspaceConfig.workspaceRoot, context.config.root, context.artifactsPath, "inject-shim.js")] : void 0
|
|
97
|
+
}, context.config?.esbuild ? context.config.esbuild : {}, {
|
|
98
|
+
mainFields: context.config.resolve.mainFields,
|
|
99
|
+
conditions: context.config.resolve.conditions,
|
|
100
|
+
define: context.config.define,
|
|
101
|
+
resolveExtensions: context.config.resolve.extensions,
|
|
102
|
+
packages: context.config.resolve.skipNodeModulesBundle ? "external" : context.config?.esbuild ? (context.config?.esbuild).packages : void 0,
|
|
103
|
+
format: Array.isArray(context.config.output.format) ? context.config.output.format[0] : context.config.output.format,
|
|
104
|
+
platform: context.config.platform,
|
|
105
|
+
outdir: context.config.output.buildPath,
|
|
106
|
+
tsconfig: context.tsconfig.tsconfigFilePath,
|
|
107
|
+
minify: context.config.mode !== "development",
|
|
108
|
+
metafile: context.config.mode === "development",
|
|
109
|
+
sourcemap: context.config.mode === "development"
|
|
110
|
+
}, DEFAULT_ESBUILD_CONFIG);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
//#endregion
|
|
114
|
+
Object.defineProperty(exports, 'DEFAULT_ESBUILD_CONFIG', {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () {
|
|
117
|
+
return DEFAULT_ESBUILD_CONFIG;
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
Object.defineProperty(exports, '__toESM', {
|
|
121
|
+
enumerable: true,
|
|
122
|
+
get: function () {
|
|
123
|
+
return __toESM;
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, 'resolveEntry', {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () {
|
|
129
|
+
return resolveEntry;
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(exports, 'resolveOptions', {
|
|
133
|
+
enumerable: true,
|
|
134
|
+
get: function () {
|
|
135
|
+
return resolveOptions;
|
|
136
|
+
}
|
|
137
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BuildOptions } from "esbuild";
|
|
2
|
+
import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core/types";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
declare const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the entry options for esbuild.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The build context.
|
|
10
|
+
* @param entryPoints - The entry points to resolve.
|
|
11
|
+
* @returns The resolved entry options.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveEntry(context: Context, entryPoints?: ResolvedEntryTypeDefinition[] | string[]): BuildOptions["entryPoints"];
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the esbuild options.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The build context.
|
|
18
|
+
* @returns The resolved esbuild options.
|
|
19
|
+
*/
|
|
20
|
+
declare function resolveOptions(context: Context): BuildOptions;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { resolveEntry as n, resolveOptions as r, DEFAULT_ESBUILD_CONFIG as t };
|
|
23
|
+
//# sourceMappingURL=resolve-options-CpEoapmL.d.mts.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { BuildOptions } from "esbuild";
|
|
2
|
+
import { Context, ResolvedEntryTypeDefinition } from "@powerlines/core/types";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
declare const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions>;
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the entry options for esbuild.
|
|
8
|
+
*
|
|
9
|
+
* @param context - The build context.
|
|
10
|
+
* @param entryPoints - The entry points to resolve.
|
|
11
|
+
* @returns The resolved entry options.
|
|
12
|
+
*/
|
|
13
|
+
declare function resolveEntry(context: Context, entryPoints?: ResolvedEntryTypeDefinition[] | string[]): BuildOptions["entryPoints"];
|
|
14
|
+
/**
|
|
15
|
+
* Resolves the esbuild options.
|
|
16
|
+
*
|
|
17
|
+
* @param context - The build context.
|
|
18
|
+
* @returns The resolved esbuild options.
|
|
19
|
+
*/
|
|
20
|
+
declare function resolveOptions(context: Context): BuildOptions;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { resolveEntry as n, resolveOptions as r, DEFAULT_ESBUILD_CONFIG as t };
|
|
23
|
+
//# sourceMappingURL=resolve-options-DSHX7AUS.d.cts.map
|
|
@@ -0,0 +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"}
|
package/dist/types/build.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../build-CQpSv6Qa.cjs');
|
package/dist/types/build.d.cts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type EsbuildOptions = Omit<BuildOptions, "entryPoints" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel">;
|
|
5
|
-
declare type __ΩEsbuildOptions = any[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { EsbuildOptions, __ΩEsbuildOptions };
|
|
8
|
-
//# sourceMappingURL=build.d.cts.map
|
|
1
|
+
import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "../build-Br4iCJ5d.cjs";
|
|
2
|
+
export { EsbuildOptions, __ΩEsbuildOptions };
|
package/dist/types/build.d.mts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type EsbuildOptions = Omit<BuildOptions, "entryPoints" | "platform" | "outdir" | "env" | "assets" | "external" | "inject" | "tsconfig" | "tsconfigRaw" | "logLevel">;
|
|
5
|
-
declare type __ΩEsbuildOptions = any[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { EsbuildOptions, __ΩEsbuildOptions };
|
|
8
|
-
//# sourceMappingURL=build.d.mts.map
|
|
1
|
+
import { n as __ΩEsbuildOptions, t as EsbuildOptions } from "../build-CrohITJo.mjs";
|
|
2
|
+
export { EsbuildOptions, __ΩEsbuildOptions };
|
package/dist/types/build.mjs
CHANGED
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EsbuildPluginContext,
|
|
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";
|
|
3
|
+
import "../index-sQecLSpR.cjs";
|
|
3
4
|
export { EsbuildOptions, EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildOptions, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { EsbuildPluginContext,
|
|
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";
|
|
3
|
+
import "../index-DJOHDG5e.mjs";
|
|
3
4
|
export { EsbuildOptions, EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildOptions, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-OjUZLLkc.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type EsbuildPluginOptions = Partial<EsbuildOptions>;
|
|
7
|
-
interface EsbuildPluginUserConfig extends UserConfig {
|
|
8
|
-
esbuild?: EsbuildPluginOptions;
|
|
9
|
-
}
|
|
10
|
-
interface EsbuildPluginResolvedConfig extends ResolvedConfig {
|
|
11
|
-
esbuild: EsbuildOptions;
|
|
12
|
-
}
|
|
13
|
-
type EsbuildPluginContext<TResolvedConfig extends EsbuildPluginResolvedConfig = EsbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
declare type __ΩEsbuildPluginOptions = any[];
|
|
15
|
-
declare type __ΩEsbuildPluginUserConfig = any[];
|
|
16
|
-
declare type __ΩEsbuildPluginResolvedConfig = any[];
|
|
17
|
-
declare type __ΩEsbuildPluginContext = any[];
|
|
18
|
-
//#endregion
|
|
19
|
-
export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
|
20
|
-
//# sourceMappingURL=plugin.d.cts.map
|
|
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";
|
|
3
|
+
export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { EsbuildOptions } from "./build.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type EsbuildPluginOptions = Partial<EsbuildOptions>;
|
|
8
|
-
interface EsbuildPluginUserConfig extends UserConfig {
|
|
9
|
-
esbuild?: EsbuildPluginOptions;
|
|
10
|
-
}
|
|
11
|
-
interface EsbuildPluginResolvedConfig extends ResolvedConfig {
|
|
12
|
-
esbuild: EsbuildOptions;
|
|
13
|
-
}
|
|
14
|
-
type EsbuildPluginContext<TResolvedConfig extends EsbuildPluginResolvedConfig = EsbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
15
|
-
declare type __ΩEsbuildPluginOptions = any[];
|
|
16
|
-
declare type __ΩEsbuildPluginUserConfig = any[];
|
|
17
|
-
declare type __ΩEsbuildPluginResolvedConfig = any[];
|
|
18
|
-
declare type __ΩEsbuildPluginContext = any[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
|
21
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
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";
|
|
3
|
+
export { EsbuildPluginContext, EsbuildPluginOptions, EsbuildPluginResolvedConfig, EsbuildPluginUserConfig, __ΩEsbuildPluginContext, __ΩEsbuildPluginOptions, __ΩEsbuildPluginResolvedConfig, __ΩEsbuildPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_resolve_options = require('./resolve-options-C3WIGKaG.cjs');
|
|
2
|
+
let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
3
|
+
let unplugin = require("unplugin");
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/unplugin.ts
|
|
6
|
+
function createEsbuildPlugin(context) {
|
|
7
|
+
return (0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
Object.defineProperty(exports, 'createEsbuildPlugin', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return createEsbuildPlugin;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as EsbuildPluginContext } from "./plugin-fp0p1CCy.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 as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-Cf7hyWQE.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-Cf7hyWQE.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as EsbuildPluginContext } from "./plugin-Bivts13R.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 as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-Csi4d8gj.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-Csi4d8gj.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,mBAAA,UAA6B,uBAAoB,QAAA,CAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
+
import { createEsbuildPlugin } from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.ts
|
|
5
|
+
function createEsbuildPlugin$1(context) {
|
|
6
|
+
return createEsbuildPlugin(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createEsbuildPlugin$1 as t };
|
|
11
|
+
//# sourceMappingURL=unplugin-_Yvl6iM8.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-_Yvl6iM8.mjs","names":["createEsbuildPlugin","createEsbuildUnplugin"],"sources":["../src/helpers/unplugin.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 { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin as createEsbuildUnplugin } from \"unplugin\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport function createEsbuildPlugin(context: EsbuildPluginContext) {\n return createEsbuildUnplugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgBA,sBAAoB,SAA+B;AACjE,QAAOC,oBAAsB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-esbuild",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.308",
|
|
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.
|
|
86
|
+
"@powerlines/core": "^0.0.10",
|
|
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": "
|
|
97
|
+
"gitHead": "c5eba2320a22122bbefaca9aba105dd8a98f19b9"
|
|
98
98
|
}
|