refactor(devframe)!: add cac adapter (createCac) as an optional peer dependency; deprecate the cli alias#96
Merged
Merged
Conversation
…adapter cac is now an optional peer dependency, pulled in only through the devframe/adapters/cli entry. Tools that assemble their own command-line shell from the createDevServer / createBuild / createMcpServer factories run without installing cac. A new cac-free devframe/adapters/flags entry exposes the typed-flag helpers (defineCliFlags / parseCliFlags) so bring-your-own-CLI tools get flag validation without depending on cac. The helpers stay re-exported from adapters/cli for back-compat. Plugins and examples that ship a createCli-backed binary now declare cac directly. PR created with the help of an agent.
✅ Deploy Preview for devfra ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
…cate createCli The cac-based CLI adapter is now canonically devframe/adapters/cac with createCac / CacHandle / CreateCacOptions. The historical devframe/adapters/cli entry keeps working as a deprecated alias (createCli / CliHandle / CreateCliOptions re-export the cac module), to be removed in a future major. The typed-flag helpers (defineCliFlags / parseCliFlags) stay co-located on the CLI adapter (re-exported from devframe/adapters/cac and the deprecated devframe/adapters/cli) rather than a separate entry. Internal plugins, examples, docs, and the skill migrate to createCac. PR created with the help of an agent.
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.
What
Two related changes to how the
cac-powered CLI adapter is packaged:cacis now an optional peer dependency ofdevframeinstead of a hard dependency, so consumers opt into it — or bring their own CLI framework without ever pullingcac. This mirrors the existing treatment of@modelcontextprotocol/sdk: the dependency is only reached through its adapter entry, so tools that assemble their own shell fromcreateDevServer/createBuild/createMcpServerrun without it.The adapter is renamed to
cac. The canonical entry is nowdevframe/adapters/cacexposingcreateCac(withCacHandle/CreateCacOptions). The historicaldevframe/adapters/clientry (createCli/CliHandle/CreateCliOptions) remains as a deprecated alias that re-exports the cac module, to be removed in a future major.Details
devframe:cacmoved fromdependenciestopeerDependencies(^7.0.0) +peerDependenciesMeta.cac.optional; kept as adevDependencyfor the workspace build.src/adapters/cac.tsis the implementation;src/adapters/cli.tsis a thin deprecated shim.defineCliFlags/parseCliFlags) stay co-located on the CLI adapter — re-exported fromdevframe/adapters/cac(and the deprecateddevframe/adapters/cli) rather than a separate module.cacthemselves: pluginsgit,a11y,inspect,messages,terminals,code-server; examplesfiles-inspector,next-runtime-snapshot,streaming-chat— all migrated tocreateCac.alias.ts(the source of truth that regeneratestsconfig.base.jsonpaths) gains thedevframe/adapters/cacalias.adapters/clidocs page becomesadapters/cac.Why not make
createCacasynccac@7is ESM-only, so a graceful in-functionrequireisn't possible; deferring it via dynamic import would forcecreateCacto become async and break every call site. The chosen approach keeps it synchronous while achieving the opt-in goal, matching the repo's established optional-peer pattern (importing the adapter entry withoutcacthrows the usual Node module-not-found error).Verification
pnpm build,pnpm typecheck,pnpm lint, andpnpm test(653 passing) all green.Note
Marked
!(breaking):cacmust now be installed explicitly by anyone using the adapter, and new code should importcreateCacfromdevframe/adapters/cac.PR created with the help of an agent.