Skip to content

docs: add README for the npm example plugin (#15)#33

Merged
ben-laird merged 2 commits into
mainfrom
docs/issue-15-npm-plugin-readme
Jun 8, 2026
Merged

docs: add README for the npm example plugin (#15)#33
ben-laird merged 2 commits into
mainfrom
docs/issue-15-npm-plugin-readme

Conversation

@ben-laird

Copy link
Copy Markdown
Owner

Closes #15.

examples/plugins/npm/main.ts is already functionally complete: it implements the full op setinfo, discover, read-version, write-version, update-dependency, get-dependencies, release, finalize — targets package.json, and finalize runs npm install --package-lock-only so package-lock.json refreshes in the same commit (reported in additionalChangedFiles only when it differs from HEAD). The only gap vs the deno example was a missing README.

This PR adds examples/plugins/npm/README.md, modeled on examples/plugins/deno/README.md: wiring via the run: arm, per-op descriptions (including info, get-dependencies, and finalize, which the deno README predates), and npm-specific adaptation notes (Node rewrite, --package-lock-only, permissions).

Verification

$ dv plugin verify "run:deno run -A .../examples/plugins/npm/main.ts"
  ✓ info  contractVersion=1, 8 ops declared (npm 0.1.0)
  ✓ discover  0 packages returned for glob '*'
  · read-version / write-version / update-dependency / release / get-dependencies  (side-effectful or no-package skips)
  ✓ finalize  no-op run reported 0 additional files
  ✓ bad-input rejects
PASS  4 passed, 0 failed, 5 skipped

(The skipped ops are side-effectful — verify can't safely auto-run them — identical to the deno example's verify profile.)

🤖 Generated with Claude Code

ben-laird and others added 2 commits June 7, 2026 16:33
examples/plugins/npm/main.ts is already functionally complete — it
implements the full op set (info, discover, read-version, write-version,
update-dependency, get-dependencies, release, finalize), targets
package.json, and finalize runs `npm install --package-lock-only`.
`dv plugin verify run:deno run -A .../npm/main.ts` reports
4 passed, 0 failed, 5 skipped (the skips are side-effectful ops, matching
every other plugin). The only gap vs the deno example was a missing README.

Add one modeled on examples/plugins/deno/README.md: wiring via the run:
arm, per-op descriptions (incl. info / get-dependencies / finalize that
the deno README predates), and npm-specific adaptation notes.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@ben-laird ben-laird merged commit c429d6c into main Jun 8, 2026
1 check passed
@ben-laird ben-laird deleted the docs/issue-15-npm-plugin-readme branch June 8, 2026 01:41
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.

npm example plugin (examples/plugins/npm/main.ts)

1 participant