reactiveflutter
v1.0.5
Published
Reusable VS Code React JSX/TSX snippets with safe bootstrap installer for macOS.
Maintainers
Readme
This will be a working progress project, with time more and more shortcuts will be added as i go through the learning curve of React`
VS Code React JSX Dotfiles
This repository provides a reusable, version-controlled VS Code snippet setup for React JSX/TSX with Flutter-like flow:
- Type trigger, press Enter, then Tab through placeholders.
- Dual prefixes for each snippet (long trigger + short alias).
- Double-quote attribute placeholders by default.
- Broad HTML tag coverage for React work.
- Auto-detects VS Code User directory on macOS, Linux, and Windows.
Quickstart (Linux/macOS/Windows)
Install package:
npm install -g reactiveflutter
Deploy snippets to VS Code User directory:
vscode-react-snippets --mode copy
Alias (same command):
reactiveflutter --mode copy
Verify in VS Code:
- Open a
.jsxor.tsxfile. - Type
secorimg, then accept snippet.
- Open a
If global npm install fails with EACCES on Linux, use one of these:
Use nvm (recommended) so global installs are user-scoped.
Or avoid global install entirely:
npm install reactiveflutter npx vscode-react-snippets --mode copy
Install As npm Package
Global Install (Recommended)
Install:
npm install -g reactiveflutter
Run installer (safe default, snippets only):
vscode-react-snippets --mode copy
Alias (same command):
reactiveflutter --mode copy
Optional: include managed VS Code settings:
vscode-react-snippets --mode copy --include-settings
Local Project Install
If you install locally (npm install reactiveflutter without -g), use npx to run it:
npx vscode-react-snippets --mode copy
Alias with same behavior:
npx reactiveflutter --mode copy
Or with optional settings:
npx vscode-react-snippets --mode copy --include-settings
Repository Layout
vscode/settings.json- Optional VS Code user settings overrides (snippet ranking and snippet acceptance behavior).vscode/snippets/javascriptreact.json- Global React JSX snippets.vscode/snippets/typescriptreact.json- TSX parity snippets.scripts/bootstrap-vscode.sh- Safe and idempotent macOS bootstrap script.scripts/bootstrap-vscode.js- Cross-platform bootstrap script (macOS/Linux/Windows).scripts/bootstrap-vscode.sh- Bash bootstrap script (macOS/Linux/WSL/Git Bash).bin/vscode-react-snippets.js- npm CLI entrypoint.package.json- npm package metadata and commands.
Initial Install (macOS)
Clone this repo on your machine.
From repo root, run (safe default, snippets only):
node ./scripts/bootstrap-vscode.js --mode copy
Optional: apply managed VS Code settings too:
node ./scripts/bootstrap-vscode.js --mode copy --include-settings
Using npm script shortcuts:
- npm run bootstrap
- npm run bootstrap:with-settings
Default destination paths:
~/Library/Application Support/Code/User/snippets/javascriptreact.json~/Library/Application Support/Code/User/snippets/typescriptreact.json
Optional destination when --include-settings is used:
~/Library/Application Support/Code/User/settings.json
Backups are stored under:
~/.vscode-dotfiles-backups/<timestamp>/...
Update / Sync On Another Machine
Pull latest changes in this repository.
Re-run bootstrap:
./scripts/bootstrap-vscode.sh --mode copy
Include settings only when you explicitly want to replace local user settings:
./scripts/bootstrap-vscode.sh --mode copy --include-settings
The script is idempotent:
- Unchanged files are skipped.
- Changed files are backed up before replacement.
Rollback Using Backups
Identify your backup folder:
ls -1 ~/.vscode-dotfiles-backups
Restore desired files manually from a timestamped snapshot. Example:
cp "$HOME/.vscode-dotfiles-backups/20260327-120000/Library/Application Support/Code/User/settings.json" "$HOME/Library/Application Support/Code/User/settings.json"
cp "$HOME/.vscode-dotfiles-backups/20260327-120000/Library/Application Support/Code/User/snippets/javascriptreact.json" "$HOME/Library/Application Support/Code/User/snippets/javascriptreact.json"
cp "$HOME/.vscode-dotfiles-backups/20260327-120000/Library/Application Support/Code/User/snippets/typescriptreact.json" "$HOME/Library/Application Support/Code/User/snippets/typescriptreact.json"
Copy Mode vs Symlink Mode
- Copy mode (default, recommended): files are copied into VS Code User paths.
- Best for portability and tool compatibility.
- Survives repo path changes.
- Symlink mode: use
--mode symlink.- Destination files point directly to repo-managed files.
- Changes in repo are reflected immediately.
- If repo moves, links must be recreated.
Optional Path Override
Use custom VS Code user directory:
VSCODE_USER_DIR="$HOME/Library/Application Support/Code - Insiders/User" node ./scripts/bootstrap-vscode.js --mode copy
Linux example:
VSCODE_USER_DIR="$HOME/.config/Code/User" node ./scripts/bootstrap-vscode.js --mode copy
Windows PowerShell example:
$env:VSCODE_USER_DIR="$env:APPDATA\Code\User"; node .\scripts\bootstrap-vscode.js --mode copy
Include managed settings with custom path:
VSCODE_USER_DIR="$HOME/Library/Application Support/Code - Insiders/User" node ./scripts/bootstrap-vscode.js --mode copy --include-settings
Quick Validation
- Open a
.jsxor.tsxfile. - Type
Sectionorsec, press Enter. - Type
Imageorimg, press Enter. - Press Tab to navigate placeholders in order.
- Confirm snippet suggestions are near top of completion list.
Troubleshooting
If install succeeded but VS Code does not behave as if snippets are installed, run:
Check package installation:
npm list -g reactiveflutter
Check CLI resolution:
which vscode-react-snippets
Check npm global prefix:
npm config get prefix
Check shell PATH:
echo "$PATH"
Check deployed snippet files:
ls -l ~/.config/Code/User/snippets/javascriptreact.json ls -l ~/.config/Code/User/snippets/typescriptreact.json
Run built-in diagnostics:
vscode-react-snippets --doctor
If command works in a normal terminal but not VS Code terminal, restart VS Code after updating shell config (.bashrc, .zshrc, etc.).
Notes
- Snippets target
javascriptreactandtypescriptreactglobally via VS Code User snippet files. - Attributes use double quotes for placeholder defaults.
- Bootstrap does not overwrite user settings unless
--include-settingsis passed.
Release notes (suggested one-liner): New: reactiveflutter command alias; New: built-in doctor diagnostics; Improved: postinstall and troubleshooting guidance.
