@powerlines/plugin-rolldown 0.7.300 → 0.7.302
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/core/src/lib/logger.mjs +40 -0
- package/dist/core/src/lib/logger.mjs.map +1 -0
- package/dist/core/src/lib/unplugin/helpers.mjs +19 -0
- package/dist/core/src/lib/unplugin/helpers.mjs.map +1 -0
- package/dist/core/src/lib/unplugin/index.mjs +5 -0
- package/dist/core/src/lib/unplugin/module-resolution.mjs +66 -0
- package/dist/core/src/lib/unplugin/module-resolution.mjs.map +1 -0
- package/dist/core/src/lib/unplugin/plugin.mjs +71 -0
- package/dist/core/src/lib/unplugin/plugin.mjs.map +1 -0
- package/dist/core/src/lib/utilities/source-file.mjs +22 -0
- package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
- package/dist/core/src/types/api.d.mts +103 -0
- package/dist/core/src/types/api.d.mts.map +1 -0
- package/dist/core/src/types/commands.d.mts +10 -0
- package/dist/core/src/types/commands.d.mts.map +1 -0
- package/dist/core/src/types/config.d.mts +551 -0
- package/dist/core/src/types/config.d.mts.map +1 -0
- package/dist/core/src/types/context.d.mts +511 -0
- package/dist/core/src/types/context.d.mts.map +1 -0
- package/dist/core/src/types/fs.d.mts +487 -0
- package/dist/core/src/types/fs.d.mts.map +1 -0
- package/dist/core/src/types/hooks.d.mts +99 -0
- package/dist/core/src/types/hooks.d.mts.map +1 -0
- package/dist/core/src/types/index.d.mts +9 -0
- package/dist/core/src/types/plugin.d.mts +204 -0
- package/dist/core/src/types/plugin.d.mts.map +1 -0
- package/dist/core/src/types/tsconfig.d.mts +70 -0
- package/dist/core/src/types/tsconfig.d.mts.map +1 -0
- package/dist/core/src/types/unplugin.d.mts +25 -0
- package/dist/core/src/types/unplugin.d.mts.map +1 -0
- package/dist/core/src/types/unplugin.mjs +22 -0
- package/dist/core/src/types/unplugin.mjs.map +1 -0
- package/dist/helpers/index.d.mts +2 -1
- package/dist/helpers/index.mjs +2 -1
- package/dist/helpers/resolve-options.d.mts +16 -0
- package/dist/helpers/resolve-options.d.mts.map +1 -0
- package/dist/helpers/resolve-options.mjs +117 -0
- package/dist/helpers/resolve-options.mjs.map +1 -0
- package/dist/helpers/unplugin.mjs +2 -1
- package/dist/helpers/unplugin.mjs.map +1 -1
- package/dist/index.d.mts +5 -3
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -7
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-rollup/src/helpers/resolve-options.mjs +38 -0
- package/dist/plugin-rollup/src/helpers/resolve-options.mjs.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.d.mts +3 -2
- package/dist/types/plugin.d.mts +13 -6
- package/dist/types/plugin.d.mts.map +1 -1
- package/package.json +28 -93
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- package/dist/helpers/index.cjs +0 -3
- package/dist/helpers/index.d.cts +0 -2
- package/dist/helpers/unplugin.cjs +0 -11
- package/dist/helpers/unplugin.d.cts +0 -8
- package/dist/helpers/unplugin.d.cts.map +0 -1
- package/dist/index.cjs +0 -38
- package/dist/index.d.cts +0 -14
- package/dist/index.d.cts.map +0 -1
- package/dist/types/index.cjs +0 -0
- package/dist/types/index.d.cts +0 -2
- package/dist/types/plugin.cjs +0 -0
- package/dist/types/plugin.d.cts +0 -14
- package/dist/types/plugin.d.cts.map +0 -1
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { toArray } from "@stryke/convert/to-array";
|
|
2
|
+
import defu from "defu";
|
|
3
|
+
import "@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 ../plugin-rollup/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
|
+
//#endregion
|
|
37
|
+
export { dtsBundlePlugin };
|
|
38
|
+
//# sourceMappingURL=resolve-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve-options.mjs","names":["dtsBundlePlugin: Plugin"],"sources":["../../../../../plugin-rollup/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":";;;;;;;;;;;;;;;;;;;AA4CA,MAAaA,kBAA0B;CACrC,MAAM;CACN,MAAM,eAAe,OAAO,QAAQ;AAClC,OAAK,MAAM,GAAG,SAAS,OAAO,QAAQ,OAAO,EAAE;AAC7C,OACE,KAAK,SAAS,WACd,CAAC,KAAK,WACN,KAAK,kBAAkB,KAEvB;GAIF,MAAM,cAAc,KAAK,SAAS,QAChC,uDACA,QACD;GAED,MAAM,wBAAwB,KAAK,UACjC,KAAK,KAAK,eAAe,QAAQ,mBAAmB,GAAG,GACxD;AAED,QAAK,SAAS;IACZ,MAAM;IACN,UAAU;IACV,QAAQ,KAAK,QAAQ,SAAS,UAAU,GACpC,iBAAiB,sBAAsB,6BAA6B,sBAAsB,OAC1F,iBAAiB,sBAAsB;IAC5C,CAAC;;;CAGP"}
|
|
@@ -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"],"sourcesContent":[],"mappings":";;;KAoBY,eAAA,GAAkB,KAC5B"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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 };
|
package/dist/types/plugin.d.mts
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { PluginContext } from "../core/src/types/context.mjs";
|
|
2
|
+
import { ResolvedConfig, UserConfig } from "../core/src/types/config.mjs";
|
|
3
|
+
import "../core/src/types/index.mjs";
|
|
4
|
+
import { RolldownOptions } from "./build.mjs";
|
|
4
5
|
|
|
5
6
|
//#region src/types/plugin.d.ts
|
|
6
|
-
type RolldownPluginOptions = Partial<
|
|
7
|
-
|
|
7
|
+
type RolldownPluginOptions = Partial<RolldownOptions>;
|
|
8
|
+
interface RolldownPluginUserConfig extends UserConfig {
|
|
9
|
+
rolldown: RolldownPluginOptions;
|
|
10
|
+
}
|
|
11
|
+
interface RolldownPluginResolvedConfig extends ResolvedConfig {
|
|
12
|
+
rolldown: RolldownOptions;
|
|
13
|
+
}
|
|
8
14
|
type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig = RolldownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
9
15
|
declare type __ΩRolldownPluginOptions = any[];
|
|
16
|
+
declare type __ΩRolldownPluginUserConfig = any[];
|
|
10
17
|
declare type __ΩRolldownPluginResolvedConfig = any[];
|
|
11
18
|
declare type __ΩRolldownPluginContext = any[];
|
|
12
19
|
//#endregion
|
|
13
|
-
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig };
|
|
20
|
+
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, RolldownPluginUserConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, __ΩRolldownPluginUserConfig };
|
|
14
21
|
//# sourceMappingURL=plugin.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAyBY,qBAAA,GAAwB,QAAQ;UAE3B,wBAAA,SAAiC;YACtC;;AAHA,UAMK,4BAAA,SAAqC,cANX,CAAA;EAE1B,QAAA,EAKL,eALK;AAIjB;AAIY,KAAA,qBAAqB,CAAA,wBACP,4BADO,GAE7B,4BAF6B,CAAA,GAG7B,aAH6B,CAGf,eAHe,CAAA;AACP,wCAAA,GAAA,EAAA;AACtB,2CAAA,GAAA,EAAA;AACc,+CAAA,GAAA,EAAA;AAAd,wCAAA,GAAA,EAAA"}
|
package/package.json
CHANGED
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@powerlines/plugin-rolldown",
|
|
3
|
-
"version": "0.7.
|
|
4
|
-
"
|
|
3
|
+
"version": "0.7.302",
|
|
4
|
+
"private": false,
|
|
5
5
|
"description": "A package containing a Powerlines plugin to assist in developing other Powerlines plugins.",
|
|
6
|
+
"keywords": ["rolldown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
7
|
+
"homepage": "https://stormsoftware.com",
|
|
8
|
+
"bugs": {
|
|
9
|
+
"url": "https://stormsoftware.com/support",
|
|
10
|
+
"email": "support@stormsoftware.com"
|
|
11
|
+
},
|
|
6
12
|
"repository": {
|
|
7
13
|
"type": "github",
|
|
8
14
|
"url": "https://github.com/storm-software/powerlines.git",
|
|
9
15
|
"directory": "packages/plugin-rolldown"
|
|
10
16
|
},
|
|
11
|
-
"
|
|
12
|
-
|
|
13
|
-
"url": "https://
|
|
14
|
-
"email": "support@stormsoftware.com"
|
|
17
|
+
"funding": {
|
|
18
|
+
"type": "github",
|
|
19
|
+
"url": "https://github.com/sponsors/storm-software"
|
|
15
20
|
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
16
22
|
"author": {
|
|
17
23
|
"name": "Storm Software",
|
|
18
24
|
"email": "contact@stormsoftware.com",
|
|
@@ -32,91 +38,25 @@
|
|
|
32
38
|
"url": "https://stormsoftware.com"
|
|
33
39
|
}
|
|
34
40
|
],
|
|
35
|
-
"
|
|
36
|
-
"type": "github",
|
|
37
|
-
"url": "https://github.com/sponsors/storm-software"
|
|
38
|
-
},
|
|
39
|
-
"license": "Apache-2.0",
|
|
40
|
-
"private": false,
|
|
41
|
-
"main": "./dist/index.cjs",
|
|
42
|
-
"module": "./dist/index.mjs",
|
|
41
|
+
"type": "module",
|
|
43
42
|
"exports": {
|
|
44
|
-
".":
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
},
|
|
53
|
-
"default": {
|
|
54
|
-
"types": "./dist/index.d.mts",
|
|
55
|
-
"default": "./dist/index.mjs"
|
|
56
|
-
}
|
|
57
|
-
},
|
|
58
|
-
"./helpers": {
|
|
59
|
-
"require": {
|
|
60
|
-
"types": "./dist/helpers/index.d.cts",
|
|
61
|
-
"default": "./dist/helpers/index.cjs"
|
|
62
|
-
},
|
|
63
|
-
"import": {
|
|
64
|
-
"types": "./dist/helpers/index.d.mts",
|
|
65
|
-
"default": "./dist/helpers/index.mjs"
|
|
66
|
-
},
|
|
67
|
-
"default": {
|
|
68
|
-
"types": "./dist/helpers/index.d.mts",
|
|
69
|
-
"default": "./dist/helpers/index.mjs"
|
|
70
|
-
}
|
|
71
|
-
},
|
|
72
|
-
"./helpers/unplugin": {
|
|
73
|
-
"require": {
|
|
74
|
-
"types": "./dist/helpers/unplugin.d.cts",
|
|
75
|
-
"default": "./dist/helpers/unplugin.cjs"
|
|
76
|
-
},
|
|
77
|
-
"import": {
|
|
78
|
-
"types": "./dist/helpers/unplugin.d.mts",
|
|
79
|
-
"default": "./dist/helpers/unplugin.mjs"
|
|
80
|
-
},
|
|
81
|
-
"default": {
|
|
82
|
-
"types": "./dist/helpers/unplugin.d.mts",
|
|
83
|
-
"default": "./dist/helpers/unplugin.mjs"
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
"./package.json": "./package.json",
|
|
87
|
-
"./types": {
|
|
88
|
-
"require": {
|
|
89
|
-
"types": "./dist/types/index.d.cts",
|
|
90
|
-
"default": "./dist/types/index.cjs"
|
|
91
|
-
},
|
|
92
|
-
"import": {
|
|
93
|
-
"types": "./dist/types/index.d.mts",
|
|
94
|
-
"default": "./dist/types/index.mjs"
|
|
95
|
-
},
|
|
96
|
-
"default": {
|
|
97
|
-
"types": "./dist/types/index.d.mts",
|
|
98
|
-
"default": "./dist/types/index.mjs"
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
"./types/plugin": {
|
|
102
|
-
"require": {
|
|
103
|
-
"types": "./dist/types/plugin.d.cts",
|
|
104
|
-
"default": "./dist/types/plugin.cjs"
|
|
105
|
-
},
|
|
106
|
-
"import": {
|
|
107
|
-
"types": "./dist/types/plugin.d.mts",
|
|
108
|
-
"default": "./dist/types/plugin.mjs"
|
|
109
|
-
},
|
|
110
|
-
"default": {
|
|
111
|
-
"types": "./dist/types/plugin.d.mts",
|
|
112
|
-
"default": "./dist/types/plugin.mjs"
|
|
113
|
-
}
|
|
114
|
-
}
|
|
43
|
+
".": "./dist/index.mjs",
|
|
44
|
+
"./helpers": "./dist/helpers/index.mjs",
|
|
45
|
+
"./helpers/resolve-options": "./dist/helpers/resolve-options.mjs",
|
|
46
|
+
"./helpers/unplugin": "./dist/helpers/unplugin.mjs",
|
|
47
|
+
"./types": "./dist/types/index.mjs",
|
|
48
|
+
"./types/build": "./dist/types/build.mjs",
|
|
49
|
+
"./types/plugin": "./dist/types/plugin.mjs",
|
|
50
|
+
"./*": "./*"
|
|
115
51
|
},
|
|
52
|
+
"main": "./dist/index.mjs",
|
|
53
|
+
"module": "./dist/index.mjs",
|
|
54
|
+
"types": "./dist/index.d.mts",
|
|
116
55
|
"typings": "dist/index.d.mts",
|
|
117
56
|
"files": ["dist/**/*"],
|
|
118
|
-
"keywords": ["rolldown", "powerlines", "storm-software", "powerlines-plugin"],
|
|
119
57
|
"dependencies": {
|
|
58
|
+
"@powerlines/plugin-babel": "^0.12.301",
|
|
59
|
+
"@powerlines/plugin-rollup": "^0.7.302",
|
|
120
60
|
"@stryke/convert": "^0.6.40",
|
|
121
61
|
"@stryke/fs": "^0.33.43",
|
|
122
62
|
"@stryke/path": "^0.26.6",
|
|
@@ -124,15 +64,10 @@
|
|
|
124
64
|
"@stryke/types": "^0.10.39",
|
|
125
65
|
"defu": "^6.1.4",
|
|
126
66
|
"jiti": "^2.6.1",
|
|
127
|
-
"powerlines": "^0.38.57",
|
|
128
67
|
"rolldown": "1.0.0-beta.53",
|
|
129
68
|
"unplugin": "3.0.0-beta.3"
|
|
130
69
|
},
|
|
131
|
-
"devDependencies": {
|
|
132
|
-
"@powerlines/plugin-plugin": "^0.12.241",
|
|
133
|
-
"@types/node": "^25.3.1"
|
|
134
|
-
},
|
|
70
|
+
"devDependencies": { "@types/node": "^25.3.3" },
|
|
135
71
|
"publishConfig": { "access": "public" },
|
|
136
|
-
"
|
|
137
|
-
"gitHead": "eb3dbd19bd153aa5a988bce09a1cf05d985cb04b"
|
|
72
|
+
"gitHead": "30a096fed42d3462dbc028b16145250c373f3d99"
|
|
138
73
|
}
|
|
@@ -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;
|
package/dist/helpers/index.cjs
DELETED
package/dist/helpers/index.d.cts
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
const require_rolldown_runtime = require('../_virtual/rolldown_runtime.cjs');
|
|
2
|
-
let powerlines_lib_unplugin = require("powerlines/lib/unplugin");
|
|
3
|
-
let unplugin = require("unplugin");
|
|
4
|
-
|
|
5
|
-
//#region src/helpers/unplugin.ts
|
|
6
|
-
function createRolldownPlugin(context) {
|
|
7
|
-
return (0, unplugin.createEsbuildPlugin)((0, powerlines_lib_unplugin.createUnplugin)(context))({});
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
//#endregion
|
|
11
|
-
exports.createRolldownPlugin = createRolldownPlugin;
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { RolldownPluginContext } from "../types/plugin.cjs";
|
|
2
|
-
import * as esbuild0 from "esbuild";
|
|
3
|
-
|
|
4
|
-
//#region src/helpers/unplugin.d.ts
|
|
5
|
-
declare function createRolldownPlugin(context: RolldownPluginContext): esbuild0.Plugin;
|
|
6
|
-
//#endregion
|
|
7
|
-
export { createRolldownPlugin };
|
|
8
|
-
//# sourceMappingURL=unplugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"unplugin.d.cts","names":[],"sources":["../../src/helpers/unplugin.ts"],"sourcesContent":[],"mappings":";;;;iBAsBgB,oBAAA,UAA8B,wBAAqB,QAAA,CAAA"}
|
package/dist/index.cjs
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
3
|
-
const require_helpers_unplugin = require('./helpers/unplugin.cjs');
|
|
4
|
-
require('./helpers/index.cjs');
|
|
5
|
-
let __stryke_convert_to_array = require("@stryke/convert/to-array");
|
|
6
|
-
let defu = require("defu");
|
|
7
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
8
|
-
let powerlines_lib_build_rolldown = require("powerlines/lib/build/rolldown");
|
|
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
|
-
build: {
|
|
22
|
-
...options,
|
|
23
|
-
variant: "rolldown"
|
|
24
|
-
}
|
|
25
|
-
};
|
|
26
|
-
},
|
|
27
|
-
async build() {
|
|
28
|
-
const result = await (0, rolldown.rolldown)((0, defu.default)({ plugins: [require_helpers_unplugin.createRolldownPlugin(this)] }, (0, powerlines_lib_build_rolldown.extractRolldownConfig)(this)));
|
|
29
|
-
await Promise.all((0, __stryke_convert_to_array.toArray)(this.config.output.format).map(async (format) => result.write({ format })));
|
|
30
|
-
}
|
|
31
|
-
};
|
|
32
|
-
};
|
|
33
|
-
var src_default = plugin;
|
|
34
|
-
|
|
35
|
-
//#endregion
|
|
36
|
-
exports.createRolldownPlugin = require_helpers_unplugin.createRolldownPlugin;
|
|
37
|
-
exports.default = src_default;
|
|
38
|
-
exports.plugin = plugin;
|
package/dist/index.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig } from "./types/plugin.cjs";
|
|
2
|
-
import { createRolldownPlugin } from "./helpers/unplugin.cjs";
|
|
3
|
-
import "./helpers/index.cjs";
|
|
4
|
-
import "./types/index.cjs";
|
|
5
|
-
import { Plugin } from "powerlines/types/plugin";
|
|
6
|
-
|
|
7
|
-
//#region src/index.d.ts
|
|
8
|
-
/**
|
|
9
|
-
* A Powerlines plugin to assist in developing other Powerlines plugins.
|
|
10
|
-
*/
|
|
11
|
-
declare const plugin: <TContext extends RolldownPluginContext = RolldownPluginContext>(options?: RolldownPluginOptions) => Plugin<TContext>;
|
|
12
|
-
//#endregion
|
|
13
|
-
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig, createRolldownPlugin, plugin as default, plugin };
|
|
14
|
-
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;AAiCa,cAAA,MAqCZ,EAAA,CAAA,iBApCkB,qBAoClB,GApC0C,qBAoC1C,CAAA,CAAA,OAAA,CAAA,EAlCU,qBAkCV,EAAA,GAjCE,MAiCF,CAjCS,QAiCT,CAAA"}
|
package/dist/types/index.cjs
DELETED
|
File without changes
|
package/dist/types/index.d.cts
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig } from "./plugin.cjs";
|
|
2
|
-
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig };
|
package/dist/types/plugin.cjs
DELETED
|
File without changes
|
package/dist/types/plugin.d.cts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { RolldownBuildConfig } from "powerlines/types/build";
|
|
2
|
-
import { PluginContext } from "powerlines/types/context";
|
|
3
|
-
import { RolldownResolvedConfig } from "powerlines/types/resolved";
|
|
4
|
-
|
|
5
|
-
//#region src/types/plugin.d.ts
|
|
6
|
-
type RolldownPluginOptions = Partial<RolldownBuildConfig>;
|
|
7
|
-
type RolldownPluginResolvedConfig = RolldownResolvedConfig;
|
|
8
|
-
type RolldownPluginContext<TResolvedConfig extends RolldownPluginResolvedConfig = RolldownPluginResolvedConfig> = PluginContext<TResolvedConfig>;
|
|
9
|
-
declare type __ΩRolldownPluginOptions = any[];
|
|
10
|
-
declare type __ΩRolldownPluginResolvedConfig = any[];
|
|
11
|
-
declare type __ΩRolldownPluginContext = any[];
|
|
12
|
-
//#endregion
|
|
13
|
-
export { RolldownPluginContext, RolldownPluginOptions, RolldownPluginResolvedConfig, __ΩRolldownPluginContext, __ΩRolldownPluginOptions, __ΩRolldownPluginResolvedConfig };
|
|
14
|
-
//# sourceMappingURL=plugin.d.cts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAsBY,qBAAA,GAAwB,QAAQ;KAEhC,4BAAA,GAA+B;AAF/B,KAIA,qBAJqB,CAAA,wBAM7B,4BANuC,GAMR,4BANQ,CAAA,GAOvC,aAPuC,CAOzB,eAPyB,CAAA;AAE/B,wCAA+B,GAAA,EAAA;AAE/B,+CAAqB,GAAA,EAAA;AAE7B,wCAAA,GAAA,EAAA"}
|