@storm-software/config-tools 1.8.1 → 1.9.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/declarations.d.ts +15 -0
- package/index.cjs +123 -101
- package/index.js +122 -101
- package/meta.cjs.json +1 -1
- package/meta.esm.json +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
## [1.8.2](https://github.com/storm-software/storm-ops/compare/config-tools-v1.8.1...config-tools-v1.8.2) (2023-12-22)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* **config-tools:** Resolved issue in configuration defaulter function ([92e10c1](https://github.com/storm-software/storm-ops/commit/92e10c1fa0283eaf341f4bc9338628cbdb546eb9))
|
|
7
|
+
|
|
8
|
+
## [1.8.1](https://github.com/storm-software/storm-ops/compare/config-tools-v1.8.0...config-tools-v1.8.1) (2023-12-22)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Bug Fixes
|
|
12
|
+
|
|
13
|
+
* **config-tools:** Resolved export issue in type declarations ([9125a40](https://github.com/storm-software/storm-ops/commit/9125a40607db1f58351cd9ef12e86f62b234d753))
|
|
14
|
+
|
|
1
15
|
# [1.8.0](https://github.com/storm-software/storm-ops/compare/config-tools-v1.7.1...config-tools-v1.8.0) (2023-12-22)
|
|
2
16
|
|
|
3
17
|
|
package/declarations.d.ts
CHANGED
|
@@ -17,6 +17,9 @@ declare type StormConfig<
|
|
|
17
17
|
};
|
|
18
18
|
export { StormConfig };
|
|
19
19
|
|
|
20
|
+
declare type StormConfigInput = z.input<typeof StormConfigSchema>;
|
|
21
|
+
export { StormConfigInput };
|
|
22
|
+
|
|
20
23
|
/**
|
|
21
24
|
* Find the root of the current monorepo
|
|
22
25
|
*
|
|
@@ -44,6 +47,18 @@ export { findWorkspaceRootSafe };
|
|
|
44
47
|
declare function createConfig(workspaceRoot?: string): StormConfig;
|
|
45
48
|
export { createConfig };
|
|
46
49
|
|
|
50
|
+
/**
|
|
51
|
+
* Get the config file values for the current Storm workspace
|
|
52
|
+
*/
|
|
53
|
+
declare function getConfigFile(): Promise<Partial<StormConfigInput>>;
|
|
54
|
+
export { getConfigFile };
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Load the config file values for the current Storm workspace into environment variables
|
|
58
|
+
*/
|
|
59
|
+
declare function loadStormConfig(workspaceRoot?: string): Promise<void>;
|
|
60
|
+
export { loadStormConfig };
|
|
61
|
+
|
|
47
62
|
/**
|
|
48
63
|
* Type-check to determine if `obj` is a `StormError` object
|
|
49
64
|
*
|
package/index.cjs
CHANGED
|
@@ -46,6 +46,7 @@ __export(src_exports, {
|
|
|
46
46
|
getExtensionEnv: () => getExtensionEnv,
|
|
47
47
|
getLogLevel: () => getLogLevel,
|
|
48
48
|
getLogLevelLabel: () => getLogLevelLabel,
|
|
49
|
+
loadStormConfig: () => loadStormConfig,
|
|
49
50
|
setConfigEnv: () => setConfigEnv,
|
|
50
51
|
setExtensionEnv: () => setExtensionEnv
|
|
51
52
|
});
|
|
@@ -54,22 +55,22 @@ module.exports = __toCommonJS(src_exports);
|
|
|
54
55
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
55
56
|
var import_cosmiconfig = require("cosmiconfig");
|
|
56
57
|
var _static_cache = void 0;
|
|
57
|
-
var getConfigFileName = (fileName) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search();
|
|
58
|
-
var getConfigFile = async () => {
|
|
58
|
+
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
59
|
+
var getConfigFile = async (filePath) => {
|
|
59
60
|
if (_static_cache) {
|
|
60
61
|
return _static_cache;
|
|
61
62
|
}
|
|
62
|
-
let cosmiconfigResult = await getConfigFileName("storm");
|
|
63
|
+
let cosmiconfigResult = await getConfigFileName("storm", filePath);
|
|
63
64
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
64
|
-
cosmiconfigResult = await getConfigFileName("storm-software");
|
|
65
|
+
cosmiconfigResult = await getConfigFileName("storm-software", filePath);
|
|
65
66
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
66
|
-
cosmiconfigResult = await getConfigFileName("storm-stack");
|
|
67
|
+
cosmiconfigResult = await getConfigFileName("storm-stack", filePath);
|
|
67
68
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
68
|
-
cosmiconfigResult = await getConfigFileName("storm-cloud");
|
|
69
|
+
cosmiconfigResult = await getConfigFileName("storm-cloud", filePath);
|
|
69
70
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
70
|
-
cosmiconfigResult = await getConfigFileName("acidic");
|
|
71
|
+
cosmiconfigResult = await getConfigFileName("acidic", filePath);
|
|
71
72
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
72
|
-
cosmiconfigResult = await getConfigFileName("acid");
|
|
73
|
+
cosmiconfigResult = await getConfigFileName("acid", filePath);
|
|
73
74
|
}
|
|
74
75
|
}
|
|
75
76
|
}
|
|
@@ -186,8 +187,8 @@ var ColorConfigSchema = z.object({
|
|
|
186
187
|
fatal: z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#7d1a1a").describe("The fatal color of the workspace")
|
|
187
188
|
}).describe("Colors used for various workspace elements");
|
|
188
189
|
var StormConfigSchema = z.object({
|
|
189
|
-
name: z.string().trim().toLowerCase().describe("The name of the package"),
|
|
190
|
-
namespace: z.string().trim().toLowerCase().
|
|
190
|
+
name: z.string().trim().toLowerCase().optional().describe("The name of the package"),
|
|
191
|
+
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
191
192
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
192
193
|
repository: z.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
193
194
|
license: z.string().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
@@ -204,7 +205,7 @@ var StormConfigSchema = z.object({
|
|
|
204
205
|
ci: z.boolean().default(true).describe(
|
|
205
206
|
"An indicator specifying if the current environment is a CI environment"
|
|
206
207
|
),
|
|
207
|
-
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
208
|
+
workspaceRoot: z.string().trim().optional().describe("The root directory of the workspace"),
|
|
208
209
|
packageDirectory: z.string().trim().optional().describe("The root directory of the package"),
|
|
209
210
|
buildDirectory: z.string().trim().default("dist").describe("The build directory for the workspace"),
|
|
210
211
|
runtimeDirectory: z.string().trim().default("node_modules/.storm").describe("The runtime directory of Storm"),
|
|
@@ -214,7 +215,7 @@ var StormConfigSchema = z.object({
|
|
|
214
215
|
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
215
216
|
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
216
217
|
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
217
|
-
logLevel: z.enum(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).
|
|
218
|
+
logLevel: z.enum(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
218
219
|
"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`)."
|
|
219
220
|
),
|
|
220
221
|
configFile: z.string().trim().nullable().default(null).describe(
|
|
@@ -239,7 +240,7 @@ var DefaultColorConfig = {
|
|
|
239
240
|
fatal: "#7d1a1a"
|
|
240
241
|
};
|
|
241
242
|
var DefaultStormConfig = {
|
|
242
|
-
name: "storm
|
|
243
|
+
name: "storm",
|
|
243
244
|
namespace: "storm-software",
|
|
244
245
|
license: "Apache License 2.0",
|
|
245
246
|
homepage: "https://stormsoftware.org",
|
|
@@ -279,19 +280,18 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
279
280
|
packageJson.homepage && (homepage = packageJson.homepage);
|
|
280
281
|
}
|
|
281
282
|
}
|
|
282
|
-
return StormConfigSchema.parse(
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
);
|
|
283
|
+
return StormConfigSchema.parse({
|
|
284
|
+
...config,
|
|
285
|
+
...DefaultStormConfig,
|
|
286
|
+
colors: { ...config.colors, ...DefaultColorConfig },
|
|
287
|
+
workspaceRoot,
|
|
288
|
+
name,
|
|
289
|
+
namespace,
|
|
290
|
+
repository,
|
|
291
|
+
license: license ?? DefaultStormConfig.license,
|
|
292
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
293
|
+
extensions: {}
|
|
294
|
+
});
|
|
295
295
|
};
|
|
296
296
|
|
|
297
297
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
@@ -354,6 +354,7 @@ var getConfigEnv = () => {
|
|
|
354
354
|
owner: process.env[`${prefix}OWNER`],
|
|
355
355
|
worker: process.env[`${prefix}WORKER`],
|
|
356
356
|
organization: process.env[`${prefix}ORGANIZATION`],
|
|
357
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
357
358
|
license: process.env[`${prefix}LICENSE`],
|
|
358
359
|
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
359
360
|
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
@@ -399,6 +400,81 @@ var getConfigEnv = () => {
|
|
|
399
400
|
}, config);
|
|
400
401
|
};
|
|
401
402
|
|
|
403
|
+
// packages/config-tools/src/env/set-env.ts
|
|
404
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
405
|
+
Object.keys(extension ?? {}).forEach((key) => {
|
|
406
|
+
if (extension[key]) {
|
|
407
|
+
let result = key?.replace(
|
|
408
|
+
/([A-Z])+/g,
|
|
409
|
+
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
410
|
+
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
411
|
+
let extensionKey;
|
|
412
|
+
if (result.length === 0) {
|
|
413
|
+
return;
|
|
414
|
+
} else if (result.length === 1) {
|
|
415
|
+
extensionKey = result[0].toUpperCase();
|
|
416
|
+
} else {
|
|
417
|
+
extensionKey = result.reduce((ret, part) => {
|
|
418
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
419
|
+
});
|
|
420
|
+
}
|
|
421
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
};
|
|
425
|
+
var setConfigEnv = (config) => {
|
|
426
|
+
const prefix = `STORM_`;
|
|
427
|
+
config.name && (process.env[`${prefix}NAME`] = config.name);
|
|
428
|
+
config.namespace && (process.env[`${prefix}NAMESPACE`] = config.namespace);
|
|
429
|
+
config.owner && (process.env[`${prefix}OWNER`] = config.owner);
|
|
430
|
+
config.worker && (process.env[`${prefix}WORKER`] = config.worker);
|
|
431
|
+
config.organization && (process.env[`${prefix}ORGANIZATION`] = config.organization);
|
|
432
|
+
config.packageManager && (process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager);
|
|
433
|
+
config.license && (process.env[`${prefix}LICENSE`] = config.license);
|
|
434
|
+
config.homepage && (process.env[`${prefix}HOMEPAGE`] = config.homepage);
|
|
435
|
+
config.timezone && (process.env[`${prefix}TIMEZONE`] = config.timezone);
|
|
436
|
+
config.timezone && (process.env.TZ = config.timezone);
|
|
437
|
+
config.timezone && (process.env.DEFAULT_TIMEZONE = config.timezone);
|
|
438
|
+
config.locale && (process.env[`${prefix}LOCALE`] = config.locale);
|
|
439
|
+
config.locale && (process.env.LOCALE = config.locale);
|
|
440
|
+
config.locale && (process.env.DEFAULT_LOCALE = config.locale);
|
|
441
|
+
config.locale && (process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8");
|
|
442
|
+
config.configFile && (process.env[`${prefix}CONFIG_FILE`] = config.configFile);
|
|
443
|
+
config.workspaceRoot && (process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot);
|
|
444
|
+
config.workspaceRoot && (process.env.NX_WORKSPACE_ROOT = config.workspaceRoot);
|
|
445
|
+
config.workspaceRoot && (process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot);
|
|
446
|
+
config.packageDirectory && (process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory);
|
|
447
|
+
config.buildDirectory && (process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory);
|
|
448
|
+
config.runtimeVersion && (process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion);
|
|
449
|
+
config.runtimeDirectory && (process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory);
|
|
450
|
+
config.env && (process.env[`${prefix}ENV`] = config.env);
|
|
451
|
+
config.env && (process.env.NODE_ENV = config.env);
|
|
452
|
+
config.env && (process.env.ENVIRONMENT = config.env);
|
|
453
|
+
config.ci && (process.env[`${prefix}CI`] = String(config.ci));
|
|
454
|
+
config.ci && (process.env.CI = String(config.ci));
|
|
455
|
+
config.ci && (process.env.CONTINUOUS_INTEGRATION = String(config.ci));
|
|
456
|
+
config.colors.primary && (process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary);
|
|
457
|
+
config.colors.background && (process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background);
|
|
458
|
+
config.colors.success && (process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success);
|
|
459
|
+
config.colors.info && (process.env[`${prefix}COLOR_INFO`] = config.colors.info);
|
|
460
|
+
config.colors.warning && (process.env[`${prefix}COLOR_WARNING`] = config.colors.warning);
|
|
461
|
+
config.colors.error && (process.env[`${prefix}COLOR_ERROR`] = config.colors.error);
|
|
462
|
+
config.colors.fatal && (process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal);
|
|
463
|
+
config.repository && (process.env[`${prefix}REPOSITORY`] = config.repository);
|
|
464
|
+
config.branch && (process.env[`${prefix}BRANCH`] = config.branch);
|
|
465
|
+
config.preMajor && (process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor));
|
|
466
|
+
config.logLevel && (process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel));
|
|
467
|
+
config.logLevel && (process.env.LOG_LEVEL = String(config.logLevel));
|
|
468
|
+
config.logLevel && (process.env.NX_VERBOSE_LOGGING = String(
|
|
469
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
470
|
+
));
|
|
471
|
+
config.logLevel && (process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none");
|
|
472
|
+
config && (process.env[`${prefix}CONFIG`] = JSON.stringify(config));
|
|
473
|
+
Object.keys(config.extensions ?? {}).forEach((key) => {
|
|
474
|
+
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
475
|
+
});
|
|
476
|
+
};
|
|
477
|
+
|
|
402
478
|
// packages/config-tools/src/create-storm-config.ts
|
|
403
479
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
404
480
|
var _static_cache2 = void 0;
|
|
@@ -409,8 +485,15 @@ var createStormConfig = (extensionName, schema, workspaceRoot) => {
|
|
|
409
485
|
let result;
|
|
410
486
|
if (!_static_cache2) {
|
|
411
487
|
let config = getConfigEnv();
|
|
412
|
-
|
|
413
|
-
result = StormConfigSchema.parse(
|
|
488
|
+
const defaultConfig = getDefaultConfig(config, workspaceRoot);
|
|
489
|
+
result = StormConfigSchema.parse({
|
|
490
|
+
...defaultConfig,
|
|
491
|
+
...config,
|
|
492
|
+
colors: {
|
|
493
|
+
...defaultConfig?.colors,
|
|
494
|
+
...config.colors
|
|
495
|
+
}
|
|
496
|
+
});
|
|
414
497
|
} else {
|
|
415
498
|
result = _static_cache2;
|
|
416
499
|
}
|
|
@@ -435,79 +518,17 @@ var createConfigExtension = (extensionName, schema) => {
|
|
|
435
518
|
_extension_cache.set(extension_cache_key, extension);
|
|
436
519
|
return extension;
|
|
437
520
|
};
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
return;
|
|
450
|
-
} else if (result.length === 1) {
|
|
451
|
-
extensionKey = result[0].toUpperCase();
|
|
452
|
-
} else {
|
|
453
|
-
extensionKey = result.reduce((ret, part) => {
|
|
454
|
-
return `${ret}_${part.toLowerCase()}`;
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
};
|
|
461
|
-
var setConfigEnv = (config) => {
|
|
462
|
-
const prefix = `STORM_`;
|
|
463
|
-
process.env[`${prefix}NAME`] = config.name;
|
|
464
|
-
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
465
|
-
process.env[`${prefix}OWNER`] = config.owner;
|
|
466
|
-
process.env[`${prefix}WORKER`] = config.worker;
|
|
467
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
468
|
-
process.env[`${prefix}LICENSE`] = config.license;
|
|
469
|
-
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
470
|
-
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
471
|
-
process.env.TZ = config.timezone;
|
|
472
|
-
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
473
|
-
process.env[`${prefix}LOCALE`] = config.locale;
|
|
474
|
-
process.env.LOCALE = config.locale;
|
|
475
|
-
process.env.DEFAULT_LOCALE = config.locale;
|
|
476
|
-
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
477
|
-
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
478
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
479
|
-
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
480
|
-
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
481
|
-
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
482
|
-
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
483
|
-
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
484
|
-
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
485
|
-
process.env[`${prefix}ENV`] = config.env;
|
|
486
|
-
process.env.NODE_ENV = config.env;
|
|
487
|
-
process.env.ENVIRONMENT = config.env;
|
|
488
|
-
process.env[`${prefix}CI`] = String(config.ci);
|
|
489
|
-
process.env.CI = String(config.ci);
|
|
490
|
-
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
491
|
-
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
492
|
-
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
493
|
-
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
494
|
-
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
495
|
-
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
496
|
-
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
497
|
-
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
498
|
-
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
499
|
-
process.env[`${prefix}BRANCH`] = config.branch;
|
|
500
|
-
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
501
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
502
|
-
process.env.LOG_LEVEL = String(config.logLevel);
|
|
503
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
504
|
-
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
505
|
-
);
|
|
506
|
-
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
507
|
-
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
508
|
-
Object.keys(config.extensions ?? {}).forEach((key) => {
|
|
509
|
-
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
510
|
-
});
|
|
521
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
522
|
+
try {
|
|
523
|
+
setConfigEnv(
|
|
524
|
+
StormConfigSchema.parse(await getConfigFile(workspaceRoot))
|
|
525
|
+
);
|
|
526
|
+
} catch (e) {
|
|
527
|
+
console.warn(
|
|
528
|
+
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
529
|
+
);
|
|
530
|
+
console.error(e);
|
|
531
|
+
}
|
|
511
532
|
};
|
|
512
533
|
// Annotate the CommonJS export names for ESM import in node:
|
|
513
534
|
0 && (module.exports = {
|
|
@@ -528,6 +549,7 @@ var setConfigEnv = (config) => {
|
|
|
528
549
|
getExtensionEnv,
|
|
529
550
|
getLogLevel,
|
|
530
551
|
getLogLevelLabel,
|
|
552
|
+
loadStormConfig,
|
|
531
553
|
setConfigEnv,
|
|
532
554
|
setExtensionEnv
|
|
533
555
|
});
|
package/index.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
2
2
|
import { cosmiconfig } from "cosmiconfig";
|
|
3
3
|
var _static_cache = void 0;
|
|
4
|
-
var getConfigFileName = (fileName) => cosmiconfig(fileName, { cache: true }).search();
|
|
5
|
-
var getConfigFile = async () => {
|
|
4
|
+
var getConfigFileName = (fileName, filePath) => cosmiconfig(fileName, { cache: true }).search(filePath);
|
|
5
|
+
var getConfigFile = async (filePath) => {
|
|
6
6
|
if (_static_cache) {
|
|
7
7
|
return _static_cache;
|
|
8
8
|
}
|
|
9
|
-
let cosmiconfigResult = await getConfigFileName("storm");
|
|
9
|
+
let cosmiconfigResult = await getConfigFileName("storm", filePath);
|
|
10
10
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
11
|
-
cosmiconfigResult = await getConfigFileName("storm-software");
|
|
11
|
+
cosmiconfigResult = await getConfigFileName("storm-software", filePath);
|
|
12
12
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
13
|
-
cosmiconfigResult = await getConfigFileName("storm-stack");
|
|
13
|
+
cosmiconfigResult = await getConfigFileName("storm-stack", filePath);
|
|
14
14
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
15
|
-
cosmiconfigResult = await getConfigFileName("storm-cloud");
|
|
15
|
+
cosmiconfigResult = await getConfigFileName("storm-cloud", filePath);
|
|
16
16
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
17
|
-
cosmiconfigResult = await getConfigFileName("acidic");
|
|
17
|
+
cosmiconfigResult = await getConfigFileName("acidic", filePath);
|
|
18
18
|
if (!cosmiconfigResult || cosmiconfigResult.isEmpty) {
|
|
19
|
-
cosmiconfigResult = await getConfigFileName("acid");
|
|
19
|
+
cosmiconfigResult = await getConfigFileName("acid", filePath);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
@@ -133,8 +133,8 @@ var ColorConfigSchema = z.object({
|
|
|
133
133
|
fatal: z.string().trim().toLowerCase().regex(/^#([0-9a-f]{3}){1,2}$/i).length(7).default("#7d1a1a").describe("The fatal color of the workspace")
|
|
134
134
|
}).describe("Colors used for various workspace elements");
|
|
135
135
|
var StormConfigSchema = z.object({
|
|
136
|
-
name: z.string().trim().toLowerCase().describe("The name of the package"),
|
|
137
|
-
namespace: z.string().trim().toLowerCase().
|
|
136
|
+
name: z.string().trim().toLowerCase().optional().describe("The name of the package"),
|
|
137
|
+
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
138
138
|
organization: z.string().trim().default("storm-software").describe("The organization of the workspace"),
|
|
139
139
|
repository: z.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
|
|
140
140
|
license: z.string().trim().default("Apache License 2.0").describe("The root directory of the package"),
|
|
@@ -151,7 +151,7 @@ var StormConfigSchema = z.object({
|
|
|
151
151
|
ci: z.boolean().default(true).describe(
|
|
152
152
|
"An indicator specifying if the current environment is a CI environment"
|
|
153
153
|
),
|
|
154
|
-
workspaceRoot: z.string().trim().describe("The root directory of the workspace"),
|
|
154
|
+
workspaceRoot: z.string().trim().optional().describe("The root directory of the workspace"),
|
|
155
155
|
packageDirectory: z.string().trim().optional().describe("The root directory of the package"),
|
|
156
156
|
buildDirectory: z.string().trim().default("dist").describe("The build directory for the workspace"),
|
|
157
157
|
runtimeDirectory: z.string().trim().default("node_modules/.storm").describe("The runtime directory of Storm"),
|
|
@@ -161,7 +161,7 @@ var StormConfigSchema = z.object({
|
|
|
161
161
|
packageManager: z.enum(["npm", "yarn", "pnpm", "bun"]).default("npm").describe("The package manager used by the repository"),
|
|
162
162
|
timezone: z.string().trim().default("America/New_York").describe("The default timezone of the workspace"),
|
|
163
163
|
locale: z.string().trim().default("en-US").describe("The default locale of the workspace"),
|
|
164
|
-
logLevel: z.enum(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).
|
|
164
|
+
logLevel: z.enum(["silent", "fatal", "error", "warn", "info", "debug", "trace"]).default("debug").describe(
|
|
165
165
|
"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`)."
|
|
166
166
|
),
|
|
167
167
|
configFile: z.string().trim().nullable().default(null).describe(
|
|
@@ -186,7 +186,7 @@ var DefaultColorConfig = {
|
|
|
186
186
|
fatal: "#7d1a1a"
|
|
187
187
|
};
|
|
188
188
|
var DefaultStormConfig = {
|
|
189
|
-
name: "storm
|
|
189
|
+
name: "storm",
|
|
190
190
|
namespace: "storm-software",
|
|
191
191
|
license: "Apache License 2.0",
|
|
192
192
|
homepage: "https://stormsoftware.org",
|
|
@@ -226,19 +226,18 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
226
226
|
packageJson.homepage && (homepage = packageJson.homepage);
|
|
227
227
|
}
|
|
228
228
|
}
|
|
229
|
-
return StormConfigSchema.parse(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
);
|
|
229
|
+
return StormConfigSchema.parse({
|
|
230
|
+
...config,
|
|
231
|
+
...DefaultStormConfig,
|
|
232
|
+
colors: { ...config.colors, ...DefaultColorConfig },
|
|
233
|
+
workspaceRoot,
|
|
234
|
+
name,
|
|
235
|
+
namespace,
|
|
236
|
+
repository,
|
|
237
|
+
license: license ?? DefaultStormConfig.license,
|
|
238
|
+
homepage: homepage ?? DefaultStormConfig.homepage,
|
|
239
|
+
extensions: {}
|
|
240
|
+
});
|
|
242
241
|
};
|
|
243
242
|
|
|
244
243
|
// packages/config-tools/src/utilities/get-log-level.ts
|
|
@@ -301,6 +300,7 @@ var getConfigEnv = () => {
|
|
|
301
300
|
owner: process.env[`${prefix}OWNER`],
|
|
302
301
|
worker: process.env[`${prefix}WORKER`],
|
|
303
302
|
organization: process.env[`${prefix}ORGANIZATION`],
|
|
303
|
+
packageManager: process.env[`${prefix}PACKAGE_MANAGER`],
|
|
304
304
|
license: process.env[`${prefix}LICENSE`],
|
|
305
305
|
homepage: process.env[`${prefix}HOMEPAGE`],
|
|
306
306
|
timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
|
|
@@ -346,6 +346,81 @@ var getConfigEnv = () => {
|
|
|
346
346
|
}, config);
|
|
347
347
|
};
|
|
348
348
|
|
|
349
|
+
// packages/config-tools/src/env/set-env.ts
|
|
350
|
+
var setExtensionEnv = (extensionName, extension) => {
|
|
351
|
+
Object.keys(extension ?? {}).forEach((key) => {
|
|
352
|
+
if (extension[key]) {
|
|
353
|
+
let result = key?.replace(
|
|
354
|
+
/([A-Z])+/g,
|
|
355
|
+
(input) => input ? input[0].toUpperCase() + input.slice(1) : ""
|
|
356
|
+
).split(/(?=[A-Z])|[\.\-\s_]/).map((x) => x.toLowerCase()) ?? [];
|
|
357
|
+
let extensionKey;
|
|
358
|
+
if (result.length === 0) {
|
|
359
|
+
return;
|
|
360
|
+
} else if (result.length === 1) {
|
|
361
|
+
extensionKey = result[0].toUpperCase();
|
|
362
|
+
} else {
|
|
363
|
+
extensionKey = result.reduce((ret, part) => {
|
|
364
|
+
return `${ret}_${part.toLowerCase()}`;
|
|
365
|
+
});
|
|
366
|
+
}
|
|
367
|
+
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
};
|
|
371
|
+
var setConfigEnv = (config) => {
|
|
372
|
+
const prefix = `STORM_`;
|
|
373
|
+
config.name && (process.env[`${prefix}NAME`] = config.name);
|
|
374
|
+
config.namespace && (process.env[`${prefix}NAMESPACE`] = config.namespace);
|
|
375
|
+
config.owner && (process.env[`${prefix}OWNER`] = config.owner);
|
|
376
|
+
config.worker && (process.env[`${prefix}WORKER`] = config.worker);
|
|
377
|
+
config.organization && (process.env[`${prefix}ORGANIZATION`] = config.organization);
|
|
378
|
+
config.packageManager && (process.env[`${prefix}PACKAGE_MANAGER`] = config.packageManager);
|
|
379
|
+
config.license && (process.env[`${prefix}LICENSE`] = config.license);
|
|
380
|
+
config.homepage && (process.env[`${prefix}HOMEPAGE`] = config.homepage);
|
|
381
|
+
config.timezone && (process.env[`${prefix}TIMEZONE`] = config.timezone);
|
|
382
|
+
config.timezone && (process.env.TZ = config.timezone);
|
|
383
|
+
config.timezone && (process.env.DEFAULT_TIMEZONE = config.timezone);
|
|
384
|
+
config.locale && (process.env[`${prefix}LOCALE`] = config.locale);
|
|
385
|
+
config.locale && (process.env.LOCALE = config.locale);
|
|
386
|
+
config.locale && (process.env.DEFAULT_LOCALE = config.locale);
|
|
387
|
+
config.locale && (process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8");
|
|
388
|
+
config.configFile && (process.env[`${prefix}CONFIG_FILE`] = config.configFile);
|
|
389
|
+
config.workspaceRoot && (process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot);
|
|
390
|
+
config.workspaceRoot && (process.env.NX_WORKSPACE_ROOT = config.workspaceRoot);
|
|
391
|
+
config.workspaceRoot && (process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot);
|
|
392
|
+
config.packageDirectory && (process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory);
|
|
393
|
+
config.buildDirectory && (process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory);
|
|
394
|
+
config.runtimeVersion && (process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion);
|
|
395
|
+
config.runtimeDirectory && (process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory);
|
|
396
|
+
config.env && (process.env[`${prefix}ENV`] = config.env);
|
|
397
|
+
config.env && (process.env.NODE_ENV = config.env);
|
|
398
|
+
config.env && (process.env.ENVIRONMENT = config.env);
|
|
399
|
+
config.ci && (process.env[`${prefix}CI`] = String(config.ci));
|
|
400
|
+
config.ci && (process.env.CI = String(config.ci));
|
|
401
|
+
config.ci && (process.env.CONTINUOUS_INTEGRATION = String(config.ci));
|
|
402
|
+
config.colors.primary && (process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary);
|
|
403
|
+
config.colors.background && (process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background);
|
|
404
|
+
config.colors.success && (process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success);
|
|
405
|
+
config.colors.info && (process.env[`${prefix}COLOR_INFO`] = config.colors.info);
|
|
406
|
+
config.colors.warning && (process.env[`${prefix}COLOR_WARNING`] = config.colors.warning);
|
|
407
|
+
config.colors.error && (process.env[`${prefix}COLOR_ERROR`] = config.colors.error);
|
|
408
|
+
config.colors.fatal && (process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal);
|
|
409
|
+
config.repository && (process.env[`${prefix}REPOSITORY`] = config.repository);
|
|
410
|
+
config.branch && (process.env[`${prefix}BRANCH`] = config.branch);
|
|
411
|
+
config.preMajor && (process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor));
|
|
412
|
+
config.logLevel && (process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel));
|
|
413
|
+
config.logLevel && (process.env.LOG_LEVEL = String(config.logLevel));
|
|
414
|
+
config.logLevel && (process.env.NX_VERBOSE_LOGGING = String(
|
|
415
|
+
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
416
|
+
));
|
|
417
|
+
config.logLevel && (process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none");
|
|
418
|
+
config && (process.env[`${prefix}CONFIG`] = JSON.stringify(config));
|
|
419
|
+
Object.keys(config.extensions ?? {}).forEach((key) => {
|
|
420
|
+
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
421
|
+
});
|
|
422
|
+
};
|
|
423
|
+
|
|
349
424
|
// packages/config-tools/src/create-storm-config.ts
|
|
350
425
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
351
426
|
var _static_cache2 = void 0;
|
|
@@ -356,8 +431,15 @@ var createStormConfig = (extensionName, schema, workspaceRoot) => {
|
|
|
356
431
|
let result;
|
|
357
432
|
if (!_static_cache2) {
|
|
358
433
|
let config = getConfigEnv();
|
|
359
|
-
|
|
360
|
-
result = StormConfigSchema.parse(
|
|
434
|
+
const defaultConfig = getDefaultConfig(config, workspaceRoot);
|
|
435
|
+
result = StormConfigSchema.parse({
|
|
436
|
+
...defaultConfig,
|
|
437
|
+
...config,
|
|
438
|
+
colors: {
|
|
439
|
+
...defaultConfig?.colors,
|
|
440
|
+
...config.colors
|
|
441
|
+
}
|
|
442
|
+
});
|
|
361
443
|
} else {
|
|
362
444
|
result = _static_cache2;
|
|
363
445
|
}
|
|
@@ -382,79 +464,17 @@ var createConfigExtension = (extensionName, schema) => {
|
|
|
382
464
|
_extension_cache.set(extension_cache_key, extension);
|
|
383
465
|
return extension;
|
|
384
466
|
};
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
return;
|
|
397
|
-
} else if (result.length === 1) {
|
|
398
|
-
extensionKey = result[0].toUpperCase();
|
|
399
|
-
} else {
|
|
400
|
-
extensionKey = result.reduce((ret, part) => {
|
|
401
|
-
return `${ret}_${part.toLowerCase()}`;
|
|
402
|
-
});
|
|
403
|
-
}
|
|
404
|
-
process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] = extension[key];
|
|
405
|
-
}
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
var setConfigEnv = (config) => {
|
|
409
|
-
const prefix = `STORM_`;
|
|
410
|
-
process.env[`${prefix}NAME`] = config.name;
|
|
411
|
-
process.env[`${prefix}NAMESPACE`] = config.namespace;
|
|
412
|
-
process.env[`${prefix}OWNER`] = config.owner;
|
|
413
|
-
process.env[`${prefix}WORKER`] = config.worker;
|
|
414
|
-
process.env[`${prefix}ORGANIZATION`] = config.organization;
|
|
415
|
-
process.env[`${prefix}LICENSE`] = config.license;
|
|
416
|
-
process.env[`${prefix}HOMEPAGE`] = config.homepage;
|
|
417
|
-
process.env[`${prefix}TIMEZONE`] = config.timezone;
|
|
418
|
-
process.env.TZ = config.timezone;
|
|
419
|
-
process.env.DEFAULT_TIMEZONE = config.timezone;
|
|
420
|
-
process.env[`${prefix}LOCALE`] = config.locale;
|
|
421
|
-
process.env.LOCALE = config.locale;
|
|
422
|
-
process.env.DEFAULT_LOCALE = config.locale;
|
|
423
|
-
process.env.LANG = config.locale ? `${config.locale.replaceAll("-", "_")}.UTF-8` : "en_US.UTF-8";
|
|
424
|
-
process.env[`${prefix}CONFIG_FILE`] = config.configFile;
|
|
425
|
-
process.env[`${prefix}WORKSPACE_ROOT`] = config.workspaceRoot;
|
|
426
|
-
process.env.NX_WORKSPACE_ROOT = config.workspaceRoot;
|
|
427
|
-
process.env.NX_WORKSPACE_ROOT_PATH = config.workspaceRoot;
|
|
428
|
-
process.env[`${prefix}PACKAGE_DIRECTORY`] = config.packageDirectory;
|
|
429
|
-
process.env[`${prefix}BUILD_DIRECTORY`] = config.buildDirectory;
|
|
430
|
-
process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
|
|
431
|
-
process.env[`${prefix}RUNTIME_DIRECTORY`] = config.runtimeDirectory;
|
|
432
|
-
process.env[`${prefix}ENV`] = config.env;
|
|
433
|
-
process.env.NODE_ENV = config.env;
|
|
434
|
-
process.env.ENVIRONMENT = config.env;
|
|
435
|
-
process.env[`${prefix}CI`] = String(config.ci);
|
|
436
|
-
process.env.CI = String(config.ci);
|
|
437
|
-
process.env.CONTINUOUS_INTEGRATION = String(config.ci);
|
|
438
|
-
process.env[`${prefix}COLOR_PRIMARY`] = config.colors.primary;
|
|
439
|
-
process.env[`${prefix}COLOR_BACKGROUND`] = config.colors.background;
|
|
440
|
-
process.env[`${prefix}COLOR_SUCCESS`] = config.colors.success;
|
|
441
|
-
process.env[`${prefix}COLOR_INFO`] = config.colors.info;
|
|
442
|
-
process.env[`${prefix}COLOR_WARNING`] = config.colors.warning;
|
|
443
|
-
process.env[`${prefix}COLOR_ERROR`] = config.colors.error;
|
|
444
|
-
process.env[`${prefix}COLOR_FATAL`] = config.colors.fatal;
|
|
445
|
-
process.env[`${prefix}REPOSITORY`] = config.repository;
|
|
446
|
-
process.env[`${prefix}BRANCH`] = config.branch;
|
|
447
|
-
process.env[`${prefix}PRE_MAJOR`] = String(config.preMajor);
|
|
448
|
-
process.env[`${prefix}LOG_LEVEL`] = String(config.logLevel);
|
|
449
|
-
process.env.LOG_LEVEL = String(config.logLevel);
|
|
450
|
-
process.env.NX_VERBOSE_LOGGING = String(
|
|
451
|
-
getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
|
|
452
|
-
);
|
|
453
|
-
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
454
|
-
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
455
|
-
Object.keys(config.extensions ?? {}).forEach((key) => {
|
|
456
|
-
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
457
|
-
});
|
|
467
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
468
|
+
try {
|
|
469
|
+
setConfigEnv(
|
|
470
|
+
StormConfigSchema.parse(await getConfigFile(workspaceRoot))
|
|
471
|
+
);
|
|
472
|
+
} catch (e) {
|
|
473
|
+
console.warn(
|
|
474
|
+
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.config.js` file to the root of your workspace if it is not."
|
|
475
|
+
);
|
|
476
|
+
console.error(e);
|
|
477
|
+
}
|
|
458
478
|
};
|
|
459
479
|
export {
|
|
460
480
|
ColorConfigSchema,
|
|
@@ -474,6 +494,7 @@ export {
|
|
|
474
494
|
getExtensionEnv,
|
|
475
495
|
getLogLevel,
|
|
476
496
|
getLogLevelLabel,
|
|
497
|
+
loadStormConfig,
|
|
477
498
|
setConfigEnv,
|
|
478
499
|
setExtensionEnv
|
|
479
500
|
};
|
package/meta.cjs.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/config-tools/src/config-file/get-config-file.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/config-tools/src/config-file/get-config-file.ts":{"bytes":2097,"imports":[{"path":"cosmiconfig","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/config-file/index.ts":{"bytes":35,"imports":[{"path":"packages/config-tools/src/config-file/get-config-file.ts","kind":"import-statement","original":"./get-config-file"}],"format":"esm"},"packages/config-tools/src/types.ts":{"bytes":1405,"imports":[{"path":"zod","kind":"import-statement","external":true},{"path":"./schema","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/find-up.ts":{"bytes":648,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytes":1755,"imports":[{"path":"packages/config-tools/src/utilities/find-up.ts","kind":"import-statement","original":"./find-up"}],"format":"esm"},"packages/config-tools/src/schema.ts":{"bytes":5942,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/get-default-config.ts":{"bytes":2608,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"../schema"},{"path":"../types","kind":"import-statement","external":true},{"path":"packages/config-tools/src/utilities/find-workspace-root.ts","kind":"import-statement","original":"./find-workspace-root"}],"format":"esm"},"packages/config-tools/src/utilities/get-log-level.ts":{"bytes":1409,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/config-tools/src/utilities/index.ts":{"bytes":110,"imports":[{"path":"packages/config-tools/src/utilities/find-workspace-root.ts","kind":"import-statement","original":"./find-workspace-root"},{"path":"packages/config-tools/src/utilities/get-default-config.ts","kind":"import-statement","original":"./get-default-config"},{"path":"packages/config-tools/src/utilities/get-log-level.ts","kind":"import-statement","original":"./get-log-level"}],"format":"esm"},"packages/config-tools/src/env/get-env.ts":{"bytes":4221,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/config-tools/src/utilities/index.ts","kind":"import-statement","original":"../utilities"}],"format":"esm"},"packages/config-tools/src/env/set-env.ts":{"bytes":5433,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/config-tools/src/utilities/get-log-level.ts","kind":"import-statement","original":"../utilities/get-log-level"}],"format":"esm"},"packages/config-tools/src/create-storm-config.ts":{"bytes":3653,"imports":[{"path":"zod","kind":"import-statement","external":true},{"path":"packages/config-tools/src/config-file/get-config-file.ts","kind":"import-statement","original":"./config-file/get-config-file"},{"path":"packages/config-tools/src/env/get-env.ts","kind":"import-statement","original":"./env/get-env"},{"path":"packages/config-tools/src/env/set-env.ts","kind":"import-statement","original":"./env/set-env"},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"./types","kind":"import-statement","external":true},{"path":"packages/config-tools/src/utilities/get-default-config.ts","kind":"import-statement","original":"./utilities/get-default-config"}],"format":"esm"},"packages/config-tools/src/env/index.ts":{"bytes":54,"imports":[{"path":"packages/config-tools/src/env/get-env.ts","kind":"import-statement","original":"./get-env"},{"path":"packages/config-tools/src/env/set-env.ts","kind":"import-statement","original":"./set-env"}],"format":"esm"},"packages/config-tools/src/index.ts":{"bytes":399,"imports":[{"path":"packages/config-tools/src/config-file/index.ts","kind":"import-statement","original":"./config-file"},{"path":"packages/config-tools/src/create-storm-config.ts","kind":"import-statement","original":"./create-storm-config"},{"path":"packages/config-tools/src/env/index.ts","kind":"import-statement","original":"./env"},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/config-tools/src/utilities/index.ts","kind":"import-statement","original":"./utilities"}],"format":"esm"}},"outputs":{"dist/packages/config-tools/index.cjs":{"imports":[{"path":"cosmiconfig","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true},{"path":"zod","kind":"require-call","external":true}],"exports":[],"entryPoint":"packages/config-tools/src/index.ts","inputs":{"packages/config-tools/src/index.ts":{"bytesInOutput":941},"packages/config-tools/src/config-file/get-config-file.ts":{"bytesInOutput":1680},"packages/config-tools/src/config-file/index.ts":{"bytesInOutput":0},"packages/config-tools/src/types.ts":{"bytesInOutput":256},"packages/config-tools/src/utilities/find-up.ts":{"bytesInOutput":555},"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytesInOutput":1137},"packages/config-tools/src/utilities/index.ts":{"bytesInOutput":0},"packages/config-tools/src/utilities/get-default-config.ts":{"bytesInOutput":2063},"packages/config-tools/src/schema.ts":{"bytesInOutput":4595},"packages/config-tools/src/utilities/get-log-level.ts":{"bytesInOutput":1029},"packages/config-tools/src/env/get-env.ts":{"bytesInOutput":3121},"packages/config-tools/src/env/set-env.ts":{"bytesInOutput":4553},"packages/config-tools/src/create-storm-config.ts":{"bytesInOutput":1631},"packages/config-tools/src/env/index.ts":{"bytesInOutput":0}},"bytes":24034},"dist/packages/config-tools/utilities/find-workspace-root.cjs":{"imports":[{"path":"fs","kind":"require-call","external":true},{"path":"path","kind":"require-call","external":true}],"exports":[],"entryPoint":"packages/config-tools/src/utilities/find-workspace-root.ts","inputs":{"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytesInOutput":1378},"packages/config-tools/src/utilities/find-up.ts":{"bytesInOutput":555}},"bytes":3031}}}
|
package/meta.esm.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"inputs":{"packages/config-tools/src/config-file/get-config-file.ts":{"bytes":
|
|
1
|
+
{"inputs":{"packages/config-tools/src/config-file/get-config-file.ts":{"bytes":2097,"imports":[{"path":"cosmiconfig","kind":"import-statement","external":true},{"path":"../types","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/config-file/index.ts":{"bytes":35,"imports":[{"path":"packages/config-tools/src/config-file/get-config-file.ts","kind":"import-statement","original":"./get-config-file"}],"format":"esm"},"packages/config-tools/src/types.ts":{"bytes":1405,"imports":[{"path":"zod","kind":"import-statement","external":true},{"path":"./schema","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/find-up.ts":{"bytes":648,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytes":1755,"imports":[{"path":"packages/config-tools/src/utilities/find-up.ts","kind":"import-statement","original":"./find-up"}],"format":"esm"},"packages/config-tools/src/schema.ts":{"bytes":5942,"imports":[{"path":"zod","kind":"import-statement","external":true}],"format":"esm"},"packages/config-tools/src/utilities/get-default-config.ts":{"bytes":2608,"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"../schema"},{"path":"../types","kind":"import-statement","external":true},{"path":"packages/config-tools/src/utilities/find-workspace-root.ts","kind":"import-statement","original":"./find-workspace-root"}],"format":"esm"},"packages/config-tools/src/utilities/get-log-level.ts":{"bytes":1409,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"}],"format":"esm"},"packages/config-tools/src/utilities/index.ts":{"bytes":110,"imports":[{"path":"packages/config-tools/src/utilities/find-workspace-root.ts","kind":"import-statement","original":"./find-workspace-root"},{"path":"packages/config-tools/src/utilities/get-default-config.ts","kind":"import-statement","original":"./get-default-config"},{"path":"packages/config-tools/src/utilities/get-log-level.ts","kind":"import-statement","original":"./get-log-level"}],"format":"esm"},"packages/config-tools/src/env/get-env.ts":{"bytes":4221,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/config-tools/src/utilities/index.ts","kind":"import-statement","original":"../utilities"}],"format":"esm"},"packages/config-tools/src/env/set-env.ts":{"bytes":5433,"imports":[{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"../types"},{"path":"packages/config-tools/src/utilities/get-log-level.ts","kind":"import-statement","original":"../utilities/get-log-level"}],"format":"esm"},"packages/config-tools/src/create-storm-config.ts":{"bytes":3653,"imports":[{"path":"zod","kind":"import-statement","external":true},{"path":"packages/config-tools/src/config-file/get-config-file.ts","kind":"import-statement","original":"./config-file/get-config-file"},{"path":"packages/config-tools/src/env/get-env.ts","kind":"import-statement","original":"./env/get-env"},{"path":"packages/config-tools/src/env/set-env.ts","kind":"import-statement","original":"./env/set-env"},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"./types","kind":"import-statement","external":true},{"path":"packages/config-tools/src/utilities/get-default-config.ts","kind":"import-statement","original":"./utilities/get-default-config"}],"format":"esm"},"packages/config-tools/src/env/index.ts":{"bytes":54,"imports":[{"path":"packages/config-tools/src/env/get-env.ts","kind":"import-statement","original":"./get-env"},{"path":"packages/config-tools/src/env/set-env.ts","kind":"import-statement","original":"./set-env"}],"format":"esm"},"packages/config-tools/src/index.ts":{"bytes":399,"imports":[{"path":"packages/config-tools/src/config-file/index.ts","kind":"import-statement","original":"./config-file"},{"path":"packages/config-tools/src/create-storm-config.ts","kind":"import-statement","original":"./create-storm-config"},{"path":"packages/config-tools/src/env/index.ts","kind":"import-statement","original":"./env"},{"path":"packages/config-tools/src/schema.ts","kind":"import-statement","original":"./schema"},{"path":"packages/config-tools/src/types.ts","kind":"import-statement","original":"./types"},{"path":"packages/config-tools/src/utilities/index.ts","kind":"import-statement","original":"./utilities"}],"format":"esm"}},"outputs":{"dist/packages/config-tools/index.js":{"imports":[{"path":"cosmiconfig","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true},{"path":"zod","kind":"import-statement","external":true}],"exports":["ColorConfigSchema","DefaultColorConfig","DefaultStormConfig","LogLevel","LogLevelLabel","StormConfigSchema","createConfig","createConfigExtension","createStormConfig","findWorkspaceRoot","findWorkspaceRootSafe","getConfigEnv","getConfigFile","getDefaultConfig","getExtensionEnv","getLogLevel","getLogLevelLabel","loadStormConfig","setConfigEnv","setExtensionEnv"],"entryPoint":"packages/config-tools/src/index.ts","inputs":{"packages/config-tools/src/config-file/get-config-file.ts":{"bytesInOutput":1650},"packages/config-tools/src/config-file/index.ts":{"bytesInOutput":0},"packages/config-tools/src/index.ts":{"bytesInOutput":0},"packages/config-tools/src/types.ts":{"bytesInOutput":256},"packages/config-tools/src/utilities/find-up.ts":{"bytesInOutput":502},"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytesInOutput":1137},"packages/config-tools/src/utilities/index.ts":{"bytesInOutput":0},"packages/config-tools/src/utilities/get-default-config.ts":{"bytesInOutput":2030},"packages/config-tools/src/schema.ts":{"bytesInOutput":4585},"packages/config-tools/src/utilities/get-log-level.ts":{"bytesInOutput":1029},"packages/config-tools/src/env/get-env.ts":{"bytesInOutput":3121},"packages/config-tools/src/env/set-env.ts":{"bytesInOutput":4553},"packages/config-tools/src/create-storm-config.ts":{"bytesInOutput":1631},"packages/config-tools/src/env/index.ts":{"bytesInOutput":0}},"bytes":21466},"dist/packages/config-tools/utilities/find-workspace-root.js":{"imports":[{"path":"fs","kind":"import-statement","external":true},{"path":"path","kind":"import-statement","external":true}],"exports":["findWorkspaceRoot","findWorkspaceRootSafe"],"entryPoint":"packages/config-tools/src/utilities/find-workspace-root.ts","inputs":{"packages/config-tools/src/utilities/find-up.ts":{"bytesInOutput":502},"packages/config-tools/src/utilities/find-workspace-root.ts":{"bytesInOutput":1137}},"bytes":1809}}}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storm-software/config-tools",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.9.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
|
|
6
6
|
"repository": {
|