@storm-software/workspace-tools 1.42.4 → 1.43.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/CHANGELOG.md +14 -0
- package/README.md +1 -1
- package/index.js +382 -285
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +362 -265
- package/src/executors/design-tokens/executor.js +235 -131
- package/src/executors/tsup/executor.js +234 -129
- package/src/executors/tsup-browser/executor.js +233 -128
- package/src/executors/tsup-neutral/executor.js +233 -128
- package/src/executors/tsup-node/executor.js +233 -128
- package/src/generators/browser-library/generator.js +251 -149
- package/src/generators/config-schema/generator.js +221 -109
- package/src/generators/neutral-library/generator.js +251 -149
- package/src/generators/node-library/generator.js +251 -149
- package/src/generators/preset/generator.js +220 -108
|
@@ -16158,14 +16158,14 @@ var require_share = __commonJS({
|
|
|
16158
16158
|
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
16159
16159
|
resetConnection = void 0;
|
|
16160
16160
|
};
|
|
16161
|
-
var
|
|
16161
|
+
var reset2 = function() {
|
|
16162
16162
|
cancelReset();
|
|
16163
16163
|
connection = subject = void 0;
|
|
16164
16164
|
hasCompleted = hasErrored = false;
|
|
16165
16165
|
};
|
|
16166
16166
|
var resetAndUnsubscribe = function() {
|
|
16167
16167
|
var conn = connection;
|
|
16168
|
-
|
|
16168
|
+
reset2();
|
|
16169
16169
|
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
16170
16170
|
};
|
|
16171
16171
|
return lift_1.operate(function(source, subscriber) {
|
|
@@ -16189,13 +16189,13 @@ var require_share = __commonJS({
|
|
|
16189
16189
|
error: function(err) {
|
|
16190
16190
|
hasErrored = true;
|
|
16191
16191
|
cancelReset();
|
|
16192
|
-
resetConnection = handleReset(
|
|
16192
|
+
resetConnection = handleReset(reset2, resetOnError, err);
|
|
16193
16193
|
dest.error(err);
|
|
16194
16194
|
},
|
|
16195
16195
|
complete: function() {
|
|
16196
16196
|
hasCompleted = true;
|
|
16197
16197
|
cancelReset();
|
|
16198
|
-
resetConnection = handleReset(
|
|
16198
|
+
resetConnection = handleReset(reset2, resetOnComplete);
|
|
16199
16199
|
dest.complete();
|
|
16200
16200
|
}
|
|
16201
16201
|
});
|
|
@@ -16205,13 +16205,13 @@ var require_share = __commonJS({
|
|
|
16205
16205
|
};
|
|
16206
16206
|
}
|
|
16207
16207
|
exports.share = share;
|
|
16208
|
-
function handleReset(
|
|
16208
|
+
function handleReset(reset2, on) {
|
|
16209
16209
|
var args = [];
|
|
16210
16210
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
16211
16211
|
args[_i - 2] = arguments[_i];
|
|
16212
16212
|
}
|
|
16213
16213
|
if (on === true) {
|
|
16214
|
-
|
|
16214
|
+
reset2();
|
|
16215
16215
|
return;
|
|
16216
16216
|
}
|
|
16217
16217
|
if (on === false) {
|
|
@@ -16220,7 +16220,7 @@ var require_share = __commonJS({
|
|
|
16220
16220
|
var onSubscriber = new Subscriber_1.SafeSubscriber({
|
|
16221
16221
|
next: function() {
|
|
16222
16222
|
onSubscriber.unsubscribe();
|
|
16223
|
-
|
|
16223
|
+
reset2();
|
|
16224
16224
|
}
|
|
16225
16225
|
});
|
|
16226
16226
|
return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray2([], __read2(args)))).subscribe(onSubscriber);
|
|
@@ -20478,22 +20478,22 @@ var require_tinycolor = __commonJS({
|
|
|
20478
20478
|
};
|
|
20479
20479
|
}
|
|
20480
20480
|
function rgbToHex(r, g, b, allow3Char) {
|
|
20481
|
-
var
|
|
20482
|
-
if (allow3Char &&
|
|
20483
|
-
return
|
|
20481
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
20482
|
+
if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {
|
|
20483
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);
|
|
20484
20484
|
}
|
|
20485
|
-
return
|
|
20485
|
+
return hex.join("");
|
|
20486
20486
|
}
|
|
20487
20487
|
function rgbaToHex(r, g, b, a, allow4Char) {
|
|
20488
|
-
var
|
|
20489
|
-
if (allow4Char &&
|
|
20490
|
-
return
|
|
20488
|
+
var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];
|
|
20489
|
+
if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {
|
|
20490
|
+
return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);
|
|
20491
20491
|
}
|
|
20492
|
-
return
|
|
20492
|
+
return hex.join("");
|
|
20493
20493
|
}
|
|
20494
20494
|
function rgbaToArgbHex(r, g, b, a) {
|
|
20495
|
-
var
|
|
20496
|
-
return
|
|
20495
|
+
var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];
|
|
20496
|
+
return hex.join("");
|
|
20497
20497
|
}
|
|
20498
20498
|
tinycolor.equals = function(color1, color2) {
|
|
20499
20499
|
if (!color1 || !color2)
|
|
@@ -45010,7 +45010,7 @@ var require_acorn = __commonJS({
|
|
|
45010
45010
|
this.groupNames = [];
|
|
45011
45011
|
this.backReferenceNames = [];
|
|
45012
45012
|
};
|
|
45013
|
-
RegExpValidationState.prototype.reset = function
|
|
45013
|
+
RegExpValidationState.prototype.reset = function reset2(start, pattern, flags) {
|
|
45014
45014
|
var unicodeSets = flags.indexOf("v") !== -1;
|
|
45015
45015
|
var unicode = flags.indexOf("u") !== -1;
|
|
45016
45016
|
this.start = start | 0;
|
|
@@ -49631,7 +49631,7 @@ ${getTopLevelAwaitHint()}`);
|
|
|
49631
49631
|
nodeReplServer = repl;
|
|
49632
49632
|
context = repl.context;
|
|
49633
49633
|
const resetEval = appendToEvalState(state, "");
|
|
49634
|
-
function
|
|
49634
|
+
function reset2() {
|
|
49635
49635
|
resetEval();
|
|
49636
49636
|
runInContext("exports = module.exports", state.path, context);
|
|
49637
49637
|
if (forceToBeModule) {
|
|
@@ -49643,8 +49643,8 @@ ${module_1.builtinModules.filter((name) => !name.startsWith("_") && !name.includ
|
|
|
49643
49643
|
`;
|
|
49644
49644
|
}
|
|
49645
49645
|
}
|
|
49646
|
-
|
|
49647
|
-
repl.on("reset",
|
|
49646
|
+
reset2();
|
|
49647
|
+
repl.on("reset", reset2);
|
|
49648
49648
|
repl.defineCommand("type", {
|
|
49649
49649
|
help: "Check the type of a TypeScript identifier",
|
|
49650
49650
|
action: function(identifier) {
|
|
@@ -61444,6 +61444,7 @@ var LogLevel = {
|
|
|
61444
61444
|
ERROR: 20,
|
|
61445
61445
|
WARN: 30,
|
|
61446
61446
|
INFO: 40,
|
|
61447
|
+
SUCCESS: 45,
|
|
61447
61448
|
DEBUG: 60,
|
|
61448
61449
|
TRACE: 70,
|
|
61449
61450
|
ALL: 100
|
|
@@ -65241,6 +65242,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
65241
65242
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
65242
65243
|
var getLogLevel = (label) => {
|
|
65243
65244
|
switch (label) {
|
|
65245
|
+
case "all":
|
|
65246
|
+
return LogLevel.ALL;
|
|
65244
65247
|
case "trace":
|
|
65245
65248
|
return LogLevel.TRACE;
|
|
65246
65249
|
case "debug":
|
|
@@ -65260,6 +65263,9 @@ var getLogLevel = (label) => {
|
|
|
65260
65263
|
}
|
|
65261
65264
|
};
|
|
65262
65265
|
var getLogLevelLabel = (logLevel) => {
|
|
65266
|
+
if (logLevel >= LogLevel.ALL) {
|
|
65267
|
+
return LogLevelLabel.ALL;
|
|
65268
|
+
}
|
|
65263
65269
|
if (logLevel >= LogLevel.TRACE) {
|
|
65264
65270
|
return LogLevelLabel.TRACE;
|
|
65265
65271
|
}
|
|
@@ -65284,71 +65290,100 @@ var getLogLevelLabel = (logLevel) => {
|
|
|
65284
65290
|
return LogLevelLabel.INFO;
|
|
65285
65291
|
};
|
|
65286
65292
|
|
|
65287
|
-
// packages/config-tools/src/
|
|
65288
|
-
var
|
|
65289
|
-
|
|
65290
|
-
|
|
65291
|
-
|
|
65292
|
-
if (name) {
|
|
65293
|
-
ret[name] = process.env[key];
|
|
65294
|
-
}
|
|
65295
|
-
return ret;
|
|
65296
|
-
}, {});
|
|
65297
|
-
};
|
|
65298
|
-
var getConfigEnv = () => {
|
|
65299
|
-
const prefix = "STORM_";
|
|
65300
|
-
let config = {
|
|
65301
|
-
name: process.env[`${prefix}NAME`],
|
|
65302
|
-
namespace: process.env[`${prefix}NAMESPACE`],
|
|
65303
|
-
owner: process.env[`${prefix}OWNER`],
|
|
65304
|
-
worker: process.env[`${prefix}WORKER`],
|
|
65305
|
-
organization: process.env[`${prefix}ORGANIZATION`],
|
|
65306
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
65307
|
-
license: process.env[`${prefix}LICENSE`],
|
|
65308
|
-
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
65309
|
-
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
65310
|
-
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
65311
|
-
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
65312
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
65313
|
-
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
65314
|
-
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
65315
|
-
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
65316
|
-
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
65317
|
-
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
65318
|
-
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
65319
|
-
colors: {
|
|
65320
|
-
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
65321
|
-
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
65322
|
-
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
65323
|
-
info: process.env[`${prefix}COLOR_INFO`],
|
|
65324
|
-
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
65325
|
-
error: process.env[`${prefix}COLOR_ERROR`],
|
|
65326
|
-
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
65327
|
-
},
|
|
65328
|
-
repository: process.env[`${prefix}REPOSITORY`],
|
|
65329
|
-
branch: process.env[`${prefix}BRANCH`],
|
|
65330
|
-
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
65331
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
65332
|
-
extensions: {}
|
|
65333
|
-
};
|
|
65334
|
-
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
65335
|
-
if (serializedConfig) {
|
|
65336
|
-
const parsed = JSON.parse(serializedConfig);
|
|
65337
|
-
config = {
|
|
65338
|
-
...config,
|
|
65339
|
-
...parsed,
|
|
65340
|
-
colors: { ...config.colors, ...parsed.colors },
|
|
65341
|
-
extensions: { ...config.extensions, ...parsed.extensions }
|
|
65293
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
65294
|
+
var chalk = __toESM(require_source(), 1);
|
|
65295
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
65296
|
+
if (typeof logLevel === "number" && (logLevel >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL) || logLevel <= LogLevel.SILENT) || typeof logLevel === "string" && getLogLevel(logLevel) >= getLogLevel(config.logLevel ?? process.env?.STORM_LOG_LEVEL)) {
|
|
65297
|
+
return (_) => {
|
|
65342
65298
|
};
|
|
65343
65299
|
}
|
|
65344
|
-
|
|
65345
|
-
|
|
65346
|
-
|
|
65347
|
-
|
|
65348
|
-
|
|
65349
|
-
|
|
65350
|
-
|
|
65351
|
-
|
|
65300
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
65301
|
+
return (message) => {
|
|
65302
|
+
console.error(
|
|
65303
|
+
` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
65304
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
65305
|
+
)(message)}
|
|
65306
|
+
`
|
|
65307
|
+
);
|
|
65308
|
+
};
|
|
65309
|
+
}
|
|
65310
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
65311
|
+
return (message) => {
|
|
65312
|
+
console.error(
|
|
65313
|
+
` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
65314
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
65315
|
+
)(message)}
|
|
65316
|
+
`
|
|
65317
|
+
);
|
|
65318
|
+
};
|
|
65319
|
+
}
|
|
65320
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
65321
|
+
return (message) => {
|
|
65322
|
+
console.warn(
|
|
65323
|
+
` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
65324
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
65325
|
+
)(message)}
|
|
65326
|
+
`
|
|
65327
|
+
);
|
|
65328
|
+
};
|
|
65329
|
+
}
|
|
65330
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
65331
|
+
return (message) => {
|
|
65332
|
+
console.info(
|
|
65333
|
+
` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
65334
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
65335
|
+
)(message)}
|
|
65336
|
+
`
|
|
65337
|
+
);
|
|
65338
|
+
};
|
|
65339
|
+
}
|
|
65340
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
65341
|
+
return (message) => {
|
|
65342
|
+
console.info(
|
|
65343
|
+
` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
|
|
65344
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
65345
|
+
)(message)}
|
|
65346
|
+
`
|
|
65347
|
+
);
|
|
65348
|
+
};
|
|
65349
|
+
}
|
|
65350
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
65351
|
+
return (message) => {
|
|
65352
|
+
console.debug(
|
|
65353
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
65354
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
65355
|
+
)(message)}
|
|
65356
|
+
`
|
|
65357
|
+
);
|
|
65358
|
+
};
|
|
65359
|
+
}
|
|
65360
|
+
return (message) => {
|
|
65361
|
+
console.log(
|
|
65362
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
65363
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
65364
|
+
)(message)}
|
|
65365
|
+
`
|
|
65366
|
+
);
|
|
65367
|
+
};
|
|
65368
|
+
};
|
|
65369
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
65370
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
65371
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
65372
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
65373
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
65374
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
65375
|
+
var getStopwatch = (name) => {
|
|
65376
|
+
const start = process.hrtime();
|
|
65377
|
+
return () => {
|
|
65378
|
+
const end = process.hrtime(start);
|
|
65379
|
+
console.info(
|
|
65380
|
+
chalk.dim(
|
|
65381
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
65382
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
65383
|
+
)}ms to complete`
|
|
65384
|
+
)
|
|
65385
|
+
);
|
|
65386
|
+
};
|
|
65352
65387
|
};
|
|
65353
65388
|
|
|
65354
65389
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -65485,8 +65520,82 @@ var setConfigEnv = (config) => {
|
|
|
65485
65520
|
}
|
|
65486
65521
|
};
|
|
65487
65522
|
|
|
65488
|
-
// packages/
|
|
65489
|
-
var
|
|
65523
|
+
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
65524
|
+
var prepareWorkspace = async () => {
|
|
65525
|
+
const _STORM_CONFIG = getDefaultConfig({
|
|
65526
|
+
...await getConfigFile(),
|
|
65527
|
+
...getConfigEnv()
|
|
65528
|
+
});
|
|
65529
|
+
setConfigEnv(_STORM_CONFIG);
|
|
65530
|
+
return _STORM_CONFIG;
|
|
65531
|
+
};
|
|
65532
|
+
|
|
65533
|
+
// packages/config-tools/src/env/get-env.ts
|
|
65534
|
+
var getExtensionEnv = (extensionName) => {
|
|
65535
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
65536
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
65537
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
65538
|
+
if (name) {
|
|
65539
|
+
ret[name] = process.env[key];
|
|
65540
|
+
}
|
|
65541
|
+
return ret;
|
|
65542
|
+
}, {});
|
|
65543
|
+
};
|
|
65544
|
+
var getConfigEnv = () => {
|
|
65545
|
+
const prefix = "STORM_";
|
|
65546
|
+
let config = {
|
|
65547
|
+
name: process.env[`${prefix}NAME`],
|
|
65548
|
+
namespace: process.env[`${prefix}NAMESPACE`],
|
|
65549
|
+
owner: process.env[`${prefix}OWNER`],
|
|
65550
|
+
worker: process.env[`${prefix}WORKER`],
|
|
65551
|
+
organization: process.env[`${prefix}ORGANIZATION`],
|
|
65552
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
65553
|
+
license: process.env[`${prefix}LICENSE`],
|
|
65554
|
+
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
65555
|
+
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
65556
|
+
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
65557
|
+
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
65558
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
65559
|
+
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
65560
|
+
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
65561
|
+
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
65562
|
+
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
65563
|
+
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
65564
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
65565
|
+
colors: {
|
|
65566
|
+
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
65567
|
+
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
65568
|
+
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
65569
|
+
info: process.env[`${prefix}COLOR_INFO`],
|
|
65570
|
+
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
65571
|
+
error: process.env[`${prefix}COLOR_ERROR`],
|
|
65572
|
+
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
65573
|
+
},
|
|
65574
|
+
repository: process.env[`${prefix}REPOSITORY`],
|
|
65575
|
+
branch: process.env[`${prefix}BRANCH`],
|
|
65576
|
+
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
65577
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
65578
|
+
extensions: {}
|
|
65579
|
+
};
|
|
65580
|
+
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
65581
|
+
if (serializedConfig) {
|
|
65582
|
+
const parsed = JSON.parse(serializedConfig);
|
|
65583
|
+
config = {
|
|
65584
|
+
...config,
|
|
65585
|
+
...parsed,
|
|
65586
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
65587
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
65588
|
+
};
|
|
65589
|
+
}
|
|
65590
|
+
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
65591
|
+
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
65592
|
+
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
65593
|
+
if (extensionName) {
|
|
65594
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
65595
|
+
}
|
|
65596
|
+
return ret;
|
|
65597
|
+
}, config);
|
|
65598
|
+
};
|
|
65490
65599
|
|
|
65491
65600
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
65492
65601
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -65575,12 +65684,12 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
65575
65684
|
|
|
65576
65685
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
65577
65686
|
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
65578
|
-
const
|
|
65687
|
+
const stopwatch = getStopwatch(name);
|
|
65579
65688
|
let options = _options;
|
|
65689
|
+
let config;
|
|
65580
65690
|
try {
|
|
65581
|
-
|
|
65582
|
-
|
|
65583
|
-
`));
|
|
65691
|
+
writeInfo(config, `\u26A1 Running the ${name} executor...
|
|
65692
|
+
`);
|
|
65584
65693
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
65585
65694
|
throw new Error(
|
|
65586
65695
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -65590,35 +65699,33 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
65590
65699
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
65591
65700
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
65592
65701
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
65593
|
-
let config;
|
|
65594
65702
|
if (!executorOptions.skipReadingConfig) {
|
|
65595
|
-
|
|
65596
|
-
|
|
65597
|
-
|
|
65598
|
-
-
|
|
65599
|
-
-
|
|
65600
|
-
-
|
|
65601
|
-
|
|
65602
|
-
);
|
|
65603
|
-
config = getDefaultConfig({
|
|
65604
|
-
...await getConfigFile(),
|
|
65605
|
-
...getConfigEnv()
|
|
65606
|
-
});
|
|
65607
|
-
setConfigEnv(config);
|
|
65608
|
-
getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.info(
|
|
65609
|
-
chalk.dim(
|
|
65610
|
-
`Loaded Storm config into env:
|
|
65611
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}
|
|
65703
|
+
writeDebug(
|
|
65704
|
+
config,
|
|
65705
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
65706
|
+
- workspaceRoot: ${workspaceRoot}
|
|
65707
|
+
- projectRoot: ${projectRoot}
|
|
65708
|
+
- sourceRoot: ${sourceRoot}
|
|
65709
|
+
- projectName: ${projectName}
|
|
65612
65710
|
`
|
|
65613
|
-
|
|
65711
|
+
);
|
|
65712
|
+
config = await prepareWorkspace();
|
|
65713
|
+
writeTrace(
|
|
65714
|
+
config,
|
|
65715
|
+
`Loaded Storm config into env:
|
|
65716
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
|
|
65614
65717
|
);
|
|
65615
65718
|
}
|
|
65616
65719
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
65617
|
-
|
|
65720
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
65618
65721
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
65619
|
-
|
|
65722
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
65620
65723
|
}
|
|
65621
|
-
|
|
65724
|
+
writeTrace(
|
|
65725
|
+
config,
|
|
65726
|
+
`Executor schema options \u2699\uFE0F
|
|
65727
|
+
${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
|
|
65728
|
+
);
|
|
65622
65729
|
const tokenized = applyWorkspaceTokens(
|
|
65623
65730
|
options,
|
|
65624
65731
|
{
|
|
@@ -65633,9 +65740,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
65633
65740
|
applyWorkspaceExecutorTokens
|
|
65634
65741
|
);
|
|
65635
65742
|
if (executorOptions?.hooks?.preProcess) {
|
|
65636
|
-
|
|
65743
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
65637
65744
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
65638
|
-
|
|
65745
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
65639
65746
|
}
|
|
65640
65747
|
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
65641
65748
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -65644,34 +65751,31 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
65644
65751
|
});
|
|
65645
65752
|
}
|
|
65646
65753
|
if (executorOptions?.hooks?.postProcess) {
|
|
65647
|
-
|
|
65754
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
65648
65755
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
65649
|
-
|
|
65756
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
65650
65757
|
}
|
|
65651
|
-
|
|
65652
|
-
|
|
65653
|
-
|
|
65654
|
-
\u{1F389} Successfully completed running the ${name} executor!
|
|
65655
|
-
|
|
65656
|
-
`)
|
|
65657
|
-
);
|
|
65758
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
65759
|
+
`);
|
|
65658
65760
|
return {
|
|
65659
65761
|
success: true
|
|
65660
65762
|
};
|
|
65661
65763
|
} catch (error) {
|
|
65662
|
-
|
|
65663
|
-
|
|
65664
|
-
error
|
|
65764
|
+
writeFatal(
|
|
65765
|
+
config,
|
|
65766
|
+
"A fatal error occurred while running the executor - the process was forced to terminate"
|
|
65767
|
+
);
|
|
65768
|
+
writeError(
|
|
65769
|
+
config,
|
|
65770
|
+
`An exception was thrown in the executor's process
|
|
65771
|
+
- Details: ${error.message}
|
|
65772
|
+
- Stacktrace: ${error.stack}`
|
|
65665
65773
|
);
|
|
65666
65774
|
return {
|
|
65667
65775
|
success: false
|
|
65668
65776
|
};
|
|
65669
65777
|
} finally {
|
|
65670
|
-
|
|
65671
|
-
chalk.dim(
|
|
65672
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
65673
|
-
)
|
|
65674
|
-
);
|
|
65778
|
+
stopwatch();
|
|
65675
65779
|
}
|
|
65676
65780
|
};
|
|
65677
65781
|
|