Skip to content

Commit

Permalink
fix(config-tools): Improved logging and enhanced config json preset
Browse files Browse the repository at this point in the history
  • Loading branch information
sullivanpj committed Apr 26, 2024
1 parent d558fbb commit 5dabb1a
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 19 deletions.
2 changes: 1 addition & 1 deletion packages/config-tools/src/utilities/get-default-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const DEFAULT_COLOR_CONFIG: ColorConfig = {
export const DEFAULT_STORM_CONFIG: any = {
name: "storm",
namespace: "storm-software",
license: "Apache License 2.0",
license: "Apache 2.0",
homepage: "https://stormsoftware.com",
owner: "@storm-software/development",
worker: "stormie-bot",
Expand Down
34 changes: 18 additions & 16 deletions packages/config-tools/src/utilities/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -262,22 +262,24 @@ export const formatLogMessage = (
message?: any,
prefix: string = "-"
): string => {
return typeof message === "string"
? message
: typeof message === "object"
? Object.keys(message)
.map(
key =>
` ${prefix} ${key} = ${
_isFunction(message[key])
? "<function>"
: typeof message[key] === "object"
? `\n${formatLogMessage(message[key], `${prefix}-`)}`
: message[key]
}`
)
.join("\n")
: message;
return `\n${
typeof message === "string"
? message
: typeof message === "object"
? Object.keys(message)
.map(
key =>
` ${prefix}> ${key} = ${
_isFunction(message[key])
? "<function>"
: typeof message[key] === "object"
? formatLogMessage(message[key], `${prefix}-`)
: message[key]
}`
)
.join("\n")
: message
}`;
};

const _isFunction = (
Expand Down
5 changes: 5 additions & 0 deletions packages/config/presets/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
"timezone": "America/New_York",
"locale": "en-US",
"logLevel": "all",
"skipCache": false,
"cacheDirectory": "node_modules/.cache/storm",
"buildDirectory": "dist",
"outputDirectory": "node_modules/.storm",
"packageManager": "npm",
"externalPackagePatterns": ["@storm-software/"],
"colors": {
"light": {
Expand Down
2 changes: 1 addition & 1 deletion packages/config/src/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export const StormConfigSchema = z
license: z
.string()
.trim()
.default("Apache License 2.0")
.default("Apache 2.0")
.describe("The root directory of the package"),
homepage: z
.string()
Expand Down
3 changes: 2 additions & 1 deletion storm.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
"owner": "@storm-software/development",
"timezone": "America/New_York",
"locale": "en-US",
"logLevel": "debug",
"logLevel": "info",
"packageManager": "pnpm",
"externalPackagePatterns": ["@storm-software/"],
"colors": {
"light": {
Expand Down

0 comments on commit 5dabb1a

Please sign in to comment.