Skip to content

build: prepare script + files allowlist so git installs get dist - #20

Merged
michaeloboyle merged 1 commit into
mainfrom
feature/prepare-script
Nov 3, 2026
Merged

michaeloboyle merged 1 commit into
mainfrom
feature/prepare-script

Conversation

@michaeloboyle

Copy link
Copy Markdown
Owner

Summary

Two package.json changes 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 runs prepare for git dependencies, so the install gets a built dist. 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/dist by absolute path and lagged main for ten weeks unnoticed. Part of the PKM decision "consumers bind to commits, not paths" (ADR-0153, in progress).

Evidence

Check Result
Red: npm install github:michaeloboyle/sqlite-graph#942835e into a scratch project package has no dist/
Green: same with #97bc982 dist/ present; require('sqlite-graph') loads; createNode/createEdge/traverse run
Lockfile resolved: git+ssh://...sqlite-graph.git#97bc9828... (exact commit recorded)
files installed tree is CHANGELOG.md dist LICENSE package.json README.md

Verification: inline self-check by the authoring session (config-only change), not an independent agent. Nothing under src/ or tests/ changed; CI's three test jobs are the gate.

Revert: git revert the squash commit.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UkPPxXPqpZDv12PSugDzm7

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
Copilot AI balanced review requested due to automatic review settings November 3, 2026 16:13
@michaeloboyle
michaeloboyle merged commit e12dc62 into main Nov 3, 2026
5 checks passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 prepare script to run the build for Git-based installs so dist/ is present.
  • Add a files allowlist to include only dist/ 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

Comment thread package.json
},
"scripts": {
"build": "tsc",
"prepare": "npm run build",
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.

2 participants