@storm-software/workspace-tools 1.73.0 → 1.73.1
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 +12 -0
- package/index.js +148 -90
- package/meta.json +1 -1
- package/package.json +2 -2
- package/src/base/index.js +142 -84
- package/src/executors/rolldown/executor.js +138 -80
- package/src/executors/tsup/executor.js +138 -80
- package/src/executors/tsup-browser/executor.js +138 -80
- package/src/executors/tsup-neutral/executor.js +138 -80
- package/src/executors/tsup-node/executor.js +138 -80
- package/src/executors/typia/executor.js +138 -80
- package/src/executors/unbuild/executor.js +138 -80
- package/src/generators/browser-library/generator.js +138 -80
- package/src/generators/config-schema/generator.js +132 -74
- package/src/generators/neutral-library/generator.js +138 -80
- package/src/generators/node-library/generator.js +138 -80
- package/src/generators/preset/files/.github/workflows/build-release.yml.template +1 -1
- package/src/generators/preset/generator.js +132 -74
- package/src/generators/release-version/generator.js +132 -74
- package/src/utils/index.js +134 -76
|
@@ -46588,8 +46588,8 @@ var require_pax = __commonJS({
|
|
|
46588
46588
|
return len + s2;
|
|
46589
46589
|
}
|
|
46590
46590
|
};
|
|
46591
|
-
Pax.parse = (string, ex, g4) => new Pax(
|
|
46592
|
-
var
|
|
46591
|
+
Pax.parse = (string, ex, g4) => new Pax(merge3(parseKV(string), ex), g4);
|
|
46592
|
+
var merge3 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
|
|
46593
46593
|
var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
|
|
46594
46594
|
var parseKVLine = (set, line) => {
|
|
46595
46595
|
const n = parseInt(line, 10);
|
|
@@ -66808,64 +66808,6 @@ var require_cjs = __commonJS({
|
|
|
66808
66808
|
}
|
|
66809
66809
|
});
|
|
66810
66810
|
|
|
66811
|
-
// packages/config-tools/src/config-file/get-config-file.ts
|
|
66812
|
-
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
66813
|
-
var init_get_config_file = __esm({
|
|
66814
|
-
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
66815
|
-
init_find_workspace_root();
|
|
66816
|
-
init_dist10();
|
|
66817
|
-
import_deepmerge = __toESM(require_cjs());
|
|
66818
|
-
getConfigFileByName = async (fileName, filePath) => {
|
|
66819
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
66820
|
-
return loadConfig({
|
|
66821
|
-
cwd: workspacePath,
|
|
66822
|
-
packageJson: true,
|
|
66823
|
-
name: fileName,
|
|
66824
|
-
envName: fileName?.toUpperCase(),
|
|
66825
|
-
jitiOptions: {
|
|
66826
|
-
debug: true,
|
|
66827
|
-
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
66828
|
-
}
|
|
66829
|
-
});
|
|
66830
|
-
};
|
|
66831
|
-
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
66832
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
66833
|
-
let { config, configFile } = await loadConfig({
|
|
66834
|
-
cwd: workspacePath,
|
|
66835
|
-
name: "storm"
|
|
66836
|
-
});
|
|
66837
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
66838
|
-
const results = await Promise.all(
|
|
66839
|
-
additionalFileNames.map(
|
|
66840
|
-
(fileName) => loadConfig({
|
|
66841
|
-
cwd: workspacePath,
|
|
66842
|
-
name: fileName
|
|
66843
|
-
})
|
|
66844
|
-
)
|
|
66845
|
-
);
|
|
66846
|
-
for (const result of results) {
|
|
66847
|
-
if (result) {
|
|
66848
|
-
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
66849
|
-
}
|
|
66850
|
-
}
|
|
66851
|
-
}
|
|
66852
|
-
if (!config) {
|
|
66853
|
-
return void 0;
|
|
66854
|
-
}
|
|
66855
|
-
config.configFile = configFile;
|
|
66856
|
-
config.runtimeVersion = "0.0.1";
|
|
66857
|
-
return config;
|
|
66858
|
-
};
|
|
66859
|
-
}
|
|
66860
|
-
});
|
|
66861
|
-
|
|
66862
|
-
// packages/config-tools/src/config-file/index.ts
|
|
66863
|
-
var init_config_file = __esm({
|
|
66864
|
-
"packages/config-tools/src/config-file/index.ts"() {
|
|
66865
|
-
init_get_config_file();
|
|
66866
|
-
}
|
|
66867
|
-
});
|
|
66868
|
-
|
|
66869
66811
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
66870
66812
|
function setErrorMap(map) {
|
|
66871
66813
|
overrideErrorMap = map;
|
|
@@ -72513,7 +72455,7 @@ var init_chalk = __esm({
|
|
|
72513
72455
|
});
|
|
72514
72456
|
|
|
72515
72457
|
// packages/config-tools/src/utilities/logger.ts
|
|
72516
|
-
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch;
|
|
72458
|
+
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch, formatLogMessage, _isFunction;
|
|
72517
72459
|
var init_logger = __esm({
|
|
72518
72460
|
"packages/config-tools/src/utilities/logger.ts"() {
|
|
72519
72461
|
init_types2();
|
|
@@ -72532,7 +72474,9 @@ var init_logger = __esm({
|
|
|
72532
72474
|
return (message) => {
|
|
72533
72475
|
console.error(
|
|
72534
72476
|
`
|
|
72535
|
-
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal
|
|
72477
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#b62324").whiteBright(
|
|
72478
|
+
" \u{1F480} Fatal "
|
|
72479
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
72536
72480
|
|
|
72537
72481
|
`
|
|
72538
72482
|
);
|
|
@@ -72542,7 +72486,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBri
|
|
|
72542
72486
|
return (message) => {
|
|
72543
72487
|
console.error(
|
|
72544
72488
|
`
|
|
72545
|
-
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error
|
|
72489
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.error ?? "#f85149").whiteBright(
|
|
72490
|
+
" \u2718 Error "
|
|
72491
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
72546
72492
|
`
|
|
72547
72493
|
);
|
|
72548
72494
|
};
|
|
@@ -72551,7 +72497,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBri
|
|
|
72551
72497
|
return (message) => {
|
|
72552
72498
|
console.warn(
|
|
72553
72499
|
`
|
|
72554
|
-
${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning
|
|
72500
|
+
${_chalk.bold.hex(colors.warning ?? "#e3b341")("> ")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(
|
|
72501
|
+
" \u26A0 Warn "
|
|
72502
|
+
)} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
|
|
72555
72503
|
`
|
|
72556
72504
|
);
|
|
72557
72505
|
};
|
|
@@ -72560,7 +72508,9 @@ ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whi
|
|
|
72560
72508
|
return (message) => {
|
|
72561
72509
|
console.info(
|
|
72562
72510
|
`
|
|
72563
|
-
${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success
|
|
72511
|
+
${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(
|
|
72512
|
+
" \u2713 Success "
|
|
72513
|
+
)} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
|
|
72564
72514
|
`
|
|
72565
72515
|
);
|
|
72566
72516
|
};
|
|
@@ -72569,7 +72519,9 @@ ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whit
|
|
|
72569
72519
|
return (message) => {
|
|
72570
72520
|
console.info(
|
|
72571
72521
|
`
|
|
72572
|
-
${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info
|
|
72522
|
+
${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(
|
|
72523
|
+
" \u2139 Info "
|
|
72524
|
+
)} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
|
|
72573
72525
|
`
|
|
72574
72526
|
);
|
|
72575
72527
|
};
|
|
@@ -72578,7 +72530,9 @@ ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBrigh
|
|
|
72578
72530
|
return (message) => {
|
|
72579
72531
|
console.debug(
|
|
72580
72532
|
`
|
|
72581
|
-
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary
|
|
72533
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
72534
|
+
" \u{1F6E0} Debug "
|
|
72535
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
72582
72536
|
`
|
|
72583
72537
|
);
|
|
72584
72538
|
};
|
|
@@ -72586,7 +72540,9 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
|
|
|
72586
72540
|
return (message) => {
|
|
72587
72541
|
console.log(
|
|
72588
72542
|
`
|
|
72589
|
-
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary
|
|
72543
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
72544
|
+
" \u2709 System "
|
|
72545
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
72590
72546
|
`
|
|
72591
72547
|
);
|
|
72592
72548
|
};
|
|
@@ -72613,6 +72569,19 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
|
|
|
72613
72569
|
);
|
|
72614
72570
|
};
|
|
72615
72571
|
};
|
|
72572
|
+
formatLogMessage = (message, prefix = "-") => {
|
|
72573
|
+
return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
|
|
72574
|
+
(key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
|
|
72575
|
+
${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
|
|
72576
|
+
).join("\n") : message;
|
|
72577
|
+
};
|
|
72578
|
+
_isFunction = (value2) => {
|
|
72579
|
+
try {
|
|
72580
|
+
return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
|
|
72581
|
+
} catch (e2) {
|
|
72582
|
+
return false;
|
|
72583
|
+
}
|
|
72584
|
+
};
|
|
72616
72585
|
}
|
|
72617
72586
|
});
|
|
72618
72587
|
|
|
@@ -72789,6 +72758,94 @@ var init_utilities = __esm({
|
|
|
72789
72758
|
}
|
|
72790
72759
|
});
|
|
72791
72760
|
|
|
72761
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
72762
|
+
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
72763
|
+
var init_get_config_file = __esm({
|
|
72764
|
+
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
72765
|
+
init_find_workspace_root();
|
|
72766
|
+
init_dist10();
|
|
72767
|
+
import_deepmerge = __toESM(require_cjs());
|
|
72768
|
+
init_utilities();
|
|
72769
|
+
getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
72770
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
72771
|
+
let config = loadConfig({
|
|
72772
|
+
cwd: workspacePath,
|
|
72773
|
+
packageJson: true,
|
|
72774
|
+
name: fileName,
|
|
72775
|
+
envName: fileName?.toUpperCase(),
|
|
72776
|
+
jitiOptions: {
|
|
72777
|
+
debug: true,
|
|
72778
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
72779
|
+
},
|
|
72780
|
+
...options
|
|
72781
|
+
});
|
|
72782
|
+
if (!config || Object.keys(config).length === 0) {
|
|
72783
|
+
config = loadConfig({
|
|
72784
|
+
cwd: workspacePath,
|
|
72785
|
+
packageJson: true,
|
|
72786
|
+
name: fileName,
|
|
72787
|
+
envName: fileName?.toUpperCase(),
|
|
72788
|
+
jitiOptions: {
|
|
72789
|
+
debug: true,
|
|
72790
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
72791
|
+
},
|
|
72792
|
+
configFile: fileName,
|
|
72793
|
+
...options
|
|
72794
|
+
});
|
|
72795
|
+
}
|
|
72796
|
+
return config;
|
|
72797
|
+
};
|
|
72798
|
+
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
72799
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
72800
|
+
let { config, configFile } = await getConfigFileByName(
|
|
72801
|
+
"storm",
|
|
72802
|
+
workspacePath
|
|
72803
|
+
);
|
|
72804
|
+
if (config && Object.keys(config).length > 0) {
|
|
72805
|
+
writeTrace(
|
|
72806
|
+
`Found Storm configuration file "${configFile}" at "${workspacePath}"`,
|
|
72807
|
+
{
|
|
72808
|
+
logLevel: "all"
|
|
72809
|
+
}
|
|
72810
|
+
);
|
|
72811
|
+
writeTrace(config, { logLevel: "all" });
|
|
72812
|
+
}
|
|
72813
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
72814
|
+
const results = await Promise.all(
|
|
72815
|
+
additionalFileNames.map(
|
|
72816
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
72817
|
+
)
|
|
72818
|
+
);
|
|
72819
|
+
for (const result of results) {
|
|
72820
|
+
if (result?.config && Object.keys(result.config).length > 0) {
|
|
72821
|
+
writeTrace(
|
|
72822
|
+
`Found additional configuration file "${result.configFile}" at "${workspacePath}"`,
|
|
72823
|
+
{
|
|
72824
|
+
logLevel: "all"
|
|
72825
|
+
}
|
|
72826
|
+
);
|
|
72827
|
+
writeTrace(result.config, { logLevel: "all" });
|
|
72828
|
+
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
72829
|
+
}
|
|
72830
|
+
}
|
|
72831
|
+
}
|
|
72832
|
+
if (!config) {
|
|
72833
|
+
return void 0;
|
|
72834
|
+
}
|
|
72835
|
+
config.configFile = configFile;
|
|
72836
|
+
config.runtimeVersion = "0.0.1";
|
|
72837
|
+
return config;
|
|
72838
|
+
};
|
|
72839
|
+
}
|
|
72840
|
+
});
|
|
72841
|
+
|
|
72842
|
+
// packages/config-tools/src/config-file/index.ts
|
|
72843
|
+
var init_config_file = __esm({
|
|
72844
|
+
"packages/config-tools/src/config-file/index.ts"() {
|
|
72845
|
+
init_get_config_file();
|
|
72846
|
+
}
|
|
72847
|
+
});
|
|
72848
|
+
|
|
72792
72849
|
// packages/config-tools/src/env/get-env.ts
|
|
72793
72850
|
var getExtensionEnv, getConfigEnv, getThemeColorConfigEnv, getSingleThemeColorConfigEnv, getMultiThemeColorConfigEnv, getBaseThemeColorConfigEnv;
|
|
72794
72851
|
var init_get_env = __esm({
|
|
@@ -73150,7 +73207,7 @@ var init_set_env = __esm({
|
|
|
73150
73207
|
});
|
|
73151
73208
|
|
|
73152
73209
|
// packages/config-tools/src/create-storm-config.ts
|
|
73153
|
-
var _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
73210
|
+
var import_deepmerge2, _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
73154
73211
|
var init_create_storm_config = __esm({
|
|
73155
73212
|
"packages/config-tools/src/create-storm-config.ts"() {
|
|
73156
73213
|
init_get_config_file();
|
|
@@ -73159,6 +73216,7 @@ var init_create_storm_config = __esm({
|
|
|
73159
73216
|
init_schema();
|
|
73160
73217
|
init_utilities();
|
|
73161
73218
|
init_get_default_config();
|
|
73219
|
+
import_deepmerge2 = __toESM(require_cjs());
|
|
73162
73220
|
_extension_cache = /* @__PURE__ */ new WeakMap();
|
|
73163
73221
|
_static_cache = void 0;
|
|
73164
73222
|
createConfig = (workspaceRoot) => {
|
|
@@ -73207,7 +73265,9 @@ var init_create_storm_config = __esm({
|
|
|
73207
73265
|
if (!_workspaceRoot) {
|
|
73208
73266
|
_workspaceRoot = findWorkspaceRoot();
|
|
73209
73267
|
}
|
|
73210
|
-
|
|
73268
|
+
let configFile = await getConfigFile(
|
|
73269
|
+
_workspaceRoot
|
|
73270
|
+
);
|
|
73211
73271
|
if (!configFile) {
|
|
73212
73272
|
writeWarning(
|
|
73213
73273
|
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n",
|
|
@@ -73216,10 +73276,7 @@ var init_create_storm_config = __esm({
|
|
|
73216
73276
|
}
|
|
73217
73277
|
config = StormConfigSchema.parse(
|
|
73218
73278
|
await getDefaultConfig(
|
|
73219
|
-
{
|
|
73220
|
-
...getConfigEnv(),
|
|
73221
|
-
...configFile
|
|
73222
|
-
},
|
|
73279
|
+
(0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
|
|
73223
73280
|
_workspaceRoot
|
|
73224
73281
|
)
|
|
73225
73282
|
);
|
|
@@ -73257,6 +73314,7 @@ __export(src_exports, {
|
|
|
73257
73314
|
findFileName: () => findFileName,
|
|
73258
73315
|
findWorkspaceRoot: () => findWorkspaceRoot,
|
|
73259
73316
|
findWorkspaceRootSafe: () => findWorkspaceRootSafe,
|
|
73317
|
+
formatLogMessage: () => formatLogMessage,
|
|
73260
73318
|
getChalk: () => getChalk,
|
|
73261
73319
|
getConfigEnv: () => getConfigEnv,
|
|
73262
73320
|
getConfigFile: () => getConfigFile,
|
|
@@ -49131,8 +49131,8 @@ var require_pax = __commonJS({
|
|
|
49131
49131
|
return len + s2;
|
|
49132
49132
|
}
|
|
49133
49133
|
};
|
|
49134
|
-
Pax.parse = (string, ex, g4) => new Pax(
|
|
49135
|
-
var
|
|
49134
|
+
Pax.parse = (string, ex, g4) => new Pax(merge3(parseKV(string), ex), g4);
|
|
49135
|
+
var merge3 = (a2, b6) => b6 ? Object.keys(a2).reduce((s2, k4) => (s2[k4] = a2[k4], s2), b6) : a2;
|
|
49136
49136
|
var parseKV = (string) => string.replace(/\n$/, "").split("\n").reduce(parseKVLine, /* @__PURE__ */ Object.create(null));
|
|
49137
49137
|
var parseKVLine = (set2, line) => {
|
|
49138
49138
|
const n = parseInt(line, 10);
|
|
@@ -68968,64 +68968,6 @@ var require_cjs = __commonJS({
|
|
|
68968
68968
|
}
|
|
68969
68969
|
});
|
|
68970
68970
|
|
|
68971
|
-
// packages/config-tools/src/config-file/get-config-file.ts
|
|
68972
|
-
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
68973
|
-
var init_get_config_file = __esm({
|
|
68974
|
-
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
68975
|
-
init_find_workspace_root();
|
|
68976
|
-
init_dist10();
|
|
68977
|
-
import_deepmerge = __toESM(require_cjs());
|
|
68978
|
-
getConfigFileByName = async (fileName, filePath) => {
|
|
68979
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
68980
|
-
return loadConfig({
|
|
68981
|
-
cwd: workspacePath,
|
|
68982
|
-
packageJson: true,
|
|
68983
|
-
name: fileName,
|
|
68984
|
-
envName: fileName?.toUpperCase(),
|
|
68985
|
-
jitiOptions: {
|
|
68986
|
-
debug: true,
|
|
68987
|
-
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
68988
|
-
}
|
|
68989
|
-
});
|
|
68990
|
-
};
|
|
68991
|
-
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
68992
|
-
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
68993
|
-
let { config, configFile } = await loadConfig({
|
|
68994
|
-
cwd: workspacePath,
|
|
68995
|
-
name: "storm"
|
|
68996
|
-
});
|
|
68997
|
-
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
68998
|
-
const results = await Promise.all(
|
|
68999
|
-
additionalFileNames.map(
|
|
69000
|
-
(fileName) => loadConfig({
|
|
69001
|
-
cwd: workspacePath,
|
|
69002
|
-
name: fileName
|
|
69003
|
-
})
|
|
69004
|
-
)
|
|
69005
|
-
);
|
|
69006
|
-
for (const result of results) {
|
|
69007
|
-
if (result) {
|
|
69008
|
-
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
69009
|
-
}
|
|
69010
|
-
}
|
|
69011
|
-
}
|
|
69012
|
-
if (!config) {
|
|
69013
|
-
return void 0;
|
|
69014
|
-
}
|
|
69015
|
-
config.configFile = configFile;
|
|
69016
|
-
config.runtimeVersion = "0.0.1";
|
|
69017
|
-
return config;
|
|
69018
|
-
};
|
|
69019
|
-
}
|
|
69020
|
-
});
|
|
69021
|
-
|
|
69022
|
-
// packages/config-tools/src/config-file/index.ts
|
|
69023
|
-
var init_config_file = __esm({
|
|
69024
|
-
"packages/config-tools/src/config-file/index.ts"() {
|
|
69025
|
-
init_get_config_file();
|
|
69026
|
-
}
|
|
69027
|
-
});
|
|
69028
|
-
|
|
69029
68971
|
// node_modules/.pnpm/zod@3.22.4/node_modules/zod/lib/index.mjs
|
|
69030
68972
|
function setErrorMap(map) {
|
|
69031
68973
|
overrideErrorMap = map;
|
|
@@ -74673,7 +74615,7 @@ var init_chalk = __esm({
|
|
|
74673
74615
|
});
|
|
74674
74616
|
|
|
74675
74617
|
// packages/config-tools/src/utilities/logger.ts
|
|
74676
|
-
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch;
|
|
74618
|
+
var getLogFn, writeFatal, writeError, writeWarning, writeInfo, writeSuccess, writeDebug, writeTrace, writeSystem, getStopwatch, formatLogMessage, _isFunction;
|
|
74677
74619
|
var init_logger = __esm({
|
|
74678
74620
|
"packages/config-tools/src/utilities/logger.ts"() {
|
|
74679
74621
|
init_types2();
|
|
@@ -74692,7 +74634,9 @@ var init_logger = __esm({
|
|
|
74692
74634
|
return (message) => {
|
|
74693
74635
|
console.error(
|
|
74694
74636
|
`
|
|
74695
|
-
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal
|
|
74637
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.fatal ?? "#b62324").whiteBright(
|
|
74638
|
+
" \u{1F480} Fatal "
|
|
74639
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
74696
74640
|
|
|
74697
74641
|
`
|
|
74698
74642
|
);
|
|
@@ -74702,7 +74646,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.fatal).whiteBri
|
|
|
74702
74646
|
return (message) => {
|
|
74703
74647
|
console.error(
|
|
74704
74648
|
`
|
|
74705
|
-
${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error
|
|
74649
|
+
${_chalk.bold.hex(colors.error ?? "#f85149")(">")} ${_chalk.bold.bgHex(colors.error ?? "#f85149").whiteBright(
|
|
74650
|
+
" \u2718 Error "
|
|
74651
|
+
)} ${_chalk.hex(colors.error ?? "#f85149")(formatLogMessage(message))}
|
|
74706
74652
|
`
|
|
74707
74653
|
);
|
|
74708
74654
|
};
|
|
@@ -74711,7 +74657,9 @@ ${_chalk.bold.hex(colors.error)(">")} ${_chalk.bold.bgHex(colors.error).whiteBri
|
|
|
74711
74657
|
return (message) => {
|
|
74712
74658
|
console.warn(
|
|
74713
74659
|
`
|
|
74714
|
-
${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning
|
|
74660
|
+
${_chalk.bold.hex(colors.warning ?? "#e3b341")("> ")} ${_chalk.bold.bgHex(colors.warning ?? "#e3b341").whiteBright(
|
|
74661
|
+
" \u26A0 Warn "
|
|
74662
|
+
)} ${_chalk.hex(colors.warning ?? "#e3b341")(formatLogMessage(message))}
|
|
74715
74663
|
`
|
|
74716
74664
|
);
|
|
74717
74665
|
};
|
|
@@ -74720,7 +74668,9 @@ ${_chalk.bold.hex(colors.warning)("> ")} ${_chalk.bold.bgHex(colors.warning).whi
|
|
|
74720
74668
|
return (message) => {
|
|
74721
74669
|
console.info(
|
|
74722
74670
|
`
|
|
74723
|
-
${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success
|
|
74671
|
+
${_chalk.bold.hex(colors.success ?? "#56d364")(">")} ${_chalk.bold.bgHex(colors.success ?? "#56d364").whiteBright(
|
|
74672
|
+
" \u2713 Success "
|
|
74673
|
+
)} ${_chalk.hex(colors.success ?? "#56d364")(formatLogMessage(message))}
|
|
74724
74674
|
`
|
|
74725
74675
|
);
|
|
74726
74676
|
};
|
|
@@ -74729,7 +74679,9 @@ ${_chalk.bold.hex(colors.success)(">")} ${_chalk.bold.bgHex(colors.success).whit
|
|
|
74729
74679
|
return (message) => {
|
|
74730
74680
|
console.info(
|
|
74731
74681
|
`
|
|
74732
|
-
${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info
|
|
74682
|
+
${_chalk.bold.hex(colors.info ?? "#58a6ff")(">")} ${_chalk.bold.bgHex(colors.info ?? "#58a6ff").whiteBright(
|
|
74683
|
+
" \u2139 Info "
|
|
74684
|
+
)} ${_chalk.hex(colors.info ?? "#58a6ff")(formatLogMessage(message))}
|
|
74733
74685
|
`
|
|
74734
74686
|
);
|
|
74735
74687
|
};
|
|
@@ -74738,7 +74690,9 @@ ${_chalk.bold.hex(colors.info)(">")} ${_chalk.bold.bgHex(colors.info).whiteBrigh
|
|
|
74738
74690
|
return (message) => {
|
|
74739
74691
|
console.debug(
|
|
74740
74692
|
`
|
|
74741
|
-
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary
|
|
74693
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
74694
|
+
" \u{1F6E0} Debug "
|
|
74695
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
74742
74696
|
`
|
|
74743
74697
|
);
|
|
74744
74698
|
};
|
|
@@ -74746,7 +74700,9 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
|
|
|
74746
74700
|
return (message) => {
|
|
74747
74701
|
console.log(
|
|
74748
74702
|
`
|
|
74749
|
-
${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary
|
|
74703
|
+
${_chalk.bold.hex(colors.primary ?? "#1fb2a6")(">")} ${_chalk.bold.bgHex(colors.primary ?? "#1fb2a6").whiteBright(
|
|
74704
|
+
" \u2709 System "
|
|
74705
|
+
)} ${_chalk.hex(colors.primary ?? "#1fb2a6")(formatLogMessage(message))}
|
|
74750
74706
|
`
|
|
74751
74707
|
);
|
|
74752
74708
|
};
|
|
@@ -74773,6 +74729,19 @@ ${_chalk.bold.hex(colors.primary)(">")} ${_chalk.bold.bgHex(colors.primary).whit
|
|
|
74773
74729
|
);
|
|
74774
74730
|
};
|
|
74775
74731
|
};
|
|
74732
|
+
formatLogMessage = (message, prefix = "-") => {
|
|
74733
|
+
return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
|
|
74734
|
+
(key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
|
|
74735
|
+
${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
|
|
74736
|
+
).join("\n") : message;
|
|
74737
|
+
};
|
|
74738
|
+
_isFunction = (value2) => {
|
|
74739
|
+
try {
|
|
74740
|
+
return value2 instanceof Function || typeof value2 === "function" || !!(value2?.constructor && value2?.call && value2?.apply);
|
|
74741
|
+
} catch (e2) {
|
|
74742
|
+
return false;
|
|
74743
|
+
}
|
|
74744
|
+
};
|
|
74776
74745
|
}
|
|
74777
74746
|
});
|
|
74778
74747
|
|
|
@@ -74949,6 +74918,94 @@ var init_utilities = __esm({
|
|
|
74949
74918
|
}
|
|
74950
74919
|
});
|
|
74951
74920
|
|
|
74921
|
+
// packages/config-tools/src/config-file/get-config-file.ts
|
|
74922
|
+
var import_deepmerge, getConfigFileByName, getConfigFile;
|
|
74923
|
+
var init_get_config_file = __esm({
|
|
74924
|
+
"packages/config-tools/src/config-file/get-config-file.ts"() {
|
|
74925
|
+
init_find_workspace_root();
|
|
74926
|
+
init_dist10();
|
|
74927
|
+
import_deepmerge = __toESM(require_cjs());
|
|
74928
|
+
init_utilities();
|
|
74929
|
+
getConfigFileByName = async (fileName, filePath, options = {}) => {
|
|
74930
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
74931
|
+
let config = loadConfig({
|
|
74932
|
+
cwd: workspacePath,
|
|
74933
|
+
packageJson: true,
|
|
74934
|
+
name: fileName,
|
|
74935
|
+
envName: fileName?.toUpperCase(),
|
|
74936
|
+
jitiOptions: {
|
|
74937
|
+
debug: true,
|
|
74938
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
74939
|
+
},
|
|
74940
|
+
...options
|
|
74941
|
+
});
|
|
74942
|
+
if (!config || Object.keys(config).length === 0) {
|
|
74943
|
+
config = loadConfig({
|
|
74944
|
+
cwd: workspacePath,
|
|
74945
|
+
packageJson: true,
|
|
74946
|
+
name: fileName,
|
|
74947
|
+
envName: fileName?.toUpperCase(),
|
|
74948
|
+
jitiOptions: {
|
|
74949
|
+
debug: true,
|
|
74950
|
+
cache: process.env.STORM_CACHE ? process.env.STORM_CACHE_DIRECTORY : false
|
|
74951
|
+
},
|
|
74952
|
+
configFile: fileName,
|
|
74953
|
+
...options
|
|
74954
|
+
});
|
|
74955
|
+
}
|
|
74956
|
+
return config;
|
|
74957
|
+
};
|
|
74958
|
+
getConfigFile = async (filePath, additionalFileNames = []) => {
|
|
74959
|
+
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
74960
|
+
let { config, configFile } = await getConfigFileByName(
|
|
74961
|
+
"storm",
|
|
74962
|
+
workspacePath
|
|
74963
|
+
);
|
|
74964
|
+
if (config && Object.keys(config).length > 0) {
|
|
74965
|
+
writeTrace(
|
|
74966
|
+
`Found Storm configuration file "${configFile}" at "${workspacePath}"`,
|
|
74967
|
+
{
|
|
74968
|
+
logLevel: "all"
|
|
74969
|
+
}
|
|
74970
|
+
);
|
|
74971
|
+
writeTrace(config, { logLevel: "all" });
|
|
74972
|
+
}
|
|
74973
|
+
if (additionalFileNames && additionalFileNames.length > 0) {
|
|
74974
|
+
const results = await Promise.all(
|
|
74975
|
+
additionalFileNames.map(
|
|
74976
|
+
(fileName) => getConfigFileByName(fileName, workspacePath)
|
|
74977
|
+
)
|
|
74978
|
+
);
|
|
74979
|
+
for (const result of results) {
|
|
74980
|
+
if (result?.config && Object.keys(result.config).length > 0) {
|
|
74981
|
+
writeTrace(
|
|
74982
|
+
`Found additional configuration file "${result.configFile}" at "${workspacePath}"`,
|
|
74983
|
+
{
|
|
74984
|
+
logLevel: "all"
|
|
74985
|
+
}
|
|
74986
|
+
);
|
|
74987
|
+
writeTrace(result.config, { logLevel: "all" });
|
|
74988
|
+
config = (0, import_deepmerge.default)(config ?? {}, result.config ?? {});
|
|
74989
|
+
}
|
|
74990
|
+
}
|
|
74991
|
+
}
|
|
74992
|
+
if (!config) {
|
|
74993
|
+
return void 0;
|
|
74994
|
+
}
|
|
74995
|
+
config.configFile = configFile;
|
|
74996
|
+
config.runtimeVersion = "0.0.1";
|
|
74997
|
+
return config;
|
|
74998
|
+
};
|
|
74999
|
+
}
|
|
75000
|
+
});
|
|
75001
|
+
|
|
75002
|
+
// packages/config-tools/src/config-file/index.ts
|
|
75003
|
+
var init_config_file = __esm({
|
|
75004
|
+
"packages/config-tools/src/config-file/index.ts"() {
|
|
75005
|
+
init_get_config_file();
|
|
75006
|
+
}
|
|
75007
|
+
});
|
|
75008
|
+
|
|
74952
75009
|
// packages/config-tools/src/env/get-env.ts
|
|
74953
75010
|
var getExtensionEnv, getConfigEnv, getThemeColorConfigEnv, getSingleThemeColorConfigEnv, getMultiThemeColorConfigEnv, getBaseThemeColorConfigEnv;
|
|
74954
75011
|
var init_get_env = __esm({
|
|
@@ -75310,7 +75367,7 @@ var init_set_env = __esm({
|
|
|
75310
75367
|
});
|
|
75311
75368
|
|
|
75312
75369
|
// packages/config-tools/src/create-storm-config.ts
|
|
75313
|
-
var _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
75370
|
+
var import_deepmerge2, _extension_cache, _static_cache, createConfig, createStormConfig, createConfigExtension, loadStormConfig;
|
|
75314
75371
|
var init_create_storm_config = __esm({
|
|
75315
75372
|
"packages/config-tools/src/create-storm-config.ts"() {
|
|
75316
75373
|
init_get_config_file();
|
|
@@ -75319,6 +75376,7 @@ var init_create_storm_config = __esm({
|
|
|
75319
75376
|
init_schema();
|
|
75320
75377
|
init_utilities();
|
|
75321
75378
|
init_get_default_config();
|
|
75379
|
+
import_deepmerge2 = __toESM(require_cjs());
|
|
75322
75380
|
_extension_cache = /* @__PURE__ */ new WeakMap();
|
|
75323
75381
|
_static_cache = void 0;
|
|
75324
75382
|
createConfig = (workspaceRoot) => {
|
|
@@ -75367,7 +75425,9 @@ var init_create_storm_config = __esm({
|
|
|
75367
75425
|
if (!_workspaceRoot) {
|
|
75368
75426
|
_workspaceRoot = findWorkspaceRoot();
|
|
75369
75427
|
}
|
|
75370
|
-
|
|
75428
|
+
let configFile = await getConfigFile(
|
|
75429
|
+
_workspaceRoot
|
|
75430
|
+
);
|
|
75371
75431
|
if (!configFile) {
|
|
75372
75432
|
writeWarning(
|
|
75373
75433
|
"No Storm config file found in the current workspace. Please ensure this is the expected behavior - you can add a `storm.json` file to the root of your workspace if it is not.\n",
|
|
@@ -75376,10 +75436,7 @@ var init_create_storm_config = __esm({
|
|
|
75376
75436
|
}
|
|
75377
75437
|
config = StormConfigSchema.parse(
|
|
75378
75438
|
await getDefaultConfig(
|
|
75379
|
-
{
|
|
75380
|
-
...getConfigEnv(),
|
|
75381
|
-
...configFile
|
|
75382
|
-
},
|
|
75439
|
+
(0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
|
|
75383
75440
|
_workspaceRoot
|
|
75384
75441
|
)
|
|
75385
75442
|
);
|
|
@@ -75417,6 +75474,7 @@ __export(src_exports, {
|
|
|
75417
75474
|
findFileName: () => findFileName,
|
|
75418
75475
|
findWorkspaceRoot: () => findWorkspaceRoot,
|
|
75419
75476
|
findWorkspaceRootSafe: () => findWorkspaceRootSafe,
|
|
75477
|
+
formatLogMessage: () => formatLogMessage,
|
|
75420
75478
|
getChalk: () => getChalk,
|
|
75421
75479
|
getConfigEnv: () => getConfigEnv,
|
|
75422
75480
|
getConfigFile: () => getConfigFile,
|