diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2fb1c36f..7f392f97 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -63,6 +63,11 @@ jobs: node-version: 20 cache: pnpm + - name: Setup Python for node-gyp + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies run: pnpm install --no-frozen-lockfile @@ -98,6 +103,11 @@ jobs: node-version: 20 cache: pnpm + - name: Setup Python for node-gyp + uses: actions/setup-python@v5 + with: + python-version: '3.11' + - name: Install dependencies run: pnpm install --no-frozen-lockfile diff --git a/README.md b/README.md index 925bbf82..73b73289 100644 --- a/README.md +++ b/README.md @@ -68,7 +68,7 @@ Every tool call is paired with its result in an expandable card. Specialized vie ### :bell: Custom Notification Triggers -Define rules for when you want to be notified. Match on regex patterns, assign colors, and filter your inbox by trigger. Built-in triggers catch common errors out of the box; add your own for project-specific patterns. +Define rules for when you want to receive **system notifications**. Match on regex patterns, assign colors, and filter your inbox by trigger. Built-in triggers catch common errors out of the box; add your own for project-specific patterns. ### :busts_in_silhouette: Team & Subagent Visualization diff --git a/electron.vite.config.ts b/electron.vite.config.ts index c133e417..ad7b62be 100644 --- a/electron.vite.config.ts +++ b/electron.vite.config.ts @@ -1,21 +1,40 @@ import { defineConfig, externalizeDepsPlugin } from 'electron-vite' import react from '@vitejs/plugin-react' +import { readFileSync } from 'fs' import { resolve } from 'path' +import type { Plugin } from 'vite' + +// Read all production dependencies from package.json +// so they get bundled into the main process output. +// This avoids pnpm symlink issues with electron-builder's asar packaging. +const pkg = JSON.parse(readFileSync(resolve(__dirname, 'package.json'), 'utf-8')) +const prodDeps = Object.keys(pkg.dependencies || {}) + +// Rollup plugin: stub out native .node addon imports with empty modules. +// ssh2 and cpu-features use optional native bindings that can't be bundled, +// but they have pure JS fallbacks when the native module isn't available. +function nativeModuleStub(): Plugin { + const STUB_ID = '\0native-stub' + return { + name: 'native-module-stub', + resolveId(source) { + if (source.endsWith('.node')) return STUB_ID + return null + }, + load(id) { + if (id === STUB_ID) return 'export default {}' + return null + } + } +} export default defineConfig({ main: { plugins: [ externalizeDepsPlugin({ - exclude: [ - 'unified', - 'remark-parse', - 'remark-gfm', - 'mdast-util-to-hast', - 'fastify', - '@fastify/cors', - '@fastify/static' - ] - }) + exclude: prodDeps + }), + nativeModuleStub() ], resolve: { alias: { @@ -29,6 +48,12 @@ export default defineConfig({ rollupOptions: { input: { index: resolve(__dirname, 'src/main/index.ts') + }, + output: { + // CJS format so bundled deps can use __dirname/require. + // Use .cjs extension since package.json has "type": "module". + format: 'cjs', + entryFileNames: '[name].cjs' } } } diff --git a/package.json b/package.json index 93c5404a..b0509323 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ "bugs": { "url": "https://github.com/matt1398/claude-devtools/issues" }, - "main": "dist-electron/main/index.js", + "main": "dist-electron/main/index.cjs", "scripts": { "dev": "electron-vite dev", "build": "electron-vite build", @@ -125,7 +125,7 @@ ], "asar": true, "extraMetadata": { - "main": "dist-electron/main/index.js" + "main": "dist-electron/main/index.cjs" }, "mac": { "category": "public.app-category.developer-tools", diff --git a/resources/demo.mp4 b/resources/demo.mp4 index 6b9145af..afb0bb19 100644 Binary files a/resources/demo.mp4 and b/resources/demo.mp4 differ