Skip to content

refactor: report errors and warnings as nostics diagnostics - #838

Merged
danielroe merged 2 commits into
fix/review-followupsfrom
refactor/nostics
Nov 18, 2026
Merged

danielroe merged 2 commits into
fix/review-followupsfrom
refactor/nostics

Conversation

@danielroe

Copy link
Copy Markdown
Member

🔗 Linked issue

📚 Description

this uses nostics for printing useful diagnostics instead of plain logging

@danielroe
danielroe added this pull request to stack #839 November 17, 2026 23:15
@socket-security

socket-security Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatednostics@​1.3.0 ⏵ 1.4.010010010090100

View full report

@pkg-pr-new

pkg-pr-new Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/nuxt/module-builder/@nuxt/module-builder@838

commit: 7f2af0d

@coderabbitai

coderabbitai Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c02ef60-2ac2-44c2-86b7-f4e81215a035
Commits

Reviewing files that changed from the base of the PR and between 78527c8 and 7f2af0d.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The change adds structured error and warning diagnostics with codes, formatting, source locations, fixes, and documentation links. Build, package, tsdown, CLI, and legacy configuration paths now use diagnostics in place of many inline messages. The CLI reports recognised diagnostics and exits with status 1. Tests now check diagnostic codes, warning behaviour, and terminal formatting. The contributor guide and upgrade guide describe diagnostic codes and links.

Estimated code review effort: 4 (Complex) | ~60 minutes

Merge Risk: Low · previous review 78527

Diagnostics now go through a process-wide logger. When one tsdown run has several builder configs, a warning from one config can follow another config's warning policy and change pass or fail behaviour. Single-config builds are unaffected, so this is a bounded follow-up.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title says the PR refactors error and warning reporting to use nostics diagnostics. The changeset does this: it adds src/diagnostics.ts, replaces Error and logger.warn calls with errors.* and warn…
Description check Passed The description states that the PR uses nostics to print useful diagnostics instead of plain logging. This matches the changeset, which adds nostics to package.json and replaces plain logging with dia…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title says the PR refactors error and warning reporting to use nostics diagnostics. The changeset does this: it adds src/diagnostics.ts, replaces Error and logger.warn calls with errors.* and warnings.* diagnostic factories across build, commands, legacy and tsdown code, and adds the nostics dependency in package.json. The title names the main change.

Full details: Description check

Explanation

The description states that the PR uses nostics to print useful diagnostics instead of plain logging. This matches the changeset, which adds nostics to package.json and replaces plain logging with diagnostic reporting. The description is brief and omits the linked issue, but it is related to the changes, so the lenient check passes.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Fix failing CI checks

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4b3cd677-250e-49ea-b2be-397273e3ab95
Commits

Reviewing files that changed from the base of the PR and between bb00724 and 78527c8.

Files ignored due to path filters: 1

  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
Files selected for processing: 25

  • CONTRIBUTING.md
  • docs/upgrade-v2.md
  • package.json
  • src/build/build.ts
  • src/build/guide.ts
  • src/build/loader.ts
  • src/build/module-declarations.ts
  • src/build/options.ts
  • src/build/package.ts
  • src/cli.ts
  • src/commands/_shared.ts
  • src/commands/build.ts
  • src/commands/config-file.ts
  • src/diagnostics.ts
  • src/legacy/build-config.ts
  • src/legacy/package-paths.ts
  • src/tsdown/build.ts
  • src/tsdown/plugin.ts
  • src/tsdown/setup.ts
  • test/builder.spec.ts
  • test/cli.spec.ts
  • test/legacy.spec.ts
  • test/pack-env.ts
  • test/unit.spec.ts
  • test/utils.ts
Files with no reviewable changes: 1

  • src/build/guide.ts

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

@danielroe
danielroe enabled stacked auto-merge November 18, 2026 15:29
@danielroe
danielroe added this pull request to the merge queue Nov 18, 2026
Merged via the queue into main with commit e144598 Nov 18, 2026
16 of 17 checks passed
@danielroe
danielroe deleted the refactor/nostics branch November 18, 2026 16:01
@github-actions github-actions Bot mentioned this pull request Nov 18, 2026
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.

1 participant