Bump inter-package peerDeps to ^0.8.0 + fix release.yml sync bug
Two bugs in one fix: 1. The 0.8.0 release commit only bumped .version, not the inter-package peerDependencies / devDependencies. So the published packages still declared peer constraints like "@pascal-app/viewer": "^0.7.0". Caret in semver 0.x doesn't allow 0.8.0 to satisfy ^0.7.0, so bun resolves workspace consumers (and apps/editor's deep import paths) to the stale npm-published 0.7.0 instead of the workspace 0.8.0 — meaning local edits never show up in apps/editor or any linked consumer. 2. The release.yml sync step was using $GITHUB_ENV to read back the new versions in the same step, which doesn't work — env-file writes only surface in subsequent steps. Switched to a bash associative array (NEW_VERSIONS) for in-step lookup, kept the $GITHUB_ENV write for the downstream publish/commit/tag steps. Also added a final "refs after sync" debug print so this is visible in the workflow log. After this lands and you bun install, packages/editor/node_modules/@pascal-app/viewer should symlink to the workspace packages/viewer/, not to .bun/@pascal-app+viewer@0.7.0. Future releases will sync peerDeps correctly on their own.
This commit is contained in:
@@ -67,12 +67,19 @@ jobs:
|
|||||||
echo "$MAJ.$MIN.$PAT"
|
echo "$MAJ.$MIN.$PAT"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Track new versions in shell-local vars.
|
||||||
|
# NOTE: $GITHUB_ENV writes don't surface within the same step, so the
|
||||||
|
# peerDeps sync below must use shell vars, not env indirection.
|
||||||
|
declare -A NEW_VERSIONS
|
||||||
|
|
||||||
for pkg in core viewer editor mcp; do
|
for pkg in core viewer editor mcp; do
|
||||||
if [ "$TARGET" = "$pkg" ] || [ "$TARGET" = "all" ]; then
|
if [ "$TARGET" = "$pkg" ] || [ "$TARGET" = "all" ]; then
|
||||||
CUR=$(jq -r '.version' packages/$pkg/package.json)
|
CUR=$(jq -r '.version' packages/$pkg/package.json)
|
||||||
NEW=$(bump_version "$CUR")
|
NEW=$(bump_version "$CUR")
|
||||||
jq --arg v "$NEW" '.version = $v' packages/$pkg/package.json > tmp.json && mv tmp.json packages/$pkg/package.json
|
jq --arg v "$NEW" '.version = $v' packages/$pkg/package.json > tmp.json && mv tmp.json packages/$pkg/package.json
|
||||||
|
NEW_VERSIONS[$pkg]=$NEW
|
||||||
UPPER=$(echo "$pkg" | tr '[:lower:]' '[:upper:]')
|
UPPER=$(echo "$pkg" | tr '[:lower:]' '[:upper:]')
|
||||||
|
# Also export for the publish/commit/tag steps that follow.
|
||||||
echo "${UPPER}_VERSION=$NEW" >> $GITHUB_ENV
|
echo "${UPPER}_VERSION=$NEW" >> $GITHUB_ENV
|
||||||
echo "Bumped @pascal-app/$pkg: $CUR → $NEW"
|
echo "Bumped @pascal-app/$pkg: $CUR → $NEW"
|
||||||
fi
|
fi
|
||||||
@@ -83,9 +90,7 @@ jobs:
|
|||||||
for pkg in core viewer editor mcp; do
|
for pkg in core viewer editor mcp; do
|
||||||
FILE=packages/$pkg/package.json
|
FILE=packages/$pkg/package.json
|
||||||
for dep in core viewer editor mcp; do
|
for dep in core viewer editor mcp; do
|
||||||
UPPER=$(echo "$dep" | tr '[:lower:]' '[:upper:]')
|
VAL="${NEW_VERSIONS[$dep]}"
|
||||||
VAR="${UPPER}_VERSION"
|
|
||||||
VAL="${!VAR}"
|
|
||||||
[ -z "$VAL" ] && continue
|
[ -z "$VAL" ] && continue
|
||||||
jq --arg name "@pascal-app/$dep" --arg v "^$VAL" '
|
jq --arg name "@pascal-app/$dep" --arg v "^$VAL" '
|
||||||
if .peerDependencies[$name] then .peerDependencies[$name] = $v else . end
|
if .peerDependencies[$name] then .peerDependencies[$name] = $v else . end
|
||||||
@@ -94,6 +99,12 @@ jobs:
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
echo "=== @pascal-app/* refs after sync ==="
|
||||||
|
for pkg in core viewer editor mcp; do
|
||||||
|
echo "--- packages/$pkg/package.json ---"
|
||||||
|
jq '{ peerDependencies: (.peerDependencies // {} | with_entries(select(.key | startswith("@pascal-app/")))), devDependencies: (.devDependencies // {} | with_entries(select(.key | startswith("@pascal-app/")))) }' packages/$pkg/package.json
|
||||||
|
done
|
||||||
|
|
||||||
- name: Build & publish core
|
- name: Build & publish core
|
||||||
if: inputs.package == 'core' || inputs.package == 'all'
|
if: inputs.package == 'core' || inputs.package == 'all'
|
||||||
working-directory: packages/core
|
working-directory: packages/core
|
||||||
|
|||||||
@@ -11,8 +11,8 @@
|
|||||||
"check-types": "tsc --noEmit"
|
"check-types": "tsc --noEmit"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@pascal-app/core": "^0.7.0",
|
"@pascal-app/core": "^0.8.0",
|
||||||
"@pascal-app/viewer": "^0.7.0",
|
"@pascal-app/viewer": "^0.8.0",
|
||||||
"@react-three/drei": "^10",
|
"@react-three/drei": "^10",
|
||||||
"@react-three/fiber": "^9",
|
"@react-three/fiber": "^9",
|
||||||
"next": ">=15",
|
"next": ">=15",
|
||||||
@@ -54,8 +54,8 @@
|
|||||||
"three-mesh-bvh": "~0.9.8"
|
"three-mesh-bvh": "~0.9.8"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@pascal-app/core": "^0.7.0",
|
"@pascal-app/core": "^0.8.0",
|
||||||
"@pascal-app/viewer": "^0.7.0",
|
"@pascal-app/viewer": "^0.8.0",
|
||||||
"@pascal/typescript-config": "*",
|
"@pascal/typescript-config": "*",
|
||||||
"@types/bun": "^1.3.0",
|
"@types/bun": "^1.3.0",
|
||||||
"@types/howler": "^2.2.12",
|
"@types/howler": "^2.2.12",
|
||||||
|
|||||||
@@ -54,14 +54,14 @@
|
|||||||
"prepublishOnly": "bun run build && bun test"
|
"prepublishOnly": "bun run build && bun test"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@pascal-app/core": "^0.7.0"
|
"@pascal-app/core": "^0.8.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@modelcontextprotocol/sdk": "^1.29.0",
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
||||||
"zod": "^4.3.5"
|
"zod": "^4.3.5"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@pascal-app/core": "^0.7.0",
|
"@pascal-app/core": "^0.8.0",
|
||||||
"@pascal/typescript-config": "*",
|
"@pascal/typescript-config": "*",
|
||||||
"@types/node": "^25.5.0",
|
"@types/node": "^25.5.0",
|
||||||
"typescript": "5.9.3"
|
"typescript": "5.9.3"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
"prepublishOnly": "npm run build"
|
"prepublishOnly": "npm run build"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"@pascal-app/core": "^0.7.0",
|
"@pascal-app/core": "^0.8.0",
|
||||||
"@react-three/drei": "^10",
|
"@react-three/drei": "^10",
|
||||||
"@react-three/fiber": "^9",
|
"@react-three/fiber": "^9",
|
||||||
"react": "^18 || ^19",
|
"react": "^18 || ^19",
|
||||||
|
|||||||
Reference in New Issue
Block a user