@storm-software/workspace-tools 1.43.0 → 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 +7 -0
- package/README.md +1 -1
- package/index.js +242 -237
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +229 -224
- package/src/executors/design-tokens/executor.js +168 -156
- package/src/executors/tsup/executor.js +163 -150
- package/src/executors/tsup-browser/executor.js +162 -149
- package/src/executors/tsup-neutral/executor.js +162 -149
- package/src/executors/tsup-node/executor.js +162 -149
- package/src/generators/browser-library/generator.js +302 -209
- package/src/generators/config-schema/generator.js +258 -155
- package/src/generators/neutral-library/generator.js +302 -209
- package/src/generators/node-library/generator.js +302 -209
- package/src/generators/preset/generator.js +257 -154
|
@@ -20174,14 +20174,14 @@ var require_templates = __commonJS({
|
|
|
20174
20174
|
}
|
|
20175
20175
|
return results;
|
|
20176
20176
|
}
|
|
20177
|
-
function buildStyle(
|
|
20177
|
+
function buildStyle(chalk2, styles) {
|
|
20178
20178
|
const enabled = {};
|
|
20179
20179
|
for (const layer of styles) {
|
|
20180
20180
|
for (const style of layer.styles) {
|
|
20181
20181
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
20182
20182
|
}
|
|
20183
20183
|
}
|
|
20184
|
-
let current =
|
|
20184
|
+
let current = chalk2;
|
|
20185
20185
|
for (const styleName of Object.keys(enabled)) {
|
|
20186
20186
|
if (Array.isArray(enabled[styleName])) {
|
|
20187
20187
|
if (!(styleName in current)) {
|
|
@@ -20196,7 +20196,7 @@ var require_templates = __commonJS({
|
|
|
20196
20196
|
}
|
|
20197
20197
|
return current;
|
|
20198
20198
|
}
|
|
20199
|
-
module2.exports = (
|
|
20199
|
+
module2.exports = (chalk2, tmp) => {
|
|
20200
20200
|
const styles = [];
|
|
20201
20201
|
const chunks = [];
|
|
20202
20202
|
let chunk = [];
|
|
@@ -20206,13 +20206,13 @@ var require_templates = __commonJS({
|
|
|
20206
20206
|
} else if (style) {
|
|
20207
20207
|
const str = chunk.join("");
|
|
20208
20208
|
chunk = [];
|
|
20209
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
20209
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk2, styles)(str));
|
|
20210
20210
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
20211
20211
|
} else if (close) {
|
|
20212
20212
|
if (styles.length === 0) {
|
|
20213
20213
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
20214
20214
|
}
|
|
20215
|
-
chunks.push(buildStyle(
|
|
20215
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
20216
20216
|
chunk = [];
|
|
20217
20217
|
styles.pop();
|
|
20218
20218
|
} else {
|
|
@@ -20249,16 +20249,16 @@ var require_chalk = __commonJS({
|
|
|
20249
20249
|
}
|
|
20250
20250
|
function Chalk(options) {
|
|
20251
20251
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
20252
|
-
const
|
|
20253
|
-
applyOptions(
|
|
20254
|
-
|
|
20252
|
+
const chalk2 = {};
|
|
20253
|
+
applyOptions(chalk2, options);
|
|
20254
|
+
chalk2.template = function() {
|
|
20255
20255
|
const args = [].slice.call(arguments);
|
|
20256
|
-
return chalkTag.apply(null, [
|
|
20256
|
+
return chalkTag.apply(null, [chalk2.template].concat(args));
|
|
20257
20257
|
};
|
|
20258
|
-
Object.setPrototypeOf(
|
|
20259
|
-
Object.setPrototypeOf(
|
|
20260
|
-
|
|
20261
|
-
return
|
|
20258
|
+
Object.setPrototypeOf(chalk2, Chalk.prototype);
|
|
20259
|
+
Object.setPrototypeOf(chalk2.template, chalk2);
|
|
20260
|
+
chalk2.template.constructor = Chalk;
|
|
20261
|
+
return chalk2.template;
|
|
20262
20262
|
}
|
|
20263
20263
|
applyOptions(this, options);
|
|
20264
20264
|
}
|
|
@@ -20377,7 +20377,7 @@ var require_chalk = __commonJS({
|
|
|
20377
20377
|
ansiStyles.dim.open = originalDim;
|
|
20378
20378
|
return str;
|
|
20379
20379
|
}
|
|
20380
|
-
function chalkTag(
|
|
20380
|
+
function chalkTag(chalk2, strings) {
|
|
20381
20381
|
if (!Array.isArray(strings)) {
|
|
20382
20382
|
return [].slice.call(arguments, 1).join(" ");
|
|
20383
20383
|
}
|
|
@@ -20387,7 +20387,7 @@ var require_chalk = __commonJS({
|
|
|
20387
20387
|
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
20388
20388
|
parts.push(String(strings.raw[i]));
|
|
20389
20389
|
}
|
|
20390
|
-
return template(
|
|
20390
|
+
return template(chalk2, parts.join(""));
|
|
20391
20391
|
}
|
|
20392
20392
|
Object.defineProperties(Chalk.prototype, styles);
|
|
20393
20393
|
module2.exports = Chalk();
|
|
@@ -20433,17 +20433,17 @@ var require_lib2 = __commonJS({
|
|
|
20433
20433
|
return n.default = e, t && t.set(e, n), n;
|
|
20434
20434
|
}
|
|
20435
20435
|
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
20436
|
-
function getDefs(
|
|
20436
|
+
function getDefs(chalk2) {
|
|
20437
20437
|
return {
|
|
20438
|
-
keyword:
|
|
20439
|
-
capitalized:
|
|
20440
|
-
jsxIdentifier:
|
|
20441
|
-
punctuator:
|
|
20442
|
-
number:
|
|
20443
|
-
string:
|
|
20444
|
-
regex:
|
|
20445
|
-
comment:
|
|
20446
|
-
invalid:
|
|
20438
|
+
keyword: chalk2.cyan,
|
|
20439
|
+
capitalized: chalk2.yellow,
|
|
20440
|
+
jsxIdentifier: chalk2.yellow,
|
|
20441
|
+
punctuator: chalk2.yellow,
|
|
20442
|
+
number: chalk2.magenta,
|
|
20443
|
+
string: chalk2.green,
|
|
20444
|
+
regex: chalk2.magenta,
|
|
20445
|
+
comment: chalk2.grey,
|
|
20446
|
+
invalid: chalk2.white.bgRed.bold
|
|
20447
20447
|
};
|
|
20448
20448
|
}
|
|
20449
20449
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -20574,11 +20574,11 @@ var require_lib3 = __commonJS({
|
|
|
20574
20574
|
return _chalk.default;
|
|
20575
20575
|
}
|
|
20576
20576
|
var deprecationWarningShown = false;
|
|
20577
|
-
function getDefs(
|
|
20577
|
+
function getDefs(chalk2) {
|
|
20578
20578
|
return {
|
|
20579
|
-
gutter:
|
|
20580
|
-
marker:
|
|
20581
|
-
message:
|
|
20579
|
+
gutter: chalk2.grey,
|
|
20580
|
+
marker: chalk2.red.bold,
|
|
20581
|
+
message: chalk2.red.bold
|
|
20582
20582
|
};
|
|
20583
20583
|
}
|
|
20584
20584
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -20640,8 +20640,8 @@ var require_lib3 = __commonJS({
|
|
|
20640
20640
|
}
|
|
20641
20641
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
20642
20642
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
20643
|
-
const
|
|
20644
|
-
const defs = getDefs(
|
|
20643
|
+
const chalk2 = getChalk(opts.forceColor);
|
|
20644
|
+
const defs = getDefs(chalk2);
|
|
20645
20645
|
const maybeHighlight = (chalkFn, string) => {
|
|
20646
20646
|
return highlighted ? chalkFn(string) : string;
|
|
20647
20647
|
};
|
|
@@ -20680,7 +20680,7 @@ var require_lib3 = __commonJS({
|
|
|
20680
20680
|
${frame}`;
|
|
20681
20681
|
}
|
|
20682
20682
|
if (highlighted) {
|
|
20683
|
-
return
|
|
20683
|
+
return chalk2.reset(frame);
|
|
20684
20684
|
} else {
|
|
20685
20685
|
return frame;
|
|
20686
20686
|
}
|
|
@@ -25994,14 +25994,14 @@ var require_templates2 = __commonJS({
|
|
|
25994
25994
|
}
|
|
25995
25995
|
return results;
|
|
25996
25996
|
}
|
|
25997
|
-
function buildStyle(
|
|
25997
|
+
function buildStyle(chalk2, styles) {
|
|
25998
25998
|
const enabled = {};
|
|
25999
25999
|
for (const layer of styles) {
|
|
26000
26000
|
for (const style of layer.styles) {
|
|
26001
26001
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
26002
26002
|
}
|
|
26003
26003
|
}
|
|
26004
|
-
let current =
|
|
26004
|
+
let current = chalk2;
|
|
26005
26005
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
26006
26006
|
if (!Array.isArray(styles2)) {
|
|
26007
26007
|
continue;
|
|
@@ -26013,7 +26013,7 @@ var require_templates2 = __commonJS({
|
|
|
26013
26013
|
}
|
|
26014
26014
|
return current;
|
|
26015
26015
|
}
|
|
26016
|
-
module2.exports = (
|
|
26016
|
+
module2.exports = (chalk2, temporary) => {
|
|
26017
26017
|
const styles = [];
|
|
26018
26018
|
const chunks = [];
|
|
26019
26019
|
let chunk = [];
|
|
@@ -26023,13 +26023,13 @@ var require_templates2 = __commonJS({
|
|
|
26023
26023
|
} else if (style) {
|
|
26024
26024
|
const string = chunk.join("");
|
|
26025
26025
|
chunk = [];
|
|
26026
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
26026
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk2, styles)(string));
|
|
26027
26027
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
26028
26028
|
} else if (close) {
|
|
26029
26029
|
if (styles.length === 0) {
|
|
26030
26030
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
26031
26031
|
}
|
|
26032
|
-
chunks.push(buildStyle(
|
|
26032
|
+
chunks.push(buildStyle(chalk2, styles)(chunk.join("")));
|
|
26033
26033
|
chunk = [];
|
|
26034
26034
|
styles.pop();
|
|
26035
26035
|
} else {
|
|
@@ -26077,16 +26077,16 @@ var require_source = __commonJS({
|
|
|
26077
26077
|
}
|
|
26078
26078
|
};
|
|
26079
26079
|
var chalkFactory = (options) => {
|
|
26080
|
-
const
|
|
26081
|
-
applyOptions(
|
|
26082
|
-
|
|
26083
|
-
Object.setPrototypeOf(
|
|
26084
|
-
Object.setPrototypeOf(
|
|
26085
|
-
|
|
26080
|
+
const chalk3 = {};
|
|
26081
|
+
applyOptions(chalk3, options);
|
|
26082
|
+
chalk3.template = (...arguments_) => chalkTag(chalk3.template, ...arguments_);
|
|
26083
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
26084
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
26085
|
+
chalk3.template.constructor = () => {
|
|
26086
26086
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
26087
26087
|
};
|
|
26088
|
-
|
|
26089
|
-
return
|
|
26088
|
+
chalk3.template.Instance = ChalkClass;
|
|
26089
|
+
return chalk3.template;
|
|
26090
26090
|
};
|
|
26091
26091
|
function Chalk(options) {
|
|
26092
26092
|
return chalkFactory(options);
|
|
@@ -26197,7 +26197,7 @@ var require_source = __commonJS({
|
|
|
26197
26197
|
return openAll + string + closeAll;
|
|
26198
26198
|
};
|
|
26199
26199
|
var template;
|
|
26200
|
-
var chalkTag = (
|
|
26200
|
+
var chalkTag = (chalk3, ...strings) => {
|
|
26201
26201
|
const [firstString] = strings;
|
|
26202
26202
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
26203
26203
|
return strings.join(" ");
|
|
@@ -26213,14 +26213,14 @@ var require_source = __commonJS({
|
|
|
26213
26213
|
if (template === void 0) {
|
|
26214
26214
|
template = require_templates2();
|
|
26215
26215
|
}
|
|
26216
|
-
return template(
|
|
26216
|
+
return template(chalk3, parts.join(""));
|
|
26217
26217
|
};
|
|
26218
26218
|
Object.defineProperties(Chalk.prototype, styles);
|
|
26219
|
-
var
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26223
|
-
module2.exports =
|
|
26219
|
+
var chalk2 = Chalk();
|
|
26220
|
+
chalk2.supportsColor = stdoutColor;
|
|
26221
|
+
chalk2.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
26222
|
+
chalk2.stderr.supportsColor = stderrColor;
|
|
26223
|
+
module2.exports = chalk2;
|
|
26224
26224
|
}
|
|
26225
26225
|
});
|
|
26226
26226
|
|
|
@@ -30128,72 +30128,98 @@ var getLogLevelLabel = (logLevel) => {
|
|
|
30128
30128
|
|
|
30129
30129
|
// packages/config-tools/src/utilities/logger.ts
|
|
30130
30130
|
var chalk = __toESM(require_source(), 1);
|
|
30131
|
-
|
|
30132
|
-
|
|
30133
|
-
|
|
30134
|
-
|
|
30135
|
-
|
|
30136
|
-
|
|
30137
|
-
|
|
30138
|
-
|
|
30139
|
-
|
|
30140
|
-
|
|
30141
|
-
|
|
30142
|
-
|
|
30143
|
-
|
|
30144
|
-
const prefix = "STORM_";
|
|
30145
|
-
let config = {
|
|
30146
|
-
name: process.env[`${prefix}NAME`],
|
|
30147
|
-
namespace: process.env[`${prefix}NAMESPACE`],
|
|
30148
|
-
owner: process.env[`${prefix}OWNER`],
|
|
30149
|
-
worker: process.env[`${prefix}WORKER`],
|
|
30150
|
-
organization: process.env[`${prefix}ORGANIZATION`],
|
|
30151
|
-
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
30152
|
-
license: process.env[`${prefix}LICENSE`],
|
|
30153
|
-
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
30154
|
-
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
30155
|
-
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
30156
|
-
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
30157
|
-
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
30158
|
-
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
30159
|
-
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
30160
|
-
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
30161
|
-
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
30162
|
-
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
30163
|
-
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
30164
|
-
colors: {
|
|
30165
|
-
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
30166
|
-
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
30167
|
-
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
30168
|
-
info: process.env[`${prefix}COLOR_INFO`],
|
|
30169
|
-
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
30170
|
-
error: process.env[`${prefix}COLOR_ERROR`],
|
|
30171
|
-
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
30172
|
-
},
|
|
30173
|
-
repository: process.env[`${prefix}REPOSITORY`],
|
|
30174
|
-
branch: process.env[`${prefix}BRANCH`],
|
|
30175
|
-
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
30176
|
-
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,
|
|
30177
|
-
extensions: {}
|
|
30178
|
-
};
|
|
30179
|
-
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
30180
|
-
if (serializedConfig) {
|
|
30181
|
-
const parsed = JSON.parse(serializedConfig);
|
|
30182
|
-
config = {
|
|
30183
|
-
...config,
|
|
30184
|
-
...parsed,
|
|
30185
|
-
colors: { ...config.colors, ...parsed.colors },
|
|
30186
|
-
extensions: { ...config.extensions, ...parsed.extensions }
|
|
30131
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
30132
|
+
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)) {
|
|
30133
|
+
return (_) => {
|
|
30134
|
+
};
|
|
30135
|
+
}
|
|
30136
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
30137
|
+
return (message) => {
|
|
30138
|
+
console.error(
|
|
30139
|
+
` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
30140
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
30141
|
+
)(message)}
|
|
30142
|
+
`
|
|
30143
|
+
);
|
|
30187
30144
|
};
|
|
30188
30145
|
}
|
|
30189
|
-
|
|
30190
|
-
|
|
30191
|
-
|
|
30192
|
-
|
|
30193
|
-
|
|
30194
|
-
|
|
30195
|
-
|
|
30196
|
-
|
|
30146
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
30147
|
+
return (message) => {
|
|
30148
|
+
console.error(
|
|
30149
|
+
` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
30150
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
30151
|
+
)(message)}
|
|
30152
|
+
`
|
|
30153
|
+
);
|
|
30154
|
+
};
|
|
30155
|
+
}
|
|
30156
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
30157
|
+
return (message) => {
|
|
30158
|
+
console.warn(
|
|
30159
|
+
` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
30160
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
30161
|
+
)(message)}
|
|
30162
|
+
`
|
|
30163
|
+
);
|
|
30164
|
+
};
|
|
30165
|
+
}
|
|
30166
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
30167
|
+
return (message) => {
|
|
30168
|
+
console.info(
|
|
30169
|
+
` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
30170
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
30171
|
+
)(message)}
|
|
30172
|
+
`
|
|
30173
|
+
);
|
|
30174
|
+
};
|
|
30175
|
+
}
|
|
30176
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
30177
|
+
return (message) => {
|
|
30178
|
+
console.info(
|
|
30179
|
+
` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
|
|
30180
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
30181
|
+
)(message)}
|
|
30182
|
+
`
|
|
30183
|
+
);
|
|
30184
|
+
};
|
|
30185
|
+
}
|
|
30186
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
30187
|
+
return (message) => {
|
|
30188
|
+
console.debug(
|
|
30189
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
30190
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
30191
|
+
)(message)}
|
|
30192
|
+
`
|
|
30193
|
+
);
|
|
30194
|
+
};
|
|
30195
|
+
}
|
|
30196
|
+
return (message) => {
|
|
30197
|
+
console.log(
|
|
30198
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
30199
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
30200
|
+
)(message)}
|
|
30201
|
+
`
|
|
30202
|
+
);
|
|
30203
|
+
};
|
|
30204
|
+
};
|
|
30205
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
30206
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
30207
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
30208
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
30209
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
30210
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
30211
|
+
var getStopwatch = (name) => {
|
|
30212
|
+
const start = process.hrtime();
|
|
30213
|
+
return () => {
|
|
30214
|
+
const end = process.hrtime(start);
|
|
30215
|
+
console.info(
|
|
30216
|
+
chalk.dim(
|
|
30217
|
+
`\u23F1\uFE0F The${name ? ` ${name}` : ""} process took ${Math.round(
|
|
30218
|
+
end[0] * 1e3 + end[1] / 1e6
|
|
30219
|
+
)}ms to complete`
|
|
30220
|
+
)
|
|
30221
|
+
);
|
|
30222
|
+
};
|
|
30197
30223
|
};
|
|
30198
30224
|
|
|
30199
30225
|
// packages/config-tools/src/env/set-env.ts
|
|
@@ -30330,8 +30356,82 @@ var setConfigEnv = (config) => {
|
|
|
30330
30356
|
}
|
|
30331
30357
|
};
|
|
30332
30358
|
|
|
30333
|
-
// packages/
|
|
30334
|
-
var
|
|
30359
|
+
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
30360
|
+
var prepareWorkspace = async () => {
|
|
30361
|
+
const _STORM_CONFIG = getDefaultConfig({
|
|
30362
|
+
...await getConfigFile(),
|
|
30363
|
+
...getConfigEnv()
|
|
30364
|
+
});
|
|
30365
|
+
setConfigEnv(_STORM_CONFIG);
|
|
30366
|
+
return _STORM_CONFIG;
|
|
30367
|
+
};
|
|
30368
|
+
|
|
30369
|
+
// packages/config-tools/src/env/get-env.ts
|
|
30370
|
+
var getExtensionEnv = (extensionName) => {
|
|
30371
|
+
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
30372
|
+
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
30373
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
30374
|
+
if (name) {
|
|
30375
|
+
ret[name] = process.env[key];
|
|
30376
|
+
}
|
|
30377
|
+
return ret;
|
|
30378
|
+
}, {});
|
|
30379
|
+
};
|
|
30380
|
+
var getConfigEnv = () => {
|
|
30381
|
+
const prefix = "STORM_";
|
|
30382
|
+
let config = {
|
|
30383
|
+
name: process.env[`${prefix}NAME`],
|
|
30384
|
+
namespace: process.env[`${prefix}NAMESPACE`],
|
|
30385
|
+
owner: process.env[`${prefix}OWNER`],
|
|
30386
|
+
worker: process.env[`${prefix}WORKER`],
|
|
30387
|
+
organization: process.env[`${prefix}ORGANIZATION`],
|
|
30388
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
30389
|
+
license: process.env[`${prefix}LICENSE`],
|
|
30390
|
+
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
30391
|
+
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
30392
|
+
locale: process.env[`${prefix}LOCALE`] ?? process.env.LOCALE,
|
|
30393
|
+
configFile: process.env[`${prefix}CONFIG_FILE`],
|
|
30394
|
+
workspaceRoot: process.env[`${prefix}WORKSPACE_ROOT`],
|
|
30395
|
+
packageDirectory: process.env[`${prefix}PACKAGE_DIRECTORY`],
|
|
30396
|
+
buildDirectory: process.env[`${prefix}BUILD_DIRECTORY`],
|
|
30397
|
+
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
30398
|
+
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
30399
|
+
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
30400
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
30401
|
+
colors: {
|
|
30402
|
+
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
30403
|
+
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
30404
|
+
success: process.env[`${prefix}COLOR_SUCCESS`],
|
|
30405
|
+
info: process.env[`${prefix}COLOR_INFO`],
|
|
30406
|
+
warning: process.env[`${prefix}COLOR_WARNING`],
|
|
30407
|
+
error: process.env[`${prefix}COLOR_ERROR`],
|
|
30408
|
+
fatal: process.env[`${prefix}COLOR_FATAL`]
|
|
30409
|
+
},
|
|
30410
|
+
repository: process.env[`${prefix}REPOSITORY`],
|
|
30411
|
+
branch: process.env[`${prefix}BRANCH`],
|
|
30412
|
+
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
30413
|
+
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,
|
|
30414
|
+
extensions: {}
|
|
30415
|
+
};
|
|
30416
|
+
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
30417
|
+
if (serializedConfig) {
|
|
30418
|
+
const parsed = JSON.parse(serializedConfig);
|
|
30419
|
+
config = {
|
|
30420
|
+
...config,
|
|
30421
|
+
...parsed,
|
|
30422
|
+
colors: { ...config.colors, ...parsed.colors },
|
|
30423
|
+
extensions: { ...config.extensions, ...parsed.extensions }
|
|
30424
|
+
};
|
|
30425
|
+
}
|
|
30426
|
+
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
30427
|
+
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
30428
|
+
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("");
|
|
30429
|
+
if (extensionName) {
|
|
30430
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
30431
|
+
}
|
|
30432
|
+
return ret;
|
|
30433
|
+
}, config);
|
|
30434
|
+
};
|
|
30335
30435
|
|
|
30336
30436
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
30337
30437
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -30399,43 +30499,48 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
30399
30499
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
30400
30500
|
skipReadingConfig: false
|
|
30401
30501
|
}) => async (tree, _options) => {
|
|
30402
|
-
const
|
|
30502
|
+
const stopwatch = getStopwatch(name);
|
|
30403
30503
|
let options = _options;
|
|
30504
|
+
let config;
|
|
30404
30505
|
try {
|
|
30405
|
-
|
|
30506
|
+
writeInfo(config, `\u26A1 Running the ${name} generator...
|
|
30406
30507
|
|
|
30407
|
-
`)
|
|
30408
|
-
|
|
30508
|
+
`);
|
|
30509
|
+
const workspaceRoot = getWorkspaceRoot();
|
|
30409
30510
|
if (!generatorOptions.skipReadingConfig) {
|
|
30410
|
-
|
|
30411
|
-
|
|
30412
|
-
...
|
|
30413
|
-
|
|
30414
|
-
|
|
30415
|
-
|
|
30416
|
-
|
|
30417
|
-
|
|
30418
|
-
|
|
30419
|
-
|
|
30511
|
+
writeDebug(
|
|
30512
|
+
config,
|
|
30513
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
30514
|
+
- workspaceRoot: ${workspaceRoot}`
|
|
30515
|
+
);
|
|
30516
|
+
config = await prepareWorkspace();
|
|
30517
|
+
writeTrace(
|
|
30518
|
+
config,
|
|
30519
|
+
`Loaded Storm config into env:
|
|
30520
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
|
|
30420
30521
|
);
|
|
30421
30522
|
}
|
|
30422
30523
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
30423
|
-
|
|
30524
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
30424
30525
|
options = await Promise.resolve(
|
|
30425
30526
|
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
30426
30527
|
);
|
|
30427
|
-
|
|
30528
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
30428
30529
|
}
|
|
30429
|
-
|
|
30530
|
+
writeTrace(
|
|
30531
|
+
config,
|
|
30532
|
+
`Generator schema options \u2699\uFE0F
|
|
30533
|
+
${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
|
|
30534
|
+
);
|
|
30430
30535
|
const tokenized = applyWorkspaceTokens(
|
|
30431
30536
|
options,
|
|
30432
30537
|
{ workspaceRoot: tree.root, config },
|
|
30433
30538
|
applyWorkspaceGeneratorTokens
|
|
30434
30539
|
);
|
|
30435
30540
|
if (generatorOptions?.hooks?.preProcess) {
|
|
30436
|
-
|
|
30437
|
-
await Promise.resolve(generatorOptions.hooks.preProcess(
|
|
30438
|
-
|
|
30541
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
30542
|
+
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
30543
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
30439
30544
|
}
|
|
30440
30545
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
30441
30546
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -30444,33 +30549,31 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
30444
30549
|
});
|
|
30445
30550
|
}
|
|
30446
30551
|
if (generatorOptions?.hooks?.postProcess) {
|
|
30447
|
-
|
|
30552
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
30448
30553
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
30449
|
-
|
|
30554
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
30450
30555
|
}
|
|
30451
|
-
|
|
30452
|
-
|
|
30453
|
-
|
|
30454
|
-
\u{1F389} Successfully completed running the ${name} generator!`)
|
|
30455
|
-
);
|
|
30556
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
30557
|
+
`);
|
|
30456
30558
|
return {
|
|
30457
30559
|
success: true
|
|
30458
30560
|
};
|
|
30459
30561
|
} catch (error) {
|
|
30460
|
-
|
|
30461
|
-
|
|
30462
|
-
error
|
|
30562
|
+
writeFatal(
|
|
30563
|
+
config,
|
|
30564
|
+
"A fatal error occurred while running the generator - the process was forced to terminate"
|
|
30565
|
+
);
|
|
30566
|
+
writeError(
|
|
30567
|
+
config,
|
|
30568
|
+
`An exception was thrown in the generator's process
|
|
30569
|
+
- Details: ${error.message}
|
|
30570
|
+
- Stacktrace: ${error.stack}`
|
|
30463
30571
|
);
|
|
30464
|
-
console.error(error);
|
|
30465
30572
|
return {
|
|
30466
30573
|
success: false
|
|
30467
30574
|
};
|
|
30468
30575
|
} finally {
|
|
30469
|
-
|
|
30470
|
-
chalk2.hex("#0ea5e9").italic(
|
|
30471
|
-
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
30472
|
-
)
|
|
30473
|
-
);
|
|
30576
|
+
stopwatch();
|
|
30474
30577
|
}
|
|
30475
30578
|
};
|
|
30476
30579
|
|