Repository navigation
CI: typecheck and plugin tests; /deck reaches its hook - #1
Merged
Merged
Conversation
tsconfig.json extends .claude-plugin/types/tsconfig.json, which Claude Code writes only in an interactive --plugin-dir session, so tsc could not run in a clean clone. scripts/mod-types.mjs fetches Anthropic's published mods types at a pinned commit, checks the sha256, and lays them out where Claude Code would; a folder Claude Code wrote is left alone. package.json pins typescript and the Claude Code version that runs `claude plugin test`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The command.run matcher keyed on `name`, which the engine does not match on, so /deck never toggled the deck. It keys on `command` now, with a test that fails on the old matcher. The rest are strict-index and test-fixture fixes: narrow possibly-missing clip frames, type the test's `on` as On, and give the band fixture the isCollapsed prop. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
plugins/usage-deck/tsconfig.jsonextends./.claude-plugin/types/tsconfig.json. That folder is gitignored, and Claude Code writes it only when it loads the mod with--plugin-dirin an interactive, signed-in session (Get type definitions for your version). A clean clone or CI has no such session, so tsc stops at the first line:The repo also had no CI.
Fix
scripts/mod-types.mjsfetches the copy Anthropic publishes (anthropics/claude-code,mods/types/claude-code.d.ts) at a pinned commit and checks its sha256. It writes the file where Claude Code would,.claude-plugin/types/claude-code/index.d.ts, with atsconfig.jsonbeside it that uses the compiler options from Anthropic's ownmods/tsconfig.json. The originalextendsstays as it was. If Claude Code already wrote that folder, the script leaves it alone, so a local typecheck uses the types for the version you run.--plugin-dir.package.json(private) pinstypescript7.0.2 and@anthropic-ai/claude-code2.1.322, and has a lockfile.npm run typecheckruns the script and thentsc -p plugins/usage-deck.npm testrunsclaude plugin test plugins/usage-deck, which per the docs needs no sign-in or network. I checked that with an emptyHOMEandCLAUDE_CONFIG_DIR.allowScriptslets the Claude Code package run its postinstall. That script only links the platform binary into place, and npm 12 blocks it by default..github/workflows/ci.ymlruns onubuntu-latestfor pull requests and for pushes tomain. It runsnpm ci, the typecheck, and the tests. Both actions are pinned to commit SHAs.Type errors
Once tsc could run: 23 errors before, 0 after. Claude Code 2.1.326's
claude plugin validatereports the same 23 as warnings, and 0 after the fix.on('command.run', { name: 'deck' }, ...)matched on a key the engine doesn't use, so/decknever reached the hook and never hid the deck. It now matches oncommand. A new test runs/decktwice, then another command. It fails on the old matcher ("from below" instead of "usage-deck: hidden") and passes now, on both 2.1.290 and 2.1.322.noUncheckedIndexedAccess: the render hook now narrows the clip's frame rows before drawing them. If they were ever missing, the deck hands back the band instead of throwing.clipFor's idle pick falls back to'look'.band()helper takesOnfromclaude-code, which replaces a type that resolved tonever. The band fixture gets the now-requiredisCollapsedprop, and indexed reads go through checked lookups. I added noany,@ts-ignoreor new casts, and I removed twoas nevercasts.Tests
register.test.tsimportsclaude-code/testing, so it runs only underclaude plugin test. Before: no way to run it in CI, and 10 pass / 1 fail on the current Claude Code (2.1.326). After: 12 pass / 0 fail on the pinned 2.1.322 (11 existing tests plus the new/decktest).Needs an owner decision: the band check breaks on Claude Code 2.1.323 and later
"beside another plugin's tree the deck shrinks to one row" passes on 2.1.290 through 2.1.322 and fails on 2.1.323, 2.1.325 and 2.1.326. From 2.1.323,
next(e)in theAbovePrompthook returns{ type: 'engine', ref: 1 }even when another plugin's tree sits below.isEmptycounts that as empty, so the deck never notices it is crowded. The current types describe a new band model: the engine asksAbovePromptonce per plugin (e.plugin), and a separateAbovePromptListhook stacks the rows. Making the deck step aside for other plugins probably means moving that check to anAbovePromptListhook. That changes what the plugin does, so I left it out of this PR and pinned the test runner to 2.1.322, the last version where the suite passes. Bump the pin inpackage.jsononce the band logic is fixed.Not verified locally
git archiveof this branch:npm ci && npm run typecheck && npm testexit 0. CI uses Node 24 and npm 11, whereallowScriptsis ignored and the postinstall runs by default.atom,readandupdate, which this mod imports and which 2.1.290 already provides at runtime. So I pinned the newest commit, and it matches what 2.1.326's validator checks.Created with Claude Opus 5.5 in Claude Code.