Repository navigation
fix(cli): stop dev loop from writing to an existing source app - #30
Merged
Merged
Conversation
peek dev/tunnel pushed a draft to the SOURCE app's manifest on every restart, even when it already existed (the common case: an existing project pointed at a real, often production, app). That's unnecessary writing to a real app's registry record just to keep a local clone in sync with itself, and it surfaces as unrelated 422s whenever the source app's draft/version state is inconsistent — the test app clone already gets the local manifest pushed onto it directly. - serve.ts: skip the source-app draft push once the app already exists; go straight to cloning/updating its test app. Still bootstraps (pushes the first draft) for a genuinely new app, or an existing app row that has no version at all for test-apps to clone (createTestApp now signals that case instead of throwing). - link.ts (new): shared "pick an app from the list and link to it" flow, used by both `apps link` and a stricter `dev`/`tunnel` preflight — an unlinked directory now prompts you to pick an existing app rather than silently guessing a slug from package.json and creating it. Creating a brand-new app stays exclusively `apps link <slug> --create` / `init`. Drops the now-dead `dev`/`tunnel` `--yes` flag that only gated the old guess-and-confirm; adds `--debug` to both for parity with the other registry commands. - dev.ts: default to an executable `./bin/server` (Rails/Phoenix/Go convention) before falling back to `<pm> run dev`, ahead of `--cmd`. Updates the `cli` skill, the peek `manifest-and-deploy` skill, and recipes 02/03 to stop claiming dev drafts the source app every run. Co-Authored-By: Claude Sonnet 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.
Summary
peek dev/peek tunnelpushed a draft to the source app on every restart even when it already existed — unnecessary writes to a real (often production) app just to keep its test-app clone in sync. Now skipped once the app exists; the test app still gets the local manifest pushed to it directly, every run. Still bootstraps the first draft for a genuinely new app, or an existing app row with no version at all to clone from (surfaced this while debugging a registry org-scoping bug against a real production app)..peek-kit.json):dev/tunnelnow prompt you to pick an existing app from the registry and link it, instead of silently deriving a slug frompackage.jsonand creating that app. Creating a brand-new app stays exclusivelyapps link <slug> --create/init.devdefaults to an executable./bin/server(Rails/Phoenix/Go convention) before falling back to<pm> run dev, ahead of--cmd.--yes/-yflag fromdev/tunnel(only gated the old guess-and-create flow); added--debugto both for parity with the other registry commands.cliskill, thepeekplatform'smanifest-and-deployskill, and recipes 02/03, which claimed dev always drafts the source app.Test plan
tsc -bcleanvitest run— 99/99 passing (updated 2 e2e tests that passed the now-removed--yesflag; added a unit test forcreateTestAppreturningnullon "no version to clone")pricing-schedules) that hit the "existing app with no version to clone" edge case — confirmed the fallback (push first draft, retry clone) unblocks it🤖 Generated with Claude Code