Skip to content

fix: strip pre-marker keys in writePackageJson - #30

Merged
jxom merged 1 commit into
mainfrom
fix/write-package-json-strip-pre-marker-keys
Feb 25, 2026
Merged

jxom merged 1 commit into
mainfrom
fix/write-package-json-strip-pre-marker-keys

Conversation

@jxom

@jxom jxom commented Feb 25, 2026

Copy link
Copy Markdown
Member

Problem

writePackageJson merges the raw cached package.json content back into the decorated output via:

return { ...JSON.parse(content), ...pkgJson }

Since packageJsonCache stores the raw file content (before stripping), this re-introduces all pre-marker keys (scripts, devDependencies, [!start-pkg], etc.) into the final written package.json, undoing the work of stripPreMarkerKeys.

Fix

Call stripPreMarkerKeys on the parsed cache before merging:

return { ...stripPreMarkerKeys(JSON.parse(content)), ...pkgJson }

@pkg-pr-new

pkg-pr-new Bot commented Feb 25, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/wevm/zile@30

commit: c9626fd

@jxom
jxom merged commit 0a54f64 into main Feb 25, 2026
5 checks passed
@github-actions github-actions Bot mentioned this pull request Feb 25, 2026
@tmm
tmm deleted the fix/write-package-json-strip-pre-marker-keys branch February 25, 2026 02:42
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.

1 participant