@powerlines/plugin-esbuild 0.13.460 → 0.13.464

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 (70) hide show
  1. package/dist/build-B8u-bRQt.d.cts +8 -0
  2. package/dist/build-B8u-bRQt.d.cts.map +1 -0
  3. package/dist/build-VnV0tsb3.d.mts +8 -0
  4. package/dist/build-VnV0tsb3.d.mts.map +1 -0
  5. package/dist/bundle-A-22BjWv.d.mts +22 -0
  6. package/dist/bundle-A-22BjWv.d.mts.map +1 -0
  7. package/dist/bundle-B_-jRFlM.cjs +84 -0
  8. package/dist/bundle-HmHLeZt2.d.cts +22 -0
  9. package/dist/bundle-HmHLeZt2.d.cts.map +1 -0
  10. package/dist/helpers/bundle.cjs +2 -49
  11. package/dist/helpers/bundle.d.cts +2 -22
  12. package/dist/helpers/bundle.d.mts +2 -22
  13. package/dist/helpers/bundle.mjs +3 -6
  14. package/dist/helpers/bundle.mjs.map +1 -1
  15. package/dist/helpers/index.cjs +3 -9
  16. package/dist/helpers/index.d.cts +3 -5
  17. package/dist/helpers/index.d.mts +3 -5
  18. package/dist/helpers/index.mjs +1 -3
  19. package/dist/helpers/resolve.cjs +4 -5
  20. package/dist/helpers/resolve.d.cts +2 -26
  21. package/dist/helpers/resolve.d.mts +2 -26
  22. package/dist/helpers/resolve.mjs +2 -2
  23. package/dist/helpers/resolve.mjs.map +1 -1
  24. package/dist/index-BtBZHVmz.d.cts +1 -0
  25. package/dist/index-DXRuzH8z.d.mts +1 -0
  26. package/dist/index.cjs +19 -19
  27. package/dist/index.d.cts +5 -7
  28. package/dist/index.d.cts.map +1 -1
  29. package/dist/index.d.mts +5 -7
  30. package/dist/index.d.mts.map +1 -1
  31. package/dist/index.mjs +15 -10
  32. package/dist/index.mjs.map +1 -1
  33. package/dist/plugin-BuKZtP7s.d.mts +19 -0
  34. package/dist/plugin-BuKZtP7s.d.mts.map +1 -0
  35. package/dist/plugin-g0pkWAvQ.d.cts +19 -0
  36. package/dist/plugin-g0pkWAvQ.d.cts.map +1 -0
  37. package/dist/resolve-DGrNGKUw.d.mts +26 -0
  38. package/dist/resolve-DGrNGKUw.d.mts.map +1 -0
  39. package/dist/resolve-uvDtu7oi.d.cts +26 -0
  40. package/dist/resolve-uvDtu7oi.d.cts.map +1 -0
  41. package/dist/types/build.d.cts +2 -8
  42. package/dist/types/build.d.mts +2 -8
  43. package/dist/types/index.d.cts +3 -3
  44. package/dist/types/index.d.mts +3 -3
  45. package/dist/types/plugin.d.cts +2 -21
  46. package/dist/types/plugin.d.mts +2 -21
  47. package/package.json +12 -11
  48. package/dist/_virtual/_rolldown/runtime.cjs +0 -29
  49. package/dist/helpers/bundle.d.cts.map +0 -1
  50. package/dist/helpers/bundle.d.mts.map +0 -1
  51. package/dist/helpers/resolve-options.cjs +0 -91
  52. package/dist/helpers/resolve-options.d.cts +0 -23
  53. package/dist/helpers/resolve-options.d.cts.map +0 -1
  54. package/dist/helpers/resolve-options.d.mts +0 -23
  55. package/dist/helpers/resolve-options.d.mts.map +0 -1
  56. package/dist/helpers/resolve-options.mjs +0 -87
  57. package/dist/helpers/resolve-options.mjs.map +0 -1
  58. package/dist/helpers/resolve.d.cts.map +0 -1
  59. package/dist/helpers/resolve.d.mts.map +0 -1
  60. package/dist/helpers/unplugin.cjs +0 -18
  61. package/dist/helpers/unplugin.d.cts +0 -8
  62. package/dist/helpers/unplugin.d.cts.map +0 -1
  63. package/dist/helpers/unplugin.d.mts +0 -8
  64. package/dist/helpers/unplugin.d.mts.map +0 -1
  65. package/dist/helpers/unplugin.mjs +0 -17
  66. package/dist/helpers/unplugin.mjs.map +0 -1
  67. package/dist/types/build.d.cts.map +0 -1
  68. package/dist/types/build.d.mts.map +0 -1
  69. package/dist/types/plugin.d.cts.map +0 -1
  70. package/dist/types/plugin.d.mts.map +0 -1
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.mjs","names":[],"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 type { Context, ResolvedEntryTypeDefinition } from \"@powerlines/core\";\nimport { resolveEntryOutput } from \"@powerlines/core/lib/entry\";\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 } from \"esbuild\";\nimport { EsbuildPluginContext } from \"../types/plugin\";\n\nexport const DEFAULT_ESBUILD_CONFIG: Partial<BuildOptions> = {\n target: \"esnext\",\n platform: \"neutral\",\n format: \"esm\",\n write: true,\n minify: true,\n sourcemap: false,\n bundle: true,\n treeShaking: true,\n keepNames: true,\n splitting: true,\n logLevel: \"silent\"\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.config.cwd,\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.config.cwd,\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 : \"bundle\",\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.path,\n tsconfig: context.tsconfig.tsconfigFilePath,\n minify: context.config.output.minify,\n metafile: context.config.mode === \"development\",\n sourcemap: context.config.output.sourceMap\n },\n DEFAULT_ESBUILD_CONFIG\n ) as BuildOptions;\n}\n"],"mappings":";;;;;;;;AA4BA,MAAa,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,OAAO,KACf,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,SAA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D"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.cts","names":[],"sources":["../../src/helpers/resolve.ts"],"mappings":";;;;;;;AAoCA;;;;;;iBAAsB,aAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBAyEW,OAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve.d.mts","names":[],"sources":["../../src/helpers/resolve.ts"],"mappings":";;;;;;;AAoCA;;;;;;iBAAsB,aAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA;;;;;;;;;iBAyEW,OAAA,2BAEH,aAAA,GAAgB,aAAA,CAAA,CAEjC,OAAA,EAAS,QAAA,EACT,IAAA,EAAM,uBAAA,EACN,SAAA,GAAY,aAAA,GACX,OAAA,CAAQ,OAAA"}
@@ -1,18 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
4
- let unplugin = require("unplugin");
5
-
6
- //#region src/helpers/unplugin.ts
7
- function createEsbuildPlugin(context) {
8
- return (0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context, {
9
- silenceHookLogging: true,
10
- name: "esbuild"
11
- }))({
12
- ...context.options,
13
- ...context.config.initialConfig
14
- });
15
- }
16
-
17
- //#endregion
18
- exports.createEsbuildPlugin = createEsbuildPlugin;
@@ -1,8 +0,0 @@
1
- import { EsbuildPluginContext } from "../types/plugin.cjs";
2
- import * as _$esbuild from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createEsbuildPlugin(context: EsbuildPluginContext): _$esbuild.Plugin;
6
- //#endregion
7
- export { createEsbuildPlugin };
8
- //# sourceMappingURL=unplugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAoB,SAAA,CAAA,MAAA"}
@@ -1,8 +0,0 @@
1
- import { EsbuildPluginContext } from "../types/plugin.mjs";
2
- import * as _$esbuild from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createEsbuildPlugin(context: EsbuildPluginContext): _$esbuild.Plugin;
6
- //#endregion
7
- export { createEsbuildPlugin };
8
- //# sourceMappingURL=unplugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,mBAAA,CAAoB,OAAA,EAAS,oBAAA,GAAoB,SAAA,CAAA,MAAA"}
@@ -1,17 +0,0 @@
1
- import { createUnplugin } from "@powerlines/core/lib/unplugin";
2
- import { createEsbuildPlugin as createEsbuildPlugin$1 } from "unplugin";
3
-
4
- //#region src/helpers/unplugin.ts
5
- function createEsbuildPlugin(context) {
6
- return createEsbuildPlugin$1(createUnplugin(context, {
7
- silenceHookLogging: true,
8
- name: "esbuild"
9
- }))({
10
- ...context.options,
11
- ...context.config.initialConfig
12
- });
13
- }
14
-
15
- //#endregion
16
- export { createEsbuildPlugin };
17
- //# sourceMappingURL=unplugin.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin.mjs","names":["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(\n createUnplugin(context, { silenceHookLogging: true, name: \"esbuild\" })\n )({ ...context.options, ...context.config.initialConfig });\n}\n"],"mappings":";;;;AAsBA,SAAgB,oBAAoB,SAA+B;AACjE,QAAOA,sBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAW,CAAC,CACvE,CAAC;EAAE,GAAG,QAAQ;EAAS,GAAG,QAAQ,OAAO;EAAe,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,IAAA,CAC3B,YAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,IAAA,CAC3B,YAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,0BAAA,GACV,mBAAA,CAAoB,uBAAA;AAAA,UAEL,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KA0BY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,KAGA,0BAAA,GACV,mBAAA,CAAoB,uBAAA;AAAA,UAEL,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}