Repository navigation
build: prepare script + files allowlist so git installs get dist - #20
Conversation
npm runs prepare for git dependencies, so a consumer pinning github:michaeloboyle/sqlite-graph#<sha> gets a built dist instead of an empty package. files limits the install to dist and docs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UkPPxXPqpZDv12PSugDzm7
There was a problem hiding this comment.
Note
Copilot was unable to complete this review at the selected tier due to model policy or plan restrictions.
🟡 Changes recommended
The change introduces a redundant build hook in package.json, causing build to run twice during publish workflows and creating avoidable time cost and potential inconsistency, so the script setup needs adjustment before approval.
1 open issue
What changed in this PR
This pull request updates the npm packaging/lifecycle configuration so consumers can install sqlite-graph directly from a pinned Git commit and still receive a usable built dist/ output (without relying on local checkout paths). Review note (nit): adding prepare to run npm run build may make the build run redundantly alongside prepublishOnly during publish/pack; consider consolidating build hooks to avoid duplicate work.
Changes:
- Add a
preparescript to run the build for Git-based installs sodist/is present. - Add a
filesallowlist to include onlydist/and core docs/licenses in the installed/packed artifact.
| File | Summary |
|---|---|
package.json |
Adds prepare build hook for Git installs and a files allowlist to ship dist/ plus README/LICENSE/CHANGELOG only. |
Review effort: Balanced
| }, | ||
| "scripts": { | ||
| "build": "tsc", | ||
| "prepare": "npm run build", |

Summary
Two
package.jsonchanges so a consumer can depend on sqlite-graph at a pinned commit (github:michaeloboyle/sqlite-graph#<sha>) instead of a checkout path:"prepare": "npm run build". npm runspreparefor git dependencies, so the install gets a builtdist.dist/is gitignored, so without this a git install has no code."files": ["dist", "README.md", "LICENSE", "CHANGELOG.md"]. The installed package carries the build output and docs only.First consumer: graph lab (michaeloboyle/bddgraph
lab/graph-lab), which today loads/Volumes/black box/github/sqlite-graph/distby absolute path and laggedmainfor ten weeks unnoticed. Part of the PKM decision "consumers bind to commits, not paths" (ADR-0153, in progress).Evidence
npm install github:michaeloboyle/sqlite-graph#942835einto a scratch projectdist/#97bc982dist/present;require('sqlite-graph')loads;createNode/createEdge/traverserunresolved: git+ssh://...sqlite-graph.git#97bc9828...(exact commit recorded)filesCHANGELOG.md dist LICENSE package.json README.mdVerification: inline self-check by the authoring session (config-only change), not an independent agent. Nothing under
src/ortests/changed; CI's three test jobs are the gate.Revert:
git revertthe squash commit.🤖 Generated with Claude Code
https://claude.ai/code/session_01UkPPxXPqpZDv12PSugDzm7