This guide covers the build system, build scripts, and packaging process for NebulaFlow.
NebulaFlow is a VS Code extension with a React webview interface. The build process consists of three main components:
Build everything with type checking:
npm run build
This executes in order:
npm run typecheck - TypeScript validation for all componentsnpm run build:webview - Vite bundles React app into dist/webviews/npm run build:ext - esbuild bundles extension + SDK into dist/src/extension.jsBuild specific components:
# Webview only (React UI)
npm run build:webview
# Extension only (VS Code extension host)
npm run build:ext
# Electron app (main process)
npm run build:electron
Watch for changes and rebuild automatically:
# Webview watch (hot reload)
npm run watch:webview
# Extension watch (requires VS Code reload)
npm run watch:ext
# Combined watch (webview + extension)
npm run watch
Note: The combined watch (npm run watch) runs the webview watcher. Extension changes require a VS Code window reload.
Run TypeScript type checking for all components:
npm run typecheck
This validates:
src/, workflow/)workflow/Web/)electron/)NebulaFlow uses Biome for linting and formatting:
# Check (typecheck + lint)
npm run check
# Lint only
npm run lint
# Auto-fix (also aliased as `npm run format`)
npm run biome
Create a VSIX package for distribution:
npm run package:vsix
This creates a .vsix file in the dist/ directory.
Build and package the Electron application:
# Build Electron app
npm run pack:electron
# Build Windows installer
npm run pack:win
# Create Windows zip
npm run zip:win
tsconfig.json): Extends @sourcegraph/tsconfig, targets ES2022, Node16 module systemelectron/tsconfig.json): Extends main config, outputs to dist/electron/workflow/Web/tsconfig.json): Vite-managed, React JSX supportworkflow/Web/workflow.htmldist/webviews/@graph, @sidebar, @modals, @nodes, @sharedsrc/extension.tsdist/src/extension.jselectron/main/electron/preload/dist/electron/dist/
├── src/ # Extension bundle (extension.js)
├── webviews/ # Webview assets (HTML, JS, CSS)
├── electron/ # Electron app bundles
└── release/ # Packaged Electron apps (AppImage, DMG, NSIS)
git clone https://github.com/PriNova/nebulaflow.git
cd nebulaflow
npm install
export AMP_API_KEY="your-amp-key"
export OPENROUTER_API_KEY="your-openrouter-key"
npm run build
npm run watch
Open the project in VS Code.
Press F5 to launch the extension in debug mode.
| Issue | Solution |
|---|---|
| Webview assets don’t load | Run npm run build or start the webview watcher (npm run watch:webview). |
| Type errors | Run npm run typecheck and fix diagnostics. |
| Lint/format issues | Run npm run check or npm run biome. |
| Extension fails to load | Check VS Code version ≥ 1.90.0; reload the window. |
| Amp SDK not available | The SDK is vendored; ensure vendor/amp-sdk/amp-sdk.tgz exists. |
| AMP_API_KEY is not set | Set the environment variable before launching VS Code. |
| Build hangs | Kill any hanging processes and restart the build. |
NebulaFlow uses GitHub Actions for continuous integration. The build workflow (.github/workflows/build.yml) runs:
npm run typecheck)npm run lint)npm run package:vsix)You can run the same steps locally to verify your changes before pushing.
npm run watch) for faster development iteration.npm run build:webview directly.npm run build to ensure a clean build.node_modules/.cache/. Delete this folder if caches become corrupted.@prinova/amp-sdk: Amp SDK (vendored)@xyflow/react: React Flow for graph visualizationreact, react-dom: UI frameworktypescript: TypeScript compileresbuild: Extension bundlervite: Webview bundler@biomejs/biome: Linting and formattingelectron, electron-builder: Electron packaging