@storm-software/workspace-tools 1.42.3 → 1.43.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/CHANGELOG.md +14 -0
- package/config/nx.json +1 -3
- package/index.js +396 -230
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +387 -221
- package/src/executors/design-tokens/executor.js +393 -227
- package/src/executors/tsup/executor.js +383 -217
- package/src/executors/tsup-browser/executor.js +383 -217
- package/src/executors/tsup-neutral/executor.js +383 -217
- package/src/executors/tsup-node/executor.js +383 -217
- package/src/generators/browser-library/generator.js +266 -189
- package/src/generators/config-schema/generator.js +246 -169
- package/src/generators/neutral-library/generator.js +266 -189
- package/src/generators/node-library/generator.js +266 -189
- package/src/generators/preset/generator.js +246 -169
package/src/base/index.js
CHANGED
|
@@ -1974,14 +1974,14 @@ var require_templates = __commonJS({
|
|
|
1974
1974
|
}
|
|
1975
1975
|
return results;
|
|
1976
1976
|
}
|
|
1977
|
-
function buildStyle(
|
|
1977
|
+
function buildStyle(chalk4, styles) {
|
|
1978
1978
|
const enabled = {};
|
|
1979
1979
|
for (const layer of styles) {
|
|
1980
1980
|
for (const style of layer.styles) {
|
|
1981
1981
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
1982
1982
|
}
|
|
1983
1983
|
}
|
|
1984
|
-
let current =
|
|
1984
|
+
let current = chalk4;
|
|
1985
1985
|
for (const styleName of Object.keys(enabled)) {
|
|
1986
1986
|
if (Array.isArray(enabled[styleName])) {
|
|
1987
1987
|
if (!(styleName in current)) {
|
|
@@ -1996,7 +1996,7 @@ var require_templates = __commonJS({
|
|
|
1996
1996
|
}
|
|
1997
1997
|
return current;
|
|
1998
1998
|
}
|
|
1999
|
-
module2.exports = (
|
|
1999
|
+
module2.exports = (chalk4, tmp) => {
|
|
2000
2000
|
const styles = [];
|
|
2001
2001
|
const chunks = [];
|
|
2002
2002
|
let chunk = [];
|
|
@@ -2006,13 +2006,13 @@ var require_templates = __commonJS({
|
|
|
2006
2006
|
} else if (style) {
|
|
2007
2007
|
const str = chunk.join("");
|
|
2008
2008
|
chunk = [];
|
|
2009
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
2009
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk4, styles)(str));
|
|
2010
2010
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
2011
2011
|
} else if (close) {
|
|
2012
2012
|
if (styles.length === 0) {
|
|
2013
2013
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
2014
2014
|
}
|
|
2015
|
-
chunks.push(buildStyle(
|
|
2015
|
+
chunks.push(buildStyle(chalk4, styles)(chunk.join("")));
|
|
2016
2016
|
chunk = [];
|
|
2017
2017
|
styles.pop();
|
|
2018
2018
|
} else {
|
|
@@ -2049,16 +2049,16 @@ var require_chalk = __commonJS({
|
|
|
2049
2049
|
}
|
|
2050
2050
|
function Chalk(options) {
|
|
2051
2051
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
2052
|
-
const
|
|
2053
|
-
applyOptions(
|
|
2054
|
-
|
|
2052
|
+
const chalk4 = {};
|
|
2053
|
+
applyOptions(chalk4, options);
|
|
2054
|
+
chalk4.template = function() {
|
|
2055
2055
|
const args = [].slice.call(arguments);
|
|
2056
|
-
return chalkTag.apply(null, [
|
|
2056
|
+
return chalkTag.apply(null, [chalk4.template].concat(args));
|
|
2057
2057
|
};
|
|
2058
|
-
Object.setPrototypeOf(
|
|
2059
|
-
Object.setPrototypeOf(
|
|
2060
|
-
|
|
2061
|
-
return
|
|
2058
|
+
Object.setPrototypeOf(chalk4, Chalk.prototype);
|
|
2059
|
+
Object.setPrototypeOf(chalk4.template, chalk4);
|
|
2060
|
+
chalk4.template.constructor = Chalk;
|
|
2061
|
+
return chalk4.template;
|
|
2062
2062
|
}
|
|
2063
2063
|
applyOptions(this, options);
|
|
2064
2064
|
}
|
|
@@ -2177,7 +2177,7 @@ var require_chalk = __commonJS({
|
|
|
2177
2177
|
ansiStyles.dim.open = originalDim;
|
|
2178
2178
|
return str;
|
|
2179
2179
|
}
|
|
2180
|
-
function chalkTag(
|
|
2180
|
+
function chalkTag(chalk4, strings) {
|
|
2181
2181
|
if (!Array.isArray(strings)) {
|
|
2182
2182
|
return [].slice.call(arguments, 1).join(" ");
|
|
2183
2183
|
}
|
|
@@ -2187,7 +2187,7 @@ var require_chalk = __commonJS({
|
|
|
2187
2187
|
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
2188
2188
|
parts.push(String(strings.raw[i]));
|
|
2189
2189
|
}
|
|
2190
|
-
return template(
|
|
2190
|
+
return template(chalk4, parts.join(""));
|
|
2191
2191
|
}
|
|
2192
2192
|
Object.defineProperties(Chalk.prototype, styles);
|
|
2193
2193
|
module2.exports = Chalk();
|
|
@@ -2233,17 +2233,17 @@ var require_lib2 = __commonJS({
|
|
|
2233
2233
|
return n.default = e, t && t.set(e, n), n;
|
|
2234
2234
|
}
|
|
2235
2235
|
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
2236
|
-
function getDefs(
|
|
2236
|
+
function getDefs(chalk4) {
|
|
2237
2237
|
return {
|
|
2238
|
-
keyword:
|
|
2239
|
-
capitalized:
|
|
2240
|
-
jsxIdentifier:
|
|
2241
|
-
punctuator:
|
|
2242
|
-
number:
|
|
2243
|
-
string:
|
|
2244
|
-
regex:
|
|
2245
|
-
comment:
|
|
2246
|
-
invalid:
|
|
2238
|
+
keyword: chalk4.cyan,
|
|
2239
|
+
capitalized: chalk4.yellow,
|
|
2240
|
+
jsxIdentifier: chalk4.yellow,
|
|
2241
|
+
punctuator: chalk4.yellow,
|
|
2242
|
+
number: chalk4.magenta,
|
|
2243
|
+
string: chalk4.green,
|
|
2244
|
+
regex: chalk4.magenta,
|
|
2245
|
+
comment: chalk4.grey,
|
|
2246
|
+
invalid: chalk4.white.bgRed.bold
|
|
2247
2247
|
};
|
|
2248
2248
|
}
|
|
2249
2249
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -2374,11 +2374,11 @@ var require_lib3 = __commonJS({
|
|
|
2374
2374
|
return _chalk.default;
|
|
2375
2375
|
}
|
|
2376
2376
|
var deprecationWarningShown = false;
|
|
2377
|
-
function getDefs(
|
|
2377
|
+
function getDefs(chalk4) {
|
|
2378
2378
|
return {
|
|
2379
|
-
gutter:
|
|
2380
|
-
marker:
|
|
2381
|
-
message:
|
|
2379
|
+
gutter: chalk4.grey,
|
|
2380
|
+
marker: chalk4.red.bold,
|
|
2381
|
+
message: chalk4.red.bold
|
|
2382
2382
|
};
|
|
2383
2383
|
}
|
|
2384
2384
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -2440,8 +2440,8 @@ var require_lib3 = __commonJS({
|
|
|
2440
2440
|
}
|
|
2441
2441
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
2442
2442
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
2443
|
-
const
|
|
2444
|
-
const defs = getDefs(
|
|
2443
|
+
const chalk4 = getChalk(opts.forceColor);
|
|
2444
|
+
const defs = getDefs(chalk4);
|
|
2445
2445
|
const maybeHighlight = (chalkFn, string) => {
|
|
2446
2446
|
return highlighted ? chalkFn(string) : string;
|
|
2447
2447
|
};
|
|
@@ -2480,7 +2480,7 @@ var require_lib3 = __commonJS({
|
|
|
2480
2480
|
${frame}`;
|
|
2481
2481
|
}
|
|
2482
2482
|
if (highlighted) {
|
|
2483
|
-
return
|
|
2483
|
+
return chalk4.reset(frame);
|
|
2484
2484
|
} else {
|
|
2485
2485
|
return frame;
|
|
2486
2486
|
}
|
|
@@ -7794,14 +7794,14 @@ var require_templates2 = __commonJS({
|
|
|
7794
7794
|
}
|
|
7795
7795
|
return results;
|
|
7796
7796
|
}
|
|
7797
|
-
function buildStyle(
|
|
7797
|
+
function buildStyle(chalk4, styles) {
|
|
7798
7798
|
const enabled = {};
|
|
7799
7799
|
for (const layer of styles) {
|
|
7800
7800
|
for (const style of layer.styles) {
|
|
7801
7801
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
7802
7802
|
}
|
|
7803
7803
|
}
|
|
7804
|
-
let current =
|
|
7804
|
+
let current = chalk4;
|
|
7805
7805
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
7806
7806
|
if (!Array.isArray(styles2)) {
|
|
7807
7807
|
continue;
|
|
@@ -7813,7 +7813,7 @@ var require_templates2 = __commonJS({
|
|
|
7813
7813
|
}
|
|
7814
7814
|
return current;
|
|
7815
7815
|
}
|
|
7816
|
-
module2.exports = (
|
|
7816
|
+
module2.exports = (chalk4, temporary) => {
|
|
7817
7817
|
const styles = [];
|
|
7818
7818
|
const chunks = [];
|
|
7819
7819
|
let chunk = [];
|
|
@@ -7823,13 +7823,13 @@ var require_templates2 = __commonJS({
|
|
|
7823
7823
|
} else if (style) {
|
|
7824
7824
|
const string = chunk.join("");
|
|
7825
7825
|
chunk = [];
|
|
7826
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
7826
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk4, styles)(string));
|
|
7827
7827
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
7828
7828
|
} else if (close) {
|
|
7829
7829
|
if (styles.length === 0) {
|
|
7830
7830
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
7831
7831
|
}
|
|
7832
|
-
chunks.push(buildStyle(
|
|
7832
|
+
chunks.push(buildStyle(chalk4, styles)(chunk.join("")));
|
|
7833
7833
|
chunk = [];
|
|
7834
7834
|
styles.pop();
|
|
7835
7835
|
} else {
|
|
@@ -7877,16 +7877,16 @@ var require_source = __commonJS({
|
|
|
7877
7877
|
}
|
|
7878
7878
|
};
|
|
7879
7879
|
var chalkFactory = (options) => {
|
|
7880
|
-
const
|
|
7881
|
-
applyOptions(
|
|
7882
|
-
|
|
7883
|
-
Object.setPrototypeOf(
|
|
7884
|
-
Object.setPrototypeOf(
|
|
7885
|
-
|
|
7880
|
+
const chalk5 = {};
|
|
7881
|
+
applyOptions(chalk5, options);
|
|
7882
|
+
chalk5.template = (...arguments_) => chalkTag(chalk5.template, ...arguments_);
|
|
7883
|
+
Object.setPrototypeOf(chalk5, Chalk.prototype);
|
|
7884
|
+
Object.setPrototypeOf(chalk5.template, chalk5);
|
|
7885
|
+
chalk5.template.constructor = () => {
|
|
7886
7886
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
7887
7887
|
};
|
|
7888
|
-
|
|
7889
|
-
return
|
|
7888
|
+
chalk5.template.Instance = ChalkClass;
|
|
7889
|
+
return chalk5.template;
|
|
7890
7890
|
};
|
|
7891
7891
|
function Chalk(options) {
|
|
7892
7892
|
return chalkFactory(options);
|
|
@@ -7997,7 +7997,7 @@ var require_source = __commonJS({
|
|
|
7997
7997
|
return openAll + string + closeAll;
|
|
7998
7998
|
};
|
|
7999
7999
|
var template;
|
|
8000
|
-
var chalkTag = (
|
|
8000
|
+
var chalkTag = (chalk5, ...strings) => {
|
|
8001
8001
|
const [firstString] = strings;
|
|
8002
8002
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
8003
8003
|
return strings.join(" ");
|
|
@@ -8013,14 +8013,14 @@ var require_source = __commonJS({
|
|
|
8013
8013
|
if (template === void 0) {
|
|
8014
8014
|
template = require_templates2();
|
|
8015
8015
|
}
|
|
8016
|
-
return template(
|
|
8016
|
+
return template(chalk5, parts.join(""));
|
|
8017
8017
|
};
|
|
8018
8018
|
Object.defineProperties(Chalk.prototype, styles);
|
|
8019
|
-
var
|
|
8020
|
-
|
|
8021
|
-
|
|
8022
|
-
|
|
8023
|
-
module2.exports =
|
|
8019
|
+
var chalk4 = Chalk();
|
|
8020
|
+
chalk4.supportsColor = stdoutColor;
|
|
8021
|
+
chalk4.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
8022
|
+
chalk4.stderr.supportsColor = stderrColor;
|
|
8023
|
+
module2.exports = chalk4;
|
|
8024
8024
|
}
|
|
8025
8025
|
});
|
|
8026
8026
|
|
|
@@ -24150,14 +24150,14 @@ var require_share = __commonJS({
|
|
|
24150
24150
|
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
24151
24151
|
resetConnection = void 0;
|
|
24152
24152
|
};
|
|
24153
|
-
var
|
|
24153
|
+
var reset2 = function() {
|
|
24154
24154
|
cancelReset();
|
|
24155
24155
|
connection = subject = void 0;
|
|
24156
24156
|
hasCompleted = hasErrored = false;
|
|
24157
24157
|
};
|
|
24158
24158
|
var resetAndUnsubscribe = function() {
|
|
24159
24159
|
var conn = connection;
|
|
24160
|
-
|
|
24160
|
+
reset2();
|
|
24161
24161
|
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
24162
24162
|
};
|
|
24163
24163
|
return lift_1.operate(function(source, subscriber) {
|
|
@@ -24181,13 +24181,13 @@ var require_share = __commonJS({
|
|
|
24181
24181
|
error: function(err) {
|
|
24182
24182
|
hasErrored = true;
|
|
24183
24183
|
cancelReset();
|
|
24184
|
-
resetConnection = handleReset(
|
|
24184
|
+
resetConnection = handleReset(reset2, resetOnError, err);
|
|
24185
24185
|
dest.error(err);
|
|
24186
24186
|
},
|
|
24187
24187
|
complete: function() {
|
|
24188
24188
|
hasCompleted = true;
|
|
24189
24189
|
cancelReset();
|
|
24190
|
-
resetConnection = handleReset(
|
|
24190
|
+
resetConnection = handleReset(reset2, resetOnComplete);
|
|
24191
24191
|
dest.complete();
|
|
24192
24192
|
}
|
|
24193
24193
|
});
|
|
@@ -24197,13 +24197,13 @@ var require_share = __commonJS({
|
|
|
24197
24197
|
};
|
|
24198
24198
|
}
|
|
24199
24199
|
exports.share = share;
|
|
24200
|
-
function handleReset(
|
|
24200
|
+
function handleReset(reset2, on) {
|
|
24201
24201
|
var args = [];
|
|
24202
24202
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
24203
24203
|
args[_i - 2] = arguments[_i];
|
|
24204
24204
|
}
|
|
24205
24205
|
if (on === true) {
|
|
24206
|
-
|
|
24206
|
+
reset2();
|
|
24207
24207
|
return;
|
|
24208
24208
|
}
|
|
24209
24209
|
if (on === false) {
|
|
@@ -24212,7 +24212,7 @@ var require_share = __commonJS({
|
|
|
24212
24212
|
var onSubscriber = new Subscriber_1.SafeSubscriber({
|
|
24213
24213
|
next: function() {
|
|
24214
24214
|
onSubscriber.unsubscribe();
|
|
24215
|
-
|
|
24215
|
+
reset2();
|
|
24216
24216
|
}
|
|
24217
24217
|
});
|
|
24218
24218
|
return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray2([], __read2(args)))).subscribe(onSubscriber);
|
|
@@ -28102,7 +28102,7 @@ var require_array = __commonJS({
|
|
|
28102
28102
|
parent.enabled = choices.every((ch) => ch.enabled === true);
|
|
28103
28103
|
parent = parent.parent;
|
|
28104
28104
|
}
|
|
28105
|
-
|
|
28105
|
+
reset2(this, this.choices);
|
|
28106
28106
|
this.emit("toggle", choice, this);
|
|
28107
28107
|
return choice;
|
|
28108
28108
|
}
|
|
@@ -28400,7 +28400,7 @@ var require_array = __commonJS({
|
|
|
28400
28400
|
}
|
|
28401
28401
|
}
|
|
28402
28402
|
get choices() {
|
|
28403
|
-
return
|
|
28403
|
+
return reset2(this, this.state.choices || []);
|
|
28404
28404
|
}
|
|
28405
28405
|
set visible(visible) {
|
|
28406
28406
|
this.state.visible = visible;
|
|
@@ -28448,7 +28448,7 @@ var require_array = __commonJS({
|
|
|
28448
28448
|
return this.multiple ? this.enabled : this.focused;
|
|
28449
28449
|
}
|
|
28450
28450
|
};
|
|
28451
|
-
function
|
|
28451
|
+
function reset2(prompt, choices) {
|
|
28452
28452
|
if (choices instanceof Promise)
|
|
28453
28453
|
return choices;
|
|
28454
28454
|
if (typeof choices === "function") {
|
|
@@ -31283,20 +31283,20 @@ var require_highlight = __commonJS({
|
|
|
31283
31283
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31284
31284
|
exports.highlight = void 0;
|
|
31285
31285
|
var jsTokens = require_js_tokens();
|
|
31286
|
-
var
|
|
31286
|
+
var chalk4 = require_source();
|
|
31287
31287
|
var identifiers_1 = require_identifiers2();
|
|
31288
|
-
function getDefs(
|
|
31288
|
+
function getDefs(chalk5) {
|
|
31289
31289
|
return {
|
|
31290
|
-
keyword:
|
|
31291
|
-
capitalized:
|
|
31292
|
-
jsx_tag:
|
|
31293
|
-
punctuator:
|
|
31290
|
+
keyword: chalk5.cyan,
|
|
31291
|
+
capitalized: chalk5.yellow,
|
|
31292
|
+
jsx_tag: chalk5.yellow,
|
|
31293
|
+
punctuator: chalk5.yellow,
|
|
31294
31294
|
// bracket: intentionally omitted.
|
|
31295
|
-
number:
|
|
31296
|
-
string:
|
|
31297
|
-
regex:
|
|
31298
|
-
comment:
|
|
31299
|
-
invalid:
|
|
31295
|
+
number: chalk5.magenta,
|
|
31296
|
+
string: chalk5.green,
|
|
31297
|
+
regex: chalk5.magenta,
|
|
31298
|
+
comment: chalk5.grey,
|
|
31299
|
+
invalid: chalk5.white.bgRed.bold
|
|
31300
31300
|
};
|
|
31301
31301
|
}
|
|
31302
31302
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -31336,7 +31336,7 @@ var require_highlight = __commonJS({
|
|
|
31336
31336
|
});
|
|
31337
31337
|
}
|
|
31338
31338
|
function highlight(code) {
|
|
31339
|
-
const defs = getDefs(
|
|
31339
|
+
const defs = getDefs(chalk4);
|
|
31340
31340
|
return highlightTokens(defs, code);
|
|
31341
31341
|
}
|
|
31342
31342
|
exports.highlight = highlight;
|
|
@@ -31449,7 +31449,7 @@ var require_run_type_check = __commonJS({
|
|
|
31449
31449
|
"use strict";
|
|
31450
31450
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31451
31451
|
exports.getFormattedDiagnostic = exports.runTypeCheck = exports.runTypeCheckWatch = void 0;
|
|
31452
|
-
var
|
|
31452
|
+
var chalk4 = require_source();
|
|
31453
31453
|
var path = require("path");
|
|
31454
31454
|
var code_frames_1 = require("nx/src/utils/code-frames");
|
|
31455
31455
|
var highlight_1 = require_highlight();
|
|
@@ -31529,17 +31529,17 @@ var require_run_type_check = __commonJS({
|
|
|
31529
31529
|
const category = diagnostic.category;
|
|
31530
31530
|
switch (category) {
|
|
31531
31531
|
case ts.DiagnosticCategory.Warning: {
|
|
31532
|
-
message += `${
|
|
31532
|
+
message += `${chalk4.yellow.bold("warning")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
|
|
31533
31533
|
break;
|
|
31534
31534
|
}
|
|
31535
31535
|
case ts.DiagnosticCategory.Error: {
|
|
31536
|
-
message += `${
|
|
31536
|
+
message += `${chalk4.red.bold("error")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
|
|
31537
31537
|
break;
|
|
31538
31538
|
}
|
|
31539
31539
|
case ts.DiagnosticCategory.Suggestion:
|
|
31540
31540
|
case ts.DiagnosticCategory.Message:
|
|
31541
31541
|
default: {
|
|
31542
|
-
message += `${
|
|
31542
|
+
message += `${chalk4.cyan.bold(category === 2 ? "suggestion" : "info")}: `;
|
|
31543
31543
|
break;
|
|
31544
31544
|
}
|
|
31545
31545
|
}
|
|
@@ -31549,7 +31549,7 @@ var require_run_type_check = __commonJS({
|
|
|
31549
31549
|
const line = pos.line + 1;
|
|
31550
31550
|
const column = pos.character + 1;
|
|
31551
31551
|
const fileName = path.relative(workspaceRoot, diagnostic.file.fileName);
|
|
31552
|
-
message = `${
|
|
31552
|
+
message = `${chalk4.underline.blue(`${fileName}:${line}:${column}`)} - ` + message;
|
|
31553
31553
|
const code = diagnostic.file.getFullText(diagnostic.file.getSourceFile());
|
|
31554
31554
|
message += "\n" + (0, code_frames_1.codeFrameColumns)(code, {
|
|
31555
31555
|
start: { line, column }
|
|
@@ -43528,8 +43528,10 @@ var LogLevel = {
|
|
|
43528
43528
|
ERROR: 20,
|
|
43529
43529
|
WARN: 30,
|
|
43530
43530
|
INFO: 40,
|
|
43531
|
+
SUCCESS: 45,
|
|
43531
43532
|
DEBUG: 60,
|
|
43532
|
-
TRACE: 70
|
|
43533
|
+
TRACE: 70,
|
|
43534
|
+
ALL: 100
|
|
43533
43535
|
};
|
|
43534
43536
|
var LogLevelLabel = {
|
|
43535
43537
|
SILENT: "silent",
|
|
@@ -43538,7 +43540,8 @@ var LogLevelLabel = {
|
|
|
43538
43540
|
WARN: "warn",
|
|
43539
43541
|
INFO: "info",
|
|
43540
43542
|
DEBUG: "debug",
|
|
43541
|
-
TRACE: "trace"
|
|
43543
|
+
TRACE: "trace",
|
|
43544
|
+
ALL: "all"
|
|
43542
43545
|
};
|
|
43543
43546
|
|
|
43544
43547
|
// packages/config-tools/src/utilities/find-up.ts
|
|
@@ -43547,15 +43550,15 @@ var import_path = require("path");
|
|
|
43547
43550
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
43548
43551
|
var depth = 0;
|
|
43549
43552
|
function findFolderUp(startPath, endFileNames) {
|
|
43550
|
-
|
|
43551
|
-
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(
|
|
43552
|
-
return
|
|
43553
|
-
}
|
|
43554
|
-
|
|
43553
|
+
const _startPath = startPath ?? process.cwd();
|
|
43554
|
+
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
|
|
43555
|
+
return _startPath;
|
|
43556
|
+
}
|
|
43557
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
43558
|
+
const parent = (0, import_path.join)(_startPath, "..");
|
|
43555
43559
|
return findFolderUp(parent, endFileNames);
|
|
43556
|
-
} else {
|
|
43557
|
-
return void 0;
|
|
43558
43560
|
}
|
|
43561
|
+
return void 0;
|
|
43559
43562
|
}
|
|
43560
43563
|
|
|
43561
43564
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
@@ -47212,17 +47215,13 @@ var StormConfigSchema = objectType({
|
|
|
47212
47215
|
license: stringType().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
47213
47216
|
homepage: stringType().trim().url().default("https://stormsoftware.org").describe("The homepage of the workspace"),
|
|
47214
47217
|
branch: stringType().trim().default("main").describe("The branch of the workspace"),
|
|
47215
|
-
preMajor: booleanType().default(false).describe(
|
|
47216
|
-
"An indicator specifying if the package is still in it's pre-major version"
|
|
47217
|
-
),
|
|
47218
|
+
preMajor: booleanType().default(false).describe("An indicator specifying if the package is still in it's pre-major version"),
|
|
47218
47219
|
owner: stringType().trim().default("@storm-software/development").describe("The owner of the package"),
|
|
47219
47220
|
worker: stringType().trim().default("stormie-bot").describe(
|
|
47220
47221
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
47221
47222
|
),
|
|
47222
47223
|
env: enumType(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
|
|
47223
|
-
ci: booleanType().default(true).describe(
|
|
47224
|
-
"An indicator specifying if the current environment is a CI environment"
|
|
47225
|
-
),
|
|
47224
|
+
ci: booleanType().default(true).describe("An indicator specifying if the current environment is a CI environment"),
|
|
47226
47225
|
workspaceRoot: stringType().trim().optional().describe("The root directory of the workspace"),
|
|
47227
47226
|
packageDirectory: stringType().trim().optional().describe("The root directory of the package"),
|
|
47228
47227
|
buildDirectory: stringType().trim().default("dist").describe("The build directory for the workspace"),
|
|
@@ -47233,7 +47232,7 @@ var StormConfigSchema = objectType({
|
|
|
47233
47232
|
packageManager: enumType(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
47234
47233
|
timezone: stringType().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
47235
47234
|
locale: stringType().trim().default("en-US").describe("The default locale of the workspace"),
|
|
47236
|
-
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
47235
|
+
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]).default("debug").describe(
|
|
47237
47236
|
"The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."
|
|
47238
47237
|
),
|
|
47239
47238
|
configFile: stringType().trim().nullable().default(null).describe(
|
|
@@ -47291,11 +47290,21 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47291
47290
|
});
|
|
47292
47291
|
if (file) {
|
|
47293
47292
|
const packageJson = JSON.parse(file);
|
|
47294
|
-
|
|
47295
|
-
|
|
47296
|
-
|
|
47297
|
-
|
|
47298
|
-
|
|
47293
|
+
if (packageJson.name) {
|
|
47294
|
+
name = packageJson.name;
|
|
47295
|
+
}
|
|
47296
|
+
if (packageJson.namespace) {
|
|
47297
|
+
namespace = packageJson.namespace;
|
|
47298
|
+
}
|
|
47299
|
+
if (packageJson.repository?.url) {
|
|
47300
|
+
repository = packageJson.repository?.url;
|
|
47301
|
+
}
|
|
47302
|
+
if (packageJson.license) {
|
|
47303
|
+
license = packageJson.license;
|
|
47304
|
+
}
|
|
47305
|
+
if (packageJson.homepage) {
|
|
47306
|
+
homepage = packageJson.homepage;
|
|
47307
|
+
}
|
|
47299
47308
|
}
|
|
47300
47309
|
}
|
|
47301
47310
|
return StormConfigSchema.parse({
|
|
@@ -47317,6 +47326,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47317
47326
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
47318
47327
|
var getLogLevel = (label) => {
|
|
47319
47328
|
switch (label) {
|
|
47329
|
+
case "all":
|
|
47330
|
+
return LogLevel.ALL;
|
|
47320
47331
|
case "trace":
|
|
47321
47332
|
return LogLevel.TRACE;
|
|
47322
47333
|
case "debug":
|
|
@@ -47336,38 +47347,129 @@ var getLogLevel = (label) => {
|
|
|
47336
47347
|
}
|
|
47337
47348
|
};
|
|
47338
47349
|
var getLogLevelLabel = (logLevel) => {
|
|
47350
|
+
if (logLevel >= LogLevel.ALL) {
|
|
47351
|
+
return LogLevelLabel.ALL;
|
|
47352
|
+
}
|
|
47339
47353
|
if (logLevel >= LogLevel.TRACE) {
|
|
47340
47354
|
return LogLevelLabel.TRACE;
|
|
47341
|
-
}
|
|
47355
|
+
}
|
|
47356
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
47342
47357
|
return LogLevelLabel.DEBUG;
|
|
47343
|
-
}
|
|
47358
|
+
}
|
|
47359
|
+
if (logLevel >= LogLevel.INFO) {
|
|
47344
47360
|
return LogLevelLabel.INFO;
|
|
47345
|
-
}
|
|
47361
|
+
}
|
|
47362
|
+
if (logLevel >= LogLevel.WARN) {
|
|
47346
47363
|
return LogLevelLabel.WARN;
|
|
47347
|
-
}
|
|
47364
|
+
}
|
|
47365
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
47348
47366
|
return LogLevelLabel.ERROR;
|
|
47349
|
-
}
|
|
47367
|
+
}
|
|
47368
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
47350
47369
|
return LogLevelLabel.FATAL;
|
|
47351
|
-
}
|
|
47370
|
+
}
|
|
47371
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
47352
47372
|
return LogLevelLabel.SILENT;
|
|
47353
|
-
} else {
|
|
47354
|
-
return LogLevelLabel.INFO;
|
|
47355
47373
|
}
|
|
47374
|
+
return LogLevelLabel.INFO;
|
|
47356
47375
|
};
|
|
47357
47376
|
|
|
47377
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
47378
|
+
var chalk = __toESM(require_source(), 1);
|
|
47379
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
47380
|
+
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)) {
|
|
47381
|
+
return (message) => {
|
|
47382
|
+
};
|
|
47383
|
+
}
|
|
47384
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
47385
|
+
return (message) => {
|
|
47386
|
+
console.error(
|
|
47387
|
+
` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
47388
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
47389
|
+
)(message)}
|
|
47390
|
+
`
|
|
47391
|
+
);
|
|
47392
|
+
};
|
|
47393
|
+
}
|
|
47394
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
47395
|
+
return (message) => {
|
|
47396
|
+
console.error(
|
|
47397
|
+
` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
47398
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
47399
|
+
)(message)}
|
|
47400
|
+
`
|
|
47401
|
+
);
|
|
47402
|
+
};
|
|
47403
|
+
}
|
|
47404
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
47405
|
+
return (message) => {
|
|
47406
|
+
console.warn(
|
|
47407
|
+
` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
47408
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
47409
|
+
)(message)}
|
|
47410
|
+
`
|
|
47411
|
+
);
|
|
47412
|
+
};
|
|
47413
|
+
}
|
|
47414
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
47415
|
+
return (message) => {
|
|
47416
|
+
console.info(
|
|
47417
|
+
` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
47418
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
47419
|
+
)(message)}
|
|
47420
|
+
`
|
|
47421
|
+
);
|
|
47422
|
+
};
|
|
47423
|
+
}
|
|
47424
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
47425
|
+
return (message) => {
|
|
47426
|
+
console.info(
|
|
47427
|
+
` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
|
|
47428
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
47429
|
+
)(message)}
|
|
47430
|
+
`
|
|
47431
|
+
);
|
|
47432
|
+
};
|
|
47433
|
+
}
|
|
47434
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
47435
|
+
return (message) => {
|
|
47436
|
+
console.debug(
|
|
47437
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
47438
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
47439
|
+
)(message)}
|
|
47440
|
+
`
|
|
47441
|
+
);
|
|
47442
|
+
};
|
|
47443
|
+
}
|
|
47444
|
+
return (message) => {
|
|
47445
|
+
console.log(
|
|
47446
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
47447
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
47448
|
+
)(message)}
|
|
47449
|
+
`
|
|
47450
|
+
);
|
|
47451
|
+
};
|
|
47452
|
+
};
|
|
47453
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
47454
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
47455
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
47456
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
47457
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
47458
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
47459
|
+
|
|
47358
47460
|
// packages/config-tools/src/env/get-env.ts
|
|
47359
47461
|
var getExtensionEnv = (extensionName) => {
|
|
47360
47462
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
47361
47463
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
47362
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
47363
|
-
|
|
47364
|
-
|
|
47365
|
-
|
|
47464
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
47465
|
+
if (name) {
|
|
47466
|
+
ret[name] = process.env[key];
|
|
47467
|
+
}
|
|
47366
47468
|
return ret;
|
|
47367
47469
|
}, {});
|
|
47368
47470
|
};
|
|
47369
47471
|
var getConfigEnv = () => {
|
|
47370
|
-
const prefix =
|
|
47472
|
+
const prefix = "STORM_";
|
|
47371
47473
|
let config = {
|
|
47372
47474
|
name: process.env[`${prefix}NAME`],
|
|
47373
47475
|
namespace: process.env[`${prefix}NAMESPACE`],
|
|
@@ -47386,9 +47488,7 @@ var getConfigEnv = () => {
|
|
|
47386
47488
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
47387
47489
|
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
47388
47490
|
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
47389
|
-
ci: Boolean(
|
|
47390
|
-
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
47391
|
-
),
|
|
47491
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
47392
47492
|
colors: {
|
|
47393
47493
|
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
47394
47494
|
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
@@ -47401,9 +47501,7 @@ var getConfigEnv = () => {
|
|
|
47401
47501
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
47402
47502
|
branch: process.env[`${prefix}BRANCH`],
|
|
47403
47503
|
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
47404
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(
|
|
47405
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
47406
|
-
) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
47504
|
+
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,
|
|
47407
47505
|
extensions: {}
|
|
47408
47506
|
};
|
|
47409
47507
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
@@ -47418,26 +47516,27 @@ var getConfigEnv = () => {
|
|
|
47418
47516
|
}
|
|
47419
47517
|
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
47420
47518
|
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
47421
|
-
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map(
|
|
47422
|
-
|
|
47423
|
-
|
|
47424
|
-
|
|
47519
|
+
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("");
|
|
47520
|
+
if (extensionName) {
|
|
47521
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
47522
|
+
}
|
|
47425
47523
|
return ret;
|
|
47426
47524
|
}, config);
|
|
47427
47525
|
};
|
|
47428
47526
|
|
|
47429
47527
|
// packages/config-tools/src/env/set-env.ts
|
|
47430
47528
|
var setExtensionEnv = (extensionName, extension) => {
|
|
47431
|
-
Object.keys(extension ?? {})
|
|
47529
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
47432
47530
|
if (extension[key]) {
|
|
47433
|
-
|
|
47531
|
+
const result = key?.replace(
|
|
47434
47532
|
/([A-Z])+/g,
|
|
47435
47533
|
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
47436
47534
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
47437
47535
|
let extensionKey;
|
|
47438
47536
|
if (result.length === 0) {
|
|
47439
47537
|
return;
|
|
47440
|
-
}
|
|
47538
|
+
}
|
|
47539
|
+
if (result.length === 1) {
|
|
47441
47540
|
extensionKey = result[0].toUpperCase();
|
|
47442
47541
|
} else {
|
|
47443
47542
|
extensionKey = result.reduce((ret, part) => {
|
|
@@ -47446,63 +47545,121 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
47446
47545
|
}
|
|
47447
47546
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
47448
47547
|
}
|
|
47449
|
-
}
|
|
47548
|
+
}
|
|
47450
47549
|
};
|
|
47451
47550
|
var setConfigEnv = (config) => {
|
|
47452
|
-
const prefix =
|
|
47453
|
-
|
|
47454
|
-
|
|
47455
|
-
|
|
47456
|
-
|
|
47457
|
-
|
|
47458
|
-
|
|
47459
|
-
|
|
47460
|
-
|
|
47461
|
-
|
|
47462
|
-
|
|
47463
|
-
|
|
47464
|
-
|
|
47465
|
-
|
|
47466
|
-
|
|
47467
|
-
|
|
47468
|
-
|
|
47469
|
-
|
|
47470
|
-
|
|
47471
|
-
|
|
47472
|
-
|
|
47473
|
-
|
|
47474
|
-
|
|
47475
|
-
|
|
47476
|
-
|
|
47477
|
-
|
|
47478
|
-
|
|
47479
|
-
|
|
47480
|
-
|
|
47481
|
-
|
|
47482
|
-
|
|
47483
|
-
|
|
47484
|
-
|
|
47485
|
-
|
|
47486
|
-
|
|
47487
|
-
|
|
47488
|
-
|
|
47489
|
-
|
|
47490
|
-
|
|
47491
|
-
|
|
47492
|
-
|
|
47493
|
-
|
|
47494
|
-
|
|
47495
|
-
|
|
47496
|
-
)
|
|
47497
|
-
|
|
47498
|
-
|
|
47499
|
-
|
|
47551
|
+
const prefix = "STORM_";
|
|
47552
|
+
if (config.name) {
|
|
47553
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
47554
|
+
}
|
|
47555
|
+
if (config.namespace) {
|
|
47556
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
47557
|
+
}
|
|
47558
|
+
if (config.owner) {
|
|
47559
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
47560
|
+
}
|
|
47561
|
+
if (config.worker) {
|
|
47562
|
+
process.env[`${prefix}WORKER`] = config.worker;
|
|
47563
|
+
}
|
|
47564
|
+
if (config.organization) {
|
|
47565
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
47566
|
+
}
|
|
47567
|
+
if (config.packageManager) {
|
|
47568
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
47569
|
+
}
|
|
47570
|
+
if (config.license) {
|
|
47571
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
47572
|
+
}
|
|
47573
|
+
if (config.homepage) {
|
|
47574
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
47575
|
+
}
|
|
47576
|
+
if (config.timezone) {
|
|
47577
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
47578
|
+
process.env.TZ = config.timezone;
|
|
47579
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
47580
|
+
}
|
|
47581
|
+
if (config.locale) {
|
|
47582
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
47583
|
+
process.env.LOCALE = config.locale;
|
|
47584
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
47585
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
47586
|
+
}
|
|
47587
|
+
if (config.configFile) {
|
|
47588
|
+
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
47589
|
+
}
|
|
47590
|
+
if (config.workspaceRoot) {
|
|
47591
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
47592
|
+
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
47593
|
+
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
47594
|
+
}
|
|
47595
|
+
if (config.packageDirectory) {
|
|
47596
|
+
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
47597
|
+
}
|
|
47598
|
+
if (config.buildDirectory) {
|
|
47599
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
47600
|
+
}
|
|
47601
|
+
if (config.runtimeVersion) {
|
|
47602
|
+
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
47603
|
+
}
|
|
47604
|
+
if (config.runtimeDirectory) {
|
|
47605
|
+
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
47606
|
+
}
|
|
47607
|
+
if (config.env) {
|
|
47608
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
47609
|
+
process.env.NODE_ENV = config.env;
|
|
47610
|
+
process.env.ENVIRONMENT = config.env;
|
|
47611
|
+
}
|
|
47612
|
+
if (config.ci) {
|
|
47613
|
+
process.env[`${prefix}CI`] = String(config.ci);
|
|
47614
|
+
process.env.CI = String(config.ci);
|
|
47615
|
+
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
47616
|
+
}
|
|
47617
|
+
if (config.colors.primary) {
|
|
47618
|
+
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
47619
|
+
}
|
|
47620
|
+
if (config.colors.background) {
|
|
47621
|
+
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
47622
|
+
}
|
|
47623
|
+
if (config.colors.success) {
|
|
47624
|
+
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
47625
|
+
}
|
|
47626
|
+
if (config.colors.info) {
|
|
47627
|
+
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
47628
|
+
}
|
|
47629
|
+
if (config.colors.warning) {
|
|
47630
|
+
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
47631
|
+
}
|
|
47632
|
+
if (config.colors.error) {
|
|
47633
|
+
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
47634
|
+
}
|
|
47635
|
+
if (config.colors.fatal) {
|
|
47636
|
+
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
47637
|
+
}
|
|
47638
|
+
if (config.repository) {
|
|
47639
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
47640
|
+
}
|
|
47641
|
+
if (config.branch) {
|
|
47642
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
47643
|
+
}
|
|
47644
|
+
if (config.preMajor) {
|
|
47645
|
+
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
47646
|
+
}
|
|
47647
|
+
if (config.logLevel) {
|
|
47648
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
47649
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
47650
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
47651
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
47652
|
+
);
|
|
47653
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
47654
|
+
}
|
|
47655
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
47656
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
47500
47657
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
47501
|
-
}
|
|
47658
|
+
}
|
|
47502
47659
|
};
|
|
47503
47660
|
|
|
47504
47661
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
47505
|
-
var
|
|
47662
|
+
var chalk2 = __toESM(require_source());
|
|
47506
47663
|
|
|
47507
47664
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
47508
47665
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -47616,16 +47773,13 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
47616
47773
|
};
|
|
47617
47774
|
|
|
47618
47775
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
47619
|
-
var withRunExecutor = (name, executorFn, executorOptions
|
|
47620
|
-
skipReadingConfig: false,
|
|
47621
|
-
hooks: {}
|
|
47622
|
-
}) => async (_options, context) => {
|
|
47776
|
+
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
47623
47777
|
const startTime = Date.now();
|
|
47624
47778
|
let options = _options;
|
|
47779
|
+
let config;
|
|
47625
47780
|
try {
|
|
47626
|
-
|
|
47627
|
-
|
|
47628
|
-
`));
|
|
47781
|
+
writeInfo(config, `\u26A1 Running the ${name} executor...
|
|
47782
|
+
`);
|
|
47629
47783
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
47630
47784
|
throw new Error(
|
|
47631
47785
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -47635,26 +47789,37 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
47635
47789
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
47636
47790
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
47637
47791
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
47638
|
-
let config;
|
|
47639
47792
|
if (!executorOptions.skipReadingConfig) {
|
|
47793
|
+
writeDebug(
|
|
47794
|
+
config,
|
|
47795
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
47796
|
+
- workspaceRoot: ${workspaceRoot}
|
|
47797
|
+
- projectRoot: ${projectRoot}
|
|
47798
|
+
- sourceRoot: ${sourceRoot}
|
|
47799
|
+
- projectName: ${projectName}
|
|
47800
|
+
`
|
|
47801
|
+
);
|
|
47640
47802
|
config = getDefaultConfig({
|
|
47641
47803
|
...await getConfigFile(),
|
|
47642
47804
|
...getConfigEnv()
|
|
47643
47805
|
});
|
|
47644
47806
|
setConfigEnv(config);
|
|
47645
|
-
|
|
47646
|
-
|
|
47647
|
-
|
|
47648
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
|
|
47649
|
-
)
|
|
47807
|
+
writeTrace(
|
|
47808
|
+
config,
|
|
47809
|
+
`Loaded Storm config into env:
|
|
47810
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
|
|
47650
47811
|
);
|
|
47651
47812
|
}
|
|
47652
47813
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
47653
|
-
|
|
47814
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
47654
47815
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
47655
|
-
|
|
47816
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
47656
47817
|
}
|
|
47657
|
-
|
|
47818
|
+
writeTrace(
|
|
47819
|
+
config,
|
|
47820
|
+
`Executor schema options \u2699\uFE0F
|
|
47821
|
+
${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
|
|
47822
|
+
);
|
|
47658
47823
|
const tokenized = applyWorkspaceTokens(
|
|
47659
47824
|
options,
|
|
47660
47825
|
{
|
|
@@ -47669,9 +47834,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47669
47834
|
applyWorkspaceExecutorTokens
|
|
47670
47835
|
);
|
|
47671
47836
|
if (executorOptions?.hooks?.preProcess) {
|
|
47672
|
-
|
|
47837
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
47673
47838
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
47674
|
-
|
|
47839
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
47675
47840
|
}
|
|
47676
47841
|
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
47677
47842
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -47680,31 +47845,32 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47680
47845
|
});
|
|
47681
47846
|
}
|
|
47682
47847
|
if (executorOptions?.hooks?.postProcess) {
|
|
47683
|
-
|
|
47848
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
47684
47849
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
47685
|
-
|
|
47850
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
47686
47851
|
}
|
|
47687
|
-
|
|
47688
|
-
|
|
47689
|
-
|
|
47690
|
-
\u{1F389} Successfully completed running the ${name} executor!
|
|
47691
|
-
|
|
47692
|
-
`)
|
|
47693
|
-
);
|
|
47852
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
47853
|
+
`);
|
|
47694
47854
|
return {
|
|
47695
47855
|
success: true
|
|
47696
47856
|
};
|
|
47697
47857
|
} catch (error) {
|
|
47698
|
-
|
|
47699
|
-
|
|
47700
|
-
error
|
|
47858
|
+
writeFatal(
|
|
47859
|
+
config,
|
|
47860
|
+
"A fatal error occurred while running the executor - the process was forced to terminate"
|
|
47861
|
+
);
|
|
47862
|
+
writeError(
|
|
47863
|
+
config,
|
|
47864
|
+
`An exception was thrown in the executor's process
|
|
47865
|
+
- Details: ${error.message}
|
|
47866
|
+
- Stacktrace: ${error.stack}`
|
|
47701
47867
|
);
|
|
47702
47868
|
return {
|
|
47703
47869
|
success: false
|
|
47704
47870
|
};
|
|
47705
47871
|
} finally {
|
|
47706
47872
|
console.info(
|
|
47707
|
-
|
|
47873
|
+
chalk2.dim(
|
|
47708
47874
|
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
47709
47875
|
)
|
|
47710
47876
|
);
|
|
@@ -47712,14 +47878,14 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47712
47878
|
};
|
|
47713
47879
|
|
|
47714
47880
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
47715
|
-
var
|
|
47881
|
+
var chalk3 = __toESM(require_source());
|
|
47716
47882
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
47717
47883
|
skipReadingConfig: false
|
|
47718
47884
|
}) => async (tree, _options) => {
|
|
47719
47885
|
const startTime = Date.now();
|
|
47720
47886
|
let options = _options;
|
|
47721
47887
|
try {
|
|
47722
|
-
console.info(
|
|
47888
|
+
console.info(chalk3.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
|
|
47723
47889
|
|
|
47724
47890
|
`));
|
|
47725
47891
|
let config;
|
|
@@ -47730,29 +47896,29 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
47730
47896
|
});
|
|
47731
47897
|
setConfigEnv(config);
|
|
47732
47898
|
getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.debug(
|
|
47733
|
-
|
|
47899
|
+
chalk3.dim(
|
|
47734
47900
|
`Loaded Storm config into env:
|
|
47735
47901
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
|
|
47736
47902
|
)
|
|
47737
47903
|
);
|
|
47738
47904
|
}
|
|
47739
47905
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
47740
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47906
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the applyDefaultOptions hook..."));
|
|
47741
47907
|
options = await Promise.resolve(
|
|
47742
47908
|
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
47743
47909
|
);
|
|
47744
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47910
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the applyDefaultOptions hook..."));
|
|
47745
47911
|
}
|
|
47746
|
-
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(
|
|
47912
|
+
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk3.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
|
|
47747
47913
|
const tokenized = applyWorkspaceTokens(
|
|
47748
47914
|
options,
|
|
47749
47915
|
{ workspaceRoot: tree.root, config },
|
|
47750
47916
|
applyWorkspaceGeneratorTokens
|
|
47751
47917
|
);
|
|
47752
47918
|
if (generatorOptions?.hooks?.preProcess) {
|
|
47753
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47919
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the preProcess hook..."));
|
|
47754
47920
|
await Promise.resolve(generatorOptions.hooks.preProcess(options, config));
|
|
47755
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47921
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the preProcess hook..."));
|
|
47756
47922
|
}
|
|
47757
47923
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
47758
47924
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -47761,12 +47927,12 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47761
47927
|
});
|
|
47762
47928
|
}
|
|
47763
47929
|
if (generatorOptions?.hooks?.postProcess) {
|
|
47764
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47930
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the postProcess hook..."));
|
|
47765
47931
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
47766
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
47932
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the postProcess hook..."));
|
|
47767
47933
|
}
|
|
47768
47934
|
console.info(
|
|
47769
|
-
|
|
47935
|
+
chalk3.bold.hex("#087f5b")(`
|
|
47770
47936
|
|
|
47771
47937
|
\u{1F389} Successfully completed running the ${name} generator!`)
|
|
47772
47938
|
);
|
|
@@ -47775,7 +47941,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47775
47941
|
};
|
|
47776
47942
|
} catch (error) {
|
|
47777
47943
|
console.error(
|
|
47778
|
-
|
|
47944
|
+
chalk3.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
|
|
47779
47945
|
error
|
|
47780
47946
|
);
|
|
47781
47947
|
console.error(error);
|
|
@@ -47784,7 +47950,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
47784
47950
|
};
|
|
47785
47951
|
} finally {
|
|
47786
47952
|
console.info(
|
|
47787
|
-
|
|
47953
|
+
chalk3.hex("#0ea5e9").italic(
|
|
47788
47954
|
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
47789
47955
|
)
|
|
47790
47956
|
);
|