You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
refactor(devframe): centralize diagnostics reporter in devframe/utils/nostics
Move the ANSI console reporter registration into the shared
`devframe/utils/nostics` `defineDiagnostics` wrapper, which pre-wires it
ahead of any caller-supplied reporters. Every module-level
`diagnostics.ts` (devframe core, @devframes/hub, @devframes/json-render,
and the built-in plugins) now just calls `defineDiagnostics({ docsBase,
codes })` — no local reporter, no `colors`/`ansiFormatter` imports.
Delete the per-package `diagnostics-reporter.ts` files and collapse the
host's `defineDiagnostics` to the shared wrapper (it already prepends the
reporter, so no extra merging is needed).
Copy file name to clipboardExpand all lines: AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ Any change to one lands in the other in the same PR: adding a dock, wiring a new
91
91
92
92
## Structured Diagnostics (Error Codes)
93
93
94
-
All node-side warnings and errors use structured diagnostics via [`nostics`](https://www.npmjs.com/package/nostics). Never use raw `console.warn`, `console.error`, or `throw new Error` with ad-hoc messages in node-side code - always define a coded diagnostic. Import `defineDiagnostics`, `Diagnostic`, and `ansiFormatter`from `devframe/utils/nostics` rather than from `nostics` directly - it re-exports the package's API so plugins don't need their own `nostics`dependency.
94
+
All node-side warnings and errors use structured diagnostics via [`nostics`](https://www.npmjs.com/package/nostics). Never use raw `console.warn`, `console.error`, or `throw new Error` with ad-hoc messages in node-side code - always define a coded diagnostic. Import `defineDiagnostics` (and `Diagnostic` for `instanceof` checks) from `devframe/utils/nostics` rather than from `nostics` directly - it pre-wires devframe's ANSI console reporter, so a plugin's `diagnostics.ts` never builds its own reporter (`colors`, `ansiFormatter`) or depends on `nostics`itself.
95
95
96
96
Prefix: **`DF`**. Codes are sequential 4-digit numbers (e.g. `DF0033`). Check the existing diagnostics file to find the next available number.
0 commit comments