feat: add self-contained starter template - #271
Open
antfubot wants to merge 2 commits into
Open
Conversation
Add a top-level starter/ folder: a minimal devframe integration with a vanilla-TS Vite client, single + hub playgrounds, and unit + e2e tests. - devframe.ts + rpc/ define the DevframeDefinition and two RPC functions (get-info static, list-items query+snapshot). - src/client/ is a dependency-light vanilla-TS SPA (hand-rolled DOM helpers, no UI framework) served by the CLI (bin.mjs) or built as a static deploy. - playground/single/ dev-serves the SPA with Vite HMR while devframeViteBridge answers RPC at the devframe's own base path - documented why the two can't share one base. - playground/hub/ mounts the devframe as a dock inside a @devframes/hub host. - test/ (vitest, RPC over a real WebSocket) and e2e/ (playwright, against the single playground) cover both layers. The starter pins real dependency versions instead of the monorepo's catalog:/workspace:* specifiers, so it's copy-paste ready outside the workspace; pnpm still links devframe/@devframes/* to the local packages during in-repo development. A root bump.config.ts + scripts/sync-starter-version.ts keep those versions in sync automatically whenever `bumpp -r` releases the monorepo. Wires the starter into the monorepo's tooling: pnpm-workspace.yaml, vitest.config.ts (root test aggregation), turbo.json (explicit devframe-starter#build/#cli:build task entries - this repo has no generic build task, every package needs one), and verify-typecheck-coverage.ts. Documented in AGENTS.md. This PR was 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. |
…ection `auth: false` was set on every real surface (the CLI's cli.auth, and both Vite playgrounds) - each one auto-trusted any connection that could reach its port, with no interactive handshake at all. That's the framework's documented opt-out for a tool that's genuinely single-user and loopback-only, not a sane starter default: a copy-pasted template should teach the secure-by-default posture, not silently disable it everywhere. Leave `auth` unset on `src/devframe.ts`'s `cli` and both playground configs, so they fall through to devframe's interactive OTP gate (the same default every hosted adapter already ships). A developer who wants to skip the prompt for a one-off loopback session now reaches for the CLI's existing `--no-auth` flag per invocation instead of a baked-in opt-out. The single playground's e2e suite still needs to drive the bridge without solving an interactive code, so `playwright.config.ts`'s `webServer.env` sets an explicit `DEVFRAME_E2E` flag that the playground config checks to disable auth *only* for that automated run - a plain `pnpm run play:single` stays gated. The unit test's own ephemeral, loopback-only `initDevframe` instance keeps `auth: false` outright (it's a private test fixture torn down in `afterAll`, not a listening surface anyone else can reach) - now with a comment explaining why that one is fine. This PR was 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.
Summary
Adds a top-level
starter/folder — a minimal, self-contained devframe integration: a vanilla-TS Vite client, a CLI dev/build/MCP shell, single + hub playgrounds, and unit + e2e tests.src/devframe.ts+src/rpc/define theDevframeDefinitionand two RPC functions (get-infostatic,list-itemsquery+snapshot).src/client/is a dependency-light vanilla-TS SPA (hand-rolled DOM helpers, no UI framework), served by the CLI or built as a static deploy.playground/single/dev-serves the SPA with Vite HMR whiledevframeViteBridgeanswers RPC at the devframe's own base path — the config comments explain why the two can't share one base (the bridge's middleware claims 100% of requests under its mount base with no passthrough).playground/hub/mounts the devframe as a dock inside a@devframes/hubhost.test/(vitest, RPC over a real WebSocket via the publicinitDevframeAPI) ande2e/(playwright, against the single playground) cover both layers.Versioning
The starter pins real dependency versions instead of the monorepo's
catalog:/workspace:*specifiers, so the folder is copy-paste ready outside this workspace. Pnpm still linksdevframe/@devframes/*to the local packages during in-repo development. A rootbump.config.ts+scripts/sync-starter-version.tskeep those versions in sync automatically wheneverbumpp -rreleases the monorepo.Monorepo wiring
pnpm-workspace.yaml— registersstarteras a workspace packagevitest.config.ts— addsstarterto the root test aggregationturbo.json— explicitdevframe-starter#build/#cli:buildtask entries (this repo has no genericbuildtask; every package needs its own entry, orpnpm build/pnpm testsilently skip it)scripts/verify-typecheck-coverage.ts— addsstarterto the coverage safety netAGENTS.md— documents the starter's purpose and version-sync mechanismVerification
pnpm typecheck,pnpm lint,pnpm knip, and the rootpnpm test(114 test files / 1253 tests) all pass with the starter includedThis PR was created with the help of an agent.