Skip to content

fix: update npm-packlist#10658

Merged
zkochan merged 4 commits into
mainfrom
update-npm-packlist
Feb 25, 2026
Merged

fix: update npm-packlist#10658
zkochan merged 4 commits into
mainfrom
update-npm-packlist

Conversation

@zkochan

@zkochan zkochan commented Feb 20, 2026

Copy link
Copy Markdown
Member

No description provided.

Copilot AI review requested due to automatic review settings February 20, 2026 13:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the repo to use a newer npm-packlist major version and adapts pnpm’s internal packlist wrapper and publishing flow to the updated API.

Changes:

  • Bump npm-packlist from 5.1.3 to 10.0.3 via the workspace catalog (and lockfile).
  • Update publishing pack logic to pass a manifest directly into packlist.
  • Rework @pnpm/fs.packlist to call the new npm-packlist API (tree input) and adjust local typings.

Reviewed changes

Copilot reviewed 3 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
releasing/plugin-commands-publishing/src/pack.ts Switches packlist() call site to pass a manifest using the new wrapper API.
pnpm-workspace.yaml Updates the catalog-pinned npm-packlist version to 10.0.3.
pnpm-lock.yaml Updates lockfile entries for the new npm-packlist version and new transitive deps.
fs/packlist/src/index.ts Implements the new npm-packlist v10 calling convention and manifest normalization.
typings/typed.d.ts Updates the custom module typing for npm-packlist to match the new call signature.
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread fs/packlist/src/index.ts Outdated
}

function stripDotSlash (p: string): string {
return p.startsWith('./') ? p.slice(2) : p

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stripDotSlash() only strips the POSIX-style prefix './', but the rest of this module already treats both ./ and .\\ as valid dot-slash prefixes (see the regex used when normalizing returned file paths). If main/browser/bin entries ever use Windows-style .\\, they won't be normalized and npm-packlist may miss those files. Consider stripping both separators (e.g. p.replace(/^\.[/\\]/, '') or an equivalent check for both prefixes).

Suggested change
return p.startsWith('./') ? p.slice(2) : p
return p.replace(/^\.[/\\]/, '')

Copilot uses AI. Check for mistakes.
Comment thread pnpm-lock.yaml
npm-packlist:
specifier: 'catalog:'
version: 5.1.3
version: 10.0.3

Copilot AI Feb 20, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pnpm-lock.yaml still contains a snapshot for @pnpm/fs.packlist@1000.0.0 that depends on npm-packlist: 5.1.3 (see snapshots section around pnpm-lock.yaml:18290+), which contradicts this importer entry resolving npm-packlist to 10.0.3. This looks like a partially-updated lockfile; re-generate the lockfile so the @pnpm/fs.packlist snapshot and the npm-packlist@5.1.3 entries are updated/removed consistently.

Suggested change
version: 10.0.3
version: 5.1.3

Copilot uses AI. Check for mistakes.
@zkochan zkochan mentioned this pull request Feb 20, 2026
@zkochan zkochan merged commit 84075f9 into main Feb 25, 2026
10 of 13 checks passed
@zkochan zkochan deleted the update-npm-packlist branch February 25, 2026 10:33
zkochan added a commit that referenced this pull request May 8, 2026
- Fixes [#11519](#11519): `pnpm pack` in pnpm 11 silently dropped every package listed in `bundleDependencies` / `bundledDependencies`, producing tarballs that no longer contained the bundled `node_modules/<dep>` files that v10 produced.
- Root cause: the npm-packlist v10 upgrade ([#10658](#10658)) changed its API to require the caller to pre-populate the dependency tree's `edgesOut` Map. The wrapper in `fs/packlist` passed an empty Map, so npm-packlist's `gatherBundles()` looked up each declared name, found nothing, and skipped them all.
- Fix: `fs/packlist` now reads each bundled dep's `package.json` (walking up parent `node_modules` to support hoisted layouts), recursively populates `edgesOut` for transitive deps of bundled packages, and normalizes `bundleDependencies: true` to an explicit array (npm-packlist iterates the field directly).
zkochan added a commit that referenced this pull request May 8, 2026
- Fixes [#11519](#11519): `pnpm pack` in pnpm 11 silently dropped every package listed in `bundleDependencies` / `bundledDependencies`, producing tarballs that no longer contained the bundled `node_modules/<dep>` files that v10 produced.
- Root cause: the npm-packlist v10 upgrade ([#10658](#10658)) changed its API to require the caller to pre-populate the dependency tree's `edgesOut` Map. The wrapper in `fs/packlist` passed an empty Map, so npm-packlist's `gatherBundles()` looked up each declared name, found nothing, and skipped them all.
- Fix: `fs/packlist` now reads each bundled dep's `package.json` (walking up parent `node_modules` to support hoisted layouts), recursively populates `edgesOut` for transitive deps of bundled packages, and normalizes `bundleDependencies: true` to an explicit array (npm-packlist iterates the field directly).
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