feat(core): add ctx.dotdir API and rename Context to CommandContext#103
feat(core): add ctx.dotdir API and rename Context to CommandContext#103zrosenbauer wants to merge 1 commit intomainfrom
Conversation
…103) Add `ctx.dotdir` — a scoped dot directory client with filesystem operations and a protection registry for guarding sensitive files. Rename `Context` to `CommandContext` and `useCommandContext` to `useScreenContext` for clearer delineation between command handlers and screen components. Co-Authored-By: Claude <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
🦋 Changeset detectedLatest commit: 9b97280 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR performs a comprehensive refactoring that renames the Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes The review demand stems from the high file count (60+ files) but with predominantly repetitive, mechanical type substitutions ( Possibly related PRs
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
⚔️ Resolve merge conflicts
Comment |
…103) Add `ctx.dotdir` — a scoped dot directory client with filesystem operations and a protection registry for guarding sensitive files. Rename `Context` to `CommandContext` and `useCommandContext` to `useScreenContext` for clearer delineation between command handlers and screen components. Co-Authored-By: Claude <noreply@anthropic.com>
Summary
ctx.dotdir— NewDotDirectoryClienton the command context providing scoped filesystem operations (read,write,readJson,writeJson,exists,remove,ensure,path) for CLI dot directories (~/.myapp/,<project>/.myapp/). Includes a protection registry so middleware can guard sensitive files — auth middleware now protectsauth.jsonby default.Context→CommandContext— Renamed the core interface for clearer delineation between command handlers and screen components. Module augmentation declarations (auth,report,icons) updated accordingly.useCommandContext→useScreenContext— Renamed the React hook to matchScreenContextnaming.Breaking changes
Contexttype is nowCommandContext— update imports anddeclare moduleblocksuseCommandContext()hook is nowuseScreenContext()Test plan
pnpm checkpasses (typecheck + lint + format) — 0 errorspnpm testpasses — 780/780 tests across 58 test filesprotection.test.ts,create-dot-directory.test.ts,create-dot-directory-client.test.tsauth.jsonis now protected, existing auth code doesn't usectx.dotdiryet so no behavioral change