Skip to main content

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

git clone https://github.com/liltrendi/gitlantis.git
cd gitlantis

2. Use the Correct Node Version

The project includes an .nvmrc file that specifies the required Node.js version:
nvm use
If you don’t have the specified version installed, nvm will prompt you to install it:
nvm install

3. Install Dependencies

Install all project dependencies using pnpm:
pnpm i

Development Workflow

Running the Dev Server

Start the Vite development server for the browser/webview code:
pnpm dev
This will:
  • Start a local dev server with hot module replacement (HMR)
  • Watch for changes in src/browser/ and src/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

pnpm run build:browser
This compiles the React application with Vite and outputs to out/.

Build Extension Code

pnpm run build:extension
This compiles the VS Code extension TypeScript code to out/extension/.

Build Everything

pnpm run build
Builds both browser and extension code in sequence.

Watch Mode for Extension

When developing extension features, use watch mode:
pnpm run watch
This will automatically recompile the extension code when files change.

Testing in VS Code

After building, test the extension:
  1. Open the project in VS Code
  2. Press F5 to launch the Extension Development Host
  3. In the new VS Code window, open a project folder
  4. Run the command: Gitlantis (Cmd/Ctrl + Shift + P)
The extension will launch with your local changes.

Code Quality Tools

Linting

Run ESLint to check for code issues:
pnpm lint
Auto-fix linting errors:
pnpm run lint:fix

Formatting

Check code formatting with Prettier:
pnpm format
Auto-format all files:
pnpm run format:fix

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, .tsx files
  • Run Prettier on staged files
  • Auto-fix issues when possible
If there are unfixable issues, the commit will be blocked.

Commit Message Hook

Commits must follow the Conventional Commits format:
type(scope): description

[optional body]

[optional footer]
Examples:
feat: add boat speed control
fix: resolve minimap positioning bug
chore: update dependencies
docs: improve setup instructions
Valid types: feat, fix, docs, style, refactor, test, chore, perf, ci, build, revert

Building for Distribution

Create Extension Package

Create a .vsix file for distribution:
pnpm run package
This creates gitlantis-{version}.vsix in the project root.

Full Release Process

Build, package, and publish to the marketplace:
pnpm run release
Note: Publishing requires proper credentials configured.

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)

Git Hook Issues

If hooks aren’t running:
pnpm run prepare
This reinstalls Husky hooks.

Build docs developers (and LLMs) love