Skip to content

feat(devframe)!: migrate from logs-sdk to nostics#19

Merged
antfu merged 1 commit into
mainfrom
antfu/migrate-to-nostics
May 15, 2026
Merged

feat(devframe)!: migrate from logs-sdk to nostics#19
antfu merged 1 commit into
mainfrom
antfu/migrate-to-nostics

Conversation

@antfu
Copy link
Copy Markdown
Contributor

@antfu antfu commented May 15, 2026

Summary

  • Replaces logs-sdk@^0.0.6 with nostics@^0.1.0 (renamed-and-redesigned successor). Updates all 28 emit sites to the new shape (code.throw({...}) / code.report({...}, { method })) and renames definition fields (message/hint/levelwhy/fix + per-call reporter method).
  • Redesigns DevToolsDiagnosticsHost as a shim: keeps register() and host.logger.CODE via a Proxy over an internal registry, and host.defineDiagnostics() pre-wires the shared ANSI console reporter. Drops host.createLogger (no nostics equivalent — use the typed return of defineDiagnostics() directly).
  • New src/utils/diagnostics-reporter.ts exposes the shared ANSI reporter so rpc/ and node/ diagnostics modules can both consume it without crossing the browser/server build boundary. Docs (docs/guide/diagnostics.md, AGENTS.md/CLAUDE.md, error/adapter pages, skill) updated for the new API; tsnapi snapshots regenerated.

Test plan

  • pnpm lint
  • pnpm typecheck
  • pnpm test (319/319 passing — 3 snapshot updates: index, node, types reflecting DevToolsDiagnosticsHost shape change and new DevToolsDefineDiagnosticsOptions export)
  • pnpm build
  • grep -r logs-sdk returns zero hits (including lockfile)

Adopts nostics 0.1.0 (the renamed-and-redesigned logs-sdk):
`message`/`hint`/`level` become `why`/`fix`/per-call reporter method;
`createLogger`/`Logger` are gone (each `defineDiagnostics()` returns
its own callable handles); emit shape is `code.throw({...})` /
`code.report({...}, { method })` instead of `code({...}).method()`.

The `DevToolsDiagnosticsHost` keeps `register()` and `host.logger.CODE`
via a Proxy over an internal registry, and `host.defineDiagnostics()`
pre-wires the shared ANSI console reporter. `host.createLogger` is
dropped (no nostics equivalent — use the typed return of
`defineDiagnostics` directly).
Copilot AI review requested due to automatic review settings May 15, 2026 02:41
@netlify
Copy link
Copy Markdown

netlify Bot commented May 15, 2026

Deploy Preview for devfra ready!

Name Link
🔨 Latest commit 81bed8d
🔍 Latest deploy log https://app.netlify.com/projects/devfra/deploys/6a0687dc30f1ec00077237a7
😎 Deploy Preview https://deploy-preview-19--devfra.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Migrates Devframe’s structured diagnostics layer from logs-sdk to nostics, updating runtime emit sites, public diagnostics host types, docs, package metadata, and API snapshots.

Changes:

  • Replaces logs-sdk with nostics in dependencies and diagnostics definitions.
  • Updates diagnostics emit sites to use diagnostics.CODE.throw(...) / .report(...).
  • Redesigns DevToolsDiagnosticsHost around a proxy-backed registry and updates documentation/snapshots.

Reviewed changes

Copilot reviewed 27 out of 31 changed files in this pull request and generated no comments.

Show a summary per file
File Description
packages/devframe/src/utils/diagnostics-reporter.ts Adds shared ANSI console reporter for nostics diagnostics.
packages/devframe/src/types/diagnostics.ts Updates public diagnostics host and option types for nostics.
packages/devframe/src/types/context.ts Updates diagnostics host documentation wording.
packages/devframe/src/rpc/diagnostics.ts Migrates RPC diagnostic definitions to nostics.
packages/devframe/src/rpc/collector.ts Updates RPC collector diagnostic emit calls.
packages/devframe/src/rpc/handler.ts Updates missing-handler diagnostic emit call.
packages/devframe/src/rpc/serialization.ts Updates JSON serialization diagnostic emit call.
packages/devframe/src/rpc/validation.ts Updates RPC validation diagnostic emit calls.
packages/devframe/src/rpc/dump/collect.ts Updates dump collection diagnostic emit calls.
packages/devframe/src/node/diagnostics.ts Migrates node diagnostic definitions to nostics.
packages/devframe/src/node/host-diagnostics.ts Reworks diagnostics host registry/logger implementation.
packages/devframe/src/node/host-agent.ts Updates agent diagnostic emit calls.
packages/devframe/src/node/host-functions.ts Updates RPC host diagnostic emit calls.
packages/devframe/src/node/host-views.ts Updates static view diagnostic emit call.
packages/devframe/src/node/rpc-shared-state.ts Updates shared-state diagnostic emit call.
packages/devframe/src/node/rpc-streaming.ts Updates streaming diagnostic emit/report calls.
packages/devframe/src/node/storage.ts Updates storage parse warning report call.
packages/devframe/src/helpers/vite.ts Updates Vite bridge warning report call.
packages/devframe/src/adapters/mcp/build-server.ts Updates MCP adapter diagnostic emit calls.
packages/devframe/package.json Replaces runtime dependency with nostics.
pnpm-workspace.yaml Updates dependency catalog entry.
pnpm-lock.yaml Regenerates lockfile for nostics and transitive changes.
docs/guide/diagnostics.md Rewrites diagnostics guide for nostics API.
docs/guide/index.md Updates diagnostics overview wording.
docs/errors/index.md Updates diagnostics backend description.
docs/adapters/cli.md Updates CLI diagnostics wording.
skills/devframe/SKILL.md Updates diagnostics host wording.
AGENTS.md Updates contributor diagnostics guidance.
tests/__snapshots__/tsnapi/devframe/index.snapshot.d.ts Updates public API snapshot exports.
tests/__snapshots__/tsnapi/devframe/types.snapshot.d.ts Updates types snapshot exports.
tests/__snapshots__/tsnapi/devframe/node.snapshot.d.ts Updates node API snapshot for diagnostics host shape.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@antfu antfu merged commit d9b7ebb into main May 15, 2026
16 checks passed
@antfu antfu deleted the antfu/migrate-to-nostics branch May 15, 2026 02:48
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.

2 participants