@brrock/oj

中文文档
0.2.52发布于 2026/10/29MITCommonJS构建来源已验证近 30 天下载 2889

Prebuilt Linux binaries of oj (lovablelabs/oj), e.g. for running oj on Vercel

原始使用文档
文档目录3 节
  1. Use on Vercel
  2. How releases work
  3. One-time setup

@brrock/oj

Prebuilt Linux binaries of oj (lovablelabs' Rust frontend tooling), packaged for npm so it can run where you can't cargo install, like Vercel builds.

Upstream oj only ships to crates.io. This repo builds it from source for each oj release and publishes:

packagecontents
@brrock/ojthe oj command (a small Node launcher)
@brrock/oj-linux-x64-gnuoj for Linux x64, glibc ≥ 2.34
@brrock/oj-linux-arm64-gnuoj for Linux arm64, glibc ≥ 2.34

npm installs only the platform package that matches the machine. Binaries are built inside amazonlinux:2023, which is Vercel's build image.

Use on Vercel

npm i -D @brrock/oj
{
  "scripts": {
    "build": "oj build"
  }
}

Set the Vercel project's output directory to dist. Versions match upstream oj versions.

Only Linux is supported. On macOS/Windows install oj with cargo install oj --locked; you can point the launcher at any binary with OJ_BINARY_PATH=/path/to/oj.

@brrock/oj depends on [email protected] and sets OJ_VENDORED_ROLLDOWN to it, the same rolldown the upstream nix build vendors for oj's TanStack Start bundles. Set OJ_VENDORED_ROLLDOWN= (empty) to use the app's own rolldown instead.

How releases work

.github/workflows/release.yml runs every 6 hours. When the latest lovablelabs/oj release isn't on npm yet, it:

  1. builds oj for x64 and arm64 in amazonlinux:2023 (fat-LTO release build, so expect 1–2 hours),
  2. publishes the platform packages, then @brrock/oj, through npm trusted publishing (OIDC). Provenance is attached automatically and no npm token is stored.

To build a specific version by hand: make release VERSION=0.2.16.

One-time setup

You need npm ≥ 11.10 (for npm trust) and 2FA enabled on your npm account.

make login     # npm login
make setup     # publishes empty 0.0.0 placeholders, then trusts release.yml for each package
make release   # build + publish the latest oj
make watch     # follow the run

Trusted publishing can only be configured on packages that already exist, which is why setup publishes placeholders first. Optionally run make lockdown afterwards to block token-based publishes.

版本与发布记录

@brrock/oj 共发布 28 个版本,首次发布于 2026/10/08;过去 12 个月发布了 28 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.52latest2026/10/2910 天前
0.2.502026/10/2910 天前
0.2.492026/10/2811 天前
0.2.482026/10/2811 天前
0.2.472026/10/2712 天前
0.2.462026/10/2514 天前

关于 @brrock/oj 的常见问题

@brrock/oj 是什么?

Prebuilt Linux binaries of oj (lovablelabs/oj), e.g. for running oj on Vercel

如何安装 @brrock/oj?

在项目目录运行 npm install @brrock/oj,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 oj,可以用 npx oj 直接运行。

@brrock/oj 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/brrock__oj 是否存在。

@brrock/oj 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@brrock/oj 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=18。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@brrock/oj 可以商用吗?

@brrock/oj 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@brrock/oj 的下载量有多少?

根据 npm 官方下载统计,@brrock/oj 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,889 次,日均约 96 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@brrock/oj 还在维护吗?

最新版本 0.2.52 发布于 2026/10/29(10 天前);至今共发布 28 个版本,其中过去 12 个月发布了 28 个;首次发布于 2026/10/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。