Skip to content

Serve the packument time field (fix ERR_PNPM_MISSING_TIME)#17

Merged
fengmk2 merged 3 commits into
mainfrom
fix-packument-time
Jun 29, 2026
Merged

Serve the packument time field (fix ERR_PNPM_MISSING_TIME)#17
fengmk2 merged 3 commits into
mainfrom
fix-packument-time

Conversation

@fengmk2

@fengmk2 fengmk2 commented Jun 29, 2026

Copy link
Copy Markdown
Member

The bridge fetched only the abbreviated npm packument (which omits the per-version time map) and never added time for injected preview versions, so pnpm's minimum-release-age resolution failed with ERR_PNPM_MISSING_TIME.

Source time from npm's full packument via a separate, parallel, fail-soft fetch (the served response keeps the compact abbreviated version docs), and add an entry for each injected preview version (incl. the synthesized not-on-npm case). Reproducing test written first; 55 tests pass.

fengmk2 added 3 commits June 29, 2026 18:50
The bridge fetched only the abbreviated npm packument, which omits the
per-version time map, and never added time for injected preview versions. pnpm's
minimum-release-age resolution then hard-failed with ERR_PNPM_MISSING_TIME.

Source the time map from npm's full packument via a separate, parallel,
fail-soft fetch (the served response keeps the compact abbreviated version
docs), seed packument.time from it, and add an entry for each injected preview
version. Handles the synthesized (not-on-npm) case too.
A preview version's time (release date) was derived from npm's package-level
modified time or a per-request new Date(), so it shifted per request. Stamp it
once server-side in POST /-/publish (and the on-demand build) into the stored
meta, serve that as the version's time, and fall back to a fixed past date for a
ref registered but not yet published. Any client-reported time is ignored.
@fengmk2 fengmk2 force-pushed the fix-packument-time branch from c3dfb42 to 9b14b22 Compare June 29, 2026 10:50
@fengmk2 fengmk2 merged commit 3cac054 into main Jun 29, 2026
3 checks passed
@fengmk2 fengmk2 deleted the fix-packument-time branch June 29, 2026 10:51
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.

1 participant