@powerlines/plugin-esbuild 0.13.384 → 0.13.386
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 +2 -2
- package/dist/helpers/bundle.d.cts +1 -0
- package/dist/helpers/bundle.d.cts.map +1 -1
- package/dist/helpers/bundle.d.mts +1 -0
- package/dist/helpers/bundle.d.mts.map +1 -1
- package/dist/helpers/bundle.mjs +2 -2
- package/dist/helpers/bundle.mjs.map +1 -1
- package/package.json +4 -4
package/dist/helpers/bundle.cjs
CHANGED
|
@@ -31,9 +31,9 @@ async function bundle(context, file, overrides = {}) {
|
|
|
31
31
|
packages: "bundle",
|
|
32
32
|
platform: "node",
|
|
33
33
|
logLevel: "silent",
|
|
34
|
-
...(0, _stryke_helpers_omit.omit)(overrides, ["resolve"])
|
|
34
|
+
...(0, _stryke_helpers_omit.omit)(overrides, ["name", "resolve"])
|
|
35
35
|
}, require_helpers_resolve_options.resolveOptions(context), { plugins: [(0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnpluginResolver)(context, {
|
|
36
|
-
name: `${(0, _stryke_path_file_path_fns.findFileName)(file)} Bundler`,
|
|
36
|
+
name: overrides.name ?? `${(0, _stryke_path_file_path_fns.findFileName)(file)} Bundler`,
|
|
37
37
|
prefix: false,
|
|
38
38
|
overrides: (0, defu.default)(overrides.resolve ?? {}, { skipNodeModulesBundle: false }, context.config.resolve)
|
|
39
39
|
}))({})] }));
|
|
@@ -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":";;;;;KAgCY,aAAA,GAAgB,OAAA,CAAQ,cAAA;EAClC,IAAA;EACA,OAAA,GAAU,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;iBAWE,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CAC5D,OAAA,EAAS,QAAA,EACT,IAAA,UACA,SAAA,GAAW,aAAA,GACV,OAAA,CAAQ,UAAA;AAAA"}
|
|
@@ -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":";;;;;KAgCY,aAAA,GAAgB,OAAA,CAAQ,cAAA;EAClC,IAAA;EACA,OAAA,GAAU,OAAA,CAAQ,cAAA;AAAA;;;;;;;;;iBAWE,MAAA,kBAAwB,aAAA,GAAgB,aAAA,CAAA,CAC5D,OAAA,EAAS,QAAA,EACT,IAAA,UACA,SAAA,GAAW,aAAA,GACV,OAAA,CAAQ,UAAA;AAAA"}
|
package/dist/helpers/bundle.mjs
CHANGED
|
@@ -28,9 +28,9 @@ async function bundle(context, file, overrides = {}) {
|
|
|
28
28
|
packages: "bundle",
|
|
29
29
|
platform: "node",
|
|
30
30
|
logLevel: "silent",
|
|
31
|
-
...omit(overrides, ["resolve"])
|
|
31
|
+
...omit(overrides, ["name", "resolve"])
|
|
32
32
|
}, resolveOptions(context), { plugins: [createEsbuildPlugin(createUnpluginResolver(context, {
|
|
33
|
-
name: `${findFileName(file)} Bundler`,
|
|
33
|
+
name: overrides.name ?? `${findFileName(file)} Bundler`,
|
|
34
34
|
prefix: false,
|
|
35
35
|
overrides: defu(overrides.resolve ?? {}, { skipNodeModulesBundle: false }, context.config.resolve)
|
|
36
36
|
}))({})] }));
|
|
@@ -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 {
|
|
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 {\n CreateUnpluginResolverOptions,\n PluginContext,\n ResolveOptions\n} 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, OutputFile } from \"esbuild\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { EsbuildOptions } from \"../types\";\nimport { resolveOptions } from \"./resolve-options\";\n\nexport type BundleOptions = Partial<EsbuildOptions> & {\n name?: string;\n resolve?: Partial<ResolveOptions>;\n};\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<TContext extends PluginContext = PluginContext>(\n context: TContext,\n file: string,\n overrides: BundleOptions = {}\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 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, [\"name\", \"resolve\"])\n },\n resolveOptions(context),\n {\n plugins: [\n createEsbuildPlugin(\n createUnpluginResolver(context, {\n name: overrides.name ?? `${findFileName(file)} Bundler`,\n prefix: false,\n overrides: defu(\n overrides.resolve ?? {},\n { skipNodeModulesBundle: false },\n context.config.resolve\n )\n } as CreateUnpluginResolverOptions)\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":";;;;;;;;;;;;;;;;;AA6CA,eAAsB,OACpB,SACA,MACA,YAA2B,EAAE,EACR;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,aAAa,CAAC,KAAK;EACnB,OAAO;EACP,WAAW;EACX,WAAW;EACX,aAAa;EACb,QAAQ;EACR,UAAU;EACV,UAAU;EACV,UAAU;EACV,GAAG,KAAK,WAAW,CAAC,QAAQ,UAAU,CAAC;EACxC,EACD,eAAe,QAAQ,EACvB,EACE,SAAS,CACP,oBACE,uBAAuB,SAAS;EAC9B,MAAM,UAAU,QAAQ,GAAG,aAAa,KAAK,CAAC;EAC9C,QAAQ;EACR,WAAW,KACT,UAAU,WAAW,EAAE,EACvB,EAAE,uBAAuB,OAAO,EAChC,QAAQ,OAAO,QAChB;EACF,CAAkC,CACpC,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-esbuild",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.386",
|
|
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,16 +83,16 @@
|
|
|
83
83
|
"peerDependencies": { "esbuild": ">=0.27.3" },
|
|
84
84
|
"peerDependenciesMeta": { "esbuild": { "optional": false } },
|
|
85
85
|
"dependencies": {
|
|
86
|
-
"@powerlines/core": "^0.12.
|
|
86
|
+
"@powerlines/core": "^0.12.6",
|
|
87
87
|
"@stryke/fs": "^0.33.64",
|
|
88
88
|
"@stryke/path": "^0.27.3",
|
|
89
89
|
"@stryke/type-checks": "^0.6.0",
|
|
90
90
|
"@stryke/types": "^0.11.2",
|
|
91
|
-
"defu": "^6.1.
|
|
91
|
+
"defu": "^6.1.6",
|
|
92
92
|
"jiti": "^2.6.1",
|
|
93
93
|
"unplugin": "^3.0.0"
|
|
94
94
|
},
|
|
95
95
|
"devDependencies": { "esbuild": "^0.27.4", "@types/node": "^25.5.0" },
|
|
96
96
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "36659bb9272f4247dca475613e45451f0adedcfa"
|
|
98
98
|
}
|