@powerlines/plugin-rolldown 0.7.368 → 0.7.371
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/_virtual/_rolldown/runtime.cjs +29 -0
- package/dist/helpers/index.cjs +6 -0
- package/dist/helpers/index.d.cts +3 -0
- package/dist/helpers/index.d.mts +3 -0
- package/dist/helpers/index.mjs +4 -0
- package/dist/helpers/resolve-options.cjs +127 -0
- package/dist/helpers/resolve-options.d.cts +14 -0
- package/dist/helpers/resolve-options.d.cts.map +1 -0
- package/dist/helpers/resolve-options.d.mts +14 -0
- package/dist/helpers/resolve-options.d.mts.map +1 -0
- package/dist/helpers/resolve-options.mjs +121 -0
- package/dist/helpers/resolve-options.mjs.map +1 -0
- package/dist/helpers/unplugin.cjs +12 -0
- package/dist/helpers/unplugin.d.cts +8 -0
- package/dist/helpers/unplugin.d.cts.map +1 -0
- package/dist/helpers/unplugin.d.mts +8 -0
- package/dist/helpers/unplugin.d.mts.map +1 -0
- package/dist/helpers/unplugin.mjs +11 -0
- package/dist/helpers/unplugin.mjs.map +1 -0
- package/dist/index.cjs +35 -0
- package/dist/index.d.cts +19 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +19 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +30 -0
- package/dist/index.mjs.map +1 -0
- package/dist/types/build.cjs +0 -0
- package/dist/types/build.d.cts +8 -0
- package/dist/types/build.d.cts.map +1 -0
- package/dist/types/build.d.mts +8 -0
- package/dist/types/build.d.mts.map +1 -0
- package/dist/types/build.mjs +1 -0
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +3 -0
- package/dist/types/index.d.mts +3 -0
- package/dist/types/index.mjs +1 -0
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +19 -0
- package/dist/types/plugin.d.cts.map +1 -0
- package/dist/types/plugin.d.mts +19 -0
- package/dist/types/plugin.d.mts.map +1 -0
- package/dist/types/plugin.mjs +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,29 @@
|
|
|
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;
|
|
@@ -0,0 +1,6 @@
|
|
|
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.createRolldownPlugin = require_helpers_unplugin.createRolldownPlugin;
|
|
6
|
+
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
|
@@ -0,0 +1,127 @@
|
|
|
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);
|
|
6
|
+
let _powerlines_plugin_rollup_helpers_resolve_options = require("@powerlines/plugin-rollup/helpers/resolve-options");
|
|
7
|
+
let _rollup_plugin_babel = require("@rollup/plugin-babel");
|
|
8
|
+
let _rollup_plugin_inject = require("@rollup/plugin-inject");
|
|
9
|
+
_rollup_plugin_inject = require_runtime.__toESM(_rollup_plugin_inject);
|
|
10
|
+
let _rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
|
|
11
|
+
_rollup_plugin_node_resolve = require_runtime.__toESM(_rollup_plugin_node_resolve);
|
|
12
|
+
let _rollup_plugin_replace = require("@rollup/plugin-replace");
|
|
13
|
+
_rollup_plugin_replace = require_runtime.__toESM(_rollup_plugin_replace);
|
|
14
|
+
let _stryke_path_append = require("@stryke/path/append");
|
|
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 rolldown_experimental = require("rolldown/experimental");
|
|
19
|
+
let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
|
|
20
|
+
rollup_plugin_typescript2 = require_runtime.__toESM(rollup_plugin_typescript2);
|
|
21
|
+
|
|
22
|
+
//#region src/helpers/resolve-options.ts
|
|
23
|
+
/**
|
|
24
|
+
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
25
|
+
*
|
|
26
|
+
* @param context - The build context.
|
|
27
|
+
* @returns The resolved options.
|
|
28
|
+
*/
|
|
29
|
+
function resolveOptions(context) {
|
|
30
|
+
return (0, defu.default)({
|
|
31
|
+
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(),
|
|
32
|
+
external: (source) => {
|
|
33
|
+
if (context.config.resolve.external && (0, _stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
|
|
34
|
+
if (context.config.resolve.noExternal && (0, _stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
|
|
35
|
+
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
36
|
+
return !context.config.resolve.skipNodeModulesBundle;
|
|
37
|
+
},
|
|
38
|
+
plugins: [
|
|
39
|
+
(0, rollup_plugin_typescript2.default)({
|
|
40
|
+
check: false,
|
|
41
|
+
tsconfig: context.tsconfig.tsconfigFilePath
|
|
42
|
+
}),
|
|
43
|
+
context.config.define && Object.keys(context.config.define).length > 0 && (0, _rollup_plugin_replace.default)({
|
|
44
|
+
sourceMap: context.config.mode === "development",
|
|
45
|
+
preventAssignment: true,
|
|
46
|
+
...context.config.define ?? {}
|
|
47
|
+
}),
|
|
48
|
+
context.config.inject && Object.keys(context.config.inject).length > 0 && (0, _rollup_plugin_inject.default)({
|
|
49
|
+
sourceMap: context.config.mode === "development",
|
|
50
|
+
...context.config.inject
|
|
51
|
+
}),
|
|
52
|
+
(0, rolldown_experimental.viteAliasPlugin)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
53
|
+
if (!ret.find((e) => e.find === id)) ret.push({
|
|
54
|
+
find: id,
|
|
55
|
+
replacement: path
|
|
56
|
+
});
|
|
57
|
+
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
58
|
+
return ret;
|
|
59
|
+
}, []) }),
|
|
60
|
+
context.config.babel && (0, _rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
|
|
61
|
+
caller: {
|
|
62
|
+
name: "powerlines",
|
|
63
|
+
supportsStaticESM: true
|
|
64
|
+
},
|
|
65
|
+
cwd: context.config.root,
|
|
66
|
+
babelrc: false,
|
|
67
|
+
extensions: [
|
|
68
|
+
".js",
|
|
69
|
+
".jsx",
|
|
70
|
+
".ts",
|
|
71
|
+
".tsx"
|
|
72
|
+
],
|
|
73
|
+
babelHelpers: "bundled",
|
|
74
|
+
skipPreflightCheck: true,
|
|
75
|
+
exclude: /node_modules/
|
|
76
|
+
})),
|
|
77
|
+
(0, _rollup_plugin_node_resolve.default)({
|
|
78
|
+
moduleDirectories: ["node_modules"],
|
|
79
|
+
preferBuiltins: true
|
|
80
|
+
}),
|
|
81
|
+
_powerlines_plugin_rollup_helpers_resolve_options.dtsBundlePlugin
|
|
82
|
+
]
|
|
83
|
+
}, context.config?.rolldown ? context.config?.rolldown : {}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
84
|
+
resolve: {
|
|
85
|
+
alias: context.alias,
|
|
86
|
+
mainFields: context.config.resolve.mainFields,
|
|
87
|
+
conditions: context.config.resolve.conditions,
|
|
88
|
+
define: context.config.define,
|
|
89
|
+
extensions: context.config.resolve.extensions
|
|
90
|
+
},
|
|
91
|
+
transform: {
|
|
92
|
+
define: context.config.define,
|
|
93
|
+
inject: context.config.inject,
|
|
94
|
+
typescript: {
|
|
95
|
+
onlyRemoveTypeImports: context.tsconfig.options.verbatimModuleSyntax ? true : void 0,
|
|
96
|
+
target: context.tsconfig.options.target
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
platform: context.config.platform,
|
|
100
|
+
tsconfig: (0, _stryke_path_append.appendPath)(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
101
|
+
cache: !context.config.skipCache ? (0, _stryke_path_join_paths.joinPaths)(context.cachePath, "rolldown") : false,
|
|
102
|
+
logLevel: context.config.logLevel,
|
|
103
|
+
onLog(level, log) {
|
|
104
|
+
if (log.message?.trim()) context.log(level === "info" ? "debug" : level, log.message?.trim() ?? "");
|
|
105
|
+
},
|
|
106
|
+
minify: context.config.mode === "production",
|
|
107
|
+
output: [{
|
|
108
|
+
dir: context.config.output.path,
|
|
109
|
+
format: "es",
|
|
110
|
+
preserveModules: true,
|
|
111
|
+
sourcemap: context.config.mode === "development"
|
|
112
|
+
}, {
|
|
113
|
+
dir: context.config.output.path,
|
|
114
|
+
format: "cjs",
|
|
115
|
+
preserveModules: true,
|
|
116
|
+
sourcemap: context.config.mode === "development"
|
|
117
|
+
}]
|
|
118
|
+
}, {
|
|
119
|
+
keepNames: true,
|
|
120
|
+
treeshake: true,
|
|
121
|
+
shimMissingExports: true,
|
|
122
|
+
transform: { target: "esnext" }
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
//#endregion
|
|
127
|
+
exports.resolveOptions = resolveOptions;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Context } from "@powerlines/core";
|
|
2
|
+
import { RolldownOptions } from "rolldown";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context.
|
|
9
|
+
* @returns The resolved options.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveOptions(context: Context): RolldownOptions;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { resolveOptions };
|
|
14
|
+
//# sourceMappingURL=resolve-options.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;AA8CA;;;;iBAAgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,eAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { RolldownOptions } from "rolldown";
|
|
2
|
+
import { Context } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
7
|
+
*
|
|
8
|
+
* @param context - The build context.
|
|
9
|
+
* @returns The resolved options.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveOptions(context: Context): RolldownOptions;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { resolveOptions };
|
|
14
|
+
//# sourceMappingURL=resolve-options.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;;AA8CA;;;;iBAAgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,eAAA"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import { dtsBundlePlugin } from "@powerlines/plugin-rollup/helpers/resolve-options";
|
|
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 { appendPath } from "@stryke/path/append";
|
|
9
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
10
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
11
|
+
import { globSync } from "node:fs";
|
|
12
|
+
import { viteAliasPlugin } from "rolldown/experimental";
|
|
13
|
+
import typescriptPlugin from "rollup-plugin-typescript2";
|
|
14
|
+
|
|
15
|
+
//#region src/helpers/resolve-options.ts
|
|
16
|
+
/**
|
|
17
|
+
* Resolves the options for [rolldown](https://rolldown.rs).
|
|
18
|
+
*
|
|
19
|
+
* @param context - The build context.
|
|
20
|
+
* @returns The resolved options.
|
|
21
|
+
*/
|
|
22
|
+
function resolveOptions(context) {
|
|
23
|
+
return defu({
|
|
24
|
+
input: globSync(toArray(context.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
|
|
25
|
+
external: (source) => {
|
|
26
|
+
if (context.config.resolve.external && toArray(context.config.resolve.external).includes(source)) return true;
|
|
27
|
+
if (context.config.resolve.noExternal && toArray(context.config.resolve.noExternal).includes(source)) return false;
|
|
28
|
+
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
29
|
+
return !context.config.resolve.skipNodeModulesBundle;
|
|
30
|
+
},
|
|
31
|
+
plugins: [
|
|
32
|
+
typescriptPlugin({
|
|
33
|
+
check: false,
|
|
34
|
+
tsconfig: context.tsconfig.tsconfigFilePath
|
|
35
|
+
}),
|
|
36
|
+
context.config.define && Object.keys(context.config.define).length > 0 && replace({
|
|
37
|
+
sourceMap: context.config.mode === "development",
|
|
38
|
+
preventAssignment: true,
|
|
39
|
+
...context.config.define ?? {}
|
|
40
|
+
}),
|
|
41
|
+
context.config.inject && Object.keys(context.config.inject).length > 0 && inject({
|
|
42
|
+
sourceMap: context.config.mode === "development",
|
|
43
|
+
...context.config.inject
|
|
44
|
+
}),
|
|
45
|
+
viteAliasPlugin({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
46
|
+
if (!ret.find((e) => e.find === id)) ret.push({
|
|
47
|
+
find: id,
|
|
48
|
+
replacement: path
|
|
49
|
+
});
|
|
50
|
+
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
51
|
+
return ret;
|
|
52
|
+
}, []) }),
|
|
53
|
+
context.config.babel && getBabelInputPlugin(defu(context.config.babel, {
|
|
54
|
+
caller: {
|
|
55
|
+
name: "powerlines",
|
|
56
|
+
supportsStaticESM: true
|
|
57
|
+
},
|
|
58
|
+
cwd: context.config.root,
|
|
59
|
+
babelrc: false,
|
|
60
|
+
extensions: [
|
|
61
|
+
".js",
|
|
62
|
+
".jsx",
|
|
63
|
+
".ts",
|
|
64
|
+
".tsx"
|
|
65
|
+
],
|
|
66
|
+
babelHelpers: "bundled",
|
|
67
|
+
skipPreflightCheck: true,
|
|
68
|
+
exclude: /node_modules/
|
|
69
|
+
})),
|
|
70
|
+
resolve({
|
|
71
|
+
moduleDirectories: ["node_modules"],
|
|
72
|
+
preferBuiltins: true
|
|
73
|
+
}),
|
|
74
|
+
dtsBundlePlugin
|
|
75
|
+
]
|
|
76
|
+
}, context.config?.rolldown ? context.config?.rolldown : {}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
77
|
+
resolve: {
|
|
78
|
+
alias: context.alias,
|
|
79
|
+
mainFields: context.config.resolve.mainFields,
|
|
80
|
+
conditions: context.config.resolve.conditions,
|
|
81
|
+
define: context.config.define,
|
|
82
|
+
extensions: context.config.resolve.extensions
|
|
83
|
+
},
|
|
84
|
+
transform: {
|
|
85
|
+
define: context.config.define,
|
|
86
|
+
inject: context.config.inject,
|
|
87
|
+
typescript: {
|
|
88
|
+
onlyRemoveTypeImports: context.tsconfig.options.verbatimModuleSyntax ? true : void 0,
|
|
89
|
+
target: context.tsconfig.options.target
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
platform: context.config.platform,
|
|
93
|
+
tsconfig: appendPath(context.tsconfig.tsconfigFilePath, context.workspaceConfig.workspaceRoot),
|
|
94
|
+
cache: !context.config.skipCache ? joinPaths(context.cachePath, "rolldown") : false,
|
|
95
|
+
logLevel: context.config.logLevel,
|
|
96
|
+
onLog(level, log) {
|
|
97
|
+
if (log.message?.trim()) context.log(level === "info" ? "debug" : level, log.message?.trim() ?? "");
|
|
98
|
+
},
|
|
99
|
+
minify: context.config.mode === "production",
|
|
100
|
+
output: [{
|
|
101
|
+
dir: context.config.output.path,
|
|
102
|
+
format: "es",
|
|
103
|
+
preserveModules: true,
|
|
104
|
+
sourcemap: context.config.mode === "development"
|
|
105
|
+
}, {
|
|
106
|
+
dir: context.config.output.path,
|
|
107
|
+
format: "cjs",
|
|
108
|
+
preserveModules: true,
|
|
109
|
+
sourcemap: context.config.mode === "development"
|
|
110
|
+
}]
|
|
111
|
+
}, {
|
|
112
|
+
keepNames: true,
|
|
113
|
+
treeshake: true,
|
|
114
|
+
shimMissingExports: true,
|
|
115
|
+
transform: { target: "esnext" }
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
//#endregion
|
|
120
|
+
export { resolveOptions };
|
|
121
|
+
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":["alias"],"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 { dtsBundlePlugin } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport { RollupPluginResolvedConfig } from \"@powerlines/plugin-rollup/types/plugin\";\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 { appendPath } from \"@stryke/path/append\";\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 { RolldownOptions, RollupLog } from \"rolldown\";\nimport { viteAliasPlugin as alias } from \"rolldown/experimental\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RolldownPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * Resolves the options for [rolldown](https://rolldown.rs).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RolldownOptions {\n return defu<RolldownOptions, any>(\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 ]\n },\n (context.config as RolldownPluginResolvedConfig)?.rolldown\n ? (context.config as RolldownPluginResolvedConfig)?.rolldown\n : {},\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n resolve: {\n alias: context.alias,\n mainFields: context.config.resolve.mainFields,\n conditions: context.config.resolve.conditions,\n define: context.config.define,\n extensions: context.config.resolve.extensions\n },\n transform: {\n define: context.config.define,\n inject: context.config.inject,\n typescript: {\n onlyRemoveTypeImports: context.tsconfig.options.verbatimModuleSyntax\n ? true\n : undefined,\n target: context.tsconfig.options.target\n }\n },\n platform: context.config.platform,\n tsconfig: appendPath(\n context.tsconfig.tsconfigFilePath,\n context.workspaceConfig.workspaceRoot\n ),\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rolldown\")\n : false,\n logLevel: context.config.logLevel,\n onLog(level: \"info\" | \"debug\" | \"warn\", log: RollupLog) {\n if (log.message?.trim()) {\n context.log(\n level === \"info\" ? \"debug\" : level,\n log.message?.trim() ?? \"\"\n );\n }\n },\n minify: context.config.mode === \"production\",\n output: [\n {\n dir: context.config.output.path,\n format: \"es\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n },\n {\n dir: context.config.output.path,\n format: \"cjs\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n }\n ]\n },\n {\n keepNames: true,\n treeshake: true,\n shimMissingExports: true,\n transform: {\n target: \"esnext\"\n }\n }\n );\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,12 @@
|
|
|
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 createRolldownPlugin(context) {
|
|
8
|
+
return (0, unplugin.createEsbuildPlugin)((0, _powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
//#endregion
|
|
12
|
+
exports.createRolldownPlugin = createRolldownPlugin;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RolldownPluginContext } from "../types/plugin.cjs";
|
|
2
|
+
import * as esbuild from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRolldownPlugin(context: RolldownPluginContext): esbuild.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRolldownPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,oBAAA,CAAqB,OAAA,EAAS,qBAAA,GAAqB,OAAA,CAAA,MAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RolldownPluginContext } from "../types/plugin.mjs";
|
|
2
|
+
import * as esbuild from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRolldownPlugin(context: RolldownPluginContext): esbuild.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRolldownPlugin };
|
|
8
|
+
//# sourceMappingURL=unplugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin.d.mts","names":[],"sources":["../../src/helpers/unplugin.ts"],"mappings":";;;;iBAsBgB,oBAAA,CAAqB,OAAA,EAAS,qBAAA,GAAqB,OAAA,CAAA,MAAA"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { createUnplugin } from "@powerlines/core/lib/unplugin";
|
|
2
|
+
import { createEsbuildPlugin } from "unplugin";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.ts
|
|
5
|
+
function createRolldownPlugin(context) {
|
|
6
|
+
return createEsbuildPlugin(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createRolldownPlugin };
|
|
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 { RolldownPluginContext } from \"../types/plugin\";\n\nexport function createRolldownPlugin(context: RolldownPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,qBAAqB,SAAgC;AACnE,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
|
|
2
|
+
const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
|
|
3
|
+
const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
|
|
4
|
+
const require_helpers_unplugin = require('./helpers/unplugin.cjs');
|
|
5
|
+
require('./helpers/index.cjs');
|
|
6
|
+
let _stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
7
|
+
let defu = require("defu");
|
|
8
|
+
defu = require_runtime.__toESM(defu);
|
|
9
|
+
let rolldown = require("rolldown");
|
|
10
|
+
|
|
11
|
+
//#region src/index.ts
|
|
12
|
+
/**
|
|
13
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
14
|
+
*/
|
|
15
|
+
const plugin = (options = {}) => {
|
|
16
|
+
return {
|
|
17
|
+
name: "rolldown",
|
|
18
|
+
config() {
|
|
19
|
+
return {
|
|
20
|
+
output: { format: ["cjs", "esm"] },
|
|
21
|
+
rolldown: { ...options }
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
async build() {
|
|
25
|
+
const result = await (0, rolldown.rolldown)((0, defu.default)({ plugins: [require_helpers_unplugin.createRolldownPlugin(this)] }, require_helpers_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
|
+
}
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
//#endregion
|
|
32
|
+
exports.createRolldownPlugin = require_helpers_unplugin.createRolldownPlugin;
|
|
33
|
+
exports.default = plugin;
|
|
34
|
+
exports.plugin = plugin;
|
|
35
|
+
exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.cjs";
|
|
2
|
+
import { RolldownOptions, __ΩRolldownOptions } from "./types/build.cjs";
|
|
3
|
+
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig } from "./types/plugin.cjs";
|
|
4
|
+
import { createRolldownPlugin } from "./helpers/unplugin.cjs";
|
|
5
|
+
import { Plugin } from "@powerlines/core/types/plugin";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "@powerlines/core" {
|
|
9
|
+
interface Config {
|
|
10
|
+
rolldown?: RolldownPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
15
|
+
*/
|
|
16
|
+
declare const plugin: <TContext extends RolldownPluginContext = RolldownPluginContext>(options?: RolldownPluginOptions) => Plugin<TContext>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RolldownOptions, RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownOptions, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig, createRolldownPlugin, plugin as default, plugin, resolveOptions };
|
|
19
|
+
//# sourceMappingURL=index.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,QAAA,GAAW,qBAAA;EAAA;AAAA;AAJS;;;AAAA,cAWX,MAAA,oBACM,qBAAA,GAAwB,qBAAA,EAEzC,OAAA,GAAS,qBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { RolldownOptions, __ΩRolldownOptions } from "./types/build.mjs";
|
|
3
|
+
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig } from "./types/plugin.mjs";
|
|
4
|
+
import { createRolldownPlugin } from "./helpers/unplugin.mjs";
|
|
5
|
+
import { Plugin } from "@powerlines/core/types/plugin";
|
|
6
|
+
|
|
7
|
+
//#region src/index.d.ts
|
|
8
|
+
declare module "@powerlines/core" {
|
|
9
|
+
interface Config {
|
|
10
|
+
rolldown?: RolldownPluginOptions;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
15
|
+
*/
|
|
16
|
+
declare const plugin: <TContext extends RolldownPluginContext = RolldownPluginContext>(options?: RolldownPluginOptions) => Plugin<TContext>;
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RolldownOptions, RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownOptions, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig, createRolldownPlugin, plugin as default, plugin, resolveOptions };
|
|
19
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;;;YAkCY,MAAA;IACR,QAAA,GAAW,qBAAA;EAAA;AAAA;AAJS;;;AAAA,cAWX,MAAA,oBACM,qBAAA,GAAwB,qBAAA,EAEzC,OAAA,GAAS,qBAAA,KACR,MAAA,CAAO,QAAA"}
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { resolveOptions } from "./helpers/resolve-options.mjs";
|
|
2
|
+
import { createRolldownPlugin } from "./helpers/unplugin.mjs";
|
|
3
|
+
import "./helpers/index.mjs";
|
|
4
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
5
|
+
import defu from "defu";
|
|
6
|
+
import { rolldown } from "rolldown";
|
|
7
|
+
|
|
8
|
+
//#region src/index.ts
|
|
9
|
+
/**
|
|
10
|
+
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
11
|
+
*/
|
|
12
|
+
const plugin = (options = {}) => {
|
|
13
|
+
return {
|
|
14
|
+
name: "rolldown",
|
|
15
|
+
config() {
|
|
16
|
+
return {
|
|
17
|
+
output: { format: ["cjs", "esm"] },
|
|
18
|
+
rolldown: { ...options }
|
|
19
|
+
};
|
|
20
|
+
},
|
|
21
|
+
async build() {
|
|
22
|
+
const result = await rolldown(defu({ plugins: [createRolldownPlugin(this)] }, resolveOptions(this)));
|
|
23
|
+
await Promise.all(toArray(this.config.output.format).map(async (format) => result.write({ format })));
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
//#endregion
|
|
29
|
+
export { createRolldownPlugin, plugin as default, plugin, resolveOptions };
|
|
30
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +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/types/plugin\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport defu from \"defu\";\nimport { rolldown as build } from \"rolldown\";\nimport { resolveOptions } from \"./helpers/resolve-options\";\nimport { createRolldownPlugin } from \"./helpers/unplugin\";\nimport {\n RolldownPluginContext,\n RolldownPluginOptions,\n RolldownPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./helpers\";\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n rolldown?: RolldownPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to assist in developing other Powerlines plugins.\n */\nexport const plugin = <\n TContext extends RolldownPluginContext = RolldownPluginContext\n>(\n options: RolldownPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"rolldown\",\n config() {\n return {\n output: {\n format: [\"cjs\", \"esm\"]\n },\n rolldown: {\n ...options\n }\n } as Partial<RolldownPluginResolvedConfig>;\n },\n async build() {\n const result = await build(\n defu(\n {\n plugins: [createRolldownPlugin(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,UAAiC,EAAE,KACd;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,OAAO,MAAM,EACvB;IACD,UAAU,EACR,GAAG,SACJ;IACF;;EAEH,MAAM,QAAQ;GACZ,MAAM,SAAS,MAAMA,SACnB,KACE,EACE,SAAS,CAAC,qBAAqB,KAAK,CAAC,EACtC,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"}
|
|
File without changes
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RolldownOptions as RolldownOptions$1 } from "rolldown";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RolldownOptions = Omit<RolldownOptions$1, "input" | "external" | "tsconfig" | "logLevel" | "output">;
|
|
5
|
+
declare type __ΩRolldownOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { RolldownOptions, __ΩRolldownOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAkB,IAAA,CAC5B,iBAAA;AAAA"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RolldownOptions as RolldownOptions$1 } from "rolldown";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type RolldownOptions = Omit<RolldownOptions$1, "input" | "external" | "tsconfig" | "logLevel" | "output">;
|
|
5
|
+
declare type __ΩRolldownOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { RolldownOptions, __ΩRolldownOptions };
|
|
8
|
+
//# sourceMappingURL=build.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,eAAA,GAAkB,IAAA,CAC5B,iBAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RolldownOptions, __ΩRolldownOptions } from "./build.cjs";
|
|
2
|
+
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig } from "./plugin.cjs";
|
|
3
|
+
export { RolldownOptions, RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownOptions, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { RolldownOptions, __ΩRolldownOptions } from "./build.mjs";
|
|
2
|
+
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig } from "./plugin.mjs";
|
|
3
|
+
export { RolldownOptions, RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownOptions, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RolldownOptions } from "./build.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type RolldownPluginOptions = Partial<RolldownOptions>;
|
|
6
|
+
interface RolldownPluginUserConfig extends UserConfig {
|
|
7
|
+
rolldown: RolldownPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface RolldownPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
rolldown: RolldownOptions;
|
|
11
|
+
}
|
|
12
|
+
type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig = RolldownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩRolldownPluginOptions = any[];
|
|
14
|
+
declare type __ΩRolldownPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩRolldownPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩRolldownPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,qBAAA,GAAwB,OAAA,CAAQ,eAAA;AAAA,UAE3B,wBAAA,SAAiC,UAAA;EAChD,QAAA,EAAU,qBAAA;AAAA;AAAA,UAGK,4BAAA,SAAqC,cAAA;EACpD,QAAA,EAAU,eAAA;AAAA;AAAA,KAGA,qBAAA,yBACc,4BAAA,GACtB,4BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { RolldownOptions } from "./build.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
|
|
3
|
+
|
|
4
|
+
//#region src/types/plugin.d.ts
|
|
5
|
+
type RolldownPluginOptions = Partial<RolldownOptions>;
|
|
6
|
+
interface RolldownPluginUserConfig extends UserConfig {
|
|
7
|
+
rolldown: RolldownPluginOptions;
|
|
8
|
+
}
|
|
9
|
+
interface RolldownPluginResolvedConfig extends ResolvedConfig {
|
|
10
|
+
rolldown: RolldownOptions;
|
|
11
|
+
}
|
|
12
|
+
type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig = RolldownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
13
|
+
declare type __ΩRolldownPluginOptions = any[];
|
|
14
|
+
declare type __ΩRolldownPluginUserConfig = any[];
|
|
15
|
+
declare type __ΩRolldownPluginResolvedConfig = any[];
|
|
16
|
+
declare type __ΩRolldownPluginContext = any[];
|
|
17
|
+
//#endregion
|
|
18
|
+
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig };
|
|
19
|
+
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,qBAAA,GAAwB,OAAA,CAAQ,eAAA;AAAA,UAE3B,wBAAA,SAAiC,UAAA;EAChD,QAAA,EAAU,qBAAA;AAAA;AAAA,UAGK,4BAAA,SAAqC,cAAA;EACpD,QAAA,EAAU,eAAA;AAAA;AAAA,KAGA,qBAAA,yBACc,4BAAA,GACtB,4BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rolldown",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.371",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
6
|
"keywords": ["rolldown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
@@ -43,9 +43,9 @@
|
|
|
43
43
|
"peerDependencies": { "rolldown": ">=1.0.0-rc.9 <2.0.0" },
|
|
44
44
|
"peerDependenciesMeta": { "rolldown": { "optional": false } },
|
|
45
45
|
"dependencies": {
|
|
46
|
-
"@powerlines/core": "^0.
|
|
47
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
48
|
-
"@powerlines/plugin-rollup": "^0.7.
|
|
46
|
+
"@powerlines/core": "^0.8.2",
|
|
47
|
+
"@powerlines/plugin-babel": "^0.12.368",
|
|
48
|
+
"@powerlines/plugin-rollup": "^0.7.369",
|
|
49
49
|
"@stryke/convert": "^0.6.56",
|
|
50
50
|
"@stryke/fs": "^0.33.63",
|
|
51
51
|
"@stryke/path": "^0.27.2",
|
|
@@ -88,5 +88,5 @@
|
|
|
88
88
|
},
|
|
89
89
|
"./package.json": "./package.json"
|
|
90
90
|
},
|
|
91
|
-
"gitHead": "
|
|
91
|
+
"gitHead": "8c25b27c36407abbd22351d8a9afba5bce5abc08"
|
|
92
92
|
}
|