@powerlines/plugin-unbuild 0.5.365 → 0.5.366

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@powerlines/plugin-unbuild",
3
- "version": "0.5.365",
3
+ "version": "0.5.366",
4
4
  "private": false,
5
5
  "description": "A package containing a Powerlines plugin to build projects using Unbuild.",
6
6
  "keywords": ["unbuild", "powerlines", "storm-software", "powerlines-plugin"],
@@ -69,8 +69,8 @@
69
69
  "typings": "dist/index.d.mts",
70
70
  "files": ["dist/**/*"],
71
71
  "dependencies": {
72
- "@powerlines/core": "^0.6.2",
73
- "@powerlines/plugin-rollup": "^0.7.365",
72
+ "@powerlines/core": "^0.7.0",
73
+ "@powerlines/plugin-rollup": "^0.7.366",
74
74
  "@stryke/path": "^0.27.2",
75
75
  "@stryke/type-checks": "^0.5.41",
76
76
  "defu": "^6.1.4",
@@ -84,5 +84,5 @@
84
84
  "peerDependencies": { "@storm-software/unbuild": ">=0.57.0" },
85
85
  "peerDependenciesMeta": { "@storm-software/unbuild": { "optional": false } },
86
86
  "publishConfig": { "access": "public" },
87
- "gitHead": "c9c61ea343f037afaa4097720d77cb822eb86e63"
87
+ "gitHead": "c3243c1ec0fbacb4afd4bd3db20432f443334076"
88
88
  }
@@ -1,29 +0,0 @@
1
- //#region \0rolldown/runtime.js
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __getProtoOf = Object.getPrototypeOf;
7
- var __hasOwnProp = Object.prototype.hasOwnProperty;
8
- var __copyProps = (to, from, except, desc) => {
9
- if (from && typeof from === "object" || typeof from === "function") {
10
- for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) {
13
- __defProp(to, key, {
14
- get: ((k) => from[k]).bind(null, key),
15
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
- });
17
- }
18
- }
19
- }
20
- return to;
21
- };
22
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
- value: mod,
24
- enumerable: true
25
- }) : target, mod));
26
-
27
- //#endregion
28
-
29
- exports.__toESM = __toESM;
@@ -1,6 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_helpers_resolve_options = require('./resolve-options.cjs');
3
-
4
- exports.DEFAULT_UNBUILD_CONFIG = require_helpers_resolve_options.DEFAULT_UNBUILD_CONFIG;
5
- exports.resolveOptions = require_helpers_resolve_options.resolveOptions;
6
- exports.unbuildLoader = require_helpers_resolve_options.unbuildLoader;
@@ -1,2 +0,0 @@
1
- import { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader } from "./resolve-options.cjs";
2
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
@@ -1,2 +0,0 @@
1
- import { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader } from "./resolve-options.mjs";
2
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
@@ -1,3 +0,0 @@
1
- import { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader } from "./resolve-options.mjs";
2
-
3
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
@@ -1,128 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_runtime = require('../_virtual/_rolldown/runtime.cjs');
3
- let _powerlines_core_lib_utilities_source_file = require("@powerlines/core/lib/utilities/source-file");
4
- let _powerlines_plugin_rollup_helpers_resolve_options = require("@powerlines/plugin-rollup/helpers/resolve-options");
5
- let _stryke_path = require("@stryke/path");
6
- let _stryke_path_join_paths = require("@stryke/path/join-paths");
7
- let _stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
8
- let defu = require("defu");
9
- defu = require_runtime.__toESM(defu);
10
- let esbuild = require("esbuild");
11
-
12
- //#region src/helpers/resolve-options.ts
13
- const DEFAULT_UNBUILD_CONFIG = {
14
- dts: true,
15
- clean: false,
16
- includeSrc: false,
17
- treeShaking: true,
18
- splitting: true,
19
- stub: false,
20
- watchOptions: {},
21
- outputPath: "dist",
22
- generatePackageJson: true,
23
- banner: " ",
24
- rollup: {
25
- dts: {},
26
- emitCJS: true,
27
- replace: {},
28
- resolve: {},
29
- json: {},
30
- esbuild: { target: "es2020" },
31
- commonjs: {},
32
- alias: {}
33
- }
34
- };
35
- const unbuildLoader = (context) => {
36
- return async (input, { options }) => {
37
- if (!/\.(?:c|m)?[jt]sx?$/.test(input.path) || /\.d\.[cm]?ts$/.test(input.path)) return;
38
- const output = [];
39
- let contents = await input.getContents();
40
- if (options.declaration && !input.srcPath?.match(/\.d\.[cm]?ts$/)) {
41
- const extension = `.d.${input.srcPath?.match(/(?<=\.)(?:c|m)(?=[jt]s$)/)?.[0] || ""}ts`;
42
- output.push({
43
- contents,
44
- srcPath: input.srcPath,
45
- path: input.path,
46
- extension,
47
- declaration: true
48
- });
49
- }
50
- let transformed = contents;
51
- let result = await context.$$internal.callHook("transform", {
52
- sequential: true,
53
- order: "pre"
54
- }, transformed, input.path);
55
- if (result) transformed = result;
56
- result = await context.$$internal.callHook("transform", {
57
- sequential: true,
58
- order: "normal"
59
- }, (0, _powerlines_core_lib_utilities_source_file.getString)(transformed), input.path);
60
- if (result) transformed = result;
61
- result = await context.$$internal.callHook("transform", {
62
- sequential: true,
63
- order: "post"
64
- }, (0, _powerlines_core_lib_utilities_source_file.getString)(transformed), input.path);
65
- if (result) transformed = result;
66
- if ([
67
- ".ts",
68
- ".mts",
69
- ".cts"
70
- ].includes(input.extension)) contents = await (0, esbuild.transform)((0, _powerlines_core_lib_utilities_source_file.getString)(transformed), {
71
- ...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths")),
72
- loader: "ts"
73
- }).then((r) => r.code);
74
- else if ([".tsx", ".jsx"].includes(input.extension)) contents = await (0, esbuild.transform)((0, _powerlines_core_lib_utilities_source_file.getString)(transformed), {
75
- loader: input.extension === ".tsx" ? "tsx" : "jsx",
76
- ...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths"))
77
- }).then((r) => r.code);
78
- const isCjs = options.format === "cjs";
79
- if (isCjs) contents = context.resolver.transform({
80
- source: contents,
81
- retainLines: false
82
- }).replace(/^exports.default = /gm, "module.exports = ").replace(/^var _default = exports.default = /gm, "module.exports = ").replace("module.exports = void 0;", "");
83
- let extension = isCjs ? ".js" : ".mjs";
84
- if (options.ext) extension = options.ext.startsWith(".") ? options.ext : `.${options.ext}`;
85
- output.push({
86
- contents,
87
- path: input.path,
88
- extension
89
- });
90
- return output;
91
- };
92
- };
93
- /**
94
- * Extracts the unbuild configuration from the context.
95
- *
96
- * @param context - The build context.
97
- * @returns The resolved unbuild configuration.
98
- */
99
- function resolveOptions(context) {
100
- return (0, defu.default)({ alias: context.alias }, context.config.unbuild ? context.config.unbuild : {}, {
101
- projectName: context.config.name,
102
- name: context.config.name,
103
- orgName: (0, _stryke_type_checks_is_object.isObject)(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
104
- sourceRoot: (0, _stryke_path_join_paths.joinPaths)(context.config.root, "src"),
105
- projectRoot: context.config.root,
106
- outputPath: (0, _stryke_path.relativePath)(context.config.root, context.config.output.path) || "dist",
107
- platform: context.config.platform,
108
- external: context.builtins.reduce((ret, id) => {
109
- if (!ret.includes(id)) ret.push(id);
110
- return ret;
111
- }, context.config.resolve.external ?? []),
112
- loaders: [unbuildLoader(context)],
113
- jiti: {
114
- interopDefault: true,
115
- fsCache: (0, _stryke_path_join_paths.joinPaths)(context.envPaths.cache, "jiti"),
116
- moduleCache: true
117
- },
118
- rollup: (0, _powerlines_plugin_rollup_helpers_resolve_options.resolveOptions)(context),
119
- debug: context.config.mode === "development",
120
- minify: context.config.mode !== "development",
121
- sourcemap: context.config.mode === "development"
122
- }, DEFAULT_UNBUILD_CONFIG);
123
- }
124
-
125
- //#endregion
126
- exports.DEFAULT_UNBUILD_CONFIG = DEFAULT_UNBUILD_CONFIG;
127
- exports.resolveOptions = resolveOptions;
128
- exports.unbuildLoader = unbuildLoader;
@@ -1,17 +0,0 @@
1
- import { Context } from "@powerlines/core";
2
- import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
3
- import { Loader, UnbuildOptions } from "@storm-software/unbuild/types";
4
-
5
- //#region src/helpers/resolve-options.d.ts
6
- declare const DEFAULT_UNBUILD_CONFIG: Partial<UnbuildOptions>;
7
- declare const unbuildLoader: (context: UNSAFE_PluginContext) => Loader;
8
- /**
9
- * Extracts the unbuild configuration from the context.
10
- *
11
- * @param context - The build context.
12
- * @returns The resolved unbuild configuration.
13
- */
14
- declare function resolveOptions(context: Context): UnbuildOptions;
15
- //#endregion
16
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
17
- //# sourceMappingURL=resolve-options.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.d.cts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;cAmCa,sBAAA,EAqBR,OAAA,CAAQ,cAAA;AAAA,cAEA,aAAA,GAAiB,OAAA,EAAS,oBAAA,KAAuB,MAAA;AAvB9D;;;;;AAuBA;AAvBA,iBAiJgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,cAAA"}
@@ -1,17 +0,0 @@
1
- import { Context } from "@powerlines/core";
2
- import { UNSAFE_PluginContext } from "@powerlines/core/types/_internal";
3
- import { Loader, UnbuildOptions } from "@storm-software/unbuild/types";
4
-
5
- //#region src/helpers/resolve-options.d.ts
6
- declare const DEFAULT_UNBUILD_CONFIG: Partial<UnbuildOptions>;
7
- declare const unbuildLoader: (context: UNSAFE_PluginContext) => Loader;
8
- /**
9
- * Extracts the unbuild configuration from the context.
10
- *
11
- * @param context - The build context.
12
- * @returns The resolved unbuild configuration.
13
- */
14
- declare function resolveOptions(context: Context): UnbuildOptions;
15
- //#endregion
16
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
17
- //# sourceMappingURL=resolve-options.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.d.mts","names":[],"sources":["../../src/helpers/resolve-options.ts"],"mappings":";;;;;cAmCa,sBAAA,EAqBR,OAAA,CAAQ,cAAA;AAAA,cAEA,aAAA,GAAiB,OAAA,EAAS,oBAAA,KAAuB,MAAA;AAvB9D;;;;;AAuBA;AAvBA,iBAiJgB,cAAA,CAAe,OAAA,EAAS,OAAA,GAAU,cAAA"}
@@ -1,124 +0,0 @@
1
- import { getString } from "@powerlines/core/lib/utilities/source-file";
2
- import { resolveOptions as resolveOptions$1 } from "@powerlines/plugin-rollup/helpers/resolve-options";
3
- import { relativePath } from "@stryke/path";
4
- import { joinPaths } from "@stryke/path/join-paths";
5
- import { isObject } from "@stryke/type-checks/is-object";
6
- import defu from "defu";
7
- import { transform } from "esbuild";
8
-
9
- //#region src/helpers/resolve-options.ts
10
- const DEFAULT_UNBUILD_CONFIG = {
11
- dts: true,
12
- clean: false,
13
- includeSrc: false,
14
- treeShaking: true,
15
- splitting: true,
16
- stub: false,
17
- watchOptions: {},
18
- outputPath: "dist",
19
- generatePackageJson: true,
20
- banner: " ",
21
- rollup: {
22
- dts: {},
23
- emitCJS: true,
24
- replace: {},
25
- resolve: {},
26
- json: {},
27
- esbuild: { target: "es2020" },
28
- commonjs: {},
29
- alias: {}
30
- }
31
- };
32
- const unbuildLoader = (context) => {
33
- return async (input, { options }) => {
34
- if (!/\.(?:c|m)?[jt]sx?$/.test(input.path) || /\.d\.[cm]?ts$/.test(input.path)) return;
35
- const output = [];
36
- let contents = await input.getContents();
37
- if (options.declaration && !input.srcPath?.match(/\.d\.[cm]?ts$/)) {
38
- const extension = `.d.${input.srcPath?.match(/(?<=\.)(?:c|m)(?=[jt]s$)/)?.[0] || ""}ts`;
39
- output.push({
40
- contents,
41
- srcPath: input.srcPath,
42
- path: input.path,
43
- extension,
44
- declaration: true
45
- });
46
- }
47
- let transformed = contents;
48
- let result = await context.$$internal.callHook("transform", {
49
- sequential: true,
50
- order: "pre"
51
- }, transformed, input.path);
52
- if (result) transformed = result;
53
- result = await context.$$internal.callHook("transform", {
54
- sequential: true,
55
- order: "normal"
56
- }, getString(transformed), input.path);
57
- if (result) transformed = result;
58
- result = await context.$$internal.callHook("transform", {
59
- sequential: true,
60
- order: "post"
61
- }, getString(transformed), input.path);
62
- if (result) transformed = result;
63
- if ([
64
- ".ts",
65
- ".mts",
66
- ".cts"
67
- ].includes(input.extension)) contents = await transform(getString(transformed), {
68
- ...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths")),
69
- loader: "ts"
70
- }).then((r) => r.code);
71
- else if ([".tsx", ".jsx"].includes(input.extension)) contents = await transform(getString(transformed), {
72
- loader: input.extension === ".tsx" ? "tsx" : "jsx",
73
- ...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths"))
74
- }).then((r) => r.code);
75
- const isCjs = options.format === "cjs";
76
- if (isCjs) contents = context.resolver.transform({
77
- source: contents,
78
- retainLines: false
79
- }).replace(/^exports.default = /gm, "module.exports = ").replace(/^var _default = exports.default = /gm, "module.exports = ").replace("module.exports = void 0;", "");
80
- let extension = isCjs ? ".js" : ".mjs";
81
- if (options.ext) extension = options.ext.startsWith(".") ? options.ext : `.${options.ext}`;
82
- output.push({
83
- contents,
84
- path: input.path,
85
- extension
86
- });
87
- return output;
88
- };
89
- };
90
- /**
91
- * Extracts the unbuild configuration from the context.
92
- *
93
- * @param context - The build context.
94
- * @returns The resolved unbuild configuration.
95
- */
96
- function resolveOptions(context) {
97
- return defu({ alias: context.alias }, context.config.unbuild ? context.config.unbuild : {}, {
98
- projectName: context.config.name,
99
- name: context.config.name,
100
- orgName: isObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
101
- sourceRoot: joinPaths(context.config.root, "src"),
102
- projectRoot: context.config.root,
103
- outputPath: relativePath(context.config.root, context.config.output.path) || "dist",
104
- platform: context.config.platform,
105
- external: context.builtins.reduce((ret, id) => {
106
- if (!ret.includes(id)) ret.push(id);
107
- return ret;
108
- }, context.config.resolve.external ?? []),
109
- loaders: [unbuildLoader(context)],
110
- jiti: {
111
- interopDefault: true,
112
- fsCache: joinPaths(context.envPaths.cache, "jiti"),
113
- moduleCache: true
114
- },
115
- rollup: resolveOptions$1(context),
116
- debug: context.config.mode === "development",
117
- minify: context.config.mode !== "development",
118
- sourcemap: context.config.mode === "development"
119
- }, DEFAULT_UNBUILD_CONFIG);
120
- }
121
-
122
- //#endregion
123
- export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
124
- //# sourceMappingURL=resolve-options.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"resolve-options.mjs","names":["resolveRollupOptions"],"sources":["../../src/helpers/resolve-options.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Context } from \"@powerlines/core\";\nimport { getString } from \"@powerlines/core/lib/utilities/source-file\";\nimport { UNSAFE_PluginContext } from \"@powerlines/core/types/_internal\";\nimport { resolveOptions as resolveRollupOptions } from \"@powerlines/plugin-rollup/helpers/resolve-options\";\nimport type {\n UnbuildOptions as ExternalUnbuildOptions,\n Loader,\n LoaderResult\n} from \"@storm-software/unbuild/types\";\nimport { relativePath } from \"@stryke/path\";\nimport { joinPaths } from \"@stryke/path/join-paths\";\nimport { isObject } from \"@stryke/type-checks/is-object\";\nimport defu from \"defu\";\nimport { transform } from \"esbuild\";\nimport { TransformResult } from \"unplugin\";\nimport { UnbuildPluginResolvedConfig } from \"../types\";\n\nexport const DEFAULT_UNBUILD_CONFIG = {\n dts: true,\n clean: false,\n includeSrc: false,\n treeShaking: true,\n splitting: true,\n stub: false,\n watchOptions: {},\n outputPath: \"dist\",\n generatePackageJson: true,\n banner: \" \",\n rollup: {\n dts: {},\n emitCJS: true,\n replace: {},\n resolve: {},\n json: {},\n esbuild: { target: \"es2020\" },\n commonjs: {},\n alias: {}\n }\n} as Partial<ExternalUnbuildOptions>;\n\nexport const unbuildLoader = (context: UNSAFE_PluginContext): Loader => {\n return async (input, { options }) => {\n if (\n !/\\.(?:c|m)?[jt]sx?$/.test(input.path) ||\n /\\.d\\.[cm]?ts$/.test(input.path)\n ) {\n return;\n }\n\n const output: LoaderResult = [];\n\n let contents = await input.getContents();\n\n // declaration\n if (options.declaration && !input.srcPath?.match(/\\.d\\.[cm]?ts$/)) {\n const cm = input.srcPath?.match(/(?<=\\.)(?:c|m)(?=[jt]s$)/)?.[0] || \"\";\n const extension = `.d.${cm}ts`;\n output.push({\n contents,\n srcPath: input.srcPath,\n path: input.path,\n extension,\n declaration: true\n });\n }\n\n let transformed: TransformResult | string = contents;\n\n let result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"pre\"\n },\n transformed,\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"normal\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n result = await context.$$internal.callHook(\n \"transform\",\n {\n sequential: true,\n order: \"post\"\n },\n getString(transformed),\n input.path\n );\n if (result) {\n transformed = result;\n }\n\n // typescript => js\n if ([\".ts\", \".mts\", \".cts\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n ),\n loader: \"ts\"\n }).then(r => r.code);\n } else if ([\".tsx\", \".jsx\"].includes(input.extension)) {\n contents = await transform(getString(transformed), {\n loader: input.extension === \".tsx\" ? \"tsx\" : \"jsx\",\n ...Object.fromEntries(\n Object.entries(options.esbuild ?? {}).filter(\n ([key]) => key !== \"absPaths\"\n )\n )\n }).then(r => r.code);\n }\n\n // esm => cjs\n const isCjs = options.format === \"cjs\";\n if (isCjs) {\n contents = context.resolver\n .transform({\n source: contents,\n retainLines: false\n })\n .replace(/^exports.default = /gm, \"module.exports = \")\n .replace(/^var _default = exports.default = /gm, \"module.exports = \")\n .replace(\"module.exports = void 0;\", \"\");\n }\n\n let extension = isCjs ? \".js\" : \".mjs\"; // TODO: Default to .cjs in next major version\n if (options.ext) {\n extension = options.ext.startsWith(\".\") ? options.ext : `.${options.ext}`;\n }\n\n output.push({\n contents,\n path: input.path,\n extension\n });\n\n return output;\n };\n};\n\n/**\n * Extracts the unbuild configuration from the context.\n *\n * @param context - The build context.\n * @returns The resolved unbuild configuration.\n */\nexport function resolveOptions(context: Context): ExternalUnbuildOptions {\n return defu(\n {\n alias: context.alias\n },\n (context.config as UnbuildPluginResolvedConfig).unbuild\n ? (context.config as UnbuildPluginResolvedConfig).unbuild\n : {},\n {\n projectName: context.config.name,\n name: context.config.name,\n orgName: isObject(context.workspaceConfig.organization)\n ? context.workspaceConfig.organization.name\n : context.workspaceConfig.organization,\n sourceRoot: joinPaths(context.config.root, \"src\"),\n projectRoot: context.config.root,\n outputPath:\n relativePath(context.config.root, context.config.output.path) || \"dist\",\n platform: context.config.platform,\n external: context.builtins.reduce((ret, id) => {\n if (!ret.includes(id)) {\n ret.push(id);\n }\n\n return ret;\n }, context.config.resolve.external ?? []),\n loaders: [unbuildLoader(context as UNSAFE_PluginContext)],\n jiti: {\n interopDefault: true,\n fsCache: joinPaths(context.envPaths.cache, \"jiti\"),\n moduleCache: true\n },\n rollup: resolveRollupOptions(context) as any,\n debug: context.config.mode === \"development\",\n minify: context.config.mode !== \"development\",\n sourcemap: context.config.mode === \"development\"\n },\n DEFAULT_UNBUILD_CONFIG\n );\n}\n"],"mappings":"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"}
package/dist/index.cjs DELETED
@@ -1,30 +0,0 @@
1
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: 'Module' } });
2
- const require_runtime = require('./_virtual/_rolldown/runtime.cjs');
3
- const require_helpers_resolve_options = require('./helpers/resolve-options.cjs');
4
- let _storm_software_unbuild = require("@storm-software/unbuild");
5
-
6
- //#region src/index.ts
7
- /**
8
- * A Powerlines plugin to build projects using Unbuild.
9
- */
10
- const plugin = (options = {}) => {
11
- return {
12
- name: "unbuild",
13
- config() {
14
- return {
15
- output: { format: ["esm"] },
16
- unbuild: {
17
- ...require_helpers_resolve_options.DEFAULT_UNBUILD_CONFIG,
18
- ...options
19
- }
20
- };
21
- },
22
- async build() {
23
- await (0, _storm_software_unbuild.build)(require_helpers_resolve_options.resolveOptions(this));
24
- }
25
- };
26
- };
27
-
28
- //#endregion
29
- exports.default = plugin;
30
- exports.plugin = plugin;
package/dist/index.d.cts DELETED
@@ -1,17 +0,0 @@
1
- import { UnbuildOptions, __ΩUnbuildOptions } from "./types/build.cjs";
2
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig } from "./types/plugin.cjs";
3
- import { Plugin } from "@powerlines/core";
4
-
5
- //#region src/index.d.ts
6
- declare module "@powerlines/core" {
7
- interface Config {
8
- unbuild?: UnbuildPluginOptions;
9
- }
10
- }
11
- /**
12
- * A Powerlines plugin to build projects using Unbuild.
13
- */
14
- declare const plugin: <TContext extends UnbuildPluginContext = UnbuildPluginContext>(options?: UnbuildPluginOptions) => Plugin<TContext>;
15
- //#endregion
16
- export { UnbuildOptions, UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildOptions, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig, plugin as default, plugin };
17
- //# sourceMappingURL=index.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAiCY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;cAOD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.d.mts DELETED
@@ -1,17 +0,0 @@
1
- import { UnbuildOptions, __ΩUnbuildOptions } from "./types/build.mjs";
2
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig } from "./types/plugin.mjs";
3
- import { Plugin } from "@powerlines/core";
4
-
5
- //#region src/index.d.ts
6
- declare module "@powerlines/core" {
7
- interface Config {
8
- unbuild?: UnbuildPluginOptions;
9
- }
10
- }
11
- /**
12
- * A Powerlines plugin to build projects using Unbuild.
13
- */
14
- declare const plugin: <TContext extends UnbuildPluginContext = UnbuildPluginContext>(options?: UnbuildPluginOptions) => Plugin<TContext>;
15
- //#endregion
16
- export { UnbuildOptions, UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildOptions, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig, plugin as default, plugin };
17
- //# sourceMappingURL=index.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"mappings":";;;;;;YAiCY,MAAA;IACR,OAAA,GAAU,oBAAA;EAAA;AAAA;;;;cAOD,MAAA,oBACM,oBAAA,GAAuB,oBAAA,EAExC,OAAA,GAAS,oBAAA,KACR,MAAA,CAAO,QAAA"}
package/dist/index.mjs DELETED
@@ -1,28 +0,0 @@
1
- import { DEFAULT_UNBUILD_CONFIG, resolveOptions } from "./helpers/resolve-options.mjs";
2
- import { build } from "@storm-software/unbuild";
3
-
4
- //#region src/index.ts
5
- /**
6
- * A Powerlines plugin to build projects using Unbuild.
7
- */
8
- const plugin = (options = {}) => {
9
- return {
10
- name: "unbuild",
11
- config() {
12
- return {
13
- output: { format: ["esm"] },
14
- unbuild: {
15
- ...DEFAULT_UNBUILD_CONFIG,
16
- ...options
17
- }
18
- };
19
- },
20
- async build() {
21
- await build(resolveOptions(this));
22
- }
23
- };
24
- };
25
-
26
- //#endregion
27
- export { plugin as default, plugin };
28
- //# sourceMappingURL=index.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/index.ts"],"sourcesContent":["/* -------------------------------------------------------------------\n\n ⚡ Storm Software - Powerlines\n\n This code was released as part of the Powerlines project. Powerlines\n is maintained by Storm Software under the Apache-2.0 license, and is\n free for commercial and private use. For more information, please visit\n our licensing page at https://stormsoftware.com/licenses/projects/powerlines.\n\n Website: https://stormsoftware.com\n Repository: https://github.com/storm-software/powerlines\n Documentation: https://docs.stormsoftware.com/projects/powerlines\n Contact: https://stormsoftware.com/contact\n\n SPDX-License-Identifier: Apache-2.0\n\n ------------------------------------------------------------------- */\n\nimport { Plugin } from \"@powerlines/core\";\nimport { build } from \"@storm-software/unbuild\";\nimport {\n DEFAULT_UNBUILD_CONFIG,\n resolveOptions\n} from \"./helpers/resolve-options\";\nimport {\n UnbuildPluginContext,\n UnbuildPluginOptions,\n UnbuildPluginResolvedConfig\n} from \"./types/plugin\";\n\nexport * from \"./types\";\n\ndeclare module \"@powerlines/core\" {\n interface Config {\n unbuild?: UnbuildPluginOptions;\n }\n}\n\n/**\n * A Powerlines plugin to build projects using Unbuild.\n */\nexport const plugin = <\n TContext extends UnbuildPluginContext = UnbuildPluginContext\n>(\n options: UnbuildPluginOptions = {}\n): Plugin<TContext> => {\n return {\n name: \"unbuild\",\n config() {\n return {\n output: {\n format: [\"esm\"]\n },\n unbuild: {\n ...DEFAULT_UNBUILD_CONFIG,\n ...options\n }\n } as Partial<UnbuildPluginResolvedConfig>;\n },\n async build() {\n await build(resolveOptions(this));\n }\n };\n};\n\nexport default plugin;\n"],"mappings":";;;;;;;AAyCA,MAAa,UAGX,UAAgC,EAAE,KACb;AACrB,QAAO;EACL,MAAM;EACN,SAAS;AACP,UAAO;IACL,QAAQ,EACN,QAAQ,CAAC,MAAM,EAChB;IACD,SAAS;KACP,GAAG;KACH,GAAG;KACJ;IACF;;EAEH,MAAM,QAAQ;AACZ,SAAM,MAAM,eAAe,KAAK,CAAC;;EAEpC"}
File without changes
@@ -1,8 +0,0 @@
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.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.cts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,OAAA,CAC3B,IAAA,CACE,gBAAA;AAAA"}
@@ -1,8 +0,0 @@
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
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.d.mts","names":[],"sources":["../../src/types/build.ts"],"mappings":";;;KAoBY,cAAA,GAAiB,OAAA,CAC3B,IAAA,CACE,gBAAA;AAAA"}
@@ -1 +0,0 @@
1
- export { };
File without changes
@@ -1,3 +0,0 @@
1
- import { UnbuildOptions, __ΩUnbuildOptions } from "./build.cjs";
2
- import { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig } from "./plugin.cjs";
3
- export { UnbuildOptions, UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildOptions, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig };
@@ -1,3 +0,0 @@
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 +0,0 @@
1
- export { };
File without changes
@@ -1,19 +0,0 @@
1
- import { UnbuildOptions } from "./build.cjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
-
4
- //#region src/types/plugin.d.ts
5
- type UnbuildPluginOptions = Partial<UnbuildOptions>;
6
- interface UnbuildPluginUserConfig extends UserConfig {
7
- unbuild?: UnbuildPluginOptions;
8
- }
9
- interface UnbuildPluginResolvedConfig extends ResolvedConfig {
10
- unbuild: UnbuildOptions;
11
- }
12
- type UnbuildPluginContext<TResolvedConfig extends UnbuildPluginResolvedConfig = UnbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
- declare type __ΩUnbuildPluginOptions = any[];
14
- declare type __ΩUnbuildPluginUserConfig = any[];
15
- declare type __ΩUnbuildPluginResolvedConfig = any[];
16
- declare type __ΩUnbuildPluginContext = any[];
17
- //#endregion
18
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig };
19
- //# sourceMappingURL=plugin.d.cts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.cts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,UAGK,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1,19 +0,0 @@
1
- import { UnbuildOptions } from "./build.mjs";
2
- import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core";
3
-
4
- //#region src/types/plugin.d.ts
5
- type UnbuildPluginOptions = Partial<UnbuildOptions>;
6
- interface UnbuildPluginUserConfig extends UserConfig {
7
- unbuild?: UnbuildPluginOptions;
8
- }
9
- interface UnbuildPluginResolvedConfig extends ResolvedConfig {
10
- unbuild: UnbuildOptions;
11
- }
12
- type UnbuildPluginContext<TResolvedConfig extends UnbuildPluginResolvedConfig = UnbuildPluginResolvedConfig> = PluginContext<TResolvedConfig>;
13
- declare type __ΩUnbuildPluginOptions = any[];
14
- declare type __ΩUnbuildPluginUserConfig = any[];
15
- declare type __ΩUnbuildPluginResolvedConfig = any[];
16
- declare type __ΩUnbuildPluginContext = any[];
17
- //#endregion
18
- export { UnbuildPluginContext, UnbuildPluginOptions, UnbuildPluginResolvedConfig, UnbuildPluginUserConfig, __ΩUnbuildPluginContext, __ΩUnbuildPluginOptions, __ΩUnbuildPluginResolvedConfig, __ΩUnbuildPluginUserConfig };
19
- //# sourceMappingURL=plugin.d.mts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"plugin.d.mts","names":[],"sources":["../../src/types/plugin.ts"],"mappings":";;;;KAqBY,oBAAA,GAAuB,OAAA,CAAQ,cAAA;AAAA,UAE1B,uBAAA,SAAgC,UAAA;EAC/C,OAAA,GAAU,oBAAA;AAAA;AAAA,UAGK,2BAAA,SAAoC,cAAA;EACnD,OAAA,EAAS,cAAA;AAAA;AAAA,KAGC,oBAAA,yBACc,2BAAA,GACtB,2BAAA,IACA,aAAA,CAAc,eAAA;AAAA"}
@@ -1 +0,0 @@
1
- export { };