@powerlines/plugin-rollup 0.7.460 → 0.7.463
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/build-B0B1GOsk.d.mts +7 -0
- package/dist/build-B0B1GOsk.d.mts.map +1 -0
- package/dist/build-BcwN3DuZ.d.cts +7 -0
- package/dist/build-BcwN3DuZ.d.cts.map +1 -0
- package/dist/index.cjs +42 -10
- package/dist/index.d.cts +3 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +14 -5
- package/dist/index.mjs.map +1 -1
- package/dist/types/build.d.cts +2 -7
- package/dist/types/build.d.mts +2 -7
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.mts +3 -3
- package/dist/types/plugin.d.cts +3 -4
- package/dist/types/plugin.d.cts.map +1 -1
- package/dist/types/plugin.d.mts +3 -4
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +14 -14
- package/dist/_virtual/_rolldown/runtime.cjs +0 -29
- package/dist/helpers/index.cjs +0 -7
- package/dist/helpers/index.d.cts +0 -3
- package/dist/helpers/index.d.mts +0 -3
- package/dist/helpers/index.mjs +0 -4
- package/dist/helpers/resolve-options.cjs +0 -124
- package/dist/helpers/resolve-options.d.cts +0 -21
- package/dist/helpers/resolve-options.d.cts.map +0 -1
- package/dist/helpers/resolve-options.d.mts +0 -21
- package/dist/helpers/resolve-options.d.mts.map +0 -1
- package/dist/helpers/resolve-options.mjs +0 -116
- package/dist/helpers/resolve-options.mjs.map +0 -1
- package/dist/helpers/unplugin.cjs +0 -18
- package/dist/helpers/unplugin.d.cts +0 -8
- package/dist/helpers/unplugin.d.cts.map +0 -1
- package/dist/helpers/unplugin.d.mts +0 -8
- package/dist/helpers/unplugin.d.mts.map +0 -1
- package/dist/helpers/unplugin.mjs +0 -17
- package/dist/helpers/unplugin.mjs.map +0 -1
- package/dist/types/build.d.cts.map +0 -1
- package/dist/types/build.d.mts.map +0 -1
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RollupOptions } from "rollup";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RollupOptions$1 = Omit<RollupOptions, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { RollupOptions$1 as t };
|
|
7
|
+
//# sourceMappingURL=build-B0B1GOsk.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-B0B1GOsk.d.mts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAgB,IAAA,CAC1B,aAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { RollupOptions } from "rollup";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RollupOptions$1 = Omit<RollupOptions, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
+
//#endregion
|
|
6
|
+
export { RollupOptions$1 as t };
|
|
7
|
+
//# sourceMappingURL=build-BcwN3DuZ.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-BcwN3DuZ.d.cts","names":[],"sources":["../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAgB,IAAA,CAC1B,aAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
//#region \0rolldown/runtime.js
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
|
+
key = keys[i];
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
14
|
+
__defProp(to, key, {
|
|
15
|
+
get: ((k) => from[k]).bind(null, key),
|
|
16
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return to;
|
|
22
|
+
};
|
|
23
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
24
|
+
value: mod,
|
|
25
|
+
enumerable: true
|
|
26
|
+
}) : target, mod));
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
require('./types/index.cjs');
|
|
30
|
+
let _powerlines_core = require("@powerlines/core");
|
|
6
31
|
let _powerlines_core_plugin_utils = require("@powerlines/core/plugin-utils");
|
|
32
|
+
let _powerlines_unplugin_rollup = require("@powerlines/unplugin/rollup");
|
|
7
33
|
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
8
34
|
let defu = require("defu");
|
|
9
|
-
defu =
|
|
35
|
+
defu = __toESM(defu, 1);
|
|
10
36
|
let rollup = require("rollup");
|
|
37
|
+
let unplugin = require("unplugin");
|
|
11
38
|
|
|
12
39
|
//#region src/index.ts
|
|
13
40
|
/**
|
|
@@ -24,7 +51,15 @@ const plugin = (options = {}) => {
|
|
|
24
51
|
},
|
|
25
52
|
async build() {
|
|
26
53
|
this.debug("Starting Rollup build process...");
|
|
27
|
-
const
|
|
54
|
+
const resolved = (0, _powerlines_unplugin_rollup.resolveOptions)(this);
|
|
55
|
+
const options = (0, defu.default)(this.config.rollup, {
|
|
56
|
+
...resolved,
|
|
57
|
+
config: false,
|
|
58
|
+
plugins: [(0, unplugin.createRollupPlugin)((0, _powerlines_core.createUnplugin)(this, {
|
|
59
|
+
silenceHookLogging: true,
|
|
60
|
+
name: "rollup"
|
|
61
|
+
}))()]
|
|
62
|
+
});
|
|
28
63
|
this.debug({
|
|
29
64
|
meta: { category: "config" },
|
|
30
65
|
message: `Resolved Rollup configuration: \n${(0, _powerlines_core_plugin_utils.formatConfig)(options)}`
|
|
@@ -36,8 +71,5 @@ const plugin = (options = {}) => {
|
|
|
36
71
|
};
|
|
37
72
|
|
|
38
73
|
//#endregion
|
|
39
|
-
exports.createRollupPlugin = require_helpers_unplugin.createRollupPlugin;
|
|
40
74
|
exports.default = plugin;
|
|
41
|
-
exports.plugin = plugin;
|
|
42
|
-
exports.dtsBundlePlugin = require_helpers_resolve_options.dtsBundlePlugin;
|
|
43
|
-
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
|
75
|
+
exports.plugin = plugin;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { RollupPluginContext, RollupPluginInitialConfig, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./types/plugin.cjs";
|
|
4
|
-
import { createRollupPlugin } from "./helpers/unplugin.cjs";
|
|
1
|
+
import { t as RollupOptions } from "./build-BcwN3DuZ.cjs";
|
|
2
|
+
import { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./types/plugin.cjs";
|
|
5
3
|
import { Plugin } from "@powerlines/core";
|
|
6
4
|
|
|
7
5
|
//#region src/index.d.ts
|
|
@@ -15,5 +13,5 @@ declare module "@powerlines/core" {
|
|
|
15
13
|
*/
|
|
16
14
|
declare const plugin: <TContext extends RollupPluginContext = RollupPluginContext>(options?: RollupPluginOptions) => Plugin<TContext>;
|
|
17
15
|
//#endregion
|
|
18
|
-
export { RollupOptions, RollupPluginContext,
|
|
16
|
+
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, plugin as default, plugin };
|
|
19
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA8BY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;cAOA,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { RollupPluginContext, RollupPluginInitialConfig, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
-
import { createRollupPlugin } from "./helpers/unplugin.mjs";
|
|
1
|
+
import { t as RollupOptions } from "./build-B0B1GOsk.mjs";
|
|
2
|
+
import { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./types/plugin.mjs";
|
|
5
3
|
import { Plugin } from "@powerlines/core";
|
|
6
4
|
|
|
7
5
|
//#region src/index.d.ts
|
|
@@ -15,5 +13,5 @@ declare module "@powerlines/core" {
|
|
|
15
13
|
*/
|
|
16
14
|
declare const plugin: <TContext extends RollupPluginContext = RollupPluginContext>(options?: RollupPluginOptions) => Plugin<TContext>;
|
|
17
15
|
//#endregion
|
|
18
|
-
export { RollupOptions, RollupPluginContext,
|
|
16
|
+
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, plugin as default, plugin };
|
|
19
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YA8BY,MAAA;IACR,MAAA,GAAS,mBAAA;EAAA;AAAA;;;;cAOA,MAAA,oBACM,mBAAA,GAAsB,mBAAA,EAEvC,OAAA,GAAS,mBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import "./helpers/index.mjs";
|
|
1
|
+
import "./types/index.mjs";
|
|
2
|
+
import { createUnplugin } from "@powerlines/core";
|
|
4
3
|
import { formatConfig } from "@powerlines/core/plugin-utils";
|
|
4
|
+
import { resolveOptions } from "@powerlines/unplugin/rollup";
|
|
5
5
|
import { toArray } from "@stryke/convert/to-array";
|
|
6
6
|
import defu from "defu";
|
|
7
7
|
import { rollup } from "rollup";
|
|
8
|
+
import { createRollupPlugin } from "unplugin";
|
|
8
9
|
|
|
9
10
|
//#region src/index.ts
|
|
10
11
|
/**
|
|
@@ -21,7 +22,15 @@ const plugin = (options = {}) => {
|
|
|
21
22
|
},
|
|
22
23
|
async build() {
|
|
23
24
|
this.debug("Starting Rollup build process...");
|
|
24
|
-
const
|
|
25
|
+
const resolved = resolveOptions(this);
|
|
26
|
+
const options = defu(this.config.rollup, {
|
|
27
|
+
...resolved,
|
|
28
|
+
config: false,
|
|
29
|
+
plugins: [createRollupPlugin(createUnplugin(this, {
|
|
30
|
+
silenceHookLogging: true,
|
|
31
|
+
name: "rollup"
|
|
32
|
+
}))()]
|
|
33
|
+
});
|
|
25
34
|
this.debug({
|
|
26
35
|
meta: { category: "config" },
|
|
27
36
|
message: `Resolved Rollup configuration: \n${formatConfig(options)}`
|
|
@@ -33,5 +42,5 @@ const plugin = (options = {}) => {
|
|
|
33
42
|
};
|
|
34
43
|
|
|
35
44
|
//#endregion
|
|
36
|
-
export {
|
|
45
|
+
export { plugin as default, plugin };
|
|
37
46
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -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 { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build } from \"rollup\";\nimport {
|
|
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 { createUnplugin, Plugin } from \"@powerlines/core\";\nimport { formatConfig } from \"@powerlines/core/plugin-utils\";\nimport { resolveOptions } from \"@powerlines/unplugin/rollup\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rollup as build, RollupOptions } from \"rollup\";\nimport { createRollupPlugin } from \"unplugin\";\nimport { RollupPluginContext, RollupPluginOptions } from \"./types/plugin\";\n\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 };\n },\n async build() {\n this.debug(\"Starting Rollup build process...\");\n\n const resolved = resolveOptions(this);\n const options = defu(this.config.rollup, {\n ...resolved,\n config: false,\n plugins: [\n createRollupPlugin(\n createUnplugin(this, {\n silenceHookLogging: true,\n name: \"rollup\"\n })\n )()\n ]\n }) as RollupOptions;\n\n this.debug({\n meta: {\n category: \"config\"\n },\n message: `Resolved Rollup configuration: \\n${formatConfig(options)}`\n });\n\n const result = await build(options);\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":";;;;;;;;;;;;;AAsCA,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;AACZ,QAAK,MAAM,mCAAmC;GAE9C,MAAM,WAAW,eAAe,KAAK;GACrC,MAAM,UAAU,KAAK,KAAK,OAAO,QAAQ;IACvC,GAAG;IACH,QAAQ;IACR,SAAS,CACP,mBACE,eAAe,MAAM;KACnB,oBAAoB;KACpB,MAAM;KACP,CAAC,CACH,EAAE,CACJ;IACF,CAAC;AAEF,QAAK,MAAM;IACT,MAAM,EACJ,UAAU,UACX;IACD,SAAS,oCAAoC,aAAa,QAAQ;IACnE,CAAC;GAEF,MAAM,SAAS,MAAMA,OAAM,QAAQ;AAEnC,SAAM,QAAQ,IACZ,QAAQ,KAAK,OAAO,OAAO,OAAO,CAAC,IAAI,OAAM,WAC3C,OAAO,MAAM,EACX,QACD,CAAC,CACH,CACF;;EAEJ"}
|
package/dist/types/build.d.cts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type RollupOptions = Omit<RollupOptions$1, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { RollupOptions };
|
|
7
|
-
//# sourceMappingURL=build.d.cts.map
|
|
1
|
+
import { t as RollupOptions } from "../build-BcwN3DuZ.cjs";
|
|
2
|
+
export { RollupOptions };
|
package/dist/types/build.d.mts
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type RollupOptions = Omit<RollupOptions$1, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { RollupOptions };
|
|
7
|
-
//# sourceMappingURL=build.d.mts.map
|
|
1
|
+
import { t as RollupOptions } from "../build-B0B1GOsk.mjs";
|
|
2
|
+
export { RollupOptions };
|
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RollupOptions } from "
|
|
2
|
-
import { RollupPluginContext,
|
|
3
|
-
export { RollupOptions, RollupPluginContext,
|
|
1
|
+
import { t as RollupOptions } from "../build-BcwN3DuZ.cjs";
|
|
2
|
+
import { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./plugin.cjs";
|
|
3
|
+
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { RollupOptions } from "
|
|
2
|
-
import { RollupPluginContext,
|
|
3
|
-
export { RollupOptions, RollupPluginContext,
|
|
1
|
+
import { t as RollupOptions } from "../build-B0B1GOsk.mjs";
|
|
2
|
+
import { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig } from "./plugin.mjs";
|
|
3
|
+
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig };
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { RollupOptions } from "
|
|
2
|
-
import {
|
|
1
|
+
import { t as RollupOptions } from "../build-BcwN3DuZ.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
5
|
type RollupPluginOptions = Partial<RollupOptions>;
|
|
6
6
|
interface RollupPluginUserConfig extends UserConfig {
|
|
7
7
|
rollup: RollupPluginOptions;
|
|
8
8
|
}
|
|
9
|
-
type RollupPluginInitialConfig = InitialPluginConfig<RollupPluginUserConfig>;
|
|
10
9
|
interface RollupPluginResolvedConfig extends ResolvedConfig {
|
|
11
10
|
rollup: RollupOptions;
|
|
12
11
|
}
|
|
13
12
|
type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
13
|
//#endregion
|
|
15
|
-
export { RollupPluginContext,
|
|
14
|
+
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig };
|
|
16
15
|
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,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"}
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
import { RollupOptions } from "
|
|
2
|
-
import {
|
|
1
|
+
import { t as RollupOptions } from "../build-B0B1GOsk.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
3
|
|
|
4
4
|
//#region src/types/plugin.d.ts
|
|
5
5
|
type RollupPluginOptions = Partial<RollupOptions>;
|
|
6
6
|
interface RollupPluginUserConfig extends UserConfig {
|
|
7
7
|
rollup: RollupPluginOptions;
|
|
8
8
|
}
|
|
9
|
-
type RollupPluginInitialConfig = InitialPluginConfig<RollupPluginUserConfig>;
|
|
10
9
|
interface RollupPluginResolvedConfig extends ResolvedConfig {
|
|
11
10
|
rollup: RollupOptions;
|
|
12
11
|
}
|
|
13
12
|
type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
13
|
//#endregion
|
|
15
|
-
export { RollupPluginContext,
|
|
14
|
+
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig };
|
|
16
15
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAyBY,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rollup",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.463",
|
|
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"],
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "github",
|
|
14
14
|
"url": "https://github.com/storm-software/powerlines.git",
|
|
15
|
-
"directory": "packages/plugin-rollup"
|
|
15
|
+
"directory": "packages/plugins/plugin-rollup"
|
|
16
16
|
},
|
|
17
17
|
"funding": {
|
|
18
18
|
"type": "github",
|
|
@@ -71,29 +71,29 @@
|
|
|
71
71
|
"module": "./dist/index.mjs",
|
|
72
72
|
"types": "./dist/index.d.cts",
|
|
73
73
|
"typings": "dist/index.d.mts",
|
|
74
|
-
"files": ["dist
|
|
74
|
+
"files": ["dist"],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@powerlines/core": "^0.
|
|
77
|
-
"@powerlines/
|
|
76
|
+
"@powerlines/core": "^0.9.2",
|
|
77
|
+
"@powerlines/unplugin": "^0.0.4",
|
|
78
78
|
"@rollup/plugin-alias": "^6.0.0",
|
|
79
79
|
"@rollup/plugin-babel": "^7.0.0",
|
|
80
80
|
"@rollup/plugin-inject": "^5.0.5",
|
|
81
81
|
"@rollup/plugin-node-resolve": "^16.0.3",
|
|
82
82
|
"@rollup/plugin-replace": "^6.0.3",
|
|
83
|
-
"@stryke/convert": "^0.7.
|
|
84
|
-
"@stryke/fs": "^0.33.
|
|
85
|
-
"@stryke/helpers": "^0.10.
|
|
86
|
-
"@stryke/path": "^0.
|
|
87
|
-
"@stryke/type-checks": "^0.6.
|
|
88
|
-
"@stryke/types": "^0.12.
|
|
83
|
+
"@stryke/convert": "^0.7.6",
|
|
84
|
+
"@stryke/fs": "^0.33.75",
|
|
85
|
+
"@stryke/helpers": "^0.10.15",
|
|
86
|
+
"@stryke/path": "^0.29.2",
|
|
87
|
+
"@stryke/type-checks": "^0.6.8",
|
|
88
|
+
"@stryke/types": "^0.12.3",
|
|
89
89
|
"defu": "^6.1.7",
|
|
90
|
-
"jiti": "^2.
|
|
90
|
+
"jiti": "^2.7.0",
|
|
91
91
|
"rollup-plugin-typescript2": "^0.36.0",
|
|
92
92
|
"unplugin": "^3.0.0"
|
|
93
93
|
},
|
|
94
|
-
"devDependencies": { "@types/node": "^25.
|
|
94
|
+
"devDependencies": { "@types/node": "^25.7.0", "rollup": "^4.60.3" },
|
|
95
95
|
"peerDependencies": { "rollup": ">=4.46.4" },
|
|
96
96
|
"peerDependenciesMeta": { "rollup": { "optional": false } },
|
|
97
97
|
"publishConfig": { "access": "public" },
|
|
98
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "3c5c701e16af74006dd70b965009d41eb22ace2a"
|
|
99
99
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region \0rolldown/runtime.js
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
10
|
-
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
11
|
-
key = keys[i];
|
|
12
|
-
if (!__hasOwnProp.call(to, key) && key !== except) {
|
|
13
|
-
__defProp(to, key, {
|
|
14
|
-
get: ((k) => from[k]).bind(null, key),
|
|
15
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
16
|
-
});
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
23
|
-
value: mod,
|
|
24
|
-
enumerable: true
|
|
25
|
-
}) : target, mod));
|
|
26
|
-
|
|
27
|
-
//#endregion
|
|
28
|
-
|
|
29
|
-
exports.__toESM = __toESM;
|
package/dist/helpers/index.cjs
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_helpers_resolve_options = require('./resolve-options.cjs');
|
|
3
|
-
const require_helpers_unplugin = require('./unplugin.cjs');
|
|
4
|
-
|
|
5
|
-
exports.createRollupPlugin = require_helpers_unplugin.createRollupPlugin;
|
|
6
|
-
exports.dtsBundlePlugin = require_helpers_resolve_options.dtsBundlePlugin;
|
|
7
|
-
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
package/dist/helpers/index.d.cts
DELETED
package/dist/helpers/index.d.mts
DELETED
package/dist/helpers/index.mjs
DELETED
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
|
|
3
|
-
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
4
|
-
let defu = require("defu");
|
|
5
|
-
defu = require_runtime.__toESM(defu, 1);
|
|
6
|
-
let _rollup_plugin_alias = require("@rollup/plugin-alias");
|
|
7
|
-
_rollup_plugin_alias = require_runtime.__toESM(_rollup_plugin_alias, 1);
|
|
8
|
-
let _rollup_plugin_babel = require("@rollup/plugin-babel");
|
|
9
|
-
let _rollup_plugin_inject = require("@rollup/plugin-inject");
|
|
10
|
-
_rollup_plugin_inject = require_runtime.__toESM(_rollup_plugin_inject, 1);
|
|
11
|
-
let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
|
|
12
|
-
_rollup_plugin_node_resolve = require_runtime.__toESM(_rollup_plugin_node_resolve, 1);
|
|
13
|
-
let _rollup_plugin_replace = require("@rollup/plugin-replace");
|
|
14
|
-
_rollup_plugin_replace = require_runtime.__toESM(_rollup_plugin_replace, 1);
|
|
15
|
-
let _stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
16
|
-
let _stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
17
|
-
let node_fs = require("node:fs");
|
|
18
|
-
let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
|
|
19
|
-
rollup_plugin_typescript2 = require_runtime.__toESM(rollup_plugin_typescript2, 1);
|
|
20
|
-
|
|
21
|
-
//#region src/helpers/resolve-options.ts
|
|
22
|
-
/**
|
|
23
|
-
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
24
|
-
*
|
|
25
|
-
* @remarks
|
|
26
|
-
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
27
|
-
*/
|
|
28
|
-
const dtsBundlePlugin = {
|
|
29
|
-
name: "powerlines:dts-bundle",
|
|
30
|
-
async generateBundle(_opts, bundle) {
|
|
31
|
-
for (const [, file] of Object.entries(bundle)) {
|
|
32
|
-
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
|
|
33
|
-
const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
|
|
34
|
-
const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
|
|
35
|
-
this.emitFile({
|
|
36
|
-
type: "asset",
|
|
37
|
-
fileName: dtsFileName,
|
|
38
|
-
source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* Resolves the options for [rollup](https://rollupjs.org).
|
|
45
|
-
*
|
|
46
|
-
* @param context - The build context.
|
|
47
|
-
* @returns The resolved options.
|
|
48
|
-
*/
|
|
49
|
-
function resolveOptions(context) {
|
|
50
|
-
return (0, defu.default)({
|
|
51
|
-
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(),
|
|
52
|
-
external: (source) => {
|
|
53
|
-
if (context.config.resolve.external && (0, _stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
|
|
54
|
-
if (context.config.resolve.noExternal && (0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
|
|
55
|
-
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
56
|
-
return !context.config.resolve.skipNodeModulesBundle;
|
|
57
|
-
},
|
|
58
|
-
plugins: [
|
|
59
|
-
(0, rollup_plugin_typescript2.default)({
|
|
60
|
-
check: false,
|
|
61
|
-
tsconfig: context.tsconfig.tsconfigFilePath
|
|
62
|
-
}),
|
|
63
|
-
context.config.define && Object.keys(context.config.define).length > 0 && (0, _rollup_plugin_replace.default)({
|
|
64
|
-
sourceMap: context.config.mode === "development",
|
|
65
|
-
preventAssignment: true,
|
|
66
|
-
...context.config.define ?? {}
|
|
67
|
-
}),
|
|
68
|
-
context.config.inject && Object.keys(context.config.inject).length > 0 && (0, _rollup_plugin_inject.default)({
|
|
69
|
-
sourceMap: context.config.mode === "development",
|
|
70
|
-
...context.config.inject
|
|
71
|
-
}),
|
|
72
|
-
(0, _rollup_plugin_alias.default)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
73
|
-
if (!ret.find((e) => e.find === id)) ret.push({
|
|
74
|
-
find: id,
|
|
75
|
-
replacement: path
|
|
76
|
-
});
|
|
77
|
-
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
78
|
-
return ret;
|
|
79
|
-
}, []) }),
|
|
80
|
-
context.config.babel && (0, _rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
|
|
81
|
-
caller: {
|
|
82
|
-
name: "powerlines",
|
|
83
|
-
supportsStaticESM: true
|
|
84
|
-
},
|
|
85
|
-
cwd: context.config.root,
|
|
86
|
-
babelrc: false,
|
|
87
|
-
extensions: [
|
|
88
|
-
".js",
|
|
89
|
-
".jsx",
|
|
90
|
-
".ts",
|
|
91
|
-
".tsx"
|
|
92
|
-
],
|
|
93
|
-
babelHelpers: "bundled",
|
|
94
|
-
skipPreflightCheck: true,
|
|
95
|
-
exclude: /node_modules/
|
|
96
|
-
})),
|
|
97
|
-
(0, _rollup_plugin_node_resolve.default)({
|
|
98
|
-
moduleDirectories: ["node_modules"],
|
|
99
|
-
preferBuiltins: true
|
|
100
|
-
}),
|
|
101
|
-
dtsBundlePlugin
|
|
102
|
-
].filter(Boolean)
|
|
103
|
-
}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
104
|
-
cache: !context.config.skipCache ? (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
|
|
105
|
-
logLevel: context.config.logLevel.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
|
|
106
|
-
output: [{
|
|
107
|
-
dir: context.config.output.path,
|
|
108
|
-
format: "es",
|
|
109
|
-
entryFileNames: "[name].js",
|
|
110
|
-
preserveModules: true,
|
|
111
|
-
sourcemap: context.config.output.sourceMap
|
|
112
|
-
}, {
|
|
113
|
-
dir: context.config.output.path,
|
|
114
|
-
format: "cjs",
|
|
115
|
-
entryFileNames: "[name].cjs",
|
|
116
|
-
preserveModules: true,
|
|
117
|
-
sourcemap: context.config.output.sourceMap
|
|
118
|
-
}]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
//#endregion
|
|
123
|
-
exports.dtsBundlePlugin = dtsBundlePlugin;
|
|
124
|
-
exports.resolveOptions = resolveOptions;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Context } from "@powerlines/core";
|
|
2
|
-
import { Plugin as Plugin$1, RollupOptions } from "rollup";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/resolve-options.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
10
|
-
*/
|
|
11
|
-
declare const dtsBundlePlugin: Plugin$1;
|
|
12
|
-
/**
|
|
13
|
-
* Resolves the options for [rollup](https://rollupjs.org).
|
|
14
|
-
*
|
|
15
|
-
* @param context - The build context.
|
|
16
|
-
* @returns The resolved options.
|
|
17
|
-
*/
|
|
18
|
-
declare function resolveOptions(context: Context): RollupOptions;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { dtsBundlePlugin, resolveOptions };
|
|
21
|
-
//# sourceMappingURL=resolve-options.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;AA4CA;;;;;cAAa,eAAA,EAAiB,QAAA;;;;;;;iBAuCd,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { Plugin, RollupOptions } from "rollup";
|
|
2
|
-
import { Context } from "@powerlines/core";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/resolve-options.d.ts
|
|
5
|
-
/**
|
|
6
|
-
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
7
|
-
*
|
|
8
|
-
* @remarks
|
|
9
|
-
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
10
|
-
*/
|
|
11
|
-
declare const dtsBundlePlugin: Plugin;
|
|
12
|
-
/**
|
|
13
|
-
* Resolves the options for [rollup](https://rollupjs.org).
|
|
14
|
-
*
|
|
15
|
-
* @param context - The build context.
|
|
16
|
-
* @returns The resolved options.
|
|
17
|
-
*/
|
|
18
|
-
declare function resolveOptions(context: Context): RollupOptions;
|
|
19
|
-
//#endregion
|
|
20
|
-
export { dtsBundlePlugin, resolveOptions };
|
|
21
|
-
//# sourceMappingURL=resolve-options.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;AA4CA;;;;;cAAa,eAAA,EAAiB,MAAA;;;;;;;iBAuCd,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,aAAA"}
|
|
@@ -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.general === "trace" ? "debug" : context.config.logLevel.general === "debug" ? "warn" : "error",
|
|
98
|
-
output: [{
|
|
99
|
-
dir: context.config.output.path,
|
|
100
|
-
format: "es",
|
|
101
|
-
entryFileNames: "[name].js",
|
|
102
|
-
preserveModules: true,
|
|
103
|
-
sourcemap: context.config.output.sourceMap
|
|
104
|
-
}, {
|
|
105
|
-
dir: context.config.output.path,
|
|
106
|
-
format: "cjs",
|
|
107
|
-
entryFileNames: "[name].cjs",
|
|
108
|
-
preserveModules: true,
|
|
109
|
-
sourcemap: context.config.output.sourceMap
|
|
110
|
-
}]
|
|
111
|
-
});
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
//#endregion
|
|
115
|
-
export { dtsBundlePlugin, resolveOptions };
|
|
116
|
-
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -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 } from \"@powerlines/core\";\nimport type { 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:\n context.config.logLevel.general === \"trace\"\n ? \"debug\"\n : context.config.logLevel.general === \"debug\"\n ? \"warn\"\n : \"error\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.output.sourceMap\n }\n ]\n }\n ) as RollupOptions;\n\n return result;\n}\n"],"mappings":"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"}
|
|
@@ -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 createRollupPlugin(context) {
|
|
8
|
-
return (0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context, {
|
|
9
|
-
silenceHookLogging: true,
|
|
10
|
-
name: "rollup"
|
|
11
|
-
}))({
|
|
12
|
-
...context.options,
|
|
13
|
-
...context.config.initialConfig
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
//#endregion
|
|
18
|
-
exports.createRollupPlugin = createRollupPlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RollupPluginContext } from "../types/plugin.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 };
|
|
8
|
-
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,SAAA,CAAA,MAAA"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RollupPluginContext } from "../types/plugin.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 };
|
|
8
|
-
//# sourceMappingURL=unplugin.d.mts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,kBAAA,CAAmB,OAAA,EAAS,mBAAA,GAAmB,SAAA,CAAA,MAAA"}
|
|
@@ -1,17 +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
|
-
silenceHookLogging: true,
|
|
8
|
-
name: "rollup"
|
|
9
|
-
}))({
|
|
10
|
-
...context.options,
|
|
11
|
-
...context.config.initialConfig
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
//#endregion
|
|
16
|
-
export { createRollupPlugin };
|
|
17
|
-
//# sourceMappingURL=unplugin.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
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(\n createUnplugin(context, { silenceHookLogging: true, name: \"rollup\" })\n )({ ...context.options, ...context.config.initialConfig });\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,oBACL,eAAe,SAAS;EAAE,oBAAoB;EAAM,MAAM;EAAU,CAAC,CACtE,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,aAAA,GAAgB,IAAA,CAC1B,eAAA"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,aAAA,GAAgB,IAAA,CAC1B,eAAA"}
|