feat(cli): support SvelteKit setup#324
Open
maxffarrell wants to merge 5 commits into
Open
Conversation
Contributor
|
@maxffarrell is attempting to deploy a commit to the Million Team on Vercel. A member of the Team first needs to authorize it. |
Co-Authored-By: Claude Sonnet 4.6 <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
src/hooks.client.tsCloses #231
Validation
nr buildnr formatnr lintnr typechecknr test:clireact-grab init -y --skip-install, repeat init idempotency check, app build, and browser runtime smoke test forwindow.__REACT_GRAB__Full root
nr testwas also run after installing Playwright Chromium. Package builds passed, but the existing Playwright suite failed in keyboard activation and copy-feedback coverage unrelated to the SvelteKit setup path: 540 passed, 17 failed, 2 flaky, 6 did not run.Summary by cubic
Adds SvelteKit support to the CLI. It auto-detects
@sveltejs/kit, injects a dev-onlyreact-grabimport intosrc/hooks.client.(ts|js)without duplication, and updates docs/CLI help with SvelteKit setup.New Features
sveltekitvia@sveltejs/kitand removes it from unsupported; CLI framework choices updated.src/hooks.client.ts/.jswithif (import.meta.env.DEV) { void import("react-grab"); }.react-grabalready exists inhooks.client,src/app.html, or+layout.svelte.previewOptionsTransformby upgrading the dynamic import to.then((m) => m.init(...))once.initdiff preview when original content is missing and write-permission checks for new files.Migration
react-grab init. Re-running is safe and idempotent.Written for commit 1bc0a3f. Summary will update on new commits.
Note
Medium Risk
Medium risk because it extends CLI project detection and file transforms to create/modify
src/hooks.client.*, which could affect install/config behavior across frameworks if detection or idempotency edge cases are wrong.Overview
Adds first-class SvelteKit support to
grab initby detecting@sveltejs/kitprojects and automatically injecting a dev-onlyreact-grabdynamic import intosrc/hooks.client.(ts|js)(creating the file when missing and avoiding duplicates by also checkingsrc/app.html).Extends CLI option reconfiguration to update the SvelteKit dynamic import with
.init({...}), improves diff/preview handling and write-permission checks for newly-created files, and updates docs/help text and tests to reflect SvelteKit being supported (not “unsupported”).Reviewed by Cursor Bugbot for commit 1bc0a3f. Bugbot is set up for automated code reviews on this repo. Configure here.