oca-proxy 1.0.5 → 1.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +91 -2
  2. package/package.json +5 -3
package/README.md CHANGED
@@ -15,7 +15,22 @@ Or install globally from npm and run:
15
15
 
16
16
  ```bash
17
17
  npm install -g oca-proxy
18
- oca-proxy
18
+ # oca-proxy
19
+
20
+ ## Git hooks
21
+
22
+ This repo uses Husky to run checks locally to keep the codebase consistent and healthy.
23
+
24
+ - Pre-commit: runs Biome autofix (`npm run check`), re-stages changes, then runs `npm run lint` to ensure no remaining issues.
25
+ - Pre-push: runs `npm run typecheck` and `npm run build` to catch type errors and build failures before pushing.
26
+
27
+ Setup:
28
+ - Hooks are installed automatically via the `prepare` script when you run `npm install`.
29
+ - If hooks are missing, run: `npx husky install`.
30
+
31
+ Skip hooks temporarily (use sparingly):
32
+ - Commit without hooks: `git commit -m "msg" --no-verify`
33
+ - Push without hooks: `git push --no-verify`
19
34
  ```
20
35
 
21
36
  ### From Source
@@ -186,7 +201,81 @@ module.exports = {
186
201
  ],
187
202
  };
188
203
  ```
189
-
204
+
190
205
  Then start with `pm2 start ecosystem.config.js`.
191
206
 
207
+ ## Releases (GitHub Actions)
208
+
209
+ Tagged pushes that match `v*.*.*` trigger a cross-platform build and GitHub Release with prebuilt binaries using `@yao-pkg/pkg`.
210
+
211
+ - Workflow: `.github/workflows/release.yml`
212
+ - Builds on: Ubuntu, macOS, Windows (Node 20)
213
+ - Output release assets:
214
+ - `oca-proxy-macos-x64.tar.gz`
215
+ - `oca-proxy-macos-arm64.tar.gz`
216
+ - `oca-proxy-linux-x64.tar.gz`
217
+ - `oca-proxy-linux-arm64.tar.gz`
218
+ - `oca-proxy-windows-x64.zip`
219
+
220
+ - How to test builds (Intel and Apple Silicon):
221
+ 1. Manually run the workflow without tagging (GitHub → Actions → build-and-release → Run workflow).
222
+ 2. Download artifacts for your platform from the run summary.
223
+ 3. macOS:
224
+ - Intel: `chmod +x oca-proxy-macos-x64 && ./oca-proxy-macos-x64 --help`
225
+ - Apple Silicon: `chmod +x oca-proxy-macos-arm64 && ./oca-proxy-macos-arm64 --help`
226
+ - Test Intel binary on Apple Silicon via Rosetta: `arch -x86_64 ./oca-proxy-macos-x64 --help`
227
+ 4. Linux:
228
+ - x64: `chmod +x oca-proxy-linux-x64 && ./oca-proxy-linux-x64 --help`
229
+ - arm64: `chmod +x oca-proxy-linux-arm64 && ./oca-proxy-linux-arm64 --help`
230
+ 5. Windows:
231
+ - `.\oca-proxy-windows-x64.exe --help`
232
+ 6. Optional smoke test: start the server and hit the health endpoint:
233
+ - `./oca-proxy-<platform-arch> &`
234
+ - `curl -s http://localhost:8669/health`
235
+
236
+ Cut a release:
237
+
238
+ ```bash
239
+ # 1) Bump your version in package.json (optional but recommended)
240
+ # 2) Commit and tag
241
+ git commit -am "chore: release v1.0.5"
242
+ git tag v1.0.5
243
+ git push origin v1.0.5
244
+ ```
245
+
246
+ Or using npm to manage the version and tag:
247
+
248
+ ```bash
249
+ npm version patch # or minor/major
250
+ git push --follow-tags
251
+ ```
252
+
253
+ ## Homebrew Tap
254
+
255
+ You can distribute `oca-proxy` via a personal Homebrew tap.
256
+
257
+ 1. Create a tap repo: `your-user/homebrew-tap`
258
+ 2. Add a formula at `Formula/oca-proxy.rb` (a template exists in this repo under `Formula/oca-proxy.rb`)
259
+ 3. After a release publishes, update the `sha256` values in the formula for each asset:
260
+ - `shasum -a 256 oca-proxy-macos-x64.tar.gz`
261
+ - `shasum -a 256 oca-proxy-linux-x64.tar.gz`
262
+ - `shasum -a 256 oca-proxy-macos-arm64.tar.gz` (if you publish it)
263
+ 4. Commit the formula to your tap
264
+
265
+ Install from your tap:
266
+
267
+ ```bash
268
+ brew tap your-user/tap
269
+ brew install oca-proxy
270
+ ```
271
+
272
+ ### Automate tap updates
273
+
274
+ This repo includes `.github/workflows/brew-tap.yml` which can automatically bump your tap’s formula on every GitHub Release. Requirements:
275
+
276
+ - Create `GH_PAT` secret (Personal Access Token with `repo` scope) in this repo
277
+ - Ensure your tap repo is `your-user/homebrew-tap` (or adjust the workflow’s `tap:` input)
278
+
279
+ The action computes new checksums and updates URLs in `Formula/oca-proxy.rb` within your tap repository.
280
+
192
281
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oca-proxy",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "OpenAI-compatible proxy for Oracle Code Assist (OCA)",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -18,7 +18,8 @@
18
18
  "lint": "biome lint .",
19
19
  "check": "biome check --write .",
20
20
  "typecheck": "tsc -p tsconfig.json --noEmit",
21
- "prepublishOnly": "npm run build"
21
+ "prepublishOnly": "npm run build",
22
+ "prepare": "husky"
22
23
  },
23
24
  "dependencies": {
24
25
  "axios": "1.13.2",
@@ -34,7 +35,8 @@
34
35
  "@types/uuid": "11.0.0",
35
36
  "esbuild": "0.27.2",
36
37
  "tsx": "4.21.0",
37
- "typescript": "5.9.3"
38
+ "typescript": "5.9.3",
39
+ "husky": "9.1.7"
38
40
  },
39
41
  "publishConfig": {
40
42
  "access": "public"