@powerlines/plugin-unbuild 0.5.300 → 0.5.301

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/core/src/lib/utilities/source-file.mjs +22 -0
  2. package/dist/core/src/lib/utilities/source-file.mjs.map +1 -0
  3. package/dist/core/src/types/_internal.d.mts +85 -0
  4. package/dist/core/src/types/_internal.d.mts.map +1 -0
  5. package/dist/core/src/types/api.d.mts +103 -0
  6. package/dist/core/src/types/api.d.mts.map +1 -0
  7. package/dist/core/src/types/commands.d.mts +10 -0
  8. package/dist/core/src/types/commands.d.mts.map +1 -0
  9. package/dist/core/src/types/config.d.mts +551 -0
  10. package/dist/core/src/types/config.d.mts.map +1 -0
  11. package/dist/core/src/types/context.d.mts +511 -0
  12. package/dist/core/src/types/context.d.mts.map +1 -0
  13. package/dist/core/src/types/fs.d.mts +487 -0
  14. package/dist/core/src/types/fs.d.mts.map +1 -0
  15. package/dist/core/src/types/hooks.d.mts +99 -0
  16. package/dist/core/src/types/hooks.d.mts.map +1 -0
  17. package/dist/core/src/types/index.d.mts +9 -0
  18. package/dist/core/src/types/plugin.d.mts +204 -0
  19. package/dist/core/src/types/plugin.d.mts.map +1 -0
  20. package/dist/core/src/types/tsconfig.d.mts +70 -0
  21. package/dist/core/src/types/tsconfig.d.mts.map +1 -0
  22. package/dist/core/src/types/unplugin.d.mts +25 -0
  23. package/dist/core/src/types/unplugin.d.mts.map +1 -0
  24. package/dist/helpers/index.d.mts +2 -0
  25. package/dist/helpers/index.mjs +3 -0
  26. package/dist/helpers/resolve-options.d.mts +18 -0
  27. package/dist/helpers/resolve-options.d.mts.map +1 -0
  28. package/dist/helpers/resolve-options.mjs +123 -0
  29. package/dist/helpers/resolve-options.mjs.map +1 -0
  30. package/dist/index.d.mts +5 -4
  31. package/dist/index.d.mts.map +1 -1
  32. package/dist/index.mjs +4 -5
  33. package/dist/index.mjs.map +1 -1
  34. package/dist/plugin-rollup/src/helpers/resolve-options.mjs +116 -0
  35. package/dist/plugin-rollup/src/helpers/resolve-options.mjs.map +1 -0
  36. package/dist/types/build.d.mts +8 -0
  37. package/dist/types/build.d.mts.map +1 -0
  38. package/dist/types/build.mjs +1 -0
  39. package/dist/types/index.d.mts +3 -2
  40. package/dist/types/plugin.d.mts +13 -6
  41. package/dist/types/plugin.d.mts.map +1 -1
  42. package/package.json +19 -53
  43. package/dist/index.cjs +0 -31
  44. package/dist/index.d.cts +0 -13
  45. package/dist/index.d.cts.map +0 -1
  46. package/dist/types/index.cjs +0 -0
  47. package/dist/types/index.d.cts +0 -2
  48. package/dist/types/plugin.cjs +0 -0
  49. package/dist/types/plugin.d.cts +0 -14
  50. package/dist/types/plugin.d.cts.map +0 -1
@@ -0,0 +1,116 @@
1
+ import { isString } from "@stryke/type-checks/is-string";
2
+ import alias from "@rollup/plugin-alias";
3
+ import { getBabelInputPlugin } from "@rollup/plugin-babel";
4
+ import inject from "@rollup/plugin-inject";
5
+ import resolve from "@rollup/plugin-node-resolve";
6
+ import replace from "@rollup/plugin-replace";
7
+ import { toArray } from "@stryke/convert/to-array";
8
+ import { joinPaths } from "@stryke/path/join-paths";
9
+ import defu from "defu";
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
+ * 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 };
116
+ //# 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":"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"}
@@ -0,0 +1,8 @@
1
+ import { UnbuildOptions as UnbuildOptions$1 } from "@storm-software/unbuild/types";
2
+
3
+ //#region src/types/build.d.ts
4
+ type UnbuildOptions = Partial<Omit<UnbuildOptions$1, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">>;
5
+ declare type __ΩUnbuildOptions = any[];
6
+ //#endregion
7
+ export { UnbuildOptions, __ΩUnbuildOptions };
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,cAAA,GAAiB,QAC3B,KACE"}
@@ -0,0 +1 @@
1
+ export { };
@@ -1,2 +1,3 @@
1
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig } from "./plugin.mjs";
2
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig };
1
+ import { UnbuildOptions, __ΩUnbuildOptions } from "./build.mjs";
2
+ import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig } from "./plugin.mjs";
3
+ export { UnbuildOptions, UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildOptions, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig };
@@ -1,14 +1,21 @@
1
- import { UnbuildBuildConfig } from "powerlines/types/build";
2
- import { PluginContext } from "powerlines/types/context";
3
- import { UnbuildResolvedConfig } from "powerlines/types/resolved";
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 { UnbuildOptions } from "./build.mjs";
4
5
 
5
6
  //#region src/types/plugin.d.ts
6
- type UnbuildPluginOptions = Partial<UnbuildBuildConfig>;
7
- type UnbuildPluginResolvedConfig = UnbuildResolvedConfig;
7
+ type UnbuildPluginOptions = Partial<UnbuildOptions>;
8
+ interface UnbuildPluginUserConfig extends UserConfig {
9
+ unbuild?: UnbuildPluginOptions;
10
+ }
11
+ interface UnbuildPluginResolvedConfig extends ResolvedConfig {
12
+ unbuild: UnbuildOptions;
13
+ }
8
14
  type UnbuildPluginContext<TResolvedConfig extends UnbuildPluginResolvedConfig = UnbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
9
15
  declare type __ΩUnbuildPluginOptions = any[];
16
+ declare type __ΩUnbuildPluginUserConfig = any[];
10
17
  declare type __ΩUnbuildPluginResolvedConfig = any[];
11
18
  declare type __ΩUnbuildPluginContext = any[];
12
19
  //#endregion
13
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig };
20
+ export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig };
14
21
  //# sourceMappingURL=plugin.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;KAsBY,oBAAA,GAAuB,QAAQ;KAE/B,2BAAA,GAA8B;AAF9B,KAIA,oBAJoB,CAAA,wBAM5B,2BANsC,GAMR,2BANQ,CAAA,GAOtC,aAPsC,CAOxB,eAPwB,CAAA;AAE9B,uCAA8B,GAAA,EAAA;AAE9B,8CAAoB,GAAA,EAAA;AAE5B,uCAAA,GAAA,EAAA"}
1
+ {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;;;KAyBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;YACrC;;AAHA,UAMK,2BAAA,SAAoC,cANX,CAAA;EAEzB,OAAA,EAKN,cALM;AAIjB;AAIY,KAAA,oBAAoB,CAAA,wBACN,2BADM,GAE5B,2BAF4B,CAAA,GAG5B,aAH4B,CAGd,eAHc,CAAA;AACN,uCAAA,GAAA,EAAA;AACtB,0CAAA,GAAA,EAAA;AACc,8CAAA,GAAA,EAAA;AAAd,uCAAA,GAAA,EAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-unbuild",
3
- "version": "0.5.300",
3
+ "version": "0.5.301",
4
4
  "type": "module",
5
5
  "description": "A package containing a Powerlines plugin to build projects using Unbuild.",
6
6
  "repository": {
@@ -38,65 +38,31 @@
38
38
  },
39
39
  "license": "Apache-2.0",
40
40
  "private": false,
41
- "main": "./dist/index.cjs",
41
+ "main": "./dist/index.mjs",
42
42
  "module": "./dist/index.mjs",
43
43
  "exports": {
44
- ".": {
45
- "require": {
46
- "types": "./dist/index.d.cts",
47
- "default": "./dist/index.cjs"
48
- },
49
- "import": {
50
- "types": "./dist/index.d.mts",
51
- "default": "./dist/index.mjs"
52
- },
53
- "default": {
54
- "types": "./dist/index.d.mts",
55
- "default": "./dist/index.mjs"
56
- }
57
- },
58
- "./package.json": "./package.json",
59
- "./types": {
60
- "require": {
61
- "types": "./dist/types/index.d.cts",
62
- "default": "./dist/types/index.cjs"
63
- },
64
- "import": {
65
- "types": "./dist/types/index.d.mts",
66
- "default": "./dist/types/index.mjs"
67
- },
68
- "default": {
69
- "types": "./dist/types/index.d.mts",
70
- "default": "./dist/types/index.mjs"
71
- }
72
- },
73
- "./types/plugin": {
74
- "require": {
75
- "types": "./dist/types/plugin.d.cts",
76
- "default": "./dist/types/plugin.cjs"
77
- },
78
- "import": {
79
- "types": "./dist/types/plugin.d.mts",
80
- "default": "./dist/types/plugin.mjs"
81
- },
82
- "default": {
83
- "types": "./dist/types/plugin.d.mts",
84
- "default": "./dist/types/plugin.mjs"
85
- }
86
- }
44
+ ".": "./dist/index.mjs",
45
+ "./helpers": "./dist/helpers/index.mjs",
46
+ "./helpers/resolve-options": "./dist/helpers/resolve-options.mjs",
47
+ "./types": "./dist/types/index.mjs",
48
+ "./types/build": "./dist/types/build.mjs",
49
+ "./types/plugin": "./dist/types/plugin.mjs",
50
+ "./*": "./*"
87
51
  },
88
52
  "typings": "dist/index.d.mts",
89
53
  "files": ["dist/**/*"],
90
54
  "keywords": ["unbuild", "powerlines", "storm-software", "powerlines-plugin"],
91
55
  "dependencies": {
92
- "@storm-software/unbuild": "^0.57.91",
93
- "powerlines": "^0.38.57"
94
- },
95
- "devDependencies": {
96
- "@powerlines/plugin-plugin": "^0.12.241",
97
- "@types/node": "^25.3.1"
56
+ "@storm-software/unbuild": "^0.57.92",
57
+ "@stryke/path": "^0.26.6",
58
+ "@stryke/type-checks": "^0.5.25",
59
+ "defu": "^6.1.4",
60
+ "@powerlines/plugin-rollup": "^0.7.301",
61
+ "esbuild": "^0.25.12",
62
+ "unplugin": "3.0.0-beta.3"
98
63
  },
64
+ "devDependencies": { "@types/node": "^25.3.2" },
99
65
  "publishConfig": { "access": "public" },
100
- "types": "./dist/index.d.cts",
101
- "gitHead": "eb3dbd19bd153aa5a988bce09a1cf05d985cb04b"
66
+ "types": "./dist/index.d.mts",
67
+ "gitHead": "0dcb16f054b8a69915b074578e6d4dfa3ecc1529"
102
68
  }
package/dist/index.cjs DELETED
@@ -1,31 +0,0 @@
1
- Object.defineProperty(exports, '__esModule', { value: true });
2
- let __storm_software_unbuild = require("@storm-software/unbuild");
3
- let powerlines_lib_build_unbuild = require("powerlines/lib/build/unbuild");
4
-
5
- //#region src/index.ts
6
- /**
7
- * A Powerlines plugin to build projects using Unbuild.
8
- */
9
- const plugin = (options = {}) => {
10
- return {
11
- name: "unbuild",
12
- config() {
13
- return {
14
- output: { format: ["esm"] },
15
- build: {
16
- ...powerlines_lib_build_unbuild.DEFAULT_UNBUILD_CONFIG,
17
- ...options,
18
- variant: "unbuild"
19
- }
20
- };
21
- },
22
- async build() {
23
- await (0, __storm_software_unbuild.build)((0, powerlines_lib_build_unbuild.extractUnbuildConfig)(this));
24
- }
25
- };
26
- };
27
- var src_default = plugin;
28
-
29
- //#endregion
30
- exports.default = src_default;
31
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,13 +0,0 @@
1
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig } from "./types/plugin.cjs";
2
- import "./types/index.cjs";
3
- import { Plugin } from "powerlines/types/plugin";
4
-
5
- //#region src/index.d.ts
6
-
7
- /**
8
- * A Powerlines plugin to build projects using Unbuild.
9
- */
10
- declare const plugin: <TContext extends UnbuildPluginContext = UnbuildPluginContext>(options?: UnbuildPluginOptions) => Plugin<TContext>;
11
- //#endregion
12
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, plugin as default, plugin };
13
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;AAgCA;AACmB,cADN,MACM,EAAA,CAAA,iBAAA,oBAAA,GAAuB,oBAAvB,CAAA,CAAA,OAAA,CAAA,EAER,oBAFQ,EAAA,GAGhB,MAHgB,CAGT,QAHS,CAAA"}
File without changes
@@ -1,2 +0,0 @@
1
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig } from "./plugin.cjs";
2
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig };
File without changes
@@ -1,14 +0,0 @@
1
- import { UnbuildBuildConfig } from "powerlines/types/build";
2
- import { PluginContext } from "powerlines/types/context";
3
- import { UnbuildResolvedConfig } from "powerlines/types/resolved";
4
-
5
- //#region src/types/plugin.d.ts
6
- type UnbuildPluginOptions = Partial<UnbuildBuildConfig>;
7
- type UnbuildPluginResolvedConfig = UnbuildResolvedConfig;
8
- type UnbuildPluginContext<TResolvedConfig extends UnbuildPluginResolvedConfig = UnbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
9
- declare type __ΩUnbuildPluginOptions = any[];
10
- declare type __ΩUnbuildPluginResolvedConfig = any[];
11
- declare type __ΩUnbuildPluginContext = any[];
12
- //#endregion
13
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig };
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,oBAAA,GAAuB,QAAQ;KAE/B,2BAAA,GAA8B;AAF9B,KAIA,oBAJoB,CAAA,wBAM5B,2BANsC,GAMR,2BANQ,CAAA,GAOtC,aAPsC,CAOxB,eAPwB,CAAA;AAE9B,uCAA8B,GAAA,EAAA;AAE9B,8CAAoB,GAAA,EAAA;AAE5B,uCAAA,GAAA,EAAA"}