@powerlines/plugin-rollup 0.7.345 → 0.7.347

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 (71) hide show
  1. package/README.md +14 -16
  2. package/dist/{build-CZBW0WlF.d.cts → build-BFa7jC2n.d.mts} +1 -1
  3. package/dist/build-BFa7jC2n.d.mts.map +1 -0
  4. package/dist/{build-TorJrUfF.d.mts → build-CTTuMTE8.d.cts} +1 -1
  5. package/dist/build-CTTuMTE8.d.cts.map +1 -0
  6. package/dist/helpers/index.cjs +4 -4
  7. package/dist/helpers/index.d.cts +2 -4
  8. package/dist/helpers/index.d.mts +2 -5
  9. package/dist/helpers/index.mjs +2 -3
  10. package/dist/helpers/resolve-options.cjs +2 -1
  11. package/dist/helpers/resolve-options.d.cts +1 -1
  12. package/dist/helpers/resolve-options.d.mts +1 -1
  13. package/dist/helpers/resolve-options.mjs +115 -2
  14. package/dist/helpers/resolve-options.mjs.map +1 -0
  15. package/dist/helpers/unplugin.cjs +11 -2
  16. package/dist/helpers/unplugin.d.cts +1 -2
  17. package/dist/helpers/unplugin.d.mts +1 -3
  18. package/dist/helpers/unplugin.mjs +10 -2
  19. package/dist/helpers/unplugin.mjs.map +1 -0
  20. package/dist/index.cjs +10 -11
  21. package/dist/index.d.cts +4 -6
  22. package/dist/index.d.cts.map +1 -1
  23. package/dist/index.d.mts +4 -6
  24. package/dist/index.d.mts.map +1 -1
  25. package/dist/index.mjs +4 -5
  26. package/dist/index.mjs.map +1 -1
  27. package/dist/{plugin-BULXKDMv.d.cts → plugin-BZbF8qd2.d.mts} +2 -2
  28. package/dist/plugin-BZbF8qd2.d.mts.map +1 -0
  29. package/dist/{plugin-y8-0XXZk.d.mts → plugin-Dm9Lskw9.d.cts} +2 -2
  30. package/dist/plugin-Dm9Lskw9.d.cts.map +1 -0
  31. package/dist/{resolve-options-CspMU4pD.d.mts → resolve-options-BtzeX_UB.d.mts} +1 -2
  32. package/dist/resolve-options-BtzeX_UB.d.mts.map +1 -0
  33. package/dist/{resolve-options-C5kHKAmS.d.cts → resolve-options-CdqC2t_d.d.cts} +1 -2
  34. package/dist/resolve-options-CdqC2t_d.d.cts.map +1 -0
  35. package/dist/{resolve-options-JUh7vwne.cjs → resolve-options-Csi14L2Z.cjs} +22 -22
  36. package/dist/types/build.d.cts +1 -1
  37. package/dist/types/build.d.mts +1 -1
  38. package/dist/types/index.d.cts +2 -3
  39. package/dist/types/index.d.mts +2 -3
  40. package/dist/types/plugin.d.cts +1 -1
  41. package/dist/types/plugin.d.mts +1 -2
  42. package/dist/unplugin-5bf1Tm4U.d.mts +8 -0
  43. package/dist/unplugin-5bf1Tm4U.d.mts.map +1 -0
  44. package/dist/unplugin-DyIARsU7.d.cts +8 -0
  45. package/dist/unplugin-DyIARsU7.d.cts.map +1 -0
  46. package/package.json +18 -17
  47. package/dist/build-CZBW0WlF.d.cts.map +0 -1
  48. package/dist/build-DJTI0ZMx.cjs +0 -0
  49. package/dist/build-TorJrUfF.d.mts.map +0 -1
  50. package/dist/build-XTM4L3VY.mjs +0 -1
  51. package/dist/helpers-C9XSjwSZ.mjs +0 -1
  52. package/dist/helpers-yB1XkvQI.cjs +0 -0
  53. package/dist/index-B_e8BwCm.d.cts +0 -1
  54. package/dist/index-CW2WHUXP.d.mts +0 -1
  55. package/dist/index-CiBIKhMu.d.cts +0 -1
  56. package/dist/index-mH1MEWOz.d.mts +0 -1
  57. package/dist/plugin-BULXKDMv.d.cts.map +0 -1
  58. package/dist/plugin-D3B5E_Hg.mjs +0 -1
  59. package/dist/plugin-D5qyQPqC.cjs +0 -0
  60. package/dist/plugin-y8-0XXZk.d.mts.map +0 -1
  61. package/dist/resolve-options-Aps_4r5P.mjs +0 -116
  62. package/dist/resolve-options-Aps_4r5P.mjs.map +0 -1
  63. package/dist/resolve-options-C5kHKAmS.d.cts.map +0 -1
  64. package/dist/resolve-options-CspMU4pD.d.mts.map +0 -1
  65. package/dist/unplugin-BMzDrbyK.d.cts +0 -8
  66. package/dist/unplugin-BMzDrbyK.d.cts.map +0 -1
  67. package/dist/unplugin-ByRbaNtu.cjs +0 -16
  68. package/dist/unplugin-DrmiEjBF.mjs +0 -11
  69. package/dist/unplugin-DrmiEjBF.mjs.map +0 -1
  70. package/dist/unplugin-_ObOV1Q_.d.mts +0 -8
  71. package/dist/unplugin-_ObOV1Q_.d.mts.map +0 -1
package/README.md CHANGED
@@ -27,7 +27,7 @@ This package is part of the <b>🔌 Powerlines</b> monorepo. Powerlines is the "
27
27
 
28
28
  <h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
29
29
 
30
- [![Version](https://img.shields.io/badge/version-0.7.340-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
30
+ [![Version](https://img.shields.io/badge/version-0.7.345-1fb2a6.svg?style=for-the-badge&color=1fb2a6)](https://stormsoftware.com/projects/powerlines)&nbsp;[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?style=for-the-badge&logo=commitlint&color=1fb2a6)](http://commitizen.github.io/cz-cli/)&nbsp;![Semantic-Release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=for-the-badge&color=1fb2a6)&nbsp;![GitHub Workflow Status (with event)](https://img.shields.io/github/actions/workflow/status/storm-software/powerlines/release.yml?style=for-the-badge&logo=github-actions&color=1fb2a6)
31
31
 
32
32
  <!-- prettier-ignore-start -->
33
33
  <!-- markdownlint-disable -->
@@ -58,21 +58,19 @@ A Powerlines plugin to assist in building projects with [Rollup](https://rollupj
58
58
 
59
59
  ## Table of Contents
60
60
 
61
- - [Powerlines - Rollup Build Plugin](#powerlines---rollup-build-plugin)
62
- - [Table of Contents](#table-of-contents)
63
- - [Installing](#installing)
64
- - [Reduced Package Size](#reduced-package-size)
65
- - [Development](#development)
66
- - [Building](#building)
67
- - [Running unit tests](#running-unit-tests)
68
- - [Linting](#linting)
69
- - [Storm Workspaces](#storm-workspaces)
70
- - [Roadmap](#roadmap)
71
- - [Support](#support)
72
- - [License](#license)
73
- - [Changelog](#changelog)
74
- - [Contributing](#contributing)
75
- - [Contributors](#contributors)
61
+ - [Installing](#installing)
62
+ - [Reduced Package Size](#reduced-package-size)
63
+ - [Development](#development)
64
+ - [Building](#building)
65
+ - [Running unit tests](#running-unit-tests)
66
+ - [Linting](#linting)
67
+ - [Storm Workspaces](#storm-workspaces)
68
+ - [Roadmap](#roadmap)
69
+ - [Support](#support)
70
+ - [License](#license)
71
+ - [Changelog](#changelog)
72
+ - [Contributing](#contributing)
73
+ - [Contributors](#contributors)
76
74
 
77
75
  <!-- END doctoc -->
78
76
 
@@ -5,4 +5,4 @@ type RollupOptions$1 = Omit<RollupOptions, "entry" | "external" | "input" | "out
5
5
  declare type __ΩRollupOptions = any[];
6
6
  //#endregion
7
7
  export { __ΩRollupOptions as n, RollupOptions$1 as t };
8
- //# sourceMappingURL=build-CZBW0WlF.d.cts.map
8
+ //# sourceMappingURL=build-BFa7jC2n.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-BFa7jC2n.d.mts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAgB,IAAA,CAC1B,aAAA;AAAA"}
@@ -5,4 +5,4 @@ type RollupOptions$1 = Omit<RollupOptions, "entry" | "external" | "input" | "out
5
5
  declare type __ΩRollupOptions = any[];
6
6
  //#endregion
7
7
  export { __ΩRollupOptions as n, RollupOptions$1 as t };
8
- //# sourceMappingURL=build-TorJrUfF.d.mts.map
8
+ //# sourceMappingURL=build-CTTuMTE8.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"build-CTTuMTE8.d.cts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAgB,IAAA,CAC1B,aAAA;AAAA"}
@@ -1,7 +1,7 @@
1
- const require_resolve_options = require('../resolve-options-JUh7vwne.cjs');
2
- const require_unplugin = require('../unplugin-ByRbaNtu.cjs');
3
- require('../helpers-yB1XkvQI.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_resolve_options = require('../resolve-options-Csi14L2Z.cjs');
3
+ const require_helpers_unplugin = require('./unplugin.cjs');
4
4
 
5
- exports.createRollupPlugin = require_unplugin.createRollupPlugin;
5
+ exports.createRollupPlugin = require_helpers_unplugin.createRollupPlugin;
6
6
  exports.dtsBundlePlugin = require_resolve_options.dtsBundlePlugin;
7
7
  exports.resolveOptions = require_resolve_options.resolveOptions;
@@ -1,5 +1,3 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-C5kHKAmS.cjs";
2
- import "../plugin-BULXKDMv.cjs";
3
- import { t as createRollupPlugin } from "../unplugin-BMzDrbyK.cjs";
4
- import "../index-CiBIKhMu.cjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-CdqC2t_d.cjs";
2
+ import { t as createRollupPlugin } from "../unplugin-DyIARsU7.cjs";
5
3
  export { createRollupPlugin, dtsBundlePlugin, resolveOptions };
@@ -1,6 +1,3 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-CspMU4pD.mjs";
2
- import "../build-TorJrUfF.mjs";
3
- import "../plugin-y8-0XXZk.mjs";
4
- import { t as createRollupPlugin } from "../unplugin-_ObOV1Q_.mjs";
5
- import "../index-mH1MEWOz.mjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-BtzeX_UB.mjs";
2
+ import { t as createRollupPlugin } from "../unplugin-5bf1Tm4U.mjs";
6
3
  export { createRollupPlugin, dtsBundlePlugin, resolveOptions };
@@ -1,5 +1,4 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-Aps_4r5P.mjs";
2
- import { t as createRollupPlugin } from "../unplugin-DrmiEjBF.mjs";
3
- import "../helpers-C9XSjwSZ.mjs";
1
+ import { dtsBundlePlugin, resolveOptions } from "./resolve-options.mjs";
2
+ import { createRollupPlugin } from "./unplugin.mjs";
4
3
 
5
4
  export { createRollupPlugin, dtsBundlePlugin, resolveOptions };
@@ -1,4 +1,5 @@
1
- const require_resolve_options = require('../resolve-options-JUh7vwne.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_resolve_options = require('../resolve-options-Csi14L2Z.cjs');
2
3
 
3
4
  exports.dtsBundlePlugin = require_resolve_options.dtsBundlePlugin;
4
5
  exports.resolveOptions = require_resolve_options.resolveOptions;
@@ -1,2 +1,2 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-C5kHKAmS.cjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-CdqC2t_d.cjs";
2
2
  export { dtsBundlePlugin, resolveOptions };
@@ -1,2 +1,2 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-CspMU4pD.mjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-BtzeX_UB.mjs";
2
2
  export { dtsBundlePlugin, resolveOptions };
@@ -1,3 +1,116 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "../resolve-options-Aps_4r5P.mjs";
1
+ import { toArray } from "@stryke/convert/to-array";
2
+ import defu from "defu";
3
+ import alias from "@rollup/plugin-alias";
4
+ import { getBabelInputPlugin } from "@rollup/plugin-babel";
5
+ import inject from "@rollup/plugin-inject";
6
+ import resolve from "@rollup/plugin-node-resolve";
7
+ import replace from "@rollup/plugin-replace";
8
+ import { joinPaths } from "@stryke/path/join-paths";
9
+ import { isString } from "@stryke/type-checks/is-string";
10
+ import { globSync } from "node:fs";
11
+ import typescriptPlugin from "rollup-plugin-typescript2";
2
12
 
3
- export { dtsBundlePlugin, resolveOptions };
13
+ //#region src/helpers/resolve-options.ts
14
+ /**
15
+ * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
16
+ *
17
+ * @remarks
18
+ * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
19
+ */
20
+ const dtsBundlePlugin = {
21
+ name: "powerlines:dts-bundle",
22
+ async generateBundle(_opts, bundle) {
23
+ for (const [, file] of Object.entries(bundle)) {
24
+ if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
25
+ const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
26
+ const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
27
+ this.emitFile({
28
+ type: "asset",
29
+ fileName: dtsFileName,
30
+ source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
31
+ });
32
+ }
33
+ }
34
+ };
35
+ /**
36
+ * Resolves the options for [rollup](https://rollupjs.org).
37
+ *
38
+ * @param context - The build context.
39
+ * @returns The resolved options.
40
+ */
41
+ function resolveOptions(context) {
42
+ return defu({
43
+ input: globSync(toArray(context.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
44
+ external: (source) => {
45
+ if (context.config.resolve.external && toArray(context.config.resolve.external).includes(source)) return true;
46
+ if (context.config.resolve.noExternal && toArray(context.config.resolve.noExternal).includes(source)) return false;
47
+ if (context.builtins.includes(source)) return context.config.projectType !== "application";
48
+ return !context.config.resolve.skipNodeModulesBundle;
49
+ },
50
+ plugins: [
51
+ typescriptPlugin({
52
+ check: false,
53
+ tsconfig: context.tsconfig.tsconfigFilePath
54
+ }),
55
+ context.config.define && Object.keys(context.config.define).length > 0 && replace({
56
+ sourceMap: context.config.mode === "development",
57
+ preventAssignment: true,
58
+ ...context.config.define ?? {}
59
+ }),
60
+ context.config.inject && Object.keys(context.config.inject).length > 0 && inject({
61
+ sourceMap: context.config.mode === "development",
62
+ ...context.config.inject
63
+ }),
64
+ alias({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
65
+ if (!ret.find((e) => e.find === id)) ret.push({
66
+ find: id,
67
+ replacement: path
68
+ });
69
+ else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
70
+ return ret;
71
+ }, []) }),
72
+ context.config.babel && getBabelInputPlugin(defu(context.config.babel, {
73
+ caller: {
74
+ name: "powerlines",
75
+ supportsStaticESM: true
76
+ },
77
+ cwd: context.config.root,
78
+ babelrc: false,
79
+ extensions: [
80
+ ".js",
81
+ ".jsx",
82
+ ".ts",
83
+ ".tsx"
84
+ ],
85
+ babelHelpers: "bundled",
86
+ skipPreflightCheck: true,
87
+ exclude: /node_modules/
88
+ })),
89
+ resolve({
90
+ moduleDirectories: ["node_modules"],
91
+ preferBuiltins: true
92
+ }),
93
+ dtsBundlePlugin
94
+ ].filter(Boolean)
95
+ }, context.config?.rollup ? context.config?.rollup : {}, {
96
+ cache: !context.config.skipCache ? joinPaths(context.cachePath, "rollup") : false,
97
+ logLevel: context.config.logLevel,
98
+ output: [{
99
+ dir: context.config.output.buildPath,
100
+ format: "es",
101
+ entryFileNames: "[name].js",
102
+ preserveModules: true,
103
+ sourcemap: context.config.mode === "development"
104
+ }, {
105
+ dir: context.config.output.buildPath,
106
+ format: "cjs",
107
+ entryFileNames: "[name].cjs",
108
+ preserveModules: true,
109
+ sourcemap: context.config.mode === "development"
110
+ }]
111
+ });
112
+ }
113
+
114
+ //#endregion
115
+ export { dtsBundlePlugin, resolveOptions };
116
+ //# sourceMappingURL=resolve-options.mjs.map
@@ -0,0 +1 @@
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 { Context } from \"@powerlines/core\";\nimport { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport alias from \"@rollup/plugin-alias\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RollupPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RollupOptions {\n const result = defu(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n (context.config as BabelPluginResolvedConfig).babel &&\n getBabelInputPlugin(\n defu((context.config as BabelPluginResolvedConfig).babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.root,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ].filter(Boolean) as Plugin[]\n },\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n logLevel: context.config.logLevel,\n output: [\n {\n dir: context.config.output.buildPath,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n },\n {\n dir: context.config.output.buildPath,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n }\n ]\n }\n ) as RollupOptions;\n\n return result;\n}\n"],"mappings":"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"}
@@ -1,3 +1,12 @@
1
- const require_unplugin = require('../unplugin-ByRbaNtu.cjs');
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_resolve_options = require('../resolve-options-Csi14L2Z.cjs');
3
+ let _powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
4
+ let unplugin = require("unplugin");
2
5
 
3
- exports.createRollupPlugin = require_unplugin.createRollupPlugin;
6
+ //#region src/helpers/unplugin.ts
7
+ function createRollupPlugin(context) {
8
+ return (0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context))({});
9
+ }
10
+
11
+ //#endregion
12
+ exports.createRollupPlugin = createRollupPlugin;
@@ -1,3 +1,2 @@
1
- import "../plugin-BULXKDMv.cjs";
2
- import { t as createRollupPlugin } from "../unplugin-BMzDrbyK.cjs";
1
+ import { t as createRollupPlugin } from "../unplugin-DyIARsU7.cjs";
3
2
  export { createRollupPlugin };
@@ -1,4 +1,2 @@
1
- import "../build-TorJrUfF.mjs";
2
- import "../plugin-y8-0XXZk.mjs";
3
- import { t as createRollupPlugin } from "../unplugin-_ObOV1Q_.mjs";
1
+ import { t as createRollupPlugin } from "../unplugin-5bf1Tm4U.mjs";
4
2
  export { createRollupPlugin };
@@ -1,3 +1,11 @@
1
- import { t as createRollupPlugin } from "../unplugin-DrmiEjBF.mjs";
1
+ import { createUnplugin } from "@powerlines/core/lib/unplugin";
2
+ import { createEsbuildPlugin } from "unplugin";
2
3
 
3
- export { createRollupPlugin };
4
+ //#region src/helpers/unplugin.ts
5
+ function createRollupPlugin(context) {
6
+ return createEsbuildPlugin(createUnplugin(context))({});
7
+ }
8
+
9
+ //#endregion
10
+ export { createRollupPlugin };
11
+ //# sourceMappingURL=unplugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin.mjs","names":[],"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 } from \"unplugin\";\nimport { RollupPluginContext } from \"../types/plugin\";\n\nexport function createRollupPlugin(context: RollupPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
package/dist/index.cjs CHANGED
@@ -1,9 +1,9 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- const require_resolve_options = require('./resolve-options-JUh7vwne.cjs');
3
- const require_unplugin = require('./unplugin-ByRbaNtu.cjs');
4
- require('./helpers-yB1XkvQI.cjs');
1
+ Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
+ const require_resolve_options = require('./resolve-options-Csi14L2Z.cjs');
3
+ const require_helpers_unplugin = require('./helpers/unplugin.cjs');
4
+ require('./helpers/index.cjs');
5
5
  require('./types/index.cjs');
6
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
6
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
7
7
  let defu = require("defu");
8
8
  defu = require_resolve_options.__toESM(defu);
9
9
  let rollup = require("rollup");
@@ -22,16 +22,15 @@ const plugin = (options = {}) => {
22
22
  };
23
23
  },
24
24
  async build() {
25
- const result = await (0, rollup.rollup)((0, defu.default)({ plugins: [require_unplugin.createRollupPlugin(this)] }, require_resolve_options.resolveOptions(this)));
26
- await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.output.format).map(async (format) => result.write({ format })));
25
+ const result = await (0, rollup.rollup)((0, defu.default)({ plugins: [require_helpers_unplugin.createRollupPlugin(this)] }, require_resolve_options.resolveOptions(this)));
26
+ await Promise.all((0, _stryke_convert_to_array.toArray)(this.config.output.format).map(async (format) => result.write({ format })));
27
27
  }
28
28
  };
29
29
  };
30
- var src_default = plugin;
31
30
 
32
31
  //#endregion
33
- exports.createRollupPlugin = require_unplugin.createRollupPlugin;
34
- exports.default = src_default;
35
- exports.dtsBundlePlugin = require_resolve_options.dtsBundlePlugin;
32
+ exports.createRollupPlugin = require_helpers_unplugin.createRollupPlugin;
33
+ exports.default = plugin;
36
34
  exports.plugin = plugin;
35
+ exports.dtsBundlePlugin = require_resolve_options.dtsBundlePlugin;
37
36
  exports.resolveOptions = require_resolve_options.resolveOptions;
package/dist/index.d.cts CHANGED
@@ -1,9 +1,7 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "./resolve-options-C5kHKAmS.cjs";
2
- import { n as __ΩRollupOptions, t as RollupOptions } from "./build-CZBW0WlF.cjs";
3
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "./plugin-BULXKDMv.cjs";
4
- import { t as createRollupPlugin } from "./unplugin-BMzDrbyK.cjs";
5
- import "./index-CiBIKhMu.cjs";
6
- import "./index-B_e8BwCm.cjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "./resolve-options-CdqC2t_d.cjs";
2
+ import { n as __ΩRollupOptions, t as RollupOptions } from "./build-CTTuMTE8.cjs";
3
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "./plugin-Dm9Lskw9.cjs";
4
+ import { t as createRollupPlugin } from "./unplugin-DyIARsU7.cjs";
7
5
  import { Plugin } from "@powerlines/core";
8
6
 
9
7
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;aAmCa;;;AAJW;;;AAIQ,cAOnB,MAPmB,EAAA,CAAA,iBAQb,mBARa,GAQS,mBART,CAAA,CAAA,OAAA,CAAA,EAUrB,mBAVqB,EAAA,GAW7B,MAX6B,CAWtB,QAXsB,CAAA"}
1
+ {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;AAJW;;;AAAA,cAWX,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts CHANGED
@@ -1,9 +1,7 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "./resolve-options-CspMU4pD.mjs";
2
- import { n as __ΩRollupOptions, t as RollupOptions } from "./build-TorJrUfF.mjs";
3
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "./plugin-y8-0XXZk.mjs";
4
- import { t as createRollupPlugin } from "./unplugin-_ObOV1Q_.mjs";
5
- import "./index-mH1MEWOz.mjs";
6
- import "./index-CW2WHUXP.mjs";
1
+ import { n as resolveOptions, t as dtsBundlePlugin } from "./resolve-options-BtzeX_UB.mjs";
2
+ import { n as __ΩRollupOptions, t as RollupOptions } from "./build-BFa7jC2n.mjs";
3
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "./plugin-BZbF8qd2.mjs";
4
+ import { t as createRollupPlugin } from "./unplugin-5bf1Tm4U.mjs";
7
5
  import { Plugin } from "@powerlines/core";
8
6
 
9
7
  //#region src/index.d.ts
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;aAmCa;;;AAJW;;;AAIQ,cAOnB,MAPmB,EAAA,CAAA,iBAQb,mBARa,GAQS,mBART,CAAA,CAAA,OAAA,CAAA,EAUrB,mBAVqB,EAAA,GAW7B,MAX6B,CAWtB,QAXsB,CAAA"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;AAJW;;;AAAA,cAWX,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs CHANGED
@@ -1,6 +1,6 @@
1
- import { n as resolveOptions, t as dtsBundlePlugin } from "./resolve-options-Aps_4r5P.mjs";
2
- import { t as createRollupPlugin } from "./unplugin-DrmiEjBF.mjs";
3
- import "./helpers-C9XSjwSZ.mjs";
1
+ import { dtsBundlePlugin, resolveOptions } from "./helpers/resolve-options.mjs";
2
+ import { createRollupPlugin } from "./helpers/unplugin.mjs";
3
+ import "./helpers/index.mjs";
4
4
  import "./types/index.mjs";
5
5
  import { toArray } from "@stryke/convert/to-array";
6
6
  import defu from "defu";
@@ -25,8 +25,7 @@ const plugin = (options = {}) => {
25
25
  }
26
26
  };
27
27
  };
28
- var src_default = plugin;
29
28
 
30
29
  //#endregion
31
- export { createRollupPlugin, src_default as default, dtsBundlePlugin, plugin, resolveOptions };
30
+ export { createRollupPlugin, plugin as default, plugin, dtsBundlePlugin, resolveOptions };
32
31
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":["build"],"sources":["../src/index.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 { Plugin } from \"@powerlines/core\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport {\n RollupPluginContext,\n RollupPluginOptions,\n RollupPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n } as Partial<RollupPluginUserConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRollupPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA0CA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMA,OACnB,KACE,EACE,SAAS,CAAC,mBAAmB,KAAK,CAAC,EACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ;;AAGH,kBAAe"}
1
+ {"version":3,"file":"index.mjs","names":["build"],"sources":["../src/index.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 { Plugin } from \"@powerlines/core\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport { resolveOptions } from \"./helpers\";\nimport { createRollupPlugin } from \"./helpers/unplugin\";\nimport {\n RollupPluginContext,\n RollupPluginOptions,\n RollupPluginUserConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rollup?: RollupPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RollupPluginContext = RollupPluginContext\n>(\n options: RollupPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rollup\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rollup: {\n ...options\n }\n } as Partial<RollupPluginUserConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRollupPlugin(this)]\n },\n resolveOptions(this)\n )\n );\n\n await Promise.all(\n toArray(this.config.output.format).map(async format =>\n result.write({\n format\n })\n )\n );\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;;;;;;AA0CA,MAAa,UAGX,UAA+B,EAAE,KACZ;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,QAAQ,EACN,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMA,OACnB,KACE,EACE,SAAS,CAAC,mBAAmB,KAAK,CAAC,EACpC,EACD,eAAe,KAAK,CACrB,CACF;AAED,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ"}
@@ -1,4 +1,4 @@
1
- import { t as RollupOptions } from "./build-CZBW0WlF.cjs";
1
+ import { t as RollupOptions } from "./build-BFa7jC2n.mjs";
2
2
  import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
@@ -16,4 +16,4 @@ declare type __ΩRollupPluginResolvedConfig = any[];
16
16
  declare type __ΩRollupPluginContext = any[];
17
17
  //#endregion
18
18
  export { __ΩRollupPluginContext as a, __ΩRollupPluginUserConfig as c, RollupPluginUserConfig as i, RollupPluginOptions as n, __ΩRollupPluginOptions as o, RollupPluginResolvedConfig as r, __ΩRollupPluginResolvedConfig as s, RollupPluginContext as t };
19
- //# sourceMappingURL=plugin-BULXKDMv.d.cts.map
19
+ //# sourceMappingURL=plugin-BZbF8qd2.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-BZbF8qd2.d.mts","names":[],"sources":["../src/types/plugin.ts"],"mappings":";;;;KAqBY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,EAAQ,mBAAA;AAAA;AAAA,UAGO,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1,4 +1,4 @@
1
- import { t as RollupOptions } from "./build-TorJrUfF.mjs";
1
+ import { t as RollupOptions } from "./build-CTTuMTE8.cjs";
2
2
  import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
3
 
4
4
  //#region src/types/plugin.d.ts
@@ -16,4 +16,4 @@ declare type __ΩRollupPluginResolvedConfig = any[];
16
16
  declare type __ΩRollupPluginContext = any[];
17
17
  //#endregion
18
18
  export { __ΩRollupPluginContext as a, __ΩRollupPluginUserConfig as c, RollupPluginUserConfig as i, RollupPluginOptions as n, __ΩRollupPluginOptions as o, RollupPluginResolvedConfig as r, __ΩRollupPluginResolvedConfig as s, RollupPluginContext as t };
19
- //# sourceMappingURL=plugin-y8-0XXZk.d.mts.map
19
+ //# sourceMappingURL=plugin-Dm9Lskw9.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-Dm9Lskw9.d.cts","names":[],"sources":["../src/types/plugin.ts"],"mappings":";;;;KAqBY,mBAAA,GAAsB,OAAA,CAAQ,aAAA;AAAA,UAEzB,sBAAA,SAA+B,UAAA;EAC9C,MAAA,EAAQ,mBAAA;AAAA;AAAA,UAGO,0BAAA,SAAmC,cAAA;EAClD,MAAA,EAAQ,aAAA;AAAA;AAAA,KAGE,mBAAA,yBACc,0BAAA,GACtB,0BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -2,7 +2,6 @@ import { Plugin, RollupOptions } from "rollup";
2
2
  import { Context } from "@powerlines/core";
3
3
 
4
4
  //#region src/helpers/resolve-options.d.ts
5
-
6
5
  /**
7
6
  * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
8
7
  *
@@ -19,4 +18,4 @@ declare const dtsBundlePlugin: Plugin;
19
18
  declare function resolveOptions(context: Context): RollupOptions;
20
19
  //#endregion
21
20
  export { resolveOptions as n, dtsBundlePlugin as t };
22
- //# sourceMappingURL=resolve-options-CspMU4pD.d.mts.map
21
+ //# sourceMappingURL=resolve-options-BtzeX_UB.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-BtzeX_UB.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;;AA4CA;;;;;cAAa,eAAA,EAAiB,MAAA;;;;;;;iBAuCd,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
@@ -2,7 +2,6 @@ import { Context } from "@powerlines/core";
2
2
  import { Plugin as Plugin$1, RollupOptions } from "rollup";
3
3
 
4
4
  //#region src/helpers/resolve-options.d.ts
5
-
6
5
  /**
7
6
  * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
8
7
  *
@@ -19,4 +18,4 @@ declare const dtsBundlePlugin: Plugin$1;
19
18
  declare function resolveOptions(context: Context): RollupOptions;
20
19
  //#endregion
21
20
  export { resolveOptions as n, dtsBundlePlugin as t };
22
- //# sourceMappingURL=resolve-options-C5kHKAmS.d.cts.map
21
+ //# sourceMappingURL=resolve-options-CdqC2t_d.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolve-options-CdqC2t_d.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"mappings":";;;;;AA4CA;;;;;cAAa,eAAA,EAAiB,QAAA;;;;;;;iBAuCd,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
@@ -1,4 +1,4 @@
1
- //#region rolldown:runtime
1
+ //#region \0rolldown/runtime.js
2
2
  var __create = Object.create;
3
3
  var __defProp = Object.defineProperty;
4
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
@@ -25,20 +25,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
25
25
  }) : target, mod));
26
26
 
27
27
  //#endregion
28
- let __stryke_convert_to_array = require("@stryke/convert/to-array");
28
+ let _stryke_convert_to_array = require("@stryke/convert/to-array");
29
29
  let defu = require("defu");
30
30
  defu = __toESM(defu);
31
- let __rollup_plugin_alias = require("@rollup/plugin-alias");
32
- __rollup_plugin_alias = __toESM(__rollup_plugin_alias);
33
- let __rollup_plugin_babel = require("@rollup/plugin-babel");
34
- let __rollup_plugin_inject = require("@rollup/plugin-inject");
35
- __rollup_plugin_inject = __toESM(__rollup_plugin_inject);
36
- let __rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
37
- __rollup_plugin_node_resolve = __toESM(__rollup_plugin_node_resolve);
38
- let __rollup_plugin_replace = require("@rollup/plugin-replace");
39
- __rollup_plugin_replace = __toESM(__rollup_plugin_replace);
40
- let __stryke_path_join_paths = require("@stryke/path/join-paths");
41
- let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
31
+ let _rollup_plugin_alias = require("@rollup/plugin-alias");
32
+ _rollup_plugin_alias = __toESM(_rollup_plugin_alias);
33
+ let _rollup_plugin_babel = require("@rollup/plugin-babel");
34
+ let _rollup_plugin_inject = require("@rollup/plugin-inject");
35
+ _rollup_plugin_inject = __toESM(_rollup_plugin_inject);
36
+ let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
37
+ _rollup_plugin_node_resolve = __toESM(_rollup_plugin_node_resolve);
38
+ let _rollup_plugin_replace = require("@rollup/plugin-replace");
39
+ _rollup_plugin_replace = __toESM(_rollup_plugin_replace);
40
+ let _stryke_path_join_paths = require("@stryke/path/join-paths");
41
+ let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
42
42
  let node_fs = require("node:fs");
43
43
  let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
44
44
  rollup_plugin_typescript2 = __toESM(rollup_plugin_typescript2);
@@ -73,10 +73,10 @@ const dtsBundlePlugin = {
73
73
  */
74
74
  function resolveOptions(context) {
75
75
  return (0, defu.default)({
76
- input: (0, node_fs.globSync)((0, __stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
76
+ input: (0, node_fs.globSync)((0, _stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, _stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
77
77
  external: (source) => {
78
- if (context.config.resolve.external && (0, __stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
79
- if (context.config.resolve.noExternal && (0, __stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
78
+ if (context.config.resolve.external && (0, _stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
79
+ if (context.config.resolve.noExternal && (0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
80
80
  if (context.builtins.includes(source)) return context.config.projectType !== "application";
81
81
  return !context.config.resolve.skipNodeModulesBundle;
82
82
  },
@@ -85,16 +85,16 @@ function resolveOptions(context) {
85
85
  check: false,
86
86
  tsconfig: context.tsconfig.tsconfigFilePath
87
87
  }),
88
- context.config.define && Object.keys(context.config.define).length > 0 && (0, __rollup_plugin_replace.default)({
88
+ context.config.define && Object.keys(context.config.define).length > 0 && (0, _rollup_plugin_replace.default)({
89
89
  sourceMap: context.config.mode === "development",
90
90
  preventAssignment: true,
91
91
  ...context.config.define ?? {}
92
92
  }),
93
- context.config.inject && Object.keys(context.config.inject).length > 0 && (0, __rollup_plugin_inject.default)({
93
+ context.config.inject && Object.keys(context.config.inject).length > 0 && (0, _rollup_plugin_inject.default)({
94
94
  sourceMap: context.config.mode === "development",
95
95
  ...context.config.inject
96
96
  }),
97
- (0, __rollup_plugin_alias.default)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
97
+ (0, _rollup_plugin_alias.default)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
98
98
  if (!ret.find((e) => e.find === id)) ret.push({
99
99
  find: id,
100
100
  replacement: path
@@ -102,7 +102,7 @@ function resolveOptions(context) {
102
102
  else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
103
103
  return ret;
104
104
  }, []) }),
105
- context.config.babel && (0, __rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
105
+ context.config.babel && (0, _rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
106
106
  caller: {
107
107
  name: "powerlines",
108
108
  supportsStaticESM: true
@@ -119,14 +119,14 @@ function resolveOptions(context) {
119
119
  skipPreflightCheck: true,
120
120
  exclude: /node_modules/
121
121
  })),
122
- (0, __rollup_plugin_node_resolve.default)({
122
+ (0, _rollup_plugin_node_resolve.default)({
123
123
  moduleDirectories: ["node_modules"],
124
124
  preferBuiltins: true
125
125
  }),
126
126
  dtsBundlePlugin
127
127
  ].filter(Boolean)
128
128
  }, context.config?.rollup ? context.config?.rollup : {}, {
129
- cache: !context.config.skipCache ? (0, __stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
129
+ cache: !context.config.skipCache ? (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
130
130
  logLevel: context.config.logLevel,
131
131
  output: [{
132
132
  dir: context.config.output.buildPath,
@@ -1,2 +1,2 @@
1
- import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CZBW0WlF.cjs";
1
+ import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CTTuMTE8.cjs";
2
2
  export { RollupOptions, __ΩRollupOptions };
@@ -1,2 +1,2 @@
1
- import { n as __ΩRollupOptions, t as RollupOptions } from "../build-TorJrUfF.mjs";
1
+ import { n as __ΩRollupOptions, t as RollupOptions } from "../build-BFa7jC2n.mjs";
2
2
  export { RollupOptions, __ΩRollupOptions };
@@ -1,4 +1,3 @@
1
- import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CZBW0WlF.cjs";
2
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-BULXKDMv.cjs";
3
- import "../index-B_e8BwCm.cjs";
1
+ import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CTTuMTE8.cjs";
2
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-Dm9Lskw9.cjs";
4
3
  export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupOptions, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
@@ -1,4 +1,3 @@
1
- import { n as __ΩRollupOptions, t as RollupOptions } from "../build-TorJrUfF.mjs";
2
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-y8-0XXZk.mjs";
3
- import "../index-CW2WHUXP.mjs";
1
+ import { n as __ΩRollupOptions, t as RollupOptions } from "../build-BFa7jC2n.mjs";
2
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-BZbF8qd2.mjs";
4
3
  export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupOptions, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
@@ -1,2 +1,2 @@
1
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-BULXKDMv.cjs";
1
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-Dm9Lskw9.cjs";
2
2
  export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
@@ -1,3 +1,2 @@
1
- import "../build-TorJrUfF.mjs";
2
- import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-y8-0XXZk.mjs";
1
+ import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-BZbF8qd2.mjs";
3
2
  export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
@@ -0,0 +1,8 @@
1
+ import { t as RollupPluginContext } from "./plugin-BZbF8qd2.mjs";
2
+ import * as esbuild from "esbuild";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createRollupPlugin(context: RollupPluginContext): esbuild.Plugin;
6
+ //#endregion
7
+ export { createRollupPlugin as t };
8
+ //# sourceMappingURL=unplugin-5bf1Tm4U.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-5bf1Tm4U.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,OAAA,CAAA,MAAA"}
@@ -0,0 +1,8 @@
1
+ import { t as RollupPluginContext } from "./plugin-Dm9Lskw9.cjs";
2
+ import * as esbuild from "esbuild";
3
+
4
+ //#region src/helpers/unplugin.d.ts
5
+ declare function createRollupPlugin(context: RollupPluginContext): esbuild.Plugin;
6
+ //#endregion
7
+ export { createRollupPlugin as t };
8
+ //# sourceMappingURL=unplugin-DyIARsU7.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unplugin-DyIARsU7.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,OAAA,CAAA,MAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-rollup",
3
- "version": "0.7.345",
3
+ "version": "0.7.347",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
6
6
  "keywords": ["rollup", "powerlines", "storm-software", "powerlines-plugin"],
@@ -40,30 +40,31 @@
40
40
  ],
41
41
  "type": "module",
42
42
  "exports": {
43
- ".": { "require": "./dist/index.cjs", "import": "./dist/index.mjs" },
43
+ ".": { "import": "./dist/index.mjs", "require": "./dist/index.cjs" },
44
44
  "./helpers": {
45
- "require": "./dist/helpers/index.cjs",
46
- "import": "./dist/helpers/index.mjs"
45
+ "import": "./dist/helpers/index.mjs",
46
+ "require": "./dist/helpers/index.cjs"
47
47
  },
48
48
  "./helpers/resolve-options": {
49
- "require": "./dist/helpers/resolve-options.cjs",
50
- "import": "./dist/helpers/resolve-options.mjs"
49
+ "import": "./dist/helpers/resolve-options.mjs",
50
+ "require": "./dist/helpers/resolve-options.cjs"
51
51
  },
52
52
  "./helpers/unplugin": {
53
- "require": "./dist/helpers/unplugin.cjs",
54
- "import": "./dist/helpers/unplugin.mjs"
53
+ "import": "./dist/helpers/unplugin.mjs",
54
+ "require": "./dist/helpers/unplugin.cjs"
55
55
  },
56
+ "./resolve-options-Csi14L2Z": "./dist/resolve-options-Csi14L2Z.cjs",
56
57
  "./types": {
57
- "require": "./dist/types/index.cjs",
58
- "import": "./dist/types/index.mjs"
58
+ "import": "./dist/types/index.mjs",
59
+ "require": "./dist/types/index.cjs"
59
60
  },
60
61
  "./types/build": {
61
- "require": "./dist/types/build.cjs",
62
- "import": "./dist/types/build.mjs"
62
+ "import": "./dist/types/build.mjs",
63
+ "require": "./dist/types/build.cjs"
63
64
  },
64
65
  "./types/plugin": {
65
- "require": "./dist/types/plugin.cjs",
66
- "import": "./dist/types/plugin.mjs"
66
+ "import": "./dist/types/plugin.mjs",
67
+ "require": "./dist/types/plugin.cjs"
67
68
  },
68
69
  "./*": "./*"
69
70
  },
@@ -73,8 +74,8 @@
73
74
  "typings": "dist/index.d.mts",
74
75
  "files": ["dist/**/*"],
75
76
  "dependencies": {
76
- "@powerlines/core": "^0.2.22",
77
- "@powerlines/plugin-babel": "^0.12.344",
77
+ "@powerlines/core": "^0.3.0",
78
+ "@powerlines/plugin-babel": "^0.12.346",
78
79
  "@rollup/plugin-alias": "^6.0.0",
79
80
  "@rollup/plugin-babel": "^6.1.0",
80
81
  "@rollup/plugin-inject": "^5.0.5",
@@ -94,5 +95,5 @@
94
95
  "peerDependencies": { "rollup": ">=4.46.4" },
95
96
  "peerDependenciesMeta": { "rollup": { "optional": false } },
96
97
  "publishConfig": { "access": "public" },
97
- "gitHead": "0ed0ad0cd6f440d1584ac705987ef985931161db"
98
+ "gitHead": "40d1f94407720be23c3801f9145fdad1fe27dfb2"
98
99
  }
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-CZBW0WlF.d.cts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,eAAA,GAAgB,KAC1B"}
File without changes
@@ -1 +0,0 @@
1
- {"version":3,"file":"build-TorJrUfF.d.mts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,eAAA,GAAgB,KAC1B"}
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- export { };
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-BULXKDMv.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;EAFpC,MAAA,EAGF,mBAHqB;AAE/B;AAIiB,UAAA,0BAAA,SAAmC,cAAA,CAAA;EAIxC,MAAA,EAHF,aAGE;;AAER,KAFQ,mBAER,CAAA,wBADsB,0BACtB,GAAA,0BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,sCAAA,GAAA,EAAA;AAAd,yCAAA,GAAA,EAAA;AAAa,6CAAA,GAAA,EAAA"}
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin-y8-0XXZk.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAqBY,mBAAA,GAAsB,QAAQ;UAEzB,sBAAA,SAA+B;EAFpC,MAAA,EAGF,mBAHqB;AAE/B;AAIiB,UAAA,0BAAA,SAAmC,cAAA,CAAA;EAIxC,MAAA,EAHF,aAGE;;AAER,KAFQ,mBAER,CAAA,wBADsB,0BACtB,GAAA,0BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,sCAAA,GAAA,EAAA;AAAd,yCAAA,GAAA,EAAA;AAAa,6CAAA,GAAA,EAAA"}
@@ -1,116 +0,0 @@
1
- import { toArray } from "@stryke/convert/to-array";
2
- import defu from "defu";
3
- import alias from "@rollup/plugin-alias";
4
- import { getBabelInputPlugin } from "@rollup/plugin-babel";
5
- import inject from "@rollup/plugin-inject";
6
- import resolve from "@rollup/plugin-node-resolve";
7
- import replace from "@rollup/plugin-replace";
8
- import { joinPaths } from "@stryke/path/join-paths";
9
- import { isString } from "@stryke/type-checks/is-string";
10
- import { globSync } from "node:fs";
11
- import typescriptPlugin from "rollup-plugin-typescript2";
12
-
13
- //#region src/helpers/resolve-options.ts
14
- /**
15
- * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
16
- *
17
- * @remarks
18
- * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
19
- */
20
- const dtsBundlePlugin = {
21
- name: "powerlines:dts-bundle",
22
- async generateBundle(_opts, bundle) {
23
- for (const [, file] of Object.entries(bundle)) {
24
- if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
25
- const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
26
- const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
27
- this.emitFile({
28
- type: "asset",
29
- fileName: dtsFileName,
30
- source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
31
- });
32
- }
33
- }
34
- };
35
- /**
36
- * Resolves the options for [rollup](https://rollupjs.org).
37
- *
38
- * @param context - The build context.
39
- * @returns The resolved options.
40
- */
41
- function resolveOptions(context) {
42
- return defu({
43
- input: globSync(toArray(context.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
44
- external: (source) => {
45
- if (context.config.resolve.external && toArray(context.config.resolve.external).includes(source)) return true;
46
- if (context.config.resolve.noExternal && toArray(context.config.resolve.noExternal).includes(source)) return false;
47
- if (context.builtins.includes(source)) return context.config.projectType !== "application";
48
- return !context.config.resolve.skipNodeModulesBundle;
49
- },
50
- plugins: [
51
- typescriptPlugin({
52
- check: false,
53
- tsconfig: context.tsconfig.tsconfigFilePath
54
- }),
55
- context.config.define && Object.keys(context.config.define).length > 0 && replace({
56
- sourceMap: context.config.mode === "development",
57
- preventAssignment: true,
58
- ...context.config.define ?? {}
59
- }),
60
- context.config.inject && Object.keys(context.config.inject).length > 0 && inject({
61
- sourceMap: context.config.mode === "development",
62
- ...context.config.inject
63
- }),
64
- alias({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
65
- if (!ret.find((e) => e.find === id)) ret.push({
66
- find: id,
67
- replacement: path
68
- });
69
- else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
70
- return ret;
71
- }, []) }),
72
- context.config.babel && getBabelInputPlugin(defu(context.config.babel, {
73
- caller: {
74
- name: "powerlines",
75
- supportsStaticESM: true
76
- },
77
- cwd: context.config.root,
78
- babelrc: false,
79
- extensions: [
80
- ".js",
81
- ".jsx",
82
- ".ts",
83
- ".tsx"
84
- ],
85
- babelHelpers: "bundled",
86
- skipPreflightCheck: true,
87
- exclude: /node_modules/
88
- })),
89
- resolve({
90
- moduleDirectories: ["node_modules"],
91
- preferBuiltins: true
92
- }),
93
- dtsBundlePlugin
94
- ].filter(Boolean)
95
- }, context.config?.rollup ? context.config?.rollup : {}, {
96
- cache: !context.config.skipCache ? joinPaths(context.cachePath, "rollup") : false,
97
- logLevel: context.config.logLevel,
98
- output: [{
99
- dir: context.config.output.buildPath,
100
- format: "es",
101
- entryFileNames: "[name].js",
102
- preserveModules: true,
103
- sourcemap: context.config.mode === "development"
104
- }, {
105
- dir: context.config.output.buildPath,
106
- format: "cjs",
107
- entryFileNames: "[name].cjs",
108
- preserveModules: true,
109
- sourcemap: context.config.mode === "development"
110
- }]
111
- });
112
- }
113
-
114
- //#endregion
115
- export { resolveOptions as n, dtsBundlePlugin as t };
116
- //# sourceMappingURL=resolve-options-Aps_4r5P.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options-Aps_4r5P.mjs","names":["dtsBundlePlugin: Plugin"],"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 { Context } from \"@powerlines/core\";\nimport { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport alias from \"@rollup/plugin-alias\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RollupPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RollupOptions {\n const result = defu(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n (context.config as BabelPluginResolvedConfig).babel &&\n getBabelInputPlugin(\n defu((context.config as BabelPluginResolvedConfig).babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.root,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ].filter(Boolean) as Plugin[]\n },\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n logLevel: context.config.logLevel,\n output: [\n {\n dir: context.config.output.buildPath,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n },\n {\n dir: context.config.output.buildPath,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n }\n ]\n }\n ) as RollupOptions;\n\n return result;\n}\n"],"mappings":"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"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options-C5kHKAmS.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA4CA;AAuCA;;;;cAvCa,iBAAiB;;;;;;;iBAuCd,cAAA,UAAwB,UAAU"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options-CspMU4pD.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA4CA;AAuCA;;;;cAvCa,iBAAiB;;;;;;;iBAuCd,cAAA,UAAwB,UAAU"}
@@ -1,8 +0,0 @@
1
- import { t as RollupPluginContext } from "./plugin-BULXKDMv.cjs";
2
- import * as esbuild0 from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createRollupPlugin(context: RollupPluginContext): esbuild0.Plugin;
6
- //#endregion
7
- export { createRollupPlugin as t };
8
- //# sourceMappingURL=unplugin-BMzDrbyK.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-BMzDrbyK.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,QAAA,CAAA"}
@@ -1,16 +0,0 @@
1
- const require_resolve_options = require('./resolve-options-JUh7vwne.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 createRollupPlugin(context) {
7
- return (0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
8
- }
9
-
10
- //#endregion
11
- Object.defineProperty(exports, 'createRollupPlugin', {
12
- enumerable: true,
13
- get: function () {
14
- return createRollupPlugin;
15
- }
16
- });
@@ -1,11 +0,0 @@
1
- import { createUnplugin } from "@powerlines/core/lib/unplugin";
2
- import { createEsbuildPlugin } from "unplugin";
3
-
4
- //#region src/helpers/unplugin.ts
5
- function createRollupPlugin(context) {
6
- return createEsbuildPlugin(createUnplugin(context))({});
7
- }
8
-
9
- //#endregion
10
- export { createRollupPlugin as t };
11
- //# sourceMappingURL=unplugin-DrmiEjBF.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-DrmiEjBF.mjs","names":[],"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 } from \"unplugin\";\nimport { RollupPluginContext } from \"../types/plugin\";\n\nexport function createRollupPlugin(context: RollupPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
@@ -1,8 +0,0 @@
1
- import { t as RollupPluginContext } from "./plugin-y8-0XXZk.mjs";
2
- import * as esbuild0 from "esbuild";
3
-
4
- //#region src/helpers/unplugin.d.ts
5
- declare function createRollupPlugin(context: RollupPluginContext): esbuild0.Plugin;
6
- //#endregion
7
- export { createRollupPlugin as t };
8
- //# sourceMappingURL=unplugin-_ObOV1Q_.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"unplugin-_ObOV1Q_.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,QAAA,CAAA"}