Skip to content

fix(pkg): include scripts/ in tarball so postinstall finds ensure-tree-sitter.mjs#214

Merged
kaghni merged 2 commits into
mainfrom
fix/postinstall-scripts-in-files
May 27, 2026
Merged

fix(pkg): include scripts/ in tarball so postinstall finds ensure-tree-sitter.mjs#214
kaghni merged 2 commits into
mainfrom
fix/postinstall-scripts-in-files

Conversation

@kaghni
Copy link
Copy Markdown
Collaborator

@kaghni kaghni commented May 27, 2026

Summary

  • npm install @deeplake/hivemind@0.7.60 fails on every platform with Error: Cannot find module '.../scripts/ensure-tree-sitter.mjs' because PR fix(deps): build tree-sitter from source on linux-arm64 / Node ≥22 #206 added a postinstall hook referencing scripts/ensure-tree-sitter.mjs but did not add "scripts" to the files array in package.json. The tarball is built without the entire scripts/ directory.
  • One-line fix: add "scripts" to the files array. Bumps 0.7.60 → 0.7.61; sync-versions cascades to the per-agent metadata.
  • This is independent of the Node-version pin in release.yaml — that pin (PR ci(release): pin release + publish jobs to Node 22 #207) was the right call for the CI build, but it cannot affect what's inside the published tarball. Only files controls that.

Verification

  • npm pack on Node 22 produces deeplake-hivemind-0.7.61.tgz (64 files, +6 vs 0.7.60), and tar tzf confirms package/scripts/ensure-tree-sitter.mjs is present.
  • npm i -g <tarball> on Node 24.12 completes without the missing-module crash.

Test plan

  • CI release pipeline (Node 22) produces a tarball that contains package/scripts/ensure-tree-sitter.mjs
  • After publish, npm i -g @deeplake/hivemind@0.7.61 succeeds on Node 24 linux-x64
  • Postinstall heal output is non-fatal where rebuild can't recover

Summary by CodeRabbit

  • Chores
    • Version bumped to 0.7.61 across all project components
    • Updated package distribution configuration to include additional resources in published releases

Review Change Stack

…nd ensure-tree-sitter.mjs

PR #206 added a `postinstall: node scripts/ensure-tree-sitter.mjs` hook
but did not add `scripts` to the `files` array in package.json. The
published 0.7.60 tarball therefore omits the entire `scripts/` directory,
and every `npm install @deeplake/hivemind` fails with:

  Error: Cannot find module '.../@deeplake/hivemind/scripts/ensure-tree-sitter.mjs'

This bug is independent of the build host's Node version — the `files`
array is what controls tarball composition, not the build environment.

Fix: add `"scripts"` to the `files` array so the postinstall heal script
ships with the package. The heal itself already exits 0 on platforms
where the rebuild can't recover, so end-user installs stay non-fatal.

Bumps version to 0.7.61; sync-versions cascaded to the per-agent
metadata files.

Verified:
- `npm pack` produces a tarball that contains package/scripts/ensure-tree-sitter.mjs
- Local global install of the resulting tarball under Node 24.12 completes without the missing-module error

Confidence: 95%, because the tarball composition is mechanically verified and the postinstall script is exit-0 by design.
Untested: end-to-end behavior when the tree-sitter compile fails on a host with no toolchain (heal warns + exits 0 by design, but not observed end-to-end here).
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 27, 2026

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 2444c045-d782-4f55-b185-55e06cfabb45

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Root @deeplake/hivemind package version incremented from 0.7.60 to 0.7.61 across all manifests and package files in the monorepo. Root package.json also adds scripts directory to the distribution files whitelist.

Changes

Version 0.7.61 Release

Layer / File(s) Summary
Root package version and distribution files
package.json
Root @deeplake/hivemind version bumped to 0.7.61 and scripts directory added to files whitelist for npm publication.
Plugin manifests and marketplace version
.claude-plugin/plugin.json, .claude-plugin/marketplace.json
Plugin manifest version and marketplace metadata for hivemind plugin updated to 0.7.61.
Subpackage and plugin versions
codex/package.json, openclaw/package.json, openclaw/openclaw.plugin.json, claude-code/.claude-plugin/plugin.json
Version bumped to 0.7.61 across codex, openclaw, and claude-code packages and plugin manifests to align with root release.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Suggested reviewers

  • efenocchi

Poem

🐰 Version bumps cascade like carrots down the row,
From root to plugin-land, where APIs grow,
With scripts now packaged, distribution takes flight,
0.7.61 shines, released tonight!
thump thump 🥕

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main fix: adding the scripts directory to the tarball files so the postinstall hook can find the required ensure-tree-sitter.mjs file.
Description check ✅ Passed The description includes a comprehensive summary explaining the bug and fix, version bump rationale (0.7.60 → 0.7.61 for a patch fix), verification steps, and a detailed test plan matching the template requirements.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/postinstall-scripts-in-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@coderabbitai coderabbitai Bot requested a review from efenocchi May 27, 2026 19:39
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 27, 2026

Coverage Report

No src/*.ts files changed in this PR.

Generated for commit be5e755.

The previous commit manually bumped 0.7.60 → 0.7.61 and cascaded the
version through sync-versions. That's redundant: release.yaml runs
`npm version patch --no-git-tag-version` + `npm run build` (which calls
prebuild → sync-versions) on every push to main that isn't already a
release commit. The workflow would have produced the same version
metadata itself.

With the manual bump in, the workflow would have bumped 0.7.61 → 0.7.62
and skipped the 0.7.61 number entirely. Dropping the bump lets the
workflow publish a clean 0.7.61.
@kaghni kaghni merged commit a5e7e90 into main May 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant