@storm-software/config-tools 1.36.0 → 1.36.2

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 CHANGED
@@ -1,3 +1,27 @@
1
+ ## 1.36.2 (2024-04-13)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **config:** Update config to use `outputDirectory` value ([42604faf](https://github.com/storm-software/storm-ops/commit/42604faf))
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Patrick Sullivan
12
+
13
+ ## 1.36.1 (2024-04-13)
14
+
15
+
16
+ ### 🩹 Fixes
17
+
18
+ - **build-tools:** Update the path provided to include TypeScript declarations ([a1a74b21](https://github.com/storm-software/storm-ops/commit/a1a74b21))
19
+
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Patrick Sullivan
24
+
1
25
  ## 1.36.0 (2024-04-09)
2
26
 
3
27
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storm-software/config-tools",
3
- "version": "1.36.0",
3
+ "version": "1.36.2",
4
4
  "private": false,
5
5
  "description": "⚡The Storm-Ops monorepo contains utility applications, tools, and various libraries to create modern and scalable web applications.",
6
6
  "repository": {
@@ -25,7 +25,8 @@ export const createConfig = (workspaceRoot?: string): StormConfig => {
25
25
  * @returns The config for the current Storm workspace
26
26
  */
27
27
  export const createStormConfig = <
28
- TExtensionName extends keyof StormConfig["extensions"] = keyof StormConfig["extensions"],
28
+ TExtensionName extends
29
+ keyof StormConfig["extensions"] = keyof StormConfig["extensions"],
29
30
  TExtensionConfig = any,
30
31
  TExtensionSchema extends ZodTypeAny = ZodTypeAny
31
32
  >(
@@ -55,10 +56,11 @@ export const createStormConfig = <
55
56
  if (schema && extensionName) {
56
57
  result.extensions = {
57
58
  ...result.extensions,
58
- [extensionName]: createConfigExtension<TExtensionName, TExtensionConfig, TExtensionSchema>(
59
- extensionName,
60
- schema
61
- )
59
+ [extensionName]: createConfigExtension<
60
+ TExtensionName,
61
+ TExtensionConfig,
62
+ TExtensionSchema
63
+ >(extensionName, schema)
62
64
  };
63
65
  }
64
66
 
@@ -74,7 +76,8 @@ export const createStormConfig = <
74
76
  * @returns The config for the specified Storm config extension. If the extension does not exist, `undefined` is returned.
75
77
  */
76
78
  export const createConfigExtension = <
77
- TExtensionName extends keyof StormConfig["extensions"] = keyof StormConfig["extensions"],
79
+ TExtensionName extends
80
+ keyof StormConfig["extensions"] = keyof StormConfig["extensions"],
78
81
  TExtensionConfig = any,
79
82
  TExtensionSchema extends ZodTypeAny = ZodTypeAny
80
83
  >(
@@ -98,7 +101,9 @@ export const createConfigExtension = <
98
101
  /**
99
102
  * Load the config file values for the current Storm workspace into environment variables
100
103
  */
101
- export const loadStormConfig = async (workspaceRoot?: string): Promise<StormConfig> => {
104
+ export const loadStormConfig = async (
105
+ workspaceRoot?: string
106
+ ): Promise<StormConfig> => {
102
107
  let config = {} as StormConfig;
103
108
 
104
109
  let _workspaceRoot = workspaceRoot;
@@ -10,17 +10,23 @@ import { correctPaths } from "../utilities/correct-paths";
10
10
  * @param extensionName - The name of the extension module
11
11
  * @returns The config for the specified Storm extension module. If the module does not exist, `undefined` is returned.
12
12
  */
13
- export const getExtensionEnv = <TConfig extends Record<string, any> = Record<string, any>>(
13
+ export const getExtensionEnv = <
14
+ TConfig extends Record<string, any> = Record<string, any>
15
+ >(
14
16
  extensionName: string
15
17
  ): TConfig | undefined => {
16
18
  const prefix = `STORM_EXTENSION_${extensionName.toUpperCase()}_`;
17
19
  return Object.keys(process.env)
18
- .filter((key) => key.startsWith(prefix))
20
+ .filter(key => key.startsWith(prefix))
19
21
  .reduce((ret: Record<string, any>, key: string) => {
20
22
  const name = key
21
23
  .replace(prefix, "")
22
24
  .split("_")
23
- .map((i) => (i.length > 0 ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1) : ""))
25
+ .map(i =>
26
+ i.length > 0
27
+ ? i.trim().charAt(0).toUpperCase() + i.trim().slice(1)
28
+ : ""
29
+ )
24
30
  .join("");
25
31
  if (name) {
26
32
  ret[name] = process.env[key];
@@ -45,7 +51,9 @@ export const getConfigEnv = (): DeepPartial<StormConfig> => {
45
51
  owner: process.env[`${prefix}OWNER`],
46
52
  worker: process.env[`${prefix}WORKER`],
47
53
  organization: process.env[`${prefix}ORGANIZATION`],
48
- packageManager: process.env[`${prefix}PACKAGE_MANAGER`] as StormConfig["packageManager"],
54
+ packageManager: process.env[
55
+ `${prefix}PACKAGE_MANAGER`
56
+ ] as StormConfig["packageManager"],
49
57
  license: process.env[`${prefix}LICENSE`],
50
58
  homepage: process.env[`${prefix}HOMEPAGE`],
51
59
  timezone: process.env[`${prefix}TIMEZONE`] ?? process.env.TZ,
@@ -60,14 +68,16 @@ export const getConfigEnv = (): DeepPartial<StormConfig> => {
60
68
  : undefined,
61
69
  cacheDirectory: correctPaths(process.env[`${prefix}CACHE_DIRECTORY`]),
62
70
  runtimeVersion: process.env[`${prefix}RUNTIME_VERSION`],
63
- runtimeDirectory: correctPaths(process.env[`${prefix}RUNTIME_DIRECTORY`]),
71
+ outputDirectory: correctPaths(process.env[`${prefix}OUTPUT_DIRECTORY`]),
64
72
  env: (process.env[`${prefix}ENV`] ??
65
73
  process.env.NODE_ENV ??
66
74
  process.env.ENVIRONMENT) as StormConfig["env"],
67
75
  ci:
68
76
  process.env[`${prefix}CI`] !== undefined
69
77
  ? Boolean(
70
- process.env[`${prefix}CI`] ?? process.env.CI ?? process.env.CONTINUOUS_INTEGRATION
78
+ process.env[`${prefix}CI`] ??
79
+ process.env.CI ??
80
+ process.env.CONTINUOUS_INTEGRATION
71
81
  )
72
82
  : undefined,
73
83
  colors: {
@@ -86,10 +96,15 @@ export const getConfigEnv = (): DeepPartial<StormConfig> => {
86
96
  ? JSON.parse(process.env[`${prefix}EXTERNAL_PACKAGE_PATTERNS`] as string)
87
97
  : [],
88
98
  logLevel:
89
- process.env[`${prefix}LOG_LEVEL`] !== null && process.env[`${prefix}LOG_LEVEL`] !== undefined
99
+ process.env[`${prefix}LOG_LEVEL`] !== null &&
100
+ process.env[`${prefix}LOG_LEVEL`] !== undefined
90
101
  ? process.env[`${prefix}LOG_LEVEL`] &&
91
- Number.isSafeInteger(Number.parseInt(process.env[`${prefix}LOG_LEVEL`] as string))
92
- ? getLogLevelLabel(Number.parseInt(process.env[`${prefix}LOG_LEVEL`] as string))
102
+ Number.isSafeInteger(
103
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`] as string)
104
+ )
105
+ ? getLogLevelLabel(
106
+ Number.parseInt(process.env[`${prefix}LOG_LEVEL`] as string)
107
+ )
93
108
  : (process.env[`${prefix}LOG_LEVEL`] as LogLevelLabel)
94
109
  : undefined
95
110
  };
@@ -9,7 +9,9 @@ import { correctPaths } from "../utilities/correct-paths";
9
9
  * @param extensionName - The name of the extension module
10
10
  * @returns The config for the specified Storm extension module. If the module does not exist, `undefined` is returned.
11
11
  */
12
- export const setExtensionEnv = <TConfig extends Record<string, any> = Record<string, any>>(
12
+ export const setExtensionEnv = <
13
+ TConfig extends Record<string, any> = Record<string, any>
14
+ >(
13
15
  extensionName: string,
14
16
  extension: TConfig
15
17
  ) => {
@@ -35,8 +37,9 @@ export const setExtensionEnv = <TConfig extends Record<string, any> = Record<str
35
37
  });
36
38
  }
37
39
 
38
- process.env[`STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`] =
39
- extension[key];
40
+ process.env[
41
+ `STORM_EXTENSION_${extensionName.toUpperCase()}_${extensionKey.toUpperCase()}`
42
+ ] = extension[key];
40
43
  }
41
44
  }
42
45
  };
@@ -98,10 +101,14 @@ export const setConfigEnv = (config: StormConfig) => {
98
101
  process.env.NX_WORKSPACE_ROOT_PATH = correctPaths(config.workspaceRoot);
99
102
  }
100
103
  if (config.packageDirectory) {
101
- process.env[`${prefix}PACKAGE_DIRECTORY`] = correctPaths(config.packageDirectory);
104
+ process.env[`${prefix}PACKAGE_DIRECTORY`] = correctPaths(
105
+ config.packageDirectory
106
+ );
102
107
  }
103
108
  if (config.buildDirectory) {
104
- process.env[`${prefix}BUILD_DIRECTORY`] = correctPaths(config.buildDirectory);
109
+ process.env[`${prefix}BUILD_DIRECTORY`] = correctPaths(
110
+ config.buildDirectory
111
+ );
105
112
  }
106
113
  if (config.skipCache !== undefined) {
107
114
  process.env[`${prefix}SKIP_CACHE`] = String(config.skipCache);
@@ -111,7 +118,9 @@ export const setConfigEnv = (config: StormConfig) => {
111
118
  }
112
119
  }
113
120
  if (!config.skipCache && config.cacheDirectory) {
114
- process.env[`${prefix}CACHE_DIRECTORY`] = correctPaths(config.cacheDirectory);
121
+ process.env[`${prefix}CACHE_DIRECTORY`] = correctPaths(
122
+ config.cacheDirectory
123
+ );
115
124
  // if (config.cacheDirectory.includes("/storm") || config.cacheDirectory.includes("\\storm")) {
116
125
  // const nxCacheDirectory = join(
117
126
  // config.cacheDirectory.includes("/storm")
@@ -126,8 +135,10 @@ export const setConfigEnv = (config: StormConfig) => {
126
135
  if (config.runtimeVersion) {
127
136
  process.env[`${prefix}RUNTIME_VERSION`] = config.runtimeVersion;
128
137
  }
129
- if (config.runtimeDirectory) {
130
- process.env[`${prefix}RUNTIME_DIRECTORY`] = correctPaths(config.runtimeDirectory);
138
+ if (config.outputDirectory) {
139
+ process.env[`${prefix}OUTPUT_DIRECTORY`] = correctPaths(
140
+ config.outputDirectory
141
+ );
131
142
  }
132
143
  if (config.env) {
133
144
  process.env[`${prefix}ENV`] = config.env;
@@ -180,7 +191,8 @@ export const setConfigEnv = (config: StormConfig) => {
180
191
  process.env.NX_VERBOSE_LOGGING = String(
181
192
  getLogLevel(config.logLevel) >= LogLevel.DEBUG ? true : false
182
193
  );
183
- process.env.RUST_BACKTRACE = getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
194
+ process.env.RUST_BACKTRACE =
195
+ getLogLevel(config.logLevel) >= LogLevel.DEBUG ? "full" : "none";
184
196
  }
185
197
  process.env[`${prefix}CONFIG`] = JSON.stringify(config);
186
198
 
@@ -76,7 +76,7 @@ ${_chalk.bold.hex(config?.colors?.error ? config.colors.error : "#7d1a1a")(">")}
76
76
  `
77
77
  ${_chalk.bold.hex(config?.colors?.warning ? config.colors.warning : "#fcc419")("> ")} ${_chalk.bold
78
78
  .bgHex(config?.colors?.warning ? config.colors.warning : "#fcc419")
79
- .whiteBright(" ⚠ Warn ")} ${_chalk.hex(
79
+ .whiteBright(" ⚠ Warn ")} ${_chalk.hex(
80
80
  config?.colors?.warning ? config.colors.warning : "#fcc419"
81
81
  )(message)}
82
82
  `