Skip to content

Commit f2114f3

Browse files
committed
better typescript ergonomic; silent logger by default
1 parent 0786b7d commit f2114f3

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

packages/b2c-cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
},
8282
"repository": "SalesforceCommerceCloud/b2c-cli",
8383
"scripts": {
84-
"build": "shx rm -rf dist && tsc",
84+
"build": "shx rm -rf dist && tsc -p tsconfig.build.json",
8585
"lint": "eslint",
8686
"format": "prettier --write src",
8787
"format:check": "prettier --check src",
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"extends": "./tsconfig.json",
3+
"compilerOptions": {
4+
"customConditions": []
5+
}
6+
}

packages/b2c-cli/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
"skipLibCheck": true,
77
"esModuleInterop": true,
88
"forceConsistentCasingInFileNames": true,
9-
"verbatimModuleSyntax": true
9+
"verbatimModuleSyntax": true,
10+
"customConditions": ["development"]
1011
},
1112
"include": ["./src/**/*"]
1213
}

packages/b2c-tooling/src/logging/logger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function censor(value: unknown): string {
3131
}
3232

3333
let globalLogger: Logger | null = null;
34-
let globalOptions: LoggerOptions = {level: 'info'};
34+
let globalOptions: LoggerOptions = {level: 'silent'};
3535

3636
function createPinoLogger(options: LoggerOptions): Logger {
3737
const level = options.level ?? 'info';
@@ -89,7 +89,7 @@ export function getLogger(): Logger {
8989

9090
export function resetLogger(): void {
9191
globalLogger = null;
92-
globalOptions = {level: 'info'};
92+
globalOptions = {level: 'silent'};
9393
}
9494

9595
export function createSilentLogger(): Logger {

0 commit comments

Comments
 (0)