@storm-software/unbuild 0.22.0 → 0.23.1
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/README.md +1 -1
- package/bin/unbuild.js +9840 -3131
- package/bin/unbuild.mjs +9817 -3083
- package/dist/build.d.mts +1 -0
- package/dist/build.d.ts +1 -0
- package/dist/build.js +9 -10
- package/dist/build.mjs +8 -9
- package/dist/chunk-3TNHGERR.mjs +49 -0
- package/dist/{chunk-BIZYEBW3.mjs → chunk-4ENAOJ33.mjs} +4 -2
- package/dist/chunk-5A3XPRPO.js +29 -0
- package/dist/{chunk-AICX43E6.mjs → chunk-67M6JMGM.mjs} +6584 -145
- package/dist/chunk-7G3WYTPJ.js +6 -0
- package/dist/{chunk-OG2CKJQU.mjs → chunk-AQ2MDNLT.mjs} +5 -5
- package/dist/{chunk-IIVTCNH5.mjs → chunk-K7L2WB3G.mjs} +5 -6
- package/dist/{chunk-6KE6SIPQ.js → chunk-LYYHOUCS.js} +6 -6
- package/dist/chunk-NA6OVNJI.js +287 -0
- package/dist/chunk-NOVWJHZD.mjs +6 -0
- package/dist/{chunk-FDF3FMZP.mjs → chunk-OUDNDBMR.mjs} +5 -5
- package/dist/{chunk-RUNO4F6F.js → chunk-P6LWSWAQ.js} +4 -2
- package/dist/chunk-Q6WN55YR.mjs +287 -0
- package/dist/chunk-RBSVNX4W.js +49 -0
- package/dist/{chunk-BMAXMHJB.js → chunk-SLC5BBLC.js} +6 -6
- package/dist/chunk-T5JY3PDF.js +23 -0
- package/dist/{chunk-B2WY6JG2.js → chunk-TAHELANG.js} +7629 -1190
- package/dist/{chunk-T5NKX2EJ.mjs → chunk-XPX5NQ4D.mjs} +8 -6
- package/dist/clean.js +3 -4
- package/dist/clean.mjs +2 -3
- package/dist/config.d.mts +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +7 -8
- package/dist/config.mjs +6 -7
- package/dist/index.d.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +15 -11
- package/dist/index.mjs +14 -10
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.js +2 -2
- package/dist/types.mjs +2 -1
- package/package.json +190 -1
- package/dist/chunk-2Q67L63A.js +0 -2456
- package/dist/chunk-4WKFVYTI.js +0 -18
- package/dist/chunk-B5GGHMTB.mjs +0 -604
- package/dist/chunk-E73BVQF5.js +0 -24
- package/dist/chunk-ERHVDARL.mjs +0 -0
- package/dist/chunk-J5YBLOB7.js +0 -27
- package/dist/chunk-LPEX4YW6.mjs +0 -13
- package/dist/chunk-OULCUN6I.js +0 -1
- package/dist/chunk-SGIQJ2OU.mjs +0 -2455
- package/dist/chunk-UUI4UWA4.js +0 -604
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
import {
|
|
2
|
+
clean
|
|
3
|
+
} from "./chunk-K7L2WB3G.mjs";
|
|
4
|
+
import {
|
|
5
|
+
getDefaultBuildPlugins
|
|
6
|
+
} from "./chunk-XPX5NQ4D.mjs";
|
|
7
|
+
import {
|
|
8
|
+
loadConfig
|
|
9
|
+
} from "./chunk-67M6JMGM.mjs";
|
|
10
|
+
import {
|
|
11
|
+
__name,
|
|
12
|
+
init_esm_shims
|
|
13
|
+
} from "./chunk-3TNHGERR.mjs";
|
|
14
|
+
|
|
15
|
+
// src/build.ts
|
|
16
|
+
init_esm_shims();
|
|
17
|
+
import { readCachedProjectGraph, writeJsonFile } from "@nx/devkit";
|
|
18
|
+
import { getHelperDependency, HelperDependency } from "@nx/js";
|
|
19
|
+
import { calculateProjectBuildableDependencies } from "@nx/js/src/utils/buildable-libs-utils";
|
|
20
|
+
import { addPackageDependencies, addPackageJsonExports, addWorkspacePackageJsonFields, copyAssets } from "@storm-software/build-tools";
|
|
21
|
+
import { loadStormConfig } from "@storm-software/config-tools/create-storm-config";
|
|
22
|
+
import { getStopwatch, writeDebug, writeError, writeFatal, writeSuccess, writeTrace } from "@storm-software/config-tools/logger/console";
|
|
23
|
+
import { isVerbose } from "@storm-software/config-tools/logger/get-log-level";
|
|
24
|
+
import { LogLevelLabel } from "@storm-software/config-tools/types";
|
|
25
|
+
import { joinPaths } from "@storm-software/config-tools/utilities/correct-paths";
|
|
26
|
+
import defu from "defu";
|
|
27
|
+
import { createJiti } from "jiti";
|
|
28
|
+
import { existsSync } from "node:fs";
|
|
29
|
+
import { readFile } from "node:fs/promises";
|
|
30
|
+
import { relative } from "node:path";
|
|
31
|
+
import { findWorkspaceRoot } from "nx/src/utils/find-workspace-root";
|
|
32
|
+
async function resolveOptions(options) {
|
|
33
|
+
const projectRoot = options.projectRoot;
|
|
34
|
+
if (!projectRoot) {
|
|
35
|
+
throw new Error("Cannot find project root");
|
|
36
|
+
}
|
|
37
|
+
const outputPath = options.outputPath || joinPaths("dist", projectRoot);
|
|
38
|
+
const workspaceRoot = findWorkspaceRoot(projectRoot);
|
|
39
|
+
if (!workspaceRoot) {
|
|
40
|
+
throw new Error("Cannot find workspace root");
|
|
41
|
+
}
|
|
42
|
+
const config = await loadStormConfig(workspaceRoot.dir);
|
|
43
|
+
writeDebug(" \u2699\uFE0F Resolving build options", config);
|
|
44
|
+
const stopwatch = getStopwatch("Build options resolution");
|
|
45
|
+
if (options.configPath) {
|
|
46
|
+
const configFile = await loadConfig(options.configPath);
|
|
47
|
+
if (configFile) {
|
|
48
|
+
options = defu(options, configFile);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
const projectGraph = readCachedProjectGraph();
|
|
52
|
+
const projectJsonPath = joinPaths(config.workspaceRoot, projectRoot, "project.json");
|
|
53
|
+
if (!existsSync(projectJsonPath)) {
|
|
54
|
+
throw new Error("Cannot find project.json configuration");
|
|
55
|
+
}
|
|
56
|
+
const projectJsonContent = await readFile(projectJsonPath, "utf8");
|
|
57
|
+
const projectJson = JSON.parse(projectJsonContent);
|
|
58
|
+
const projectName = projectJson.name;
|
|
59
|
+
const packageJsonPath = joinPaths(workspaceRoot.dir, projectRoot, "package.json");
|
|
60
|
+
if (!existsSync(packageJsonPath)) {
|
|
61
|
+
throw new Error("Cannot find package.json configuration");
|
|
62
|
+
}
|
|
63
|
+
const packageJsonContent = await readFile(packageJsonPath, "utf8");
|
|
64
|
+
const packageJson = JSON.parse(packageJsonContent);
|
|
65
|
+
let tsconfig = options.tsconfig;
|
|
66
|
+
if (!tsconfig) {
|
|
67
|
+
tsconfig = joinPaths(workspaceRoot.dir, projectRoot, "tsconfig.json");
|
|
68
|
+
}
|
|
69
|
+
if (!existsSync(tsconfig)) {
|
|
70
|
+
throw new Error("Cannot find tsconfig.json configuration");
|
|
71
|
+
}
|
|
72
|
+
let sourceRoot = projectJson.sourceRoot;
|
|
73
|
+
if (!sourceRoot) {
|
|
74
|
+
sourceRoot = joinPaths(projectRoot, "src");
|
|
75
|
+
}
|
|
76
|
+
if (!existsSync(sourceRoot)) {
|
|
77
|
+
throw new Error("Cannot find sourceRoot directory");
|
|
78
|
+
}
|
|
79
|
+
const result = calculateProjectBuildableDependencies(void 0, projectGraph, workspaceRoot.dir, projectName, process.env.NX_TASK_TARGET_TARGET || "build", process.env.NX_TASK_TARGET_CONFIGURATION || "production", true);
|
|
80
|
+
let dependencies = result.dependencies;
|
|
81
|
+
const tsLibDependency = getHelperDependency(HelperDependency.tsc, tsconfig, dependencies, projectGraph, true);
|
|
82
|
+
if (tsLibDependency) {
|
|
83
|
+
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
84
|
+
dependencies.push(tsLibDependency);
|
|
85
|
+
}
|
|
86
|
+
const jiti = createJiti(config.workspaceRoot, {
|
|
87
|
+
fsCache: config.skipCache ? false : joinPaths(config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
88
|
+
interopDefault: true
|
|
89
|
+
});
|
|
90
|
+
const resolvedOptions = {
|
|
91
|
+
name: projectName,
|
|
92
|
+
config,
|
|
93
|
+
projectRoot,
|
|
94
|
+
sourceRoot,
|
|
95
|
+
projectName,
|
|
96
|
+
tsconfig,
|
|
97
|
+
jiti,
|
|
98
|
+
clean: false,
|
|
99
|
+
entries: [
|
|
100
|
+
{
|
|
101
|
+
builder: "mkdist",
|
|
102
|
+
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
103
|
+
outDir: joinPaths(relative(joinPaths(config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
104
|
+
declaration: options.emitTypes !== false,
|
|
105
|
+
format: "esm"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
builder: "mkdist",
|
|
109
|
+
input: `.${sourceRoot.replace(projectRoot, "")}`,
|
|
110
|
+
outDir: joinPaths(relative(joinPaths(config.workspaceRoot, projectRoot), config.workspaceRoot).replaceAll("\\", "/"), outputPath, "dist").replaceAll("\\", "/"),
|
|
111
|
+
declaration: options.emitTypes !== false,
|
|
112
|
+
format: "cjs",
|
|
113
|
+
ext: "cjs"
|
|
114
|
+
}
|
|
115
|
+
],
|
|
116
|
+
declaration: options.emitTypes !== false ? "compatible" : false,
|
|
117
|
+
failOnWarn: false,
|
|
118
|
+
sourcemap: options.sourcemap ?? !!options.debug,
|
|
119
|
+
outDir: outputPath,
|
|
120
|
+
parallel: true,
|
|
121
|
+
stub: false,
|
|
122
|
+
stubOptions: {
|
|
123
|
+
jiti: {}
|
|
124
|
+
},
|
|
125
|
+
externals: options.external ?? [],
|
|
126
|
+
dependencies: [],
|
|
127
|
+
peerDependencies: [],
|
|
128
|
+
devDependencies: [],
|
|
129
|
+
hooks: {},
|
|
130
|
+
alias: {},
|
|
131
|
+
replace: {},
|
|
132
|
+
rollup: {
|
|
133
|
+
replace: {},
|
|
134
|
+
alias: {},
|
|
135
|
+
json: {},
|
|
136
|
+
commonjs: {
|
|
137
|
+
sourceMap: options.sourcemap ?? true
|
|
138
|
+
},
|
|
139
|
+
emitCJS: true,
|
|
140
|
+
cjsBridge: true,
|
|
141
|
+
dts: {
|
|
142
|
+
respectExternal: true,
|
|
143
|
+
tsconfig
|
|
144
|
+
},
|
|
145
|
+
output: {
|
|
146
|
+
banner: options.banner || `
|
|
147
|
+
// \u26A1 Built by Storm Software
|
|
148
|
+
`,
|
|
149
|
+
footer: options.footer
|
|
150
|
+
},
|
|
151
|
+
resolve: {
|
|
152
|
+
preferBuiltins: true,
|
|
153
|
+
extensions: [
|
|
154
|
+
".cjs",
|
|
155
|
+
".mjs",
|
|
156
|
+
".js",
|
|
157
|
+
".jsx",
|
|
158
|
+
".ts",
|
|
159
|
+
".tsx",
|
|
160
|
+
".json"
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
esbuild: {
|
|
164
|
+
minify: options.minify !== false,
|
|
165
|
+
splitting: options.splitting !== false,
|
|
166
|
+
treeShaking: options.treeShaking !== false,
|
|
167
|
+
color: true,
|
|
168
|
+
logLevel: config.logLevel === LogLevelLabel.FATAL ? LogLevelLabel.ERROR : isVerbose() ? "verbose" : config.logLevel
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
dependencies = dependencies.filter((dep) => dep.node.type === "npm" || dep.node.type === "lib" || dep.node.type === "app");
|
|
173
|
+
if (dependencies.length > 0) {
|
|
174
|
+
resolvedOptions.dependencies = dependencies.map((dep) => dep.name);
|
|
175
|
+
}
|
|
176
|
+
if (packageJson.devDependencies) {
|
|
177
|
+
resolvedOptions.devDependencies = Object.keys(packageJson.devDependencies);
|
|
178
|
+
}
|
|
179
|
+
if (packageJson.peerDependencies) {
|
|
180
|
+
resolvedOptions.peerDependencies = Object.keys(packageJson.peerDependencies);
|
|
181
|
+
}
|
|
182
|
+
if (options.rollup) {
|
|
183
|
+
let rollup = {};
|
|
184
|
+
if (typeof options.rollup === "string") {
|
|
185
|
+
const rollupFile = await loadConfig(options.rollup);
|
|
186
|
+
if (rollupFile) {
|
|
187
|
+
rollup = rollupFile;
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
rollup = options.rollup;
|
|
191
|
+
}
|
|
192
|
+
resolvedOptions.rollup = defu(resolvedOptions.rollup ?? {}, rollup);
|
|
193
|
+
}
|
|
194
|
+
resolvedOptions.hooks = {
|
|
195
|
+
"rollup:options": /* @__PURE__ */ __name(async (ctx, opts) => {
|
|
196
|
+
opts.plugins = options.plugins ?? await getDefaultBuildPlugins(options, resolvedOptions);
|
|
197
|
+
}, "rollup:options")
|
|
198
|
+
};
|
|
199
|
+
stopwatch();
|
|
200
|
+
return resolvedOptions;
|
|
201
|
+
}
|
|
202
|
+
__name(resolveOptions, "resolveOptions");
|
|
203
|
+
async function generatePackageJson(options) {
|
|
204
|
+
if (options.generatePackageJson !== false && existsSync(joinPaths(options.projectRoot, "package.json"))) {
|
|
205
|
+
writeDebug(" \u270D\uFE0F Writing package.json file", options.config);
|
|
206
|
+
const stopwatch = getStopwatch("Write package.json file");
|
|
207
|
+
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
208
|
+
if (!existsSync(packageJsonPath)) {
|
|
209
|
+
throw new Error("Cannot find package.json configuration");
|
|
210
|
+
}
|
|
211
|
+
let packageJsonContent = await readFile(joinPaths(options.config.workspaceRoot, options.projectRoot, "package.json"), "utf8");
|
|
212
|
+
if (!packageJsonContent) {
|
|
213
|
+
throw new Error("Cannot find package.json configuration file");
|
|
214
|
+
}
|
|
215
|
+
let packageJson = JSON.parse(packageJsonContent);
|
|
216
|
+
packageJson = await addPackageDependencies(options.config.workspaceRoot, options.projectRoot, options.projectName, packageJson);
|
|
217
|
+
packageJson = await addWorkspacePackageJsonFields(options.config, options.projectRoot, options.sourceRoot, options.projectName, false, packageJson);
|
|
218
|
+
await writeJsonFile(joinPaths(options.outDir, "package.json"), await addPackageJsonExports(options.sourceRoot, packageJson));
|
|
219
|
+
stopwatch();
|
|
220
|
+
}
|
|
221
|
+
return options;
|
|
222
|
+
}
|
|
223
|
+
__name(generatePackageJson, "generatePackageJson");
|
|
224
|
+
async function resolveUnbuild(options) {
|
|
225
|
+
writeTrace(`Resolving Unbuild package with Jiti`, options.config);
|
|
226
|
+
try {
|
|
227
|
+
return options.jiti.import("unbuild");
|
|
228
|
+
} catch (error) {
|
|
229
|
+
writeError(" \u274C An error occurred while resolving the Unbuild package", options.config);
|
|
230
|
+
throw new Error("An error occurred while resolving the Unbuild package", {
|
|
231
|
+
cause: error
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
|
+
__name(resolveUnbuild, "resolveUnbuild");
|
|
236
|
+
async function executeUnbuild(options) {
|
|
237
|
+
writeDebug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
238
|
+
const stopwatch = getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
239
|
+
try {
|
|
240
|
+
const unbuild = await resolveUnbuild(options);
|
|
241
|
+
await unbuild.build(options.projectRoot, false, {
|
|
242
|
+
...options,
|
|
243
|
+
rootDir: options.projectRoot
|
|
244
|
+
});
|
|
245
|
+
} finally {
|
|
246
|
+
stopwatch();
|
|
247
|
+
}
|
|
248
|
+
return options;
|
|
249
|
+
}
|
|
250
|
+
__name(executeUnbuild, "executeUnbuild");
|
|
251
|
+
async function copyBuildAssets(options) {
|
|
252
|
+
writeDebug(` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`, options.config);
|
|
253
|
+
const stopwatch = getStopwatch(`${options.name} asset copy`);
|
|
254
|
+
await copyAssets(options.config, options.assets ?? [], options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
|
|
255
|
+
stopwatch();
|
|
256
|
+
return options;
|
|
257
|
+
}
|
|
258
|
+
__name(copyBuildAssets, "copyBuildAssets");
|
|
259
|
+
async function cleanOutputPath(options) {
|
|
260
|
+
if (options.clean !== false && options.outDir) {
|
|
261
|
+
await clean(options.name, options.outDir, options.config);
|
|
262
|
+
}
|
|
263
|
+
return options;
|
|
264
|
+
}
|
|
265
|
+
__name(cleanOutputPath, "cleanOutputPath");
|
|
266
|
+
async function build(options) {
|
|
267
|
+
writeDebug(` \u26A1 Executing Storm Unbuild pipeline`);
|
|
268
|
+
const stopwatch = getStopwatch("Unbuild pipeline");
|
|
269
|
+
try {
|
|
270
|
+
const resolvedOptions = await resolveOptions(options);
|
|
271
|
+
await cleanOutputPath(resolvedOptions);
|
|
272
|
+
await generatePackageJson(resolvedOptions);
|
|
273
|
+
await executeUnbuild(resolvedOptions);
|
|
274
|
+
await copyBuildAssets(resolvedOptions);
|
|
275
|
+
writeSuccess(` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`, resolvedOptions.config);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
writeFatal(" \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
278
|
+
throw error;
|
|
279
|
+
} finally {
|
|
280
|
+
stopwatch();
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
__name(build, "build");
|
|
284
|
+
|
|
285
|
+
export {
|
|
286
|
+
build
|
|
287
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var __create = Object.create;
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
6
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
8
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
9
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
10
|
+
}) : x)(function(x) {
|
|
11
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
12
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
13
|
+
});
|
|
14
|
+
var __esm = (fn, res) => function __init() {
|
|
15
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
16
|
+
};
|
|
17
|
+
var __commonJS = (cb, mod) => function __require2() {
|
|
18
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
19
|
+
};
|
|
20
|
+
var __copyProps = (to, from, except, desc) => {
|
|
21
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
22
|
+
for (let key of __getOwnPropNames(from))
|
|
23
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
24
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
25
|
+
}
|
|
26
|
+
return to;
|
|
27
|
+
};
|
|
28
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
29
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
30
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
31
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
32
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
33
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
34
|
+
mod
|
|
35
|
+
));
|
|
36
|
+
|
|
37
|
+
// ../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.49.1_@types+node@22.10.7__@swc+core@1.7.26_@swc+helpers_ekim6y52mwpq6ssxiprcp44dam/node_modules/tsup/assets/cjs_shims.js
|
|
38
|
+
var init_cjs_shims = __esm({
|
|
39
|
+
"../../node_modules/.pnpm/tsup@8.3.5_@microsoft+api-extractor@7.49.1_@types+node@22.10.7__@swc+core@1.7.26_@swc+helpers_ekim6y52mwpq6ssxiprcp44dam/node_modules/tsup/assets/cjs_shims.js"() {
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
exports.__name = __name; exports.__require = __require; exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.init_cjs_shims = init_cjs_shims;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkUUI4UWA4js = require('./chunk-UUI4UWA4.js');
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
var _chunk4WKFVYTIjs = require('./chunk-4WKFVYTI.js');
|
|
4
|
+
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
7
5
|
|
|
8
6
|
// src/plugins/on-error.ts
|
|
9
|
-
|
|
7
|
+
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
8
|
+
var _configtools = require('@storm-software/config-tools');
|
|
9
|
+
var onErrorPlugin = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (options, resolvedOptions) => ({
|
|
10
10
|
name: "storm:on-error",
|
|
11
11
|
buildEnd(error) {
|
|
12
12
|
if (error) {
|
|
13
|
-
|
|
13
|
+
_configtools.writeError.call(void 0, `The following errors occurred during the build:
|
|
14
14
|
${error ? error.message : "Unknown build error"}
|
|
15
15
|
|
|
16
16
|
`, resolvedOptions.config);
|
|
@@ -18,7 +18,7 @@ ${error ? error.message : "Unknown build error"}
|
|
|
18
18
|
}
|
|
19
19
|
},
|
|
20
20
|
renderError(error) {
|
|
21
|
-
|
|
21
|
+
_configtools.writeError.call(void 0, `The following errors occurred during the build:
|
|
22
22
|
${error ? error.message : "Unknown build error"}
|
|
23
23
|
|
|
24
24
|
`, resolvedOptions.config);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
5
|
+
|
|
6
|
+
// src/clean.ts
|
|
7
|
+
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
8
|
+
var _console = require('@storm-software/config-tools/logger/console');
|
|
9
|
+
var _promises = require('fs/promises');
|
|
10
|
+
async function clean(name = "Unbuild", directory, config) {
|
|
11
|
+
_console.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
12
|
+
const stopwatch = _console.getStopwatch.call(void 0, `${name} output clean`);
|
|
13
|
+
await _promises.rm.call(void 0, directory, {
|
|
14
|
+
recursive: true,
|
|
15
|
+
force: true
|
|
16
|
+
});
|
|
17
|
+
stopwatch();
|
|
18
|
+
}
|
|
19
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, clean, "clean");
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
exports.clean = clean;
|