[PR #1133] [CLOSED] fix(update): accept npm 12 release metadata #2671

Closed
opened 2026-10-17 21:08:53 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/1133
Author: @penielgold-hub
Created: 10/8/2026
Status: ❌ Closed

Base: main ← Head: fix/1123-npm12-version-lookup


📝 Commits (1)

  • aa400d1 fix(update): accept npm 12 release metadata

📊 Changes

2 files changed (+85 additions, -1 deletions)

View changed files

📝 src/application/UpdateRuntime.ts (+6 -1)
➕ tests/process-global/updateRuntimeVersion.test.ts (+79 -0)

📄 Description

Summary

Fixes #1123.

The update command previously expected npm view ... --json to return a nonempty JSON string. npm 12 can return a single-element JSON array instead, causing a successful registry lookup to be rejected as invalid release metadata.

Changes

  • Accept both scalar JSON strings (npm 11) and single-element JSON string arrays (npm 12).
  • Normalize both response formats to a single version string.
  • Continue rejecting empty arrays, multiple values, invalid types, and malformed JSON.
  • Preserve the existing npm command arguments, installation prefix, and error handling.
  • Add focused regression tests for both npm response formats and invalid metadata.

Validation

  • npm run test:focused -- tests/process-global/updateRuntimeVersion.test.ts — 9 passed.
  • npm run check:fast — passed.
  • git diff --check — passed.
  • Git commit hooks — passed.

The tests mock subprocess responses and do not require installing npm 12 or accessing the registry.

Scope

This change addresses release metadata parsing only. It does not alter npm installation or update behavior.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/1133 **Author:** [@penielgold-hub](https://github.com/penielgold-hub) **Created:** 10/8/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/1123-npm12-version-lookup` --- ### 📝 Commits (1) - [`aa400d1`](https://github.com/morluto/rea/commit/aa400d18c95e36029c5c654c396ec66924e1358f) fix(update): accept npm 12 release metadata ### 📊 Changes **2 files changed** (+85 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `src/application/UpdateRuntime.ts` (+6 -1) ➕ `tests/process-global/updateRuntimeVersion.test.ts` (+79 -0) </details> ### 📄 Description ## Summary Fixes #1123. The update command previously expected `npm view ... --json` to return a nonempty JSON string. npm 12 can return a single-element JSON array instead, causing a successful registry lookup to be rejected as invalid release metadata. ## Changes - Accept both scalar JSON strings (npm 11) and single-element JSON string arrays (npm 12). - Normalize both response formats to a single version string. - Continue rejecting empty arrays, multiple values, invalid types, and malformed JSON. - Preserve the existing npm command arguments, installation prefix, and error handling. - Add focused regression tests for both npm response formats and invalid metadata. ## Validation - `npm run test:focused -- tests/process-global/updateRuntimeVersion.test.ts` — 9 passed. - `npm run check:fast` — passed. - `git diff --check` — passed. - Git commit hooks — passed. The tests mock subprocess responses and do not require installing npm 12 or accessing the registry. ## Scope This change addresses release metadata parsing only. It does not alter npm installation or update behavior. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-17 21:08:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#2671
No description provided.