From 05e70255e78abf1e5dabf8e74a207ea6ee5def0e Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 23 Nov 2022 14:03:03 -0800 Subject: [PATCH 1/3] Add debug arg. --- packages/packemon/package.json | 1 + packages/packemon/src/bin.ts | 5 +++++ packages/packemon/src/commands/Base.ts | 3 +++ 3 files changed, 9 insertions(+) diff --git a/packages/packemon/package.json b/packages/packemon/package.json index 775a38315..501d102fc 100644 --- a/packages/packemon/package.json +++ b/packages/packemon/package.json @@ -85,6 +85,7 @@ "babel-plugin-env-constants": "^2.0.2", "babel-preset-solid": "^1.6.0", "browserslist": "^4.21.4", + "debug": "^4.3.4", "execa": "^5.1.1", "fast-glob": "^3.2.12", "filesize": "^10.0.5", diff --git a/packages/packemon/src/bin.ts b/packages/packemon/src/bin.ts index 782b8f5ec..0f43517e0 100644 --- a/packages/packemon/src/bin.ts +++ b/packages/packemon/src/bin.ts @@ -1,3 +1,4 @@ +import debug from 'debug'; import { checkPackageOutdated, Program } from '@boost/cli'; import { getVersion } from './helpers/getVersion'; import { @@ -21,6 +22,10 @@ try { // Ignore } +if (process.argv.includes('--debug')) { + debug.enable('packemon:*'); +} + async function run() { const program = new Program({ bin: 'packemon', diff --git a/packages/packemon/src/commands/Base.ts b/packages/packemon/src/commands/Base.ts index e0b88a6d4..25b653bbc 100644 --- a/packages/packemon/src/commands/Base.ts +++ b/packages/packemon/src/commands/Base.ts @@ -15,6 +15,9 @@ export abstract class BaseCommand< @Arg.String('Current working directory to run in', { category: 'global' }) cwd: string = ''; + @Arg.Flag('Enable debug logs', { category: 'global' }) + debug: boolean = false; + @Arg.String('Only generate specific output formats', { category: 'filter', short: 'f' }) formats: string = ''; From 25717a517e44dd80348b0af2ef7f90b0a810309a Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 23 Nov 2022 14:08:18 -0800 Subject: [PATCH 2/3] Bump From 339abb23b8a9a015f1f5df01f6deeb798c90e23d Mon Sep 17 00:00:00 2001 From: Miles Johnson Date: Wed, 23 Nov 2022 14:14:12 -0800 Subject: [PATCH 3/3] Update lock. --- yarn.lock | 1 + 1 file changed, 1 insertion(+) diff --git a/yarn.lock b/yarn.lock index 4cc1f7411..4f73d7513 100644 --- a/yarn.lock +++ b/yarn.lock @@ -16669,6 +16669,7 @@ __metadata: babel-plugin-env-constants: ^2.0.2 babel-preset-solid: ^1.6.0 browserslist: ^4.21.4 + debug: ^4.3.4 execa: ^5.1.1 fast-glob: ^3.2.12 filesize: ^10.0.5