@storm-software/workspace-tools 1.43.5 → 1.43.7
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/index.js +453 -450
- package/meta.json +1 -1
- package/package.json +1 -1
- package/src/base/index.js +40 -23
- package/src/executors/design-tokens/executor.js +39 -22
- package/src/executors/tsup/executor.js +433 -430
- package/src/executors/tsup-browser/executor.js +433 -430
- package/src/executors/tsup-neutral/executor.js +433 -430
- package/src/executors/tsup-node/executor.js +433 -430
- package/src/generators/browser-library/generator.js +39 -22
- package/src/generators/config-schema/generator.js +44 -27
- package/src/generators/neutral-library/generator.js +39 -22
- package/src/generators/node-library/generator.js +39 -22
- package/src/generators/preset/generator.js +39 -22
|
@@ -43478,7 +43478,7 @@ var import_devkit2 = __toESM(require_devkit());
|
|
|
43478
43478
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43479
43479
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
43480
43480
|
var _static_cache = void 0;
|
|
43481
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43481
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43482
43482
|
var getConfigFile = async (filePath) => {
|
|
43483
43483
|
if (_static_cache) {
|
|
43484
43484
|
return _static_cache;
|
|
@@ -43538,17 +43538,17 @@ var LogLevelLabel = {
|
|
|
43538
43538
|
};
|
|
43539
43539
|
|
|
43540
43540
|
// packages/config-tools/src/utilities/find-up.ts
|
|
43541
|
-
var
|
|
43542
|
-
var
|
|
43541
|
+
var import_node_fs = require("node:fs");
|
|
43542
|
+
var import_node_path = require("node:path");
|
|
43543
43543
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
43544
43544
|
var depth = 0;
|
|
43545
43545
|
function findFolderUp(startPath, endFileNames) {
|
|
43546
43546
|
const _startPath = startPath ?? process.cwd();
|
|
43547
|
-
if (endFileNames.some((endFileName) => (0,
|
|
43547
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
43548
43548
|
return _startPath;
|
|
43549
43549
|
}
|
|
43550
43550
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
43551
|
-
const parent = (0,
|
|
43551
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
43552
43552
|
return findFolderUp(parent, endFileNames);
|
|
43553
43553
|
}
|
|
43554
43554
|
return void 0;
|
|
@@ -43607,8 +43607,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
43607
43607
|
}
|
|
43608
43608
|
|
|
43609
43609
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
43610
|
-
var
|
|
43611
|
-
var
|
|
43610
|
+
var import_node_fs2 = require("node:fs");
|
|
43611
|
+
var import_node_path2 = require("node:path");
|
|
43612
43612
|
|
|
43613
43613
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
43614
43614
|
var util;
|
|
@@ -47277,8 +47277,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47277
47277
|
let license = DefaultStormConfig.license;
|
|
47278
47278
|
let homepage = DefaultStormConfig.homepage;
|
|
47279
47279
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
47280
|
-
if ((0,
|
|
47281
|
-
const file = (0,
|
|
47280
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
47281
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
47282
47282
|
encoding: "utf-8"
|
|
47283
47283
|
});
|
|
47284
47284
|
if (file) {
|
|
@@ -47301,9 +47301,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47301
47301
|
}
|
|
47302
47302
|
}
|
|
47303
47303
|
return StormConfigSchema.parse({
|
|
47304
|
-
...config,
|
|
47305
47304
|
...DefaultStormConfig,
|
|
47306
|
-
|
|
47305
|
+
...config,
|
|
47306
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
47307
47307
|
workspaceRoot,
|
|
47308
47308
|
name,
|
|
47309
47309
|
namespace,
|
|
@@ -47494,6 +47494,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
47494
47494
|
};
|
|
47495
47495
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
47496
47496
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
47497
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
47497
47498
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
47498
47499
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
47499
47500
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -47646,16 +47647,6 @@ var setConfigEnv = (config) => {
|
|
|
47646
47647
|
}
|
|
47647
47648
|
};
|
|
47648
47649
|
|
|
47649
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
47650
|
-
var prepareWorkspace = async () => {
|
|
47651
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
47652
|
-
...await getConfigFile(),
|
|
47653
|
-
...getConfigEnv()
|
|
47654
|
-
});
|
|
47655
|
-
setConfigEnv(_STORM_CONFIG);
|
|
47656
|
-
return _STORM_CONFIG;
|
|
47657
|
-
};
|
|
47658
|
-
|
|
47659
47650
|
// packages/config-tools/src/env/get-env.ts
|
|
47660
47651
|
var getExtensionEnv = (extensionName) => {
|
|
47661
47652
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -47723,6 +47714,32 @@ var getConfigEnv = () => {
|
|
|
47723
47714
|
}, config);
|
|
47724
47715
|
};
|
|
47725
47716
|
|
|
47717
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
47718
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
47719
|
+
let config = {};
|
|
47720
|
+
let _workspaceRoot = workspaceRoot;
|
|
47721
|
+
if (!_workspaceRoot) {
|
|
47722
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
47723
|
+
}
|
|
47724
|
+
const configFile = await getDefaultConfig(
|
|
47725
|
+
{
|
|
47726
|
+
...await getConfigFile(_workspaceRoot),
|
|
47727
|
+
...getConfigEnv()
|
|
47728
|
+
},
|
|
47729
|
+
_workspaceRoot
|
|
47730
|
+
);
|
|
47731
|
+
if (configFile) {
|
|
47732
|
+
config = StormConfigSchema.parse(configFile);
|
|
47733
|
+
} else {
|
|
47734
|
+
writeWarning(
|
|
47735
|
+
config,
|
|
47736
|
+
"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."
|
|
47737
|
+
);
|
|
47738
|
+
}
|
|
47739
|
+
setConfigEnv(config);
|
|
47740
|
+
return config;
|
|
47741
|
+
};
|
|
47742
|
+
|
|
47726
47743
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
47727
47744
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
47728
47745
|
var getWorkspaceRoot = () => {
|
|
@@ -47803,7 +47820,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
47803
47820
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
47804
47821
|
- workspaceRoot: ${workspaceRoot}`
|
|
47805
47822
|
);
|
|
47806
|
-
config = await
|
|
47823
|
+
config = await loadStormConfig(workspaceRoot);
|
|
47807
47824
|
writeTrace(
|
|
47808
47825
|
config,
|
|
47809
47826
|
`Loaded Storm config into env:
|
|
@@ -26236,7 +26236,7 @@ var import_devkit = __toESM(require_devkit());
|
|
|
26236
26236
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
26237
26237
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
26238
26238
|
var _static_cache = void 0;
|
|
26239
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26239
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26240
26240
|
var getConfigFile = async (filePath) => {
|
|
26241
26241
|
if (_static_cache) {
|
|
26242
26242
|
return _static_cache;
|
|
@@ -26296,17 +26296,17 @@ var LogLevelLabel = {
|
|
|
26296
26296
|
};
|
|
26297
26297
|
|
|
26298
26298
|
// packages/config-tools/src/utilities/find-up.ts
|
|
26299
|
-
var
|
|
26300
|
-
var
|
|
26299
|
+
var import_node_fs = require("node:fs");
|
|
26300
|
+
var import_node_path = require("node:path");
|
|
26301
26301
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
26302
26302
|
var depth = 0;
|
|
26303
26303
|
function findFolderUp(startPath, endFileNames) {
|
|
26304
26304
|
const _startPath = startPath ?? process.cwd();
|
|
26305
|
-
if (endFileNames.some((endFileName) => (0,
|
|
26305
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
26306
26306
|
return _startPath;
|
|
26307
26307
|
}
|
|
26308
26308
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
26309
|
-
const parent = (0,
|
|
26309
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
26310
26310
|
return findFolderUp(parent, endFileNames);
|
|
26311
26311
|
}
|
|
26312
26312
|
return void 0;
|
|
@@ -26365,8 +26365,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
26365
26365
|
}
|
|
26366
26366
|
|
|
26367
26367
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
26368
|
-
var
|
|
26369
|
-
var
|
|
26368
|
+
var import_node_fs2 = require("node:fs");
|
|
26369
|
+
var import_node_path2 = require("node:path");
|
|
26370
26370
|
|
|
26371
26371
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
26372
26372
|
var util;
|
|
@@ -30035,8 +30035,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30035
30035
|
let license = DefaultStormConfig.license;
|
|
30036
30036
|
let homepage = DefaultStormConfig.homepage;
|
|
30037
30037
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
30038
|
-
if ((0,
|
|
30039
|
-
const file = (0,
|
|
30038
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
30039
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
30040
30040
|
encoding: "utf-8"
|
|
30041
30041
|
});
|
|
30042
30042
|
if (file) {
|
|
@@ -30059,9 +30059,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30059
30059
|
}
|
|
30060
30060
|
}
|
|
30061
30061
|
return StormConfigSchema.parse({
|
|
30062
|
-
...config,
|
|
30063
30062
|
...DefaultStormConfig,
|
|
30064
|
-
|
|
30063
|
+
...config,
|
|
30064
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
30065
30065
|
workspaceRoot,
|
|
30066
30066
|
name,
|
|
30067
30067
|
namespace,
|
|
@@ -30252,6 +30252,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
30252
30252
|
};
|
|
30253
30253
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
30254
30254
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
30255
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
30255
30256
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
30256
30257
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
30257
30258
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -30404,16 +30405,6 @@ var setConfigEnv = (config) => {
|
|
|
30404
30405
|
}
|
|
30405
30406
|
};
|
|
30406
30407
|
|
|
30407
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
30408
|
-
var prepareWorkspace = async () => {
|
|
30409
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
30410
|
-
...await getConfigFile(),
|
|
30411
|
-
...getConfigEnv()
|
|
30412
|
-
});
|
|
30413
|
-
setConfigEnv(_STORM_CONFIG);
|
|
30414
|
-
return _STORM_CONFIG;
|
|
30415
|
-
};
|
|
30416
|
-
|
|
30417
30408
|
// packages/config-tools/src/env/get-env.ts
|
|
30418
30409
|
var getExtensionEnv = (extensionName) => {
|
|
30419
30410
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -30481,9 +30472,35 @@ var getConfigEnv = () => {
|
|
|
30481
30472
|
}, config);
|
|
30482
30473
|
};
|
|
30483
30474
|
|
|
30475
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
30476
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
30477
|
+
let config = {};
|
|
30478
|
+
let _workspaceRoot = workspaceRoot;
|
|
30479
|
+
if (!_workspaceRoot) {
|
|
30480
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
30481
|
+
}
|
|
30482
|
+
const configFile = await getDefaultConfig(
|
|
30483
|
+
{
|
|
30484
|
+
...await getConfigFile(_workspaceRoot),
|
|
30485
|
+
...getConfigEnv()
|
|
30486
|
+
},
|
|
30487
|
+
_workspaceRoot
|
|
30488
|
+
);
|
|
30489
|
+
if (configFile) {
|
|
30490
|
+
config = StormConfigSchema.parse(configFile);
|
|
30491
|
+
} else {
|
|
30492
|
+
writeWarning(
|
|
30493
|
+
config,
|
|
30494
|
+
"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."
|
|
30495
|
+
);
|
|
30496
|
+
}
|
|
30497
|
+
setConfigEnv(config);
|
|
30498
|
+
return config;
|
|
30499
|
+
};
|
|
30500
|
+
|
|
30484
30501
|
// packages/workspace-tools/src/generators/config-schema/generator.ts
|
|
30485
|
-
var
|
|
30486
|
-
var
|
|
30502
|
+
var import_fs = require("fs");
|
|
30503
|
+
var import_path = require("path");
|
|
30487
30504
|
|
|
30488
30505
|
// node_modules/.pnpm/zod-to-json-schema@3.22.1_zod@3.22.4/node_modules/zod-to-json-schema/dist/esm/errorMessages.js
|
|
30489
30506
|
function addErrorMessage(res, key, errorMessage, refs) {
|
|
@@ -31576,7 +31593,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
31576
31593
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
31577
31594
|
- workspaceRoot: ${workspaceRoot}`
|
|
31578
31595
|
);
|
|
31579
|
-
config = await
|
|
31596
|
+
config = await loadStormConfig(workspaceRoot);
|
|
31580
31597
|
writeTrace(
|
|
31581
31598
|
config,
|
|
31582
31599
|
`Loaded Storm config into env:
|
|
@@ -31653,11 +31670,11 @@ async function configSchemaGeneratorFn(tree, options) {
|
|
|
31653
31670
|
const modules = await Promise.all(
|
|
31654
31671
|
Object.keys(projectConfigurations).map(async (key) => {
|
|
31655
31672
|
if (projectConfigurations[key]?.config) {
|
|
31656
|
-
const configPath = (0,
|
|
31673
|
+
const configPath = (0, import_path.join)(
|
|
31657
31674
|
workspaceRoot,
|
|
31658
31675
|
projectConfigurations[key].config
|
|
31659
31676
|
);
|
|
31660
|
-
if ((0,
|
|
31677
|
+
if ((0, import_fs.existsSync)(configPath)) {
|
|
31661
31678
|
const mod = await import(configPath);
|
|
31662
31679
|
if (mod.default) {
|
|
31663
31680
|
return { name: key, schema: mod.default };
|
|
@@ -31685,7 +31702,7 @@ async function configSchemaGeneratorFn(tree, options) {
|
|
|
31685
31702
|
);
|
|
31686
31703
|
(0, import_devkit.writeJson)(
|
|
31687
31704
|
tree,
|
|
31688
|
-
options.outputFile ? (0,
|
|
31705
|
+
options.outputFile ? (0, import_path.join)(workspaceRoot, options.outputFile) : (0, import_path.join)(workspaceRoot, "storm.schema.json"),
|
|
31689
31706
|
zodToJsonSchema(ModulesSchema, "StormConfig")
|
|
31690
31707
|
);
|
|
31691
31708
|
await (0, import_devkit.formatFiles)(tree);
|
|
@@ -43478,7 +43478,7 @@ var import_devkit2 = __toESM(require_devkit());
|
|
|
43478
43478
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43479
43479
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
43480
43480
|
var _static_cache = void 0;
|
|
43481
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43481
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43482
43482
|
var getConfigFile = async (filePath) => {
|
|
43483
43483
|
if (_static_cache) {
|
|
43484
43484
|
return _static_cache;
|
|
@@ -43538,17 +43538,17 @@ var LogLevelLabel = {
|
|
|
43538
43538
|
};
|
|
43539
43539
|
|
|
43540
43540
|
// packages/config-tools/src/utilities/find-up.ts
|
|
43541
|
-
var
|
|
43542
|
-
var
|
|
43541
|
+
var import_node_fs = require("node:fs");
|
|
43542
|
+
var import_node_path = require("node:path");
|
|
43543
43543
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
43544
43544
|
var depth = 0;
|
|
43545
43545
|
function findFolderUp(startPath, endFileNames) {
|
|
43546
43546
|
const _startPath = startPath ?? process.cwd();
|
|
43547
|
-
if (endFileNames.some((endFileName) => (0,
|
|
43547
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
43548
43548
|
return _startPath;
|
|
43549
43549
|
}
|
|
43550
43550
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
43551
|
-
const parent = (0,
|
|
43551
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
43552
43552
|
return findFolderUp(parent, endFileNames);
|
|
43553
43553
|
}
|
|
43554
43554
|
return void 0;
|
|
@@ -43607,8 +43607,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
43607
43607
|
}
|
|
43608
43608
|
|
|
43609
43609
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
43610
|
-
var
|
|
43611
|
-
var
|
|
43610
|
+
var import_node_fs2 = require("node:fs");
|
|
43611
|
+
var import_node_path2 = require("node:path");
|
|
43612
43612
|
|
|
43613
43613
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
43614
43614
|
var util;
|
|
@@ -47277,8 +47277,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47277
47277
|
let license = DefaultStormConfig.license;
|
|
47278
47278
|
let homepage = DefaultStormConfig.homepage;
|
|
47279
47279
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
47280
|
-
if ((0,
|
|
47281
|
-
const file = (0,
|
|
47280
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
47281
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
47282
47282
|
encoding: "utf-8"
|
|
47283
47283
|
});
|
|
47284
47284
|
if (file) {
|
|
@@ -47301,9 +47301,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47301
47301
|
}
|
|
47302
47302
|
}
|
|
47303
47303
|
return StormConfigSchema.parse({
|
|
47304
|
-
...config,
|
|
47305
47304
|
...DefaultStormConfig,
|
|
47306
|
-
|
|
47305
|
+
...config,
|
|
47306
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
47307
47307
|
workspaceRoot,
|
|
47308
47308
|
name,
|
|
47309
47309
|
namespace,
|
|
@@ -47494,6 +47494,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
47494
47494
|
};
|
|
47495
47495
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
47496
47496
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
47497
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
47497
47498
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
47498
47499
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
47499
47500
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -47646,16 +47647,6 @@ var setConfigEnv = (config) => {
|
|
|
47646
47647
|
}
|
|
47647
47648
|
};
|
|
47648
47649
|
|
|
47649
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
47650
|
-
var prepareWorkspace = async () => {
|
|
47651
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
47652
|
-
...await getConfigFile(),
|
|
47653
|
-
...getConfigEnv()
|
|
47654
|
-
});
|
|
47655
|
-
setConfigEnv(_STORM_CONFIG);
|
|
47656
|
-
return _STORM_CONFIG;
|
|
47657
|
-
};
|
|
47658
|
-
|
|
47659
47650
|
// packages/config-tools/src/env/get-env.ts
|
|
47660
47651
|
var getExtensionEnv = (extensionName) => {
|
|
47661
47652
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -47723,6 +47714,32 @@ var getConfigEnv = () => {
|
|
|
47723
47714
|
}, config);
|
|
47724
47715
|
};
|
|
47725
47716
|
|
|
47717
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
47718
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
47719
|
+
let config = {};
|
|
47720
|
+
let _workspaceRoot = workspaceRoot;
|
|
47721
|
+
if (!_workspaceRoot) {
|
|
47722
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
47723
|
+
}
|
|
47724
|
+
const configFile = await getDefaultConfig(
|
|
47725
|
+
{
|
|
47726
|
+
...await getConfigFile(_workspaceRoot),
|
|
47727
|
+
...getConfigEnv()
|
|
47728
|
+
},
|
|
47729
|
+
_workspaceRoot
|
|
47730
|
+
);
|
|
47731
|
+
if (configFile) {
|
|
47732
|
+
config = StormConfigSchema.parse(configFile);
|
|
47733
|
+
} else {
|
|
47734
|
+
writeWarning(
|
|
47735
|
+
config,
|
|
47736
|
+
"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."
|
|
47737
|
+
);
|
|
47738
|
+
}
|
|
47739
|
+
setConfigEnv(config);
|
|
47740
|
+
return config;
|
|
47741
|
+
};
|
|
47742
|
+
|
|
47726
47743
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
47727
47744
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
47728
47745
|
var getWorkspaceRoot = () => {
|
|
@@ -47803,7 +47820,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
47803
47820
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
47804
47821
|
- workspaceRoot: ${workspaceRoot}`
|
|
47805
47822
|
);
|
|
47806
|
-
config = await
|
|
47823
|
+
config = await loadStormConfig(workspaceRoot);
|
|
47807
47824
|
writeTrace(
|
|
47808
47825
|
config,
|
|
47809
47826
|
`Loaded Storm config into env:
|
|
@@ -43478,7 +43478,7 @@ var import_devkit2 = __toESM(require_devkit());
|
|
|
43478
43478
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
43479
43479
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
43480
43480
|
var _static_cache = void 0;
|
|
43481
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43481
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
43482
43482
|
var getConfigFile = async (filePath) => {
|
|
43483
43483
|
if (_static_cache) {
|
|
43484
43484
|
return _static_cache;
|
|
@@ -43538,17 +43538,17 @@ var LogLevelLabel = {
|
|
|
43538
43538
|
};
|
|
43539
43539
|
|
|
43540
43540
|
// packages/config-tools/src/utilities/find-up.ts
|
|
43541
|
-
var
|
|
43542
|
-
var
|
|
43541
|
+
var import_node_fs = require("node:fs");
|
|
43542
|
+
var import_node_path = require("node:path");
|
|
43543
43543
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
43544
43544
|
var depth = 0;
|
|
43545
43545
|
function findFolderUp(startPath, endFileNames) {
|
|
43546
43546
|
const _startPath = startPath ?? process.cwd();
|
|
43547
|
-
if (endFileNames.some((endFileName) => (0,
|
|
43547
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
43548
43548
|
return _startPath;
|
|
43549
43549
|
}
|
|
43550
43550
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
43551
|
-
const parent = (0,
|
|
43551
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
43552
43552
|
return findFolderUp(parent, endFileNames);
|
|
43553
43553
|
}
|
|
43554
43554
|
return void 0;
|
|
@@ -43607,8 +43607,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
43607
43607
|
}
|
|
43608
43608
|
|
|
43609
43609
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
43610
|
-
var
|
|
43611
|
-
var
|
|
43610
|
+
var import_node_fs2 = require("node:fs");
|
|
43611
|
+
var import_node_path2 = require("node:path");
|
|
43612
43612
|
|
|
43613
43613
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
43614
43614
|
var util;
|
|
@@ -47277,8 +47277,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47277
47277
|
let license = DefaultStormConfig.license;
|
|
47278
47278
|
let homepage = DefaultStormConfig.homepage;
|
|
47279
47279
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
47280
|
-
if ((0,
|
|
47281
|
-
const file = (0,
|
|
47280
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
47281
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
47282
47282
|
encoding: "utf-8"
|
|
47283
47283
|
});
|
|
47284
47284
|
if (file) {
|
|
@@ -47301,9 +47301,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
47301
47301
|
}
|
|
47302
47302
|
}
|
|
47303
47303
|
return StormConfigSchema.parse({
|
|
47304
|
-
...config,
|
|
47305
47304
|
...DefaultStormConfig,
|
|
47306
|
-
|
|
47305
|
+
...config,
|
|
47306
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
47307
47307
|
workspaceRoot,
|
|
47308
47308
|
name,
|
|
47309
47309
|
namespace,
|
|
@@ -47494,6 +47494,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
47494
47494
|
};
|
|
47495
47495
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
47496
47496
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
47497
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
47497
47498
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
47498
47499
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
47499
47500
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -47646,16 +47647,6 @@ var setConfigEnv = (config) => {
|
|
|
47646
47647
|
}
|
|
47647
47648
|
};
|
|
47648
47649
|
|
|
47649
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
47650
|
-
var prepareWorkspace = async () => {
|
|
47651
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
47652
|
-
...await getConfigFile(),
|
|
47653
|
-
...getConfigEnv()
|
|
47654
|
-
});
|
|
47655
|
-
setConfigEnv(_STORM_CONFIG);
|
|
47656
|
-
return _STORM_CONFIG;
|
|
47657
|
-
};
|
|
47658
|
-
|
|
47659
47650
|
// packages/config-tools/src/env/get-env.ts
|
|
47660
47651
|
var getExtensionEnv = (extensionName) => {
|
|
47661
47652
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -47723,6 +47714,32 @@ var getConfigEnv = () => {
|
|
|
47723
47714
|
}, config);
|
|
47724
47715
|
};
|
|
47725
47716
|
|
|
47717
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
47718
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
47719
|
+
let config = {};
|
|
47720
|
+
let _workspaceRoot = workspaceRoot;
|
|
47721
|
+
if (!_workspaceRoot) {
|
|
47722
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
47723
|
+
}
|
|
47724
|
+
const configFile = await getDefaultConfig(
|
|
47725
|
+
{
|
|
47726
|
+
...await getConfigFile(_workspaceRoot),
|
|
47727
|
+
...getConfigEnv()
|
|
47728
|
+
},
|
|
47729
|
+
_workspaceRoot
|
|
47730
|
+
);
|
|
47731
|
+
if (configFile) {
|
|
47732
|
+
config = StormConfigSchema.parse(configFile);
|
|
47733
|
+
} else {
|
|
47734
|
+
writeWarning(
|
|
47735
|
+
config,
|
|
47736
|
+
"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."
|
|
47737
|
+
);
|
|
47738
|
+
}
|
|
47739
|
+
setConfigEnv(config);
|
|
47740
|
+
return config;
|
|
47741
|
+
};
|
|
47742
|
+
|
|
47726
47743
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
47727
47744
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
47728
47745
|
var getWorkspaceRoot = () => {
|
|
@@ -47803,7 +47820,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
47803
47820
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
47804
47821
|
- workspaceRoot: ${workspaceRoot}`
|
|
47805
47822
|
);
|
|
47806
|
-
config = await
|
|
47823
|
+
config = await loadStormConfig(workspaceRoot);
|
|
47807
47824
|
writeTrace(
|
|
47808
47825
|
config,
|
|
47809
47826
|
`Loaded Storm config into env:
|
|
@@ -26237,7 +26237,7 @@ var import_devkit = __toESM(require_devkit());
|
|
|
26237
26237
|
// packages/config-tools/src/config-file/get-config-file.ts
|
|
26238
26238
|
var import_cosmiconfig = __toESM(require_dist(), 1);
|
|
26239
26239
|
var _static_cache = void 0;
|
|
26240
|
-
var getConfigFileName = (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26240
|
+
var getConfigFileName = async (fileName, filePath) => (0, import_cosmiconfig.cosmiconfig)(fileName, { cache: true }).search(filePath);
|
|
26241
26241
|
var getConfigFile = async (filePath) => {
|
|
26242
26242
|
if (_static_cache) {
|
|
26243
26243
|
return _static_cache;
|
|
@@ -26297,17 +26297,17 @@ var LogLevelLabel = {
|
|
|
26297
26297
|
};
|
|
26298
26298
|
|
|
26299
26299
|
// packages/config-tools/src/utilities/find-up.ts
|
|
26300
|
-
var
|
|
26301
|
-
var
|
|
26300
|
+
var import_node_fs = require("node:fs");
|
|
26301
|
+
var import_node_path = require("node:path");
|
|
26302
26302
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
26303
26303
|
var depth = 0;
|
|
26304
26304
|
function findFolderUp(startPath, endFileNames) {
|
|
26305
26305
|
const _startPath = startPath ?? process.cwd();
|
|
26306
|
-
if (endFileNames.some((endFileName) => (0,
|
|
26306
|
+
if (endFileNames.some((endFileName) => (0, import_node_fs.existsSync)((0, import_node_path.join)(_startPath, endFileName)))) {
|
|
26307
26307
|
return _startPath;
|
|
26308
26308
|
}
|
|
26309
26309
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
26310
|
-
const parent = (0,
|
|
26310
|
+
const parent = (0, import_node_path.join)(_startPath, "..");
|
|
26311
26311
|
return findFolderUp(parent, endFileNames);
|
|
26312
26312
|
}
|
|
26313
26313
|
return void 0;
|
|
@@ -26366,8 +26366,8 @@ Path: ${pathInsideMonorepo ? pathInsideMonorepo : process.cwd()}`
|
|
|
26366
26366
|
}
|
|
26367
26367
|
|
|
26368
26368
|
// packages/config-tools/src/utilities/get-default-config.ts
|
|
26369
|
-
var
|
|
26370
|
-
var
|
|
26369
|
+
var import_node_fs2 = require("node:fs");
|
|
26370
|
+
var import_node_path2 = require("node:path");
|
|
26371
26371
|
|
|
26372
26372
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
26373
26373
|
var util;
|
|
@@ -30036,8 +30036,8 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30036
30036
|
let license = DefaultStormConfig.license;
|
|
30037
30037
|
let homepage = DefaultStormConfig.homepage;
|
|
30038
30038
|
const workspaceRoot = findWorkspaceRoot(root);
|
|
30039
|
-
if ((0,
|
|
30040
|
-
const file = (0,
|
|
30039
|
+
if ((0, import_node_fs2.existsSync)((0, import_node_path2.join)(workspaceRoot, "package.json"))) {
|
|
30040
|
+
const file = (0, import_node_fs2.readFileSync)((0, import_node_path2.join)(workspaceRoot, "package.json"), {
|
|
30041
30041
|
encoding: "utf-8"
|
|
30042
30042
|
});
|
|
30043
30043
|
if (file) {
|
|
@@ -30060,9 +30060,9 @@ var getDefaultConfig = (config = {}, root) => {
|
|
|
30060
30060
|
}
|
|
30061
30061
|
}
|
|
30062
30062
|
return StormConfigSchema.parse({
|
|
30063
|
-
...config,
|
|
30064
30063
|
...DefaultStormConfig,
|
|
30065
|
-
|
|
30064
|
+
...config,
|
|
30065
|
+
colors: { ...DefaultColorConfig, ...config.colors },
|
|
30066
30066
|
workspaceRoot,
|
|
30067
30067
|
name,
|
|
30068
30068
|
namespace,
|
|
@@ -30253,6 +30253,7 @@ var getLogFn = (config = {}, logLevel = LogLevel.INFO) => {
|
|
|
30253
30253
|
};
|
|
30254
30254
|
var writeFatal = (config, message) => getLogFn(config, LogLevel.FATAL)(message);
|
|
30255
30255
|
var writeError = (config, message) => getLogFn(config, LogLevel.ERROR)(message);
|
|
30256
|
+
var writeWarning = (config, message) => getLogFn(config, LogLevel.WARN)(message);
|
|
30256
30257
|
var writeInfo = (config, message) => getLogFn(config, LogLevel.INFO)(message);
|
|
30257
30258
|
var writeSuccess = (config, message) => getLogFn(config, LogLevel.SUCCESS)(message);
|
|
30258
30259
|
var writeDebug = (config, message) => getLogFn(config, LogLevel.DEBUG)(message);
|
|
@@ -30405,16 +30406,6 @@ var setConfigEnv = (config) => {
|
|
|
30405
30406
|
}
|
|
30406
30407
|
};
|
|
30407
30408
|
|
|
30408
|
-
// packages/config-tools/src/utilities/prepare-workspace.ts
|
|
30409
|
-
var prepareWorkspace = async () => {
|
|
30410
|
-
const _STORM_CONFIG = getDefaultConfig({
|
|
30411
|
-
...await getConfigFile(),
|
|
30412
|
-
...getConfigEnv()
|
|
30413
|
-
});
|
|
30414
|
-
setConfigEnv(_STORM_CONFIG);
|
|
30415
|
-
return _STORM_CONFIG;
|
|
30416
|
-
};
|
|
30417
|
-
|
|
30418
30409
|
// packages/config-tools/src/env/get-env.ts
|
|
30419
30410
|
var getExtensionEnv = (extensionName) => {
|
|
30420
30411
|
const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
|
|
@@ -30482,6 +30473,32 @@ var getConfigEnv = () => {
|
|
|
30482
30473
|
}, config);
|
|
30483
30474
|
};
|
|
30484
30475
|
|
|
30476
|
+
// packages/config-tools/src/create-storm-config.ts
|
|
30477
|
+
var loadStormConfig = async (workspaceRoot) => {
|
|
30478
|
+
let config = {};
|
|
30479
|
+
let _workspaceRoot = workspaceRoot;
|
|
30480
|
+
if (!_workspaceRoot) {
|
|
30481
|
+
_workspaceRoot = findWorkspaceRoot();
|
|
30482
|
+
}
|
|
30483
|
+
const configFile = await getDefaultConfig(
|
|
30484
|
+
{
|
|
30485
|
+
...await getConfigFile(_workspaceRoot),
|
|
30486
|
+
...getConfigEnv()
|
|
30487
|
+
},
|
|
30488
|
+
_workspaceRoot
|
|
30489
|
+
);
|
|
30490
|
+
if (configFile) {
|
|
30491
|
+
config = StormConfigSchema.parse(configFile);
|
|
30492
|
+
} else {
|
|
30493
|
+
writeWarning(
|
|
30494
|
+
config,
|
|
30495
|
+
"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."
|
|
30496
|
+
);
|
|
30497
|
+
}
|
|
30498
|
+
setConfigEnv(config);
|
|
30499
|
+
return config;
|
|
30500
|
+
};
|
|
30501
|
+
|
|
30485
30502
|
// packages/workspace-tools/src/utils/get-workspace-root.ts
|
|
30486
30503
|
var import_find_workspace_root2 = require("nx/src/utils/find-workspace-root.js");
|
|
30487
30504
|
var getWorkspaceRoot = () => {
|
|
@@ -30562,7 +30579,7 @@ var withRunGenerator = (name, generatorFn, generatorOptions = {
|
|
|
30562
30579
|
`Loading the Storm Config from environment variables and storm.config.js file...
|
|
30563
30580
|
- workspaceRoot: ${workspaceRoot}`
|
|
30564
30581
|
);
|
|
30565
|
-
config = await
|
|
30582
|
+
config = await loadStormConfig(workspaceRoot);
|
|
30566
30583
|
writeTrace(
|
|
30567
30584
|
config,
|
|
30568
30585
|
`Loaded Storm config into env:
|