@powerlines/plugin-rollup 0.7.308 → 0.7.309
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-CZBW0WlF.d.cts +8 -0
- package/dist/build-CZBW0WlF.d.cts.map +1 -0
- package/dist/build-DJTI0ZMx.cjs +0 -0
- package/dist/build-DZybhECU.d.mts +8 -0
- package/dist/build-DZybhECU.d.mts.map +1 -0
- package/dist/build-XTM4L3VY.mjs +1 -0
- package/dist/helpers/index.cjs +6 -5
- package/dist/helpers/index.d.cts +5 -2
- package/dist/helpers/index.d.mts +5 -2
- package/dist/helpers/index.mjs +3 -2
- package/dist/helpers/resolve-options.cjs +3 -122
- package/dist/helpers/resolve-options.d.cts +2 -22
- package/dist/helpers/resolve-options.d.mts +2 -23
- package/dist/helpers/resolve-options.mjs +2 -115
- package/dist/helpers/unplugin.cjs +2 -11
- package/dist/helpers/unplugin.d.cts +4 -8
- package/dist/helpers/unplugin.d.mts +4 -8
- package/dist/helpers/unplugin.mjs +2 -11
- package/dist/helpers-C9XSjwSZ.mjs +1 -0
- package/dist/helpers-yB1XkvQI.cjs +0 -0
- package/dist/index-B_e8BwCm.d.cts +1 -0
- package/dist/index-CW2WHUXP.d.mts +1 -0
- package/dist/index-Cc7fCJU9.d.mts +1 -0
- package/dist/index-CiBIKhMu.d.cts +1 -0
- package/dist/index.cjs +11 -9
- package/dist/index.d.cts +7 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +7 -8
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +6 -3
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-D3B5E_Hg.mjs +1 -0
- package/dist/plugin-D5qyQPqC.cjs +0 -0
- package/dist/plugin-Diu2VjRD.d.mts +19 -0
- package/dist/plugin-Diu2VjRD.d.mts.map +1 -0
- package/dist/plugin-jKu50p7w.d.cts +19 -0
- package/dist/plugin-jKu50p7w.d.cts.map +1 -0
- package/dist/resolve-options-Aps_4r5P.mjs +116 -0
- package/dist/resolve-options-Aps_4r5P.mjs.map +1 -0
- package/dist/resolve-options-CDAAEyhT.d.cts +22 -0
- package/dist/resolve-options-CDAAEyhT.d.cts.map +1 -0
- package/dist/resolve-options-E_fWwC71.d.mts +22 -0
- package/dist/resolve-options-E_fWwC71.d.mts.map +1 -0
- package/dist/resolve-options-JUh7vwne.cjs +165 -0
- package/dist/types/build.cjs +1 -0
- package/dist/types/build.d.cts +2 -8
- package/dist/types/build.d.mts +2 -8
- package/dist/types/build.mjs +2 -0
- package/dist/types/index.cjs +3 -0
- package/dist/types/index.d.cts +3 -2
- package/dist/types/index.d.mts +3 -2
- package/dist/types/index.mjs +4 -0
- package/dist/types/plugin.cjs +1 -0
- package/dist/types/plugin.d.cts +3 -20
- package/dist/types/plugin.d.mts +3 -21
- package/dist/types/plugin.mjs +2 -0
- package/dist/types-D208vOSb.cjs +0 -0
- package/dist/types-Dv2cgIDx.mjs +1 -0
- package/dist/unplugin-BMtcWvP4.d.mts +8 -0
- package/dist/unplugin-BMtcWvP4.d.mts.map +1 -0
- package/dist/unplugin-ByRbaNtu.cjs +16 -0
- package/dist/unplugin-DrmiEjBF.mjs +11 -0
- package/dist/unplugin-DrmiEjBF.mjs.map +1 -0
- package/dist/unplugin-JxAcixPP.d.cts +8 -0
- package/dist/unplugin-JxAcixPP.d.cts.map +1 -0
- package/package.json +4 -4
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/core/src/lib/logger.cjs +0 -41
- package/dist/core/src/lib/logger.mjs +0 -40
- package/dist/core/src/lib/logger.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/helpers.cjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs +0 -19
- package/dist/core/src/lib/unplugin/helpers.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/index.cjs +0 -3
- package/dist/core/src/lib/unplugin/index.mjs +0 -5
- package/dist/core/src/lib/unplugin/module-resolution.cjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs +0 -66
- package/dist/core/src/lib/unplugin/module-resolution.mjs.map +0 -1
- package/dist/core/src/lib/unplugin/plugin.cjs +0 -71
- package/dist/core/src/lib/unplugin/plugin.mjs +0 -71
- package/dist/core/src/lib/unplugin/plugin.mjs.map +0 -1
- package/dist/core/src/lib/utilities/source-file.cjs +0 -22
- package/dist/core/src/lib/utilities/source-file.mjs +0 -22
- package/dist/core/src/lib/utilities/source-file.mjs.map +0 -1
- package/dist/core/src/types/api.d.cts +0 -103
- package/dist/core/src/types/api.d.cts.map +0 -1
- package/dist/core/src/types/api.d.mts +0 -103
- package/dist/core/src/types/api.d.mts.map +0 -1
- package/dist/core/src/types/commands.d.cts +0 -9
- package/dist/core/src/types/commands.d.cts.map +0 -1
- package/dist/core/src/types/commands.d.mts +0 -10
- package/dist/core/src/types/commands.d.mts.map +0 -1
- package/dist/core/src/types/config.d.cts +0 -551
- package/dist/core/src/types/config.d.cts.map +0 -1
- package/dist/core/src/types/config.d.mts +0 -551
- package/dist/core/src/types/config.d.mts.map +0 -1
- package/dist/core/src/types/context.d.cts +0 -511
- package/dist/core/src/types/context.d.cts.map +0 -1
- package/dist/core/src/types/context.d.mts +0 -511
- package/dist/core/src/types/context.d.mts.map +0 -1
- package/dist/core/src/types/fs.d.cts +0 -487
- package/dist/core/src/types/fs.d.cts.map +0 -1
- package/dist/core/src/types/fs.d.mts +0 -487
- package/dist/core/src/types/fs.d.mts.map +0 -1
- package/dist/core/src/types/hooks.d.cts +0 -99
- package/dist/core/src/types/hooks.d.cts.map +0 -1
- package/dist/core/src/types/hooks.d.mts +0 -99
- package/dist/core/src/types/hooks.d.mts.map +0 -1
- package/dist/core/src/types/index.d.mts +0 -9
- package/dist/core/src/types/plugin.d.cts +0 -204
- package/dist/core/src/types/plugin.d.cts.map +0 -1
- package/dist/core/src/types/plugin.d.mts +0 -204
- package/dist/core/src/types/plugin.d.mts.map +0 -1
- package/dist/core/src/types/tsconfig.d.cts +0 -70
- package/dist/core/src/types/tsconfig.d.cts.map +0 -1
- package/dist/core/src/types/tsconfig.d.mts +0 -70
- package/dist/core/src/types/tsconfig.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.cjs +0 -21
- package/dist/core/src/types/unplugin.d.cts +0 -24
- package/dist/core/src/types/unplugin.d.cts.map +0 -1
- package/dist/core/src/types/unplugin.d.mts +0 -25
- package/dist/core/src/types/unplugin.d.mts.map +0 -1
- package/dist/core/src/types/unplugin.mjs +0 -22
- package/dist/core/src/types/unplugin.mjs.map +0 -1
- package/dist/helpers/resolve-options.d.cts.map +0 -1
- package/dist/helpers/resolve-options.d.mts.map +0 -1
- package/dist/helpers/resolve-options.mjs.map +0 -1
- package/dist/helpers/unplugin.d.cts.map +0 -1
- package/dist/helpers/unplugin.d.mts.map +0 -1
- 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
- package/dist/types/plugin.d.cts.map +0 -1
- package/dist/types/plugin.d.mts.map +0 -1
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import alias from "@rollup/plugin-alias";
|
|
4
|
+
import { getBabelInputPlugin } from "@rollup/plugin-babel";
|
|
5
|
+
import inject from "@rollup/plugin-inject";
|
|
6
|
+
import resolve from "@rollup/plugin-node-resolve";
|
|
7
|
+
import replace from "@rollup/plugin-replace";
|
|
8
|
+
import { joinPaths } from "@stryke/path/join-paths";
|
|
9
|
+
import { isString } from "@stryke/type-checks/is-string";
|
|
10
|
+
import { globSync } from "node:fs";
|
|
11
|
+
import typescriptPlugin from "rollup-plugin-typescript2";
|
|
12
|
+
|
|
13
|
+
//#region src/helpers/resolve-options.ts
|
|
14
|
+
/**
|
|
15
|
+
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
16
|
+
*
|
|
17
|
+
* @remarks
|
|
18
|
+
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
19
|
+
*/
|
|
20
|
+
const dtsBundlePlugin = {
|
|
21
|
+
name: "powerlines:dts-bundle",
|
|
22
|
+
async generateBundle(_opts, bundle) {
|
|
23
|
+
for (const [, file] of Object.entries(bundle)) {
|
|
24
|
+
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
|
|
25
|
+
const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
|
|
26
|
+
const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
|
|
27
|
+
this.emitFile({
|
|
28
|
+
type: "asset",
|
|
29
|
+
fileName: dtsFileName,
|
|
30
|
+
source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* Resolves the options for [rollup](https://rollupjs.org).
|
|
37
|
+
*
|
|
38
|
+
* @param context - The build context.
|
|
39
|
+
* @returns The resolved options.
|
|
40
|
+
*/
|
|
41
|
+
function resolveOptions(context) {
|
|
42
|
+
return defu({
|
|
43
|
+
input: globSync(toArray(context.entry).map((entry) => isString(entry) ? entry : entry.file)).flat(),
|
|
44
|
+
external: (source) => {
|
|
45
|
+
if (context.config.resolve.external && toArray(context.config.resolve.external).includes(source)) return true;
|
|
46
|
+
if (context.config.resolve.noExternal && toArray(context.config.resolve.noExternal).includes(source)) return false;
|
|
47
|
+
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
48
|
+
return !context.config.resolve.skipNodeModulesBundle;
|
|
49
|
+
},
|
|
50
|
+
plugins: [
|
|
51
|
+
typescriptPlugin({
|
|
52
|
+
check: false,
|
|
53
|
+
tsconfig: context.tsconfig.tsconfigFilePath
|
|
54
|
+
}),
|
|
55
|
+
context.config.define && Object.keys(context.config.define).length > 0 && replace({
|
|
56
|
+
sourceMap: context.config.mode === "development",
|
|
57
|
+
preventAssignment: true,
|
|
58
|
+
...context.config.define ?? {}
|
|
59
|
+
}),
|
|
60
|
+
context.config.inject && Object.keys(context.config.inject).length > 0 && inject({
|
|
61
|
+
sourceMap: context.config.mode === "development",
|
|
62
|
+
...context.config.inject
|
|
63
|
+
}),
|
|
64
|
+
alias({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
65
|
+
if (!ret.find((e) => e.find === id)) ret.push({
|
|
66
|
+
find: id,
|
|
67
|
+
replacement: path
|
|
68
|
+
});
|
|
69
|
+
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
70
|
+
return ret;
|
|
71
|
+
}, []) }),
|
|
72
|
+
context.config.babel && getBabelInputPlugin(defu(context.config.babel, {
|
|
73
|
+
caller: {
|
|
74
|
+
name: "powerlines",
|
|
75
|
+
supportsStaticESM: true
|
|
76
|
+
},
|
|
77
|
+
cwd: context.config.root,
|
|
78
|
+
babelrc: false,
|
|
79
|
+
extensions: [
|
|
80
|
+
".js",
|
|
81
|
+
".jsx",
|
|
82
|
+
".ts",
|
|
83
|
+
".tsx"
|
|
84
|
+
],
|
|
85
|
+
babelHelpers: "bundled",
|
|
86
|
+
skipPreflightCheck: true,
|
|
87
|
+
exclude: /node_modules/
|
|
88
|
+
})),
|
|
89
|
+
resolve({
|
|
90
|
+
moduleDirectories: ["node_modules"],
|
|
91
|
+
preferBuiltins: true
|
|
92
|
+
}),
|
|
93
|
+
dtsBundlePlugin
|
|
94
|
+
].filter(Boolean)
|
|
95
|
+
}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
96
|
+
cache: !context.config.skipCache ? joinPaths(context.cachePath, "rollup") : false,
|
|
97
|
+
logLevel: context.config.logLevel,
|
|
98
|
+
output: [{
|
|
99
|
+
dir: context.config.output.buildPath,
|
|
100
|
+
format: "es",
|
|
101
|
+
entryFileNames: "[name].js",
|
|
102
|
+
preserveModules: true,
|
|
103
|
+
sourcemap: context.config.mode === "development"
|
|
104
|
+
}, {
|
|
105
|
+
dir: context.config.output.buildPath,
|
|
106
|
+
format: "cjs",
|
|
107
|
+
entryFileNames: "[name].cjs",
|
|
108
|
+
preserveModules: true,
|
|
109
|
+
sourcemap: context.config.mode === "development"
|
|
110
|
+
}]
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
//#endregion
|
|
115
|
+
export { resolveOptions as n, dtsBundlePlugin as t };
|
|
116
|
+
//# sourceMappingURL=resolve-options-Aps_4r5P.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options-Aps_4r5P.mjs","names":["dtsBundlePlugin: Plugin"],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core/types\";\nimport { BabelPluginResolvedConfig } from \"@powerlines/plugin-babel/types/plugin\";\nimport alias from \"@rollup/plugin-alias\";\nimport {\n getBabelInputPlugin,\n RollupBabelInputPluginOptions\n} from \"@rollup/plugin-babel\";\nimport inject from \"@rollup/plugin-inject\";\nimport resolve from \"@rollup/plugin-node-resolve\";\nimport replace from \"@rollup/plugin-replace\";\nimport { toArray } from \"@stryke/convert/to-array\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isString } from \"@stryke/type-checks/is-string\";\nimport defu from \"defu\";\nimport { globSync } from \"node:fs\";\nimport type { RollupOptions } from \"rollup\";\nimport { Plugin } from \"rollup\";\nimport typescriptPlugin from \"rollup-plugin-typescript2\";\nimport { RollupPluginResolvedConfig } from \"../types/plugin\";\n\n/**\n * A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.\n *\n * @remarks\n * This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.\n */\nexport const dtsBundlePlugin: Plugin = {\n name: \"powerlines:dts-bundle\",\n async generateBundle(_opts, bundle) {\n for (const [, file] of Object.entries(bundle)) {\n if (\n file.type === \"asset\" ||\n !file.isEntry ||\n file.facadeModuleId == null\n ) {\n continue;\n }\n\n // Replace various JavaScript file extensions (e.g., .js, .cjs, .mjs, .cjs.js, .mjs.js) with .d.ts for generating type definition file names.\n const dtsFileName = file.fileName.replace(\n /(?:\\.cjs|\\.mjs|\\.esm\\.js|\\.cjs\\.js|\\.mjs\\.js|\\.js)$/,\n \".d.ts\"\n );\n\n const relativeSourceDtsName = JSON.stringify(\n `./${file.facadeModuleId.replace(/\\.[cm]?[jt]sx?$/, \"\")}`\n );\n\n this.emitFile({\n type: \"asset\",\n fileName: dtsFileName,\n source: file.exports.includes(\"default\")\n ? `export * from ${relativeSourceDtsName};\\nexport { default } from ${relativeSourceDtsName};\\n`\n : `export * from ${relativeSourceDtsName};\\n`\n });\n }\n }\n};\n\n/**\n * Resolves the options for [rollup](https://rollupjs.org).\n *\n * @param context - The build context.\n * @returns The resolved options.\n */\nexport function resolveOptions(context: Context): RollupOptions {\n const result = defu(\n {\n input: globSync(\n toArray(context.entry).map(entry =>\n isString(entry) ? entry : entry.file\n )\n ).flat(),\n external: (source: string) => {\n if (\n context.config.resolve.external &&\n toArray(context.config.resolve.external).includes(source)\n ) {\n return true;\n }\n\n if (\n context.config.resolve.noExternal &&\n toArray(context.config.resolve.noExternal).includes(source)\n ) {\n return false;\n }\n\n if (context.builtins.includes(source)) {\n return context.config.projectType !== \"application\";\n }\n\n return !context.config.resolve.skipNodeModulesBundle;\n },\n plugins: [\n typescriptPlugin({\n check: false,\n tsconfig: context.tsconfig.tsconfigFilePath\n }),\n context.config.define &&\n Object.keys(context.config.define).length > 0 &&\n replace({\n sourceMap: context.config.mode === \"development\",\n preventAssignment: true,\n ...(context.config.define ?? {})\n }),\n context.config.inject &&\n Object.keys(context.config.inject).length > 0 &&\n inject({\n sourceMap: context.config.mode === \"development\",\n ...context.config.inject\n }),\n alias({\n entries: Object.entries(context.alias).reduce(\n (ret, [id, path]) => {\n if (!ret.find(e => e.find === id)) {\n ret.push({\n find: id,\n replacement: path\n });\n } else {\n context.warn(\n `Duplicate alias entry for '${id}' detected. The first entry will be used.`\n );\n }\n\n return ret;\n },\n [] as { find: string; replacement: string }[]\n )\n }),\n (context.config as BabelPluginResolvedConfig).babel &&\n getBabelInputPlugin(\n defu((context.config as BabelPluginResolvedConfig).babel, {\n caller: {\n name: \"powerlines\",\n supportsStaticESM: true\n },\n cwd: context.config.root,\n babelrc: false,\n extensions: [\".js\", \".jsx\", \".ts\", \".tsx\"],\n babelHelpers: \"bundled\",\n skipPreflightCheck: true,\n exclude: /node_modules/\n }) as RollupBabelInputPluginOptions\n ),\n resolve({\n moduleDirectories: [\"node_modules\"],\n preferBuiltins: true\n }),\n dtsBundlePlugin\n ].filter(Boolean) as Plugin[]\n },\n (context.config as RollupPluginResolvedConfig)?.rollup\n ? (context.config as RollupPluginResolvedConfig)?.rollup\n : {},\n {\n cache: !context.config.skipCache\n ? joinPaths(context.cachePath, \"rollup\")\n : false,\n logLevel: context.config.logLevel,\n output: [\n {\n dir: context.config.output.buildPath,\n format: \"es\",\n entryFileNames: \"[name].js\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n },\n {\n dir: context.config.output.buildPath,\n format: \"cjs\",\n entryFileNames: \"[name].cjs\",\n preserveModules: true,\n sourcemap: context.config.mode === \"development\"\n }\n ]\n }\n ) as RollupOptions;\n\n return result;\n}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Context } from "@powerlines/core/types";
|
|
2
|
+
import { Plugin as Plugin$1, RollupOptions } from "rollup";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
11
|
+
*/
|
|
12
|
+
declare const dtsBundlePlugin: Plugin$1;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the options for [rollup](https://rollupjs.org).
|
|
15
|
+
*
|
|
16
|
+
* @param context - The build context.
|
|
17
|
+
* @returns The resolved options.
|
|
18
|
+
*/
|
|
19
|
+
declare function resolveOptions(context: Context): RollupOptions;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { resolveOptions as n, dtsBundlePlugin as t };
|
|
22
|
+
//# sourceMappingURL=resolve-options-CDAAEyhT.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options-CDAAEyhT.d.cts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA4CA;AAuCA;;;;cAvCa,iBAAiB;;;;;;;iBAuCd,cAAA,UAAwB,UAAU"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Plugin, RollupOptions } from "rollup";
|
|
2
|
+
import { Context } from "@powerlines/core/types";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/resolve-options.d.ts
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
8
|
+
*
|
|
9
|
+
* @remarks
|
|
10
|
+
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
11
|
+
*/
|
|
12
|
+
declare const dtsBundlePlugin: Plugin;
|
|
13
|
+
/**
|
|
14
|
+
* Resolves the options for [rollup](https://rollupjs.org).
|
|
15
|
+
*
|
|
16
|
+
* @param context - The build context.
|
|
17
|
+
* @returns The resolved options.
|
|
18
|
+
*/
|
|
19
|
+
declare function resolveOptions(context: Context): RollupOptions;
|
|
20
|
+
//#endregion
|
|
21
|
+
export { resolveOptions as n, dtsBundlePlugin as t };
|
|
22
|
+
//# sourceMappingURL=resolve-options-E_fWwC71.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options-E_fWwC71.d.mts","names":[],"sources":["../src/helpers/resolve-options.ts"],"sourcesContent":[],"mappings":";;;;;;AA4CA;AAuCA;;;;cAvCa,iBAAiB;;;;;;;iBAuCd,cAAA,UAAwB,UAAU"}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
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
|
+
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
29
|
+
let defu = require("defu");
|
|
30
|
+
defu = __toESM(defu);
|
|
31
|
+
let __rollup_plugin_alias = require("@rollup/plugin-alias");
|
|
32
|
+
__rollup_plugin_alias = __toESM(__rollup_plugin_alias);
|
|
33
|
+
let __rollup_plugin_babel = require("@rollup/plugin-babel");
|
|
34
|
+
let __rollup_plugin_inject = require("@rollup/plugin-inject");
|
|
35
|
+
__rollup_plugin_inject = __toESM(__rollup_plugin_inject);
|
|
36
|
+
let __rollup_plugin_node_resolve = require("@rollup/plugin-node-resolve");
|
|
37
|
+
__rollup_plugin_node_resolve = __toESM(__rollup_plugin_node_resolve);
|
|
38
|
+
let __rollup_plugin_replace = require("@rollup/plugin-replace");
|
|
39
|
+
__rollup_plugin_replace = __toESM(__rollup_plugin_replace);
|
|
40
|
+
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
41
|
+
let __stryke_type_checks_is_string = require("@stryke/type-checks/is-string");
|
|
42
|
+
let node_fs = require("node:fs");
|
|
43
|
+
let rollup_plugin_typescript2 = require("rollup-plugin-typescript2");
|
|
44
|
+
rollup_plugin_typescript2 = __toESM(rollup_plugin_typescript2);
|
|
45
|
+
|
|
46
|
+
//#region src/helpers/resolve-options.ts
|
|
47
|
+
/**
|
|
48
|
+
* A Rollup plugin to bundle TypeScript declaration files (.d.ts) alongside the JavaScript output files.
|
|
49
|
+
*
|
|
50
|
+
* @remarks
|
|
51
|
+
* This plugin generates .d.ts files for each entry point in the bundle, ensuring that type definitions are available for consumers of the library.
|
|
52
|
+
*/
|
|
53
|
+
const dtsBundlePlugin = {
|
|
54
|
+
name: "powerlines:dts-bundle",
|
|
55
|
+
async generateBundle(_opts, bundle) {
|
|
56
|
+
for (const [, file] of Object.entries(bundle)) {
|
|
57
|
+
if (file.type === "asset" || !file.isEntry || file.facadeModuleId == null) continue;
|
|
58
|
+
const dtsFileName = file.fileName.replace(/(?:\.cjs|\.mjs|\.esm\.js|\.cjs\.js|\.mjs\.js|\.js)$/, ".d.ts");
|
|
59
|
+
const relativeSourceDtsName = JSON.stringify(`./${file.facadeModuleId.replace(/\.[cm]?[jt]sx?$/, "")}`);
|
|
60
|
+
this.emitFile({
|
|
61
|
+
type: "asset",
|
|
62
|
+
fileName: dtsFileName,
|
|
63
|
+
source: file.exports.includes("default") ? `export * from ${relativeSourceDtsName};\nexport { default } from ${relativeSourceDtsName};\n` : `export * from ${relativeSourceDtsName};\n`
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the options for [rollup](https://rollupjs.org).
|
|
70
|
+
*
|
|
71
|
+
* @param context - The build context.
|
|
72
|
+
* @returns The resolved options.
|
|
73
|
+
*/
|
|
74
|
+
function resolveOptions(context) {
|
|
75
|
+
return (0, defu.default)({
|
|
76
|
+
input: (0, node_fs.globSync)((0, __stryke_convert_to_array.toArray)(context.entry).map((entry) => (0, __stryke_type_checks_is_string.isString)(entry) ? entry : entry.file)).flat(),
|
|
77
|
+
external: (source) => {
|
|
78
|
+
if (context.config.resolve.external && (0, __stryke_convert_to_array.toArray)(context.config.resolve.external).includes(source)) return true;
|
|
79
|
+
if (context.config.resolve.noExternal && (0, __stryke_convert_to_array.toArray)(context.config.resolve.noExternal).includes(source)) return false;
|
|
80
|
+
if (context.builtins.includes(source)) return context.config.projectType !== "application";
|
|
81
|
+
return !context.config.resolve.skipNodeModulesBundle;
|
|
82
|
+
},
|
|
83
|
+
plugins: [
|
|
84
|
+
(0, rollup_plugin_typescript2.default)({
|
|
85
|
+
check: false,
|
|
86
|
+
tsconfig: context.tsconfig.tsconfigFilePath
|
|
87
|
+
}),
|
|
88
|
+
context.config.define && Object.keys(context.config.define).length > 0 && (0, __rollup_plugin_replace.default)({
|
|
89
|
+
sourceMap: context.config.mode === "development",
|
|
90
|
+
preventAssignment: true,
|
|
91
|
+
...context.config.define ?? {}
|
|
92
|
+
}),
|
|
93
|
+
context.config.inject && Object.keys(context.config.inject).length > 0 && (0, __rollup_plugin_inject.default)({
|
|
94
|
+
sourceMap: context.config.mode === "development",
|
|
95
|
+
...context.config.inject
|
|
96
|
+
}),
|
|
97
|
+
(0, __rollup_plugin_alias.default)({ entries: Object.entries(context.alias).reduce((ret, [id, path]) => {
|
|
98
|
+
if (!ret.find((e) => e.find === id)) ret.push({
|
|
99
|
+
find: id,
|
|
100
|
+
replacement: path
|
|
101
|
+
});
|
|
102
|
+
else context.warn(`Duplicate alias entry for '${id}' detected. The first entry will be used.`);
|
|
103
|
+
return ret;
|
|
104
|
+
}, []) }),
|
|
105
|
+
context.config.babel && (0, __rollup_plugin_babel.getBabelInputPlugin)((0, defu.default)(context.config.babel, {
|
|
106
|
+
caller: {
|
|
107
|
+
name: "powerlines",
|
|
108
|
+
supportsStaticESM: true
|
|
109
|
+
},
|
|
110
|
+
cwd: context.config.root,
|
|
111
|
+
babelrc: false,
|
|
112
|
+
extensions: [
|
|
113
|
+
".js",
|
|
114
|
+
".jsx",
|
|
115
|
+
".ts",
|
|
116
|
+
".tsx"
|
|
117
|
+
],
|
|
118
|
+
babelHelpers: "bundled",
|
|
119
|
+
skipPreflightCheck: true,
|
|
120
|
+
exclude: /node_modules/
|
|
121
|
+
})),
|
|
122
|
+
(0, __rollup_plugin_node_resolve.default)({
|
|
123
|
+
moduleDirectories: ["node_modules"],
|
|
124
|
+
preferBuiltins: true
|
|
125
|
+
}),
|
|
126
|
+
dtsBundlePlugin
|
|
127
|
+
].filter(Boolean)
|
|
128
|
+
}, context.config?.rollup ? context.config?.rollup : {}, {
|
|
129
|
+
cache: !context.config.skipCache ? (0, __stryke_path_join_paths.joinPaths)(context.cachePath, "rollup") : false,
|
|
130
|
+
logLevel: context.config.logLevel,
|
|
131
|
+
output: [{
|
|
132
|
+
dir: context.config.output.buildPath,
|
|
133
|
+
format: "es",
|
|
134
|
+
entryFileNames: "[name].js",
|
|
135
|
+
preserveModules: true,
|
|
136
|
+
sourcemap: context.config.mode === "development"
|
|
137
|
+
}, {
|
|
138
|
+
dir: context.config.output.buildPath,
|
|
139
|
+
format: "cjs",
|
|
140
|
+
entryFileNames: "[name].cjs",
|
|
141
|
+
preserveModules: true,
|
|
142
|
+
sourcemap: context.config.mode === "development"
|
|
143
|
+
}]
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
//#endregion
|
|
148
|
+
Object.defineProperty(exports, '__toESM', {
|
|
149
|
+
enumerable: true,
|
|
150
|
+
get: function () {
|
|
151
|
+
return __toESM;
|
|
152
|
+
}
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, 'dtsBundlePlugin', {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () {
|
|
157
|
+
return dtsBundlePlugin;
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
Object.defineProperty(exports, 'resolveOptions', {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: function () {
|
|
163
|
+
return resolveOptions;
|
|
164
|
+
}
|
|
165
|
+
});
|
package/dist/types/build.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../build-DJTI0ZMx.cjs');
|
package/dist/types/build.d.cts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { RollupOptions as RollupOptions
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type RollupOptions = Omit<RollupOptions$1, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
-
declare type __ΩRollupOptions = any[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { RollupOptions, __ΩRollupOptions };
|
|
8
|
-
//# sourceMappingURL=build.d.cts.map
|
|
1
|
+
import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CZBW0WlF.cjs";
|
|
2
|
+
export { RollupOptions, __ΩRollupOptions };
|
package/dist/types/build.d.mts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
import { RollupOptions as RollupOptions
|
|
2
|
-
|
|
3
|
-
//#region src/types/build.d.ts
|
|
4
|
-
type RollupOptions = Omit<RollupOptions$1, "entry" | "external" | "input" | "output" | "logLevel">;
|
|
5
|
-
declare type __ΩRollupOptions = any[];
|
|
6
|
-
//#endregion
|
|
7
|
-
export { RollupOptions, __ΩRollupOptions };
|
|
8
|
-
//# sourceMappingURL=build.d.mts.map
|
|
1
|
+
import { n as __ΩRollupOptions, t as RollupOptions } from "../build-DZybhECU.mjs";
|
|
2
|
+
export { RollupOptions, __ΩRollupOptions };
|
package/dist/types/build.mjs
CHANGED
package/dist/types/index.cjs
CHANGED
package/dist/types/index.d.cts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RollupPluginContext,
|
|
1
|
+
import { n as __ΩRollupOptions, t as RollupOptions } from "../build-CZBW0WlF.cjs";
|
|
2
|
+
import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-jKu50p7w.cjs";
|
|
3
|
+
import "../index-B_e8BwCm.cjs";
|
|
3
4
|
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupOptions, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RollupPluginContext,
|
|
1
|
+
import { n as __ΩRollupOptions, t as RollupOptions } from "../build-DZybhECU.mjs";
|
|
2
|
+
import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-Diu2VjRD.mjs";
|
|
3
|
+
import "../index-Cc7fCJU9.mjs";
|
|
3
4
|
export { RollupOptions, RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupOptions, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
package/dist/types/index.mjs
CHANGED
package/dist/types/plugin.cjs
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require('../plugin-D5qyQPqC.cjs');
|
package/dist/types/plugin.d.cts
CHANGED
|
@@ -1,20 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type RollupPluginOptions = Partial<RollupOptions>;
|
|
7
|
-
interface RollupPluginUserConfig extends UserConfig {
|
|
8
|
-
rollup: RollupPluginOptions;
|
|
9
|
-
}
|
|
10
|
-
interface RollupPluginResolvedConfig extends ResolvedConfig {
|
|
11
|
-
rollup: RollupOptions;
|
|
12
|
-
}
|
|
13
|
-
type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
14
|
-
declare type __ΩRollupPluginOptions = any[];
|
|
15
|
-
declare type __ΩRollupPluginUserConfig = any[];
|
|
16
|
-
declare type __ΩRollupPluginResolvedConfig = any[];
|
|
17
|
-
declare type __ΩRollupPluginContext = any[];
|
|
18
|
-
//#endregion
|
|
19
|
-
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
|
20
|
-
//# sourceMappingURL=plugin.d.cts.map
|
|
1
|
+
import "../build-CZBW0WlF.cjs";
|
|
2
|
+
import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-jKu50p7w.cjs";
|
|
3
|
+
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { RollupOptions } from "./build.mjs";
|
|
5
|
-
|
|
6
|
-
//#region src/types/plugin.d.ts
|
|
7
|
-
type RollupPluginOptions = Partial<RollupOptions>;
|
|
8
|
-
interface RollupPluginUserConfig extends UserConfig {
|
|
9
|
-
rollup: RollupPluginOptions;
|
|
10
|
-
}
|
|
11
|
-
interface RollupPluginResolvedConfig extends ResolvedConfig {
|
|
12
|
-
rollup: RollupOptions;
|
|
13
|
-
}
|
|
14
|
-
type RollupPluginContext<TResolvedConfig extends RollupPluginResolvedConfig = RollupPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
15
|
-
declare type __ΩRollupPluginOptions = any[];
|
|
16
|
-
declare type __ΩRollupPluginUserConfig = any[];
|
|
17
|
-
declare type __ΩRollupPluginResolvedConfig = any[];
|
|
18
|
-
declare type __ΩRollupPluginContext = any[];
|
|
19
|
-
//#endregion
|
|
20
|
-
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
|
21
|
-
//# sourceMappingURL=plugin.d.mts.map
|
|
1
|
+
import "../build-DZybhECU.mjs";
|
|
2
|
+
import { a as __ΩRollupPluginContext, c as __ΩRollupPluginUserConfig, i as RollupPluginUserConfig, n as RollupPluginOptions, o as __ΩRollupPluginOptions, r as RollupPluginResolvedConfig, s as __ΩRollupPluginResolvedConfig, t as RollupPluginContext } from "../plugin-Diu2VjRD.mjs";
|
|
3
|
+
export { RollupPluginContext, RollupPluginOptions, RollupPluginResolvedConfig, RollupPluginUserConfig, __ΩRollupPluginContext, __ΩRollupPluginOptions, __ΩRollupPluginResolvedConfig, __ΩRollupPluginUserConfig };
|
package/dist/types/plugin.mjs
CHANGED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as RollupPluginContext } from "./plugin-Diu2VjRD.mjs";
|
|
2
|
+
import * as esbuild0 from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRollupPlugin(context: RollupPluginContext): esbuild0.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRollupPlugin as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-BMtcWvP4.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-BMtcWvP4.d.mts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,QAAA,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
const require_resolve_options = require('./resolve-options-JUh7vwne.cjs');
|
|
2
|
+
let __powerlines_core_lib_unplugin = require("@powerlines/core/lib/unplugin");
|
|
3
|
+
let unplugin = require("unplugin");
|
|
4
|
+
|
|
5
|
+
//#region src/helpers/unplugin.ts
|
|
6
|
+
function createRollupPlugin(context) {
|
|
7
|
+
return (0, unplugin.createEsbuildPlugin)((0, __powerlines_core_lib_unplugin.createUnplugin)(context))({});
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
//#endregion
|
|
11
|
+
Object.defineProperty(exports, 'createRollupPlugin', {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
get: function () {
|
|
14
|
+
return createRollupPlugin;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
@@ -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 createRollupPlugin(context) {
|
|
6
|
+
return createEsbuildPlugin(createUnplugin(context))({});
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
//#endregion
|
|
10
|
+
export { createRollupPlugin as t };
|
|
11
|
+
//# sourceMappingURL=unplugin-DrmiEjBF.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-DrmiEjBF.mjs","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { createUnplugin } from \"@powerlines/core/lib/unplugin\";\nimport { createEsbuildPlugin } from \"unplugin\";\nimport { RollupPluginContext } from \"../types/plugin\";\n\nexport function createRollupPlugin(context: RollupPluginContext) {\n return createEsbuildPlugin(createUnplugin(context))({});\n}\n"],"mappings":";;;;AAsBA,SAAgB,mBAAmB,SAA8B;AAC/D,QAAO,oBAAoB,eAAe,QAAQ,CAAC,CAAC,EAAE,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { t as RollupPluginContext } from "./plugin-jKu50p7w.cjs";
|
|
2
|
+
import * as esbuild0 from "esbuild";
|
|
3
|
+
|
|
4
|
+
//#region src/helpers/unplugin.d.ts
|
|
5
|
+
declare function createRollupPlugin(context: RollupPluginContext): esbuild0.Plugin;
|
|
6
|
+
//#endregion
|
|
7
|
+
export { createRollupPlugin as t };
|
|
8
|
+
//# sourceMappingURL=unplugin-JxAcixPP.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unplugin-JxAcixPP.d.cts","names":[],"sources":["../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,kBAAA,UAA4B,sBAAmB,QAAA,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rollup",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.309",
|
|
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"],
|
|
@@ -73,8 +73,8 @@
|
|
|
73
73
|
"typings": "dist/index.d.mts",
|
|
74
74
|
"files": ["dist/**/*"],
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@powerlines/core": "^0.0.
|
|
77
|
-
"@powerlines/plugin-babel": "^0.12.
|
|
76
|
+
"@powerlines/core": "^0.0.10",
|
|
77
|
+
"@powerlines/plugin-babel": "^0.12.308",
|
|
78
78
|
"@rollup/plugin-alias": "^6.0.0",
|
|
79
79
|
"@rollup/plugin-babel": "^6.1.0",
|
|
80
80
|
"@rollup/plugin-inject": "^5.0.5",
|
|
@@ -94,5 +94,5 @@
|
|
|
94
94
|
"peerDependencies": { "rollup": ">=4.46.4" },
|
|
95
95
|
"peerDependenciesMeta": { "rollup": { "optional": false } },
|
|
96
96
|
"publishConfig": { "access": "public" },
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "c5eba2320a22122bbefaca9aba105dd8a98f19b9"
|
|
98
98
|
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
//#region rolldown:runtime
|
|
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;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let __storm_software_config_tools_types = require("@storm-software/config-tools/types");
|
|
3
|
-
let __stryke_string_format_kebab_case = require("@stryke/string-format/kebab-case");
|
|
4
|
-
let __stryke_string_format_title_case = require("@stryke/string-format/title-case");
|
|
5
|
-
require("@storm-software/config-tools/logger");
|
|
6
|
-
require("@storm-software/config-tools/utilities/colors");
|
|
7
|
-
require("@stryke/helpers/noop");
|
|
8
|
-
let chalk = require("chalk");
|
|
9
|
-
chalk = require_rolldown_runtime.__toESM(chalk);
|
|
10
|
-
|
|
11
|
-
//#region ../core/src/lib/logger.ts
|
|
12
|
-
const BADGE_COLORS = [
|
|
13
|
-
"#00A0DD",
|
|
14
|
-
"#6FCE4E",
|
|
15
|
-
"#FBBF24",
|
|
16
|
-
"#F43F5E",
|
|
17
|
-
"#3B82F6",
|
|
18
|
-
"#A855F7",
|
|
19
|
-
"#469592",
|
|
20
|
-
"#288EDF",
|
|
21
|
-
"#D8B4FE",
|
|
22
|
-
"#10B981",
|
|
23
|
-
"#EF4444",
|
|
24
|
-
"#F0EC56",
|
|
25
|
-
"#F472B6",
|
|
26
|
-
"#22D3EE",
|
|
27
|
-
"#EAB308",
|
|
28
|
-
"#84CC16",
|
|
29
|
-
"#F87171",
|
|
30
|
-
"#0EA5E9",
|
|
31
|
-
"#D946EF",
|
|
32
|
-
"#FACC15",
|
|
33
|
-
"#34D399",
|
|
34
|
-
"#8B5CF6"
|
|
35
|
-
];
|
|
36
|
-
const extendLog = (logFn, name) => {
|
|
37
|
-
return (type, ...args) => logFn(type, ` ${chalk.default.inverse.hex(BADGE_COLORS[name.split("").map((char) => char.charCodeAt(0)).reduce((ret, charCode) => ret + charCode, 0) % BADGE_COLORS.length] || BADGE_COLORS[0])(` ${(0, __stryke_string_format_title_case.titleCase)(name)} `)} ${args.join(" ")} `);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
//#endregion
|
|
41
|
-
exports.extendLog = extendLog;
|