Skip to content

[pull] latest from npm:latest#199

Merged
pull[bot] merged 4 commits into
DavidLacombe46:latestfrom
npm:latest
Jul 10, 2026
Merged

[pull] latest from npm:latest#199
pull[bot] merged 4 commits into
DavidLacombe46:latestfrom
npm:latest

Conversation

@pull

@pull pull Bot commented Jul 10, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

reggi and others added 4 commits July 10, 2026 11:44
npm 12.0.0 breaks downstream updaters by returning nested arrays for
`npm view <pkg> versions --json`.

## The bug

On npm 12.0.0, a single array-valued field is wrapped in the outer
results array:

```
$ npm view abbrev versions --json
[["1.0.3","1.0.4", ...]]   # should be ["1.0.3","1.0.4", ...]
```

This happens in `lib/commands/view.js` `#packageOutput`: for a
single-field query it maps to `res.map(m => m[first[0]])`, and when that
field's value is itself an array (e.g. `versions`), it gets
double-wrapped.

## The fix

Return a sole array-valued JSON result directly instead of adding a
second result wrapper. Existing output shapes are preserved:

- scalar and object results still return in an array (`["1.0.0"]`,
`[{...}]`)
- multiple matching versions keep the result boundary (`[[...],[...]]`)
- a single array-valued result is returned directly
(`["1.0.0","1.0.1"]`)

Docs and tests updated to cover flat array, nested array,
object-wrapper, workspace, and multi-match cases.

Co-authored-by: Martin Ruiz <martin.ruiz.mares@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…9746)

The `bin links adding and removing` test in
`workspaces/arborist/test/arborist/reify.js` reifies `rimraf@2.7.1`
without setting up a mock registry.

This adds `createRegistry(t, true)` so the test uses the mock registry
instead of depending on the real one.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
## Problem

The `build nodejs` jobs in `Release Integration / publish` fail at
`.github/workflows/node-integration.yml`:

```
node . pack --loglevel=silent --json | jq -r .[0].filename
→ jq: error (at <stdin>:9859): Cannot index object with number
→ Process completed with exit code 5
```

As of #9247 (sync json output of pack and publish), `npm pack --json` no
longer outputs an array. `logTar` now buffers `{ [tar.name]: tarball }`,
so the output is an object keyed by package name:

```json
{ "npm": { "filename": "npm-12.0.1.tgz", ... } }
```

The workflow still parsed it with `.[0].filename`, which errors on an
object. npm 12.0.x is the first release carrying this change, so the
release integration only started breaking now.

## Fix

Parse the filename from the object instead of an array index:

```diff
-npmtarball="$(node . pack --loglevel=silent --json | jq -r .[0].filename)"
+npmtarball="$(node . pack --loglevel=silent --json | jq -r 'to_entries[0].value.filename')"
```

Verified locally: returns `npm-12.0.1.tgz`.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@pull pull Bot locked and limited conversation to collaborators Jul 10, 2026
@pull pull Bot added the ⤵️ pull label Jul 10, 2026
@pull pull Bot merged commit 7b1f6c1 into DavidLacombe46:latest Jul 10, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant