@storm-software/unbuild 0.26.1 → 0.27.0
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/bin/unbuild.cjs +25 -14
- package/bin/unbuild.js +25 -14
- package/dist/build.cjs +8 -8
- package/dist/build.js +7 -7
- package/dist/{chunk-TRA2WJ3W.cjs → chunk-5E3NJ26L.cjs} +3 -3
- package/dist/{chunk-4RR7YISH.js → chunk-5S4A4OEA.js} +1 -1
- package/dist/{chunk-VEX5RCZW.js → chunk-C5IHRWT3.js} +1 -1
- package/dist/{chunk-XKHSZIHP.cjs → chunk-CF2C3GEV.cjs} +3 -3
- package/dist/{chunk-GHVDJY3S.cjs → chunk-FG6XQ26M.cjs} +15 -8
- package/dist/{chunk-5DNFZ6NI.js → chunk-G4U2DNFU.js} +14 -10
- package/dist/{chunk-TFMXUACY.js → chunk-K2D7TQ7G.js} +3 -3
- package/dist/{chunk-YCGXRIUD.js → chunk-KPFCICEG.js} +1 -1
- package/dist/{chunk-UV35N5R4.cjs → chunk-PSYW5YJB.cjs} +2 -2
- package/dist/{chunk-BRHZNXQM.js → chunk-TPFSDZCR.js} +15 -8
- package/dist/{chunk-KA5JSIMF.cjs → chunk-UECQBDR2.cjs} +97 -93
- package/dist/{chunk-KAXKUEZ7.cjs → chunk-V627S7QU.cjs} +2 -2
- package/dist/{chunk-JIVM7FQJ.js → chunk-VC7N2YVM.js} +1 -1
- package/dist/{chunk-HO6B5DC7.cjs → chunk-Y2DOCJBE.cjs} +6 -6
- package/dist/clean.cjs +3 -3
- package/dist/clean.js +2 -2
- package/dist/config.cjs +6 -6
- package/dist/config.js +5 -5
- package/dist/index.cjs +8 -8
- package/dist/index.js +7 -7
- package/package.json +2 -2
package/bin/unbuild.cjs
CHANGED
|
@@ -515,49 +515,56 @@ var isVerbose = /* @__PURE__ */ __name((label = LogLevelLabel.SILENT) => {
|
|
|
515
515
|
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
516
516
|
const colors2 = !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;
|
|
517
517
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
518
|
-
if (
|
|
518
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
519
519
|
return (_) => {
|
|
520
520
|
};
|
|
521
521
|
}
|
|
522
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
522
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
523
523
|
return (message) => {
|
|
524
524
|
console.error(`
|
|
525
525
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
526
526
|
`);
|
|
527
527
|
};
|
|
528
528
|
}
|
|
529
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
529
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
530
530
|
return (message) => {
|
|
531
531
|
console.error(`
|
|
532
532
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
533
533
|
`);
|
|
534
534
|
};
|
|
535
535
|
}
|
|
536
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
536
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
537
537
|
return (message) => {
|
|
538
538
|
console.warn(`
|
|
539
539
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
540
540
|
`);
|
|
541
541
|
};
|
|
542
542
|
}
|
|
543
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
543
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
544
544
|
return (message) => {
|
|
545
545
|
console.info(`
|
|
546
546
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
547
547
|
`);
|
|
548
548
|
};
|
|
549
549
|
}
|
|
550
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
550
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
551
551
|
return (message) => {
|
|
552
552
|
console.info(`
|
|
553
553
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
554
554
|
`);
|
|
555
555
|
};
|
|
556
556
|
}
|
|
557
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
557
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
558
558
|
return (message) => {
|
|
559
559
|
console.debug(`
|
|
560
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
560
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
561
|
+
`);
|
|
562
|
+
};
|
|
563
|
+
}
|
|
564
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
565
|
+
return (message) => {
|
|
566
|
+
console.debug(`
|
|
567
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
561
568
|
`);
|
|
562
569
|
};
|
|
563
570
|
}
|
|
@@ -3033,14 +3040,14 @@ async function resolveOptions(options, config) {
|
|
|
3033
3040
|
{
|
|
3034
3041
|
builder: "mkdist",
|
|
3035
3042
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
3036
|
-
outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
3043
|
+
outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
3037
3044
|
declaration: options.emitTypes !== false,
|
|
3038
3045
|
format: "esm"
|
|
3039
3046
|
},
|
|
3040
3047
|
{
|
|
3041
3048
|
builder: "mkdist",
|
|
3042
3049
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
3043
|
-
outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
3050
|
+
outDir: joinPaths((0, import_node_path6.relative)(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
3044
3051
|
declaration: options.emitTypes !== false,
|
|
3045
3052
|
format: "cjs",
|
|
3046
3053
|
ext: "cjs"
|
|
@@ -3158,11 +3165,15 @@ async function executeUnbuild(options) {
|
|
|
3158
3165
|
writeDebug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
3159
3166
|
const stopwatch = getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
3160
3167
|
try {
|
|
3161
|
-
|
|
3168
|
+
const config = {
|
|
3162
3169
|
...options,
|
|
3163
3170
|
config: null,
|
|
3164
|
-
rootDir: options.projectRoot
|
|
3165
|
-
}
|
|
3171
|
+
rootDir: joinPaths(options.config.workspaceRoot, options.projectRoot)
|
|
3172
|
+
};
|
|
3173
|
+
writeTrace(`Running with unbuild configuration:
|
|
3174
|
+
${formatLogMessage(config)}
|
|
3175
|
+
`, options.config);
|
|
3176
|
+
await build(options.projectRoot, false, config);
|
|
3166
3177
|
} finally {
|
|
3167
3178
|
stopwatch();
|
|
3168
3179
|
}
|
|
@@ -3200,7 +3211,7 @@ async function build2(options) {
|
|
|
3200
3211
|
writeDebug(` \u26A1 Executing Storm Unbuild pipeline`, config);
|
|
3201
3212
|
const stopwatch = getStopwatch("Unbuild pipeline");
|
|
3202
3213
|
try {
|
|
3203
|
-
options.projectRoot = projectRoot;
|
|
3214
|
+
options.projectRoot = correctPaths(projectRoot);
|
|
3204
3215
|
const resolvedOptions = await resolveOptions(options, config);
|
|
3205
3216
|
await cleanOutputPath(resolvedOptions);
|
|
3206
3217
|
await generatePackageJson(resolvedOptions);
|
package/bin/unbuild.js
CHANGED
|
@@ -490,49 +490,56 @@ var isVerbose = /* @__PURE__ */ __name((label = LogLevelLabel.SILENT) => {
|
|
|
490
490
|
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
491
491
|
const colors2 = !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;
|
|
492
492
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
493
|
-
if (
|
|
493
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
494
494
|
return (_) => {
|
|
495
495
|
};
|
|
496
496
|
}
|
|
497
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
497
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
498
498
|
return (message) => {
|
|
499
499
|
console.error(`
|
|
500
500
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
501
501
|
`);
|
|
502
502
|
};
|
|
503
503
|
}
|
|
504
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
504
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
505
505
|
return (message) => {
|
|
506
506
|
console.error(`
|
|
507
507
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
508
508
|
`);
|
|
509
509
|
};
|
|
510
510
|
}
|
|
511
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
511
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
512
512
|
return (message) => {
|
|
513
513
|
console.warn(`
|
|
514
514
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
515
515
|
`);
|
|
516
516
|
};
|
|
517
517
|
}
|
|
518
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
518
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
519
519
|
return (message) => {
|
|
520
520
|
console.info(`
|
|
521
521
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
522
522
|
`);
|
|
523
523
|
};
|
|
524
524
|
}
|
|
525
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
525
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
526
526
|
return (message) => {
|
|
527
527
|
console.info(`
|
|
528
528
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
529
529
|
`);
|
|
530
530
|
};
|
|
531
531
|
}
|
|
532
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
532
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
533
533
|
return (message) => {
|
|
534
534
|
console.debug(`
|
|
535
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
535
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
536
|
+
`);
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
540
|
+
return (message) => {
|
|
541
|
+
console.debug(`
|
|
542
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors2.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
536
543
|
`);
|
|
537
544
|
};
|
|
538
545
|
}
|
|
@@ -3008,14 +3015,14 @@ async function resolveOptions(options, config) {
|
|
|
3008
3015
|
{
|
|
3009
3016
|
builder: "mkdist",
|
|
3010
3017
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
3011
|
-
outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
3018
|
+
outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
3012
3019
|
declaration: options.emitTypes !== false,
|
|
3013
3020
|
format: "esm"
|
|
3014
3021
|
},
|
|
3015
3022
|
{
|
|
3016
3023
|
builder: "mkdist",
|
|
3017
3024
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
3018
|
-
outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
3025
|
+
outDir: joinPaths(relative4(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
3019
3026
|
declaration: options.emitTypes !== false,
|
|
3020
3027
|
format: "cjs",
|
|
3021
3028
|
ext: "cjs"
|
|
@@ -3133,11 +3140,15 @@ async function executeUnbuild(options) {
|
|
|
3133
3140
|
writeDebug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
3134
3141
|
const stopwatch = getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
3135
3142
|
try {
|
|
3136
|
-
|
|
3143
|
+
const config = {
|
|
3137
3144
|
...options,
|
|
3138
3145
|
config: null,
|
|
3139
|
-
rootDir: options.projectRoot
|
|
3140
|
-
}
|
|
3146
|
+
rootDir: joinPaths(options.config.workspaceRoot, options.projectRoot)
|
|
3147
|
+
};
|
|
3148
|
+
writeTrace(`Running with unbuild configuration:
|
|
3149
|
+
${formatLogMessage(config)}
|
|
3150
|
+
`, options.config);
|
|
3151
|
+
await build(options.projectRoot, false, config);
|
|
3141
3152
|
} finally {
|
|
3142
3153
|
stopwatch();
|
|
3143
3154
|
}
|
|
@@ -3175,7 +3186,7 @@ async function build2(options) {
|
|
|
3175
3186
|
writeDebug(` \u26A1 Executing Storm Unbuild pipeline`, config);
|
|
3176
3187
|
const stopwatch = getStopwatch("Unbuild pipeline");
|
|
3177
3188
|
try {
|
|
3178
|
-
options.projectRoot = projectRoot;
|
|
3189
|
+
options.projectRoot = correctPaths(projectRoot);
|
|
3179
3190
|
const resolvedOptions = await resolveOptions(options, config);
|
|
3180
3191
|
await cleanOutputPath(resolvedOptions);
|
|
3181
3192
|
await generatePackageJson(resolvedOptions);
|
package/dist/build.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('./chunk-
|
|
5
|
-
require('./chunk-
|
|
6
|
-
require('./chunk-
|
|
3
|
+
var _chunkUECQBDR2cjs = require('./chunk-UECQBDR2.cjs');
|
|
4
|
+
require('./chunk-5E3NJ26L.cjs');
|
|
5
|
+
require('./chunk-Y2DOCJBE.cjs');
|
|
6
|
+
require('./chunk-V627S7QU.cjs');
|
|
7
7
|
require('./chunk-SHHAZOHN.cjs');
|
|
8
|
-
require('./chunk-
|
|
9
|
-
require('./chunk-
|
|
10
|
-
require('./chunk-
|
|
8
|
+
require('./chunk-PSYW5YJB.cjs');
|
|
9
|
+
require('./chunk-CF2C3GEV.cjs');
|
|
10
|
+
require('./chunk-FG6XQ26M.cjs');
|
|
11
11
|
require('./chunk-YDYGZTJK.cjs');
|
|
12
12
|
|
|
13
13
|
|
|
14
|
-
exports.build =
|
|
14
|
+
exports.build = _chunkUECQBDR2cjs.build;
|
package/dist/build.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
2
|
build
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-G4U2DNFU.js";
|
|
4
|
+
import "./chunk-VC7N2YVM.js";
|
|
5
|
+
import "./chunk-K2D7TQ7G.js";
|
|
6
|
+
import "./chunk-C5IHRWT3.js";
|
|
7
7
|
import "./chunk-ESRR2FD2.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-KPFCICEG.js";
|
|
9
|
+
import "./chunk-5S4A4OEA.js";
|
|
10
|
+
import "./chunk-TPFSDZCR.js";
|
|
11
11
|
import "./chunk-3GQAWCBQ.js";
|
|
12
12
|
export {
|
|
13
13
|
build
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkFG6XQ26Mcjs = require('./chunk-FG6XQ26M.cjs');
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
|
|
@@ -9,8 +9,8 @@ var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
|
|
|
9
9
|
// src/clean.ts
|
|
10
10
|
var _promises = require('fs/promises');
|
|
11
11
|
async function clean(name = "Unbuild", directory, config) {
|
|
12
|
-
|
|
13
|
-
const stopwatch =
|
|
12
|
+
_chunkFG6XQ26Mcjs.writeDebug.call(void 0, ` \u{1F9F9} Cleaning ${name} output path: ${directory}`, config);
|
|
13
|
+
const stopwatch = _chunkFG6XQ26Mcjs.getStopwatch.call(void 0, `${name} output clean`);
|
|
14
14
|
await cleanDirectories(name, directory, config);
|
|
15
15
|
stopwatch();
|
|
16
16
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFG6XQ26Mcjs = require('./chunk-FG6XQ26M.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
|
|
@@ -10,7 +10,7 @@ var onErrorPlugin = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (optio
|
|
|
10
10
|
name: "storm:on-error",
|
|
11
11
|
buildEnd(error) {
|
|
12
12
|
if (error) {
|
|
13
|
-
|
|
13
|
+
_chunkFG6XQ26Mcjs.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
|
+
_chunkFG6XQ26Mcjs.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);
|
|
@@ -481,49 +481,56 @@ var formatTimestamp = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (dat
|
|
|
481
481
|
var getLogFn = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
482
482
|
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;
|
|
483
483
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
484
|
-
if (
|
|
484
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
485
485
|
return (_) => {
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
488
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
489
489
|
return (message) => {
|
|
490
490
|
console.error(`
|
|
491
491
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.fatal, () => ( "#7d1a1a")))(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
492
492
|
`);
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
495
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
496
496
|
return (message) => {
|
|
497
497
|
console.error(`
|
|
498
498
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.danger, () => ( "#f85149")))(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
499
499
|
`);
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
502
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
503
503
|
return (message) => {
|
|
504
504
|
console.warn(`
|
|
505
505
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.warning, () => ( "#e3b341")))(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
506
506
|
`);
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
509
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
510
510
|
return (message) => {
|
|
511
511
|
console.info(`
|
|
512
512
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.success, () => ( "#56d364")))(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
513
513
|
`);
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
516
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
517
517
|
return (message) => {
|
|
518
518
|
console.info(`
|
|
519
519
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.info, () => ( "#58a6ff")))(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
520
520
|
`);
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
523
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
524
524
|
return (message) => {
|
|
525
525
|
console.debug(`
|
|
526
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
526
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
527
|
+
`);
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
531
|
+
return (message) => {
|
|
532
|
+
console.debug(`
|
|
533
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(_nullishCoalesce(colors.brand, () => ( "#1fb2a6")))(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
527
534
|
`);
|
|
528
535
|
};
|
|
529
536
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
cleanDirectories
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VC7N2YVM.js";
|
|
4
4
|
import {
|
|
5
5
|
getDefaultBuildPlugins
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-K2D7TQ7G.js";
|
|
7
7
|
import {
|
|
8
8
|
loadConfig
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-C5IHRWT3.js";
|
|
10
10
|
import {
|
|
11
11
|
COLOR_KEYS,
|
|
12
12
|
LogLevel,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
writeSystem,
|
|
30
30
|
writeTrace,
|
|
31
31
|
writeWarning
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TPFSDZCR.js";
|
|
33
33
|
import {
|
|
34
34
|
__name
|
|
35
35
|
} from "./chunk-3GQAWCBQ.js";
|
|
@@ -2272,14 +2272,14 @@ async function resolveOptions(options, config) {
|
|
|
2272
2272
|
{
|
|
2273
2273
|
builder: "mkdist",
|
|
2274
2274
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
2275
|
-
outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
2275
|
+
outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
2276
2276
|
declaration: options.emitTypes !== false,
|
|
2277
2277
|
format: "esm"
|
|
2278
2278
|
},
|
|
2279
2279
|
{
|
|
2280
2280
|
builder: "mkdist",
|
|
2281
2281
|
input: `.${sourceRoot.replace(options.projectRoot, "")}`,
|
|
2282
|
-
outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot)
|
|
2282
|
+
outDir: joinPaths(relative3(joinPaths(config.workspaceRoot, options.projectRoot), config.workspaceRoot), outputPath, "dist"),
|
|
2283
2283
|
declaration: options.emitTypes !== false,
|
|
2284
2284
|
format: "cjs",
|
|
2285
2285
|
ext: "cjs"
|
|
@@ -2397,11 +2397,15 @@ async function executeUnbuild(options) {
|
|
|
2397
2397
|
writeDebug(` \u{1F680} Running ${options.name} (${options.projectRoot}) build`, options.config);
|
|
2398
2398
|
const stopwatch = getStopwatch(`${options.name} (${options.projectRoot}) build`);
|
|
2399
2399
|
try {
|
|
2400
|
-
|
|
2400
|
+
const config = {
|
|
2401
2401
|
...options,
|
|
2402
2402
|
config: null,
|
|
2403
|
-
rootDir: options.projectRoot
|
|
2404
|
-
}
|
|
2403
|
+
rootDir: joinPaths(options.config.workspaceRoot, options.projectRoot)
|
|
2404
|
+
};
|
|
2405
|
+
writeTrace(`Running with unbuild configuration:
|
|
2406
|
+
${formatLogMessage(config)}
|
|
2407
|
+
`, options.config);
|
|
2408
|
+
await build(options.projectRoot, false, config);
|
|
2405
2409
|
} finally {
|
|
2406
2410
|
stopwatch();
|
|
2407
2411
|
}
|
|
@@ -2439,7 +2443,7 @@ async function build2(options) {
|
|
|
2439
2443
|
writeDebug(` \u26A1 Executing Storm Unbuild pipeline`, config);
|
|
2440
2444
|
const stopwatch = getStopwatch("Unbuild pipeline");
|
|
2441
2445
|
try {
|
|
2442
|
-
options.projectRoot = projectRoot;
|
|
2446
|
+
options.projectRoot = correctPaths(projectRoot);
|
|
2443
2447
|
const resolvedOptions = await resolveOptions(options, config);
|
|
2444
2448
|
await cleanOutputPath(resolvedOptions);
|
|
2445
2449
|
await generatePackageJson(resolvedOptions);
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
tscPlugin
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-C5IHRWT3.js";
|
|
4
4
|
import {
|
|
5
5
|
typeDefinitions
|
|
6
6
|
} from "./chunk-ESRR2FD2.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzePlugin
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KPFCICEG.js";
|
|
10
10
|
import {
|
|
11
11
|
onErrorPlugin
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-5S4A4OEA.js";
|
|
13
13
|
import {
|
|
14
14
|
__name
|
|
15
15
|
} from "./chunk-3GQAWCBQ.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkFG6XQ26Mcjs = require('./chunk-FG6XQ26M.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
var _chunkYDYGZTJKcjs = require('./chunk-YDYGZTJK.cjs');
|
|
@@ -25,7 +25,7 @@ var analyzePlugin = /* @__PURE__ */ _chunkYDYGZTJKcjs.__name.call(void 0, (optio
|
|
|
25
25
|
renderChunk(source, chunk) {
|
|
26
26
|
const sourceBytes = formatBytes(source.length);
|
|
27
27
|
const fileName = chunk.fileName;
|
|
28
|
-
|
|
28
|
+
_chunkFG6XQ26Mcjs.writeInfo.call(void 0, ` - ${fileName} ${sourceBytes}`, resolvedOptions.config);
|
|
29
29
|
}
|
|
30
30
|
};
|
|
31
31
|
}, "analyzePlugin");
|
|
@@ -481,49 +481,56 @@ var formatTimestamp = /* @__PURE__ */ __name((date = /* @__PURE__ */ new Date())
|
|
|
481
481
|
var getLogFn = /* @__PURE__ */ __name((logLevel = LogLevel.INFO, config = {}, _chalk = getChalk()) => {
|
|
482
482
|
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;
|
|
483
483
|
const configLogLevel = config.logLevel || process.env.STORM_LOG_LEVEL || LogLevelLabel.INFO;
|
|
484
|
-
if (
|
|
484
|
+
if (logLevel > getLogLevel(configLogLevel) || logLevel <= LogLevel.SILENT || getLogLevel(configLogLevel) <= LogLevel.SILENT) {
|
|
485
485
|
return (_) => {
|
|
486
486
|
};
|
|
487
487
|
}
|
|
488
|
-
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel
|
|
488
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel) {
|
|
489
489
|
return (message) => {
|
|
490
490
|
console.error(`
|
|
491
491
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.fatal ?? "#7d1a1a")(`[${CONSOLE_ICONS[LogLevelLabel.FATAL]} Fatal]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
492
492
|
`);
|
|
493
493
|
};
|
|
494
494
|
}
|
|
495
|
-
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel
|
|
495
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel) {
|
|
496
496
|
return (message) => {
|
|
497
497
|
console.error(`
|
|
498
498
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.danger ?? "#f85149")(`[${CONSOLE_ICONS[LogLevelLabel.ERROR]} Error]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
499
499
|
`);
|
|
500
500
|
};
|
|
501
501
|
}
|
|
502
|
-
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel
|
|
502
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel) {
|
|
503
503
|
return (message) => {
|
|
504
504
|
console.warn(`
|
|
505
505
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.warning ?? "#e3b341")(`[${CONSOLE_ICONS[LogLevelLabel.WARN]} Warn]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
506
506
|
`);
|
|
507
507
|
};
|
|
508
508
|
}
|
|
509
|
-
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel
|
|
509
|
+
if (typeof logLevel === "number" && LogLevel.SUCCESS >= logLevel) {
|
|
510
510
|
return (message) => {
|
|
511
511
|
console.info(`
|
|
512
512
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.success ?? "#56d364")(`[${CONSOLE_ICONS[LogLevelLabel.SUCCESS]} Success]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
513
513
|
`);
|
|
514
514
|
};
|
|
515
515
|
}
|
|
516
|
-
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel
|
|
516
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel) {
|
|
517
517
|
return (message) => {
|
|
518
518
|
console.info(`
|
|
519
519
|
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.info ?? "#58a6ff")(`[${CONSOLE_ICONS[LogLevelLabel.INFO]} Info]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
520
520
|
`);
|
|
521
521
|
};
|
|
522
522
|
}
|
|
523
|
-
if (typeof logLevel === "number" && LogLevel.
|
|
523
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel) {
|
|
524
524
|
return (message) => {
|
|
525
525
|
console.debug(`
|
|
526
|
-
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]}
|
|
526
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.DEBUG]} Debug]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
527
|
+
`);
|
|
528
|
+
};
|
|
529
|
+
}
|
|
530
|
+
if (typeof logLevel === "number" && LogLevel.TRACE >= logLevel) {
|
|
531
|
+
return (message) => {
|
|
532
|
+
console.debug(`
|
|
533
|
+
${_chalk.gray(formatTimestamp())} ${_chalk.hex(colors.brand ?? "#1fb2a6")(`[${CONSOLE_ICONS[LogLevelLabel.TRACE]} Trace]`)} ${_chalk.bold.whiteBright(formatLogMessage(message))}
|
|
527
534
|
`);
|
|
528
535
|
};
|
|
529
536
|
}
|