Skip to content

feat!: migrate logs-sdk to nostics, bump devframe to v0.3#350

Open
antfu wants to merge 3 commits into
mainfrom
antfu/devframe-v0.3
Open

feat!: migrate logs-sdk to nostics, bump devframe to v0.3#350
antfu wants to merge 3 commits into
mainfrom
antfu/devframe-v0.3

Conversation

@antfu
Copy link
Copy Markdown
Member

@antfu antfu commented May 15, 2026

Description

logs-sdk has been renamed and rewritten as nostics. Devframe v0.3.0 is the first release that consumes the new dep, so this PR bumps both together to keep ctx.diagnostics (re-exported from devframe) and the in-repo diagnostics files backed by the same library and emission API.

API delta (also applies to plugin-facing ctx.diagnostics):

  • defineDiagnostics({ docsBase, codes }) + separate createLogger()defineDiagnostics({ docsBase, reporters, codes }) (no more createLogger).
  • Code fields message / hint / levelwhy / fix (no level).
  • Emission logger.CODE(params).throw() / .log()diagnostics.CODE.throw(params) / .report(params) (and ctx.diagnostics.logger.CODE is now a proxy that resolves directly to the nostics handle).
  • cause moves from a 2nd arg into the params object.

Convention docs (AGENTS.md/CLAUDE.md), plugin-author docs (docs/kit/diagnostics.md, docs/errors/index.md), and the vite-devtools-kit skill have been rewritten to teach the new API.

Linked Issues

Additional context

Verification: pnpm sync --check ✓ (devframe at v0.3.0), pnpm lint ✓, pnpm test ✓ (190/190), pnpm build ✓. The remaining pnpm typecheck errors are pre-existing RPC-type registration issues unrelated to this migration.

antfu added 2 commits May 15, 2026 13:35
`logs-sdk` has been renamed and rewritten as `nostics`. Devframe v0.3.0
is the first release on the new dep. Doing both together keeps
`ctx.diagnostics` (re-exported from devframe) and our internal
diagnostics backed by the same library.

API delta:
- `defineDiagnostics({ docsBase, codes })` + separate `createLogger()`
  → `defineDiagnostics({ docsBase, reporters, codes })`
- Code fields `message`/`hint`/`level` → `why`/`fix` (no `level`)
- `logger.CODE(params).throw() / .log()` → `diagnostics.CODE.throw(params) / .report(params)`
- `cause` moves from a 2nd arg to inside the params object

For plugin authors, `ctx.diagnostics.logger.CODE` is now a proxy that
resolves directly to a `nostics` handle, so emission is
`ctx.diagnostics.logger.CODE.throw(params)` instead of the old
`logger.CODE(params).throw()` shape.
# Conflicts:
#	devframe
#	pnpm-lock.yaml
#	pnpm-workspace.yaml
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 15, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@vitejs/devtools@350
npm i https://pkg.pr.new/@vitejs/devtools-kit@350
npm i https://pkg.pr.new/@vitejs/devtools-rolldown@350
npm i https://pkg.pr.new/@vitejs/devtools-self-inspect@350

commit: 1384f41

`tsdown`'s client/server split in devframe v0.2.3+ emits the
`DevToolsRpc{Server,Client}Functions` and `DevToolsRpcSharedStates`
interfaces twice — once in the canonical `devframe-*.d.mts` chunk and
again in the `index-*.d.mts` chunk consumed by `devframe/client`. The
duplicate declarations are seen by TypeScript as separate identities,
so `declare module '@vitejs/devtools-kit'` augmentations applied to
the canonical interface don't reach client-side consumers.

The patch replaces the duplicate declarations in the client chunk with
type imports from the canonical chunk, so both sides resolve to the
same interface. Remove the patch once devframe ships a fix upstream.
@antfu antfu changed the title feat: migrate logs-sdk to nostics, bump devframe to v0.3 feat!: migrate logs-sdk to nostics, bump devframe to v0.3 May 15, 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