Skip to content

test: update api snapshots for DevframeDiagnostics type output - #500

Merged
antfu merged 1 commit into
mainfrom
test-update-dts-snapshots
Nov 19, 2026
Merged

antfu merged 1 commit into
mainfrom
test-update-dts-snapshots

Conversation

@antfubot

Copy link
Copy Markdown
Collaborator

Summary

CI on main fails on 3 tsnapi API snapshots since the deps update in 72a4814 / 13b26a3. The last 3 main CI runs fail the same way, and every open PR inherits it (for example #498).

The built .d.ts output changed, not the source API:

  • devframe/internal: diagnostics is now typed DevframeDiagnostics<{...}, []> (imported from ../utils/nostics.mjs) instead of import("nostics").Diagnostics<{...}, readonly [reporter], never>.
  • @devframes/plugin-terminals and @devframes/plugin-code-server (./node): the same, and they no longer inline copies of nostics's Diagnostic class and Diagnostics type.

This is the output the DevframeDiagnostics doc comment in packages/devframe/src/utils/nostics.ts asks for: references resolve through devframe/utils/nostics and do not inline nostics types.

tsnapi reports ~ narrowed diagnostics and refuses a plain -u, because the second type argument now prints as []. That [] is the extra-reporters argument of DevframeDiagnostics, which still prepends devframe's reporter. So I updated with TSNAPI_ALLOW_BREAKING=1.

User prompts

Model: Claude Opus 5.5 in Claude Code (via Paseo).

  • While opening #498, CI failed on these snapshots, which also fail on main. The user chose to fix them in a separate PR.

Verification

  • pnpm build, then TSNAPI_ALLOW_BREAKING=1 pnpm exec vitest run --project tests tests/exports.test.ts -u: 3 snapshots updated.
  • pnpm exec vitest run --project tests tests/exports.test.ts: 246 passed, 9 skipped.
  • Caller-facing check against the built packages/devframe/dist/internal/index.d.mts (throwaway file, tsc --strict, exit 0):
    • diagnostics.DF0006({ name: 'x' }, { method: 'warn' }) type-checks, so the reporter option is still typed.
    • { method: 'bogus' } and a missing name both fail, checked with @ts-expect-error.
  • Not verified: an exact type-equality proof between the old and new diagnostics types. My infer-based attempt could not pull the type parameters out, so it proved nothing either way.

This PR was written by an agent. The human chose to fix this separately; they have not reviewed the diff yet.

After the deps update, the built .d.ts files reference DevframeDiagnostics from devframe/utils/nostics instead of inlining nostics types. tsnapi flags this as narrowed, but callers see the same API.
@vercel

vercel Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
devframe Ignored Ignored Preview Nov 19, 2026 1:26am UTC

@github-actions

Copy link
Copy Markdown

👁️‍🗨️ Review this pull request with grouped, summarized diffs at:
👉 https://pulls.review/gh/devframes/devframe/500?from=github-actions[bot]

raw result

💭 analyzed by vercel-ai-gateway/anthropic/claude-sonnet-5
🕰️ 2026-11-19 01:28 UTC
🔗 head 158cb1e
🤖 automated by pulls.review

{
  "headSha": "158cb1ee1c2f7de355a96f84a6fe1ad4fa228fec",
  "result": {
    "overallSummary": "CI on `main` fails on 3 tsnapi API snapshots because recent dependency updates changed how the built `.d.ts` output expresses the `diagnostics` export's type (now via `DevframeDiagnostics` instead of inlined `nostics` types), not because the source API changed. This PR simply regenerates those snapshots with `TSNAPI_ALLOW_BREAKING=1` to unblock CI for this and other open PRs.",
    "groups": [
      {
        "key": "snapshot-updates",
        "label": "Update tsnapi snapshots",
        "summary": "Regenerates stale tsnapi API snapshots to match the updated built `.d.ts` output, where `diagnostics` now resolves through `DevframeDiagnostics` (imported from `devframe/utils/nostics`) instead of inlining `nostics`'s `Diagnostic`/`Diagnostics` types. No source API changed; this only unblocks CI, which fails the same way on `main`.",
        "category": "tests",
        "filePaths": [
          "tests/__snapshots__/tsnapi/@devframes/plugin-code-server/node.snapshot.d.ts",
          "tests/__snapshots__/tsnapi/@devframes/plugin-terminals/node.snapshot.d.ts",
          "tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts"
        ],
        "fileNotes": [
          {
            "path": "tests/__snapshots__/tsnapi/devframe/internal.snapshot.d.ts",
            "text": "The reporters type argument now prints as `[]` instead of the inline reporter tuple; this is expected since `DevframeDiagnostics` prepends devframe's reporter implicitly rather than listing it in the type. Not formally proven equivalent to the old type (see PR description), only verified by caller-facing type-check against the built output."
          }
        ]
      }
    ],
    "schemaVersion": 1,
    "source": "llm",
    "generatedAt": "2026-11-19T01:28:40.704Z",
    "model": "vercel-ai-gateway/anthropic/claude-sonnet-5",
    "locale": "en"
  }
}

@antfu
antfu merged commit eaa9f7b into main Nov 19, 2026
16 checks passed
@antfu
antfu deleted the test-update-dts-snapshots branch November 19, 2026 01:29
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