Skip to content

Commit 2378477

Browse files
Set Node 24 floor for reranking client (#3)
* Set Node 24 floor for reranking client * fix: execute Node against packed dist in CI CI installed Node 24 then only ran bun. After build, pack the package and import @corbits/reranking with node. Emit .js relative specifiers so Node ESM can load dist. Drop package.json author so this branch does not fight #1.
1 parent ddc354c commit 2378477

6 files changed

Lines changed: 26 additions & 7 deletions

File tree

‎.github/workflows/ci.yml‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,14 @@ on:
88
jobs:
99
check:
1010
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
node-version: [24]
1114
steps:
1215
- uses: actions/checkout@v4
16+
- uses: actions/setup-node@v4
17+
with:
18+
node-version: ${{ matrix.node-version }}
1319
- uses: oven-sh/setup-bun@v2
1420
with:
1521
bun-version: latest
@@ -18,3 +24,13 @@ jobs:
1824
- run: bun test ./src
1925
- run: bunx prettier --check src
2026
- run: bun run build
27+
- name: Pack and import on Node
28+
run: |
29+
set -euo pipefail
30+
tgz=$(npm pack)
31+
repo="$PWD"
32+
work=$(mktemp -d)
33+
cd "$work"
34+
npm init -y
35+
npm install "$repo/$tgz"
36+
node --input-type=module -e "import { rerankDocuments } from '@corbits/reranking'; if (typeof rerankDocuments !== 'function') process.exit(1)"

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Semver. Released manually with `bun run build && npm publish` once CI is green.
114114

115115
## Development
116116

117+
Requires Node.js >= 24 and Bun >= 1.2.0.
118+
117119
```bash
118120
bun install
119121
bun test ./src

‎package.json‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"url": "https://github.com/corbitsdev/corbits-reranking/issues"
5050
},
5151
"engines": {
52-
"bun": ">=1.2.0"
52+
"bun": ">=1.2.0",
53+
"node": ">=24"
5354
}
5455
}

‎src/adapters.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { type } from "arktype";
22
import type { BuiltRequest } from "@intx/inference";
33

4-
import type { RetryAfterExtractor } from "./request";
4+
import type { RetryAfterExtractor } from "./request.js";
55

66
/**
77
* A document offered to the reranker. `id` is the caller's own handle — the

‎src/index.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ export {
33
RerankConfigSchema,
44
type RerankConfig,
55
type RerankOptions,
6-
} from "./rerank";
6+
} from "./rerank.js";
77
export {
88
rerankAdapters,
99
rerankAdapterRegistry,
@@ -16,11 +16,11 @@ export {
1616
type RerankRequestConfig,
1717
type RerankResponseParser,
1818
type RerankResult,
19-
} from "./adapters";
19+
} from "./adapters.js";
2020
export {
2121
runJSONRequest,
2222
extractRetryAfterMs,
2323
ModelRequestError,
2424
type RetryAfterExtractor,
2525
type RunRequestOptions,
26-
} from "./request";
26+
} from "./request.js";

‎src/rerank.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
type RerankAPIStyle,
88
type RerankDoc,
99
type RerankResult,
10-
} from "./adapters";
11-
import { runJSONRequest, type RequestDependencies } from "./request";
10+
} from "./adapters.js";
11+
import { runJSONRequest, type RequestDependencies } from "./request.js";
1212

1313
export const RerankConfigSchema = type({
1414
/** Provider root, e.g. `http://localhost:8085` for a TEI server. */

0 commit comments

Comments
 (0)