Repository navigation
feat(cli): fail closed on direct adds without the official foundation (#547 phase C) - #644
Merged
Merged
Conversation
added 2 commits
October 24, 2026 01:05
…#547 phase C) A direct `sv add <svforge-addon>=template:<base|dashboard>` can no longer run without the official Paraglide/Drizzle/Better Auth output: SVForge only extends that foundation since phases A/B. - new `official-integrations.ts` preflights the workspace BEFORE any write (official files, plus the Paraglide/Better Auth handles in hooks.server.ts) and cancels with the exact supported manual sequence and the `svforge create` alternative. Fail-closed: no file, no dependency change. - the published `sv` (1.1.1) still cannot express conditional add-on dependencies with options (upstream sveltejs/cli#1419 open), so the direct path is documented as a manual sequence rather than faked. - generated AGENTS.md guidance, the Better Auth runbook and the ownership matrix document the ordering; the scaffold matrix keeps validating the supported sequence (official add-ons, then SVForge). - tests: preflight unit coverage (missing artifacts, hooks without official handles, PM-aware message) and a zero-write cancellation test; the real-CLI smoke (`vite-config-modern-scaffold`) and addon-run tests now seed/request the official add-ons first. Validated: full repo suite, lint, typecheck; direct add on a fresh project cancels with the exact commands and writes nothing; the manual sequence then produces the composed hooks/policy; `test-scaffold.sh base`, `dashboard` (46 tests) and `create-cli` (58 tests) pass with real PostgreSQL. Refs #547 (phase C).
The OSV audit flags three new advisories against undici 8.10.2, resolved through jsdom (dev-only). A scoped override keeps every resolution on 8.12.3 without adding a direct dependency; `bun run audit` is clean again.
Merged
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.
Phase C — direct
sv addfails closed with the supported sequencePhases A (#642) and B (#643) made SVForge extend the official Paraglide / Drizzle / Better Auth output. Phase C closes the direct-add path.
What changed
official-integrations.ts): a directsv add <svforge-addon>=template:<base|dashboard>now verifies the official foundation exists —project.inlang/settings.json,src/hooks.server.ts(with the Paraglide middleware; and the Better Auth handler for the dashboard),src/hooks.ts, plusauth.ts/db/index.ts/env.tsfor the dashboard. Missing pieces → the add-on cancels before writing any file or dependency.bunx/pnpm dlx/npx --yes) then "re-run the SVForge add", plus the supported one-command alternativenpx svforge create <dir> --template ….sv@1.1.1still cannot express conditional add-on dependencies with options (setup()does not receive the add-on options; upstream feat(addons): pass setup defaults to dependencies sveltejs/cli#1419 is open). The manual sequence is documented rather than faked.svforge create(official add-ons first) remains the one-command path.vite-config-modern-scaffold) runs the official add-ons first, and add-on-run tests seed the official foundation.Verification
AGENTS.md,svforge-check.mjs, components absent).hooks.server.ts=sequence(handleParaglide, handleBetterAuth, handleSvforgePolicy),auth.tscarriessvforgeAuthPolicy+disableSignUp.bun run test,bun run lint,bun run typecheck,node scripts/check-generated.mjs— pass.test-scaffold.sh base,dashboard(46 tests, schema/runtime gate, auth HTTP smoke) andcreate-cli(all 13 modules, 58 tests) with real PostgreSQL — pass.Remaining (upstream)
Automatic dependency installation for direct
sv addrequires the upstream conditional-dependency API (sveltejs/cli#1419). When a publishedsvexposessetup({ options, dependsOn }), SVForge can declare the official add-ons instead of the documented manual sequence — no template or extension changes expected.Refs #547 — phase C; nothing else implemented.