From 4ddf2f949f2f9942bfaaebe34e24b865bf39f209 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Thu, 6 Nov 2025 04:49:59 -0800 Subject: [PATCH] use jq to preserve package.json structure --- .github/workflows/publish-packages.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-packages.yml b/.github/workflows/publish-packages.yml index 91125004d..f2e61a9f7 100644 --- a/.github/workflows/publish-packages.yml +++ b/.github/workflows/publish-packages.yml @@ -82,9 +82,9 @@ jobs: # Update version in package.json npm version $NEW_VERSION --no-git-tag-version - # Replace workspace:* with actual version for @jamiepine/assets + # Replace workspace:* with actual version for @jamiepine/assets (using jq to preserve structure) ASSETS_VERSION=$(node -p "require('../assets/package.json').version") - node -e "const fs=require('fs'); const pkg=JSON.parse(fs.readFileSync('package.json')); pkg.dependencies['@jamiepine/assets']='^$ASSETS_VERSION'; fs.writeFileSync('package.json', JSON.stringify(pkg, null, '\t'));" + jq --arg ver "^$ASSETS_VERSION" '.dependencies["@jamiepine/assets"] = $ver' package.json > package.json.tmp && mv package.json.tmp package.json # Build pnpm build