Pin @comapeo/core types to the backend version and verify the type surface#205
Pin @comapeo/core types to the backend version and verify the type surface#205gmaclennan wants to merge 2 commits into
Conversation
…rface Closes the gap where the published types resolved against a floating @comapeo/core (via npm's auto-installed peer of @comapeo/ipc) while the backend bundle embedded a different version — the root lockfile had core 7.2.0 against the backend's 7.3.0. - Declare @comapeo/core as an exact-pinned, types-only dependency so the published d.ts always resolves, and against the exact core the backend runs. scripts/check-core-types-pin.mjs (in `prepare`) fails install/CI if the root and backend pins ever diverge. - Add src/rpc-boundary.types.ts: an OverIpc transform re-typing resolved RPC values as what actually survives the JSON round-trip over the message port (type-fest Jsonify), preserving structure, parameters, emitter methods, and generic Exact<> signatures. This is the single divergence point for #1 (Date revival). `comapeo` and `comapeoServicesClient` now export the boundary-corrected types. - Add compile-only type-surface tests (test-d/, `npm run test:types`) pinning key API shapes against the pinned core, so a core bump that changes the published surface fails CI for review instead of shipping silently. - Add `npm run check:package`: publint + attw against a packed tarball (types-relevant staging), gating exports/types resolution for the typed entrypoints under bundler and node16-ESM resolution. - Wire both checks into lint.yml; document the layers and the core bump procedure in CONTRIBUTING.md and docs/TESTING.md. Fixes #99 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVFsPZBJJHnSg3DajK3ydQ
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
…heck deadlock check-core-types-pin requires @comapeo/core to move in package.json and backend/package.json together, so any automation that bumps it in only one directory produces a PR that can never go green. The existing minor-and-patch group already spans both directories (single "across 2 directories" PRs), but updates outside that group — prerelease graduations (see #185) and security updates — arrive as per-directory PRs, which would deadlock: two red PRs, each missing the other's half. Add a first-party-sync group (group-by: dependency-name) and a security-update twin so every @comapeo/* update spans both directories in one PR, ordered before the catch-all group since a dependency joins the first group it matches. Document the automation paths and the manual escape hatch (dispatch bump-first-party-deps) in CONTRIBUTING, and record why no prerelease ignore rules are needed: Dependabot never bumps a stable pin to a prerelease, and prerelease-pinned deps getting graduation PRs is wanted behavior. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NVFsPZBJJHnSg3DajK3ydQ
c509bd3 to
e45a7f2
Compare
Closes the gap where the published types resolved against a floating
@comapeo/core (via npm's auto-installed peer of @comapeo/ipc) while the
backend bundle embedded a different version — the root lockfile had core
7.2.0 against the backend's 7.3.0.
published d.ts always resolves, and against the exact core the backend
runs. scripts/check-core-types-pin.mjs (in
prepare) fails install/CIif the root and backend pins ever diverge.
RPC values as what actually survives the JSON round-trip over the
message port (type-fest Jsonify), preserving structure, parameters,
emitter methods, and generic Exact<> signatures. This is the single
divergence point for Convert date timestamps to Date objects over RPC #1 (Date revival).
comapeoandcomapeoServicesClientnow export the boundary-corrected types.npm run test:types)pinning key API shapes against the pinned core, so a core bump that
changes the published surface fails CI for review instead of shipping
silently.
npm run check:package: publint + attw against a packed tarball(types-relevant staging), gating exports/types resolution for the
typed entrypoints under bundler and node16-ESM resolution.
procedure in CONTRIBUTING.md and docs/TESTING.md.
Fixes #99
Co-Authored-By: Claude Fable 5 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01NVFsPZBJJHnSg3DajK3ydQ