This monorepo publishes 13 packages in lockstep:
@vscode/ripgrep— the JS wrapper (in packages/ripgrep/)@vscode/ripgrep-<os>-<cpu>— 12 per-platform binary packages (in packages/)
All packages share the same version, taken from the root package.json.
Use this when you only want to ship a new wrapper revision (e.g. README fix, code change in packages/ripgrep/lib/index.js).
- Edit
versionin the root package.json, e.g.1.18.0→1.18.1. - Run:
This rewrites all 13
npm run sync-packages
package.jsonfiles (wrapper + 12 platforms) to the new version and refreshes the wrapper'soptionalDependencies. - Commit the changes — every
packages/*/package.jsonand the rootpackage.jsonshould be in the diff. - Push and run the publish pipeline (build/pipeline.yml) with
publishPackage: true. All 13 packages publish at the same version.
Use this when upgrading to a new upstream ripgrep-prebuilt release.
- Edit build/platforms.js:
- Update
VERSION(and/orMULTI_ARCH_VERSIONif applicable). - If a platform should pin to a different upstream version, change its
versionfield directly.
- Update
- Bump
versionin the root package.json (semver-major or -minor as appropriate, since the binary changed). - Refresh the lockfile with the new SHA256 hashes:
This downloads every platform's archive, computes its SHA256, and writes binaries.lock.json. Requires network access to GitHub Releases. Set
npm run update-lock
GITHUB_TOKENto avoid rate limits. - Sync the package manifests:
npm run sync-packages
- Commit binaries.lock.json, build/platforms.js, the root package.json, and every regenerated
packages/*/package.json. - Run the publish pipeline.
- Add an entry to the
platformsarray in build/platforms.js. npm run update-lockto populate its SHA256.npm run sync-packagesto materializepackages/ripgrep-<os>-<cpu>/.- Add a matching entry to the
npmPackagesarray in build/pipeline.yml. Copy an existing platform block and substitute the package short name and--target <triple>. - Bump the root version and commit.
For each of the 13 entries in build/pipeline.yml:
- Wrapper (
ripgrep): runssync-packages.jsand publishes packages/ripgrep/. No binary download. - Platform (
ripgrep-<os>-<cpu>): runssync-packages.js, thenprepare-binaries.js --target <triple>to download and SHA-verify just that platform's binary, then publishes the package.
sync-packages.js is idempotent — running it in CI guarantees published manifests match the committed root version even if a developer forgot to run it locally.
# Make sure all manifests are in sync with the root version
npm run sync-packages
# Download the binary for your host platform (example: Windows x64)
node build/prepare-binaries.js --target x86_64-pc-windows-msvc
# Install the workspace and verify the wrapper resolves to the sibling package.
# --force is needed because optional platform deps fail npm's os/cpu check
# for non-host platforms in workspace mode (this is harmless).
npm install --force
node -e "import('@vscode/ripgrep').then(m => console.log(m.rgPath))"The printed path should be inside packages/ripgrep-<your-os>-<your-cpu>/bin/.