Commit graph

8 commits

Author SHA1 Message Date
kite
c69108656b feat: switch auto-update to npm i -g and show update hints on failure
Some checks are pending
CI / test (push) Waiting to run
Replace GitHub releases download with `npm i -g` so platform package
installations also get auto-updates. On permission failure, write a hint
file that bin/ocr.js reads to prompt the user to update manually.
2026-06-23 19:09:44 +08:00
kite
f76d4266ed feat: add platform-specific npm packages to eliminate postinstall download
Ship Go binaries inside per-platform npm packages (@alibaba-group/ocr-{os}-{arch})
so npm install resolves the correct binary via optionalDependencies + os/cpu fields.
This removes the need for a postinstall download from GitHub Releases, which is
extremely slow for users behind restricted networks (e.g. China mainland).

The postinstall download is retained as a fallback for --no-optional installs.
2026-06-17 14:17:03 +08:00
kite
e9bd334b7f fix: enforce mandatory checksum verification and HTTPS-only registry access
Previously, checksum failures in install.js were silently downgraded to
warnings, allowing unverified binaries to be installed. Similarly,
update.js accepted HTTP registries and skipped verification when no
matching platform entry was found.

Now both scripts treat checksum verification as mandatory when configured:
all failure paths (download error, compute error, mismatch, missing
platform entry) abort the operation and clean up downloaded files.
update.js also drops the http module and silently skips version checks
for non-HTTPS registries.
2026-06-16 16:15:14 +08:00
kite
558ffe9a91 fix(build): improve Windows support based on PR #13 review feedback
Unify BUILD_PLATFORM macro with optional suffix parameter to eliminate
  duplication, centralize IS_WINDOWS/BINARY_NAME exports in install.js,
  add Windows-safe rename-then-replace strategy in update.js, and add
  PATH guidance in README for Windows users.
2026-06-02 22:37:27 +08:00
Bison Xu
89effb6b22
feat(build): add Windows platform support (#13)
* feat(build): add Windows platform support

Add windows/amd64 and windows/arm64 to CI build matrix, Makefile
cross-platform targets, and handle .exe suffix in install/update
scripts and binary wrapper. Skip chmod on Windows where unsupported.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* docs(README): add Windows download instructions

Add Windows x86_64 and ARM64 binary download commands to both
English and Chinese README install sections.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
2026-06-02 21:57:31 +08:00
kite
5053e6dca8 refactor(config): rename config directory from .open-code-review to .opencodereview
Unify the config folder name to `.opencodereview` across all runtime paths,
  tests, docs, and i18n strings. Also make defaultConfigPath() return an error
  instead of silently falling back to a current-directory file when $HOME is
  unresolvable.
2026-05-25 23:07:36 +08:00
kite
fe058451cc chore(scripts): Update version check 2026-05-22 22:06:07 +08:00
kite
44120e28b6 fix: fix some bug 2026-05-22 21:27:39 +08:00