@powerlines/plugin-esbuild 0.13.375 → 0.13.377
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/helpers/bundle.cjs +4 -2
- package/dist/helpers/bundle.d.cts +4 -2
- package/dist/helpers/bundle.d.cts.map +1 -1
- package/dist/helpers/bundle.d.mts +4 -2
- package/dist/helpers/bundle.d.mts.map +1 -1
- package/dist/helpers/bundle.mjs +4 -2
- package/dist/helpers/bundle.mjs.map +1 -1
- package/package.json +3 -3
package/dist/helpers/bundle.cjs
CHANGED
|
@@ -6,6 +6,7 @@ defu = require_runtime.__toESM(defu);
|
|
|
6
6
|
let esbuild = require("esbuild");
|
|
7
7
|
let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
8
8
|
let unplugin = require("unplugin");
|
|
9
|
+
let _stryke_helpers_omit = require("@stryke/helpers/omit");
|
|
9
10
|
let _stryke_path_file_path_fns = require("@stryke/path/file-path-fns");
|
|
10
11
|
|
|
11
12
|
//#region src/helpers/bundle.ts
|
|
@@ -21,8 +22,9 @@ async function bundle(context, file, overrides = {}) {
|
|
|
21
22
|
const path = await context.fs.resolve(file);
|
|
22
23
|
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
23
24
|
const ctx = await context.clone();
|
|
24
|
-
ctx.config.resolve.skipNodeModulesBundle
|
|
25
|
+
ctx.config.resolve = (0, defu.default)(overrides.resolve ?? {}, { skipNodeModulesBundle: false }, ctx.config.resolve);
|
|
25
26
|
ctx.config.esbuild = {
|
|
27
|
+
...ctx.config.esbuild ?? {},
|
|
26
28
|
entryPoints: [path],
|
|
27
29
|
write: false,
|
|
28
30
|
sourcemap: false,
|
|
@@ -32,7 +34,7 @@ async function bundle(context, file, overrides = {}) {
|
|
|
32
34
|
packages: "bundle",
|
|
33
35
|
platform: "node",
|
|
34
36
|
logLevel: "silent",
|
|
35
|
-
...overrides
|
|
37
|
+
...(0, _stryke_helpers_omit.omit)(overrides, ["resolve"])
|
|
36
38
|
};
|
|
37
39
|
const result = await (0, esbuild.build)((0, defu.default)(require_helpers_resolve_options.resolveOptions(ctx), { plugins: [(0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnpluginResolver)(ctx, {
|
|
38
40
|
name: `${(0, _stryke_path_file_path_fns.findFileName)(file)} Bundler`,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PluginContext } from "@powerlines/core";
|
|
1
|
+
import { PluginContext, ResolveResolvedConfig } from "@powerlines/core";
|
|
2
2
|
import { BuildOptions, OutputFile } from "esbuild";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/bundle.d.ts
|
|
@@ -10,7 +10,9 @@ import { BuildOptions, OutputFile } from "esbuild";
|
|
|
10
10
|
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
11
11
|
* @returns A promise that resolves to the bundled module.
|
|
12
12
|
*/
|
|
13
|
-
declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions>
|
|
13
|
+
declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions> & {
|
|
14
|
+
resolve?: Partial<ResolveResolvedConfig>;
|
|
15
|
+
}): Promise<OutputFile>;
|
|
14
16
|
//#endregion
|
|
15
17
|
export { bundle };
|
|
16
18
|
//# sourceMappingURL=bundle.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.cts","names":[],"sources":["../../src/helpers/bundle.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"bundle.d.cts","names":[],"sources":["../../src/helpers/bundle.ts"],"mappings":";;;;;;AAoCA;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,aAAA,EACT,IAAA,UACA,SAAA,GAAW,OAAA,CAAQ,YAAA;EACjB,OAAA,GAAU,OAAA,CAAQ,qBAAA;AAAA,IAEnB,OAAA,CAAQ,UAAA"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BuildOptions, OutputFile } from "esbuild";
|
|
2
|
-
import { PluginContext } from "@powerlines/core";
|
|
2
|
+
import { PluginContext, ResolveResolvedConfig } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/helpers/bundle.d.ts
|
|
5
5
|
/**
|
|
@@ -10,7 +10,9 @@ import { PluginContext } from "@powerlines/core";
|
|
|
10
10
|
* @param overrides - Optional overrides for the ESBuild configuration.
|
|
11
11
|
* @returns A promise that resolves to the bundled module.
|
|
12
12
|
*/
|
|
13
|
-
declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions>
|
|
13
|
+
declare function bundle(context: PluginContext, file: string, overrides?: Partial<BuildOptions> & {
|
|
14
|
+
resolve?: Partial<ResolveResolvedConfig>;
|
|
15
|
+
}): Promise<OutputFile>;
|
|
14
16
|
//#endregion
|
|
15
17
|
export { bundle };
|
|
16
18
|
//# sourceMappingURL=bundle.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.d.mts","names":[],"sources":["../../src/helpers/bundle.ts"],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"bundle.d.mts","names":[],"sources":["../../src/helpers/bundle.ts"],"mappings":";;;;;;AAoCA;;;;;;iBAAsB,MAAA,CACpB,OAAA,EAAS,aAAA,EACT,IAAA,UACA,SAAA,GAAW,OAAA,CAAQ,YAAA;EACjB,OAAA,GAAU,OAAA,CAAQ,qBAAA;AAAA,IAEnB,OAAA,CAAQ,UAAA"}
|
package/dist/helpers/bundle.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import defu from "defu";
|
|
|
3
3
|
import { build } from "esbuild";
|
|
4
4
|
import { createUnpluginResolver } from "@powerlines/core/lib/unplugin";
|
|
5
5
|
import { createEsbuildPlugin } from "unplugin";
|
|
6
|
+
import { omit } from "@stryke/helpers/omit";
|
|
6
7
|
import { findFileName } from "@stryke/path/file-path-fns";
|
|
7
8
|
|
|
8
9
|
//#region src/helpers/bundle.ts
|
|
@@ -18,8 +19,9 @@ async function bundle(context, file, overrides = {}) {
|
|
|
18
19
|
const path = await context.fs.resolve(file);
|
|
19
20
|
if (!path || !context.fs.existsSync(path)) throw new Error(`Module not found: "${file}". Please check the path and try again.`);
|
|
20
21
|
const ctx = await context.clone();
|
|
21
|
-
ctx.config.resolve.skipNodeModulesBundle
|
|
22
|
+
ctx.config.resolve = defu(overrides.resolve ?? {}, { skipNodeModulesBundle: false }, ctx.config.resolve);
|
|
22
23
|
ctx.config.esbuild = {
|
|
24
|
+
...ctx.config.esbuild ?? {},
|
|
23
25
|
entryPoints: [path],
|
|
24
26
|
write: false,
|
|
25
27
|
sourcemap: false,
|
|
@@ -29,7 +31,7 @@ async function bundle(context, file, overrides = {}) {
|
|
|
29
31
|
packages: "bundle",
|
|
30
32
|
platform: "node",
|
|
31
33
|
logLevel: "silent",
|
|
32
|
-
...overrides
|
|
34
|
+
...omit(overrides, ["resolve"])
|
|
33
35
|
};
|
|
34
36
|
const result = await build(defu(resolveOptions(ctx), { plugins: [createEsbuildPlugin(createUnpluginResolver(ctx, {
|
|
35
37
|
name: `${findFileName(file)} Bundler`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundle.mjs","names":[],"sources":["../../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { EsbuildPluginContext } from \"../types\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const ctx = (await context.clone()) as EsbuildPluginContext;\n\n ctx.config.resolve.skipNodeModulesBundle
|
|
1
|
+
{"version":3,"file":"bundle.mjs","names":[],"sources":["../../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext, ResolveResolvedConfig } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { omit } from \"@stryke/helpers/omit\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { EsbuildPluginContext } from \"../types\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> & {\n resolve?: Partial<ResolveResolvedConfig>;\n } = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const ctx = (await context.clone()) as EsbuildPluginContext;\n\n ctx.config.resolve = defu(\n overrides.resolve ?? {},\n { skipNodeModulesBundle: false },\n ctx.config.resolve\n ) as ResolveResolvedConfig;\n ctx.config.esbuild = {\n ...(ctx.config.esbuild ?? {}),\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: true,\n bundle: true,\n packages: \"bundle\",\n platform: \"node\",\n logLevel: \"silent\",\n ...omit(overrides, [\"resolve\"])\n } as BuildOptions;\n\n const result = await build(\n defu(resolveOptions(ctx), {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(ctx, {\n name: `${findFileName(file)} Bundler`,\n prefix: false\n })\n )({})\n ]\n })\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAoCA,eAAsB,OACpB,SACA,MACA,YAEI,EAAE,EACe;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,KAAK;AAC3C,KAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,KAAK,CACvC,OAAM,IAAI,MACR,sBAAsB,KAAK,yCAC5B;CAGH,MAAM,MAAO,MAAM,QAAQ,OAAO;AAElC,KAAI,OAAO,UAAU,KACnB,UAAU,WAAW,EAAE,EACvB,EAAE,uBAAuB,OAAO,EAChC,IAAI,OAAO,QACZ;AACD,KAAI,OAAO,UAAU;EACnB,GAAI,IAAI,OAAO,WAAW,EAAE;EAC5B,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG,KAAK,WAAW,CAAC,UAAU,CAAC;EAChC;CAED,MAAM,SAAS,MAAM,MACnB,KAAK,eAAe,IAAI,EAAE,EACxB,SAAS,CACP,oBACE,uBAAuB,KAAK;EAC1B,MAAM,GAAG,aAAa,KAAK,CAAC;EAC5B,QAAQ;EACT,CAAC,CACH,CAAC,EAAE,CAAC,CACN,EACF,CAAC,CACH;AACD,KAAI,OAAO,OAAO,SAAS,EACzB,OAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,KAAK,CACxB,KAAK,KAAK,GACd;AAEH,KAAI,OAAO,SAAS,SAAS,EAC3B,SAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,KAAK,CAC5B,KAAK,KAAK,GACd;AAEH,KAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,QAAQ,CAAC,WAAW,EACvE,OAAM,IAAI,MACR,iCACE,KACD,iDACF;AAGH,QAAO,OAAO,YAAY,OAAO,QAAQ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-esbuild",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.377",
|
|
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.27.3" },
|
|
84
84
|
"peerDependenciesMeta": { "esbuild": { "optional": false } },
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@powerlines/core": "^0.10.
|
|
86
|
+
"@powerlines/core": "^0.10.1",
|
|
87
87
|
"@stryke/fs": "^0.33.63",
|
|
88
88
|
"@stryke/path": "^0.27.2",
|
|
89
89
|
"@stryke/type-checks": "^0.5.41",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": { "esbuild": "^0.27.4", "@types/node": "^25.5.0" },
|
|
96
96
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "eb9b2f3872a25a93d62a1c93c7a0af5fb600a999"
|
|
98
98
|
}
|