@storm-software/config-tools 1.41.1 → 1.41.3

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.41.3 (2024-04-26)
2
+
3
+
4
+ ### 🩹 Fixes
5
+
6
+ - **config-tools:** Resolved issue applying default config ([8e1403b3](https://github.com/storm-software/storm-ops/commit/8e1403b3))
7
+
8
+
9
+ ### ❤️ Thank You
10
+
11
+ - Patrick Sullivan
12
+
13
+ ## 1.41.2 (2024-04-26)
14
+
15
+
16
+ ### 🩹 Fixes
17
+
18
+ - **config-tools:** Ensure defaulting doesn't overwrite file ([d14794e5](https://github.com/storm-software/storm-ops/commit/d14794e5))
19
+
20
+
21
+ ### ❤️ Thank You
22
+
23
+ - Patrick Sullivan
24
+
1
25
  ## 1.41.1 (2024-04-25)
2
26
 
3
27
 
package/index.cjs CHANGED
@@ -72167,7 +72167,7 @@ var StormConfigSchema = z2.object({
72167
72167
  namespace: z2.string().trim().toLowerCase().optional().describe("The namespace of the package"),
72168
72168
  organization: z2.string().trim().default("storm-software").describe("The organization of the workspace"),
72169
72169
  repository: z2.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
72170
- license: z2.string().trim().default("Apache License 2.0").describe("The root directory of the package"),
72170
+ license: z2.string().trim().default("Apache 2.0").describe("The root directory of the package"),
72171
72171
  homepage: z2.string().trim().url().default("https://stormsoftware.com").describe("The homepage of the workspace"),
72172
72172
  branch: z2.string().trim().default("main").describe("The branch of the workspace"),
72173
72173
  preid: z2.string().optional().describe("A tag specifying the version pre-release identifier"),
@@ -72249,7 +72249,7 @@ var DEFAULT_COLOR_CONFIG = {
72249
72249
  var DEFAULT_STORM_CONFIG = {
72250
72250
  name: "storm",
72251
72251
  namespace: "storm-software",
72252
- license: "Apache License 2.0",
72252
+ license: "Apache 2.0",
72253
72253
  homepage: "https://stormsoftware.com",
72254
72254
  owner: "@storm-software/development",
72255
72255
  worker: "stormie-bot",
@@ -72300,7 +72300,14 @@ var getDefaultConfig = (config = {}, root) => {
72300
72300
  }
72301
72301
  return StormConfigSchema.parse({
72302
72302
  ...DEFAULT_STORM_CONFIG,
72303
- ...config,
72303
+ ...Object.keys(config).reduce((ret, key) => {
72304
+ if (typeof config[key] === "string" && !config[key]) {
72305
+ ret[key] = void 0;
72306
+ } else {
72307
+ ret[key] = config[key];
72308
+ }
72309
+ return ret;
72310
+ }, {}),
72304
72311
  colors: { ...DEFAULT_COLOR_CONFIG, ...config.colors },
72305
72312
  workspaceRoot,
72306
72313
  name,
@@ -72521,10 +72528,10 @@ var getStopwatch = (name) => {
72521
72528
  };
72522
72529
  };
72523
72530
  var formatLogMessage = (message, prefix = "-") => {
72524
- return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
72525
- (key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
72526
- ${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
72527
- ).join("\n") : message;
72531
+ return `
72532
+ ${typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
72533
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], `${prefix}-`) : message[key]}`
72534
+ ).join("\n") : message}`;
72528
72535
  };
72529
72536
  var _isFunction = (value2) => {
72530
72537
  try {
@@ -73144,13 +73151,15 @@ var loadStormConfig = async (workspaceRoot) => {
73144
73151
  { logLevel: "all" }
73145
73152
  );
73146
73153
  }
73147
- config = StormConfigSchema.parse(
73148
- await getDefaultConfig(
73149
- (0, import_deepmerge2.default)(configFile, getConfigEnv(), {}),
73150
- _workspaceRoot
73151
- )
73154
+ config = getDefaultConfig(
73155
+ (0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
73156
+ _workspaceRoot
73152
73157
  );
73153
73158
  setConfigEnv(config);
73159
+ writeInfo(`Using Storm configuration:
73160
+ ${formatLogMessage(config)}`, {
73161
+ logLevel: "all"
73162
+ });
73154
73163
  return config;
73155
73164
  };
73156
73165
  // Annotate the CommonJS export names for ESM import in node:
package/index.js CHANGED
@@ -72125,7 +72125,7 @@ var StormConfigSchema = z2.object({
72125
72125
  namespace: z2.string().trim().toLowerCase().optional().describe("The namespace of the package"),
72126
72126
  organization: z2.string().trim().default("storm-software").describe("The organization of the workspace"),
72127
72127
  repository: z2.string().trim().url().optional().describe("The repo URL of the workspace (i.e. GitHub)"),
72128
- license: z2.string().trim().default("Apache License 2.0").describe("The root directory of the package"),
72128
+ license: z2.string().trim().default("Apache 2.0").describe("The root directory of the package"),
72129
72129
  homepage: z2.string().trim().url().default("https://stormsoftware.com").describe("The homepage of the workspace"),
72130
72130
  branch: z2.string().trim().default("main").describe("The branch of the workspace"),
72131
72131
  preid: z2.string().optional().describe("A tag specifying the version pre-release identifier"),
@@ -72207,7 +72207,7 @@ var DEFAULT_COLOR_CONFIG = {
72207
72207
  var DEFAULT_STORM_CONFIG = {
72208
72208
  name: "storm",
72209
72209
  namespace: "storm-software",
72210
- license: "Apache License 2.0",
72210
+ license: "Apache 2.0",
72211
72211
  homepage: "https://stormsoftware.com",
72212
72212
  owner: "@storm-software/development",
72213
72213
  worker: "stormie-bot",
@@ -72258,7 +72258,14 @@ var getDefaultConfig = (config = {}, root) => {
72258
72258
  }
72259
72259
  return StormConfigSchema.parse({
72260
72260
  ...DEFAULT_STORM_CONFIG,
72261
- ...config,
72261
+ ...Object.keys(config).reduce((ret, key) => {
72262
+ if (typeof config[key] === "string" && !config[key]) {
72263
+ ret[key] = void 0;
72264
+ } else {
72265
+ ret[key] = config[key];
72266
+ }
72267
+ return ret;
72268
+ }, {}),
72262
72269
  colors: { ...DEFAULT_COLOR_CONFIG, ...config.colors },
72263
72270
  workspaceRoot,
72264
72271
  name,
@@ -72479,10 +72486,10 @@ var getStopwatch = (name) => {
72479
72486
  };
72480
72487
  };
72481
72488
  var formatLogMessage = (message, prefix = "-") => {
72482
- return typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
72483
- (key) => ` ${prefix} ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? `
72484
- ${formatLogMessage(message[key], `${prefix}-`)}` : message[key]}`
72485
- ).join("\n") : message;
72489
+ return `
72490
+ ${typeof message === "string" ? message : typeof message === "object" ? Object.keys(message).map(
72491
+ (key) => ` ${prefix}> ${key} = ${_isFunction(message[key]) ? "<function>" : typeof message[key] === "object" ? formatLogMessage(message[key], `${prefix}-`) : message[key]}`
72492
+ ).join("\n") : message}`;
72486
72493
  };
72487
72494
  var _isFunction = (value2) => {
72488
72495
  try {
@@ -73102,13 +73109,15 @@ var loadStormConfig = async (workspaceRoot) => {
73102
73109
  { logLevel: "all" }
73103
73110
  );
73104
73111
  }
73105
- config = StormConfigSchema.parse(
73106
- await getDefaultConfig(
73107
- (0, import_deepmerge2.default)(configFile, getConfigEnv(), {}),
73108
- _workspaceRoot
73109
- )
73112
+ config = getDefaultConfig(
73113
+ (0, import_deepmerge2.default)(getConfigEnv(), configFile, {}),
73114
+ _workspaceRoot
73110
73115
  );
73111
73116
  setConfigEnv(config);
73117
+ writeInfo(`Using Storm configuration:
73118
+ ${formatLogMessage(config)}`, {
73119
+ logLevel: "all"
73120
+ });
73112
73121
  return config;
73113
73122
  };
73114
73123
  export {