Development Setup
Set up your development environment to contribute to SpecTacular.
Prerequisites
Required
- Git - Version control
- .NET 8 SDK - For CLI development
- Node.js 18+ - For extension development
- VS Code - Recommended IDE
Recommended
- PowerShell 7+ - For installation scripts
- GitHub CLI (
gh) - For PR management - Docker - For containerized testing (optional)
Clone Repository
bash
git clone https://github.com/Tadzesi/SpecTacular.git
cd SpecTacularCLI Development Setup
Install .NET SDK
bash
# Download from https://dot.net
dotnet --version # Verify: 8.0.xRestore Dependencies
bash
cd spectacular-cli/Spectacular.Cli
dotnet restoreBuild
bash
dotnet buildRun Tests
bash
cd ..
dotnet testExtension Development Setup
Install Node.js
bash
# Download from https://nodejs.org
node --version # Verify: 18.x or higher
npm --versionInstall Dependencies
bash
cd spectacular-vscode
npm installThis installs dependencies for both extension and webview.
Start Development
bash
npm run watchThis starts two watch processes:
- Extension host (TypeScript → JavaScript)
- Webview (React + Vite)
Open in VS Code
bash
code .Press F5 to launch Extension Development Host.
Project Structure
SpecTacular/
├── spectacular-cli/ # CLI tool
│ ├── Spectacular.Cli/
│ └── Spectacular.Cli.Tests/
├── spectacular-vscode/ # VS Code extension
│ ├── src/ # Extension host
│ └── webview/ # React UI
├── docs/ # VitePress documentation
├── .spectacular/ # Example configuration
└── specs/ # Example specsDevelopment Workflow
CLI Workflow
- Make changes in
Spectacular.Cli/ - Build:
dotnet build - Test:
dotnet test - Run:
dotnet run -- init --help - Install locally:
cd installer && .\install.ps1 -Local
Extension Workflow
- Start watch:
npm run watch - Open in VS Code:
code . - Press
F5to debug - Make changes
- Reload window (
Ctrl+R) for extension changes - Webview hot-reloads automatically
Documentation Workflow
- Navigate to
docs/ - Start dev server:
npm run dev - Edit markdown files
- Preview at http://localhost:5173
- Build:
npm run build
Testing
CLI Tests
bash
cd spectacular-cli
dotnet test --logger "console;verbosity=detailed"Extension Tests
bash
cd spectacular-vscode
npm testWebview Tests
bash
cd spectacular-vscode/webview
npm testE2E Testing
bash
# Install test project
cd test-workspace
spectacular init --name "Test"
# Open in VS Code
code .
# Test extension features manuallyDebugging
Debug CLI
In VS Code, create .vscode/launch.json:
json
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug CLI",
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/spectacular-cli/Spectacular.Cli/bin/Debug/net8.0/spectacular.exe",
"args": ["init", "--name", "TestProject"],
"cwd": "${workspaceFolder}",
"console": "integratedTerminal"
}
]
}Debug Extension
- Open
spectacular-vscode/in VS Code - Press
F5 - Set breakpoints in
src/*.ts - Test in Extension Development Host
Debug Webview
- In Extension Development Host:
Ctrl+Shift+I - Console shows webview logs
- Sources tab for React debugging
Common Issues
.NET SDK Not Found
bash
# Verify installation
dotnet --version
# If not found, download from https://dot.netnpm install Fails
bash
# Clear cache and retry
rm -rf node_modules package-lock.json
npm installExtension Not Activating
Check activation events in package.json:
json
{
"activationEvents": [
"workspaceContains:**/.spectacular"
]
}Watch Mode Not Working
bash
# Restart watch processes
pkill node
npm run watchCode Style
C# (CLI)
csharp
// PascalCase for classes, methods
public class ScaffoldService
{
// camelCase for parameters
public async Task ScaffoldAsync(string targetPath)
{
// ...
}
}TypeScript (Extension)
typescript
// PascalCase for classes, interfaces
export class DashboardPanel {
// camelCase for methods, variables
public async showFile(filePath: string): Promise<void> {
// ...
}
}React (Webview)
typescript
// PascalCase for components
export const WysiwygEditor: React.FC<Props> = ({ content }) => {
// camelCase for hooks, variables
const [isEditing, setIsEditing] = useState(false);
return <div>...</div>;
};Git Workflow
Create Feature Branch
bash
git checkout -b feature/my-featureCommit Changes
bash
git add .
git commit -m "feat: Add feature description
- Detailed change 1
- Detailed change 2"Push and Create PR
bash
git push origin feature/my-feature
gh pr create --fillNext Steps
- Building - Build from source
- Contributing - Contribution guidelines
- Architecture - Understand the codebase