Skip to content

refactor: trim published package + clearer OTA API/docs (#18 feedback) - #21

Merged
huytdps13400 merged 1 commit into
mainfrom
enhance/trim-and-ota-docs
Jul 21, 2026
Merged

huytdps13400 merged 1 commit into
mainfrom
enhance/trim-and-ota-docs

Conversation

@huytdps13400

Copy link
Copy Markdown
Owner

Acts on the maintainer feedback in #18 ("most files are not needed, especially monorepo setup files" + "no proper docs on how to pair isExpired with updatePinsFromUrl").

1. Slimmer published package

  • files now uses an explicit allowlist of runtime scripts (cli, cli-utils, postinstall, postinstall-lib, bun-postinstall, nsc-utils). Dev/test/maintainer scripts moved to scripts/dev/ and are no longer published.
  • Tarball drops from 82 → 75 files (73.7 kB → 65.1 kB); internal scripts like rebuild-and-test.js, run-feature-tests.js, test-bun.js, deprecate-v1.sh and build.sh no longer ship.
  • New __tests__/pack-contents.test.js asserts the tarball ships only runtime scripts and never dev tooling / fixtures — guards against re-bloat.
  • Removed the monorepo-setup CLI command + monorepo-setup.js / monorepo-utils.js (13.6 kB) and the pnpm-monorepo fixture. Monorepo/pnpm support is unchanged — the actual fix lives in the postinstall safety logic; the README now documents a resolved-path Gradle snippet instead of a bespoke command.

2. Clearer OTA

  • New applySignedPinBundle(bundle, { publicKey }) — the verify-and-apply half of updatePinsFromUrl, for callers who fetch the signed bundle themselves (custom networking/caching, push-delivered bundles). updatePinsFromUrl now = fetch → applySignedPinBundle.
  • Rewrote the README OTA section: the signed-bundle JSON shape, an OtaError code table, the applySignedPinBundle / verifyOtaBundle+setSSLConfig lower-level paths (exactly the seam the reporter rebuilt by hand), and a callout clarifying isExpired/expirationDate (config fail-open) is unrelated to OTA bundle freshness (expiresAt/maxAgeMs) — the specific confusion in the issue.

Verification

  • 159 tests pass (including the new pack-contents guard), tsc --noEmit clean, eslint clean on changed sources.
  • No dependency changes and no nitrogen/ spec changes, so yarn install --immutable and yarn specs stay green.

Note: dropping the unused postinstall runtime dependency was intentionally deferred — it needs a yarn.lock regen that isn't possible in this environment.

🤖 Generated with Claude Code

https://claude.ai/code/session_01LdDmMzSuVbNXeQcUQNYzk9


Generated by Claude Code

Acts on maintainer feedback in #18.

Slimmer tarball:
- Ship only runtime scripts via an explicit files allowlist (cli, cli-utils,
  postinstall, postinstall-lib, bun-postinstall, nsc-utils). Dev/test/
  maintainer scripts moved to scripts/dev/ and no longer published.
- Add __tests__/pack-contents.test.js to guard against re-bloat.
- Remove the monorepo-setup CLI command + monorepo-setup.js/monorepo-utils.js
  and the pnpm-monorepo fixture. Monorepo/pnpm support is unchanged (it lives in
  the postinstall safety logic); README documents a resolved-path Gradle snippet.

Clearer OTA:
- Add applySignedPinBundle(bundle, options) — the verify-and-apply half of
  updatePinsFromUrl — for callers who fetch the bundle themselves.
- Rewrite the README OTA section: signed-bundle format, OtaError code table,
  the applySignedPinBundle / verifyOtaBundle+setSSLConfig lower-level paths, and
  a clarification that isExpired/expirationDate (config fail-open) is unrelated
  to OTA bundle freshness (expiresAt/maxAgeMs).

No dependency or nitro-spec changes. 159 tests pass; tsc + eslint clean.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LdDmMzSuVbNXeQcUQNYzk9
@huytdps13400
huytdps13400 merged commit 892fe69 into main Jul 21, 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.

2 participants