@powerlines/plugin-esbuild 0.13.343 → 0.13.345

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.
@@ -24,13 +24,16 @@ async function bundle(context, file, overrides = {}) {
24
24
  write: false,
25
25
  sourcemap: false,
26
26
  splitting: false,
27
- treeShaking: false,
27
+ treeShaking: true,
28
28
  bundle: true,
29
29
  packages: "bundle",
30
30
  platform: "node",
31
31
  logLevel: "silent",
32
32
  ...overrides
33
- }, { plugins: [(0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnpluginResolver)(context, { name: `${(0, __stryke_path_file_path_fns.findFileName)(file)} Bundler` }))({})] }));
33
+ }, { plugins: [(0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnpluginResolver)(context, {
34
+ name: `${(0, __stryke_path_file_path_fns.findFileName)(file)} Bundler`,
35
+ prefix: false
36
+ }))({})] }));
34
37
  if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
35
38
  if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
36
39
  if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
@@ -23,13 +23,16 @@ async function bundle(context, file, overrides = {}) {
23
23
  write: false,
24
24
  sourcemap: false,
25
25
  splitting: false,
26
- treeShaking: false,
26
+ treeShaking: true,
27
27
  bundle: true,
28
28
  packages: "bundle",
29
29
  platform: "node",
30
30
  logLevel: "silent",
31
31
  ...overrides
32
- }, { plugins: [createEsbuildPlugin(createUnpluginResolver(context, { name: `${findFileName(file)} Bundler` }))({})] }));
32
+ }, { plugins: [createEsbuildPlugin(createUnpluginResolver(context, {
33
+ name: `${findFileName(file)} Bundler`,
34
+ prefix: false
35
+ }))({})] }));
33
36
  if (result.errors.length > 0) throw new Error(`Failed to bundle ${file}: ${result.errors.map((error) => error.text).join(", ")}`);
34
37
  if (result.warnings.length > 0) context.warn(`Warnings while bundling ${file}: ${result.warnings.map((warning) => warning.text).join(", ")}`);
35
38
  if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) throw new Error(`No output files generated for ${file}. Please check the configuration and try again.`);
@@ -38,4 +41,4 @@ async function bundle(context, file, overrides = {}) {
38
41
 
39
42
  //#endregion
40
43
  export { bundle as t };
41
- //# sourceMappingURL=bundle-CVo6LDmp.mjs.map
44
+ //# sourceMappingURL=bundle-Mt5bozRV.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"bundle-CVo6LDmp.mjs","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build(\n defu(\n {\n ...resolveOptions(context),\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: false,\n bundle: true,\n packages: \"bundle\",\n platform: \"node\",\n logLevel: \"silent\",\n ...overrides\n } as BuildOptions,\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, {\n name: `${findFileName(file)} Bundler`\n })\n )({})\n ]\n }\n )\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,eAAsB,OACpB,SACA,MACA,YAAmC,EAAE,EAChB;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,KAAK;AAC3C,KAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,KAAK,CACvC,OAAM,IAAI,MACR,sBAAsB,KAAK,yCAC5B;CAGH,MAAM,SAAS,MAAM,MACnB,KACE;EACE,GAAG,eAAe,QAAQ;EAC1B,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG;EACJ,EACD,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS,EAC9B,MAAM,GAAG,aAAa,KAAK,CAAC,WAC7B,CAAC,CACH,CAAC,EAAE,CAAC,CACN,EACF,CACF,CACF;AACD,KAAI,OAAO,OAAO,SAAS,EACzB,OAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,KAAK,CACxB,KAAK,KAAK,GACd;AAEH,KAAI,OAAO,SAAS,SAAS,EAC3B,SAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,KAAK,CAC5B,KAAK,KAAK,GACd;AAEH,KAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,QAAQ,CAAC,WAAW,EACvE,OAAM,IAAI,MACR,iCACE,KACD,iDACF;AAGH,QAAO,OAAO,YAAY,OAAO,QAAQ,CAAC"}
1
+ {"version":3,"file":"bundle-Mt5bozRV.mjs","names":[],"sources":["../src/helpers/bundle.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport type { PluginContext } from \"@powerlines/core\";\nimport { createUnpluginResolver } from \"@powerlines/core/lib/unplugin\";\nimport { findFileName } from \"@stryke/path/file-path-fns\";\nimport defu from \"defu\";\nimport { build, BuildOptions, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { resolveOptions } from \"./resolve-options\";\n\n/**\n * Bundle a type definition to a module.\n *\n * @param context - The context object containing the environment paths.\n * @param file - The file path to bundle.\n * @param overrides - Optional overrides for the ESBuild configuration.\n * @returns A promise that resolves to the bundled module.\n */\nexport async function bundle(\n context: PluginContext,\n file: string,\n overrides: Partial<BuildOptions> = {}\n): Promise<OutputFile> {\n const path = await context.fs.resolve(file);\n if (!path || !context.fs.existsSync(path)) {\n throw new Error(\n `Module not found: \"${file}\". Please check the path and try again.`\n );\n }\n\n const result = await build(\n defu(\n {\n ...resolveOptions(context),\n entryPoints: [path],\n write: false,\n sourcemap: false,\n splitting: false,\n treeShaking: true,\n bundle: true,\n packages: \"bundle\",\n platform: \"node\",\n logLevel: \"silent\",\n ...overrides\n } as BuildOptions,\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, {\n name: `${findFileName(file)} Bundler`,\n prefix: false\n })\n )({})\n ]\n }\n )\n );\n if (result.errors.length > 0) {\n throw new Error(\n `Failed to bundle ${file}: ${result.errors\n .map(error => error.text)\n .join(\", \")}`\n );\n }\n if (result.warnings.length > 0) {\n context.warn(\n `Warnings while bundling ${file}: ${result.warnings\n .map(warning => warning.text)\n .join(\", \")}`\n );\n }\n if (!result.outputFiles || result.outputFiles.filter(Boolean).length === 0) {\n throw new Error(\n `No output files generated for ${\n file\n }. Please check the configuration and try again.`\n );\n }\n\n return result.outputFiles.filter(Boolean)[0]!;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAkCA,eAAsB,OACpB,SACA,MACA,YAAmC,EAAE,EAChB;CACrB,MAAM,OAAO,MAAM,QAAQ,GAAG,QAAQ,KAAK;AAC3C,KAAI,CAAC,QAAQ,CAAC,QAAQ,GAAG,WAAW,KAAK,CACvC,OAAM,IAAI,MACR,sBAAsB,KAAK,yCAC5B;CAGH,MAAM,SAAS,MAAM,MACnB,KACE;EACE,GAAG,eAAe,QAAQ;EAC1B,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG;EACJ,EACD,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS;EAC9B,MAAM,GAAG,aAAa,KAAK,CAAC;EAC5B,QAAQ;EACT,CAAC,CACH,CAAC,EAAE,CAAC,CACN,EACF,CACF,CACF;AACD,KAAI,OAAO,OAAO,SAAS,EACzB,OAAM,IAAI,MACR,oBAAoB,KAAK,IAAI,OAAO,OACjC,KAAI,UAAS,MAAM,KAAK,CACxB,KAAK,KAAK,GACd;AAEH,KAAI,OAAO,SAAS,SAAS,EAC3B,SAAQ,KACN,2BAA2B,KAAK,IAAI,OAAO,SACxC,KAAI,YAAW,QAAQ,KAAK,CAC5B,KAAK,KAAK,GACd;AAEH,KAAI,CAAC,OAAO,eAAe,OAAO,YAAY,OAAO,QAAQ,CAAC,WAAW,EACvE,OAAM,IAAI,MACR,iCACE,KACD,iDACF;AAGH,QAAO,OAAO,YAAY,OAAO,QAAQ,CAAC"}
@@ -1,4 +1,4 @@
1
1
  require('../resolve-options-C3WIGKaG.cjs');
2
- const require_bundle = require('../bundle-a75NYW0q.cjs');
2
+ const require_bundle = require('../bundle-CyAIQjG8.cjs');
3
3
 
4
4
  exports.bundle = require_bundle.bundle;
@@ -1,4 +1,4 @@
1
1
  import "../resolve-options-C-213jz6.mjs";
2
- import { t as bundle } from "../bundle-CVo6LDmp.mjs";
2
+ import { t as bundle } from "../bundle-Mt5bozRV.mjs";
3
3
 
4
4
  export { bundle };
@@ -1,6 +1,6 @@
1
1
  const require_resolve_options = require('../resolve-options-C3WIGKaG.cjs');
2
2
  const require_unplugin = require('../unplugin-CW_BVHFj.cjs');
3
- const require_bundle = require('../bundle-a75NYW0q.cjs');
3
+ const require_bundle = require('../bundle-CyAIQjG8.cjs');
4
4
  const require_resolve = require('../resolve-CsStIaEj.cjs');
5
5
  require('../helpers-CAF8Bmv1.cjs');
6
6
 
@@ -1,6 +1,6 @@
1
1
  import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "../resolve-options-C-213jz6.mjs";
2
2
  import { t as createEsbuildPlugin } from "../unplugin-_Yvl6iM8.mjs";
3
- import { t as bundle } from "../bundle-CVo6LDmp.mjs";
3
+ import { t as bundle } from "../bundle-Mt5bozRV.mjs";
4
4
  import { n as resolveModule, t as resolve } from "../resolve-C8OzoP-s.mjs";
5
5
  import "../helpers-BAUlPOQe.mjs";
6
6
 
package/dist/index.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, '__esModule', { value: true });
2
2
  const require_resolve_options = require('./resolve-options-C3WIGKaG.cjs');
3
3
  const require_unplugin = require('./unplugin-CW_BVHFj.cjs');
4
- const require_bundle = require('./bundle-a75NYW0q.cjs');
4
+ const require_bundle = require('./bundle-CyAIQjG8.cjs');
5
5
  const require_resolve = require('./resolve-CsStIaEj.cjs');
6
6
  require('./helpers-CAF8Bmv1.cjs');
7
7
  require('./types/index.cjs');
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
1
  import { n as resolveEntry, r as resolveOptions, t as DEFAULT_ESBUILD_CONFIG } from "./resolve-options-C-213jz6.mjs";
2
2
  import { t as createEsbuildPlugin } from "./unplugin-_Yvl6iM8.mjs";
3
- import { t as bundle } from "./bundle-CVo6LDmp.mjs";
3
+ import { t as bundle } from "./bundle-Mt5bozRV.mjs";
4
4
  import { n as resolveModule, t as resolve } from "./resolve-C8OzoP-s.mjs";
5
5
  import "./helpers-BAUlPOQe.mjs";
6
6
  import "./types/index.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-esbuild",
3
- "version": "0.13.343",
3
+ "version": "0.13.345",
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.2.21",
86
+ "@powerlines/core": "^0.2.22",
87
87
  "@stryke/fs": "^0.33.57",
88
88
  "@stryke/path": "^0.26.19",
89
89
  "@stryke/type-checks": "^0.5.38",
@@ -94,5 +94,5 @@
94
94
  },
95
95
  "devDependencies": { "esbuild": "^0.25.12", "@types/node": "^25.4.0" },
96
96
  "publishConfig": { "access": "public" },
97
- "gitHead": "df3c5d736cd0fce20967864a4920af034e9434e3"
97
+ "gitHead": "86bbe64da57a38d472b37261ca9d113171841a6c"
98
98
  }