Build Commands
SuperCmd has several build scripts for different purposes:Development Build
What it does:
- Builds main process once with
npm run build:main - Starts TypeScript watch for main process
- Starts Vite dev server for renderer
- Launches Electron app in development mode with DevTools
Production Build
Build main process
src/main/ to JavaScript in dist/main/ using tsconfig.main.json.Build renderer
dist/renderer/. Optimizes for production with minification and code splitting.Building Native Modules
The native Swift modules are compiled separately:What Gets Built
All native modules are compiled with
-O (optimization) for production performance. They are unpacked from the ASAR archive at runtime (see package.json:69).Packaging
Standard Package (Signed & Notarized)
- Sets
NODE_ENV=production - Runs full production build
- Packages with electron-builder
- Code signs with identity
Shobhit Bhosure (T7HT4U4666) - Notarizes with Apple (Team ID:
T7HT4U4666) - Outputs to
out/directory
Unsigned Package (Development)
- Sets
CSC_IDENTITY_AUTO_DISCOVERY=false - Sets
-c.mac.identity=null - Sets
-c.mac.notarize=false - Useful for local testing and development
Build Configuration
electron-builder Settings
Configured inpackage.json under the build key:
ASAR Unpacking
Certain files must be unpacked from the ASAR archive:- Native modules - Swift binaries in
dist/native/ - Worker scripts -
window-manager-worker.js - Binary dependencies - esbuild, node-edge-tts, node-window-manager, electron-liquid-glass
macOS Configuration
- Camera usage description
- Microphone usage description
- Speech recognition usage description
Output Artifacts
After runningnpm run package, you’ll find artifacts in the out/ directory:
Distribution Formats
- DMG - Drag-and-drop installer for macOS
- ZIP - Compressed archive with the
.appbundle
Auto-Updates
SuperCmd includes electron-updater for automatic updates:Build Process Details
TypeScript Compilation
Main Process:- Uses
tsconfig.main.json - Compiles
src/main/**/*.tstodist/main/**/*.js - Target: ES2020
- Module: CommonJS
- Handled by Vite with
@vitejs/plugin-react - Hot module replacement in dev mode
- Optimized bundle in production
- Outputs to
dist/renderer/
Extension Bundling
Extensions are bundled at runtime using esbuild:- Format: CommonJS
- Bundles
@raycast/apiand@raycast/utilsimports - Provides custom
require()shim - See
src/main/extension-runner.ts:100
Continuous Integration
Recommended CI Workflow
Troubleshooting
Build fails with 'swiftc: command not found'
Build fails with 'swiftc: command not found'
Install Xcode Command Line Tools:
Native modules missing after build
Native modules missing after build
Run
npm run build:native explicitly before packaging:Electron builder fails with signing errors
Electron builder fails with signing errors
Use the unsigned build for local development:
ASAR unpacking issues
ASAR unpacking issues
Ensure files that need filesystem access are listed in
asarUnpack in package.json:69-77.Build size is too large
Build size is too large
Check that dev dependencies aren’t being bundled. Ensure they’re in
devDependencies, not dependencies in package.json.Next Steps
- Learn about the project architecture
- Set up your development environment
- Read the contribution guidelines