@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
|
@@ -24382,14 +24382,14 @@ var require_share = __commonJS({
|
|
|
24382
24382
|
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
24383
24383
|
resetConnection = void 0;
|
|
24384
24384
|
};
|
|
24385
|
-
var
|
|
24385
|
+
var reset2 = function() {
|
|
24386
24386
|
cancelReset();
|
|
24387
24387
|
connection = subject = void 0;
|
|
24388
24388
|
hasCompleted = hasErrored = false;
|
|
24389
24389
|
};
|
|
24390
24390
|
var resetAndUnsubscribe = function() {
|
|
24391
24391
|
var conn = connection;
|
|
24392
|
-
|
|
24392
|
+
reset2();
|
|
24393
24393
|
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
24394
24394
|
};
|
|
24395
24395
|
return lift_1.operate(function(source, subscriber) {
|
|
@@ -24413,13 +24413,13 @@ var require_share = __commonJS({
|
|
|
24413
24413
|
error: function(err) {
|
|
24414
24414
|
hasErrored = true;
|
|
24415
24415
|
cancelReset();
|
|
24416
|
-
resetConnection = handleReset(
|
|
24416
|
+
resetConnection = handleReset(reset2, resetOnError, err);
|
|
24417
24417
|
dest.error(err);
|
|
24418
24418
|
},
|
|
24419
24419
|
complete: function() {
|
|
24420
24420
|
hasCompleted = true;
|
|
24421
24421
|
cancelReset();
|
|
24422
|
-
resetConnection = handleReset(
|
|
24422
|
+
resetConnection = handleReset(reset2, resetOnComplete);
|
|
24423
24423
|
dest.complete();
|
|
24424
24424
|
}
|
|
24425
24425
|
});
|
|
@@ -24429,13 +24429,13 @@ var require_share = __commonJS({
|
|
|
24429
24429
|
};
|
|
24430
24430
|
}
|
|
24431
24431
|
exports.share = share;
|
|
24432
|
-
function handleReset(
|
|
24432
|
+
function handleReset(reset2, on) {
|
|
24433
24433
|
var args = [];
|
|
24434
24434
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
24435
24435
|
args[_i - 2] = arguments[_i];
|
|
24436
24436
|
}
|
|
24437
24437
|
if (on === true) {
|
|
24438
|
-
|
|
24438
|
+
reset2();
|
|
24439
24439
|
return;
|
|
24440
24440
|
}
|
|
24441
24441
|
if (on === false) {
|
|
@@ -24444,7 +24444,7 @@ var require_share = __commonJS({
|
|
|
24444
24444
|
var onSubscriber = new Subscriber_1.SafeSubscriber({
|
|
24445
24445
|
next: function() {
|
|
24446
24446
|
onSubscriber.unsubscribe();
|
|
24447
|
-
|
|
24447
|
+
reset2();
|
|
24448
24448
|
}
|
|
24449
24449
|
});
|
|
24450
24450
|
return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray2([], __read2(args)))).subscribe(onSubscriber);
|
|
@@ -38620,7 +38620,7 @@ var require_array2 = __commonJS({
|
|
|
38620
38620
|
parent.enabled = choices.every((ch) => ch.enabled === true);
|
|
38621
38621
|
parent = parent.parent;
|
|
38622
38622
|
}
|
|
38623
|
-
|
|
38623
|
+
reset2(this, this.choices);
|
|
38624
38624
|
this.emit("toggle", choice, this);
|
|
38625
38625
|
return choice;
|
|
38626
38626
|
}
|
|
@@ -38918,7 +38918,7 @@ var require_array2 = __commonJS({
|
|
|
38918
38918
|
}
|
|
38919
38919
|
}
|
|
38920
38920
|
get choices() {
|
|
38921
|
-
return
|
|
38921
|
+
return reset2(this, this.state.choices || []);
|
|
38922
38922
|
}
|
|
38923
38923
|
set visible(visible) {
|
|
38924
38924
|
this.state.visible = visible;
|
|
@@ -38966,7 +38966,7 @@ var require_array2 = __commonJS({
|
|
|
38966
38966
|
return this.multiple ? this.enabled : this.focused;
|
|
38967
38967
|
}
|
|
38968
38968
|
};
|
|
38969
|
-
function
|
|
38969
|
+
function reset2(prompt, choices) {
|
|
38970
38970
|
if (choices instanceof Promise)
|
|
38971
38971
|
return choices;
|
|
38972
38972
|
if (typeof choices === "function") {
|
|
@@ -46812,7 +46812,7 @@ var require_chunk_UIX4URMV = __commonJS({
|
|
|
46812
46812
|
magentaBright: () => magentaBright,
|
|
46813
46813
|
red: () => red,
|
|
46814
46814
|
redBright: () => redBright,
|
|
46815
|
-
reset: () =>
|
|
46815
|
+
reset: () => reset2,
|
|
46816
46816
|
strikethrough: () => strikethrough,
|
|
46817
46817
|
underline: () => underline,
|
|
46818
46818
|
white: () => white,
|
|
@@ -46889,7 +46889,7 @@ var require_chunk_UIX4URMV = __commonJS({
|
|
|
46889
46889
|
{}
|
|
46890
46890
|
);
|
|
46891
46891
|
var {
|
|
46892
|
-
reset,
|
|
46892
|
+
reset: reset2,
|
|
46893
46893
|
bold: bold2,
|
|
46894
46894
|
dim: dim2,
|
|
46895
46895
|
italic,
|
|
@@ -78733,7 +78733,7 @@ var require_rollup = __commonJS({
|
|
|
78733
78733
|
{}
|
|
78734
78734
|
);
|
|
78735
78735
|
var {
|
|
78736
|
-
reset,
|
|
78736
|
+
reset: reset2,
|
|
78737
78737
|
bold: bold$1,
|
|
78738
78738
|
dim: dim$1,
|
|
78739
78739
|
italic,
|
|
@@ -93603,19 +93603,19 @@ ${outro}`;
|
|
|
93603
93603
|
function keep(key, value) {
|
|
93604
93604
|
if (++num > limit) {
|
|
93605
93605
|
prev = curr;
|
|
93606
|
-
|
|
93606
|
+
reset3(1);
|
|
93607
93607
|
++num;
|
|
93608
93608
|
}
|
|
93609
93609
|
curr[key] = value;
|
|
93610
93610
|
}
|
|
93611
|
-
function
|
|
93611
|
+
function reset3(isPartial) {
|
|
93612
93612
|
num = 0;
|
|
93613
93613
|
curr = /* @__PURE__ */ Object.create(null);
|
|
93614
93614
|
isPartial || (prev = /* @__PURE__ */ Object.create(null));
|
|
93615
93615
|
}
|
|
93616
|
-
|
|
93616
|
+
reset3();
|
|
93617
93617
|
return {
|
|
93618
|
-
clear:
|
|
93618
|
+
clear: reset3,
|
|
93619
93619
|
has: function(key) {
|
|
93620
93620
|
return curr[key] !== void 0 || prev[key] !== void 0;
|
|
93621
93621
|
},
|
|
@@ -126346,6 +126346,7 @@ var LogLevel = {
|
|
|
126346
126346
|
ERROR: 20,
|
|
126347
126347
|
WARN: 30,
|
|
126348
126348
|
INFO: 40,
|
|
126349
|
+
SUCCESS: 45,
|
|
126349
126350
|
DEBUG: 60,
|
|
126350
126351
|
TRACE: 70,
|
|
126351
126352
|
ALL: 100
|
|
@@ -130143,6 +130144,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
130143
130144
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
130144
130145
|
var getLogLevel = (label) => {
|
|
130145
130146
|
switch (label) {
|
|
130147
|
+
case "all":
|
|
130148
|
+
return LogLevel.ALL;
|
|
130146
130149
|
case "trace":
|
|
130147
130150
|
return LogLevel.TRACE;
|
|
130148
130151
|
case "debug":
|
|
@@ -130162,6 +130165,9 @@ var getLogLevel = (label) => {
|
|
|
130162
130165
|
}
|
|
130163
130166
|
};
|
|
130164
130167
|
var getLogLevelLabel = (logLevel) => {
|
|
130168
|
+
if (logLevel >= LogLevel.ALL) {
|
|
130169
|
+
return LogLevelLabel.ALL;
|
|
130170
|
+
}
|
|
130165
130171
|
if (logLevel >= LogLevel.TRACE) {
|
|
130166
130172
|
return LogLevelLabel.TRACE;
|
|
130167
130173
|
}
|
|
@@ -130186,71 +130192,100 @@ var getLogLevelLabel = (logLevel) => {
|
|
|
130186
130192
|
return LogLevelLabel.INFO;
|
|
130187
130193
|
};
|
|
130188
130194
|
|
|
130189
|
-
// packages/config-tools/src/
|
|
130190
|
-
var
|
|
130191
|
-
|
|
130192
|
-
|
|
130193
|
-
|
|
130194
|
-
if (name) {
|
|
130195
|
-
ret[name] = process.env[key];
|
|
130196
|
-
}
|
|
130197
|
-
return ret;
|
|
130198
|
-
}, {});
|
|
130199
|
-
};
|
|
130200
|
-
var getConfigEnv = () => {
|
|
130201
|
-
const prefix = "STORM_";
|
|
130202
|
-
let config = {
|
|
130203
|
-
name: process.env[`${prefix}NAME`],
|
|
130204
|
-
namespace: process.env[`${prefix}NAMESPACE`],
|
|
130205
|
-
owner: process.env[`${prefix}OWNER`],
|
|
130206
|
-
worker: process.env[`${prefix}WORKER`],
|
|
130207
|
-
organization: process.env[`${prefix}ORGANIZATION`],
|
|
130208
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
130209
|
-
license: process.env[`${prefix}LICENSE`],
|
|
130210
|
-
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
130211
|
-
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
130212
|
-
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
130213
|
-
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
130214
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
130215
|
-
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
130216
|
-
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
130217
|
-
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
130218
|
-
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
130219
|
-
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
130220
|
-
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
130221
|
-
colors: {
|
|
130222
|
-
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
130223
|
-
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
130224
|
-
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
130225
|
-
info: process.env[`${prefix}COLOR_INFO`],
|
|
130226
|
-
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
130227
|
-
error: process.env[`${prefix}COLOR_ERROR`],
|
|
130228
|
-
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
130229
|
-
},
|
|
130230
|
-
repository: process.env[`${prefix}REPOSITORY`],
|
|
130231
|
-
branch: process.env[`${prefix}BRANCH`],
|
|
130232
|
-
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
130233
|
-
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,
|
|
130234
|
-
extensions: {}
|
|
130235
|
-
};
|
|
130236
|
-
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
130237
|
-
if (serializedConfig) {
|
|
130238
|
-
const parsed = JSON.parse(serializedConfig);
|
|
130239
|
-
config = {
|
|
130240
|
-
...config,
|
|
130241
|
-
...parsed,
|
|
130242
|
-
colors: { ...config.colors, ...parsed.colors },
|
|
130243
|
-
extensions: { ...config.extensions, ...parsed.extensions }
|
|
130195
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
130196
|
+
var chalk = __toESM(require_source(), 1);
|
|
130197
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
130198
|
+
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)) {
|
|
130199
|
+
return (_) => {
|
|
130244
130200
|
};
|
|
130245
130201
|
}
|
|
130246
|
-
|
|
130247
|
-
|
|
130248
|
-
|
|
130249
|
-
|
|
130250
|
-
|
|
130251
|
-
|
|
130252
|
-
|
|
130253
|
-
|
|
130202
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
130203
|
+
return (message) => {
|
|
130204
|
+
console.error(
|
|
130205
|
+
` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
130206
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
130207
|
+
)(message)}
|
|
130208
|
+
`
|
|
130209
|
+
);
|
|
130210
|
+
};
|
|
130211
|
+
}
|
|
130212
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
130213
|
+
return (message) => {
|
|
130214
|
+
console.error(
|
|
130215
|
+
` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
130216
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
130217
|
+
)(message)}
|
|
130218
|
+
`
|
|
130219
|
+
);
|
|
130220
|
+
};
|
|
130221
|
+
}
|
|
130222
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
130223
|
+
return (message) => {
|
|
130224
|
+
console.warn(
|
|
130225
|
+
` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
130226
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
130227
|
+
)(message)}
|
|
130228
|
+
`
|
|
130229
|
+
);
|
|
130230
|
+
};
|
|
130231
|
+
}
|
|
130232
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130233
|
+
return (message) => {
|
|
130234
|
+
console.info(
|
|
130235
|
+
` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
130236
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
130237
|
+
)(message)}
|
|
130238
|
+
`
|
|
130239
|
+
);
|
|
130240
|
+
};
|
|
130241
|
+
}
|
|
130242
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130243
|
+
return (message) => {
|
|
130244
|
+
console.info(
|
|
130245
|
+
` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
|
|
130246
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
130247
|
+
)(message)}
|
|
130248
|
+
`
|
|
130249
|
+
);
|
|
130250
|
+
};
|
|
130251
|
+
}
|
|
130252
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
130253
|
+
return (message) => {
|
|
130254
|
+
console.debug(
|
|
130255
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
130256
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130257
|
+
)(message)}
|
|
130258
|
+
`
|
|
130259
|
+
);
|
|
130260
|
+
};
|
|
130261
|
+
}
|
|
130262
|
+
return (message) => {
|
|
130263
|
+
console.log(
|
|
130264
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
130265
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130266
|
+
)(message)}
|
|
130267
|
+
`
|
|
130268
|
+
);
|
|
130269
|
+
};
|
|
130270
|
+
};
|
|
130271
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
130272
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
130273
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
130274
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
130275
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
130276
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
130277
|
+
var getStopwatch = (name) => {
|
|
130278
|
+
const start = process.hrtime();
|
|
130279
|
+
return () => {
|
|
130280
|
+
const end = process.hrtime(start);
|
|
130281
|
+
console.info(
|
|
130282
|
+
chalk.dim(
|
|
130283
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
130284
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
130285
|
+
)}ms to complete`
|
|
130286
|
+
)
|
|
130287
|
+
);
|
|
130288
|
+
};
|
|
130254
130289
|
};
|
|
130255
130290
|
|
|
130256
130291
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -130387,8 +130422,82 @@ var setConfigEnv = (config) => {
|
|
|
130387
130422
|
}
|
|
130388
130423
|
};
|
|
130389
130424
|
|
|
130390
|
-
// packages/
|
|
130391
|
-
var
|
|
130425
|
+
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
130426
|
+
var prepareWorkspace = async () => {
|
|
130427
|
+
const _STORM_CONFIG = getDefaultConfig({
|
|
130428
|
+
...await getConfigFile(),
|
|
130429
|
+
...getConfigEnv()
|
|
130430
|
+
});
|
|
130431
|
+
setConfigEnv(_STORM_CONFIG);
|
|
130432
|
+
return _STORM_CONFIG;
|
|
130433
|
+
};
|
|
130434
|
+
|
|
130435
|
+
// packages/config-tools/src/env/get-env.ts
|
|
130436
|
+
var getExtensionEnv = (extensionName) => {
|
|
130437
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
130438
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
130439
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
130440
|
+
if (name) {
|
|
130441
|
+
ret[name] = process.env[key];
|
|
130442
|
+
}
|
|
130443
|
+
return ret;
|
|
130444
|
+
}, {});
|
|
130445
|
+
};
|
|
130446
|
+
var getConfigEnv = () => {
|
|
130447
|
+
const prefix = "STORM_";
|
|
130448
|
+
let config = {
|
|
130449
|
+
name: process.env[`${prefix}NAME`],
|
|
130450
|
+
namespace: process.env[`${prefix}NAMESPACE`],
|
|
130451
|
+
owner: process.env[`${prefix}OWNER`],
|
|
130452
|
+
worker: process.env[`${prefix}WORKER`],
|
|
130453
|
+
organization: process.env[`${prefix}ORGANIZATION`],
|
|
130454
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
130455
|
+
license: process.env[`${prefix}LICENSE`],
|
|
130456
|
+
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
130457
|
+
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
130458
|
+
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
130459
|
+
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
130460
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
130461
|
+
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
130462
|
+
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
130463
|
+
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
130464
|
+
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
130465
|
+
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
130466
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
130467
|
+
colors: {
|
|
130468
|
+
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
130469
|
+
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
130470
|
+
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
130471
|
+
info: process.env[`${prefix}COLOR_INFO`],
|
|
130472
|
+
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
130473
|
+
error: process.env[`${prefix}COLOR_ERROR`],
|
|
130474
|
+
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
130475
|
+
},
|
|
130476
|
+
repository: process.env[`${prefix}REPOSITORY`],
|
|
130477
|
+
branch: process.env[`${prefix}BRANCH`],
|
|
130478
|
+
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
130479
|
+
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,
|
|
130480
|
+
extensions: {}
|
|
130481
|
+
};
|
|
130482
|
+
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
130483
|
+
if (serializedConfig) {
|
|
130484
|
+
const parsed = JSON.parse(serializedConfig);
|
|
130485
|
+
config = {
|
|
130486
|
+
...config,
|
|
130487
|
+
...parsed,
|
|
130488
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
130489
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
130490
|
+
};
|
|
130491
|
+
}
|
|
130492
|
+
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
130493
|
+
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
130494
|
+
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("");
|
|
130495
|
+
if (extensionName) {
|
|
130496
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
130497
|
+
}
|
|
130498
|
+
return ret;
|
|
130499
|
+
}, config);
|
|
130500
|
+
};
|
|
130392
130501
|
|
|
130393
130502
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
130394
130503
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -130477,12 +130586,12 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
130477
130586
|
|
|
130478
130587
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
130479
130588
|
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
130480
|
-
const
|
|
130589
|
+
const stopwatch = getStopwatch(name);
|
|
130481
130590
|
let options = _options;
|
|
130591
|
+
let config;
|
|
130482
130592
|
try {
|
|
130483
|
-
|
|
130484
|
-
|
|
130485
|
-
`));
|
|
130593
|
+
writeInfo(config, `\u26A1 Running the ${name} executor...
|
|
130594
|
+
`);
|
|
130486
130595
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
130487
130596
|
throw new Error(
|
|
130488
130597
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -130492,35 +130601,33 @@ var withRunExecutor = (name, executorFn, executorOptions) => async (_options, co
|
|
|
130492
130601
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
130493
130602
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
130494
130603
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
130495
|
-
let config;
|
|
130496
130604
|
if (!executorOptions.skipReadingConfig) {
|
|
130497
|
-
|
|
130498
|
-
|
|
130499
|
-
|
|
130500
|
-
-
|
|
130501
|
-
-
|
|
130502
|
-
-
|
|
130503
|
-
|
|
130504
|
-
);
|
|
130505
|
-
config = getDefaultConfig({
|
|
130506
|
-
...await getConfigFile(),
|
|
130507
|
-
...getConfigEnv()
|
|
130508
|
-
});
|
|
130509
|
-
setConfigEnv(config);
|
|
130510
|
-
getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.info(
|
|
130511
|
-
chalk.dim(
|
|
130512
|
-
`Loaded Storm config into env:
|
|
130513
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}
|
|
130605
|
+
writeDebug(
|
|
130606
|
+
config,
|
|
130607
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
130608
|
+
- workspaceRoot: ${workspaceRoot}
|
|
130609
|
+
- projectRoot: ${projectRoot}
|
|
130610
|
+
- sourceRoot: ${sourceRoot}
|
|
130611
|
+
- projectName: ${projectName}
|
|
130514
130612
|
`
|
|
130515
|
-
|
|
130613
|
+
);
|
|
130614
|
+
config = await prepareWorkspace();
|
|
130615
|
+
writeTrace(
|
|
130616
|
+
config,
|
|
130617
|
+
`Loaded Storm config into env:
|
|
130618
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
|
|
130516
130619
|
);
|
|
130517
130620
|
}
|
|
130518
130621
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
130519
|
-
|
|
130622
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
130520
130623
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
130521
|
-
|
|
130624
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
130522
130625
|
}
|
|
130523
|
-
|
|
130626
|
+
writeTrace(
|
|
130627
|
+
config,
|
|
130628
|
+
`Executor schema options \u2699\uFE0F
|
|
130629
|
+
${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
|
|
130630
|
+
);
|
|
130524
130631
|
const tokenized = applyWorkspaceTokens(
|
|
130525
130632
|
options,
|
|
130526
130633
|
{
|
|
@@ -130535,9 +130642,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130535
130642
|
applyWorkspaceExecutorTokens
|
|
130536
130643
|
);
|
|
130537
130644
|
if (executorOptions?.hooks?.preProcess) {
|
|
130538
|
-
|
|
130645
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
130539
130646
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
130540
|
-
|
|
130647
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
130541
130648
|
}
|
|
130542
130649
|
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
130543
130650
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -130546,34 +130653,31 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130546
130653
|
});
|
|
130547
130654
|
}
|
|
130548
130655
|
if (executorOptions?.hooks?.postProcess) {
|
|
130549
|
-
|
|
130656
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
130550
130657
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
130551
|
-
|
|
130658
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
130552
130659
|
}
|
|
130553
|
-
|
|
130554
|
-
|
|
130555
|
-
|
|
130556
|
-
\u{1F389} Successfully completed running the ${name} executor!
|
|
130557
|
-
|
|
130558
|
-
`)
|
|
130559
|
-
);
|
|
130660
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
130661
|
+
`);
|
|
130560
130662
|
return {
|
|
130561
130663
|
success: true
|
|
130562
130664
|
};
|
|
130563
130665
|
} catch (error) {
|
|
130564
|
-
|
|
130565
|
-
|
|
130566
|
-
error
|
|
130666
|
+
writeFatal(
|
|
130667
|
+
config,
|
|
130668
|
+
"A fatal error occurred while running the executor - the process was forced to terminate"
|
|
130669
|
+
);
|
|
130670
|
+
writeError(
|
|
130671
|
+
config,
|
|
130672
|
+
`An exception was thrown in the executor's process
|
|
130673
|
+
- Details: ${error.message}
|
|
130674
|
+
- Stacktrace: ${error.stack}`
|
|
130567
130675
|
);
|
|
130568
130676
|
return {
|
|
130569
130677
|
success: false
|
|
130570
130678
|
};
|
|
130571
130679
|
} finally {
|
|
130572
|
-
|
|
130573
|
-
chalk.dim(
|
|
130574
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
130575
|
-
)
|
|
130576
|
-
);
|
|
130680
|
+
stopwatch();
|
|
130577
130681
|
}
|
|
130578
130682
|
};
|
|
130579
130683
|
|
|
@@ -136914,9 +137018,10 @@ function defaultConfig({
|
|
|
136914
137018
|
outExtension
|
|
136915
137019
|
};
|
|
136916
137020
|
}
|
|
136917
|
-
function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig,
|
|
137021
|
+
function getConfig(workspaceRoot, projectRoot, getConfigFn, { outputPath, tsConfig, platform, ...rest }) {
|
|
136918
137022
|
return getConfigFn({
|
|
136919
137023
|
...rest,
|
|
137024
|
+
additionalEntryPoints: [],
|
|
136920
137025
|
outDir: outputPath,
|
|
136921
137026
|
tsconfig: tsConfig,
|
|
136922
137027
|
workspaceRoot,
|