Reset core/viewer/editor/mcp packages and apps/editor from private-editor
Wholesale swap of packages/{core,viewer,editor,mcp} and apps/editor with the
versions from the private editor repo, which is the production source of truth.
Setup changes:
- packages/{core,viewer,editor} versions held at 0.7.0 baseline (matching
the most recent published release) so a bump=minor publishes 0.8.0
- packages/mcp held at 0.1.1 (never published; first publish will go through
the new release.yml flow)
- peerDependencies and devDependencies for inter-package @pascal-app/*
references pinned to ^0.7.0 instead of '*' / 'workspace:*' so they are
valid for npm consumers
- Root package.json: TypeScript bumped to 6.0.2, added overrides for
@types/react, @types/react-dom, @types/three to prevent JSX namespace
fragmentation across the workspace
- release.yml extended to also publish editor and mcp; 'both' option renamed
to 'all'; added a sync step that updates inter-package peerDeps/devDeps to
match the new versions on every bump (so viewer/editor/mcp tarballs always
reference the version of core they were built against)
- Root scripts gained release:editor and release:mcp shortcuts
Verification:
- bun install --frozen-lockfile is consistent
- packages/{core,viewer,mcp} build cleanly, dist/index.d.ts emitted
- packages/editor check-types reports 21 pre-existing errors, identical to
what private-editor currently reports
Open PRs against editor-v2 will need rebasing/conflict resolution.
This commit is contained in:
@@ -10,7 +10,9 @@ on:
|
||||
options:
|
||||
- core
|
||||
- viewer
|
||||
- both
|
||||
- editor
|
||||
- mcp
|
||||
- all
|
||||
bump:
|
||||
description: "Version bump"
|
||||
required: true
|
||||
@@ -51,56 +53,104 @@ jobs:
|
||||
git config user.name "github-actions[bot]"
|
||||
git config user.email "github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Bump & publish core
|
||||
if: inputs.package == 'core' || inputs.package == 'both'
|
||||
- name: Bump versions and sync inter-package references
|
||||
run: |
|
||||
BUMP=${{ inputs.bump }}
|
||||
TARGET=${{ inputs.package }}
|
||||
|
||||
bump_version() {
|
||||
local v=$1
|
||||
IFS='.' read -r MAJ MIN PAT <<< "$v"
|
||||
if [ "$BUMP" = "major" ]; then MAJ=$((MAJ+1)); MIN=0; PAT=0; fi
|
||||
if [ "$BUMP" = "minor" ]; then MIN=$((MIN+1)); PAT=0; fi
|
||||
if [ "$BUMP" = "patch" ]; then PAT=$((PAT+1)); fi
|
||||
echo "$MAJ.$MIN.$PAT"
|
||||
}
|
||||
|
||||
for pkg in core viewer editor mcp; do
|
||||
if [ "$TARGET" = "$pkg" ] || [ "$TARGET" = "all" ]; then
|
||||
CUR=$(jq -r '.version' packages/$pkg/package.json)
|
||||
NEW=$(bump_version "$CUR")
|
||||
jq --arg v "$NEW" '.version = $v' packages/$pkg/package.json > tmp.json && mv tmp.json packages/$pkg/package.json
|
||||
UPPER=$(echo "$pkg" | tr '[:lower:]' '[:upper:]')
|
||||
echo "${UPPER}_VERSION=$NEW" >> $GITHUB_ENV
|
||||
echo "Bumped @pascal-app/$pkg: $CUR → $NEW"
|
||||
fi
|
||||
done
|
||||
|
||||
# Sync inter-package references in peerDependencies and devDependencies.
|
||||
# Anything that references a bumped @pascal-app/* package is updated to ^NEW.
|
||||
for pkg in core viewer editor mcp; do
|
||||
FILE=packages/$pkg/package.json
|
||||
for dep in core viewer editor mcp; do
|
||||
UPPER=$(echo "$dep" | tr '[:lower:]' '[:upper:]')
|
||||
VAR="${UPPER}_VERSION"
|
||||
VAL="${!VAR}"
|
||||
[ -z "$VAL" ] && continue
|
||||
jq --arg name "@pascal-app/$dep" --arg v "^$VAL" '
|
||||
if .peerDependencies[$name] then .peerDependencies[$name] = $v else . end
|
||||
| if .devDependencies[$name] then .devDependencies[$name] = $v else . end
|
||||
' "$FILE" > tmp.json && mv tmp.json "$FILE"
|
||||
done
|
||||
done
|
||||
|
||||
- name: Build & publish core
|
||||
if: inputs.package == 'core' || inputs.package == 'all'
|
||||
working-directory: packages/core
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
BUMP=${{ inputs.bump }}
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
IFS='.' read -r MAJ MIN PAT <<< "$VERSION"
|
||||
if [ "$BUMP" = "major" ]; then MAJ=$((MAJ+1)); MIN=0; PAT=0; fi
|
||||
if [ "$BUMP" = "minor" ]; then MIN=$((MIN+1)); PAT=0; fi
|
||||
if [ "$BUMP" = "patch" ]; then PAT=$((PAT+1)); fi
|
||||
VERSION="$MAJ.$MIN.$PAT"
|
||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||
echo "CORE_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
bun run build
|
||||
|
||||
if [ "${{ inputs.dry-run }}" = "true" ]; then
|
||||
echo "🏜️ Dry run — would publish @pascal-app/core@$VERSION"
|
||||
echo "🏜️ Dry run — would publish @pascal-app/core@$CORE_VERSION"
|
||||
npm publish --dry-run --access public
|
||||
else
|
||||
npm publish --access public
|
||||
echo "📦 Published @pascal-app/core@$VERSION"
|
||||
echo "📦 Published @pascal-app/core@$CORE_VERSION"
|
||||
fi
|
||||
|
||||
- name: Bump & publish viewer
|
||||
if: inputs.package == 'viewer' || inputs.package == 'both'
|
||||
- name: Build & publish viewer
|
||||
if: inputs.package == 'viewer' || inputs.package == 'all'
|
||||
working-directory: packages/viewer
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
BUMP=${{ inputs.bump }}
|
||||
VERSION=$(jq -r '.version' package.json)
|
||||
IFS='.' read -r MAJ MIN PAT <<< "$VERSION"
|
||||
if [ "$BUMP" = "major" ]; then MAJ=$((MAJ+1)); MIN=0; PAT=0; fi
|
||||
if [ "$BUMP" = "minor" ]; then MIN=$((MIN+1)); PAT=0; fi
|
||||
if [ "$BUMP" = "patch" ]; then PAT=$((PAT+1)); fi
|
||||
VERSION="$MAJ.$MIN.$PAT"
|
||||
jq --arg v "$VERSION" '.version = $v' package.json > tmp.json && mv tmp.json package.json
|
||||
echo "VIEWER_VERSION=$VERSION" >> $GITHUB_ENV
|
||||
|
||||
bun run build
|
||||
|
||||
if [ "${{ inputs.dry-run }}" = "true" ]; then
|
||||
echo "🏜️ Dry run — would publish @pascal-app/viewer@$VERSION"
|
||||
echo "🏜️ Dry run — would publish @pascal-app/viewer@$VIEWER_VERSION"
|
||||
npm publish --dry-run --access public
|
||||
else
|
||||
npm publish --access public
|
||||
echo "📦 Published @pascal-app/viewer@$VERSION"
|
||||
echo "📦 Published @pascal-app/viewer@$VIEWER_VERSION"
|
||||
fi
|
||||
|
||||
- name: Publish editor
|
||||
if: inputs.package == 'editor' || inputs.package == 'all'
|
||||
working-directory: packages/editor
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
if [ "${{ inputs.dry-run }}" = "true" ]; then
|
||||
echo "🏜️ Dry run — would publish @pascal-app/editor@$EDITOR_VERSION"
|
||||
npm publish --dry-run --access public
|
||||
else
|
||||
npm publish --access public
|
||||
echo "📦 Published @pascal-app/editor@$EDITOR_VERSION"
|
||||
fi
|
||||
|
||||
- name: Build & publish mcp
|
||||
if: inputs.package == 'mcp' || inputs.package == 'all'
|
||||
working-directory: packages/mcp
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
run: |
|
||||
bun run build
|
||||
if [ "${{ inputs.dry-run }}" = "true" ]; then
|
||||
echo "🏜️ Dry run — would publish @pascal-app/mcp@$MCP_VERSION"
|
||||
npm publish --dry-run --access public
|
||||
else
|
||||
npm publish --access public
|
||||
echo "📦 Published @pascal-app/mcp@$MCP_VERSION"
|
||||
fi
|
||||
|
||||
- name: Commit version bumps & tag
|
||||
@@ -118,6 +168,14 @@ jobs:
|
||||
PKGS="$PKGS @pascal-app/viewer@$VIEWER_VERSION"
|
||||
TAGS="$TAGS @pascal-app/viewer@$VIEWER_VERSION"
|
||||
fi
|
||||
if [ -n "$EDITOR_VERSION" ]; then
|
||||
PKGS="$PKGS @pascal-app/editor@$EDITOR_VERSION"
|
||||
TAGS="$TAGS @pascal-app/editor@$EDITOR_VERSION"
|
||||
fi
|
||||
if [ -n "$MCP_VERSION" ]; then
|
||||
PKGS="$PKGS @pascal-app/mcp@$MCP_VERSION"
|
||||
TAGS="$TAGS @pascal-app/mcp@$MCP_VERSION"
|
||||
fi
|
||||
|
||||
git commit -m "release:${PKGS}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user