@storm-software/projen 0.9.35 → 0.9.36
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 +8 -0
- package/dist/{chunk-RL7Z5H6Y.js → chunk-IHAOUZID.js} +57 -53
- package/dist/{chunk-G4SMJQNI.mjs → chunk-QHXRKXW6.mjs} +17 -13
- package/dist/generators.d.mts +1 -1
- package/dist/generators.d.ts +1 -1
- package/dist/generators.js +2 -2
- package/dist/generators.mjs +1 -1
- package/dist/{index-Dx_XVEzo.d.mts → index-7riJfK5Q.d.mts} +21 -5
- package/dist/{index-Dx_XVEzo.d.ts → index-7riJfK5Q.d.ts} +21 -5
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -3
- package/dist/index.mjs +1 -1
- package/dist/src/components/nx-workspace.js +10 -10
- package/dist/src/components/nx-workspace.mjs +10 -10
- package/dist/src/generators/init/generator.d.mts +1 -1
- package/dist/src/generators/init/generator.d.ts +1 -1
- package/dist/src/generators/init/generator.js +2 -2
- package/dist/src/generators/init/generator.mjs +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
# Changelog for Storm Ops - Projen
|
|
4
4
|
|
|
5
|
+
## [0.9.36](https://github.com/storm-software/storm-ops/releases/tag/projen%400.9.36) (2025-04-02)
|
|
6
|
+
|
|
7
|
+
### Miscellaneous
|
|
8
|
+
|
|
9
|
+
- **projen:** Update all references to `StormConfig` to point to
|
|
10
|
+
`StormWorkspaceConfig`
|
|
11
|
+
([7f316214f](https://github.com/storm-software/storm-ops/commit/7f316214f))
|
|
12
|
+
|
|
5
13
|
## [0.9.35](https://github.com/storm-software/storm-ops/releases/tag/projen%400.9.35) (2025-03-18)
|
|
6
14
|
|
|
7
15
|
### Miscellaneous
|
|
@@ -199,7 +199,7 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
199
199
|
log: _zod2.default.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
200
200
|
build: _zod2.default.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
201
201
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
202
|
-
var
|
|
202
|
+
var stormWorkspaceConfigSchema = _zod2.default.object({
|
|
203
203
|
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
204
204
|
extends: ExtendsSchema.optional(),
|
|
205
205
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
@@ -1251,7 +1251,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(vo
|
|
|
1251
1251
|
// ../config-tools/src/create-storm-config.ts
|
|
1252
1252
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
1253
1253
|
var _static_cache = void 0;
|
|
1254
|
-
var
|
|
1254
|
+
var createStormWorkspaceConfig = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, async (extensionName, schema, workspaceRoot3, skipLogs = false) => {
|
|
1255
1255
|
let result;
|
|
1256
1256
|
if (!_optionalChain([_static_cache, 'optionalAccess', _57 => _57.data]) || !_optionalChain([_static_cache, 'optionalAccess', _58 => _58.timestamp]) || _static_cache.timestamp < Date.now() - 8e3) {
|
|
1257
1257
|
let _workspaceRoot = workspaceRoot3;
|
|
@@ -1266,7 +1266,7 @@ var createStormConfig = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, asy
|
|
|
1266
1266
|
logLevel: "all"
|
|
1267
1267
|
});
|
|
1268
1268
|
}
|
|
1269
|
-
result = await
|
|
1269
|
+
result = await stormWorkspaceConfigSchema.parseAsync(_defu2.default.call(void 0, configEnv, configFile, defaultConfig));
|
|
1270
1270
|
result.workspaceRoot ??= _workspaceRoot;
|
|
1271
1271
|
} else {
|
|
1272
1272
|
result = _static_cache.data;
|
|
@@ -1282,7 +1282,7 @@ var createStormConfig = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, asy
|
|
|
1282
1282
|
data: result
|
|
1283
1283
|
};
|
|
1284
1284
|
return result;
|
|
1285
|
-
}, "
|
|
1285
|
+
}, "createStormWorkspaceConfig");
|
|
1286
1286
|
var createConfigExtension = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (extensionName, schema) => {
|
|
1287
1287
|
const extension_cache_key = {
|
|
1288
1288
|
extensionName
|
|
@@ -1297,20 +1297,20 @@ var createConfigExtension = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0,
|
|
|
1297
1297
|
_extension_cache.set(extension_cache_key, extension);
|
|
1298
1298
|
return extension;
|
|
1299
1299
|
}, "createConfigExtension");
|
|
1300
|
-
var
|
|
1301
|
-
const config = await
|
|
1300
|
+
var loadStormWorkspaceConfig = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, async (workspaceRoot3, skipLogs = false) => {
|
|
1301
|
+
const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs);
|
|
1302
1302
|
setConfigEnv(config);
|
|
1303
1303
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
1304
1304
|
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1305
1305
|
${formatLogMessage(config)}`, config);
|
|
1306
1306
|
}
|
|
1307
1307
|
return config;
|
|
1308
|
-
}, "
|
|
1308
|
+
}, "loadStormWorkspaceConfig");
|
|
1309
1309
|
|
|
1310
1310
|
// ../config-tools/src/get-config.ts
|
|
1311
1311
|
_chunkWTMG7MTKjs.init_cjs_shims.call(void 0, );
|
|
1312
1312
|
var getConfig = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (workspaceRoot3, skipLogs = false) => {
|
|
1313
|
-
return
|
|
1313
|
+
return loadStormWorkspaceConfig(workspaceRoot3, skipLogs);
|
|
1314
1314
|
}, "getConfig");
|
|
1315
1315
|
|
|
1316
1316
|
// ../workspace-tools/src/base/base-executor.ts
|
|
@@ -1800,13 +1800,13 @@ var addPackageDependencies = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0
|
|
|
1800
1800
|
return ret;
|
|
1801
1801
|
}, [])]);
|
|
1802
1802
|
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
1803
|
-
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _98 => _98.includes, 'call', _99 => _99(localPackage.name)])) {
|
|
1804
|
-
ret[localPackage.name] =
|
|
1803
|
+
if (!ret[localPackage.name] && !_optionalChain([implicitDependencies, 'optionalAccess', _98 => _98.includes, 'call', _99 => _99(localPackage.name)]) && _optionalChain([packageJson, 'access', _100 => _100.devDependencies, 'optionalAccess', _101 => _101[localPackage.name]]) === void 0) {
|
|
1804
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
1805
1805
|
}
|
|
1806
1806
|
return ret;
|
|
1807
1807
|
}, _nullishCoalesce(packageJson.dependencies, () => ( {})));
|
|
1808
1808
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
1809
|
-
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess',
|
|
1809
|
+
if (!ret[localPackage.name] && _optionalChain([implicitDependencies, 'optionalAccess', _102 => _102.includes, 'call', _103 => _103(localPackage.name)]) && _optionalChain([packageJson, 'access', _104 => _104.dependencies, 'optionalAccess', _105 => _105[localPackage.name]]) === void 0) {
|
|
1810
1810
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
1811
1811
|
}
|
|
1812
1812
|
return ret;
|
|
@@ -1900,7 +1900,11 @@ var getEntryPoints = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, async
|
|
|
1900
1900
|
return ret;
|
|
1901
1901
|
}, []));
|
|
1902
1902
|
} else {
|
|
1903
|
-
|
|
1903
|
+
const result = _chunk3DQG66DJjs.correctPaths.call(void 0, entryPoint.replaceAll(_chunk3DQG66DJjs.correctPaths.call(void 0, workspaceRoot3), "").replaceAll(_chunk3DQG66DJjs.correctPaths.call(void 0, projectRoot), ""));
|
|
1904
|
+
writeDebug(`Trying to add entry point ${result}"`, config);
|
|
1905
|
+
if (!paths.includes(result)) {
|
|
1906
|
+
paths.push(result);
|
|
1907
|
+
}
|
|
1904
1908
|
}
|
|
1905
1909
|
return paths;
|
|
1906
1910
|
}));
|
|
@@ -2026,15 +2030,15 @@ var RendererEngine = class {
|
|
|
2026
2030
|
if (!relativePath.startsWith("\\\\?\\")) {
|
|
2027
2031
|
relativePath = relativePath.replace(/\\/g, "/");
|
|
2028
2032
|
}
|
|
2029
|
-
const meta = _optionalChain([metafile, 'optionalAccess',
|
|
2033
|
+
const meta = _optionalChain([metafile, 'optionalAccess', _106 => _106.outputs, 'access', _107 => _107[relativePath]]);
|
|
2030
2034
|
return {
|
|
2031
2035
|
type: "chunk",
|
|
2032
2036
|
path: file.path,
|
|
2033
2037
|
code: file.text,
|
|
2034
|
-
map: _optionalChain([outputFiles, 'access',
|
|
2035
|
-
entryPoint: _optionalChain([meta, 'optionalAccess',
|
|
2036
|
-
exports: _optionalChain([meta, 'optionalAccess',
|
|
2037
|
-
imports: _optionalChain([meta, 'optionalAccess',
|
|
2038
|
+
map: _optionalChain([outputFiles, 'access', _108 => _108.find, 'call', _109 => _109((f) => f.path === `${file.path}.map`), 'optionalAccess', _110 => _110.text]),
|
|
2039
|
+
entryPoint: _optionalChain([meta, 'optionalAccess', _111 => _111.entryPoint]),
|
|
2040
|
+
exports: _optionalChain([meta, 'optionalAccess', _112 => _112.exports]),
|
|
2041
|
+
imports: _optionalChain([meta, 'optionalAccess', _113 => _113.imports])
|
|
2038
2042
|
};
|
|
2039
2043
|
} else {
|
|
2040
2044
|
return {
|
|
@@ -2122,7 +2126,7 @@ var esmSplitCodeToCjsPlugin = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void
|
|
|
2122
2126
|
name: "storm:esm-split-code-to-cjs",
|
|
2123
2127
|
setup(build4) {
|
|
2124
2128
|
build4.onEnd(async (result) => {
|
|
2125
|
-
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access',
|
|
2129
|
+
const outFiles = Object.keys(_nullishCoalesce(_optionalChain([result, 'access', _114 => _114.metafile, 'optionalAccess', _115 => _115.outputs]), () => ( {})));
|
|
2126
2130
|
const jsFiles = outFiles.filter((f) => f.endsWith("js"));
|
|
2127
2131
|
await esbuild.build({
|
|
2128
2132
|
outdir: resolvedOptions.outdir,
|
|
@@ -2249,7 +2253,7 @@ ${result.errors.map((error) => error.text).join("\n")}
|
|
|
2249
2253
|
_chunkWTMG7MTKjs.init_cjs_shims.call(void 0, );
|
|
2250
2254
|
|
|
2251
2255
|
function resolvePathsConfig(options, cwd) {
|
|
2252
|
-
if (_optionalChain([options, 'optionalAccess',
|
|
2256
|
+
if (_optionalChain([options, 'optionalAccess', _116 => _116.compilerOptions, 'optionalAccess', _117 => _117.paths])) {
|
|
2253
2257
|
const paths = Object.entries(options.compilerOptions.paths);
|
|
2254
2258
|
const resolvedPaths = paths.map(([key, paths2]) => {
|
|
2255
2259
|
return [
|
|
@@ -2277,7 +2281,7 @@ var resolvePathsPlugin = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (o
|
|
|
2277
2281
|
build4.onResolve({
|
|
2278
2282
|
filter: packagesRegex
|
|
2279
2283
|
}, (args) => {
|
|
2280
|
-
if (_optionalChain([build4, 'access',
|
|
2284
|
+
if (_optionalChain([build4, 'access', _118 => _118.initialOptions, 'access', _119 => _119.external, 'optionalAccess', _120 => _120.includes, 'call', _121 => _121(args.path)])) {
|
|
2281
2285
|
return {
|
|
2282
2286
|
path: args.path,
|
|
2283
2287
|
external: true
|
|
@@ -2387,7 +2391,7 @@ var tscPlugin = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (options, r
|
|
|
2387
2391
|
function getTypeDependencyPackageName(npmPackage) {
|
|
2388
2392
|
if (npmPackage.startsWith("@")) {
|
|
2389
2393
|
const [scope, name] = npmPackage.split("/");
|
|
2390
|
-
return `@types/${_optionalChain([scope, 'optionalAccess',
|
|
2394
|
+
return `@types/${_optionalChain([scope, 'optionalAccess', _122 => _122.slice, 'call', _123 => _123(1)])}__${name}`;
|
|
2391
2395
|
}
|
|
2392
2396
|
return `@types/${npmPackage}`;
|
|
2393
2397
|
}
|
|
@@ -2606,7 +2610,7 @@ function pipeSync(fn, ...fns) {
|
|
|
2606
2610
|
return (...args) => {
|
|
2607
2611
|
let result = fn(...args);
|
|
2608
2612
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
2609
|
-
result = _optionalChain([fns, 'access',
|
|
2613
|
+
result = _optionalChain([fns, 'access', _124 => _124[i], 'optionalCall', _125 => _125(result)]);
|
|
2610
2614
|
}
|
|
2611
2615
|
return result;
|
|
2612
2616
|
};
|
|
@@ -2616,7 +2620,7 @@ function pipeAsync(fn, ...fns) {
|
|
|
2616
2620
|
return async (...args) => {
|
|
2617
2621
|
let result = await fn(...args);
|
|
2618
2622
|
for (let i = 0; result !== skip && i < fns.length; ++i) {
|
|
2619
|
-
result = await _optionalChain([fns, 'access',
|
|
2623
|
+
result = await _optionalChain([fns, 'access', _126 => _126[i], 'optionalCall', _127 => _127(result)]);
|
|
2620
2624
|
}
|
|
2621
2625
|
return result;
|
|
2622
2626
|
};
|
|
@@ -2646,7 +2650,7 @@ var resolveOptions = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, async
|
|
|
2646
2650
|
const projectJson = JSON.parse(projectJsonFile);
|
|
2647
2651
|
const projectName = projectJson.name;
|
|
2648
2652
|
const projectConfigurations = _devkit.readProjectsConfigurationFromProjectGraph.call(void 0, projectGraph);
|
|
2649
|
-
if (!_optionalChain([projectConfigurations, 'optionalAccess',
|
|
2653
|
+
if (!_optionalChain([projectConfigurations, 'optionalAccess', _128 => _128.projects, 'optionalAccess', _129 => _129[projectName]])) {
|
|
2650
2654
|
throw new Error("The Build process failed because the project does not have a valid configuration in the project.json file. Check if the file exists in the root of the project.");
|
|
2651
2655
|
}
|
|
2652
2656
|
const options = _defu2.default.call(void 0, userOptions, DEFAULT_BUILD_OPTIONS);
|
|
@@ -2859,7 +2863,7 @@ ${formatLogMessage(options)}`, context2.options.config);
|
|
|
2859
2863
|
}
|
|
2860
2864
|
_chunkWTMG7MTKjs.__name.call(void 0, executeEsBuild, "executeEsBuild");
|
|
2861
2865
|
async function copyBuildAssets(context2) {
|
|
2862
|
-
if (_optionalChain([context2, 'access',
|
|
2866
|
+
if (_optionalChain([context2, 'access', _130 => _130.result, 'optionalAccess', _131 => _131.errors, 'access', _132 => _132.length]) === 0) {
|
|
2863
2867
|
writeDebug(` \u{1F4CB} Copying asset files to output directory: ${context2.options.outdir}`, context2.options.config);
|
|
2864
2868
|
const stopwatch = getStopwatch(`${context2.options.name} asset copy`);
|
|
2865
2869
|
await copyAssets(context2.options.config, _nullishCoalesce(context2.options.assets, () => ( [])), context2.options.outdir, context2.options.projectRoot, context2.options.sourceRoot, true, false);
|
|
@@ -2869,7 +2873,7 @@ async function copyBuildAssets(context2) {
|
|
|
2869
2873
|
}
|
|
2870
2874
|
_chunkWTMG7MTKjs.__name.call(void 0, copyBuildAssets, "copyBuildAssets");
|
|
2871
2875
|
async function reportResults(context2) {
|
|
2872
|
-
if (_optionalChain([context2, 'access',
|
|
2876
|
+
if (_optionalChain([context2, 'access', _133 => _133.result, 'optionalAccess', _134 => _134.errors, 'access', _135 => _135.length]) === 0) {
|
|
2873
2877
|
if (context2.result.warnings.length > 0) {
|
|
2874
2878
|
writeWarning(` \u{1F6A7} The following warnings occurred during the build: ${context2.result.warnings.map((warning) => warning.text).join("\n")}`, context2.options.config);
|
|
2875
2879
|
}
|
|
@@ -2970,14 +2974,14 @@ var watch = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (context2, opti
|
|
|
2970
2974
|
// ../workspace-tools/src/executors/esbuild/executor.ts
|
|
2971
2975
|
async function esbuildExecutorFn(options, context2, config) {
|
|
2972
2976
|
writeInfo("\u{1F4E6} Running Storm ESBuild executor on the workspace", config);
|
|
2973
|
-
if (!_optionalChain([context2, 'access',
|
|
2977
|
+
if (!_optionalChain([context2, 'access', _136 => _136.projectsConfigurations, 'optionalAccess', _137 => _137.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName] || !_optionalChain([context2, 'access', _138 => _138.projectsConfigurations, 'access', _139 => _139.projects, 'access', _140 => _140[context2.projectName], 'optionalAccess', _141 => _141.root])) {
|
|
2974
2978
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace.");
|
|
2975
2979
|
}
|
|
2976
2980
|
await build3({
|
|
2977
2981
|
...options,
|
|
2978
|
-
projectRoot: _optionalChain([context2, 'access',
|
|
2982
|
+
projectRoot: _optionalChain([context2, 'access', _142 => _142.projectsConfigurations, 'access', _143 => _143.projects, 'optionalAccess', _144 => _144[context2.projectName], 'access', _145 => _145.root]),
|
|
2979
2983
|
projectName: context2.projectName,
|
|
2980
|
-
sourceRoot: _optionalChain([context2, 'access',
|
|
2984
|
+
sourceRoot: _optionalChain([context2, 'access', _146 => _146.projectsConfigurations, 'access', _147 => _147.projects, 'optionalAccess', _148 => _148[context2.projectName], 'optionalAccess', _149 => _149.sourceRoot]),
|
|
2981
2985
|
format: options.format,
|
|
2982
2986
|
platform: options.format
|
|
2983
2987
|
});
|
|
@@ -3023,7 +3027,7 @@ var _esbuildwhy = require('@size-limit/esbuild-why'); var _esbuildwhy2 = _intero
|
|
|
3023
3027
|
var _file = require('@size-limit/file'); var _file2 = _interopRequireDefault(_file);
|
|
3024
3028
|
var _sizelimit = require('size-limit'); var _sizelimit2 = _interopRequireDefault(_sizelimit);
|
|
3025
3029
|
async function sizeLimitExecutorFn(options, context2, config) {
|
|
3026
|
-
if (!_optionalChain([context2, 'optionalAccess',
|
|
3030
|
+
if (!_optionalChain([context2, 'optionalAccess', _150 => _150.projectName]) || !_optionalChain([context2, 'access', _151 => _151.projectsConfigurations, 'optionalAccess', _152 => _152.projects]) || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
3027
3031
|
throw new Error("The Size-Limit process failed because the context is not valid. Please run this command from a workspace.");
|
|
3028
3032
|
}
|
|
3029
3033
|
writeInfo(`\u{1F4CF} Running Size-Limit on ${context2.projectName}`, config);
|
|
@@ -3032,7 +3036,7 @@ async function sizeLimitExecutorFn(options, context2, config) {
|
|
|
3032
3036
|
_esbuild3.default,
|
|
3033
3037
|
_esbuildwhy2.default
|
|
3034
3038
|
], {
|
|
3035
|
-
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access',
|
|
3039
|
+
checks: _nullishCoalesce(_nullishCoalesce(options.entry, () => ( _optionalChain([context2, 'access', _153 => _153.projectsConfigurations, 'access', _154 => _154.projects, 'access', _155 => _155[context2.projectName], 'optionalAccess', _156 => _156.sourceRoot]))), () => ( _devkit.joinPathFragments.call(void 0, _nullishCoalesce(_optionalChain([context2, 'access', _157 => _157.projectsConfigurations, 'access', _158 => _158.projects, 'access', _159 => _159[context2.projectName], 'optionalAccess', _160 => _160.root]), () => ( "./")), "src")))
|
|
3036
3040
|
}).then((result) => {
|
|
3037
3041
|
writeInfo(`\u{1F4CF} ${context2.projectName} Size-Limit result: ${JSON.stringify(result)}`, config);
|
|
3038
3042
|
});
|
|
@@ -3093,7 +3097,7 @@ _chunkWTMG7MTKjs.init_cjs_shims.call(void 0, );
|
|
|
3093
3097
|
var _jiti = require('jiti');
|
|
3094
3098
|
async function unbuildExecutorFn(options, context2, config) {
|
|
3095
3099
|
writeInfo("\u{1F4E6} Running Storm Unbuild executor on the workspace", config);
|
|
3096
|
-
if (!_optionalChain([context2, 'access',
|
|
3100
|
+
if (!_optionalChain([context2, 'access', _161 => _161.projectsConfigurations, 'optionalAccess', _162 => _162.projects]) || !context2.projectName || !context2.projectsConfigurations.projects[context2.projectName]) {
|
|
3097
3101
|
throw new Error("The Build process failed because the context is not valid. Please run this command from a workspace root directory.");
|
|
3098
3102
|
}
|
|
3099
3103
|
if (!context2.projectsConfigurations.projects[context2.projectName].root) {
|
|
@@ -3181,7 +3185,7 @@ var withRunGenerator = /* @__PURE__ */ _chunkWTMG7MTKjs.__name.call(void 0, (nam
|
|
|
3181
3185
|
- workspaceRoot: ${workspaceRoot3}`, config);
|
|
3182
3186
|
config = await getConfig(workspaceRoot3);
|
|
3183
3187
|
}
|
|
3184
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3188
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _163 => _163.hooks, 'optionalAccess', _164 => _164.applyDefaultOptions])) {
|
|
3185
3189
|
writeDebug("Running the applyDefaultOptions hook...", config);
|
|
3186
3190
|
options = await Promise.resolve(generatorOptions.hooks.applyDefaultOptions(options, config));
|
|
3187
3191
|
writeDebug("Completed the applyDefaultOptions hook", config);
|
|
@@ -3192,22 +3196,22 @@ ${Object.keys(_nullishCoalesce(options, () => ( {}))).map((key) => ` - ${key}=${
|
|
|
3192
3196
|
workspaceRoot: tree.root,
|
|
3193
3197
|
config
|
|
3194
3198
|
}, applyWorkspaceBaseTokens);
|
|
3195
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3199
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _165 => _165.hooks, 'optionalAccess', _166 => _166.preProcess])) {
|
|
3196
3200
|
writeDebug("Running the preProcess hook...", config);
|
|
3197
3201
|
await Promise.resolve(generatorOptions.hooks.preProcess(tokenized, config));
|
|
3198
3202
|
writeDebug("Completed the preProcess hook", config);
|
|
3199
3203
|
}
|
|
3200
3204
|
const result = await Promise.resolve(generatorFn(tree, tokenized, config));
|
|
3201
3205
|
if (result) {
|
|
3202
|
-
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess',
|
|
3206
|
+
if (result.success === false || result.error && _optionalChain([result, 'optionalAccess', _167 => _167.error, 'optionalAccess', _168 => _168.message]) && typeof _optionalChain([result, 'optionalAccess', _169 => _169.error, 'optionalAccess', _170 => _170.message]) === "string" && _optionalChain([result, 'optionalAccess', _171 => _171.error, 'optionalAccess', _172 => _172.name]) && typeof _optionalChain([result, 'optionalAccess', _173 => _173.error, 'optionalAccess', _174 => _174.name]) === "string") {
|
|
3203
3207
|
throw new Error(`The ${name} generator failed to run`, {
|
|
3204
|
-
cause: _optionalChain([result, 'optionalAccess',
|
|
3208
|
+
cause: _optionalChain([result, 'optionalAccess', _175 => _175.error])
|
|
3205
3209
|
});
|
|
3206
3210
|
} else if (result.success && result.data) {
|
|
3207
3211
|
return result;
|
|
3208
3212
|
}
|
|
3209
3213
|
}
|
|
3210
|
-
if (_optionalChain([generatorOptions, 'optionalAccess',
|
|
3214
|
+
if (_optionalChain([generatorOptions, 'optionalAccess', _176 => _176.hooks, 'optionalAccess', _177 => _177.postProcess])) {
|
|
3211
3215
|
writeDebug("Running the postProcess hook...", config);
|
|
3212
3216
|
await Promise.resolve(generatorOptions.hooks.postProcess(config));
|
|
3213
3217
|
writeDebug("Completed the postProcess hook", config);
|
|
@@ -3376,15 +3380,15 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
3376
3380
|
_devkit.addProjectConfiguration.call(void 0, tree, normalized.name, projectConfig);
|
|
3377
3381
|
let repository = {
|
|
3378
3382
|
type: "github",
|
|
3379
|
-
url: _optionalChain([config, 'optionalAccess',
|
|
3383
|
+
url: _optionalChain([config, 'optionalAccess', _178 => _178.repository]) || `https://github.com/${_optionalChain([config, 'optionalAccess', _179 => _179.organization]) || "storm-software"}/${_optionalChain([config, 'optionalAccess', _180 => _180.namespace]) || _optionalChain([config, 'optionalAccess', _181 => _181.name]) || "repository"}.git`
|
|
3380
3384
|
};
|
|
3381
3385
|
let description = options.description || "A package developed by Storm Software used to create modern, scalable web applications.";
|
|
3382
3386
|
if (tree.exists("package.json")) {
|
|
3383
3387
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
3384
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3388
|
+
if (_optionalChain([packageJson, 'optionalAccess', _182 => _182.repository])) {
|
|
3385
3389
|
repository = packageJson.repository;
|
|
3386
3390
|
}
|
|
3387
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3391
|
+
if (_optionalChain([packageJson, 'optionalAccess', _183 => _183.description])) {
|
|
3388
3392
|
description = packageJson.description;
|
|
3389
3393
|
}
|
|
3390
3394
|
}
|
|
@@ -3439,9 +3443,9 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
3439
3443
|
_devkit.updateJson.call(void 0, tree, "package.json", (json) => ({
|
|
3440
3444
|
...json,
|
|
3441
3445
|
pnpm: {
|
|
3442
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3446
|
+
..._optionalChain([json, 'optionalAccess', _184 => _184.pnpm]),
|
|
3443
3447
|
overrides: {
|
|
3444
|
-
..._optionalChain([json, 'optionalAccess',
|
|
3448
|
+
..._optionalChain([json, 'optionalAccess', _185 => _185.pnpm, 'optionalAccess', _186 => _186.overrides]),
|
|
3445
3449
|
[_nullishCoalesce(normalized.importPath, () => ( ""))]: "workspace:*"
|
|
3446
3450
|
}
|
|
3447
3451
|
}
|
|
@@ -3455,10 +3459,10 @@ async function typeScriptLibraryGeneratorFn(tree, options, config) {
|
|
|
3455
3459
|
]);
|
|
3456
3460
|
if (tree.exists("package.json")) {
|
|
3457
3461
|
const packageJson = _devkit.readJson.call(void 0, tree, "package.json");
|
|
3458
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3462
|
+
if (_optionalChain([packageJson, 'optionalAccess', _187 => _187.repository])) {
|
|
3459
3463
|
repository = packageJson.repository;
|
|
3460
3464
|
}
|
|
3461
|
-
if (_optionalChain([packageJson, 'optionalAccess',
|
|
3465
|
+
if (_optionalChain([packageJson, 'optionalAccess', _188 => _188.description])) {
|
|
3462
3466
|
description = packageJson.description;
|
|
3463
3467
|
}
|
|
3464
3468
|
}
|
|
@@ -3506,24 +3510,24 @@ _chunkWTMG7MTKjs.__name.call(void 0, getOutputPath, "getOutputPath");
|
|
|
3506
3510
|
function createProjectTsConfigJson(tree, options) {
|
|
3507
3511
|
const tsconfig = {
|
|
3508
3512
|
extends: options.rootProject ? void 0 : _js.getRelativePathToRootTsConfig.call(void 0, tree, options.projectRoot),
|
|
3509
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3513
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _189 => _189.tsconfigOptions]), () => ( {})),
|
|
3510
3514
|
compilerOptions: {
|
|
3511
3515
|
...options.rootProject ? _js.tsConfigBaseOptions : {},
|
|
3512
3516
|
outDir: _chunk3DQG66DJjs.joinPaths.call(void 0, _devkit.offsetFromRoot.call(void 0, options.projectRoot), "dist/out-tsc"),
|
|
3513
3517
|
noEmit: true,
|
|
3514
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3518
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _190 => _190.tsconfigOptions, 'optionalAccess', _191 => _191.compilerOptions]), () => ( {}))
|
|
3515
3519
|
},
|
|
3516
3520
|
files: [
|
|
3517
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3521
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _192 => _192.tsconfigOptions, 'optionalAccess', _193 => _193.files]), () => ( []))
|
|
3518
3522
|
],
|
|
3519
3523
|
include: [
|
|
3520
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3524
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _194 => _194.tsconfigOptions, 'optionalAccess', _195 => _195.include]), () => ( [])),
|
|
3521
3525
|
"src/**/*.ts",
|
|
3522
3526
|
"src/**/*.js",
|
|
3523
3527
|
"bin/**/*"
|
|
3524
3528
|
],
|
|
3525
3529
|
exclude: [
|
|
3526
|
-
..._nullishCoalesce(_optionalChain([options, 'optionalAccess',
|
|
3530
|
+
..._nullishCoalesce(_optionalChain([options, 'optionalAccess', _196 => _196.tsconfigOptions, 'optionalAccess', _197 => _197.exclude]), () => ( [])),
|
|
3527
3531
|
"jest.config.ts",
|
|
3528
3532
|
"src/**/*.spec.ts",
|
|
3529
3533
|
"src/**/*.test.ts"
|
|
@@ -3534,8 +3538,8 @@ function createProjectTsConfigJson(tree, options) {
|
|
|
3534
3538
|
_chunkWTMG7MTKjs.__name.call(void 0, createProjectTsConfigJson, "createProjectTsConfigJson");
|
|
3535
3539
|
async function normalizeOptions(tree, options, config) {
|
|
3536
3540
|
let importPath = options.importPath;
|
|
3537
|
-
if (!importPath && _optionalChain([config, 'optionalAccess',
|
|
3538
|
-
importPath = `@${_optionalChain([config, 'optionalAccess',
|
|
3541
|
+
if (!importPath && _optionalChain([config, 'optionalAccess', _198 => _198.namespace])) {
|
|
3542
|
+
importPath = `@${_optionalChain([config, 'optionalAccess', _199 => _199.namespace])}/${options.name}`;
|
|
3539
3543
|
}
|
|
3540
3544
|
if (options.publishable) {
|
|
3541
3545
|
if (!importPath) {
|
|
@@ -3664,11 +3668,11 @@ var _zodtojsonschema = require('zod-to-json-schema');
|
|
|
3664
3668
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
3665
3669
|
writeInfo("\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
3666
3670
|
writeTrace(`Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
3667
|
-
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0,
|
|
3671
|
+
const jsonSchema = _zodtojsonschema.zodToJsonSchema.call(void 0, stormWorkspaceConfigSchema, {
|
|
3668
3672
|
name: "StormWorkspaceConfiguration"
|
|
3669
3673
|
});
|
|
3670
3674
|
writeTrace(jsonSchema, config);
|
|
3671
|
-
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess',
|
|
3675
|
+
const outputPath = options.outputFile.replaceAll("{workspaceRoot}", "").replaceAll(_nullishCoalesce(_optionalChain([config, 'optionalAccess', _200 => _200.workspaceRoot]), () => ( findWorkspaceRoot())), _optionalChain([options, 'access', _201 => _201.outputFile, 'optionalAccess', _202 => _202.startsWith, 'call', _203 => _203("./")]) ? "" : "./");
|
|
3672
3676
|
writeTrace(`\u{1F4DD} Writing Storm Configuration JSON Schema to "${outputPath}"`, config);
|
|
3673
3677
|
_devkit.writeJson.call(void 0, tree, outputPath, jsonSchema, {
|
|
3674
3678
|
spaces: 2
|
|
@@ -200,7 +200,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
200
200
|
log: z.string().trim().optional().describe("The directory used to store the environment's temp files"),
|
|
201
201
|
build: z.string().trim().default("dist").describe("The directory used to store the workspace's distributable files after a build (relative to the workspace root)")
|
|
202
202
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
203
|
-
var
|
|
203
|
+
var stormWorkspaceConfigSchema = z.object({
|
|
204
204
|
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm-workspace.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
205
205
|
extends: ExtendsSchema.optional(),
|
|
206
206
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
@@ -1252,7 +1252,7 @@ var setBaseThemeColorConfigEnv = /* @__PURE__ */ __name((prefix, config) => {
|
|
|
1252
1252
|
// ../config-tools/src/create-storm-config.ts
|
|
1253
1253
|
var _extension_cache = /* @__PURE__ */ new WeakMap();
|
|
1254
1254
|
var _static_cache = void 0;
|
|
1255
|
-
var
|
|
1255
|
+
var createStormWorkspaceConfig = /* @__PURE__ */ __name(async (extensionName, schema, workspaceRoot3, skipLogs = false) => {
|
|
1256
1256
|
let result;
|
|
1257
1257
|
if (!_static_cache?.data || !_static_cache?.timestamp || _static_cache.timestamp < Date.now() - 8e3) {
|
|
1258
1258
|
let _workspaceRoot = workspaceRoot3;
|
|
@@ -1267,7 +1267,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
1267
1267
|
logLevel: "all"
|
|
1268
1268
|
});
|
|
1269
1269
|
}
|
|
1270
|
-
result = await
|
|
1270
|
+
result = await stormWorkspaceConfigSchema.parseAsync(defu2(configEnv, configFile, defaultConfig));
|
|
1271
1271
|
result.workspaceRoot ??= _workspaceRoot;
|
|
1272
1272
|
} else {
|
|
1273
1273
|
result = _static_cache.data;
|
|
@@ -1283,7 +1283,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
1283
1283
|
data: result
|
|
1284
1284
|
};
|
|
1285
1285
|
return result;
|
|
1286
|
-
}, "
|
|
1286
|
+
}, "createStormWorkspaceConfig");
|
|
1287
1287
|
var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
1288
1288
|
const extension_cache_key = {
|
|
1289
1289
|
extensionName
|
|
@@ -1298,20 +1298,20 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
1298
1298
|
_extension_cache.set(extension_cache_key, extension);
|
|
1299
1299
|
return extension;
|
|
1300
1300
|
}, "createConfigExtension");
|
|
1301
|
-
var
|
|
1302
|
-
const config = await
|
|
1301
|
+
var loadStormWorkspaceConfig = /* @__PURE__ */ __name(async (workspaceRoot3, skipLogs = false) => {
|
|
1302
|
+
const config = await createStormWorkspaceConfig(void 0, void 0, workspaceRoot3, skipLogs);
|
|
1303
1303
|
setConfigEnv(config);
|
|
1304
1304
|
if (!skipLogs && !config.skipConfigLogging) {
|
|
1305
1305
|
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1306
1306
|
${formatLogMessage(config)}`, config);
|
|
1307
1307
|
}
|
|
1308
1308
|
return config;
|
|
1309
|
-
}, "
|
|
1309
|
+
}, "loadStormWorkspaceConfig");
|
|
1310
1310
|
|
|
1311
1311
|
// ../config-tools/src/get-config.ts
|
|
1312
1312
|
init_esm_shims();
|
|
1313
1313
|
var getConfig = /* @__PURE__ */ __name((workspaceRoot3, skipLogs = false) => {
|
|
1314
|
-
return
|
|
1314
|
+
return loadStormWorkspaceConfig(workspaceRoot3, skipLogs);
|
|
1315
1315
|
}, "getConfig");
|
|
1316
1316
|
|
|
1317
1317
|
// ../workspace-tools/src/base/base-executor.ts
|
|
@@ -1801,13 +1801,13 @@ var addPackageDependencies = /* @__PURE__ */ __name(async (workspaceRoot3, proje
|
|
|
1801
1801
|
return ret;
|
|
1802
1802
|
}, []);
|
|
1803
1803
|
packageJson.dependencies = localPackages.reduce((ret, localPackage) => {
|
|
1804
|
-
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name)) {
|
|
1805
|
-
ret[localPackage.name] =
|
|
1804
|
+
if (!ret[localPackage.name] && !implicitDependencies?.includes(localPackage.name) && packageJson.devDependencies?.[localPackage.name] === void 0) {
|
|
1805
|
+
ret[localPackage.name] = `^${localPackage.version || "0.0.1"}`;
|
|
1806
1806
|
}
|
|
1807
1807
|
return ret;
|
|
1808
1808
|
}, packageJson.dependencies ?? {});
|
|
1809
1809
|
packageJson.devDependencies = localPackages.reduce((ret, localPackage) => {
|
|
1810
|
-
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name)) {
|
|
1810
|
+
if (!ret[localPackage.name] && implicitDependencies?.includes(localPackage.name) && packageJson.dependencies?.[localPackage.name] === void 0) {
|
|
1811
1811
|
ret[localPackage.name] = localPackage.version || "0.0.1";
|
|
1812
1812
|
}
|
|
1813
1813
|
return ret;
|
|
@@ -1901,7 +1901,11 @@ var getEntryPoints = /* @__PURE__ */ __name(async (config, projectRoot, sourceRo
|
|
|
1901
1901
|
return ret;
|
|
1902
1902
|
}, []));
|
|
1903
1903
|
} else {
|
|
1904
|
-
|
|
1904
|
+
const result = correctPaths(entryPoint.replaceAll(correctPaths(workspaceRoot3), "").replaceAll(correctPaths(projectRoot), ""));
|
|
1905
|
+
writeDebug(`Trying to add entry point ${result}"`, config);
|
|
1906
|
+
if (!paths.includes(result)) {
|
|
1907
|
+
paths.push(result);
|
|
1908
|
+
}
|
|
1905
1909
|
}
|
|
1906
1910
|
return paths;
|
|
1907
1911
|
}));
|
|
@@ -3665,7 +3669,7 @@ import { zodToJsonSchema } from "zod-to-json-schema";
|
|
|
3665
3669
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
3666
3670
|
writeInfo("\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
3667
3671
|
writeTrace(`Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
3668
|
-
const jsonSchema = zodToJsonSchema(
|
|
3672
|
+
const jsonSchema = zodToJsonSchema(stormWorkspaceConfigSchema, {
|
|
3669
3673
|
name: "StormWorkspaceConfiguration"
|
|
3670
3674
|
});
|
|
3671
3675
|
writeTrace(jsonSchema, config);
|
package/dist/generators.d.mts
CHANGED
package/dist/generators.d.ts
CHANGED
package/dist/generators.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});require('./chunk-3Y6AMHJ5.js');
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIHAOUZIDjs = require('./chunk-IHAOUZID.js');
|
|
5
5
|
require('./chunk-3DQG66DJ.js');
|
|
6
6
|
require('./chunk-WTMG7MTK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
exports.initGeneratorFn =
|
|
9
|
+
exports.initGeneratorFn = _chunkIHAOUZIDjs.initGeneratorFn;
|
package/dist/generators.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import z from 'zod';
|
|
|
4
4
|
/**
|
|
5
5
|
* Storm Workspace config values used during various dev-ops processes. It represents the config of the entire monorepo.
|
|
6
6
|
*/
|
|
7
|
-
declare const
|
|
7
|
+
declare const stormWorkspaceConfigSchema: z.ZodObject<{
|
|
8
8
|
$schema: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodString>>>>;
|
|
9
9
|
extends: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
10
10
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1243,12 +1243,28 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
1243
1243
|
extensions?: Record<string, any> | undefined;
|
|
1244
1244
|
}>;
|
|
1245
1245
|
|
|
1246
|
-
type
|
|
1247
|
-
|
|
1248
|
-
|
|
1246
|
+
type TStormWorkspaceConfig = z.infer<typeof stormWorkspaceConfigSchema>;
|
|
1247
|
+
/**
|
|
1248
|
+
* The Storm workspace's configuration object
|
|
1249
|
+
*
|
|
1250
|
+
* @remarks
|
|
1251
|
+
* This type is used to define the configuration object for the entire Storm workspace/monorepo. The value is extracted from the `storm-workspace.json` file in the workspace root and the currently configuration environment variables. The value can be obtained by calling `getWorkspaceConfig()` in `@storm-software/config-tools`.
|
|
1252
|
+
*
|
|
1253
|
+
* @deprecated
|
|
1254
|
+
* This type is deprecated and will be removed in the next major version. Use `StormWorkspaceConfig` instead.
|
|
1255
|
+
*/
|
|
1256
|
+
type StormConfig<TExtensionName extends keyof TStormWorkspaceConfig["extensions"] = keyof TStormWorkspaceConfig["extensions"], TExtensionConfig extends TStormWorkspaceConfig["extensions"][TExtensionName] = TStormWorkspaceConfig["extensions"][TExtensionName]> = TStormWorkspaceConfig & {
|
|
1257
|
+
extensions: (TStormWorkspaceConfig["extensions"] & {
|
|
1249
1258
|
[extensionName in TExtensionName]: TExtensionConfig;
|
|
1250
1259
|
}) | NonNullable<Record<string, any>>;
|
|
1251
1260
|
};
|
|
1261
|
+
/**
|
|
1262
|
+
* The Storm workspace's configuration object
|
|
1263
|
+
*
|
|
1264
|
+
* @remarks
|
|
1265
|
+
* This type is used to define the configuration object for the entire Storm workspace/monorepo. The value is extracted from the `storm-workspace.json` file in the workspace root and the currently configuration environment variables. The value can be obtained by calling `getWorkspaceConfig()` in `@storm-software/config-tools`.
|
|
1266
|
+
*/
|
|
1267
|
+
type StormWorkspaceConfig<TExtensionName extends keyof TStormWorkspaceConfig["extensions"] = keyof TStormWorkspaceConfig["extensions"], TExtensionConfig extends TStormWorkspaceConfig["extensions"][TExtensionName] = TStormWorkspaceConfig["extensions"][TExtensionName]> = StormConfig<TExtensionName, TExtensionConfig>;
|
|
1252
1268
|
|
|
1253
1269
|
interface BaseGeneratorResult extends Record<string, any> {
|
|
1254
1270
|
error?: Error;
|
|
@@ -1277,7 +1293,7 @@ interface InitGeneratorSchema {
|
|
|
1277
1293
|
skipFormat?: boolean,
|
|
1278
1294
|
}
|
|
1279
1295
|
|
|
1280
|
-
declare function initGeneratorFn(tree: Tree, options: InitGeneratorSchema, config:
|
|
1296
|
+
declare function initGeneratorFn(tree: Tree, options: InitGeneratorSchema, config: StormWorkspaceConfig): Promise<GeneratorCallback>;
|
|
1281
1297
|
declare const _default: (tree: Tree, _options: InitGeneratorSchema) => Promise<GeneratorCallback | BaseGeneratorResult>;
|
|
1282
1298
|
|
|
1283
1299
|
export { type InitGeneratorSchema as I, _default as _, initGeneratorFn as i };
|
|
@@ -4,7 +4,7 @@ import z from 'zod';
|
|
|
4
4
|
/**
|
|
5
5
|
* Storm Workspace config values used during various dev-ops processes. It represents the config of the entire monorepo.
|
|
6
6
|
*/
|
|
7
|
-
declare const
|
|
7
|
+
declare const stormWorkspaceConfigSchema: z.ZodObject<{
|
|
8
8
|
$schema: z.ZodOptional<z.ZodNullable<z.ZodOptional<z.ZodDefault<z.ZodString>>>>;
|
|
9
9
|
extends: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
|
|
10
10
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -1243,12 +1243,28 @@ declare const StormConfigSchema: z.ZodObject<{
|
|
|
1243
1243
|
extensions?: Record<string, any> | undefined;
|
|
1244
1244
|
}>;
|
|
1245
1245
|
|
|
1246
|
-
type
|
|
1247
|
-
|
|
1248
|
-
|
|
1246
|
+
type TStormWorkspaceConfig = z.infer<typeof stormWorkspaceConfigSchema>;
|
|
1247
|
+
/**
|
|
1248
|
+
* The Storm workspace's configuration object
|
|
1249
|
+
*
|
|
1250
|
+
* @remarks
|
|
1251
|
+
* This type is used to define the configuration object for the entire Storm workspace/monorepo. The value is extracted from the `storm-workspace.json` file in the workspace root and the currently configuration environment variables. The value can be obtained by calling `getWorkspaceConfig()` in `@storm-software/config-tools`.
|
|
1252
|
+
*
|
|
1253
|
+
* @deprecated
|
|
1254
|
+
* This type is deprecated and will be removed in the next major version. Use `StormWorkspaceConfig` instead.
|
|
1255
|
+
*/
|
|
1256
|
+
type StormConfig<TExtensionName extends keyof TStormWorkspaceConfig["extensions"] = keyof TStormWorkspaceConfig["extensions"], TExtensionConfig extends TStormWorkspaceConfig["extensions"][TExtensionName] = TStormWorkspaceConfig["extensions"][TExtensionName]> = TStormWorkspaceConfig & {
|
|
1257
|
+
extensions: (TStormWorkspaceConfig["extensions"] & {
|
|
1249
1258
|
[extensionName in TExtensionName]: TExtensionConfig;
|
|
1250
1259
|
}) | NonNullable<Record<string, any>>;
|
|
1251
1260
|
};
|
|
1261
|
+
/**
|
|
1262
|
+
* The Storm workspace's configuration object
|
|
1263
|
+
*
|
|
1264
|
+
* @remarks
|
|
1265
|
+
* This type is used to define the configuration object for the entire Storm workspace/monorepo. The value is extracted from the `storm-workspace.json` file in the workspace root and the currently configuration environment variables. The value can be obtained by calling `getWorkspaceConfig()` in `@storm-software/config-tools`.
|
|
1266
|
+
*/
|
|
1267
|
+
type StormWorkspaceConfig<TExtensionName extends keyof TStormWorkspaceConfig["extensions"] = keyof TStormWorkspaceConfig["extensions"], TExtensionConfig extends TStormWorkspaceConfig["extensions"][TExtensionName] = TStormWorkspaceConfig["extensions"][TExtensionName]> = StormConfig<TExtensionName, TExtensionConfig>;
|
|
1252
1268
|
|
|
1253
1269
|
interface BaseGeneratorResult extends Record<string, any> {
|
|
1254
1270
|
error?: Error;
|
|
@@ -1277,7 +1293,7 @@ interface InitGeneratorSchema {
|
|
|
1277
1293
|
skipFormat?: boolean,
|
|
1278
1294
|
}
|
|
1279
1295
|
|
|
1280
|
-
declare function initGeneratorFn(tree: Tree, options: InitGeneratorSchema, config:
|
|
1296
|
+
declare function initGeneratorFn(tree: Tree, options: InitGeneratorSchema, config: StormWorkspaceConfig): Promise<GeneratorCallback>;
|
|
1281
1297
|
declare const _default: (tree: Tree, _options: InitGeneratorSchema) => Promise<GeneratorCallback | BaseGeneratorResult>;
|
|
1282
1298
|
|
|
1283
1299
|
export { type InitGeneratorSchema as I, _default as _, initGeneratorFn as i };
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
var _chunkZ2UXMCUYjs = require('./chunk-Z2UXMCUY.js');
|
|
5
5
|
|
|
6
6
|
|
|
7
|
-
var
|
|
7
|
+
var _chunkIHAOUZIDjs = require('./chunk-IHAOUZID.js');
|
|
8
8
|
require('./chunk-3DQG66DJ.js');
|
|
9
9
|
|
|
10
10
|
|
|
@@ -16,10 +16,10 @@ var _chunkWTMG7MTKjs = require('./chunk-WTMG7MTK.js');
|
|
|
16
16
|
// index.ts
|
|
17
17
|
var index_exports = {};
|
|
18
18
|
_chunkWTMG7MTKjs.__export.call(void 0, index_exports, {
|
|
19
|
-
initGeneratorFn: () =>
|
|
19
|
+
initGeneratorFn: () => _chunkIHAOUZIDjs.initGeneratorFn
|
|
20
20
|
});
|
|
21
21
|
_chunkWTMG7MTKjs.init_cjs_shims.call(void 0, );
|
|
22
22
|
_chunkWTMG7MTKjs.__reExport.call(void 0, index_exports, _chunkWTMG7MTKjs.__toESM.call(void 0, _chunkZ2UXMCUYjs.require_components.call(void 0, )));
|
|
23
23
|
|
|
24
24
|
|
|
25
|
-
exports.initGeneratorFn =
|
|
25
|
+
exports.initGeneratorFn = _chunkIHAOUZIDjs.initGeneratorFn;
|
package/dist/index.mjs
CHANGED
|
@@ -669,23 +669,23 @@ var StormNxWorkspace = (_class = class extends _nxworkspace.NxWorkspace {
|
|
|
669
669
|
|
|
670
670
|
constructor(project) {
|
|
671
671
|
super(project);_class.prototype.__init.call(this);_class.prototype.__init2.call(this);_class.prototype.__init3.call(this);_class.prototype.__init4.call(this);_class.prototype.__init5.call(this);_class.prototype.__init6.call(this);_class.prototype.__init7.call(this);_class.prototype.__init8.call(this);_class.prototype.__init9.call(this);_class.prototype.__init10.call(this);_class.prototype.__init11.call(this);_class.prototype.__init12.call(this);;
|
|
672
|
-
let
|
|
672
|
+
let StormWorkspaceConfig;
|
|
673
673
|
if (project.root.outdir) {
|
|
674
|
-
const
|
|
675
|
-
|
|
674
|
+
const StormWorkspaceConfigJson = _fs.readFileSync.call(void 0, _chunk3DQG66DJjs.joinPaths.call(void 0, project.root.outdir, "storm-workspace.json"), "utf8");
|
|
675
|
+
StormWorkspaceConfig = JSON.parse(StormWorkspaceConfigJson);
|
|
676
676
|
}
|
|
677
|
-
if (_optionalChain([
|
|
678
|
-
this.npmScope = _optionalChain([
|
|
677
|
+
if (_optionalChain([StormWorkspaceConfig, 'optionalAccess', _ => _.namespace])) {
|
|
678
|
+
this.npmScope = _optionalChain([StormWorkspaceConfig, 'optionalAccess', _2 => _2.namespace]);
|
|
679
679
|
}
|
|
680
|
-
if (_optionalChain([
|
|
681
|
-
this.defaultBase = _optionalChain([
|
|
680
|
+
if (_optionalChain([StormWorkspaceConfig, 'optionalAccess', _3 => _3.branch])) {
|
|
681
|
+
this.defaultBase = _optionalChain([StormWorkspaceConfig, 'optionalAccess', _4 => _4.branch]);
|
|
682
682
|
this.affected = {
|
|
683
|
-
defaultBase: _optionalChain([
|
|
683
|
+
defaultBase: _optionalChain([StormWorkspaceConfig, 'optionalAccess', _5 => _5.branch])
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
if (_optionalChain([
|
|
686
|
+
if (_optionalChain([StormWorkspaceConfig, 'optionalAccess', _6 => _6.packageManager])) {
|
|
687
687
|
this.cli = {
|
|
688
|
-
packageManager: _optionalChain([
|
|
688
|
+
packageManager: _optionalChain([StormWorkspaceConfig, 'optionalAccess', _7 => _7.packageManager])
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
691
|
this.nxJson = new (0, _projen.JsonFile)(project, "nx.json", {
|
|
@@ -669,23 +669,23 @@ var StormNxWorkspace = class extends NxWorkspace {
|
|
|
669
669
|
cli;
|
|
670
670
|
constructor(project) {
|
|
671
671
|
super(project);
|
|
672
|
-
let
|
|
672
|
+
let StormWorkspaceConfig;
|
|
673
673
|
if (project.root.outdir) {
|
|
674
|
-
const
|
|
675
|
-
|
|
674
|
+
const StormWorkspaceConfigJson = readFileSync(joinPaths(project.root.outdir, "storm-workspace.json"), "utf8");
|
|
675
|
+
StormWorkspaceConfig = JSON.parse(StormWorkspaceConfigJson);
|
|
676
676
|
}
|
|
677
|
-
if (
|
|
678
|
-
this.npmScope =
|
|
677
|
+
if (StormWorkspaceConfig?.namespace) {
|
|
678
|
+
this.npmScope = StormWorkspaceConfig?.namespace;
|
|
679
679
|
}
|
|
680
|
-
if (
|
|
681
|
-
this.defaultBase =
|
|
680
|
+
if (StormWorkspaceConfig?.branch) {
|
|
681
|
+
this.defaultBase = StormWorkspaceConfig?.branch;
|
|
682
682
|
this.affected = {
|
|
683
|
-
defaultBase:
|
|
683
|
+
defaultBase: StormWorkspaceConfig?.branch
|
|
684
684
|
};
|
|
685
685
|
}
|
|
686
|
-
if (
|
|
686
|
+
if (StormWorkspaceConfig?.packageManager) {
|
|
687
687
|
this.cli = {
|
|
688
|
-
packageManager:
|
|
688
|
+
packageManager: StormWorkspaceConfig?.packageManager
|
|
689
689
|
};
|
|
690
690
|
}
|
|
691
691
|
this.nxJson = new JsonFile(project, "nx.json", {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var _chunkIHAOUZIDjs = require('../../../chunk-IHAOUZID.js');
|
|
5
5
|
require('../../../chunk-3DQG66DJ.js');
|
|
6
6
|
require('../../../chunk-WTMG7MTK.js');
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
10
|
-
exports.default =
|
|
10
|
+
exports.default = _chunkIHAOUZIDjs.generator_default; exports.initGeneratorFn = _chunkIHAOUZIDjs.initGeneratorFn;
|