@number10/create-electron-ipc
v0.3.0
Published
Scaffold a new Electron IPC app powered by @number10/electron-ipc
Maintainers
Readme
@number10/create-electron-ipc
Scaffold a new Electron app using @number10/electron-ipc with a production-ready Vite + React setup.
Quick Start
macOS/Linux:
npm create @number10/electron-ipcWindows:
npx @number10/create-electron-ipcImportant: Always use forward-slash
/(not backslash\) in the package name, even on Windows. Usenpxinstead ofnpm createon Windows.
With options:
npx @number10/create-electron-ipc --name my-app --validation zod --inspector yUsing pnpm (all platforms):
pnpm dlx @number10/create-electron-ipcWhat You Get
- Electron 35 + Vite 5 + React 19 starter
- Type-safe IPC contracts (invoke, event, broadcast)
- TypeScript strict mode with comprehensive configuration
- ESLint 9 (flat config) + Prettier pre-configured
- VS Code workspace settings and debug configuration
- Optional IPC Inspector for debugging
- Optional runtime validation (Zod or Valibot)
- Production-ready build configuration with electron-builder
CLI Options
--dir <path> Target directory (default: current directory)
--name <name> Package name (default: directory name)
--product-name <name> Product name (default: formatted package name)
--app-id <id> Application ID (default: com.example.<name>)
--author <name> Author name
--pm <manager> Package manager: pnpm, npm (default: pnpm)
--inspector <y/n> Include IPC Inspector (default: n)
--validation <type> Validation: none, zod, valibot (default: none)
- zod: Uses modern zodValidator from @number10/electron-ipc/validation
- valibot: Uses modern valibotValidator from @number10/electron-ipc/validation
--no-install Skip dependency installation
--help, -h Show help messageProject Structure
The generated project includes:
my-app/
├── src/
│ ├── main/ # Main process code
│ │ ├── index.ts # Entry point + window setup
│ │ ├── ipc-api.ts # IPC contract definitions
│ │ └── ipc-config.yaml # Generator configuration
│ └── preload/ # Preload script (context bridge)
│ └── index.ts
├── public/ # Renderer process (React)
│ ├── App.tsx # Main React component
│ ├── index.html # HTML entry
│ ├── renderer.tsx # React setup
│ └── components/ # React components
├── dist/ # Generated IPC code
└── out/ # Built applicationAvailable Scripts
npm run dev- Start development server with hot reloadnpm run build- Build app for productionnpm run generate- Generate IPC contracts from confignpm run typecheck- Run TypeScript type checkingnpm run lint- Lint code with ESLintnpm run format- Format code with Prettiernpm run package- Package app for distribution
Requirements
- Node.js ≥20.0.0
- npm or pnpm
Local Development
From the monorepo root:
node packages/create-electron-ipc/bin/create-electron-ipc.js --dir ./tmp-appOr test the packed version:
pnpm pack
npx -y --package ./number10-create-electron-ipc-0.1.0.tgz create-electron-ipcTesting
The package includes automated tests to ensure the CLI works correctly:
# Quick tests (file generation only, ~1 second)
npm test
# Integration tests (includes npm install + build, ~3 minutes)
npm run test:integrationTests verify:
- ✅ Project scaffolding with all validation options (none, zod, valibot)
- ✅ Modern validation adapters (zodValidator, valibotValidator)
- ✅ Correct import paths (
@number10/electron-ipc/validation) - ✅ Inspector integration
- ✅ Full build pipeline (integration tests only)
Learn More
License
MIT © Michael Rieck
