@storm-software/terraform-tools 0.54.18 → 0.54.19
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 +6 -0
- package/README.md +1 -1
- package/dist/{chunk-V2MDU72P.js → chunk-2LUGBITC.js} +2 -2
- package/dist/{chunk-VZ6XA5RO.mjs → chunk-53LPW54Q.mjs} +1 -1
- package/dist/{chunk-PTGYSMPV.js → chunk-AP4J2N34.js} +2 -2
- package/dist/{chunk-EFR6PXP4.js → chunk-GCCFZEDU.js} +41 -24
- package/dist/{chunk-LFSPDVQC.mjs → chunk-K5R7Z4IA.mjs} +1 -1
- package/dist/{chunk-VLD5ZA2O.js → chunk-MMBQ5BEW.js} +2 -2
- package/dist/{chunk-Y42OHWIS.js → chunk-OJ33RFH7.js} +2 -2
- package/dist/{chunk-RWC4LQNP.mjs → chunk-PD7DIQ7D.mjs} +1 -1
- package/dist/{chunk-SIKF3MKV.mjs → chunk-STXHLIEE.mjs} +3 -3
- package/dist/{chunk-W4HT4RSX.mjs → chunk-W3S56D72.mjs} +41 -24
- package/dist/{chunk-CFYJFDXQ.js → chunk-YD6YAH3D.js} +149 -149
- package/dist/{chunk-NKCDHL2T.mjs → chunk-ZIPCZI7T.mjs} +1 -1
- package/dist/{chunk-MQHDDYEZ.mjs → chunk-ZUYMYXE2.mjs} +1 -1
- package/dist/{chunk-FITZEF2D.js → chunk-ZYPB3WAC.js} +3 -3
- package/dist/executors.js +6 -6
- package/dist/executors.mjs +6 -6
- package/dist/generators.js +3 -3
- package/dist/generators.mjs +2 -2
- package/dist/index.js +8 -8
- package/dist/index.mjs +7 -7
- package/dist/src/base/index.js +3 -3
- package/dist/src/base/index.mjs +2 -2
- package/dist/src/base/terraform-executor.d.mts +3 -0
- package/dist/src/base/terraform-executor.d.ts +3 -0
- package/dist/src/base/terraform-executor.js +3 -3
- package/dist/src/base/terraform-executor.mjs +2 -2
- package/dist/src/executors/apply/executor.js +4 -4
- package/dist/src/executors/apply/executor.mjs +3 -3
- package/dist/src/executors/destroy/executor.js +4 -4
- package/dist/src/executors/destroy/executor.mjs +3 -3
- package/dist/src/executors/output/executor.js +4 -4
- package/dist/src/executors/output/executor.mjs +3 -3
- package/dist/src/executors/plan/executor.js +4 -4
- package/dist/src/executors/plan/executor.mjs +3 -3
- package/dist/src/generators/init/init.js +3 -3
- package/dist/src/generators/init/init.mjs +2 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -21,7 +21,7 @@ This package is part of the <b>⚡Storm-Ops</b> monorepo. The Storm-Ops packages
|
|
|
21
21
|
|
|
22
22
|
<h3 align="center">💻 Visit <a href="https://stormsoftware.com" target="_blank">stormsoftware.com</a> to stay up to date with this developer</h3><br />
|
|
23
23
|
|
|
24
|
-
[](https://prettier.io/) [](http://nx.dev/) [](https://nextjs.org/) [](http://commitizen.github.io/cz-cli/)  [](https://fumadocs.vercel.app/) 
|
|
25
25
|
|
|
26
26
|
<!-- prettier-ignore-start -->
|
|
27
27
|
<!-- markdownlint-disable -->
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZYPB3WACjs = require('./chunk-ZYPB3WAC.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/apply/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunkZYPB3WACjs.withTerraformExecutor.call(void 0, "apply");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZYPB3WACjs = require('./chunk-ZYPB3WAC.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/plan/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunkZYPB3WACjs.withTerraformExecutor.call(void 0, "plan");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -153,7 +153,7 @@ var WorkspaceDirectoryConfigSchema = _zod2.default.object({
|
|
|
153
153
|
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)")
|
|
154
154
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
155
155
|
var StormConfigSchema = _zod2.default.object({
|
|
156
|
-
$schema: _zod2.default.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
156
|
+
$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"),
|
|
157
157
|
extends: ExtendsSchema.optional(),
|
|
158
158
|
name: _zod2.default.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
159
159
|
namespace: _zod2.default.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -195,6 +195,7 @@ var StormConfigSchema = _zod2.default.object({
|
|
|
195
195
|
"trace",
|
|
196
196
|
"all"
|
|
197
197
|
]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
|
|
198
|
+
skipConfigLogging: _zod2.default.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
198
199
|
registry: RegistryConfigSchema,
|
|
199
200
|
configFile: _zod2.default.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
200
201
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -357,14 +358,17 @@ var isAbsolute = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, function(p
|
|
|
357
358
|
|
|
358
359
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
359
360
|
var depth = 0;
|
|
360
|
-
function findFolderUp(startPath, endFileNames) {
|
|
361
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
361
362
|
const _startPath = _nullishCoalesce(startPath, () => ( process.cwd()));
|
|
363
|
+
if (endDirectoryNames.some((endDirName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endDirName)))) {
|
|
364
|
+
return _startPath;
|
|
365
|
+
}
|
|
362
366
|
if (endFileNames.some((endFileName) => _fs.existsSync.call(void 0, _path.join.call(void 0, _startPath, endFileName)))) {
|
|
363
367
|
return _startPath;
|
|
364
368
|
}
|
|
365
369
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
366
370
|
const parent = _path.join.call(void 0, _startPath, "..");
|
|
367
|
-
return findFolderUp(parent, endFileNames);
|
|
371
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
368
372
|
}
|
|
369
373
|
return void 0;
|
|
370
374
|
}
|
|
@@ -372,17 +376,17 @@ _chunk3GQAWCBQjs.__name.call(void 0, findFolderUp, "findFolderUp");
|
|
|
372
376
|
|
|
373
377
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
374
378
|
var rootFiles = [
|
|
375
|
-
"storm.json",
|
|
376
|
-
"storm.json",
|
|
377
|
-
"storm.yaml",
|
|
378
|
-
"storm.yml",
|
|
379
|
-
"storm.js",
|
|
380
|
-
"storm.ts",
|
|
381
|
-
".storm.json",
|
|
382
|
-
".storm.yaml",
|
|
383
|
-
".storm.yml",
|
|
384
|
-
".storm.js",
|
|
385
|
-
".storm.ts",
|
|
379
|
+
"storm-workspace.json",
|
|
380
|
+
"storm-workspace.json",
|
|
381
|
+
"storm-workspace.yaml",
|
|
382
|
+
"storm-workspace.yml",
|
|
383
|
+
"storm-workspace.js",
|
|
384
|
+
"storm-workspace.ts",
|
|
385
|
+
".storm-workspace.json",
|
|
386
|
+
".storm-workspace.yaml",
|
|
387
|
+
".storm-workspace.yml",
|
|
388
|
+
".storm-workspace.js",
|
|
389
|
+
".storm-workspace.ts",
|
|
386
390
|
"lerna.json",
|
|
387
391
|
"nx.json",
|
|
388
392
|
"turbo.json",
|
|
@@ -406,11 +410,18 @@ var rootFiles = [
|
|
|
406
410
|
"pnpm-lock.yml",
|
|
407
411
|
"bun.lockb"
|
|
408
412
|
];
|
|
413
|
+
var rootDirectories = [
|
|
414
|
+
".storm-workspace",
|
|
415
|
+
".nx",
|
|
416
|
+
".github",
|
|
417
|
+
".vscode",
|
|
418
|
+
".verdaccio"
|
|
419
|
+
];
|
|
409
420
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
410
421
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
411
422
|
return correctPaths(_nullishCoalesce(process.env.STORM_WORKSPACE_ROOT, () => ( process.env.NX_WORKSPACE_ROOT_PATH)));
|
|
412
423
|
}
|
|
413
|
-
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles));
|
|
424
|
+
return correctPaths(findFolderUp(_nullishCoalesce(pathInsideMonorepo, () => ( process.cwd())), rootFiles, rootDirectories));
|
|
414
425
|
}
|
|
415
426
|
_chunk3GQAWCBQjs.__name.call(void 0, findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
416
427
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -804,10 +815,10 @@ var getConfigFileByName = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, a
|
|
|
804
815
|
}, "getConfigFileByName");
|
|
805
816
|
var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (filePath, additionalFileNames = []) => {
|
|
806
817
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
807
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
818
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
808
819
|
let config = result.config;
|
|
809
820
|
const configFile = result.configFile;
|
|
810
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
821
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
811
822
|
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
812
823
|
logLevel: "all"
|
|
813
824
|
});
|
|
@@ -816,9 +827,11 @@ var getConfigFile = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (
|
|
|
816
827
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
817
828
|
for (const result2 of results) {
|
|
818
829
|
if (_optionalChain([result2, 'optionalAccess', _33 => _33.config]) && _optionalChain([result2, 'optionalAccess', _34 => _34.configFile]) && Object.keys(result2.config).length > 0) {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
830
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
831
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
832
|
+
logLevel: "all"
|
|
833
|
+
});
|
|
834
|
+
}
|
|
822
835
|
config = _defu2.default.call(void 0, _nullishCoalesce(result2.config, () => ( {})), _nullishCoalesce(config, () => ( {})));
|
|
823
836
|
}
|
|
824
837
|
}
|
|
@@ -894,7 +907,8 @@ var getConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, () => {
|
|
|
894
907
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
895
908
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
896
909
|
},
|
|
897
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
910
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
911
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
898
912
|
};
|
|
899
913
|
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
900
914
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
@@ -1129,6 +1143,9 @@ var setConfigEnv = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, (config)
|
|
|
1129
1143
|
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
1130
1144
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
1131
1145
|
}
|
|
1146
|
+
if (config.skipConfigLogging !== void 0) {
|
|
1147
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
1148
|
+
}
|
|
1132
1149
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
1133
1150
|
for (const key of Object.keys(_nullishCoalesce(config.extensions, () => ( {})))) {
|
|
1134
1151
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
@@ -1246,7 +1263,7 @@ var createStormConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, asy
|
|
|
1246
1263
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
1247
1264
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
1248
1265
|
if (!configFile && !skipLogs) {
|
|
1249
|
-
writeWarning("No Storm
|
|
1266
|
+
writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
|
|
1250
1267
|
logLevel: "all"
|
|
1251
1268
|
});
|
|
1252
1269
|
}
|
|
@@ -1284,8 +1301,8 @@ var createConfigExtension = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0,
|
|
|
1284
1301
|
var loadStormConfig = /* @__PURE__ */ _chunk3GQAWCBQjs.__name.call(void 0, async (workspaceRoot, skipLogs = false) => {
|
|
1285
1302
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
1286
1303
|
setConfigEnv(config);
|
|
1287
|
-
if (!skipLogs) {
|
|
1288
|
-
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
1304
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
1305
|
+
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1289
1306
|
${formatLogMessage(config)}`, config);
|
|
1290
1307
|
}
|
|
1291
1308
|
return config;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZYPB3WACjs = require('./chunk-ZYPB3WAC.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/destroy/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunkZYPB3WACjs.withTerraformExecutor.call(void 0, "destroy");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var _chunkZYPB3WACjs = require('./chunk-ZYPB3WAC.js');
|
|
4
4
|
|
|
5
5
|
// src/executors/output/executor.ts
|
|
6
|
-
var executor_default =
|
|
6
|
+
var executor_default = _chunkZYPB3WACjs.withTerraformExecutor.call(void 0, "output");
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
writeSuccess,
|
|
18
18
|
writeTrace,
|
|
19
19
|
writeWarning
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-W3S56D72.mjs";
|
|
21
21
|
import {
|
|
22
22
|
__dirname,
|
|
23
23
|
__name,
|
|
@@ -2456,8 +2456,8 @@ var generator_default = withRunGenerator("TypeScript Library Creator (Browser Pl
|
|
|
2456
2456
|
import { formatFiles as formatFiles3, writeJson as writeJson2 } from "@nx/devkit";
|
|
2457
2457
|
import { zodToJsonSchema } from "zod-to-json-schema";
|
|
2458
2458
|
async function configSchemaGeneratorFn(tree, options, config) {
|
|
2459
|
-
writeInfo("\u{1F4E6} Running Storm Configuration JSON Schema generator", config);
|
|
2460
|
-
writeTrace(`Determining the Storm Configuration JSON Schema...`, config);
|
|
2459
|
+
writeInfo("\u{1F4E6} Running Storm Workspace Configuration JSON Schema generator", config);
|
|
2460
|
+
writeTrace(`Determining the Storm Workspace Configuration JSON Schema...`, config);
|
|
2461
2461
|
const jsonSchema = zodToJsonSchema(StormConfigSchema, {
|
|
2462
2462
|
name: "StormWorkspaceConfiguration"
|
|
2463
2463
|
});
|
|
@@ -153,7 +153,7 @@ var WorkspaceDirectoryConfigSchema = z.object({
|
|
|
153
153
|
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)")
|
|
154
154
|
}).describe("Various directories used by the workspace to store data, cache, and configuration files");
|
|
155
155
|
var StormConfigSchema = z.object({
|
|
156
|
-
$schema: z.string().trim().default("https://cdn.jsdelivr.net/npm/@storm-software/config/schemas/storm.schema.json").optional().nullish().describe("The URL to the JSON schema file that describes the Storm configuration file"),
|
|
156
|
+
$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"),
|
|
157
157
|
extends: ExtendsSchema.optional(),
|
|
158
158
|
name: z.string().trim().toLowerCase().optional().describe("The name of the service/package/scope using this configuration"),
|
|
159
159
|
namespace: z.string().trim().toLowerCase().optional().describe("The namespace of the package"),
|
|
@@ -195,6 +195,7 @@ var StormConfigSchema = z.object({
|
|
|
195
195
|
"trace",
|
|
196
196
|
"all"
|
|
197
197
|
]).default("info").describe("The log level used to filter out lower priority log messages. If not provided, this is defaulted using the `environment` config value (if `environment` is set to `production` then `level` is `error`, else `level` is `debug`)."),
|
|
198
|
+
skipConfigLogging: z.boolean().optional().describe("Should the logging of the current Storm Workspace configuration be skipped?"),
|
|
198
199
|
registry: RegistryConfigSchema,
|
|
199
200
|
configFile: z.string().trim().nullable().default(null).describe("The filepath of the Storm config. When this field is null, no config file was found in the current workspace."),
|
|
200
201
|
colors: ColorConfigSchema.or(ColorConfigMapSchema).describe("Storm theme config values used for styling various package elements"),
|
|
@@ -357,14 +358,17 @@ import { existsSync } from "node:fs";
|
|
|
357
358
|
import { join } from "node:path";
|
|
358
359
|
var MAX_PATH_SEARCH_DEPTH = 30;
|
|
359
360
|
var depth = 0;
|
|
360
|
-
function findFolderUp(startPath, endFileNames) {
|
|
361
|
+
function findFolderUp(startPath, endFileNames = [], endDirectoryNames = []) {
|
|
361
362
|
const _startPath = startPath ?? process.cwd();
|
|
363
|
+
if (endDirectoryNames.some((endDirName) => existsSync(join(_startPath, endDirName)))) {
|
|
364
|
+
return _startPath;
|
|
365
|
+
}
|
|
362
366
|
if (endFileNames.some((endFileName) => existsSync(join(_startPath, endFileName)))) {
|
|
363
367
|
return _startPath;
|
|
364
368
|
}
|
|
365
369
|
if (_startPath !== "/" && depth++ < MAX_PATH_SEARCH_DEPTH) {
|
|
366
370
|
const parent = join(_startPath, "..");
|
|
367
|
-
return findFolderUp(parent, endFileNames);
|
|
371
|
+
return findFolderUp(parent, endFileNames, endDirectoryNames);
|
|
368
372
|
}
|
|
369
373
|
return void 0;
|
|
370
374
|
}
|
|
@@ -372,17 +376,17 @@ __name(findFolderUp, "findFolderUp");
|
|
|
372
376
|
|
|
373
377
|
// ../config-tools/src/utilities/find-workspace-root.ts
|
|
374
378
|
var rootFiles = [
|
|
375
|
-
"storm.json",
|
|
376
|
-
"storm.json",
|
|
377
|
-
"storm.yaml",
|
|
378
|
-
"storm.yml",
|
|
379
|
-
"storm.js",
|
|
380
|
-
"storm.ts",
|
|
381
|
-
".storm.json",
|
|
382
|
-
".storm.yaml",
|
|
383
|
-
".storm.yml",
|
|
384
|
-
".storm.js",
|
|
385
|
-
".storm.ts",
|
|
379
|
+
"storm-workspace.json",
|
|
380
|
+
"storm-workspace.json",
|
|
381
|
+
"storm-workspace.yaml",
|
|
382
|
+
"storm-workspace.yml",
|
|
383
|
+
"storm-workspace.js",
|
|
384
|
+
"storm-workspace.ts",
|
|
385
|
+
".storm-workspace.json",
|
|
386
|
+
".storm-workspace.yaml",
|
|
387
|
+
".storm-workspace.yml",
|
|
388
|
+
".storm-workspace.js",
|
|
389
|
+
".storm-workspace.ts",
|
|
386
390
|
"lerna.json",
|
|
387
391
|
"nx.json",
|
|
388
392
|
"turbo.json",
|
|
@@ -406,11 +410,18 @@ var rootFiles = [
|
|
|
406
410
|
"pnpm-lock.yml",
|
|
407
411
|
"bun.lockb"
|
|
408
412
|
];
|
|
413
|
+
var rootDirectories = [
|
|
414
|
+
".storm-workspace",
|
|
415
|
+
".nx",
|
|
416
|
+
".github",
|
|
417
|
+
".vscode",
|
|
418
|
+
".verdaccio"
|
|
419
|
+
];
|
|
409
420
|
function findWorkspaceRootSafe(pathInsideMonorepo) {
|
|
410
421
|
if (process.env.STORM_WORKSPACE_ROOT || process.env.NX_WORKSPACE_ROOT_PATH) {
|
|
411
422
|
return correctPaths(process.env.STORM_WORKSPACE_ROOT ?? process.env.NX_WORKSPACE_ROOT_PATH);
|
|
412
423
|
}
|
|
413
|
-
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles));
|
|
424
|
+
return correctPaths(findFolderUp(pathInsideMonorepo ?? process.cwd(), rootFiles, rootDirectories));
|
|
414
425
|
}
|
|
415
426
|
__name(findWorkspaceRootSafe, "findWorkspaceRootSafe");
|
|
416
427
|
function findWorkspaceRoot(pathInsideMonorepo) {
|
|
@@ -804,10 +815,10 @@ var getConfigFileByName = /* @__PURE__ */ __name(async (fileName, filePath, opti
|
|
|
804
815
|
}, "getConfigFileByName");
|
|
805
816
|
var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames = []) => {
|
|
806
817
|
const workspacePath = filePath ? filePath : findWorkspaceRoot(filePath);
|
|
807
|
-
const result = await getConfigFileByName("storm", workspacePath);
|
|
818
|
+
const result = await getConfigFileByName("storm-workspace", workspacePath);
|
|
808
819
|
let config = result.config;
|
|
809
820
|
const configFile = result.configFile;
|
|
810
|
-
if (config && configFile && Object.keys(config).length > 0) {
|
|
821
|
+
if (config && configFile && Object.keys(config).length > 0 && !config.skipConfigLogging) {
|
|
811
822
|
writeTrace(`Found Storm configuration file "${configFile.includes(`${workspacePath}/`) ? configFile.replace(`${workspacePath}/`, "") : configFile}" at "${workspacePath}"`, {
|
|
812
823
|
logLevel: "all"
|
|
813
824
|
});
|
|
@@ -816,9 +827,11 @@ var getConfigFile = /* @__PURE__ */ __name(async (filePath, additionalFileNames
|
|
|
816
827
|
const results = await Promise.all(additionalFileNames.map((fileName) => getConfigFileByName(fileName, workspacePath)));
|
|
817
828
|
for (const result2 of results) {
|
|
818
829
|
if (result2?.config && result2?.configFile && Object.keys(result2.config).length > 0) {
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
830
|
+
if (!config.skipConfigLogging && !result2.config.skipConfigLogging) {
|
|
831
|
+
writeTrace(`Found alternative configuration file "${result2.configFile.includes(`${workspacePath}/`) ? result2.configFile.replace(`${workspacePath}/`, "") : result2.configFile}" at "${workspacePath}"`, {
|
|
832
|
+
logLevel: "all"
|
|
833
|
+
});
|
|
834
|
+
}
|
|
822
835
|
config = defu(result2.config ?? {}, config ?? {});
|
|
823
836
|
}
|
|
824
837
|
}
|
|
@@ -894,7 +907,8 @@ var getConfigEnv = /* @__PURE__ */ __name(() => {
|
|
|
894
907
|
cyclone: process.env[`${prefix}REGISTRY_CYCLONE`] || void 0,
|
|
895
908
|
container: process.env[`${prefix}REGISTRY_CONTAINER`] || void 0
|
|
896
909
|
},
|
|
897
|
-
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0
|
|
910
|
+
logLevel: process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== void 0 ? process.env[`${prefix}LOG_LEVEL`] && Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`])) : process.env[`${prefix}LOG_LEVEL`] : void 0,
|
|
911
|
+
skipConfigLogging: process.env[`${prefix}SKIP_CONFIG_LOGGING`] !== void 0 ? Boolean(process.env[`${prefix}SKIP_CONFIG_LOGGING`]) : void 0
|
|
898
912
|
};
|
|
899
913
|
const themeNames = Object.keys(process.env).filter((envKey) => envKey.startsWith(`${prefix}COLOR_`) && COLOR_KEYS.every((colorKey) => !envKey.startsWith(`${prefix}COLOR_LIGHT_${colorKey}`) && !envKey.startsWith(`${prefix}COLOR_DARK_${colorKey}`)));
|
|
900
914
|
config.colors = themeNames.length > 0 ? themeNames.reduce((ret, themeName) => {
|
|
@@ -1129,6 +1143,9 @@ var setConfigEnv = /* @__PURE__ */ __name((config) => {
|
|
|
1129
1143
|
process.env.NX_VERBOSE_LOGGING = String(getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false);
|
|
1130
1144
|
process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
|
|
1131
1145
|
}
|
|
1146
|
+
if (config.skipConfigLogging !== void 0) {
|
|
1147
|
+
process.env[`${prefix}SKIP_CONFIG_LOGGING`] = String(config.skipConfigLogging);
|
|
1148
|
+
}
|
|
1132
1149
|
process.env[`${prefix}CONFIG`] = JSON.stringify(config);
|
|
1133
1150
|
for (const key of Object.keys(config.extensions ?? {})) {
|
|
1134
1151
|
config.extensions[key] && Object.keys(config.extensions[key]) && setExtensionEnv(key, config.extensions[key]);
|
|
@@ -1246,7 +1263,7 @@ var createStormConfig = /* @__PURE__ */ __name(async (extensionName, schema, wor
|
|
|
1246
1263
|
const defaultConfig = await getDefaultConfig(_workspaceRoot);
|
|
1247
1264
|
const configFile = await getConfigFile(_workspaceRoot);
|
|
1248
1265
|
if (!configFile && !skipLogs) {
|
|
1249
|
-
writeWarning("No Storm
|
|
1266
|
+
writeWarning("No Storm Workspace configuration file found in the current repository. Please ensure this is the expected behavior - you can add a `storm-workspace.json` file to the root of your workspace if it is not.\n", {
|
|
1250
1267
|
logLevel: "all"
|
|
1251
1268
|
});
|
|
1252
1269
|
}
|
|
@@ -1284,8 +1301,8 @@ var createConfigExtension = /* @__PURE__ */ __name((extensionName, schema) => {
|
|
|
1284
1301
|
var loadStormConfig = /* @__PURE__ */ __name(async (workspaceRoot, skipLogs = false) => {
|
|
1285
1302
|
const config = await createStormConfig(void 0, void 0, workspaceRoot, skipLogs);
|
|
1286
1303
|
setConfigEnv(config);
|
|
1287
|
-
if (!skipLogs) {
|
|
1288
|
-
writeTrace(`\u2699\uFE0F Using Storm configuration:
|
|
1304
|
+
if (!skipLogs && !config.skipConfigLogging) {
|
|
1305
|
+
writeTrace(`\u2699\uFE0F Using Storm Workspace configuration:
|
|
1289
1306
|
${formatLogMessage(config)}`, config);
|
|
1290
1307
|
}
|
|
1291
1308
|
return config;
|