- 
                Notifications
    
You must be signed in to change notification settings  - Fork 8
 
chore(none): 🤖 update publish config #140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
          
WalkthroughIntroduces a consolidated Changesets-based release workflow, updates Changesets configuration (including a v1-specific config), removes legacy JS/Rust release workflows, and adds npm scripts to run Changesets commands. Changes
 Sequence Diagram(s)sequenceDiagram
  autonumber
  actor Dev as Developer
  participant GH as GitHub Actions
  participant JS as release-js Job
  participant RB as call-rust-build Job
  participant RS as release-rust Job
  participant NPM as npm Registry
  Dev->>GH: Push to main / v1-main
  GH->>GH: Check commit message for js-plugins / rust-plugins / all
  rect rgba(230,245,255,0.6)
    note over GH,JS: JS release path (if js-plugins or all)
    GH->>JS: run checkout, setup Node, pnpm install, build JS subset
    JS->>NPM: changeset publish (tag=beta on main, stable on v1-main)
  end
  rect rgba(240,255,230,0.6)
    note over GH,RS: Rust release path (if rust-plugins or all)
    GH->>RB: Reusable build workflow
    RB-->>GH: Build artifacts
    GH->>RS: Download and place artifacts
    RS->>NPM: changeset publish (tag=beta on main, stable on v1-main)
  end
  note over GH: Concurrency prevents overlapping runs
    Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
 Suggested reviewers
 Pre-merge checks (3 passed)✅ Passed checks (3 passed)
 Poem
 Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs. 
 Please see the documentation for more information. Example: reviews:
  pre_merge_checks:
    custom_checks:
      - name: "Undocumented Breaking Changes"
        mode: "warning"
        instructions: |
          Pass/fail criteria: All breaking changes to public APIs, CLI flags, environment variables, configuration keys, database schemas, or HTTP/GraphQL endpoints must be documented in the "Breaking Change" section of the PR description and in CHANGELOG.md. Exclude purely internal or private changes (e.g., code not exported from package entry points or explicitly marked as internal).Please share your feedback with us on this Discord post. ✨ Finishing Touches🧪 Generate unit tests
 Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment   | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
🧹 Nitpick comments (3)
package.json (1)
6-13: Normalize scripts to pnpm and consider adding a publish aliasMinor consistency cleanups and a convenience script.
"scripts": { - "release": "npx changeset && npx changeset version", - "changeset": "changeset", - "version-packages": "changeset version", - "release-packages": "changeset publish", + "release": "pnpm changeset && pnpm version-packages", + "changeset": "pnpm exec changeset", + "version-packages": "pnpm exec changeset version", + "release-packages": "pnpm exec changeset publish", + "release-all": "pnpm version-packages && pnpm release-packages",.github/workflows/release-changeset.yml (2)
34-36: Build filter looks fragile; may skip needed packagesThe selector {js-plugins}[HEAD
1] is non-standard and HEAD1 only covers the last commit. This can miss packages that need building when multiple commits land. Prefer an explicit workspace filter or a full recursive build.- - name: Build Packages - run: pnpm --filter "{js-plugins}[HEAD~1]" build + - name: Build Packages + run: pnpm -r buildIf you need to scope to a group, switch to pnpm’s documented selectors (e.g., --filter './plugins/js-*').
142-142: Add a trailing newlineYAMLlint flagged missing EOF newline.
- uses: ./.github/workflows/build.yaml + uses: ./.github/workflows/build.yaml +
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (6)
- 
.changeset/config.json(1 hunks) - 
.changeset/config.v1.json(1 hunks) - 
.github/workflows/release-changeset.yml(1 hunks) - 
.github/workflows/release-js-plugins.yml(0 hunks) - 
.github/workflows/release-rust-plugins.yml(0 hunks) - 
package.json(1 hunks) 
💤 Files with no reviewable changes (2)
- .github/workflows/release-rust-plugins.yml
 - .github/workflows/release-js-plugins.yml
 
🧰 Additional context used
🪛 YAMLlint (1.37.1)
.github/workflows/release-changeset.yml
[error] 142-142: no new line character at the end of file
(new-line-at-end-of-file)
🔇 Additional comments (5)
.changeset/config.json (1)
7-7: Access set to public — looks goodAligns with npm’s requirement for publishing scoped packages publicly. No issues from my side.
.github/workflows/release-changeset.yml (4)
15-15: Commit-message gating can be brittleUsing only github.event.head_commit.message may skip runs for multi-commit pushes or merges where the top commit lacks the marker. If that’s acceptable, fine; otherwise consider checking all commit messages in the push or using labels/paths.
42-65: Grant write permissions for PR creation/pusheschangesets/action needs write permissions to create/update release PRs. If your repo defaults are read-only, these steps will fail.
name: Release with Changeset on: push: @@ concurrency: ${{ github.workflow }}-${{ github.ref }} +permissions: + contents: write + pull-requests: write + jobs:Alternatively, add the permissions block under each job.
116-139: Same permissions consideration for rust publishEnsure write permissions are available here too, otherwise release PRs or tags may fail.
140-142: Reusable workflow and artifacts: confirm wiringVerify .github/workflows/build.yaml has on: workflow_call and uploads artifacts named with the ${{ github.sha }}-${abi}-${package} scheme; otherwise download-artifact won’t find them.
| { | ||
| "$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
| "changelog": "@changesets/cli/changelog", | ||
| "commit": false, | ||
| "fixed": [], | ||
| "linked": [], | ||
| "access": "public", | ||
| "baseBranch": "v1-main", | ||
| "updateInternalDependencies": "patch", | ||
| "ignore": [] | ||
| } No newline at end of file | 
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This config will be ignored unless explicitly selected; wire it into the workflow
Changesets only reads .changeset/config.json by default. In this repo, the workflows never point the CLI/action to config.v1.json, so v1 branch runs will still use the main config. Ensure the v1 workflow overwrites/uses this file when running on refs/heads/v1-main.
Apply one of these:
- Simple: copy v1 config over the default before publish/version on v1-main.
 
--- a/.github/workflows/release-changeset.yml
+++ b/.github/workflows/release-changeset.yml
@@ -52,6 +52,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-v1
         uses: changesets/action@v1
         with:
           publish: pnpm exec changeset publish
@@ -122,6 +128,12 @@ jobs:
           NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
 
       - name: Create Release Pull Request or Publish to npm (v1-main branch - stable)
         if: github.ref == 'refs/heads/v1-main'
+      - name: Use v1 Changesets config
+        if: github.ref == 'refs/heads/v1-main'
+        run: |
+          cp .changeset/config.v1.json .changeset/config.json
+          echo "Using v1 Changesets config"
+
         id: changesets-rust-v1
         uses: changesets/action@v1- Alternative: keep only a single config.json per maintenance branch (recommended), and remove config.v1.json from main.
 
Committable suggestion skipped: line range outside the PR's diff.
🤖 Prompt for AI Agents
In .changeset/config.v1.json (lines 1-11) the v1-specific Changesets config will
be ignored because workflows use .changeset/config.json by default; update the
v1-main CI workflow to ensure this file is used by either copying
.changeset/config.v1.json to .changeset/config.json before any
changesets/publish/version steps when refs/heads/v1-main are running, or else
remove config.v1.json and maintain a single .changeset/config.json for the v1
branch (i.e., add a conditional step that on v1-main copies the file prior to
running the Changesets CLI).
| - name: Move Artifacts | ||
| run: | | ||
| for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc | ||
| do | ||
| for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress | ||
| do | ||
| folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}" | ||
| if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then | ||
| mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi} | ||
| ls -R $folder_path | ||
| ls -R ./rust-plugins/${package}/npm/${abi} | ||
| test -f ./rust-plugins/${package}/npm/${abi}/index.farm | ||
| else | ||
| echo "${folder_path} is empty" | ||
| fi | ||
| done | ||
| done | ||
| 
               | 
          
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Artifact move can fail if target dirs don’t exist
mv will error when ./rust-plugins/${package}/npm/${abi} is missing. Add mkdir -p and safer bash options; list destination after move.
-      - name: Move Artifacts
-        run: |
-          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
+      - name: Move Artifacts
+        run: |
+          set -euo pipefail
+          for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc
           do
             for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress
               do
                 folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}"
                 if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then
-                  mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi}
-                  ls -R $folder_path
-                  ls -R ./rust-plugins/${package}/npm/${abi}
+                  dest="./rust-plugins/${package}/npm/${abi}"
+                  mkdir -p "$dest"
+                  ls -R "$folder_path"
+                  mv "$folder_path"/* "$dest"/
+                  ls -R "$dest"
                   test -f ./rust-plugins/${package}/npm/${abi}/index.farm
                 else
                   echo "${folder_path} is empty"
                 fi
               done
           done📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| - name: Move Artifacts | |
| run: | | |
| for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc | |
| do | |
| for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress | |
| do | |
| folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}" | |
| if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then | |
| mv /tmp/artifacts/${{ github.sha }}-${abi}-${package}/* ./rust-plugins/${package}/npm/${abi} | |
| ls -R $folder_path | |
| ls -R ./rust-plugins/${package}/npm/${abi} | |
| test -f ./rust-plugins/${package}/npm/${abi}/index.farm | |
| else | |
| echo "${folder_path} is empty" | |
| fi | |
| done | |
| done | |
| - name: Move Artifacts | |
| run: | | |
| set -euo pipefail | |
| for abi in linux-x64-gnu linux-x64-musl darwin-x64 win32-x64-msvc linux-arm64-musl linux-arm64-gnu darwin-arm64 win32-ia32-msvc win32-arm64-msvc | |
| do | |
| for package in dsv react-components virtual yaml strip image url icons auto-import mdx wasm worker svgr modular-import compress | |
| do | |
| folder_path="/tmp/artifacts/${{github.sha}}-${abi}-${package}" | |
| if [ -d "${folder_path}" ] && [ -n "$(ls -A $folder_path)" ]; then | |
| dest="./rust-plugins/${package}/npm/${abi}" | |
| mkdir -p "$dest" | |
| ls -R "$folder_path" | |
| mv "$folder_path"/* "$dest"/ | |
| ls -R "$dest" | |
| test -f ./rust-plugins/${package}/npm/${abi}/index.farm | |
| else | |
| echo "${folder_path} is empty" | |
| fi | |
| done | |
| done | 
🤖 Prompt for AI Agents
.github/workflows/release-changeset.yml around lines 90 to 107: the loop moves
artifacts into ./rust-plugins/${package}/npm/${abi} but mv will fail if the
destination directory doesn't exist and the script lacks safer bash flags;
before calling mv, create the destination with mkdir -p (use the fully expanded
destination path), ensure variables are quoted, and enable safer shell options
(e.g. set -euo pipefail at script start or within the job) so failures surface;
after a successful move, list the destination to verify (ls -R destination) and
keep the existing empty-folder echo path for clarity.
Summary by CodeRabbit