Files
hapi/cli/package.json
T
weishu 85c2dc10ea feat: add npx/bunx binary distribution support
Adds infrastructure for distributing Hapi via npm as a scoped package
(@twsxtd/hapi) with platform-specific optional dependencies. This enables
installation via `npx @twsxtd/hapi` or `bunx @twsxtd/hapi`.

- Add bin/hapi.js wrapper script for platform detection and binary selection
- Create npm/ directory structure for platform-specific packages (darwin-{arm64,x64},
  linux-{arm64,x64}, win32-x64)
- Add scripts/prepare-npm-packages.ts to generate platform-specific package.json files
  and copy binaries to npm packages
- Add scripts/publish-npm.ts for automated publishing of platform packages
- Update package.json with new scoped name, bin entry, optionalDependencies, and
  prepack/publish scripts
- Update .gitignore to ignore generated npm packages and build outputs
- Update .npmignore to only include bin/hapi.js wrapper, excluding source and build files
2025-12-24 14:39:05 +08:00

91 lines
2.8 KiB
JSON

{
"name": "@twsxtd/hapi",
"version": "0.12.0-1",
"description": "Mobile and Web client for Claude Code and Codex",
"author": "Kirill Dubovitskiy",
"license": "MIT",
"type": "module",
"homepage": "https://github.com/user/hapi",
"bugs": "https://github.com/user/hapi/issues",
"repository": {
"type": "git",
"url": "https://github.com/user/hapi",
"directory": "cli"
},
"bin": {
"hapi": "bin/hapi.js"
},
"files": [
"bin/hapi.js"
],
"imports": {
"#embedded-assets": {
"bun": "./src/runtime/embeddedAssets.bun.ts",
"default": "./src/runtime/embeddedAssets.stub.ts"
}
},
"optionalDependencies": {
"@twsxtd/hapi-darwin-arm64": "0.0.0-placeholder",
"@twsxtd/hapi-darwin-x64": "0.0.0-placeholder",
"@twsxtd/hapi-linux-arm64": "0.0.0-placeholder",
"@twsxtd/hapi-linux-x64": "0.0.0-placeholder",
"@twsxtd/hapi-win32-x64": "0.0.0-placeholder"
},
"scripts": {
"typecheck": "tsc --noEmit",
"build:exe": "bun run scripts/build-executable.ts",
"build:exe:all": "bun run scripts/build-executable.ts --all",
"build:exe:allinone": "bun run scripts/build-executable.ts --with-web-assets",
"build:exe:allinone:all": "bun run scripts/build-executable.ts --with-web-assets --all",
"prepare-npm-packages": "bun run scripts/prepare-npm-packages.ts",
"prepack": "bun run prepare-npm-packages",
"publish-npm": "bun run scripts/publish-npm.ts",
"publish-npm:dry-run": "bun run scripts/publish-npm.ts --dry-run",
"tools:unpack": "bun run scripts/unpack-tools.ts",
"test": "tsx --env-file .env.integration-test node_modules/.bin/vitest run",
"test:win": "vitest run",
"dev": "tsx src/index.ts",
"dev:local-server": "tsx --env-file .env.dev-local-server src/index.ts",
"dev:integration-test-env": "tsx --env-file .env.integration-test src/index.ts"
},
"dependencies": {
"@modelcontextprotocol/sdk": "^1.22.0",
"@types/cross-spawn": "^6.0.6",
"@types/ps-list": "^6.2.1",
"@types/react": "^19.2.7",
"@types/tmp": "^0.2.6",
"axios": "^1.13.2",
"chalk": "^5.6.2",
"cross-spawn": "^7.0.6",
"fastify": "^5.6.2",
"fastify-type-provider-zod": "4.0.2",
"ink": "^6.5.1",
"ps-list": "^8.1.1",
"react": "^19.2.0",
"react-devtools-core": "^7.0.1",
"socket.io-client": "^4.8.1",
"tar": "^7.5.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@eslint/compat": "^1",
"@types/node": ">=20",
"bun-types": "^1.3.5",
"cross-env": "^10.1.0",
"dotenv": "^16.6.1",
"eslint": "^9",
"eslint-config-prettier": "^10",
"shx": "^0.3.3",
"ts-node": "^10",
"tsx": "^4.20.6",
"typescript": "^5",
"vitest": "^3.2.4"
},
"resolutions": {
"whatwg-url": "14.2.0",
"parse-path": "7.0.3",
"@types/parse-path": "7.0.3"
},
"packageManager": "bun@1.3.4"
}