@storm-software/workspace-tools 1.42.3 → 1.42.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/config/nx.json +1 -3
- package/index.js +179 -105
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +177 -103
- package/src/executors/design-tokens/executor.js +177 -103
- package/src/executors/tsup/executor.js +179 -105
- package/src/executors/tsup-browser/executor.js +179 -105
- package/src/executors/tsup-neutral/executor.js +179 -105
- package/src/executors/tsup-node/executor.js +179 -105
- package/src/generators/browser-library/generator.js +165 -97
- package/src/generators/config-schema/generator.js +165 -97
- package/src/generators/neutral-library/generator.js +165 -97
- package/src/generators/node-library/generator.js +165 -97
- package/src/generators/preset/generator.js +165 -97
|
@@ -43522,7 +43522,8 @@ var LogLevel = {
|
|
|
43522
43522
|
WARN: 30,
|
|
43523
43523
|
INFO: 40,
|
|
43524
43524
|
DEBUG: 60,
|
|
43525
|
-
TRACE: 70
|
|
43525
|
+
TRACE: 70,
|
|
43526
|
+
ALL: 100
|
|
43526
43527
|
};
|
|
43527
43528
|
var LogLevelLabel = {
|
|
43528
43529
|
SILENT: "silent",
|
|
@@ -43531,7 +43532,8 @@ var LogLevelLabel = {
|
|
|
43531
43532
|
WARN: "warn",
|
|
43532
43533
|
INFO: "info",
|
|
43533
43534
|
DEBUG: "debug",
|
|
43534
|
-
TRACE: "trace"
|
|
43535
|
+
TRACE: "trace",
|
|
43536
|
+
ALL: "all"
|
|
43535
43537
|
};
|
|
43536
43538
|
|
|
43537
43539
|
// packages/config-tools/src/utilities/find-up.ts
|
|
@@ -43540,15 +43542,15 @@ var import_path = require("path");
|
|
|
43540
43542
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
43541
43543
|
var depth = 0;
|
|
43542
43544
|
function findFolderUp(startPath, endFileNames) {
|
|
43543
|
-
|
|
43544
|
-
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(
|
|
43545
|
-
return
|
|
43546
|
-
}
|
|
43547
|
-
|
|
43545
|
+
const _startPath = startPath ?? process.cwd();
|
|
43546
|
+
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
|
|
43547
|
+
return _startPath;
|
|
43548
|
+
}
|
|
43549
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
43550
|
+
const parent = (0, import_path.join)(_startPath, "..");
|
|
43548
43551
|
return findFolderUp(parent, endFileNames);
|
|
43549
|
-
} else {
|
|
43550
|
-
return void 0;
|
|
43551
43552
|
}
|
|
43553
|
+
return void 0;
|
|
43552
43554
|
}
|
|
43553
43555
|
|
|
43554
43556
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
@@ -47205,17 +47207,13 @@ var StormConfigSchema = objectType({
|
|
|
47205
47207
|
license: stringType().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
47206
47208
|
homepage: stringType().trim().url().default("https://stormsoftware.org").describe("The homepage of the workspace"),
|
|
47207
47209
|
branch: stringType().trim().default("main").describe("The branch of the workspace"),
|
|
47208
|
-
preMajor: booleanType().default(false).describe(
|
|
47209
|
-
"An indicator specifying if the package is still in it's pre-major version"
|
|
47210
|
-
),
|
|
47210
|
+
preMajor: booleanType().default(false).describe("An indicator specifying if the package is still in it's pre-major version"),
|
|
47211
47211
|
owner: stringType().trim().default("@storm-software/development").describe("The owner of the package"),
|
|
47212
47212
|
worker: stringType().trim().default("stormie-bot").describe(
|
|
47213
47213
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
47214
47214
|
),
|
|
47215
47215
|
env: enumType(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
|
|
47216
|
-
ci: booleanType().default(true).describe(
|
|
47217
|
-
"An indicator specifying if the current environment is a CI environment"
|
|
47218
|
-
),
|
|
47216
|
+
ci: booleanType().default(true).describe("An indicator specifying if the current environment is a CI environment"),
|
|
47219
47217
|
workspaceRoot: stringType().trim().optional().describe("The root directory of the workspace"),
|
|
47220
47218
|
packageDirectory: stringType().trim().optional().describe("The root directory of the package"),
|
|
47221
47219
|
buildDirectory: stringType().trim().default("dist").describe("The build directory for the workspace"),
|
|
@@ -47226,7 +47224,7 @@ var StormConfigSchema = objectType({
|
|
|
47226
47224
|
packageManager: enumType(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
47227
47225
|
timezone: stringType().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
47228
47226
|
locale: stringType().trim().default("en-US").describe("The default locale of the workspace"),
|
|
47229
|
-
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
47227
|
+
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]).default("debug").describe(
|
|
47230
47228
|
"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`)."
|
|
47231
47229
|
),
|
|
47232
47230
|
configFile: stringType().trim().nullable().default(null).describe(
|
|
@@ -47284,11 +47282,21 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47284
47282
|
});
|
|
47285
47283
|
if (file) {
|
|
47286
47284
|
const packageJson = JSON.parse(file);
|
|
47287
|
-
|
|
47288
|
-
|
|
47289
|
-
|
|
47290
|
-
|
|
47291
|
-
|
|
47285
|
+
if (packageJson.name) {
|
|
47286
|
+
name = packageJson.name;
|
|
47287
|
+
}
|
|
47288
|
+
if (packageJson.namespace) {
|
|
47289
|
+
namespace = packageJson.namespace;
|
|
47290
|
+
}
|
|
47291
|
+
if (packageJson.repository?.url) {
|
|
47292
|
+
repository = packageJson.repository?.url;
|
|
47293
|
+
}
|
|
47294
|
+
if (packageJson.license) {
|
|
47295
|
+
license = packageJson.license;
|
|
47296
|
+
}
|
|
47297
|
+
if (packageJson.homepage) {
|
|
47298
|
+
homepage = packageJson.homepage;
|
|
47299
|
+
}
|
|
47292
47300
|
}
|
|
47293
47301
|
}
|
|
47294
47302
|
return StormConfigSchema.parse({
|
|
@@ -47331,36 +47339,41 @@ var getLogLevel = (label) => {
|
|
|
47331
47339
|
var getLogLevelLabel = (logLevel) => {
|
|
47332
47340
|
if (logLevel >= LogLevel.TRACE) {
|
|
47333
47341
|
return LogLevelLabel.TRACE;
|
|
47334
|
-
}
|
|
47342
|
+
}
|
|
47343
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
47335
47344
|
return LogLevelLabel.DEBUG;
|
|
47336
|
-
}
|
|
47345
|
+
}
|
|
47346
|
+
if (logLevel >= LogLevel.INFO) {
|
|
47337
47347
|
return LogLevelLabel.INFO;
|
|
47338
|
-
}
|
|
47348
|
+
}
|
|
47349
|
+
if (logLevel >= LogLevel.WARN) {
|
|
47339
47350
|
return LogLevelLabel.WARN;
|
|
47340
|
-
}
|
|
47351
|
+
}
|
|
47352
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
47341
47353
|
return LogLevelLabel.ERROR;
|
|
47342
|
-
}
|
|
47354
|
+
}
|
|
47355
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
47343
47356
|
return LogLevelLabel.FATAL;
|
|
47344
|
-
}
|
|
47357
|
+
}
|
|
47358
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
47345
47359
|
return LogLevelLabel.SILENT;
|
|
47346
|
-
} else {
|
|
47347
|
-
return LogLevelLabel.INFO;
|
|
47348
47360
|
}
|
|
47361
|
+
return LogLevelLabel.INFO;
|
|
47349
47362
|
};
|
|
47350
47363
|
|
|
47351
47364
|
// packages/config-tools/src/env/get-env.ts
|
|
47352
47365
|
var getExtensionEnv = (extensionName) => {
|
|
47353
47366
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
47354
47367
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
47355
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
47356
|
-
|
|
47357
|
-
|
|
47358
|
-
|
|
47368
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
47369
|
+
if (name) {
|
|
47370
|
+
ret[name] = process.env[key];
|
|
47371
|
+
}
|
|
47359
47372
|
return ret;
|
|
47360
47373
|
}, {});
|
|
47361
47374
|
};
|
|
47362
47375
|
var getConfigEnv = () => {
|
|
47363
|
-
const prefix =
|
|
47376
|
+
const prefix = "STORM_";
|
|
47364
47377
|
let config = {
|
|
47365
47378
|
name: process.env[`${prefix}NAME`],
|
|
47366
47379
|
namespace: process.env[`${prefix}NAMESPACE`],
|
|
@@ -47379,9 +47392,7 @@ var getConfigEnv = () => {
|
|
|
47379
47392
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
47380
47393
|
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
47381
47394
|
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
47382
|
-
ci: Boolean(
|
|
47383
|
-
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
47384
|
-
),
|
|
47395
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
47385
47396
|
colors: {
|
|
47386
47397
|
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
47387
47398
|
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
@@ -47394,9 +47405,7 @@ var getConfigEnv = () => {
|
|
|
47394
47405
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
47395
47406
|
branch: process.env[`${prefix}BRANCH`],
|
|
47396
47407
|
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
47397
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(
|
|
47398
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
47399
|
-
) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
47408
|
+
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,
|
|
47400
47409
|
extensions: {}
|
|
47401
47410
|
};
|
|
47402
47411
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
@@ -47411,26 +47420,27 @@ var getConfigEnv = () => {
|
|
|
47411
47420
|
}
|
|
47412
47421
|
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
47413
47422
|
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
47414
|
-
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map(
|
|
47415
|
-
|
|
47416
|
-
|
|
47417
|
-
|
|
47423
|
+
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("");
|
|
47424
|
+
if (extensionName) {
|
|
47425
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
47426
|
+
}
|
|
47418
47427
|
return ret;
|
|
47419
47428
|
}, config);
|
|
47420
47429
|
};
|
|
47421
47430
|
|
|
47422
47431
|
// packages/config-tools/src/env/set-env.ts
|
|
47423
47432
|
var setExtensionEnv = (extensionName, extension) => {
|
|
47424
|
-
Object.keys(extension ?? {})
|
|
47433
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
47425
47434
|
if (extension[key]) {
|
|
47426
|
-
|
|
47435
|
+
const result = key?.replace(
|
|
47427
47436
|
/([A-Z])+/g,
|
|
47428
47437
|
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
47429
47438
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
47430
47439
|
let extensionKey;
|
|
47431
47440
|
if (result.length === 0) {
|
|
47432
47441
|
return;
|
|
47433
|
-
}
|
|
47442
|
+
}
|
|
47443
|
+
if (result.length === 1) {
|
|
47434
47444
|
extensionKey = result[0].toUpperCase();
|
|
47435
47445
|
} else {
|
|
47436
47446
|
extensionKey = result.reduce((ret, part) => {
|
|
@@ -47439,59 +47449,117 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
47439
47449
|
}
|
|
47440
47450
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
47441
47451
|
}
|
|
47442
|
-
}
|
|
47452
|
+
}
|
|
47443
47453
|
};
|
|
47444
47454
|
var setConfigEnv = (config) => {
|
|
47445
|
-
const prefix =
|
|
47446
|
-
|
|
47447
|
-
|
|
47448
|
-
|
|
47449
|
-
|
|
47450
|
-
|
|
47451
|
-
|
|
47452
|
-
|
|
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
|
-
|
|
47455
|
+
const prefix = "STORM_";
|
|
47456
|
+
if (config.name) {
|
|
47457
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
47458
|
+
}
|
|
47459
|
+
if (config.namespace) {
|
|
47460
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
47461
|
+
}
|
|
47462
|
+
if (config.owner) {
|
|
47463
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
47464
|
+
}
|
|
47465
|
+
if (config.worker) {
|
|
47466
|
+
process.env[`${prefix}WORKER`] = config.worker;
|
|
47467
|
+
}
|
|
47468
|
+
if (config.organization) {
|
|
47469
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
47470
|
+
}
|
|
47471
|
+
if (config.packageManager) {
|
|
47472
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
47473
|
+
}
|
|
47474
|
+
if (config.license) {
|
|
47475
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
47476
|
+
}
|
|
47477
|
+
if (config.homepage) {
|
|
47478
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
47479
|
+
}
|
|
47480
|
+
if (config.timezone) {
|
|
47481
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
47482
|
+
process.env.TZ = config.timezone;
|
|
47483
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
47484
|
+
}
|
|
47485
|
+
if (config.locale) {
|
|
47486
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
47487
|
+
process.env.LOCALE = config.locale;
|
|
47488
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
47489
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
47490
|
+
}
|
|
47491
|
+
if (config.configFile) {
|
|
47492
|
+
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
47493
|
+
}
|
|
47494
|
+
if (config.workspaceRoot) {
|
|
47495
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
47496
|
+
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
47497
|
+
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
47498
|
+
}
|
|
47499
|
+
if (config.packageDirectory) {
|
|
47500
|
+
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
47501
|
+
}
|
|
47502
|
+
if (config.buildDirectory) {
|
|
47503
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
47504
|
+
}
|
|
47505
|
+
if (config.runtimeVersion) {
|
|
47506
|
+
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
47507
|
+
}
|
|
47508
|
+
if (config.runtimeDirectory) {
|
|
47509
|
+
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
47510
|
+
}
|
|
47511
|
+
if (config.env) {
|
|
47512
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
47513
|
+
process.env.NODE_ENV = config.env;
|
|
47514
|
+
process.env.ENVIRONMENT = config.env;
|
|
47515
|
+
}
|
|
47516
|
+
if (config.ci) {
|
|
47517
|
+
process.env[`${prefix}CI`] = String(config.ci);
|
|
47518
|
+
process.env.CI = String(config.ci);
|
|
47519
|
+
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
47520
|
+
}
|
|
47521
|
+
if (config.colors.primary) {
|
|
47522
|
+
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
47523
|
+
}
|
|
47524
|
+
if (config.colors.background) {
|
|
47525
|
+
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
47526
|
+
}
|
|
47527
|
+
if (config.colors.success) {
|
|
47528
|
+
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
47529
|
+
}
|
|
47530
|
+
if (config.colors.info) {
|
|
47531
|
+
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
47532
|
+
}
|
|
47533
|
+
if (config.colors.warning) {
|
|
47534
|
+
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
47535
|
+
}
|
|
47536
|
+
if (config.colors.error) {
|
|
47537
|
+
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
47538
|
+
}
|
|
47539
|
+
if (config.colors.fatal) {
|
|
47540
|
+
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
47541
|
+
}
|
|
47542
|
+
if (config.repository) {
|
|
47543
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
47544
|
+
}
|
|
47545
|
+
if (config.branch) {
|
|
47546
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
47547
|
+
}
|
|
47548
|
+
if (config.preMajor) {
|
|
47549
|
+
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
47550
|
+
}
|
|
47551
|
+
if (config.logLevel) {
|
|
47552
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
47553
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
47554
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
47555
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
47556
|
+
);
|
|
47557
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
47558
|
+
}
|
|
47559
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
47560
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
47493
47561
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
47494
|
-
}
|
|
47562
|
+
}
|
|
47495
47563
|
};
|
|
47496
47564
|
|
|
47497
47565
|
// packages/workspace-tools/src/base/base-generator.ts
|