@storm-software/unbuild 0.24.0 → 0.24.2
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 +71 -28
- package/bin/unbuild.mjs +69 -26
- package/dist/build.d.mts +1 -0
- package/dist/build.d.ts +1 -0
- package/dist/build.js +8 -8
- package/dist/build.mjs +7 -7
- package/dist/{chunk-RNM4JSUG.js → chunk-44VTNVZA.js} +6 -6
- package/dist/{chunk-UT4OJQUT.mjs → chunk-4BAUMYRN.mjs} +4 -7
- package/dist/{chunk-L76UPCDF.js → chunk-523YIUTF.js} +2 -2
- package/dist/{chunk-4QTKZ7Y7.mjs → chunk-6UMHN4KS.mjs} +9 -4
- package/dist/{chunk-QPMFJ7G7.js → chunk-BUCFGCTW.js} +2 -2
- package/dist/{chunk-TCARWZKA.mjs → chunk-ESGPHEWU.mjs} +3 -3
- package/dist/{chunk-26H2BQTK.mjs → chunk-G6BE6UP3.mjs} +62 -27
- package/dist/{chunk-X6Y2OZGW.js → chunk-MCNTIU52.js} +2 -8
- package/dist/{chunk-27VOTZLA.js → chunk-PVZYPNLZ.js} +11 -6
- package/dist/{chunk-JLKG5B52.mjs → chunk-Q4GMTWGF.mjs} +1 -1
- package/dist/{chunk-D4WJVAJM.js → chunk-SQOZCV36.js} +4 -7
- package/dist/{chunk-J3DIENOH.mjs → chunk-TEEYWCSY.mjs} +2 -8
- package/dist/{chunk-NXZFF473.mjs → chunk-WXJPXYHF.mjs} +1 -1
- package/dist/{chunk-YXF5LOZH.js → chunk-YIP6AERX.js} +107 -72
- package/dist/clean.d.mts +9 -1
- package/dist/clean.d.ts +9 -1
- package/dist/clean.js +5 -3
- package/dist/clean.mjs +6 -4
- package/dist/config.d.mts +1 -0
- package/dist/config.d.ts +1 -0
- package/dist/config.js +6 -6
- package/dist/config.mjs +5 -5
- package/dist/index.d.mts +2 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +10 -8
- package/dist/index.mjs +10 -8
- package/dist/types.d.mts +2 -0
- package/dist/types.d.ts +2 -0
- package/package.json +4 -4
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tscPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Q4GMTWGF.mjs";
|
|
4
4
|
import {
|
|
5
5
|
typeDefinitions
|
|
6
6
|
} from "./chunk-4ENAOJ33.mjs";
|
|
7
7
|
import {
|
|
8
8
|
analyzePlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-WXJPXYHF.mjs";
|
|
10
10
|
import {
|
|
11
11
|
onErrorPlugin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4BAUMYRN.mjs";
|
|
13
13
|
import {
|
|
14
14
|
__name,
|
|
15
15
|
init_esm_shims
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
resolve
|
|
10
10
|
} from "./chunk-FAXWFK7Q.mjs";
|
|
11
11
|
import {
|
|
12
|
-
|
|
13
|
-
} from "./chunk-
|
|
12
|
+
cleanDirectories
|
|
13
|
+
} from "./chunk-6UMHN4KS.mjs";
|
|
14
14
|
import {
|
|
15
15
|
getDefaultBuildPlugins
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-ESGPHEWU.mjs";
|
|
17
17
|
import {
|
|
18
18
|
loadConfig
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-Q4GMTWGF.mjs";
|
|
20
20
|
import {
|
|
21
21
|
LogLevel,
|
|
22
22
|
LogLevelLabel,
|
|
@@ -24,19 +24,16 @@ import {
|
|
|
24
24
|
findWorkspaceRoot,
|
|
25
25
|
formatLogMessage,
|
|
26
26
|
getDefaultConfig,
|
|
27
|
+
getLogFn,
|
|
27
28
|
getLogLevel,
|
|
28
29
|
getLogLevelLabel,
|
|
29
30
|
getStopwatch,
|
|
30
31
|
isVerbose,
|
|
31
32
|
joinPaths,
|
|
32
|
-
writeDebug,
|
|
33
|
-
writeError,
|
|
34
|
-
writeFatal,
|
|
35
|
-
writeSuccess,
|
|
36
33
|
writeSystem,
|
|
37
34
|
writeTrace,
|
|
38
35
|
writeWarning
|
|
39
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-TEEYWCSY.mjs";
|
|
40
37
|
import {
|
|
41
38
|
__commonJS,
|
|
42
39
|
__name,
|
|
@@ -2181,9 +2178,42 @@ ${formatLogMessage(config)}`, config);
|
|
|
2181
2178
|
return config;
|
|
2182
2179
|
}, "loadStormConfig");
|
|
2183
2180
|
|
|
2181
|
+
// ../config-tools/src/logger/create-logger.ts
|
|
2182
|
+
init_esm_shims();
|
|
2183
|
+
import { createJiti as createJiti2 } from "jiti";
|
|
2184
|
+
async function createLogger(config) {
|
|
2185
|
+
const workspaceRoot = findWorkspaceRoot();
|
|
2186
|
+
if (!workspaceRoot) {
|
|
2187
|
+
throw new Error("Cannot find workspace root");
|
|
2188
|
+
}
|
|
2189
|
+
const jiti = createJiti2(config?.workspaceRoot || workspaceRoot, {
|
|
2190
|
+
fsCache: "node_modules/.cache/storm/jiti",
|
|
2191
|
+
interopDefault: true
|
|
2192
|
+
});
|
|
2193
|
+
const chalk = await jiti.import("chalk");
|
|
2194
|
+
const writeFatal = getLogFn(LogLevel.FATAL, config, chalk);
|
|
2195
|
+
const writeError = getLogFn(LogLevel.ERROR, config, chalk);
|
|
2196
|
+
const writeWarning2 = getLogFn(LogLevel.WARN, config, chalk);
|
|
2197
|
+
const writeInfo = getLogFn(LogLevel.INFO, config, chalk);
|
|
2198
|
+
const writeSuccess = getLogFn(LogLevel.SUCCESS, config, chalk);
|
|
2199
|
+
const writeDebug = getLogFn(LogLevel.DEBUG, config, chalk);
|
|
2200
|
+
const writeTrace2 = getLogFn(LogLevel.DEBUG, config, chalk);
|
|
2201
|
+
return {
|
|
2202
|
+
fatal: writeFatal,
|
|
2203
|
+
error: writeError,
|
|
2204
|
+
warning: writeWarning2,
|
|
2205
|
+
info: writeInfo,
|
|
2206
|
+
success: writeSuccess,
|
|
2207
|
+
debug: writeDebug,
|
|
2208
|
+
trace: writeTrace2,
|
|
2209
|
+
getStopwatch
|
|
2210
|
+
};
|
|
2211
|
+
}
|
|
2212
|
+
__name(createLogger, "createLogger");
|
|
2213
|
+
|
|
2184
2214
|
// src/build.ts
|
|
2185
2215
|
import defu5 from "defu";
|
|
2186
|
-
import { createJiti as
|
|
2216
|
+
import { createJiti as createJiti3 } from "jiti";
|
|
2187
2217
|
import { existsSync as existsSync3 } from "node:fs";
|
|
2188
2218
|
import { readFile as readFile2 } from "node:fs/promises";
|
|
2189
2219
|
import { relative } from "node:path";
|
|
@@ -2199,8 +2229,9 @@ async function resolveOptions(options) {
|
|
|
2199
2229
|
throw new Error("Cannot find workspace root");
|
|
2200
2230
|
}
|
|
2201
2231
|
const config = await loadStormConfig(workspaceRoot.dir);
|
|
2202
|
-
|
|
2203
|
-
|
|
2232
|
+
const logger = await createLogger(config);
|
|
2233
|
+
logger.debug(" \u2699\uFE0F Resolving build options");
|
|
2234
|
+
const stopwatch = logger.getStopwatch("Build options resolution");
|
|
2204
2235
|
if (options.configPath) {
|
|
2205
2236
|
const configFile = await loadConfig(options.configPath);
|
|
2206
2237
|
if (configFile) {
|
|
@@ -2242,7 +2273,7 @@ async function resolveOptions(options) {
|
|
|
2242
2273
|
dependencies = dependencies.filter((deps) => deps.name !== tsLibDependency.name);
|
|
2243
2274
|
dependencies.push(tsLibDependency);
|
|
2244
2275
|
}
|
|
2245
|
-
const jiti =
|
|
2276
|
+
const jiti = createJiti3(config.workspaceRoot, {
|
|
2246
2277
|
fsCache: config.skipCache ? false : joinPaths(config.directories.cache || "node_modules/.cache/storm", "jiti"),
|
|
2247
2278
|
interopDefault: true
|
|
2248
2279
|
});
|
|
@@ -2254,6 +2285,7 @@ async function resolveOptions(options) {
|
|
|
2254
2285
|
projectName,
|
|
2255
2286
|
tsconfig,
|
|
2256
2287
|
jiti,
|
|
2288
|
+
logger,
|
|
2257
2289
|
clean: false,
|
|
2258
2290
|
entries: [
|
|
2259
2291
|
{
|
|
@@ -2361,8 +2393,8 @@ async function resolveOptions(options) {
|
|
|
2361
2393
|
__name(resolveOptions, "resolveOptions");
|
|
2362
2394
|
async function generatePackageJson(options) {
|
|
2363
2395
|
if (options.generatePackageJson !== false && existsSync3(joinPaths(options.projectRoot, "package.json"))) {
|
|
2364
|
-
|
|
2365
|
-
const stopwatch = getStopwatch("Write package.json file");
|
|
2396
|
+
options.logger.debug(" \u270D\uFE0F Writing package.json file");
|
|
2397
|
+
const stopwatch = options.logger.getStopwatch("Write package.json file");
|
|
2366
2398
|
const packageJsonPath = joinPaths(options.projectRoot, "project.json");
|
|
2367
2399
|
if (!existsSync3(packageJsonPath)) {
|
|
2368
2400
|
throw new Error("Cannot find package.json configuration");
|
|
@@ -2381,11 +2413,11 @@ async function generatePackageJson(options) {
|
|
|
2381
2413
|
}
|
|
2382
2414
|
__name(generatePackageJson, "generatePackageJson");
|
|
2383
2415
|
async function resolveUnbuild(options) {
|
|
2384
|
-
|
|
2416
|
+
options.logger.trace(`Resolving Unbuild package with Jiti`);
|
|
2385
2417
|
try {
|
|
2386
2418
|
return options.jiti.import("unbuild");
|
|
2387
2419
|
} catch (error) {
|
|
2388
|
-
|
|
2420
|
+
options.logger.error(" \u274C An error occurred while resolving the Unbuild package");
|
|
2389
2421
|
throw new Error("An error occurred while resolving the Unbuild package", {
|
|
2390
2422
|
cause: error
|
|
2391
2423
|
});
|
|
@@ -2393,8 +2425,8 @@ async function resolveUnbuild(options) {
|
|
|
2393
2425
|
}
|
|
2394
2426
|
__name(resolveUnbuild, "resolveUnbuild");
|
|
2395
2427
|
async function executeUnbuild(options) {
|
|
2396
|
-
|
|
2397
|
-
const stopwatch = getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
2428
|
+
options.logger.debug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`);
|
|
2429
|
+
const stopwatch = options.logger.getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
2398
2430
|
try {
|
|
2399
2431
|
const unbuild = await resolveUnbuild(options);
|
|
2400
2432
|
await unbuild.build(options.projectRoot, false, {
|
|
@@ -2408,8 +2440,8 @@ async function executeUnbuild(options) {
|
|
|
2408
2440
|
}
|
|
2409
2441
|
__name(executeUnbuild, "executeUnbuild");
|
|
2410
2442
|
async function copyBuildAssets(options) {
|
|
2411
|
-
|
|
2412
|
-
const stopwatch = getStopwatch(`${options.name} asset copy`);
|
|
2443
|
+
options.logger.debug(` \u{1F4CB} Copying asset files to output directory: ${options.outDir}`);
|
|
2444
|
+
const stopwatch = options.logger.getStopwatch(`${options.name} asset copy`);
|
|
2413
2445
|
await copyAssets(options.config, options.assets ?? [], options.outDir, options.projectRoot, options.projectName, options.sourceRoot, options.generatePackageJson, options.includeSrc);
|
|
2414
2446
|
stopwatch();
|
|
2415
2447
|
return options;
|
|
@@ -2417,23 +2449,26 @@ async function copyBuildAssets(options) {
|
|
|
2417
2449
|
__name(copyBuildAssets, "copyBuildAssets");
|
|
2418
2450
|
async function cleanOutputPath(options) {
|
|
2419
2451
|
if (options.clean !== false && options.outDir) {
|
|
2420
|
-
|
|
2452
|
+
options.logger.debug(` \u{1F9F9} Cleaning ${options.name} output path: ${options.outDir}`);
|
|
2453
|
+
const stopwatch = options.logger.getStopwatch(`${options.name} output clean`);
|
|
2454
|
+
await cleanDirectories(options.name, options.outDir, options.config);
|
|
2455
|
+
stopwatch();
|
|
2421
2456
|
}
|
|
2422
2457
|
return options;
|
|
2423
2458
|
}
|
|
2424
2459
|
__name(cleanOutputPath, "cleanOutputPath");
|
|
2425
2460
|
async function build(options) {
|
|
2426
|
-
|
|
2427
|
-
|
|
2461
|
+
const resolvedOptions = await resolveOptions(options);
|
|
2462
|
+
resolvedOptions.logger.debug(` \u26A1 Executing Storm Unbuild pipeline`);
|
|
2463
|
+
const stopwatch = resolvedOptions.logger.getStopwatch("Unbuild pipeline");
|
|
2428
2464
|
try {
|
|
2429
|
-
const resolvedOptions = await resolveOptions(options);
|
|
2430
2465
|
await cleanOutputPath(resolvedOptions);
|
|
2431
2466
|
await generatePackageJson(resolvedOptions);
|
|
2432
2467
|
await executeUnbuild(resolvedOptions);
|
|
2433
2468
|
await copyBuildAssets(resolvedOptions);
|
|
2434
|
-
|
|
2469
|
+
resolvedOptions.logger.success(` \u{1F3C1} The ${resolvedOptions.name} build completed successfully`);
|
|
2435
2470
|
} catch (error) {
|
|
2436
|
-
|
|
2471
|
+
resolvedOptions.logger.fatal(" \u274C Fatal errors occurred during the build that could not be recovered from. The build process has been terminated.");
|
|
2437
2472
|
throw error;
|
|
2438
2473
|
} finally {
|
|
2439
2474
|
stopwatch();
|
|
@@ -2934,8 +2934,7 @@ var formatTimestamp = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (date
|
|
|
2934
2934
|
}, "formatTimestamp");
|
|
2935
2935
|
|
|
2936
2936
|
// ../config-tools/src/logger/console.ts
|
|
2937
|
-
var getLogFn = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}) => {
|
|
2938
|
-
const _chalk = getChalk();
|
|
2937
|
+
var getLogFn = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
2939
2938
|
const colors = !_optionalChain([config, 'access', _11 => _11.colors, 'optionalAccess', _12 => _12.dark]) && !_optionalChain([config, 'access', _13 => _13.colors, 'optionalAccess', _14 => _14["base"]]) && !_optionalChain([config, 'access', _15 => _15.colors, 'optionalAccess', _16 => _16["base"], 'optionalAccess', _17 => _17.dark]) ? DEFAULT_COLOR_CONFIG : _optionalChain([config, 'access', _18 => _18.colors, 'optionalAccess', _19 => _19.dark]) && typeof config.colors.dark === "string" ? config.colors : _optionalChain([config, 'access', _20 => _20.colors, 'optionalAccess', _21 => _21["base"], 'optionalAccess', _22 => _22.dark]) && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : _optionalChain([config, 'access', _23 => _23.colors, 'optionalAccess', _24 => _24["base"]]) ? _optionalChain([config, 'access', _25 => _25.colors, 'optionalAccess', _26 => _26["base"]]) : DEFAULT_COLOR_CONFIG;
|
|
2940
2939
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
2941
2940
|
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
@@ -2990,11 +2989,8 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, ()
|
|
|
2990
2989
|
`);
|
|
2991
2990
|
};
|
|
2992
2991
|
}, "getLogFn");
|
|
2993
|
-
var writeFatal = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
|
|
2994
|
-
var writeError = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
|
|
2995
2992
|
var writeWarning = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
|
|
2996
2993
|
var writeInfo = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
|
|
2997
|
-
var writeSuccess = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
2998
2994
|
var writeDebug = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
2999
2995
|
var writeTrace = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
3000
2996
|
var writeSystem = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
@@ -3051,6 +3047,4 @@ var _isFunction = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (value) =
|
|
|
3051
3047
|
|
|
3052
3048
|
|
|
3053
3049
|
|
|
3054
|
-
|
|
3055
|
-
|
|
3056
|
-
exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose; exports.writeFatal = writeFatal; exports.writeError = writeError; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeSuccess = writeSuccess; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;
|
|
3050
|
+
exports.LogLevel = LogLevel; exports.LogLevelLabel = LogLevelLabel; exports.correctPaths = correctPaths; exports.joinPaths = joinPaths; exports.findWorkspaceRoot = findWorkspaceRoot; exports.getDefaultConfig = getDefaultConfig; exports.getLogLevel = getLogLevel; exports.getLogLevelLabel = getLogLevelLabel; exports.isVerbose = isVerbose; exports.getLogFn = getLogFn; exports.writeWarning = writeWarning; exports.writeInfo = writeInfo; exports.writeDebug = writeDebug; exports.writeTrace = writeTrace; exports.writeSystem = writeSystem; exports.getStopwatch = getStopwatch; exports.formatLogMessage = formatLogMessage;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkMCNTIU52js = require('./chunk-MCNTIU52.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
|
|
@@ -11,16 +11,21 @@ var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
|
11
11
|
_chunkRBSVNX4Wjs.init_cjs_shims.call(void 0, );
|
|
12
12
|
var _promises = require('fs/promises');
|
|
13
13
|
async function clean(name = "Unbuild", directory, config) {
|
|
14
|
-
|
|
15
|
-
const stopwatch =
|
|
14
|
+
_chunkMCNTIU52js.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
15
|
+
const stopwatch = _chunkMCNTIU52js.getStopwatch.call(void 0, `${name} output clean`);
|
|
16
|
+
await cleanDirectories(name, directory, config);
|
|
17
|
+
stopwatch();
|
|
18
|
+
}
|
|
19
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, clean, "clean");
|
|
20
|
+
async function cleanDirectories(name = "Unbuild", directory, config) {
|
|
16
21
|
await _promises.rm.call(void 0, directory, {
|
|
17
22
|
recursive: true,
|
|
18
23
|
force: true
|
|
19
24
|
});
|
|
20
|
-
stopwatch();
|
|
21
25
|
}
|
|
22
|
-
_chunkRBSVNX4Wjs.__name.call(void 0,
|
|
26
|
+
_chunkRBSVNX4Wjs.__name.call(void 0, cleanDirectories, "cleanDirectories");
|
|
27
|
+
|
|
23
28
|
|
|
24
29
|
|
|
25
30
|
|
|
26
|
-
exports.clean = clean;
|
|
31
|
+
exports.clean = clean; exports.cleanDirectories = cleanDirectories;
|
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var _chunkX6Y2OZGWjs = require('./chunk-X6Y2OZGW.js');
|
|
4
|
-
|
|
5
|
-
|
|
6
3
|
|
|
7
4
|
var _chunkRBSVNX4Wjs = require('./chunk-RBSVNX4W.js');
|
|
8
5
|
|
|
@@ -12,18 +9,18 @@ var onErrorPlugin = /* @__PURE__ */ _chunkRBSVNX4Wjs.__name.call(void 0, (option
|
|
|
12
9
|
name: "storm:on-error",
|
|
13
10
|
buildEnd(error) {
|
|
14
11
|
if (error) {
|
|
15
|
-
|
|
12
|
+
resolvedOptions.logger.error(`The following errors occurred during the build:
|
|
16
13
|
${error ? error.message : "Unknown build error"}
|
|
17
14
|
|
|
18
|
-
|
|
15
|
+
`);
|
|
19
16
|
throw new Error("Storm unbuild process failed with errors.");
|
|
20
17
|
}
|
|
21
18
|
},
|
|
22
19
|
renderError(error) {
|
|
23
|
-
|
|
20
|
+
resolvedOptions.logger.error(`The following errors occurred during the build:
|
|
24
21
|
${error ? error.message : "Unknown build error"}
|
|
25
22
|
|
|
26
|
-
|
|
23
|
+
`);
|
|
27
24
|
throw new Error("Storm unbuild process failed with errors.");
|
|
28
25
|
}
|
|
29
26
|
}), "onErrorPlugin");
|
|
@@ -2934,8 +2934,7 @@ var formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date())
|
|
|
2934
2934
|
}, "formatTimestamp");
|
|
2935
2935
|
|
|
2936
2936
|
// ../config-tools/src/logger/console.ts
|
|
2937
|
-
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}) => {
|
|
2938
|
-
const _chalk = getChalk();
|
|
2937
|
+
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
2939
2938
|
const colors = !config.colors?.dark && !config.colors?.["base"] && !config.colors?.["base"]?.dark ? DEFAULT_COLOR_CONFIG : config.colors?.dark && typeof config.colors.dark === "string" ? config.colors : config.colors?.["base"]?.dark && typeof config.colors["base"].dark === "string" ? config.colors["base"].dark : config.colors?.["base"] ? config.colors?.["base"] : DEFAULT_COLOR_CONFIG;
|
|
2940
2939
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
2941
2940
|
if (typeof logLevel === "number" && (logLevel >= getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(configLogLevel)) {
|
|
@@ -2990,11 +2989,8 @@ ${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CO
|
|
|
2990
2989
|
`);
|
|
2991
2990
|
};
|
|
2992
2991
|
}, "getLogFn");
|
|
2993
|
-
var writeFatal = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.FATAL, config)(message), "writeFatal");
|
|
2994
|
-
var writeError = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ERROR, config)(message), "writeError");
|
|
2995
2992
|
var writeWarning = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.WARN, config)(message), "writeWarning");
|
|
2996
2993
|
var writeInfo = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.INFO, config)(message), "writeInfo");
|
|
2997
|
-
var writeSuccess = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.SUCCESS, config)(message), "writeSuccess");
|
|
2998
2994
|
var writeDebug = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.DEBUG, config)(message), "writeDebug");
|
|
2999
2995
|
var writeTrace = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.TRACE, config)(message), "writeTrace");
|
|
3000
2996
|
var writeSystem = /* @__PURE__ */ __name((message, config) => getLogFn(LogLevel.ALL, config)(message), "writeSystem");
|
|
@@ -3043,11 +3039,9 @@ export {
|
|
|
3043
3039
|
getLogLevel,
|
|
3044
3040
|
getLogLevelLabel,
|
|
3045
3041
|
isVerbose,
|
|
3046
|
-
|
|
3047
|
-
writeError,
|
|
3042
|
+
getLogFn,
|
|
3048
3043
|
writeWarning,
|
|
3049
3044
|
writeInfo,
|
|
3050
|
-
writeSuccess,
|
|
3051
3045
|
writeDebug,
|
|
3052
3046
|
writeTrace,
|
|
3053
3047
|
writeSystem,
|