@storm-software/workspace-tools 1.42.2 → 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 +14 -0
- package/config/nx.json +3 -4
- package/index.js +181 -106
- 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 +181 -106
- 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
|
@@ -26280,7 +26280,8 @@ var LogLevel = {
|
|
|
26280
26280
|
WARN: 30,
|
|
26281
26281
|
INFO: 40,
|
|
26282
26282
|
DEBUG: 60,
|
|
26283
|
-
TRACE: 70
|
|
26283
|
+
TRACE: 70,
|
|
26284
|
+
ALL: 100
|
|
26284
26285
|
};
|
|
26285
26286
|
var LogLevelLabel = {
|
|
26286
26287
|
SILENT: "silent",
|
|
@@ -26289,7 +26290,8 @@ var LogLevelLabel = {
|
|
|
26289
26290
|
WARN: "warn",
|
|
26290
26291
|
INFO: "info",
|
|
26291
26292
|
DEBUG: "debug",
|
|
26292
|
-
TRACE: "trace"
|
|
26293
|
+
TRACE: "trace",
|
|
26294
|
+
ALL: "all"
|
|
26293
26295
|
};
|
|
26294
26296
|
|
|
26295
26297
|
// packages/config-tools/src/utilities/find-up.ts
|
|
@@ -26298,15 +26300,15 @@ var import_path = require("path");
|
|
|
26298
26300
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
26299
26301
|
var depth = 0;
|
|
26300
26302
|
function findFolderUp(startPath, endFileNames) {
|
|
26301
|
-
|
|
26302
|
-
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(
|
|
26303
|
-
return
|
|
26304
|
-
}
|
|
26305
|
-
|
|
26303
|
+
const _startPath = startPath ?? process.cwd();
|
|
26304
|
+
if (endFileNames.some((endFileName) => (0, import_fs.existsSync)((0, import_path.join)(_startPath, endFileName)))) {
|
|
26305
|
+
return _startPath;
|
|
26306
|
+
}
|
|
26307
|
+
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
26308
|
+
const parent = (0, import_path.join)(_startPath, "..");
|
|
26306
26309
|
return findFolderUp(parent, endFileNames);
|
|
26307
|
-
} else {
|
|
26308
|
-
return void 0;
|
|
26309
26310
|
}
|
|
26311
|
+
return void 0;
|
|
26310
26312
|
}
|
|
26311
26313
|
|
|
26312
26314
|
// packages/config-tools/src/utilities/find-workspace-root.ts
|
|
@@ -29963,17 +29965,13 @@ var StormConfigSchema = objectType({
|
|
|
29963
29965
|
license: stringType().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
29964
29966
|
homepage: stringType().trim().url().default("https://stormsoftware.org").describe("The homepage of the workspace"),
|
|
29965
29967
|
branch: stringType().trim().default("main").describe("The branch of the workspace"),
|
|
29966
|
-
preMajor: booleanType().default(false).describe(
|
|
29967
|
-
"An indicator specifying if the package is still in it's pre-major version"
|
|
29968
|
-
),
|
|
29968
|
+
preMajor: booleanType().default(false).describe("An indicator specifying if the package is still in it's pre-major version"),
|
|
29969
29969
|
owner: stringType().trim().default("@storm-software/development").describe("The owner of the package"),
|
|
29970
29970
|
worker: stringType().trim().default("stormie-bot").describe(
|
|
29971
29971
|
"The worker of the package (this is the bot that will be used to perform various tasks)"
|
|
29972
29972
|
),
|
|
29973
29973
|
env: enumType(["development", "staging", "production"]).default("production").describe("The current runtime environment of the package"),
|
|
29974
|
-
ci: booleanType().default(true).describe(
|
|
29975
|
-
"An indicator specifying if the current environment is a CI environment"
|
|
29976
|
-
),
|
|
29974
|
+
ci: booleanType().default(true).describe("An indicator specifying if the current environment is a CI environment"),
|
|
29977
29975
|
workspaceRoot: stringType().trim().optional().describe("The root directory of the workspace"),
|
|
29978
29976
|
packageDirectory: stringType().trim().optional().describe("The root directory of the package"),
|
|
29979
29977
|
buildDirectory: stringType().trim().default("dist").describe("The build directory for the workspace"),
|
|
@@ -29984,7 +29982,7 @@ var StormConfigSchema = objectType({
|
|
|
29984
29982
|
packageManager: enumType(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
29985
29983
|
timezone: stringType().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
29986
29984
|
locale: stringType().trim().default("en-US").describe("The default locale of the workspace"),
|
|
29987
|
-
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
29985
|
+
logLevel: enumType(["silent", "fatal", "error", "warn", "info", "debug", "trace", "all"]).default("debug").describe(
|
|
29988
29986
|
"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`)."
|
|
29989
29987
|
),
|
|
29990
29988
|
configFile: stringType().trim().nullable().default(null).describe(
|
|
@@ -30042,11 +30040,21 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30042
30040
|
});
|
|
30043
30041
|
if (file) {
|
|
30044
30042
|
const packageJson = JSON.parse(file);
|
|
30045
|
-
|
|
30046
|
-
|
|
30047
|
-
|
|
30048
|
-
|
|
30049
|
-
|
|
30043
|
+
if (packageJson.name) {
|
|
30044
|
+
name = packageJson.name;
|
|
30045
|
+
}
|
|
30046
|
+
if (packageJson.namespace) {
|
|
30047
|
+
namespace = packageJson.namespace;
|
|
30048
|
+
}
|
|
30049
|
+
if (packageJson.repository?.url) {
|
|
30050
|
+
repository = packageJson.repository?.url;
|
|
30051
|
+
}
|
|
30052
|
+
if (packageJson.license) {
|
|
30053
|
+
license = packageJson.license;
|
|
30054
|
+
}
|
|
30055
|
+
if (packageJson.homepage) {
|
|
30056
|
+
homepage = packageJson.homepage;
|
|
30057
|
+
}
|
|
30050
30058
|
}
|
|
30051
30059
|
}
|
|
30052
30060
|
return StormConfigSchema.parse({
|
|
@@ -30089,36 +30097,41 @@ var getLogLevel = (label) => {
|
|
|
30089
30097
|
var getLogLevelLabel = (logLevel) => {
|
|
30090
30098
|
if (logLevel >= LogLevel.TRACE) {
|
|
30091
30099
|
return LogLevelLabel.TRACE;
|
|
30092
|
-
}
|
|
30100
|
+
}
|
|
30101
|
+
if (logLevel >= LogLevel.DEBUG) {
|
|
30093
30102
|
return LogLevelLabel.DEBUG;
|
|
30094
|
-
}
|
|
30103
|
+
}
|
|
30104
|
+
if (logLevel >= LogLevel.INFO) {
|
|
30095
30105
|
return LogLevelLabel.INFO;
|
|
30096
|
-
}
|
|
30106
|
+
}
|
|
30107
|
+
if (logLevel >= LogLevel.WARN) {
|
|
30097
30108
|
return LogLevelLabel.WARN;
|
|
30098
|
-
}
|
|
30109
|
+
}
|
|
30110
|
+
if (logLevel >= LogLevel.ERROR) {
|
|
30099
30111
|
return LogLevelLabel.ERROR;
|
|
30100
|
-
}
|
|
30112
|
+
}
|
|
30113
|
+
if (logLevel >= LogLevel.FATAL) {
|
|
30101
30114
|
return LogLevelLabel.FATAL;
|
|
30102
|
-
}
|
|
30115
|
+
}
|
|
30116
|
+
if (logLevel <= LogLevel.SILENT) {
|
|
30103
30117
|
return LogLevelLabel.SILENT;
|
|
30104
|
-
} else {
|
|
30105
|
-
return LogLevelLabel.INFO;
|
|
30106
30118
|
}
|
|
30119
|
+
return LogLevelLabel.INFO;
|
|
30107
30120
|
};
|
|
30108
30121
|
|
|
30109
30122
|
// packages/config-tools/src/env/get-env.ts
|
|
30110
30123
|
var getExtensionEnv = (extensionName) => {
|
|
30111
30124
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
30112
30125
|
return Object.keys(process.env).filter((key) => key.startsWith(prefix)).reduce((ret, key) => {
|
|
30113
|
-
const name = key.replace(prefix, "").split("_").map(
|
|
30114
|
-
|
|
30115
|
-
|
|
30116
|
-
|
|
30126
|
+
const name = key.replace(prefix, "").split("_").map((i) => i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : "").join("");
|
|
30127
|
+
if (name) {
|
|
30128
|
+
ret[name] = process.env[key];
|
|
30129
|
+
}
|
|
30117
30130
|
return ret;
|
|
30118
30131
|
}, {});
|
|
30119
30132
|
};
|
|
30120
30133
|
var getConfigEnv = () => {
|
|
30121
|
-
const prefix =
|
|
30134
|
+
const prefix = "STORM_";
|
|
30122
30135
|
let config = {
|
|
30123
30136
|
name: process.env[`${prefix}NAME`],
|
|
30124
30137
|
namespace: process.env[`${prefix}NAMESPACE`],
|
|
@@ -30137,9 +30150,7 @@ var getConfigEnv = () => {
|
|
|
30137
30150
|
runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
|
|
30138
30151
|
runtimeDirectory: process.env[`${prefix}RUNTIME_DIRECTORY`],
|
|
30139
30152
|
env: process.env[`${prefix}ENV`] ?? process.env.NODE_ENV ?? process.env.ENVIRONMENT,
|
|
30140
|
-
ci: Boolean(
|
|
30141
|
-
process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
|
|
30142
|
-
),
|
|
30153
|
+
ci: Boolean(process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION),
|
|
30143
30154
|
colors: {
|
|
30144
30155
|
primary: process.env[`${prefix}COLOR_PRIMARY`],
|
|
30145
30156
|
background: process.env[`${prefix}COLOR_BACKGROUND`],
|
|
@@ -30152,9 +30163,7 @@ var getConfigEnv = () => {
|
|
|
30152
30163
|
repository: process.env[`${prefix}REPOSITORY`],
|
|
30153
30164
|
branch: process.env[`${prefix}BRANCH`],
|
|
30154
30165
|
preMajor: Boolean(process.env[`${prefix}PRE_MAJOR`]),
|
|
30155
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? Number.isSafeInteger(
|
|
30156
|
-
Number.parseInt(process.env[`${prefix}LOG_LEVEL`])
|
|
30157
|
-
) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : LogLevelLabel.INFO,
|
|
30166
|
+
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,
|
|
30158
30167
|
extensions: {}
|
|
30159
30168
|
};
|
|
30160
30169
|
const serializedConfig = process.env[`${prefix}CONFIG`];
|
|
@@ -30169,26 +30178,27 @@ var getConfigEnv = () => {
|
|
|
30169
30178
|
}
|
|
30170
30179
|
const extensionPrefix = `${prefix}EXTENSION_`;
|
|
30171
30180
|
return Object.keys(process.env).filter((key) => key.startsWith(extensionPrefix)).reduce((ret, key) => {
|
|
30172
|
-
const extensionName = key.substring(prefix.length, key.indexOf("_", prefix.length)).split("_").map(
|
|
30173
|
-
|
|
30174
|
-
|
|
30175
|
-
|
|
30181
|
+
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("");
|
|
30182
|
+
if (extensionName) {
|
|
30183
|
+
ret.extensions[extensionName] = getExtensionEnv(extensionName);
|
|
30184
|
+
}
|
|
30176
30185
|
return ret;
|
|
30177
30186
|
}, config);
|
|
30178
30187
|
};
|
|
30179
30188
|
|
|
30180
30189
|
// packages/config-tools/src/env/set-env.ts
|
|
30181
30190
|
var setExtensionEnv = (extensionName, extension) => {
|
|
30182
|
-
Object.keys(extension ?? {})
|
|
30191
|
+
for (const key of Object.keys(extension ?? {})) {
|
|
30183
30192
|
if (extension[key]) {
|
|
30184
|
-
|
|
30193
|
+
const result = key?.replace(
|
|
30185
30194
|
/([A-Z])+/g,
|
|
30186
30195
|
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
30187
30196
|
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
30188
30197
|
let extensionKey;
|
|
30189
30198
|
if (result.length === 0) {
|
|
30190
30199
|
return;
|
|
30191
|
-
}
|
|
30200
|
+
}
|
|
30201
|
+
if (result.length === 1) {
|
|
30192
30202
|
extensionKey = result[0].toUpperCase();
|
|
30193
30203
|
} else {
|
|
30194
30204
|
extensionKey = result.reduce((ret, part) => {
|
|
@@ -30197,59 +30207,117 @@ var setExtensionEnv = (extensionName, extension) => {
|
|
|
30197
30207
|
}
|
|
30198
30208
|
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
30199
30209
|
}
|
|
30200
|
-
}
|
|
30210
|
+
}
|
|
30201
30211
|
};
|
|
30202
30212
|
var setConfigEnv = (config) => {
|
|
30203
|
-
const prefix =
|
|
30204
|
-
|
|
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
|
-
|
|
30213
|
+
const prefix = "STORM_";
|
|
30214
|
+
if (config.name) {
|
|
30215
|
+
process.env[`${prefix}NAME`] = config.name;
|
|
30216
|
+
}
|
|
30217
|
+
if (config.namespace) {
|
|
30218
|
+
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
30219
|
+
}
|
|
30220
|
+
if (config.owner) {
|
|
30221
|
+
process.env[`${prefix}OWNER`] = config.owner;
|
|
30222
|
+
}
|
|
30223
|
+
if (config.worker) {
|
|
30224
|
+
process.env[`${prefix}WORKER`] = config.worker;
|
|
30225
|
+
}
|
|
30226
|
+
if (config.organization) {
|
|
30227
|
+
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
30228
|
+
}
|
|
30229
|
+
if (config.packageManager) {
|
|
30230
|
+
process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager;
|
|
30231
|
+
}
|
|
30232
|
+
if (config.license) {
|
|
30233
|
+
process.env[`${prefix}LICENSE`] = config.license;
|
|
30234
|
+
}
|
|
30235
|
+
if (config.homepage) {
|
|
30236
|
+
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
30237
|
+
}
|
|
30238
|
+
if (config.timezone) {
|
|
30239
|
+
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
30240
|
+
process.env.TZ = config.timezone;
|
|
30241
|
+
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
30242
|
+
}
|
|
30243
|
+
if (config.locale) {
|
|
30244
|
+
process.env[`${prefix}LOCALE`] = config.locale;
|
|
30245
|
+
process.env.LOCALE = config.locale;
|
|
30246
|
+
process.env.DEFAULT_LOCALE = config.locale;
|
|
30247
|
+
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
30248
|
+
}
|
|
30249
|
+
if (config.configFile) {
|
|
30250
|
+
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
30251
|
+
}
|
|
30252
|
+
if (config.workspaceRoot) {
|
|
30253
|
+
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
30254
|
+
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
30255
|
+
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
30256
|
+
}
|
|
30257
|
+
if (config.packageDirectory) {
|
|
30258
|
+
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
30259
|
+
}
|
|
30260
|
+
if (config.buildDirectory) {
|
|
30261
|
+
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
30262
|
+
}
|
|
30263
|
+
if (config.runtimeVersion) {
|
|
30264
|
+
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
30265
|
+
}
|
|
30266
|
+
if (config.runtimeDirectory) {
|
|
30267
|
+
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
30268
|
+
}
|
|
30269
|
+
if (config.env) {
|
|
30270
|
+
process.env[`${prefix}ENV`] = config.env;
|
|
30271
|
+
process.env.NODE_ENV = config.env;
|
|
30272
|
+
process.env.ENVIRONMENT = config.env;
|
|
30273
|
+
}
|
|
30274
|
+
if (config.ci) {
|
|
30275
|
+
process.env[`${prefix}CI`] = String(config.ci);
|
|
30276
|
+
process.env.CI = String(config.ci);
|
|
30277
|
+
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
30278
|
+
}
|
|
30279
|
+
if (config.colors.primary) {
|
|
30280
|
+
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
30281
|
+
}
|
|
30282
|
+
if (config.colors.background) {
|
|
30283
|
+
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
30284
|
+
}
|
|
30285
|
+
if (config.colors.success) {
|
|
30286
|
+
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
30287
|
+
}
|
|
30288
|
+
if (config.colors.info) {
|
|
30289
|
+
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
30290
|
+
}
|
|
30291
|
+
if (config.colors.warning) {
|
|
30292
|
+
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
30293
|
+
}
|
|
30294
|
+
if (config.colors.error) {
|
|
30295
|
+
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
30296
|
+
}
|
|
30297
|
+
if (config.colors.fatal) {
|
|
30298
|
+
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
30299
|
+
}
|
|
30300
|
+
if (config.repository) {
|
|
30301
|
+
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
30302
|
+
}
|
|
30303
|
+
if (config.branch) {
|
|
30304
|
+
process.env[`${prefix}BRANCH`] = config.branch;
|
|
30305
|
+
}
|
|
30306
|
+
if (config.preMajor) {
|
|
30307
|
+
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
30308
|
+
}
|
|
30309
|
+
if (config.logLevel) {
|
|
30310
|
+
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
30311
|
+
process.env.LOG_LEVEL = String(config.logLevel);
|
|
30312
|
+
process.env.NX_VERBOSE_LOGGING = String(
|
|
30313
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
30314
|
+
);
|
|
30315
|
+
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
30316
|
+
}
|
|
30317
|
+
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
30318
|
+
for (const key of Object.keys(config.extensions ?? {})) {
|
|
30251
30319
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
30252
|
-
}
|
|
30320
|
+
}
|
|
30253
30321
|
};
|
|
30254
30322
|
|
|
30255
30323
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|