Skip to content

fix(swc): support silent mode for running log#3295

Merged
kamilmysliwiec merged 1 commit intonestjs:v12.0.0from
vinubabu323:fix/3164-swc-silent-log
Apr 7, 2026
Merged

fix(swc): support silent mode for running log#3295
kamilmysliwiec merged 1 commit intonestjs:v12.0.0from
vinubabu323:fix/3164-swc-silent-log

Conversation

@vinubabu323
Copy link
Copy Markdown

@vinubabu323 vinubabu323 commented Mar 28, 2026

Add a --silent option to build/start commands and pass it to the SWC compiler extras.

Suppress the SWC 'Running...' status line when silent mode is enabled or npm_config_loglevel is set to silent.

Also adds unit tests for the new SWC logging gate behavior.

Refs #3164

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

[x] Bugfix
[ ] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[ ] Build related changes
[ ] CI related changes
[ ] Other... Please describe:

What is the current behavior?

When SWC is used, the CLI always prints > SWC Running..., which makes stdout noisy and can break piping workflows expecting clean output.

Issue Number: #3164

What is the new behavior?

  • Added --silent option to nest build and nest start

  • Passed silent into SWC compiler extras

  • Suppressed SWC Running... status log when:

    • --silent is passed
    • npm_config_loglevel=silent is set (e.g. npm run ... --silent)
  • Default behavior remains unchanged when silent mode is not enabled

    Does this PR introduce a breaking change?

    [ ] Yes
    [x] No
    

    Other information

    Other information

  • Validation:

    • npm run build
    • npx jest --runInBand --config test/jest-config.json
  • Added unit tests in:

    • test/lib/compiler/swc/swc-compiler.spec.ts
    • Files changed:
      • commands/build.command.ts
      • commands/start.command.ts
      • actions/build.action.ts
      • lib/compiler/swc/swc-compiler.ts
      • test/lib/compiler/swc/swc-compiler.spec.ts

@vinubabu323 vinubabu323 reopened this Mar 28, 2026
@vinubabu323
Copy link
Copy Markdown
Author

Thanks for the approval. Since this still needs merge access, could @kamilmysliwiec please take a look when possible?

@kamilmysliwiec
Copy link
Copy Markdown
Member

Could you rebase it to v12.0.0 branch?

Add a --silent option to build/start commands and pass it to the SWC compiler extras.

Suppress the SWC 'Running...' status line when silent mode is enabled or npm_config_loglevel is set to silent.

Also adds unit tests for the new SWC logging gate behavior.

Refs nestjs#3164
@vinubabu323 vinubabu323 force-pushed the fix/3164-swc-silent-log branch from 5043675 to 880d8b8 Compare April 1, 2026 01:45
@vinubabu323 vinubabu323 changed the base branch from master to v12.0.0 April 1, 2026 01:52
@vinubabu323
Copy link
Copy Markdown
Author

Rebased to v12.0.0. @kamilmysliwiec could you please review? Happy to make any further changes.

@kamilmysliwiec kamilmysliwiec merged commit 0ac11ed into nestjs:v12.0.0 Apr 7, 2026
1 check passed
@kamilmysliwiec
Copy link
Copy Markdown
Member

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants