Commit Graph
26 Commits
Author SHA1 Message Date
weishuandGitHub 909aaca09d fix(cli): gate main package release on platform packages being live (#1187)
- prepare-npm-packages: exit(1) instead of warn-and-continue when a
  platform binary is missing, so a broken build aborts the release
- release-all: after publishing platform packages, poll npm view for
  every @twsxtd/hapi-<platform> package until it matches the release
  version (10min timeout, 15s interval) before publishing the main
  package

Fixes #1149
2026-07-27 12:59:02 +08:00
weishu 83795c0630 Clean up cross-package build coupling 2026-05-20 19:29:43 +08:00
weishu 0db303d9f8 Fix release lockfile platform packages 2026-05-06 09:40:43 +08:00
c02f392d81 fix(cli): correct Homebrew formula URL for Linux x64 baseline build (#408)
The release workflow produces `hapi-linux-x64-baseline.tar.gz` (from
bun-linux-x64-baseline target), but the Homebrew formula generator wrote
the URL as `hapi-linux-x64.tar.gz`, causing `brew install` to fail on
Linux x64 with a 404.

Closes #365

via [HAPI](https://hapi.run)

Co-authored-by: HAPI <noreply@hapi.run>
2026-04-06 20:41:41 +08:00
weishu 72a23fc761 build baseline variant for linux x64. 2026-03-02 13:11:06 +08:00
weishu 37e10a831b feat: rename server package to hub
Rename the `server/` directory to `hub/` and update all references
across CLI, docs, web, and workspace configuration.
2026-01-27 19:51:21 +08:00
weishu 83bf40fa53 Fix npm release wrapper package 2026-01-03 22:22:45 +08:00
weishu 7922356669 feat: add timeout and retry logic to bun install in release script 2025-12-28 00:03:37 +08:00
Ruihang XiaandGitHub e2731fc7f0 fix: disable autoload dotenv (#11)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
2025-12-26 17:07:07 +08:00
weishu 3cdfee0c36 0.1.2 2025-12-25 13:05:15 +08:00
weishu c224188dd3 chore: allow release dry-run without npm login 2025-12-25 12:46:26 +08:00
weishu 4fb2a203c6 feat: add pre-checks to release-all script for safety
Add validation checks before releasing:
- Ensure we're on the main branch to prevent accidental releases from feature branches
- Verify npm authentication to prevent failed publish attempts

This prevents common release mistakes and improves release workflow reliability.
2025-12-25 12:30:10 +08:00
weishu dbbeedea0d refactor: unify release workflow into single release-all script
Consolidate version bumping, building, npm publishing, and git operations into a single release script that handles platform packages first. This solves the issue where optionalDependencies needed platform packages published before bun install could generate complete lockfile hashes.

Changes:
- Created cli/scripts/release-all.ts with support for --dry-run, --publish-npm, and --skip-build flags
- Removed release-it dependency and old release/publish-npm scripts
- Simplified GitHub Actions release workflow to always use --generate-notes
- Deleted obsolete release configuration files (.release-it.json, .release-it.notes.js, publish-npm.ts)
2025-12-25 12:26:49 +08:00
weishu 90cb7dae05 feat: add Homebrew installation support for hapi CLI
- Update CI workflow to package release artifacts with correct naming (hapi-* prefix)
- Generate SHA256 checksums for all artifacts
- Auto-update homebrew-tap repository on release
- Add Installation section to README with Homebrew, npm, and binary options
- Simplify .release-it.json config as CI now handles release process
- Add update-homebrew-formula script to update formula in homebrew-tap
- Add release-artifacts directory to .gitignore

Users can now install via: brew install tiann/tap/hapi
2025-12-25 10:23:16 +08:00
weishu 31dfaebc85 chore: remove Windows ARM64 build support and add npm publish scripts
- Add publish-npm and publish-npm:dry-run scripts to root package.json (forwarding to cli)
- Remove Windows ARM64 (bun-windows-arm64) from DEFAULT_TARGETS in build-executable.ts
- Remove Windows ARM64 check from getPlatformDir in build-executable.ts
- Remove HAPI_TARGET_WIN32_ARM64 from bunBundle.d.ts type definitions
- Remove Windows ARM64 check from embeddedAssets.bun.ts
2025-12-24 18:51:49 +08:00
weishu 3e4b8ddc64 refactor: remove non-allinone build scripts and fix npm publish build command
Remove build:cli:exe and build:cli:exe:all scripts since building executables
without web assets serves no practical purpose. Update npm publish script to use
build:single-exe:all which includes embedded web assets in published packages.
2025-12-24 15:04:26 +08:00
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
weishu 2bff252e6a refactor: migrate unpack-tools script from CommonJS to TypeScript 2025-12-23 18:09:12 +08:00
weishu 92996667d5 refactor: remove CommonJS ripgrep launcher and spawn binary directly
Replace the ripgrep_launcher.cjs intermediary with direct binary execution.
This simplifies the ripgrep module by spawning the binary directly instead
of going through a Node.js subprocess wrapper. Add platform-specific binary
path resolution to handle both Unix and Windows environments.
2025-12-23 18:09:12 +08:00
weishu 88cce9c28d refactor: remove CommonJS launchers and use claude command directly
Remove local Claude launcher scripts and refactor to invoke the global
claude command from PATH. This simplifies the launcher logic and removes
the need to maintain separate CommonJS entry points.

Changes:
- Delete cli/scripts/claude_local_launcher.cjs, claude_remote_launcher.cjs,
  and claude_version_utils.cjs
- Update claudeLocal to spawn 'claude' command directly instead of using
  a launcher script
- Remove runtimePath dependency and launcher existence checks
- Add DISABLE_AUTOUPDATER environment variable for local mode
- Improve error messages when claude command is not found
- Add shell option for Windows compatibility in process spawning
- Remove unused imports from claudeLocal and index files
2025-12-23 10:21:50 +08:00
weishu 0128792495 refactor: remove thinking state tracking from local launcher 2025-12-23 08:25:44 +08:00
weishu 8cbe68c47a fix(cli): add stub embedded assets generation to build process 2025-12-22 00:01:34 +08:00
weishu 1028547a3a feat(cli): add single executable with embedded web assets support
Implement support for bundling web assets into CLI single executable binaries.
When built with --with-web-assets, the executable includes the compiled web
application and serves it directly without file system access. A stub generator
creates empty manifests for normal builds to maintain compatibility.

Key changes:
- Add --with-web-assets flag to build-executable.ts with manifest validation
- Generate embeddedAssets.ts manifest from web/dist during build
- Serve embedded assets in web server with fallback to file system
- Add hapi server subcommand to start API + web server
- Include server sources in CLI tsconfig for compilation scope
- Add workspace-level build:single-exe scripts for production builds
2025-12-21 08:42:00 +08:00
weishu 17eeba10d6 feat(cli): add Bun single executable binary support
Enables building hapi as standalone Bun-compiled executables for macOS,
Linux, and Windows (x64/arm64). Adds build script, bootstrap entry point,
runtime asset management, and automatic deployment of bundled tools
(ripgrep, difftastic). Includes MCP stdio bridge support and proper
environment handling for compiled binaries. Updates documentation with
build and installation instructions for single executable distribution.
2025-12-20 21:41:11 +08:00
weishu 80725a2d34 feat(cli): add Bun runtime support for ripgrep and CLI spawning
Replace hardcoded 'node' commands with process.execPath to support
Bun runtime alongside Node.js. Add runtime detection and entrypoint
resolution for Bun. Update documentation to reflect multi-runtime support.
2025-12-20 16:03:51 +08:00
weishu b4654acb92 init 2025-12-16 15:03:50 +08:00