Skip to content

fix(cli): stop nf publish at the registry limits before reading or uploading everything - #369

Merged
Exeloo merged 7 commits into
mainfrom
fix/publish-v2-manifest
Nov 23, 2026
Merged

Exeloo merged 7 commits into
mainfrom
fix/publish-v2-manifest

Conversation

@Exeloo

@Exeloo Exeloo commented Nov 23, 2026

Copy link
Copy Markdown
Member

What does this PR do?

Closes #261
Refs #254 (closed: already fixed on main by #263)

  • packFolder (@nanoforge-dev/registry):
    • sums sizes while walking and stops past 256 MiB or 20,000 files;
    • with maxBytes, streams the zip one file at a time and stops once the archive passes the limit;
    • onFiles gets the file list before any file is read.
  • zipFolder keeps its signature and its bytes (sha256 checked).
  • nf publish prints the list first, then stops past 20 MiB packed with a hint, before any upload. It no longer unzips the archive a second time.

How do you test this PR?

  • Before:
    • packFolder tests fail;
    • a 257 MiB folder is read in full;
    • a 21 MiB archive gets uploaded;
    • on the limit, the list was hidden.
      After:
    • all pass;
    • nothing is sent;
    • the list is printed.
  • Commands run: repo:build, repo:test:unit (cli 346, registry 56), repo:lint and registry test:contract, all pass. The API's unzipSync and readArchive both read a streamed archive (tested).

Merge danger

Door: two-way. Library exports are only added.
Blast radius: small. None of the 7 editor packages call zipFolder or packFolder.

Quality gate

Check Result Notes
Docs Updated libs/registry/README.md, commands/registry.mdx (5d7257d, not re-reviewed)
Correctness Pass (2 rounds) M1, M2, M4 and N1 fixed; N2 → #342, N3 → #343
Performance Pass
Accessibility Pass
Security Pass the API checks archive entry paths
Style Pass lint: pass

Follow-up issues

@github-actions github-actions Bot added documentation Improvements or additions to documentation command:publish Related to publish command lib:registry Related to the @nanoforge-dev/registry library labels Nov 23, 2026
@Exeloo
Exeloo merged commit e8e13e7 into main Nov 23, 2026
8 of 9 checks passed
@Exeloo
Exeloo deleted the fix/publish-v2-manifest branch November 23, 2026 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:publish Related to publish command documentation Improvements or additions to documentation lib:registry Related to the @nanoforge-dev/registry library

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nf publish reads the whole package into memory and checks its size only on the server

1 participant