@powerlines/plugin-unbuild 0.5.308 → 0.5.310
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-BGmzCfG9.d.mts +8 -0
- package/dist/build-BGmzCfG9.d.mts.map +1 -0
- package/dist/build-CcJjLdFm.mjs +1 -0
- package/dist/build-D-HKMVs4.d.cts +8 -0
- package/dist/build-D-HKMVs4.d.cts.map +1 -0
- package/dist/build-MNonspIb.cjs +0 -0
- package/dist/helpers/index.cjs +4 -4
- package/dist/helpers/index.d.cts +1 -1
- package/dist/helpers/index.d.mts +1 -1
- package/dist/helpers/index.mjs +1 -1
- package/dist/helpers/resolve-options.cjs +4 -125
- package/dist/helpers/resolve-options.d.cts +2 -17
- package/dist/helpers/resolve-options.d.mts +2 -18
- package/dist/helpers/resolve-options.mjs +2 -122
- package/dist/index-BR1oNnaF.d.cts +1 -0
- package/dist/index-DEHBdV_z.d.mts +1 -0
- package/dist/index.cjs +6 -4
- package/dist/index.d.cts +4 -4
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +4 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -1
- package/dist/index.mjs.map +1 -1
- package/dist/plugin-CXxxQ0lD.d.cts +19 -0
- package/dist/plugin-CXxxQ0lD.d.cts.map +1 -0
- package/dist/plugin-Dt6qEKIr.d.mts +19 -0
- package/dist/plugin-Dt6qEKIr.d.mts.map +1 -0
- package/dist/plugin-jZ9N9Mz-.mjs +1 -0
- package/dist/plugin-pBKbb5K9.cjs +0 -0
- package/dist/resolve-options-COWDeANr.cjs +173 -0
- package/dist/resolve-options-CpHtoivj.mjs +123 -0
- package/dist/resolve-options-CpHtoivj.mjs.map +1 -0
- package/dist/resolve-options-DPRrB4Qj.d.cts +17 -0
- package/dist/resolve-options-DPRrB4Qj.d.cts.map +1 -0
- package/dist/resolve-options-DRA_XDDs.d.mts +17 -0
- package/dist/resolve-options-DRA_XDDs.d.mts.map +1 -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-BtDR9wb1.mjs +1 -0
- package/dist/types-o3zWarRp.cjs +0 -0
- package/package.json +4 -4
- package/dist/_virtual/rolldown_runtime.cjs +0 -29
- 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/_internal.d.cts +0 -85
- package/dist/core/src/types/_internal.d.cts.map +0 -1
- package/dist/core/src/types/_internal.d.mts +0 -85
- package/dist/core/src/types/_internal.d.mts.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.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/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/plugin-rollup/src/helpers/resolve-options.cjs +0 -122
- package/dist/plugin-rollup/src/helpers/resolve-options.mjs +0 -116
- package/dist/plugin-rollup/src/helpers/resolve-options.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,8 @@
|
|
|
1
|
+
import { UnbuildOptions } from "@storm-software/unbuild/types";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type UnbuildOptions$1 = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">>;
|
|
5
|
+
declare type __ΩUnbuildOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { __ΩUnbuildOptions as n, UnbuildOptions$1 as t };
|
|
8
|
+
//# sourceMappingURL=build-BGmzCfG9.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-BGmzCfG9.d.mts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,gBAAA,GAAiB,QAC3B,KACE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { UnbuildOptions } from "@storm-software/unbuild/types";
|
|
2
|
+
|
|
3
|
+
//#region src/types/build.d.ts
|
|
4
|
+
type UnbuildOptions$1 = Partial<Omit<UnbuildOptions, "tsconfig" | "tsconfigRaw" | "assets" | "outputPath" | "mode" | "format" | "platform" | "projectRoot" | "env" | "entry" | "entryPoints">>;
|
|
5
|
+
declare type __ΩUnbuildOptions = any[];
|
|
6
|
+
//#endregion
|
|
7
|
+
export { __ΩUnbuildOptions as n, UnbuildOptions$1 as t };
|
|
8
|
+
//# sourceMappingURL=build-D-HKMVs4.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-D-HKMVs4.d.cts","names":[],"sources":["../src/types/build.ts"],"sourcesContent":[],"mappings":";;;KAoBY,gBAAA,GAAiB,QAC3B,KACE"}
|
|
File without changes
|
package/dist/helpers/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const
|
|
1
|
+
const require_resolve_options = require('../resolve-options-COWDeANr.cjs');
|
|
2
2
|
|
|
3
|
-
exports.DEFAULT_UNBUILD_CONFIG =
|
|
4
|
-
exports.resolveOptions =
|
|
5
|
-
exports.unbuildLoader =
|
|
3
|
+
exports.DEFAULT_UNBUILD_CONFIG = require_resolve_options.DEFAULT_UNBUILD_CONFIG;
|
|
4
|
+
exports.resolveOptions = require_resolve_options.resolveOptions;
|
|
5
|
+
exports.unbuildLoader = require_resolve_options.unbuildLoader;
|
package/dist/helpers/index.d.cts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-DPRrB4Qj.cjs";
|
|
2
2
|
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
package/dist/helpers/index.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-DRA_XDDs.mjs";
|
|
2
2
|
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
package/dist/helpers/index.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-CpHtoivj.mjs";
|
|
2
2
|
|
|
3
3
|
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
@@ -1,126 +1,5 @@
|
|
|
1
|
-
const
|
|
2
|
-
const require_source_file = require('../core/src/lib/utilities/source-file.cjs');
|
|
3
|
-
const require_resolve_options = require('../plugin-rollup/src/helpers/resolve-options.cjs');
|
|
4
|
-
let __stryke_path_join_paths = require("@stryke/path/join-paths");
|
|
5
|
-
let defu = require("defu");
|
|
6
|
-
defu = require_rolldown_runtime.__toESM(defu);
|
|
7
|
-
let __stryke_type_checks_is_object = require("@stryke/type-checks/is-object");
|
|
8
|
-
let esbuild = require("esbuild");
|
|
1
|
+
const require_resolve_options = require('../resolve-options-COWDeANr.cjs');
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
clean: false,
|
|
14
|
-
includeSrc: false,
|
|
15
|
-
treeShaking: true,
|
|
16
|
-
splitting: true,
|
|
17
|
-
stub: false,
|
|
18
|
-
watchOptions: {},
|
|
19
|
-
outputPath: "dist",
|
|
20
|
-
generatePackageJson: true,
|
|
21
|
-
banner: " ",
|
|
22
|
-
rollup: {
|
|
23
|
-
dts: {},
|
|
24
|
-
emitCJS: true,
|
|
25
|
-
replace: {},
|
|
26
|
-
resolve: {},
|
|
27
|
-
json: {},
|
|
28
|
-
esbuild: { target: "es2020" },
|
|
29
|
-
commonjs: {},
|
|
30
|
-
alias: {}
|
|
31
|
-
}
|
|
32
|
-
};
|
|
33
|
-
const unbuildLoader = (context) => {
|
|
34
|
-
return async (input, { options }) => {
|
|
35
|
-
if (!/\.(?:c|m)?[jt]sx?$/.test(input.path) || /\.d\.[cm]?ts$/.test(input.path)) return;
|
|
36
|
-
const output = [];
|
|
37
|
-
let contents = await input.getContents();
|
|
38
|
-
if (options.declaration && !input.srcPath?.match(/\.d\.[cm]?ts$/)) {
|
|
39
|
-
const extension$1 = `.d.${input.srcPath?.match(/(?<=\.)(?:c|m)(?=[jt]s$)/)?.[0] || ""}ts`;
|
|
40
|
-
output.push({
|
|
41
|
-
contents,
|
|
42
|
-
srcPath: input.srcPath,
|
|
43
|
-
path: input.path,
|
|
44
|
-
extension: extension$1,
|
|
45
|
-
declaration: true
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
let transformed = contents;
|
|
49
|
-
let result = await context.$$internal.callHook("transform", {
|
|
50
|
-
sequential: true,
|
|
51
|
-
order: "pre"
|
|
52
|
-
}, transformed, input.path);
|
|
53
|
-
if (result) transformed = result;
|
|
54
|
-
result = await context.$$internal.callHook("transform", {
|
|
55
|
-
sequential: true,
|
|
56
|
-
order: "normal"
|
|
57
|
-
}, require_source_file.getString(transformed), input.path);
|
|
58
|
-
if (result) transformed = result;
|
|
59
|
-
result = await context.$$internal.callHook("transform", {
|
|
60
|
-
sequential: true,
|
|
61
|
-
order: "post"
|
|
62
|
-
}, require_source_file.getString(transformed), input.path);
|
|
63
|
-
if (result) transformed = result;
|
|
64
|
-
if ([
|
|
65
|
-
".ts",
|
|
66
|
-
".mts",
|
|
67
|
-
".cts"
|
|
68
|
-
].includes(input.extension)) contents = await (0, esbuild.transform)(require_source_file.getString(transformed), {
|
|
69
|
-
...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths")),
|
|
70
|
-
loader: "ts"
|
|
71
|
-
}).then((r) => r.code);
|
|
72
|
-
else if ([".tsx", ".jsx"].includes(input.extension)) contents = await (0, esbuild.transform)(require_source_file.getString(transformed), {
|
|
73
|
-
loader: input.extension === ".tsx" ? "tsx" : "jsx",
|
|
74
|
-
...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths"))
|
|
75
|
-
}).then((r) => r.code);
|
|
76
|
-
const isCjs = options.format === "cjs";
|
|
77
|
-
if (isCjs) contents = context.resolver.transform({
|
|
78
|
-
source: contents,
|
|
79
|
-
retainLines: false
|
|
80
|
-
}).replace(/^exports.default = /gm, "module.exports = ").replace(/^var _default = exports.default = /gm, "module.exports = ").replace("module.exports = void 0;", "");
|
|
81
|
-
let extension = isCjs ? ".js" : ".mjs";
|
|
82
|
-
if (options.ext) extension = options.ext.startsWith(".") ? options.ext : `.${options.ext}`;
|
|
83
|
-
output.push({
|
|
84
|
-
contents,
|
|
85
|
-
path: input.path,
|
|
86
|
-
extension
|
|
87
|
-
});
|
|
88
|
-
return output;
|
|
89
|
-
};
|
|
90
|
-
};
|
|
91
|
-
/**
|
|
92
|
-
* Extracts the unbuild configuration from the context.
|
|
93
|
-
*
|
|
94
|
-
* @param context - The build context.
|
|
95
|
-
* @returns The resolved unbuild configuration.
|
|
96
|
-
*/
|
|
97
|
-
function resolveOptions(context) {
|
|
98
|
-
return (0, defu.default)({ alias: context.alias }, context.config.unbuild ? context.config.unbuild : {}, {
|
|
99
|
-
projectName: context.config.name,
|
|
100
|
-
name: context.config.name,
|
|
101
|
-
orgName: (0, __stryke_type_checks_is_object.isObject)(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
|
|
102
|
-
sourceRoot: (0, __stryke_path_join_paths.joinPaths)(context.config.root, "src"),
|
|
103
|
-
projectRoot: context.config.root,
|
|
104
|
-
outputPath: context.config.output.buildPath || "dist",
|
|
105
|
-
platform: context.config.platform,
|
|
106
|
-
external: context.builtins.reduce((ret, id) => {
|
|
107
|
-
if (!ret.includes(id)) ret.push(id);
|
|
108
|
-
return ret;
|
|
109
|
-
}, context.config.resolve.external ?? []),
|
|
110
|
-
loaders: [unbuildLoader(context)],
|
|
111
|
-
jiti: {
|
|
112
|
-
interopDefault: true,
|
|
113
|
-
fsCache: (0, __stryke_path_join_paths.joinPaths)(context.envPaths.cache, "jiti"),
|
|
114
|
-
moduleCache: true
|
|
115
|
-
},
|
|
116
|
-
rollup: require_resolve_options.resolveOptions(context),
|
|
117
|
-
debug: context.config.mode === "development",
|
|
118
|
-
minify: context.config.mode !== "development",
|
|
119
|
-
sourcemap: context.config.mode === "development"
|
|
120
|
-
}, DEFAULT_UNBUILD_CONFIG);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
//#endregion
|
|
124
|
-
exports.DEFAULT_UNBUILD_CONFIG = DEFAULT_UNBUILD_CONFIG;
|
|
125
|
-
exports.resolveOptions = resolveOptions;
|
|
126
|
-
exports.unbuildLoader = unbuildLoader;
|
|
3
|
+
exports.DEFAULT_UNBUILD_CONFIG = require_resolve_options.DEFAULT_UNBUILD_CONFIG;
|
|
4
|
+
exports.resolveOptions = require_resolve_options.resolveOptions;
|
|
5
|
+
exports.unbuildLoader = require_resolve_options.unbuildLoader;
|
|
@@ -1,17 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
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
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-DPRrB4Qj.cjs";
|
|
2
|
+
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
@@ -1,18 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
import { UNSAFE_PluginContext } from "../core/src/types/_internal.mjs";
|
|
4
|
-
import { Loader, UnbuildOptions } from "@storm-software/unbuild/types";
|
|
5
|
-
|
|
6
|
-
//#region src/helpers/resolve-options.d.ts
|
|
7
|
-
declare const DEFAULT_UNBUILD_CONFIG: Partial<UnbuildOptions>;
|
|
8
|
-
declare const unbuildLoader: (context: UNSAFE_PluginContext) => Loader;
|
|
9
|
-
/**
|
|
10
|
-
* Extracts the unbuild configuration from the context.
|
|
11
|
-
*
|
|
12
|
-
* @param context - The build context.
|
|
13
|
-
* @returns The resolved unbuild configuration.
|
|
14
|
-
*/
|
|
15
|
-
declare function resolveOptions(context: Context): UnbuildOptions;
|
|
16
|
-
//#endregion
|
|
17
|
-
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
18
|
-
//# sourceMappingURL=resolve-options.d.mts.map
|
|
1
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-DRA_XDDs.mjs";
|
|
2
|
+
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
@@ -1,123 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { resolveOptions as resolveOptions$1 } from "../plugin-rollup/src/helpers/resolve-options.mjs";
|
|
3
|
-
import { joinPaths } from "@stryke/path/join-paths";
|
|
4
|
-
import defu from "defu";
|
|
5
|
-
import { isObject } from "@stryke/type-checks/is-object";
|
|
6
|
-
import { transform } from "esbuild";
|
|
1
|
+
import { n as resolveOptions, r as unbuildLoader, t as DEFAULT_UNBUILD_CONFIG } from "../resolve-options-CpHtoivj.mjs";
|
|
7
2
|
|
|
8
|
-
|
|
9
|
-
const DEFAULT_UNBUILD_CONFIG = {
|
|
10
|
-
dts: true,
|
|
11
|
-
clean: false,
|
|
12
|
-
includeSrc: false,
|
|
13
|
-
treeShaking: true,
|
|
14
|
-
splitting: true,
|
|
15
|
-
stub: false,
|
|
16
|
-
watchOptions: {},
|
|
17
|
-
outputPath: "dist",
|
|
18
|
-
generatePackageJson: true,
|
|
19
|
-
banner: " ",
|
|
20
|
-
rollup: {
|
|
21
|
-
dts: {},
|
|
22
|
-
emitCJS: true,
|
|
23
|
-
replace: {},
|
|
24
|
-
resolve: {},
|
|
25
|
-
json: {},
|
|
26
|
-
esbuild: { target: "es2020" },
|
|
27
|
-
commonjs: {},
|
|
28
|
-
alias: {}
|
|
29
|
-
}
|
|
30
|
-
};
|
|
31
|
-
const unbuildLoader = (context) => {
|
|
32
|
-
return async (input, { options }) => {
|
|
33
|
-
if (!/\.(?:c|m)?[jt]sx?$/.test(input.path) || /\.d\.[cm]?ts$/.test(input.path)) return;
|
|
34
|
-
const output = [];
|
|
35
|
-
let contents = await input.getContents();
|
|
36
|
-
if (options.declaration && !input.srcPath?.match(/\.d\.[cm]?ts$/)) {
|
|
37
|
-
const extension$1 = `.d.${input.srcPath?.match(/(?<=\.)(?:c|m)(?=[jt]s$)/)?.[0] || ""}ts`;
|
|
38
|
-
output.push({
|
|
39
|
-
contents,
|
|
40
|
-
srcPath: input.srcPath,
|
|
41
|
-
path: input.path,
|
|
42
|
-
extension: extension$1,
|
|
43
|
-
declaration: true
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
let transformed = contents;
|
|
47
|
-
let result = await context.$$internal.callHook("transform", {
|
|
48
|
-
sequential: true,
|
|
49
|
-
order: "pre"
|
|
50
|
-
}, transformed, input.path);
|
|
51
|
-
if (result) transformed = result;
|
|
52
|
-
result = await context.$$internal.callHook("transform", {
|
|
53
|
-
sequential: true,
|
|
54
|
-
order: "normal"
|
|
55
|
-
}, getString(transformed), input.path);
|
|
56
|
-
if (result) transformed = result;
|
|
57
|
-
result = await context.$$internal.callHook("transform", {
|
|
58
|
-
sequential: true,
|
|
59
|
-
order: "post"
|
|
60
|
-
}, getString(transformed), input.path);
|
|
61
|
-
if (result) transformed = result;
|
|
62
|
-
if ([
|
|
63
|
-
".ts",
|
|
64
|
-
".mts",
|
|
65
|
-
".cts"
|
|
66
|
-
].includes(input.extension)) contents = await transform(getString(transformed), {
|
|
67
|
-
...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths")),
|
|
68
|
-
loader: "ts"
|
|
69
|
-
}).then((r) => r.code);
|
|
70
|
-
else if ([".tsx", ".jsx"].includes(input.extension)) contents = await transform(getString(transformed), {
|
|
71
|
-
loader: input.extension === ".tsx" ? "tsx" : "jsx",
|
|
72
|
-
...Object.fromEntries(Object.entries(options.esbuild ?? {}).filter(([key]) => key !== "absPaths"))
|
|
73
|
-
}).then((r) => r.code);
|
|
74
|
-
const isCjs = options.format === "cjs";
|
|
75
|
-
if (isCjs) contents = context.resolver.transform({
|
|
76
|
-
source: contents,
|
|
77
|
-
retainLines: false
|
|
78
|
-
}).replace(/^exports.default = /gm, "module.exports = ").replace(/^var _default = exports.default = /gm, "module.exports = ").replace("module.exports = void 0;", "");
|
|
79
|
-
let extension = isCjs ? ".js" : ".mjs";
|
|
80
|
-
if (options.ext) extension = options.ext.startsWith(".") ? options.ext : `.${options.ext}`;
|
|
81
|
-
output.push({
|
|
82
|
-
contents,
|
|
83
|
-
path: input.path,
|
|
84
|
-
extension
|
|
85
|
-
});
|
|
86
|
-
return output;
|
|
87
|
-
};
|
|
88
|
-
};
|
|
89
|
-
/**
|
|
90
|
-
* Extracts the unbuild configuration from the context.
|
|
91
|
-
*
|
|
92
|
-
* @param context - The build context.
|
|
93
|
-
* @returns The resolved unbuild configuration.
|
|
94
|
-
*/
|
|
95
|
-
function resolveOptions(context) {
|
|
96
|
-
return defu({ alias: context.alias }, context.config.unbuild ? context.config.unbuild : {}, {
|
|
97
|
-
projectName: context.config.name,
|
|
98
|
-
name: context.config.name,
|
|
99
|
-
orgName: isObject(context.workspaceConfig.organization) ? context.workspaceConfig.organization.name : context.workspaceConfig.organization,
|
|
100
|
-
sourceRoot: joinPaths(context.config.root, "src"),
|
|
101
|
-
projectRoot: context.config.root,
|
|
102
|
-
outputPath: context.config.output.buildPath || "dist",
|
|
103
|
-
platform: context.config.platform,
|
|
104
|
-
external: context.builtins.reduce((ret, id) => {
|
|
105
|
-
if (!ret.includes(id)) ret.push(id);
|
|
106
|
-
return ret;
|
|
107
|
-
}, context.config.resolve.external ?? []),
|
|
108
|
-
loaders: [unbuildLoader(context)],
|
|
109
|
-
jiti: {
|
|
110
|
-
interopDefault: true,
|
|
111
|
-
fsCache: joinPaths(context.envPaths.cache, "jiti"),
|
|
112
|
-
moduleCache: true
|
|
113
|
-
},
|
|
114
|
-
rollup: resolveOptions$1(context),
|
|
115
|
-
debug: context.config.mode === "development",
|
|
116
|
-
minify: context.config.mode !== "development",
|
|
117
|
-
sourcemap: context.config.mode === "development"
|
|
118
|
-
}, DEFAULT_UNBUILD_CONFIG);
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
//#endregion
|
|
122
|
-
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
123
|
-
//# sourceMappingURL=resolve-options.mjs.map
|
|
3
|
+
export { DEFAULT_UNBUILD_CONFIG, resolveOptions, unbuildLoader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2
|
-
const
|
|
3
|
-
|
|
2
|
+
const require_resolve_options = require('./resolve-options-COWDeANr.cjs');
|
|
3
|
+
require('./build-MNonspIb.cjs');
|
|
4
|
+
require('./plugin-pBKbb5K9.cjs');
|
|
5
|
+
require('./types-o3zWarRp.cjs');
|
|
4
6
|
let __storm_software_unbuild = require("@storm-software/unbuild");
|
|
5
7
|
|
|
6
8
|
//#region src/index.ts
|
|
@@ -14,13 +16,13 @@ const plugin = (options = {}) => {
|
|
|
14
16
|
return {
|
|
15
17
|
output: { format: ["esm"] },
|
|
16
18
|
unbuild: {
|
|
17
|
-
...
|
|
19
|
+
...require_resolve_options.DEFAULT_UNBUILD_CONFIG,
|
|
18
20
|
...options
|
|
19
21
|
}
|
|
20
22
|
};
|
|
21
23
|
},
|
|
22
24
|
async build() {
|
|
23
|
-
await (0, __storm_software_unbuild.build)(
|
|
25
|
+
await (0, __storm_software_unbuild.build)(require_resolve_options.resolveOptions(this));
|
|
24
26
|
}
|
|
25
27
|
};
|
|
26
28
|
};
|
package/dist/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
1
|
+
import { n as __ΩUnbuildOptions, t as UnbuildOptions } from "./build-D-HKMVs4.cjs";
|
|
2
|
+
import { a as __ΩUnbuildPluginContext, c as __ΩUnbuildPluginUserConfig, i as UnbuildPluginUserConfig, n as UnbuildPluginOptions, o as __ΩUnbuildPluginOptions, r as UnbuildPluginResolvedConfig, s as __ΩUnbuildPluginResolvedConfig, t as UnbuildPluginContext } from "./plugin-CXxxQ0lD.cjs";
|
|
3
|
+
import "./index-BR1oNnaF.cjs";
|
|
4
|
+
import { Plugin } from "@powerlines/core/types";
|
|
4
5
|
|
|
5
6
|
//#region src/index.d.ts
|
|
6
|
-
|
|
7
7
|
/**
|
|
8
8
|
* A Powerlines plugin to build projects using Unbuild.
|
|
9
9
|
*/
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAmCa,cAAA,MAsBZ,EAAA,CAAA,iBArBkB,oBAqBlB,GArByC,oBAqBzC,CAAA,CAAA,OAAA,CAAA,EAnBU,oBAmBV,EAAA,GAlBE,MAkBF,CAlBS,QAkBT,CAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import "./
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import "./types/index.mjs";
|
|
1
|
+
import { n as __ΩUnbuildOptions, t as UnbuildOptions } from "./build-BGmzCfG9.mjs";
|
|
2
|
+
import { a as __ΩUnbuildPluginContext, c as __ΩUnbuildPluginUserConfig, i as UnbuildPluginUserConfig, n as UnbuildPluginOptions, o as __ΩUnbuildPluginOptions, r as UnbuildPluginResolvedConfig, s as __ΩUnbuildPluginResolvedConfig, t as UnbuildPluginContext } from "./plugin-Dt6qEKIr.mjs";
|
|
3
|
+
import "./index-DEHBdV_z.mjs";
|
|
4
|
+
import { Plugin } from "@powerlines/core/types";
|
|
6
5
|
|
|
7
6
|
//#region src/index.d.ts
|
|
8
7
|
/**
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/index.ts"],"sourcesContent":[],"mappings":";;;;;;;;;AAmCa,cAAA,MAsBZ,EAAA,CAAA,iBArBkB,oBAqBlB,GArByC,oBAqBzC,CAAA,CAAA,OAAA,CAAA,EAnBU,oBAmBV,EAAA,GAlBE,MAkBF,CAlBS,QAkBT,CAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { n as resolveOptions, t as DEFAULT_UNBUILD_CONFIG } from "./resolve-options-CpHtoivj.mjs";
|
|
2
|
+
import "./build-CcJjLdFm.mjs";
|
|
3
|
+
import "./plugin-jZ9N9Mz-.mjs";
|
|
4
|
+
import "./types-BtDR9wb1.mjs";
|
|
2
5
|
import { build } from "@storm-software/unbuild";
|
|
3
6
|
|
|
4
7
|
//#region src/index.ts
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
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/types\";\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\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":"
|
|
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/types\";\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\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":";;;;;;;;;;AAmCA,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;;AAGH,kBAAe"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as UnbuildOptions } from "./build-D-HKMVs4.cjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
|
|
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 as a, __ΩUnbuildPluginUserConfig as c, UnbuildPluginUserConfig as i, UnbuildPluginOptions as n, __ΩUnbuildPluginOptions as o, UnbuildPluginResolvedConfig as r, __ΩUnbuildPluginResolvedConfig as s, UnbuildPluginContext as t };
|
|
19
|
+
//# sourceMappingURL=plugin-CXxxQ0lD.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-CXxxQ0lD.d.cts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { t as UnbuildOptions } from "./build-BGmzCfG9.mjs";
|
|
2
|
+
import { PluginContext, ResolvedConfig, UserConfig } from "@powerlines/core/types";
|
|
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 as a, __ΩUnbuildPluginUserConfig as c, UnbuildPluginUserConfig as i, UnbuildPluginOptions as n, __ΩUnbuildPluginOptions as o, UnbuildPluginResolvedConfig as r, __ΩUnbuildPluginResolvedConfig as s, UnbuildPluginContext as t };
|
|
19
|
+
//# sourceMappingURL=plugin-Dt6qEKIr.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-Dt6qEKIr.d.mts","names":[],"sources":["../src/types/plugin.ts"],"sourcesContent":[],"mappings":";;;;KAyBY,oBAAA,GAAuB,QAAQ;UAE1B,uBAAA,SAAgC;EAFrC,OAAA,CAAA,EAGA,oBAHoB;AAEhC;AAIiB,UAAA,2BAAA,SAAoC,cAAA,CAAA;EAIzC,OAAA,EAHD,cAGqB;;AAE5B,KAFQ,oBAER,CAAA,wBADsB,2BACtB,GAAA,2BAAA,CAAA,GACA,aADA,CACc,eADd,CAAA;AACc,uCAAA,GAAA,EAAA;AAAd,0CAAA,GAAA,EAAA;AAAa,8CAAA,GAAA,EAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
File without changes
|