Skip to content

Commit 5db11e2

Browse files
build: use node to detect package.json#pnpm in update-js (#332)
* replace indentation-anchored grep guard with a JSON.parse-based check * guard now holds regardless of package.json formatting or nested engines.pnpm
1 parent f109b3f commit 5db11e2

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -892,7 +892,7 @@ update-js: node-check | node_modules ## update js dependencies
892892
@# nolyfill writes package.json#pnpm.overrides, which REPLACES (not merges with)
893893
@# the overrides in pnpm-workspace.yaml, silently dropping any entry nolyfill
894894
@# does not manage, such as the cosmiconfig pin.
895-
@if grep -qE '^ "pnpm"[[:space:]]*:' package.json; then \
895+
@if node -e 'process.exit(JSON.parse(require("node:fs").readFileSync("package.json", "utf8")).pnpm === undefined ? 1 : 0)'; then \
896896
echo "nolyfill re-created package.json#pnpm.overrides."; \
897897
echo "That field REPLACES the overrides in pnpm-workspace.yaml rather than merging with"; \
898898
echo "them, so every override pnpm-workspace.yaml holds that nolyfill does not manage"; \

0 commit comments

Comments
 (0)