Skip to content

Commit b86ed83

Browse files
committed
Add VS Code configuration and development scripts
This commit adds shared VS Code configuration and development tooling to improve the contributor experience. VS Code Configuration (.vscode/): - launch.json: Debug configurations for server, CLI, tests, and attach mode - tasks.json: Build tasks for Cargo, Clippy, and frontend (Vite, lint, build) - extensions.json: Recommends CodeLLDB and rust-analyzer extensions Development Scripts: - scripts/dev.sh: Starts full dev environment (kills existing backend, builds, ensures Vite is running, starts backend) The .gitignore is updated to track these specific VS Code files while still ignoring personal settings.
1 parent c18ba4e commit b86ed83

File tree

5 files changed

+215
-1
lines changed

5 files changed

+215
-1
lines changed

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/target
22
.claude
3-
.vscode/
3+
.vscode/*
4+
!.vscode/launch.json
5+
!.vscode/tasks.json
6+
!.vscode/extensions.json
47
.DS_Store
58
/docs/book/
69

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"vadimcn.vscode-lldb",
4+
"rust-lang.rust-analyzer"
5+
]
6+
}

.vscode/launch.json

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"type": "lldb",
6+
"request": "launch",
7+
"name": "Server (Debug)",
8+
"preLaunchTask": "Prepare Dev Environment",
9+
"cargo": {
10+
"args": [
11+
"build",
12+
"--bin=fspulse",
13+
"--package=fspulse"
14+
],
15+
"filter": {
16+
"name": "fspulse",
17+
"kind": "bin"
18+
}
19+
},
20+
"args": ["serve"],
21+
"cwd": "${workspaceFolder}"
22+
},
23+
{
24+
"type": "lldb",
25+
"request": "attach",
26+
"name": "Attach to Server (Debug)",
27+
"program": "${workspaceFolder}/target/debug/fspulse",
28+
"waitFor": true
29+
},
30+
{
31+
"type": "lldb",
32+
"request": "launch",
33+
"name": "Interact (Debug)",
34+
"cargo": {
35+
"args": [
36+
"build",
37+
"--bin=fspulse",
38+
"--package=fspulse"
39+
],
40+
"filter": {
41+
"name": "fspulse",
42+
"kind": "bin"
43+
}
44+
},
45+
"args": ["interact"],
46+
"cwd": "${workspaceFolder}"
47+
},
48+
{
49+
"type": "lldb",
50+
"request": "launch",
51+
"name": "CLI (Debug)",
52+
"cargo": {
53+
"args": [
54+
"build",
55+
"--bin=fspulse",
56+
"--package=fspulse"
57+
],
58+
"filter": {
59+
"name": "fspulse",
60+
"kind": "bin"
61+
}
62+
},
63+
"args": [],
64+
"cwd": "${workspaceFolder}"
65+
},
66+
{
67+
"type": "lldb",
68+
"request": "launch",
69+
"name": "Unit Tests (Debug)",
70+
"cargo": {
71+
"args": [
72+
"test",
73+
"--no-run",
74+
"--bin=fspulse",
75+
"--package=fspulse"
76+
],
77+
"filter": {
78+
"name": "fspulse",
79+
"kind": "bin"
80+
}
81+
},
82+
"args": [],
83+
"cwd": "${workspaceFolder}"
84+
}
85+
]
86+
}

.vscode/tasks.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Clippy",
6+
"type": "shell",
7+
"command": "cargo",
8+
"args": [
9+
"clippy",
10+
"--all-targets",
11+
"--all-features"
12+
],
13+
"group": "build",
14+
"problemMatcher": ["$rustc"]
15+
},
16+
{
17+
"label": "Build (Release)",
18+
"type": "shell",
19+
"command": "cargo",
20+
"args": [
21+
"build",
22+
"--release"
23+
],
24+
"group": {
25+
"kind": "build",
26+
"isDefault": true
27+
},
28+
"problemMatcher": ["$rustc"]
29+
},
30+
{
31+
"label": "Test: All",
32+
"type": "shell",
33+
"command": "cargo",
34+
"args": ["test"],
35+
"group": {
36+
"kind": "test",
37+
"isDefault": true
38+
},
39+
"problemMatcher": ["$rustc"]
40+
},
41+
{
42+
"label": "Test: Verbose",
43+
"type": "shell",
44+
"command": "cargo",
45+
"args": ["test", "--", "--nocapture"],
46+
"group": "test",
47+
"problemMatcher": ["$rustc"]
48+
},
49+
{
50+
"label": "Vite Dev Server",
51+
"type": "shell",
52+
"command": "npm",
53+
"args": ["run", "dev"],
54+
"options": {
55+
"cwd": "${workspaceFolder}/frontend"
56+
},
57+
"isBackground": true,
58+
"problemMatcher": []
59+
},
60+
{
61+
"label": "Frontend: Lint",
62+
"type": "shell",
63+
"command": "npm",
64+
"args": ["run", "lint"],
65+
"options": {
66+
"cwd": "${workspaceFolder}/frontend"
67+
},
68+
"problemMatcher": ["$eslint-stylish"]
69+
},
70+
{
71+
"label": "Frontend: Build",
72+
"type": "shell",
73+
"command": "npm",
74+
"args": ["run", "build"],
75+
"options": {
76+
"cwd": "${workspaceFolder}/frontend"
77+
},
78+
"problemMatcher": ["$tsc"]
79+
},
80+
{
81+
"label": "Frontend: Check",
82+
"dependsOn": ["Frontend: Lint", "Frontend: Build"],
83+
"dependsOrder": "sequence",
84+
"problemMatcher": []
85+
},
86+
{
87+
"label": "Prepare Dev Environment",
88+
"type": "shell",
89+
"command": "pkill -f 'target/debug/fspulse' || true",
90+
"problemMatcher": []
91+
}
92+
]
93+
}

scripts/dev.sh

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/bin/bash
2+
# Development script for running the full stack
3+
# Kills existing backend, builds, ensures Vite is running, then starts backend
4+
5+
set -e
6+
7+
# Kill existing backend if running
8+
echo "Stopping any existing backend..."
9+
pkill -f 'target/debug/fspulse' 2>/dev/null || true
10+
11+
# Build backend
12+
echo "Building backend..."
13+
cargo build
14+
15+
# Ensure vite is running
16+
if ! pgrep -f 'vite.*frontend' > /dev/null; then
17+
echo "Starting Vite dev server..."
18+
(cd frontend && npm run dev &)
19+
sleep 2 # Give vite time to start
20+
else
21+
echo "Vite dev server already running"
22+
fi
23+
24+
# Run backend
25+
echo "Starting backend..."
26+
./target/debug/fspulse serve

0 commit comments

Comments
 (0)