codeburn/app/package.json
iamtoruk 4a100d9d06 feat(app): bundle the CLI inside the packaged app
The packaged app resolved whatever codeburn was on PATH — for real
users the published npm release, which predates every JSON surface the
app calls. The app now ships its own CLI copy under resources/cli
(staged production node_modules tree; tsup output is not
self-contained) and spawns it with Electron's own binary via
ELECTRON_RUN_AS_NODE. No install prerequisite remains.

- resolution order: CODEBURN_BIN, dev repo CLI, bundled, persisted
  path, PATH search
- launch.js shim strips the extra argv element commander mis-slices
  under packaged Electron-as-node (process.versions.electron is set),
  which reproduced the 'too many arguments' class of error
- afterPack hook copies the staged tree (extraResources runs
  node_modules through the production-dep filter and ships it empty);
  lands before signing, signature verified intact
- packaging always restages from src via root build:cli (tsup only,
  no network); ~12MB compressed per artifact

Verified on the built app: Electron-as-node CLI emits current JSON
(providerDetails, currency), and a minimal-PATH GUI launch spawns the
bundled CLI with zero external dependencies. 290/290.
2026-07-16 09:27:46 -07:00

113 lines
3.1 KiB
JSON

{
"name": "codeburn-desktop",
"private": true,
"version": "0.9.15",
"description": "CodeBurn Desktop \u2014 Electron app fed by the codeburn CLI",
"main": "dist/electron/main.js",
"scripts": {
"build:electron": "tsc -p tsconfig.electron.json",
"build:renderer": "vite build",
"build": "npm run build:electron && npm run build:renderer",
"dev": "npm run build:electron && concurrently -k -n vite,electron -c cyan,magenta \"vite\" \"wait-on tcp:127.0.0.1:5173 && cross-env VITE_DEV_SERVER_URL=http://127.0.0.1:5173 electron .\"",
"test": "vitest run",
"typecheck": "tsc --noEmit -p tsconfig.json",
"stage-cli": "npm --prefix .. run build:cli && node scripts/stage-cli.mjs",
"package": "npm run stage-cli && npm run build && electron-builder --mac",
"package:arm64": "npm run stage-cli && npm run build && electron-builder --mac --arm64",
"package:x64": "npm run stage-cli && npm run build && electron-builder --mac --x64",
"package:win": "npm run stage-cli && npm run build && electron-builder --win",
"package:linux": "npm run stage-cli && npm run build && electron-builder --linux"
},
"dependencies": {
"@gsap/react": "^2.1.2",
"gsap": "^3.15.0",
"react": "^19.2.7",
"react-dom": "^19.2.7"
},
"devDependencies": {
"@testing-library/jest-dom": "^6.9.1",
"@testing-library/react": "^16.3.2",
"@testing-library/user-event": "^14.6.1",
"@types/node": "^26.1.1",
"@types/react": "^19.2.17",
"@types/react-dom": "^19.2.3",
"@vitejs/plugin-react": "^4.7.0",
"@vitest/ui": "^3.2.7",
"concurrently": "^10.0.3",
"cross-env": "^10.1.0",
"electron": "^43.1.0",
"electron-builder": "^26.15.3",
"jsdom": "^29.1.1",
"typescript": "^7.0.2",
"vite": "^6.4.3",
"vitest": "^3.2.7",
"wait-on": "^9.0.10"
},
"build": {
"appId": "org.agentseal.codeburn-desktop",
"productName": "CodeBurn",
"directories": {
"output": "release"
},
"files": [
"dist/electron/**/*",
"dist/renderer/**/*",
"package.json"
],
"afterPack": "./scripts/after-pack.cjs",
"mac": {
"target": [
{
"target": "dmg",
"arch": [
"arm64",
"x64"
]
},
{
"target": "zip",
"arch": [
"arm64",
"x64"
]
}
],
"category": "public.app-category.developer-tools",
"icon": "build/icon.png",
"identity": "-",
"hardenedRuntime": false,
"gatekeeperAssess": false
},
"dmg": {},
"win": {
"target": [
{
"target": "nsis",
"arch": [
"x64"
]
}
],
"icon": "build/icon.png"
},
"nsis": {
"oneClick": false,
"perMachine": false,
"artifactName": "CodeBurn-Setup-${version}.${ext}"
},
"linux": {
"target": [
{
"target": "AppImage",
"arch": [
"x64"
]
}
],
"category": "Development",
"icon": "build/icon.png",
"maintainer": "AgentSeal <hello@agentseal.org>",
"executableName": "codeburn"
}
}
}