@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
|
@@ -16158,14 +16158,14 @@ var require_share = __commonJS({
|
|
|
16158
16158
|
resetConnection === null || resetConnection === void 0 ? void 0 : resetConnection.unsubscribe();
|
|
16159
16159
|
resetConnection = void 0;
|
|
16160
16160
|
};
|
|
16161
|
-
var
|
|
16161
|
+
var reset2 = function() {
|
|
16162
16162
|
cancelReset();
|
|
16163
16163
|
connection = subject = void 0;
|
|
16164
16164
|
hasCompleted = hasErrored = false;
|
|
16165
16165
|
};
|
|
16166
16166
|
var resetAndUnsubscribe = function() {
|
|
16167
16167
|
var conn = connection;
|
|
16168
|
-
|
|
16168
|
+
reset2();
|
|
16169
16169
|
conn === null || conn === void 0 ? void 0 : conn.unsubscribe();
|
|
16170
16170
|
};
|
|
16171
16171
|
return lift_1.operate(function(source, subscriber) {
|
|
@@ -16189,13 +16189,13 @@ var require_share = __commonJS({
|
|
|
16189
16189
|
error: function(err) {
|
|
16190
16190
|
hasErrored = true;
|
|
16191
16191
|
cancelReset();
|
|
16192
|
-
resetConnection = handleReset(
|
|
16192
|
+
resetConnection = handleReset(reset2, resetOnError, err);
|
|
16193
16193
|
dest.error(err);
|
|
16194
16194
|
},
|
|
16195
16195
|
complete: function() {
|
|
16196
16196
|
hasCompleted = true;
|
|
16197
16197
|
cancelReset();
|
|
16198
|
-
resetConnection = handleReset(
|
|
16198
|
+
resetConnection = handleReset(reset2, resetOnComplete);
|
|
16199
16199
|
dest.complete();
|
|
16200
16200
|
}
|
|
16201
16201
|
});
|
|
@@ -16205,13 +16205,13 @@ var require_share = __commonJS({
|
|
|
16205
16205
|
};
|
|
16206
16206
|
}
|
|
16207
16207
|
exports.share = share;
|
|
16208
|
-
function handleReset(
|
|
16208
|
+
function handleReset(reset2, on) {
|
|
16209
16209
|
var args = [];
|
|
16210
16210
|
for (var _i = 2; _i < arguments.length; _i++) {
|
|
16211
16211
|
args[_i - 2] = arguments[_i];
|
|
16212
16212
|
}
|
|
16213
16213
|
if (on === true) {
|
|
16214
|
-
|
|
16214
|
+
reset2();
|
|
16215
16215
|
return;
|
|
16216
16216
|
}
|
|
16217
16217
|
if (on === false) {
|
|
@@ -16220,7 +16220,7 @@ var require_share = __commonJS({
|
|
|
16220
16220
|
var onSubscriber = new Subscriber_1.SafeSubscriber({
|
|
16221
16221
|
next: function() {
|
|
16222
16222
|
onSubscriber.unsubscribe();
|
|
16223
|
-
|
|
16223
|
+
reset2();
|
|
16224
16224
|
}
|
|
16225
16225
|
});
|
|
16226
16226
|
return innerFrom_1.innerFrom(on.apply(void 0, __spreadArray2([], __read2(args)))).subscribe(onSubscriber);
|
|
@@ -20174,14 +20174,14 @@ var require_templates = __commonJS({
|
|
|
20174
20174
|
}
|
|
20175
20175
|
return results;
|
|
20176
20176
|
}
|
|
20177
|
-
function buildStyle(
|
|
20177
|
+
function buildStyle(chalk3, styles) {
|
|
20178
20178
|
const enabled = {};
|
|
20179
20179
|
for (const layer of styles) {
|
|
20180
20180
|
for (const style of layer.styles) {
|
|
20181
20181
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
20182
20182
|
}
|
|
20183
20183
|
}
|
|
20184
|
-
let current =
|
|
20184
|
+
let current = chalk3;
|
|
20185
20185
|
for (const styleName of Object.keys(enabled)) {
|
|
20186
20186
|
if (Array.isArray(enabled[styleName])) {
|
|
20187
20187
|
if (!(styleName in current)) {
|
|
@@ -20196,7 +20196,7 @@ var require_templates = __commonJS({
|
|
|
20196
20196
|
}
|
|
20197
20197
|
return current;
|
|
20198
20198
|
}
|
|
20199
|
-
module2.exports = (
|
|
20199
|
+
module2.exports = (chalk3, tmp) => {
|
|
20200
20200
|
const styles = [];
|
|
20201
20201
|
const chunks = [];
|
|
20202
20202
|
let chunk = [];
|
|
@@ -20206,13 +20206,13 @@ var require_templates = __commonJS({
|
|
|
20206
20206
|
} else if (style) {
|
|
20207
20207
|
const str = chunk.join("");
|
|
20208
20208
|
chunk = [];
|
|
20209
|
-
chunks.push(styles.length === 0 ? str : buildStyle(
|
|
20209
|
+
chunks.push(styles.length === 0 ? str : buildStyle(chalk3, styles)(str));
|
|
20210
20210
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
20211
20211
|
} else if (close) {
|
|
20212
20212
|
if (styles.length === 0) {
|
|
20213
20213
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
20214
20214
|
}
|
|
20215
|
-
chunks.push(buildStyle(
|
|
20215
|
+
chunks.push(buildStyle(chalk3, styles)(chunk.join("")));
|
|
20216
20216
|
chunk = [];
|
|
20217
20217
|
styles.pop();
|
|
20218
20218
|
} else {
|
|
@@ -20249,16 +20249,16 @@ var require_chalk = __commonJS({
|
|
|
20249
20249
|
}
|
|
20250
20250
|
function Chalk(options) {
|
|
20251
20251
|
if (!this || !(this instanceof Chalk) || this.template) {
|
|
20252
|
-
const
|
|
20253
|
-
applyOptions(
|
|
20254
|
-
|
|
20252
|
+
const chalk3 = {};
|
|
20253
|
+
applyOptions(chalk3, options);
|
|
20254
|
+
chalk3.template = function() {
|
|
20255
20255
|
const args = [].slice.call(arguments);
|
|
20256
|
-
return chalkTag.apply(null, [
|
|
20256
|
+
return chalkTag.apply(null, [chalk3.template].concat(args));
|
|
20257
20257
|
};
|
|
20258
|
-
Object.setPrototypeOf(
|
|
20259
|
-
Object.setPrototypeOf(
|
|
20260
|
-
|
|
20261
|
-
return
|
|
20258
|
+
Object.setPrototypeOf(chalk3, Chalk.prototype);
|
|
20259
|
+
Object.setPrototypeOf(chalk3.template, chalk3);
|
|
20260
|
+
chalk3.template.constructor = Chalk;
|
|
20261
|
+
return chalk3.template;
|
|
20262
20262
|
}
|
|
20263
20263
|
applyOptions(this, options);
|
|
20264
20264
|
}
|
|
@@ -20377,7 +20377,7 @@ var require_chalk = __commonJS({
|
|
|
20377
20377
|
ansiStyles.dim.open = originalDim;
|
|
20378
20378
|
return str;
|
|
20379
20379
|
}
|
|
20380
|
-
function chalkTag(
|
|
20380
|
+
function chalkTag(chalk3, strings) {
|
|
20381
20381
|
if (!Array.isArray(strings)) {
|
|
20382
20382
|
return [].slice.call(arguments, 1).join(" ");
|
|
20383
20383
|
}
|
|
@@ -20387,7 +20387,7 @@ var require_chalk = __commonJS({
|
|
|
20387
20387
|
parts.push(String(args[i - 1]).replace(/[{}\\]/g, "\\$&"));
|
|
20388
20388
|
parts.push(String(strings.raw[i]));
|
|
20389
20389
|
}
|
|
20390
|
-
return template(
|
|
20390
|
+
return template(chalk3, parts.join(""));
|
|
20391
20391
|
}
|
|
20392
20392
|
Object.defineProperties(Chalk.prototype, styles);
|
|
20393
20393
|
module2.exports = Chalk();
|
|
@@ -20433,17 +20433,17 @@ var require_lib2 = __commonJS({
|
|
|
20433
20433
|
return n.default = e, t && t.set(e, n), n;
|
|
20434
20434
|
}
|
|
20435
20435
|
var sometimesKeywords = /* @__PURE__ */ new Set(["as", "async", "from", "get", "of", "set"]);
|
|
20436
|
-
function getDefs(
|
|
20436
|
+
function getDefs(chalk3) {
|
|
20437
20437
|
return {
|
|
20438
|
-
keyword:
|
|
20439
|
-
capitalized:
|
|
20440
|
-
jsxIdentifier:
|
|
20441
|
-
punctuator:
|
|
20442
|
-
number:
|
|
20443
|
-
string:
|
|
20444
|
-
regex:
|
|
20445
|
-
comment:
|
|
20446
|
-
invalid:
|
|
20438
|
+
keyword: chalk3.cyan,
|
|
20439
|
+
capitalized: chalk3.yellow,
|
|
20440
|
+
jsxIdentifier: chalk3.yellow,
|
|
20441
|
+
punctuator: chalk3.yellow,
|
|
20442
|
+
number: chalk3.magenta,
|
|
20443
|
+
string: chalk3.green,
|
|
20444
|
+
regex: chalk3.magenta,
|
|
20445
|
+
comment: chalk3.grey,
|
|
20446
|
+
invalid: chalk3.white.bgRed.bold
|
|
20447
20447
|
};
|
|
20448
20448
|
}
|
|
20449
20449
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -20574,11 +20574,11 @@ var require_lib3 = __commonJS({
|
|
|
20574
20574
|
return _chalk.default;
|
|
20575
20575
|
}
|
|
20576
20576
|
var deprecationWarningShown = false;
|
|
20577
|
-
function getDefs(
|
|
20577
|
+
function getDefs(chalk3) {
|
|
20578
20578
|
return {
|
|
20579
|
-
gutter:
|
|
20580
|
-
marker:
|
|
20581
|
-
message:
|
|
20579
|
+
gutter: chalk3.grey,
|
|
20580
|
+
marker: chalk3.red.bold,
|
|
20581
|
+
message: chalk3.red.bold
|
|
20582
20582
|
};
|
|
20583
20583
|
}
|
|
20584
20584
|
var NEWLINE = /\r\n|[\n\r\u2028\u2029]/;
|
|
@@ -20640,8 +20640,8 @@ var require_lib3 = __commonJS({
|
|
|
20640
20640
|
}
|
|
20641
20641
|
function codeFrameColumns(rawLines, loc, opts = {}) {
|
|
20642
20642
|
const highlighted = (opts.highlightCode || opts.forceColor) && (0, _highlight.shouldHighlight)(opts);
|
|
20643
|
-
const
|
|
20644
|
-
const defs = getDefs(
|
|
20643
|
+
const chalk3 = getChalk(opts.forceColor);
|
|
20644
|
+
const defs = getDefs(chalk3);
|
|
20645
20645
|
const maybeHighlight = (chalkFn, string) => {
|
|
20646
20646
|
return highlighted ? chalkFn(string) : string;
|
|
20647
20647
|
};
|
|
@@ -20680,7 +20680,7 @@ var require_lib3 = __commonJS({
|
|
|
20680
20680
|
${frame}`;
|
|
20681
20681
|
}
|
|
20682
20682
|
if (highlighted) {
|
|
20683
|
-
return
|
|
20683
|
+
return chalk3.reset(frame);
|
|
20684
20684
|
} else {
|
|
20685
20685
|
return frame;
|
|
20686
20686
|
}
|
|
@@ -25994,14 +25994,14 @@ var require_templates2 = __commonJS({
|
|
|
25994
25994
|
}
|
|
25995
25995
|
return results;
|
|
25996
25996
|
}
|
|
25997
|
-
function buildStyle(
|
|
25997
|
+
function buildStyle(chalk3, styles) {
|
|
25998
25998
|
const enabled = {};
|
|
25999
25999
|
for (const layer of styles) {
|
|
26000
26000
|
for (const style of layer.styles) {
|
|
26001
26001
|
enabled[style[0]] = layer.inverse ? null : style.slice(1);
|
|
26002
26002
|
}
|
|
26003
26003
|
}
|
|
26004
|
-
let current =
|
|
26004
|
+
let current = chalk3;
|
|
26005
26005
|
for (const [styleName, styles2] of Object.entries(enabled)) {
|
|
26006
26006
|
if (!Array.isArray(styles2)) {
|
|
26007
26007
|
continue;
|
|
@@ -26013,7 +26013,7 @@ var require_templates2 = __commonJS({
|
|
|
26013
26013
|
}
|
|
26014
26014
|
return current;
|
|
26015
26015
|
}
|
|
26016
|
-
module2.exports = (
|
|
26016
|
+
module2.exports = (chalk3, temporary) => {
|
|
26017
26017
|
const styles = [];
|
|
26018
26018
|
const chunks = [];
|
|
26019
26019
|
let chunk = [];
|
|
@@ -26023,13 +26023,13 @@ var require_templates2 = __commonJS({
|
|
|
26023
26023
|
} else if (style) {
|
|
26024
26024
|
const string = chunk.join("");
|
|
26025
26025
|
chunk = [];
|
|
26026
|
-
chunks.push(styles.length === 0 ? string : buildStyle(
|
|
26026
|
+
chunks.push(styles.length === 0 ? string : buildStyle(chalk3, styles)(string));
|
|
26027
26027
|
styles.push({ inverse, styles: parseStyle(style) });
|
|
26028
26028
|
} else if (close) {
|
|
26029
26029
|
if (styles.length === 0) {
|
|
26030
26030
|
throw new Error("Found extraneous } in Chalk template literal");
|
|
26031
26031
|
}
|
|
26032
|
-
chunks.push(buildStyle(
|
|
26032
|
+
chunks.push(buildStyle(chalk3, styles)(chunk.join("")));
|
|
26033
26033
|
chunk = [];
|
|
26034
26034
|
styles.pop();
|
|
26035
26035
|
} else {
|
|
@@ -26077,16 +26077,16 @@ var require_source = __commonJS({
|
|
|
26077
26077
|
}
|
|
26078
26078
|
};
|
|
26079
26079
|
var chalkFactory = (options) => {
|
|
26080
|
-
const
|
|
26081
|
-
applyOptions(
|
|
26082
|
-
|
|
26083
|
-
Object.setPrototypeOf(
|
|
26084
|
-
Object.setPrototypeOf(
|
|
26085
|
-
|
|
26080
|
+
const chalk4 = {};
|
|
26081
|
+
applyOptions(chalk4, options);
|
|
26082
|
+
chalk4.template = (...arguments_) => chalkTag(chalk4.template, ...arguments_);
|
|
26083
|
+
Object.setPrototypeOf(chalk4, Chalk.prototype);
|
|
26084
|
+
Object.setPrototypeOf(chalk4.template, chalk4);
|
|
26085
|
+
chalk4.template.constructor = () => {
|
|
26086
26086
|
throw new Error("`chalk.constructor()` is deprecated. Use `new chalk.Instance()` instead.");
|
|
26087
26087
|
};
|
|
26088
|
-
|
|
26089
|
-
return
|
|
26088
|
+
chalk4.template.Instance = ChalkClass;
|
|
26089
|
+
return chalk4.template;
|
|
26090
26090
|
};
|
|
26091
26091
|
function Chalk(options) {
|
|
26092
26092
|
return chalkFactory(options);
|
|
@@ -26197,7 +26197,7 @@ var require_source = __commonJS({
|
|
|
26197
26197
|
return openAll + string + closeAll;
|
|
26198
26198
|
};
|
|
26199
26199
|
var template;
|
|
26200
|
-
var chalkTag = (
|
|
26200
|
+
var chalkTag = (chalk4, ...strings) => {
|
|
26201
26201
|
const [firstString] = strings;
|
|
26202
26202
|
if (!isArray(firstString) || !isArray(firstString.raw)) {
|
|
26203
26203
|
return strings.join(" ");
|
|
@@ -26213,14 +26213,14 @@ var require_source = __commonJS({
|
|
|
26213
26213
|
if (template === void 0) {
|
|
26214
26214
|
template = require_templates2();
|
|
26215
26215
|
}
|
|
26216
|
-
return template(
|
|
26216
|
+
return template(chalk4, parts.join(""));
|
|
26217
26217
|
};
|
|
26218
26218
|
Object.defineProperties(Chalk.prototype, styles);
|
|
26219
|
-
var
|
|
26220
|
-
|
|
26221
|
-
|
|
26222
|
-
|
|
26223
|
-
module2.exports =
|
|
26219
|
+
var chalk3 = Chalk();
|
|
26220
|
+
chalk3.supportsColor = stdoutColor;
|
|
26221
|
+
chalk3.stderr = Chalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
26222
|
+
chalk3.stderr.supportsColor = stderrColor;
|
|
26223
|
+
module2.exports = chalk3;
|
|
26224
26224
|
}
|
|
26225
26225
|
});
|
|
26226
26226
|
|
|
@@ -26280,8 +26280,10 @@ var LogLevel = {
|
|
|
26280
26280
|
ERROR: 20,
|
|
26281
26281
|
WARN: 30,
|
|
26282
26282
|
INFO: 40,
|
|
26283
|
+
SUCCESS: 45,
|
|
26283
26284
|
DEBUG: 60,
|
|
26284
|
-
TRACE: 70
|
|
26285
|
+
TRACE: 70,
|
|
26286
|
+
ALL: 100
|
|
26285
26287
|
};
|
|
26286
26288
|
var LogLevelLabel = {
|
|
26287
26289
|
SILENT: "silent",
|
|
@@ -26290,7 +26292,8 @@ var LogLevelLabel = {
|
|
|
26290
26292
|
WARN: "warn",
|
|
26291
26293
|
INFO: "info",
|
|
26292
26294
|
DEBUG: "debug",
|
|
26293
|
-
TRACE: "trace"
|
|
26295
|
+
TRACE: "trace",
|
|
26296
|
+
ALL: "all"
|
|
26294
26297
|
};
|
|
26295
26298
|
|
|
26296
26299
|
// packages/config-tools/src/utilities/find-up.ts
|
|
@@ -26299,15 +26302,15 @@ var import_path = require("path");
|
|
|
26299
26302
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
26300
26303
|
var depth = 0;
|
|
26301
26304
|
function findFolderUp(startPath, endFileNames) {
|
|
26302
|
-
|
|
26303
|
-
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(
|
|
26304
|
-
return
|
|
26305
|
-
}
|
|
26306
|
-
|
|
26305
|
+
const _startPath = startPath ?? process.cwd();
|
|
26306
|
+
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
|
|
26307
|
+
return _startPath;
|
|
26308
|
+
}
|
|
26309
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
26310
|
+
const parent = (0, import_path.join)(_startPath, "..");
|
|
26307
26311
|
return findFolderUp(parent, endFileNames);
|
|
26308
|
-
} else {
|
|
26309
|
-
return void 0;
|
|
26310
26312
|
}
|
|
26313
|
+
return void 0;
|
|
26311
26314
|
}
|
|
26312
26315
|
|
|
26313
26316
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
@@ -29964,17 +29967,13 @@ var StormConfigSchema = objectType({
|
|
|
29964
29967
|
license: stringType().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
29965
29968
|
homepage: stringType().trim().url().default("https://stormsoftware.org").describe("The homepage of the workspace"),
|
|
29966
29969
|
branch: stringType().trim().default("main").describe("The branch of the workspace"),
|
|
29967
|
-
preMajor: booleanType().default(false).describe(
|
|
29968
|
-
"An indicator specifying if the package is still in it's pre-major version"
|
|
29969
|
-
),
|
|
29970
|
+
preMajor: booleanType().default(false).describe("An indicator specifying if the package is still in it's pre-major version"),
|
|
29970
29971
|
owner: stringType().trim().default("@storm-software/development").describe("The owner of the package"),
|
|
29971
29972
|
worker: stringType().trim().default("stormie-bot").describe(
|
|
29972
29973
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
29973
29974
|
),
|
|
29974
29975
|
env: enumType(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
|
|
29975
|
-
ci: booleanType().default(true).describe(
|
|
29976
|
-
"An indicator specifying if the current environment is a CI environment"
|
|
29977
|
-
),
|
|
29976
|
+
ci: booleanType().default(true).describe("An indicator specifying if the current environment is a CI environment"),
|
|
29978
29977
|
workspaceRoot: stringType().trim().optional().describe("The root directory of the workspace"),
|
|
29979
29978
|
packageDirectory: stringType().trim().optional().describe("The root directory of the package"),
|
|
29980
29979
|
buildDirectory: stringType().trim().default("dist").describe("The build directory for the workspace"),
|
|
@@ -29985,7 +29984,7 @@ var StormConfigSchema = objectType({
|
|
|
29985
29984
|
packageManager: enumType(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
29986
29985
|
timezone: stringType().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
29987
29986
|
locale: stringType().trim().default("en-US").describe("The default locale of the workspace"),
|
|
29988
|
-
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
29987
|
+
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]).default("debug").describe(
|
|
29989
29988
|
"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`)."
|
|
29990
29989
|
),
|
|
29991
29990
|
configFile: stringType().trim().nullable().default(null).describe(
|
|
@@ -30043,11 +30042,21 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30043
30042
|
});
|
|
30044
30043
|
if (file) {
|
|
30045
30044
|
const packageJson = JSON.parse(file);
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30050
|
-
|
|
30045
|
+
if (packageJson.name) {
|
|
30046
|
+
name = packageJson.name;
|
|
30047
|
+
}
|
|
30048
|
+
if (packageJson.namespace) {
|
|
30049
|
+
namespace = packageJson.namespace;
|
|
30050
|
+
}
|
|
30051
|
+
if (packageJson.repository?.url) {
|
|
30052
|
+
repository = packageJson.repository?.url;
|
|
30053
|
+
}
|
|
30054
|
+
if (packageJson.license) {
|
|
30055
|
+
license = packageJson.license;
|
|
30056
|
+
}
|
|
30057
|
+
if (packageJson.homepage) {
|
|
30058
|
+
homepage = packageJson.homepage;
|
|
30059
|
+
}
|
|
30051
30060
|
}
|
|
30052
30061
|
}
|
|
30053
30062
|
return StormConfigSchema.parse({
|
|
@@ -30069,6 +30078,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30069
30078
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
30070
30079
|
var getLogLevel = (label) => {
|
|
30071
30080
|
switch (label) {
|
|
30081
|
+
case "all":
|
|
30082
|
+
return LogLevel.ALL;
|
|
30072
30083
|
case "trace":
|
|
30073
30084
|
return LogLevel.TRACE;
|
|
30074
30085
|
case "debug":
|
|
@@ -30088,38 +30099,49 @@ var getLogLevel = (label) => {
|
|
|
30088
30099
|
}
|
|
30089
30100
|
};
|
|
30090
30101
|
var getLogLevelLabel = (logLevel) => {
|
|
30102
|
+
if (logLevel >= LogLevel.ALL) {
|
|
30103
|
+
return LogLevelLabel.ALL;
|
|
30104
|
+
}
|
|
30091
30105
|
if (logLevel >= LogLevel.TRACE) {
|
|
30092
30106
|
return LogLevelLabel.TRACE;
|
|
30093
|
-
}
|
|
30107
|
+
}
|
|
30108
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
30094
30109
|
return LogLevelLabel.DEBUG;
|
|
30095
|
-
}
|
|
30110
|
+
}
|
|
30111
|
+
if (logLevel >= LogLevel.INFO) {
|
|
30096
30112
|
return LogLevelLabel.INFO;
|
|
30097
|
-
}
|
|
30113
|
+
}
|
|
30114
|
+
if (logLevel >= LogLevel.WARN) {
|
|
30098
30115
|
return LogLevelLabel.WARN;
|
|
30099
|
-
}
|
|
30116
|
+
}
|
|
30117
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
30100
30118
|
return LogLevelLabel.ERROR;
|
|
30101
|
-
}
|
|
30119
|
+
}
|
|
30120
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
30102
30121
|
return LogLevelLabel.FATAL;
|
|
30103
|
-
}
|
|
30122
|
+
}
|
|
30123
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
30104
30124
|
return LogLevelLabel.SILENT;
|
|
30105
|
-
} else {
|
|
30106
|
-
return LogLevelLabel.INFO;
|
|
30107
30125
|
}
|
|
30126
|
+
return LogLevelLabel.INFO;
|
|
30108
30127
|
};
|
|
30109
30128
|
|
|
30129
|
+
// packages/config-tools/src/utilities/logger.ts
|
|
30130
|
+
var chalk = __toESM(require_source(), 1);
|
|
30131
|
+
|
|
30110
30132
|
// packages/config-tools/src/env/get-env.ts
|
|
30111
30133
|
var getExtensionEnv = (extensionName) => {
|
|
30112
30134
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
30113
30135
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
30114
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
30115
|
-
|
|
30116
|
-
|
|
30117
|
-
|
|
30136
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
30137
|
+
if (name) {
|
|
30138
|
+
ret[name] = process.env[key];
|
|
30139
|
+
}
|
|
30118
30140
|
return ret;
|
|
30119
30141
|
}, {});
|
|
30120
30142
|
};
|
|
30121
30143
|
var getConfigEnv = () => {
|
|
30122
|
-
const prefix =
|
|
30144
|
+
const prefix = "STORM_";
|
|
30123
30145
|
let config = {
|
|
30124
30146
|
name: process.env[`${prefix}NAME`],
|
|
30125
30147
|
namespace: process.env[`${prefix}NAMESPACE`],
|
|
@@ -30138,9 +30160,7 @@ var getConfigEnv = () => {
|
|
|
30138
30160
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
30139
30161
|
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
30140
30162
|
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
30141
|
-
ci: Boolean(
|
|
30142
|
-
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
30143
|
-
),
|
|
30163
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
30144
30164
|
colors: {
|
|
30145
30165
|
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
30146
30166
|
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
@@ -30153,9 +30173,7 @@ var getConfigEnv = () => {
|
|
|
30153
30173
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
30154
30174
|
branch: process.env[`${prefix}BRANCH`],
|
|
30155
30175
|
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
30156
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(
|
|
30157
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
30158
|
-
) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
30176
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
30159
30177
|
extensions: {}
|
|
30160
30178
|
};
|
|
30161
30179
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
@@ -30170,26 +30188,27 @@ var getConfigEnv = () => {
|
|
|
30170
30188
|
}
|
|
30171
30189
|
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
30172
30190
|
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
30173
|
-
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map(
|
|
30174
|
-
|
|
30175
|
-
|
|
30176
|
-
|
|
30191
|
+
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("");
|
|
30192
|
+
if (extensionName) {
|
|
30193
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
30194
|
+
}
|
|
30177
30195
|
return ret;
|
|
30178
30196
|
}, config);
|
|
30179
30197
|
};
|
|
30180
30198
|
|
|
30181
30199
|
// packages/config-tools/src/env/set-env.ts
|
|
30182
30200
|
var setExtensionEnv = (extensionName, extension) => {
|
|
30183
|
-
Object.keys(extension ?? {})
|
|
30201
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
30184
30202
|
if (extension[key]) {
|
|
30185
|
-
|
|
30203
|
+
const result = key?.replace(
|
|
30186
30204
|
/([A-Z])+/g,
|
|
30187
30205
|
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
30188
30206
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
30189
30207
|
let extensionKey;
|
|
30190
30208
|
if (result.length === 0) {
|
|
30191
30209
|
return;
|
|
30192
|
-
}
|
|
30210
|
+
}
|
|
30211
|
+
if (result.length === 1) {
|
|
30193
30212
|
extensionKey = result[0].toUpperCase();
|
|
30194
30213
|
} else {
|
|
30195
30214
|
extensionKey = result.reduce((ret, part) => {
|
|
@@ -30198,63 +30217,121 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
30198
30217
|
}
|
|
30199
30218
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
30200
30219
|
}
|
|
30201
|
-
}
|
|
30220
|
+
}
|
|
30202
30221
|
};
|
|
30203
30222
|
var setConfigEnv = (config) => {
|
|
30204
|
-
const prefix =
|
|
30205
|
-
|
|
30206
|
-
|
|
30207
|
-
|
|
30208
|
-
|
|
30209
|
-
|
|
30210
|
-
|
|
30211
|
-
|
|
30212
|
-
|
|
30213
|
-
|
|
30214
|
-
|
|
30215
|
-
|
|
30216
|
-
|
|
30217
|
-
|
|
30218
|
-
|
|
30219
|
-
|
|
30220
|
-
|
|
30221
|
-
|
|
30222
|
-
|
|
30223
|
-
|
|
30224
|
-
|
|
30225
|
-
|
|
30226
|
-
|
|
30227
|
-
|
|
30228
|
-
|
|
30229
|
-
|
|
30230
|
-
|
|
30231
|
-
|
|
30232
|
-
|
|
30233
|
-
|
|
30234
|
-
|
|
30235
|
-
|
|
30236
|
-
|
|
30237
|
-
|
|
30238
|
-
|
|
30239
|
-
|
|
30240
|
-
|
|
30241
|
-
|
|
30242
|
-
|
|
30243
|
-
|
|
30244
|
-
|
|
30245
|
-
|
|
30246
|
-
|
|
30247
|
-
|
|
30248
|
-
)
|
|
30249
|
-
|
|
30250
|
-
|
|
30251
|
-
|
|
30223
|
+
const prefix = "STORM_";
|
|
30224
|
+
if (config.name) {
|
|
30225
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
30226
|
+
}
|
|
30227
|
+
if (config.namespace) {
|
|
30228
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
30229
|
+
}
|
|
30230
|
+
if (config.owner) {
|
|
30231
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
30232
|
+
}
|
|
30233
|
+
if (config.worker) {
|
|
30234
|
+
process.env[`${prefix}WORKER`] = config.worker;
|
|
30235
|
+
}
|
|
30236
|
+
if (config.organization) {
|
|
30237
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
30238
|
+
}
|
|
30239
|
+
if (config.packageManager) {
|
|
30240
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
30241
|
+
}
|
|
30242
|
+
if (config.license) {
|
|
30243
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
30244
|
+
}
|
|
30245
|
+
if (config.homepage) {
|
|
30246
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
30247
|
+
}
|
|
30248
|
+
if (config.timezone) {
|
|
30249
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
30250
|
+
process.env.TZ = config.timezone;
|
|
30251
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
30252
|
+
}
|
|
30253
|
+
if (config.locale) {
|
|
30254
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
30255
|
+
process.env.LOCALE = config.locale;
|
|
30256
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
30257
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
30258
|
+
}
|
|
30259
|
+
if (config.configFile) {
|
|
30260
|
+
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
30261
|
+
}
|
|
30262
|
+
if (config.workspaceRoot) {
|
|
30263
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
30264
|
+
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
30265
|
+
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
30266
|
+
}
|
|
30267
|
+
if (config.packageDirectory) {
|
|
30268
|
+
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
30269
|
+
}
|
|
30270
|
+
if (config.buildDirectory) {
|
|
30271
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
30272
|
+
}
|
|
30273
|
+
if (config.runtimeVersion) {
|
|
30274
|
+
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
30275
|
+
}
|
|
30276
|
+
if (config.runtimeDirectory) {
|
|
30277
|
+
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
30278
|
+
}
|
|
30279
|
+
if (config.env) {
|
|
30280
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
30281
|
+
process.env.NODE_ENV = config.env;
|
|
30282
|
+
process.env.ENVIRONMENT = config.env;
|
|
30283
|
+
}
|
|
30284
|
+
if (config.ci) {
|
|
30285
|
+
process.env[`${prefix}CI`] = String(config.ci);
|
|
30286
|
+
process.env.CI = String(config.ci);
|
|
30287
|
+
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
30288
|
+
}
|
|
30289
|
+
if (config.colors.primary) {
|
|
30290
|
+
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
30291
|
+
}
|
|
30292
|
+
if (config.colors.background) {
|
|
30293
|
+
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
30294
|
+
}
|
|
30295
|
+
if (config.colors.success) {
|
|
30296
|
+
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
30297
|
+
}
|
|
30298
|
+
if (config.colors.info) {
|
|
30299
|
+
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
30300
|
+
}
|
|
30301
|
+
if (config.colors.warning) {
|
|
30302
|
+
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
30303
|
+
}
|
|
30304
|
+
if (config.colors.error) {
|
|
30305
|
+
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
30306
|
+
}
|
|
30307
|
+
if (config.colors.fatal) {
|
|
30308
|
+
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
30309
|
+
}
|
|
30310
|
+
if (config.repository) {
|
|
30311
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
30312
|
+
}
|
|
30313
|
+
if (config.branch) {
|
|
30314
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
30315
|
+
}
|
|
30316
|
+
if (config.preMajor) {
|
|
30317
|
+
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
30318
|
+
}
|
|
30319
|
+
if (config.logLevel) {
|
|
30320
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
30321
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
30322
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
30323
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
30324
|
+
);
|
|
30325
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
30326
|
+
}
|
|
30327
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
30328
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
30252
30329
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
30253
|
-
}
|
|
30330
|
+
}
|
|
30254
30331
|
};
|
|
30255
30332
|
|
|
30256
30333
|
// packages/workspace-tools/src/base/base-generator.ts
|
|
30257
|
-
var
|
|
30334
|
+
var chalk2 = __toESM(require_source());
|
|
30258
30335
|
|
|
30259
30336
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
30260
30337
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
@@ -30325,7 +30402,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
30325
30402
|
const startTime = Date.now();
|
|
30326
30403
|
let options = _options;
|
|
30327
30404
|
try {
|
|
30328
|
-
console.info(
|
|
30405
|
+
console.info(chalk2.bold.hex("#1fb2a6")(`\u26A1 Running the ${name} generator...
|
|
30329
30406
|
|
|
30330
30407
|
`));
|
|
30331
30408
|
let config;
|
|
@@ -30336,29 +30413,29 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
30336
30413
|
});
|
|
30337
30414
|
setConfigEnv(config);
|
|
30338
30415
|
getLogLevel(config.logLevel) >= LogLevel.DEBUG && console.debug(
|
|
30339
|
-
|
|
30416
|
+
chalk2.dim(
|
|
30340
30417
|
`Loaded Storm config into env:
|
|
30341
30418
|
${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\n")}`
|
|
30342
30419
|
)
|
|
30343
30420
|
);
|
|
30344
30421
|
}
|
|
30345
30422
|
if (generatorOptions?.hooks?.applyDefaultOptions) {
|
|
30346
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30423
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the applyDefaultOptions hook..."));
|
|
30347
30424
|
options = await Promise.resolve(
|
|
30348
30425
|
generatorOptions.hooks.applyDefaultOptions(options, config)
|
|
30349
30426
|
);
|
|
30350
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30427
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the applyDefaultOptions hook..."));
|
|
30351
30428
|
}
|
|
30352
|
-
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(
|
|
30429
|
+
getLogLevel(config.logLevel) >= LogLevel.INFO && console.info(chalk2.hex("#0ea5e9").italic("\n\n \u2699\uFE0F Generator schema options: \n"), options);
|
|
30353
30430
|
const tokenized = applyWorkspaceTokens(
|
|
30354
30431
|
options,
|
|
30355
30432
|
{ workspaceRoot: tree.root, config },
|
|
30356
30433
|
applyWorkspaceGeneratorTokens
|
|
30357
30434
|
);
|
|
30358
30435
|
if (generatorOptions?.hooks?.preProcess) {
|
|
30359
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30436
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the preProcess hook..."));
|
|
30360
30437
|
await Promise.resolve(generatorOptions.hooks.preProcess(options, config));
|
|
30361
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30438
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the preProcess hook..."));
|
|
30362
30439
|
}
|
|
30363
30440
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
30364
30441
|
if (result && (!result.success || result.error && result?.error?.message && typeof result?.error?.message === "string" && result?.error?.name && typeof result?.error?.name === "string")) {
|
|
@@ -30367,12 +30444,12 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
30367
30444
|
});
|
|
30368
30445
|
}
|
|
30369
30446
|
if (generatorOptions?.hooks?.postProcess) {
|
|
30370
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30447
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Running the postProcess hook..."));
|
|
30371
30448
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
30372
|
-
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(
|
|
30449
|
+
getLogLevel(config?.logLevel) >= LogLevel.TRACE && console.debug(chalk2.dim("Completed the postProcess hook..."));
|
|
30373
30450
|
}
|
|
30374
30451
|
console.info(
|
|
30375
|
-
|
|
30452
|
+
chalk2.bold.hex("#087f5b")(`
|
|
30376
30453
|
|
|
30377
30454
|
\u{1F389} Successfully completed running the ${name} generator!`)
|
|
30378
30455
|
);
|
|
@@ -30381,7 +30458,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
30381
30458
|
};
|
|
30382
30459
|
} catch (error) {
|
|
30383
30460
|
console.error(
|
|
30384
|
-
|
|
30461
|
+
chalk2.bold.hex("#7d1a1a")("\u274C An error occurred while running the generator\n\n"),
|
|
30385
30462
|
error
|
|
30386
30463
|
);
|
|
30387
30464
|
console.error(error);
|
|
@@ -30390,7 +30467,7 @@ ${Object.keys(process.env).map((key) => ` - ${key}=${process.env[key]}`).join("\
|
|
|
30390
30467
|
};
|
|
30391
30468
|
} finally {
|
|
30392
30469
|
console.info(
|
|
30393
|
-
|
|
30470
|
+
chalk2.hex("#0ea5e9").italic(
|
|
30394
30471
|
`\u23F1\uFE0F The${name ? ` ${name}` : ""} generator took ${Date.now() - startTime}ms to complete`
|
|
30395
30472
|
)
|
|
30396
30473
|
);
|