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