-
Notifications
You must be signed in to change notification settings - Fork 1
Development Guide
Snowy edited this page Feb 15, 2026
·
1 revision
- Node.js 20 or 22
- npm (included with Node.js)
- Git
- Python (for native module compilation via node-gyp)
-
C++ build tools:
- Windows: Visual Studio Build Tools or
npm install -g windows-build-tools - macOS: Xcode Command Line Tools (
xcode-select --install) - Linux:
build-essential,libsecret-1-dev
- Windows: Visual Studio Build Tools or
# Debian/Ubuntu
sudo apt install build-essential libsecret-1-dev
# Fedora
sudo dnf install gcc-c++ libsecret-devel# Clone the repository
git clone https://github.com/Snowy7/sncode.git
cd sncode
# Install dependencies
npm install
# Start development mode
npm run devDevelopment mode runs:
-
Vite dev server at
http://127.0.0.1:5188with hot module replacement - TypeScript compiler in watch mode for the main process
- Electron connecting to the Vite dev server
| Script | Command | Description |
|---|---|---|
npm run dev |
concurrently dev:renderer dev:electron |
Full dev environment with HMR |
npm run build |
vite build && tsc -p tsconfig.node.json |
Production build |
npm run lint |
eslint . |
Run ESLint |
npm run typecheck |
tsc --noEmit (both configs) |
Type check without emitting |
npm test |
vitest run |
Run test suite |
npm run package |
npm run build && electron-builder |
Build and create installers |
npm run icons |
node scripts/generate-icons.mjs |
Generate app icons |
npm start |
electron . |
Launch the built app |
| Config | Target | Module | Output |
|---|---|---|---|
tsconfig.json |
Renderer (React) | ESNext / Bundler | N/A (Vite handles) |
tsconfig.node.json |
Main process (Electron) | CommonJS / Node | dist-electron/ |
| Directory | Contents |
|---|---|
dist/ |
Vite-built renderer (HTML, CSS, JS) |
dist-electron/ |
Compiled main process JS |
release/ |
Electron-builder output (installers) |
Tests use Vitest and are located alongside source files:
# Run all tests
npm test
# Run tests in watch mode
npx vitest
# Run a specific test file
npx vitest src/shared/models.test.tsCurrent test suites:
-
src/shared/models.test.ts— Model catalog and helper functions -
src/shared/schema.test.ts— Zod validation schemas -
src/main/project-tools.test.ts— File and command tool functions
npm run lintESLint 9 with:
@typescript-eslint/eslint-plugineslint-plugin-react-hookseslint-plugin-react-refresh
npm run typecheckChecks both the renderer (tsconfig.json) and main process (tsconfig.node.json) configurations.
# Build installers for the current platform
npm run package
# Build without publishing
npx electron-builder --publish never| Platform | Target | Output |
|---|---|---|
| Windows | NSIS installer | .exe |
| macOS | DMG |
.dmg (x64 + arm64) |
| Linux | AppImage | .AppImage |
The full electron-builder config is in package.json under the "build" key:
- App ID:
com.sncode.desktop - ASAR packaging enabled (with
keytarunpacked for native access) - Artifact naming:
${productName}-${version}-${platform}-${arch}.${ext}
Runs on pull requests to main:
- Lint + Typecheck + Test — Ubuntu, Node.js 20 and 22
- Build — Ubuntu, Windows, macOS (depends on step 1 passing)
Triggered by tag pushes (v*) or manual dispatch:
- Validate — Lint, typecheck, test
- Package — Build installers on all three platforms
- Release — Create GitHub Release with auto-generated notes and upload artifacts
- Fork the repository
- Create a feature branch
- Make your changes
- Run
npm run lint && npm run typecheck && npm testto validate - Submit a pull request
See CONTRIBUTING.md for detailed guidelines.
SnCode Wiki
Getting Started
User Guide
Agent System
Technical
Support