@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/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 path3 = 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 ts2.DiagnosticCategory.Warning: {
|
|
31532
|
-
message += `${
|
|
31532
|
+
message += `${chalk4.yellow.bold("warning")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
|
|
31533
31533
|
break;
|
|
31534
31534
|
}
|
|
31535
31535
|
case ts2.DiagnosticCategory.Error: {
|
|
31536
|
-
message += `${
|
|
31536
|
+
message += `${chalk4.red.bold("error")} ${chalk4.gray(`TS${diagnostic.code}`)}: `;
|
|
31537
31537
|
break;
|
|
31538
31538
|
}
|
|
31539
31539
|
case ts2.DiagnosticCategory.Suggestion:
|
|
31540
31540
|
case ts2.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 = path3.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 }
|
|
@@ -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: bold3,
|
|
46894
46894
|
dim: dim3,
|
|
46895
46895
|
italic,
|
|
@@ -65095,7 +65095,7 @@ var require_Options_gen_types = __commonJS({
|
|
|
65095
65095
|
compiledFilename: "string"
|
|
65096
65096
|
});
|
|
65097
65097
|
exports.SourceMapOptions = SourceMapOptions;
|
|
65098
|
-
var
|
|
65098
|
+
var Options = t.iface([], {
|
|
65099
65099
|
transforms: t.array("Transform"),
|
|
65100
65100
|
disableESTransforms: t.opt("boolean"),
|
|
65101
65101
|
jsxRuntime: t.opt(t.union(t.lit("classic"), t.lit("automatic"), t.lit("preserve"))),
|
|
@@ -65111,7 +65111,7 @@ var require_Options_gen_types = __commonJS({
|
|
|
65111
65111
|
sourceMapOptions: t.opt("SourceMapOptions"),
|
|
65112
65112
|
filePath: t.opt("string")
|
|
65113
65113
|
});
|
|
65114
|
-
exports.Options =
|
|
65114
|
+
exports.Options = Options;
|
|
65115
65115
|
var exportedTypeSuite = {
|
|
65116
65116
|
Transform: exports.Transform,
|
|
65117
65117
|
SourceMapOptions: exports.SourceMapOptions,
|
|
@@ -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
|
},
|
|
@@ -126395,8 +126395,10 @@ var LogLevel = {
|
|
|
126395
126395
|
ERROR: 20,
|
|
126396
126396
|
WARN: 30,
|
|
126397
126397
|
INFO: 40,
|
|
126398
|
+
SUCCESS: 45,
|
|
126398
126399
|
DEBUG: 60,
|
|
126399
|
-
TRACE: 70
|
|
126400
|
+
TRACE: 70,
|
|
126401
|
+
ALL: 100
|
|
126400
126402
|
};
|
|
126401
126403
|
var LogLevelLabel = {
|
|
126402
126404
|
SILENT: "silent",
|
|
@@ -126405,7 +126407,8 @@ var LogLevelLabel = {
|
|
|
126405
126407
|
WARN: "warn",
|
|
126406
126408
|
INFO: "info",
|
|
126407
126409
|
DEBUG: "debug",
|
|
126408
|
-
TRACE: "trace"
|
|
126410
|
+
TRACE: "trace",
|
|
126411
|
+
ALL: "all"
|
|
126409
126412
|
};
|
|
126410
126413
|
|
|
126411
126414
|
// packages/config-tools/src/utilities/find-up.ts
|
|
@@ -126414,15 +126417,15 @@ var import_path = require("path");
|
|
|
126414
126417
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
126415
126418
|
var depth = 0;
|
|
126416
126419
|
function findFolderUp(startPath, endFileNames) {
|
|
126417
|
-
|
|
126418
|
-
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(
|
|
126419
|
-
return
|
|
126420
|
-
}
|
|
126421
|
-
|
|
126420
|
+
const _startPath = startPath ?? process.cwd();
|
|
126421
|
+
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
|
|
126422
|
+
return _startPath;
|
|
126423
|
+
}
|
|
126424
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
126425
|
+
const parent = (0, import_path.join)(_startPath, "..");
|
|
126422
126426
|
return findFolderUp(parent, endFileNames);
|
|
126423
|
-
} else {
|
|
126424
|
-
return void 0;
|
|
126425
126427
|
}
|
|
126428
|
+
return void 0;
|
|
126426
126429
|
}
|
|
126427
126430
|
|
|
126428
126431
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
@@ -130079,17 +130082,13 @@ var StormConfigSchema = objectType({
|
|
|
130079
130082
|
license: stringType().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
130080
130083
|
homepage: stringType().trim().url().default("https://stormsoftware.org").describe("The homepage of the workspace"),
|
|
130081
130084
|
branch: stringType().trim().default("main").describe("The branch of the workspace"),
|
|
130082
|
-
preMajor: booleanType().default(false).describe(
|
|
130083
|
-
"An indicator specifying if the package is still in it's pre-major version"
|
|
130084
|
-
),
|
|
130085
|
+
preMajor: booleanType().default(false).describe("An indicator specifying if the package is still in it's pre-major version"),
|
|
130085
130086
|
owner: stringType().trim().default("@storm-software/development").describe("The owner of the package"),
|
|
130086
130087
|
worker: stringType().trim().default("stormie-bot").describe(
|
|
130087
130088
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
130088
130089
|
),
|
|
130089
130090
|
env: enumType(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
|
|
130090
|
-
ci: booleanType().default(true).describe(
|
|
130091
|
-
"An indicator specifying if the current environment is a CI environment"
|
|
130092
|
-
),
|
|
130091
|
+
ci: booleanType().default(true).describe("An indicator specifying if the current environment is a CI environment"),
|
|
130093
130092
|
workspaceRoot: stringType().trim().optional().describe("The root directory of the workspace"),
|
|
130094
130093
|
packageDirectory: stringType().trim().optional().describe("The root directory of the package"),
|
|
130095
130094
|
buildDirectory: stringType().trim().default("dist").describe("The build directory for the workspace"),
|
|
@@ -130100,7 +130099,7 @@ var StormConfigSchema = objectType({
|
|
|
130100
130099
|
packageManager: enumType(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
130101
130100
|
timezone: stringType().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
130102
130101
|
locale: stringType().trim().default("en-US").describe("The default locale of the workspace"),
|
|
130103
|
-
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
130102
|
+
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]).default("debug").describe(
|
|
130104
130103
|
"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`)."
|
|
130105
130104
|
),
|
|
130106
130105
|
configFile: stringType().trim().nullable().default(null).describe(
|
|
@@ -130158,11 +130157,21 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
130158
130157
|
});
|
|
130159
130158
|
if (file) {
|
|
130160
130159
|
const packageJson = JSON.parse(file);
|
|
130161
|
-
|
|
130162
|
-
|
|
130163
|
-
|
|
130164
|
-
|
|
130165
|
-
|
|
130160
|
+
if (packageJson.name) {
|
|
130161
|
+
name = packageJson.name;
|
|
130162
|
+
}
|
|
130163
|
+
if (packageJson.namespace) {
|
|
130164
|
+
namespace = packageJson.namespace;
|
|
130165
|
+
}
|
|
130166
|
+
if (packageJson.repository?.url) {
|
|
130167
|
+
repository = packageJson.repository?.url;
|
|
130168
|
+
}
|
|
130169
|
+
if (packageJson.license) {
|
|
130170
|
+
license = packageJson.license;
|
|
130171
|
+
}
|
|
130172
|
+
if (packageJson.homepage) {
|
|
130173
|
+
homepage = packageJson.homepage;
|
|
130174
|
+
}
|
|
130166
130175
|
}
|
|
130167
130176
|
}
|
|
130168
130177
|
return StormConfigSchema.parse({
|
|
@@ -130184,6 +130193,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
130184
130193
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
130185
130194
|
var getLogLevel = (label) => {
|
|
130186
130195
|
switch (label) {
|
|
130196
|
+
case "all":
|
|
130197
|
+
return LogLevel.ALL;
|
|
130187
130198
|
case "trace":
|
|
130188
130199
|
return LogLevel.TRACE;
|
|
130189
130200
|
case "debug":
|
|
@@ -130203,38 +130214,129 @@ var getLogLevel = (label) => {
|
|
|
130203
130214
|
}
|
|
130204
130215
|
};
|
|
130205
130216
|
var getLogLevelLabel = (logLevel) => {
|
|
130217
|
+
if (logLevel >= LogLevel.ALL) {
|
|
130218
|
+
return LogLevelLabel.ALL;
|
|
130219
|
+
}
|
|
130206
130220
|
if (logLevel >= LogLevel.TRACE) {
|
|
130207
130221
|
return LogLevelLabel.TRACE;
|
|
130208
|
-
}
|
|
130222
|
+
}
|
|
130223
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
130209
130224
|
return LogLevelLabel.DEBUG;
|
|
130210
|
-
}
|
|
130225
|
+
}
|
|
130226
|
+
if (logLevel >= LogLevel.INFO) {
|
|
130211
130227
|
return LogLevelLabel.INFO;
|
|
130212
|
-
}
|
|
130228
|
+
}
|
|
130229
|
+
if (logLevel >= LogLevel.WARN) {
|
|
130213
130230
|
return LogLevelLabel.WARN;
|
|
130214
|
-
}
|
|
130231
|
+
}
|
|
130232
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
130215
130233
|
return LogLevelLabel.ERROR;
|
|
130216
|
-
}
|
|
130234
|
+
}
|
|
130235
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
130217
130236
|
return LogLevelLabel.FATAL;
|
|
130218
|
-
}
|
|
130237
|
+
}
|
|
130238
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
130219
130239
|
return LogLevelLabel.SILENT;
|
|
130220
|
-
} else {
|
|
130221
|
-
return LogLevelLabel.INFO;
|
|
130222
130240
|
}
|
|
130241
|
+
return LogLevelLabel.INFO;
|
|
130242
|
+
};
|
|
130243
|
+
|
|
130244
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
130245
|
+
var chalk = __toESM(require_source(), 1);
|
|
130246
|
+
var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
130247
|
+
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)) {
|
|
130248
|
+
return (message) => {
|
|
130249
|
+
};
|
|
130250
|
+
}
|
|
130251
|
+
if (typeof logLevel === "number" && LogLevel.FATAL >= logLevel || typeof logLevel === "string" && LogLevel.FATAL >= getLogLevel(logLevel)) {
|
|
130252
|
+
return (message) => {
|
|
130253
|
+
console.error(
|
|
130254
|
+
` ${chalk.bold.bgHex(config?.colors?.fatal ? config.colors.fatal : "#1fb2a6").inverse("\n\n \u{1F480} Fatal ")} ${chalk.reset.hex(
|
|
130255
|
+
config?.colors?.fatal ? config.colors.fatal : "#1fb2a6"
|
|
130256
|
+
)(message)}
|
|
130257
|
+
`
|
|
130258
|
+
);
|
|
130259
|
+
};
|
|
130260
|
+
}
|
|
130261
|
+
if (typeof logLevel === "number" && LogLevel.ERROR >= logLevel || typeof logLevel === "string" && LogLevel.ERROR >= getLogLevel(logLevel)) {
|
|
130262
|
+
return (message) => {
|
|
130263
|
+
console.error(
|
|
130264
|
+
` ${chalk.bold.bgHex(config?.colors?.error ? config.colors.error : "#7d1a1a").inverse("\n\n \u{1F6D1} Error ")} ${chalk.reset.hex(
|
|
130265
|
+
config?.colors?.error ? config.colors.error : "#7d1a1a"
|
|
130266
|
+
)(message)}
|
|
130267
|
+
`
|
|
130268
|
+
);
|
|
130269
|
+
};
|
|
130270
|
+
}
|
|
130271
|
+
if (typeof logLevel === "number" && LogLevel.WARN >= logLevel || typeof logLevel === "string" && LogLevel.WARN >= getLogLevel(logLevel)) {
|
|
130272
|
+
return (message) => {
|
|
130273
|
+
console.warn(
|
|
130274
|
+
` ${chalk.bold.bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419").inverse("\n\n \u26A0\uFE0F Warn ")} ${chalk.reset.hex(
|
|
130275
|
+
config?.colors?.warning ? config.colors.warning : "#fcc419"
|
|
130276
|
+
)(message)}
|
|
130277
|
+
`
|
|
130278
|
+
);
|
|
130279
|
+
};
|
|
130280
|
+
}
|
|
130281
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130282
|
+
return (message) => {
|
|
130283
|
+
console.info(
|
|
130284
|
+
` ${chalk.bold.bgHex(config?.colors?.info ? config.colors.info : "#0ea5e9").inverse("\n\n \u{1F4EC} Info ")} ${chalk.reset.hex(
|
|
130285
|
+
config?.colors?.info ? config.colors.info : "#0ea5e9"
|
|
130286
|
+
)(message)}
|
|
130287
|
+
`
|
|
130288
|
+
);
|
|
130289
|
+
};
|
|
130290
|
+
}
|
|
130291
|
+
if (typeof logLevel === "number" && LogLevel.INFO >= logLevel || typeof logLevel === "string" && LogLevel.INFO >= getLogLevel(logLevel)) {
|
|
130292
|
+
return (message) => {
|
|
130293
|
+
console.info(
|
|
130294
|
+
` ${chalk.bold.bgHex(config?.colors?.success ? config.colors.success : "#087f5b").inverse("\n\n \u{1F389} Success ")} ${chalk.reset.hex(
|
|
130295
|
+
config?.colors?.success ? config.colors.success : "#087f5b"
|
|
130296
|
+
)(message)}
|
|
130297
|
+
`
|
|
130298
|
+
);
|
|
130299
|
+
};
|
|
130300
|
+
}
|
|
130301
|
+
if (typeof logLevel === "number" && LogLevel.DEBUG >= logLevel || typeof logLevel === "string" && LogLevel.DEBUG >= getLogLevel(logLevel)) {
|
|
130302
|
+
return (message) => {
|
|
130303
|
+
console.debug(
|
|
130304
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F9EA} Debug ")} ${chalk.reset.hex(
|
|
130305
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130306
|
+
)(message)}
|
|
130307
|
+
`
|
|
130308
|
+
);
|
|
130309
|
+
};
|
|
130310
|
+
}
|
|
130311
|
+
return (message) => {
|
|
130312
|
+
console.log(
|
|
130313
|
+
` ${chalk.bold.bgHex(config?.colors?.primary ? config.colors.primary : "#1fb2a6").inverse("\n\n \u{1F4E2} System ")} ${chalk.bold.hex(
|
|
130314
|
+
config?.colors?.primary ? config.colors.primary : "#1fb2a6"
|
|
130315
|
+
)(message)}
|
|
130316
|
+
`
|
|
130317
|
+
);
|
|
130318
|
+
};
|
|
130223
130319
|
};
|
|
130320
|
+
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
130321
|
+
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
130322
|
+
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
130323
|
+
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
130324
|
+
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
130325
|
+
var writeTrace = (config, message) => getLogFn(config, LogLevel.TRACE)(message);
|
|
130224
130326
|
|
|
130225
130327
|
// packages/config-tools/src/env/get-env.ts
|
|
130226
130328
|
var getExtensionEnv = (extensionName) => {
|
|
130227
130329
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
130228
130330
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
130229
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
130230
|
-
|
|
130231
|
-
|
|
130232
|
-
|
|
130331
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
130332
|
+
if (name) {
|
|
130333
|
+
ret[name] = process.env[key];
|
|
130334
|
+
}
|
|
130233
130335
|
return ret;
|
|
130234
130336
|
}, {});
|
|
130235
130337
|
};
|
|
130236
130338
|
var getConfigEnv = () => {
|
|
130237
|
-
const prefix =
|
|
130339
|
+
const prefix = "STORM_";
|
|
130238
130340
|
let config = {
|
|
130239
130341
|
name: process.env[`${prefix}NAME`],
|
|
130240
130342
|
namespace: process.env[`${prefix}NAMESPACE`],
|
|
@@ -130253,9 +130355,7 @@ var getConfigEnv = () => {
|
|
|
130253
130355
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
130254
130356
|
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
130255
130357
|
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
130256
|
-
ci: Boolean(
|
|
130257
|
-
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
130258
|
-
),
|
|
130358
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
130259
130359
|
colors: {
|
|
130260
130360
|
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
130261
130361
|
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
@@ -130268,9 +130368,7 @@ var getConfigEnv = () => {
|
|
|
130268
130368
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
130269
130369
|
branch: process.env[`${prefix}BRANCH`],
|
|
130270
130370
|
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
130271
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(
|
|
130272
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
130273
|
-
) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
130371
|
+
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,
|
|
130274
130372
|
extensions: {}
|
|
130275
130373
|
};
|
|
130276
130374
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
@@ -130285,26 +130383,27 @@ var getConfigEnv = () => {
|
|
|
130285
130383
|
}
|
|
130286
130384
|
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
130287
130385
|
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
130288
|
-
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map(
|
|
130289
|
-
|
|
130290
|
-
|
|
130291
|
-
|
|
130386
|
+
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("");
|
|
130387
|
+
if (extensionName) {
|
|
130388
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
130389
|
+
}
|
|
130292
130390
|
return ret;
|
|
130293
130391
|
}, config);
|
|
130294
130392
|
};
|
|
130295
130393
|
|
|
130296
130394
|
// packages/config-tools/src/env/set-env.ts
|
|
130297
130395
|
var setExtensionEnv = (extensionName, extension) => {
|
|
130298
|
-
Object.keys(extension ?? {})
|
|
130396
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
130299
130397
|
if (extension[key]) {
|
|
130300
|
-
|
|
130398
|
+
const result = key?.replace(
|
|
130301
130399
|
/([A-Z])+/g,
|
|
130302
130400
|
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
130303
130401
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
130304
130402
|
let extensionKey;
|
|
130305
130403
|
if (result.length === 0) {
|
|
130306
130404
|
return;
|
|
130307
|
-
}
|
|
130405
|
+
}
|
|
130406
|
+
if (result.length === 1) {
|
|
130308
130407
|
extensionKey = result[0].toUpperCase();
|
|
130309
130408
|
} else {
|
|
130310
130409
|
extensionKey = result.reduce((ret, part) => {
|
|
@@ -130313,63 +130412,121 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
130313
130412
|
}
|
|
130314
130413
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
130315
130414
|
}
|
|
130316
|
-
}
|
|
130415
|
+
}
|
|
130317
130416
|
};
|
|
130318
130417
|
var setConfigEnv = (config) => {
|
|
130319
|
-
const prefix =
|
|
130320
|
-
|
|
130321
|
-
|
|
130322
|
-
|
|
130323
|
-
|
|
130324
|
-
|
|
130325
|
-
|
|
130326
|
-
|
|
130327
|
-
|
|
130328
|
-
|
|
130329
|
-
|
|
130330
|
-
|
|
130331
|
-
|
|
130332
|
-
|
|
130333
|
-
|
|
130334
|
-
|
|
130335
|
-
|
|
130336
|
-
|
|
130337
|
-
|
|
130338
|
-
|
|
130339
|
-
|
|
130340
|
-
|
|
130341
|
-
|
|
130342
|
-
|
|
130343
|
-
|
|
130344
|
-
|
|
130345
|
-
|
|
130346
|
-
|
|
130347
|
-
|
|
130348
|
-
|
|
130349
|
-
|
|
130350
|
-
|
|
130351
|
-
|
|
130352
|
-
|
|
130353
|
-
|
|
130354
|
-
|
|
130355
|
-
|
|
130356
|
-
|
|
130357
|
-
|
|
130358
|
-
|
|
130359
|
-
|
|
130360
|
-
|
|
130361
|
-
|
|
130362
|
-
|
|
130363
|
-
)
|
|
130364
|
-
|
|
130365
|
-
|
|
130366
|
-
|
|
130418
|
+
const prefix = "STORM_";
|
|
130419
|
+
if (config.name) {
|
|
130420
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
130421
|
+
}
|
|
130422
|
+
if (config.namespace) {
|
|
130423
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
130424
|
+
}
|
|
130425
|
+
if (config.owner) {
|
|
130426
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
130427
|
+
}
|
|
130428
|
+
if (config.worker) {
|
|
130429
|
+
process.env[`${prefix}WORKER`] = config.worker;
|
|
130430
|
+
}
|
|
130431
|
+
if (config.organization) {
|
|
130432
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
130433
|
+
}
|
|
130434
|
+
if (config.packageManager) {
|
|
130435
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
130436
|
+
}
|
|
130437
|
+
if (config.license) {
|
|
130438
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
130439
|
+
}
|
|
130440
|
+
if (config.homepage) {
|
|
130441
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
130442
|
+
}
|
|
130443
|
+
if (config.timezone) {
|
|
130444
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
130445
|
+
process.env.TZ = config.timezone;
|
|
130446
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
130447
|
+
}
|
|
130448
|
+
if (config.locale) {
|
|
130449
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
130450
|
+
process.env.LOCALE = config.locale;
|
|
130451
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
130452
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
130453
|
+
}
|
|
130454
|
+
if (config.configFile) {
|
|
130455
|
+
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
130456
|
+
}
|
|
130457
|
+
if (config.workspaceRoot) {
|
|
130458
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
130459
|
+
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
130460
|
+
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
130461
|
+
}
|
|
130462
|
+
if (config.packageDirectory) {
|
|
130463
|
+
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
130464
|
+
}
|
|
130465
|
+
if (config.buildDirectory) {
|
|
130466
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
130467
|
+
}
|
|
130468
|
+
if (config.runtimeVersion) {
|
|
130469
|
+
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
130470
|
+
}
|
|
130471
|
+
if (config.runtimeDirectory) {
|
|
130472
|
+
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
130473
|
+
}
|
|
130474
|
+
if (config.env) {
|
|
130475
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
130476
|
+
process.env.NODE_ENV = config.env;
|
|
130477
|
+
process.env.ENVIRONMENT = config.env;
|
|
130478
|
+
}
|
|
130479
|
+
if (config.ci) {
|
|
130480
|
+
process.env[`${prefix}CI`] = String(config.ci);
|
|
130481
|
+
process.env.CI = String(config.ci);
|
|
130482
|
+
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
130483
|
+
}
|
|
130484
|
+
if (config.colors.primary) {
|
|
130485
|
+
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
130486
|
+
}
|
|
130487
|
+
if (config.colors.background) {
|
|
130488
|
+
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
130489
|
+
}
|
|
130490
|
+
if (config.colors.success) {
|
|
130491
|
+
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
130492
|
+
}
|
|
130493
|
+
if (config.colors.info) {
|
|
130494
|
+
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
130495
|
+
}
|
|
130496
|
+
if (config.colors.warning) {
|
|
130497
|
+
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
130498
|
+
}
|
|
130499
|
+
if (config.colors.error) {
|
|
130500
|
+
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
130501
|
+
}
|
|
130502
|
+
if (config.colors.fatal) {
|
|
130503
|
+
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
130504
|
+
}
|
|
130505
|
+
if (config.repository) {
|
|
130506
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
130507
|
+
}
|
|
130508
|
+
if (config.branch) {
|
|
130509
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
130510
|
+
}
|
|
130511
|
+
if (config.preMajor) {
|
|
130512
|
+
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
130513
|
+
}
|
|
130514
|
+
if (config.logLevel) {
|
|
130515
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
130516
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
130517
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
130518
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
130519
|
+
);
|
|
130520
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
130521
|
+
}
|
|
130522
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
130523
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
130367
130524
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
130368
|
-
}
|
|
130525
|
+
}
|
|
130369
130526
|
};
|
|
130370
130527
|
|
|
130371
130528
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
130372
|
-
var
|
|
130529
|
+
var chalk2 = __toESM(require_source());
|
|
130373
130530
|
|
|
130374
130531
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
130375
130532
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -130483,16 +130640,13 @@ var applyWorkspaceTokens = (options, config, tokenizerFn) => {
|
|
|
130483
130640
|
};
|
|
130484
130641
|
|
|
130485
130642
|
// packages/workspace-tools/src/base/base-executor.ts
|
|
130486
|
-
var withRunExecutor = (name, executorFn, executorOptions
|
|
130487
|
-
skipReadingConfig: false,
|
|
130488
|
-
hooks: {}
|
|
130489
|
-
}) => async (_options, context) => {
|
|
130643
|
+
var withRunExecutor = (name, executorFn, executorOptions) => async (_options, context) => {
|
|
130490
130644
|
const startTime = Date.now();
|
|
130491
130645
|
let options = _options;
|
|
130646
|
+
let config;
|
|
130492
130647
|
try {
|
|
130493
|
-
|
|
130494
|
-
|
|
130495
|
-
`));
|
|
130648
|
+
writeInfo(config, `\u26A1 Running the ${name} executor...
|
|
130649
|
+
`);
|
|
130496
130650
|
if (!context.projectsConfigurations?.projects || !context.projectName || !context.projectsConfigurations.projects[context.projectName]) {
|
|
130497
130651
|
throw new Error(
|
|
130498
130652
|
"The Build process failed because the context is not valid. Please run this command from a workspace."
|
|
@@ -130502,26 +130656,37 @@ var withRunExecutor = (name, executorFn, executorOptions = {
|
|
|
130502
130656
|
const projectRoot = context.projectsConfigurations.projects[context.projectName].root;
|
|
130503
130657
|
const sourceRoot = context.projectsConfigurations.projects[context.projectName].sourceRoot;
|
|
130504
130658
|
const projectName = context.projectsConfigurations.projects[context.projectName].name;
|
|
130505
|
-
let config;
|
|
130506
130659
|
if (!executorOptions.skipReadingConfig) {
|
|
130660
|
+
writeDebug(
|
|
130661
|
+
config,
|
|
130662
|
+
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
130663
|
+
- workspaceRoot: ${workspaceRoot}
|
|
130664
|
+
- projectRoot: ${projectRoot}
|
|
130665
|
+
- sourceRoot: ${sourceRoot}
|
|
130666
|
+
- projectName: ${projectName}
|
|
130667
|
+
`
|
|
130668
|
+
);
|
|
130507
130669
|
config = getDefaultConfig({
|
|
130508
130670
|
...await getConfigFile(),
|
|
130509
130671
|
...getConfigEnv()
|
|
130510
130672
|
});
|
|
130511
130673
|
setConfigEnv(config);
|
|
130512
|
-
|
|
130513
|
-
|
|
130514
|
-
|
|
130515
|
-
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
|
|
130516
|
-
)
|
|
130674
|
+
writeTrace(
|
|
130675
|
+
config,
|
|
130676
|
+
`Loaded Storm config into env:
|
|
130677
|
+
${Object.keys(process.env).map((key) => ` - ${key}=${JSON.stringify(process.env[key])}`).join("\n")}`
|
|
130517
130678
|
);
|
|
130518
130679
|
}
|
|
130519
130680
|
if (executorOptions?.hooks?.applyDefaultOptions) {
|
|
130520
|
-
|
|
130681
|
+
writeDebug(config, "Running the applyDefaultOptions hook...");
|
|
130521
130682
|
options = await Promise.resolve(executorOptions.hooks.applyDefaultOptions(options, config));
|
|
130522
|
-
|
|
130683
|
+
writeDebug(config, "Completed the applyDefaultOptions hook");
|
|
130523
130684
|
}
|
|
130524
|
-
|
|
130685
|
+
writeTrace(
|
|
130686
|
+
config,
|
|
130687
|
+
`Executor schema options \u2699\uFE0F
|
|
130688
|
+
${Object.keys(options).map((key) => ` - ${key}=${JSON.stringify(options[key])}`).join("\n")}`
|
|
130689
|
+
);
|
|
130525
130690
|
const tokenized = applyWorkspaceTokens(
|
|
130526
130691
|
options,
|
|
130527
130692
|
{
|
|
@@ -130536,9 +130701,9 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130536
130701
|
applyWorkspaceExecutorTokens
|
|
130537
130702
|
);
|
|
130538
130703
|
if (executorOptions?.hooks?.preProcess) {
|
|
130539
|
-
|
|
130704
|
+
writeDebug(config, "Running the preProcess hook...");
|
|
130540
130705
|
await Promise.resolve(executorOptions.hooks.preProcess(tokenized, config));
|
|
130541
|
-
|
|
130706
|
+
writeDebug(config, "Completed the preProcess hook");
|
|
130542
130707
|
}
|
|
130543
130708
|
const result = await Promise.resolve(executorFn(tokenized, context, config));
|
|
130544
130709
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -130547,31 +130712,32 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130547
130712
|
});
|
|
130548
130713
|
}
|
|
130549
130714
|
if (executorOptions?.hooks?.postProcess) {
|
|
130550
|
-
|
|
130715
|
+
writeDebug(config, "Running the postProcess hook...");
|
|
130551
130716
|
await Promise.resolve(executorOptions.hooks.postProcess(config));
|
|
130552
|
-
|
|
130717
|
+
writeDebug(config, "Completed the postProcess hook");
|
|
130553
130718
|
}
|
|
130554
|
-
|
|
130555
|
-
|
|
130556
|
-
|
|
130557
|
-
\u{1F389} Successfully completed running the ${name} executor!
|
|
130558
|
-
|
|
130559
|
-
`)
|
|
130560
|
-
);
|
|
130719
|
+
writeSuccess(config, `Completed running the ${name} task executor!
|
|
130720
|
+
`);
|
|
130561
130721
|
return {
|
|
130562
130722
|
success: true
|
|
130563
130723
|
};
|
|
130564
130724
|
} catch (error) {
|
|
130565
|
-
|
|
130566
|
-
|
|
130567
|
-
error
|
|
130725
|
+
writeFatal(
|
|
130726
|
+
config,
|
|
130727
|
+
"A fatal error occurred while running the executor - the process was forced to terminate"
|
|
130728
|
+
);
|
|
130729
|
+
writeError(
|
|
130730
|
+
config,
|
|
130731
|
+
`An exception was thrown in the executor's process
|
|
130732
|
+
- Details: ${error.message}
|
|
130733
|
+
- Stacktrace: ${error.stack}`
|
|
130568
130734
|
);
|
|
130569
130735
|
return {
|
|
130570
130736
|
success: false
|
|
130571
130737
|
};
|
|
130572
130738
|
} finally {
|
|
130573
130739
|
console.info(
|
|
130574
|
-
|
|
130740
|
+
chalk2.dim(
|
|
130575
130741
|
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
130576
130742
|
)
|
|
130577
130743
|
);
|
|
@@ -130579,14 +130745,14 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130579
130745
|
};
|
|
130580
130746
|
|
|
130581
130747
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
130582
|
-
var
|
|
130748
|
+
var chalk3 = __toESM(require_source());
|
|
130583
130749
|
var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
130584
130750
|
skipReadingConfig: false
|
|
130585
130751
|
}) => async (tree, _options) => {
|
|
130586
130752
|
const startTime = Date.now();
|
|
130587
130753
|
let options = _options;
|
|
130588
130754
|
try {
|
|
130589
|
-
console.info(
|
|
130755
|
+
console.info(chalk3.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
|
|
130590
130756
|
|
|
130591
130757
|
`));
|
|
130592
130758
|
let config;
|
|
@@ -130597,29 +130763,29 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
130597
130763
|
});
|
|
130598
130764
|
setConfigEnv(config);
|
|
130599
130765
|
getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.debug(
|
|
130600
|
-
|
|
130766
|
+
chalk3.dim(
|
|
130601
130767
|
`Loaded Storm config into env:
|
|
130602
130768
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
|
|
130603
130769
|
)
|
|
130604
130770
|
);
|
|
130605
130771
|
}
|
|
130606
130772
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
130607
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130773
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the applyDefaultOptions hook..."));
|
|
130608
130774
|
options = await Promise.resolve(
|
|
130609
130775
|
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
130610
130776
|
);
|
|
130611
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130777
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the applyDefaultOptions hook..."));
|
|
130612
130778
|
}
|
|
130613
|
-
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(
|
|
130779
|
+
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk3.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
|
|
130614
130780
|
const tokenized = applyWorkspaceTokens(
|
|
130615
130781
|
options,
|
|
130616
130782
|
{ workspaceRoot: tree.root, config },
|
|
130617
130783
|
applyWorkspaceGeneratorTokens
|
|
130618
130784
|
);
|
|
130619
130785
|
if (generatorOptions?.hooks?.preProcess) {
|
|
130620
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130786
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the preProcess hook..."));
|
|
130621
130787
|
await Promise.resolve(generatorOptions.hooks.preProcess(options, config));
|
|
130622
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130788
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the preProcess hook..."));
|
|
130623
130789
|
}
|
|
130624
130790
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
130625
130791
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -130628,12 +130794,12 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130628
130794
|
});
|
|
130629
130795
|
}
|
|
130630
130796
|
if (generatorOptions?.hooks?.postProcess) {
|
|
130631
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130797
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Running the postProcess hook..."));
|
|
130632
130798
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
130633
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
130799
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk3.dim("Completed the postProcess hook..."));
|
|
130634
130800
|
}
|
|
130635
130801
|
console.info(
|
|
130636
|
-
|
|
130802
|
+
chalk3.bold.hex("#087f5b")(`
|
|
130637
130803
|
|
|
130638
130804
|
\u{1F389} Successfully completed running the ${name} generator!`)
|
|
130639
130805
|
);
|
|
@@ -130642,7 +130808,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130642
130808
|
};
|
|
130643
130809
|
} catch (error) {
|
|
130644
130810
|
console.error(
|
|
130645
|
-
|
|
130811
|
+
chalk3.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
|
|
130646
130812
|
error
|
|
130647
130813
|
);
|
|
130648
130814
|
console.error(error);
|
|
@@ -130651,7 +130817,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
130651
130817
|
};
|
|
130652
130818
|
} finally {
|
|
130653
130819
|
console.info(
|
|
130654
|
-
|
|
130820
|
+
chalk3.hex("#0ea5e9").italic(
|
|
130655
130821
|
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
130656
130822
|
)
|
|
130657
130823
|
);
|