Prerequisites
You’ll need the following tools installed on your system:- Node.js - JavaScript runtime
- pnpm - Fast, disk space efficient package manager
- nvm - Node version manager (recommended)
Installation Steps
1. Clone the Repository
2. Use the Correct Node Version
The project includes an.nvmrc file that specifies the required Node.js version:
3. Install Dependencies
Install all project dependencies using pnpm:Development Workflow
Running the Dev Server
Start the Vite development server for the browser/webview code:- Start a local dev server with hot module replacement (HMR)
- Watch for changes in
src/browser/andsrc/main/ - Rebuild automatically when you save files
Building the Extension
To test the full extension in VS Code, you need to build both the browser and extension code:Build Browser Code
out/.
Build Extension Code
out/extension/.
Build Everything
Watch Mode for Extension
When developing extension features, use watch mode:Testing in VS Code
After building, test the extension:- Open the project in VS Code
- Press
F5to launch the Extension Development Host - In the new VS Code window, open a project folder
- Run the command: Gitlantis (Cmd/Ctrl + Shift + P)
Code Quality Tools
Linting
Run ESLint to check for code issues:Formatting
Check code formatting with Prettier:Git Hooks
The project uses Husky to enforce code quality:Pre-commit Hook
Before each commit, lint-staged will:- Run ESLint on staged
.js,.jsx,.ts,.tsxfiles - Run Prettier on staged files
- Auto-fix issues when possible
Commit Message Hook
Commits must follow the Conventional Commits format:feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert
Building for Distribution
Create Extension Package
Create a.vsix file for distribution:
gitlantis-{version}.vsix in the project root.
Full Release Process
Build, package, and publish to the marketplace:Troubleshooting
Build Errors
- Ensure you’re using the correct Node version:
nvm use - Clear node_modules and reinstall:
rm -rf node_modules && pnpm i - Clear Vite cache:
rm -rf out
Extension Not Loading
- Rebuild the extension:
pnpm run build - Reload the Extension Development Host window
- Check the VS Code Developer Console for errors (Help > Toggle Developer Tools)