Skip to content

package.json rewrite reorders keys and reformats the whole file #5

Description

@ygpark80

oneup version on a package.json target rewrites the entire file — keys come back alphabetized and formatting normalized — instead of surgically updating only the version field.

Repro

mkdir repro && cd repro && git init -q
cat > package.json <<'EOF'
{
  "name": "app",
  "main": "expo-router/entry",
  "scripts": { "start": "expo start" },
  "dependencies": { "react": "19.2.3" },
  "private": true
}
EOF
npx @circlesac/oneup version --source git

Result: dependencies moves to the top, name/main/scripts move down, one-line objects get expanded — a full-file diff for a one-field change. Confusing during releases: the reordered file is easy to misread as field loss (name/main no longer at the top), and if a project ever committed the release-time write it would churn the whole file.

Expected

Match the documented gradle behavior ("surgically rewrites only the versionName string, preserving quote style and formatting"): insert/replace only the version member, leaving key order, indentation, and line breaks untouched.

Also

The Homebrew formula lags npm — the current brew binary doesn't know --source at all (error: unexpected argument '--source' found) while npm 26.7.0 supports it. Worth a tap bump alongside the fix.

🤖 Generated with Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions