Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

fix(ci): replace fragile sync-exports auto-push with a check (#906)

Cindy Zhangda3f35cf1894
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 3e084b5638..92d84a671c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -54,6 +54,9 @@ jobs:
- run: yarn install --frozen-lockfile
+ - name: Check package.json exports are in sync
+ run: node scripts/sync-exports.js --check
+
- run: yarn test
- run: yarn build
diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml
index d654b2e325..fd33a6920d 100644
--- a/.github/workflows/deploy.yml
+++ b/.github/workflows/deploy.yml
@@ -17,50 +17,16 @@ concurrency:
cancel-in-progress: false
jobs:
- # Sync package.json exports with src/ and commit if changed.
- # Runs first so test and deploy always see correct exports.
+ # Verify package.json exports match the source tree.
+ # Fails if exports are stale — run `node scripts/sync-exports.js` locally to fix.
sync-exports:
- # Skip runs triggered by our own auto-commits to avoid loops
- if: "!contains(github.event.head_commit.message, '[skip ci]')"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- - name: Sync package.json exports
- run: node scripts/sync-exports.js
+ - name: Check package.json exports are in sync
+ run: node scripts/sync-exports.js --check
- - name: Create PR if exports changed
- env:
- GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
- git diff --quiet packages/core/package.json && exit 0
-
- # Check if there's already an open sync-exports PR
- EXISTING=$(gh pr list --head "chore/sync-exports" --state open --json number --jq '.[0].number' 2>/dev/null || true)
- if [ -n "$EXISTING" ]; then
- echo "Sync-exports PR #$EXISTING already open — updating it"
- BRANCH=$(gh pr view "$EXISTING" --json headRefName --jq '.headRefName')
- git config user.name "github-actions[bot]"
- git config user.email "github-actions[bot]@users.noreply.github.com"
- git fetch origin "$BRANCH" 2>/dev/null || true
- git checkout -B "$BRANCH"
- git add packages/core/package.json
- git commit -m "chore: sync package.json exports"
- git push origin "$BRANCH" --force-with-lease
- else
- BRANCH="chore/sync-exports"
- git config user.name "github-actions[bot]"
- git config user.email "github-actions[bot]@users.noreply.github.com"
- git checkout -b "$BRANCH"
- git add packages/core/package.json
- git commit -m "chore: sync package.json exports"
- git push origin "$BRANCH"
- gh pr create \
- --title "chore: sync package.json exports" \
- --body "Auto-generated by the sync-exports CI step. Package.json exports were out of sync with the source tree." \
- --head "$BRANCH" \
- --base main
- fi
test:
runs-on: ubuntu-latest
diff --git a/packages/core/package.json b/packages/core/package.json
index 657ebea183..43505ab914 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -262,6 +262,12 @@
"import": "./dist/Section/index.mjs",
"require": "./dist/Section/index.js"
},
+ "./SegmentedControl": {
+ "source": "./src/SegmentedControl/index.ts",
+ "types": "./dist/SegmentedControl/index.d.ts",
+ "import": "./dist/SegmentedControl/index.mjs",
+ "require": "./dist/SegmentedControl/index.js"
+ },
"./Selector": {
"source": "./src/Selector/index.ts",
"types": "./dist/Selector/index.d.ts",