Skip to content

WIP: feat: upgrade create-dev-release flow#1164

Draft
jwartofsky-yext wants to merge 2 commits intomainfrom
improveCreateDevRelease
Draft

WIP: feat: upgrade create-dev-release flow#1164
jwartofsky-yext wants to merge 2 commits intomainfrom
improveCreateDevRelease

Conversation

@jwartofsky-yext
Copy link
Copy Markdown
Contributor

Updates the create-dev-release flow to update the package versions in the starter to match the visual-editor

To be combined with a receiving update in pages-visual-editor-starter

jwartofsky-yext and others added 2 commits April 17, 2026 16:49
Updates the create-dev-release flow to update the package
versions in the starter to match the visual-editor

To be combined with a receiving update in pages-visual-editor-starter
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Apr 17, 2026

Walkthrough

The changes add a new capability to align shared package versions across repositories during dev release creation. A new script scripts/getSharedPackageVersions.mjs reads two package.json files, identifies common dependencies between them (excluding @yext/visual-editor), and generates a mapping of shared package names to their versions from the source manifest. The create-dev-release workflow is updated to invoke this script with the visual editor and starter repository package manifests, then includes the resulting shared_package_versions object in the repository dispatch payload sent to the starter repository. Documentation is updated to describe this new behavior.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title describes the main change (upgrading the create-dev-release flow) and aligns with the pull request objectives and file modifications.
Description check ✅ Passed The description clearly relates to the changeset by explaining the intent to update package versions in the starter to match the visual-editor through the create-dev-release flow.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch improveCreateDevRelease

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/create-dev-release.yml (1)

39-63: ⚠️ Potential issue | 🟠 Major

Ensure companion changes in pages-visual-editor-starter are ready before/alongside this PR.

The two original concerns:

  1. ./starter/package.json availability — This is confirmed safe. The workflow explicitly checks out the PR code and runs pnpm i, which sets up the starter workspace (declared in pnpm-workspace.yaml). The readFile call in getSharedPackageVersions.mjs will throw if either package.json is missing, causing the step to fail clearly rather than silently producing invalid JSON.

  2. Companion changes — The shared_package_versions field is new to the dispatch payload. The receiver (pages-visual-editor-starter) must be updated to handle this field before (or simultaneously with) this PR lands, or it will ignore or error on the unexpected payload.

The script output format (shared_package_versions={...}) always produces valid JSON when it succeeds, so the interpolation concern is mitigated by the fact that script errors surface as step failures.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/create-dev-release.yml around lines 39 - 63, This change
adds a new client-payload field shared_package_versions (from
steps.build-shared-package-versions.outputs.shared_package_versions) to the
repository-dispatch for event-type dev-release-created targeting
YextSolutions/pages-visual-editor-starter; ensure the companion repo is updated
to accept and process this new payload key (or tolerate its absence) before
merging: update the pages-visual-editor-starter dispatch handler to parse and
validate shared_package_versions, add defensive checks for missing/invalid JSON,
or make this workflow conditionally include the field only when
build-shared-package-versions succeeds so the receiver remains
backward-compatible.
🧹 Nitpick comments (2)
.github/workflows/README.md (1)

48-56: Docs accurately reflect the new payload.

The example payload and the trailing sentence correctly describe the new shared_package_versions behavior. One minor nit: consider also documenting that @yext/visual-editor itself is intentionally excluded from this map (since it's carried by package_url), so future readers understand why it won't appear here.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/README.md around lines 48 - 56, Add a short note to the
README explaining that the package named in "package_url" (e.g.
"@yext/visual-editor") is intentionally excluded from the
"shared_package_versions" map, so readers understand why "@yext/visual-editor"
will not appear in "shared_package_versions"; update the paragraph after the
example payload to mention this exclusion and clarify that
"shared_package_versions" only lists other shared package names and versions.
scripts/getSharedPackageVersions.mjs (1)

77-100: Consider writing only to stdout the key=value line and nothing else.

The workflow relies on >> "$GITHUB_OUTPUT" capturing every stdout line as a key=value pair. Right now the script is clean, but any future console.log added for debugging (or an incidental log from an imported module) would corrupt $GITHUB_OUTPUT and likely cause the repository-dispatch payload to become invalid JSON. Consider either (a) adding a short comment here warning contributors not to console.log other content, or (b) writing the single output line via process.stdout.write and routing any future diagnostics to console.error/stderr.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/getSharedPackageVersions.mjs` around lines 77 - 100, The script's
stdout must only emit the single key=value line to avoid corrupting GitHub
Actions $GITHUB_OUTPUT; replace the final console.log in main() that writes
shared_package_versions with a single call to process.stdout.write and ensure
any diagnostics use console.error (or process.stderr.write) instead, and
optionally add a short inline comment near main/await main() warning
contributors not to use console.log for other output so future debug prints
don't break the workflow.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@scripts/getSharedPackageVersions.mjs`:
- Around line 17-34: The spread order in getSourceDependencyLookup is backwards:
later spreads overwrite earlier ones so devDependencies currently win over
peerDependencies and dependencies; reverse the merge order so that
packageManifest.devDependencies is spread first, then
packageManifest.peerDependencies, and finally packageManifest.dependencies (or
use Object.assign({}, dev, peer, deps)) so runtime dependencies in
packageManifest.dependencies take precedence when keys conflict.

---

Outside diff comments:
In @.github/workflows/create-dev-release.yml:
- Around line 39-63: This change adds a new client-payload field
shared_package_versions (from
steps.build-shared-package-versions.outputs.shared_package_versions) to the
repository-dispatch for event-type dev-release-created targeting
YextSolutions/pages-visual-editor-starter; ensure the companion repo is updated
to accept and process this new payload key (or tolerate its absence) before
merging: update the pages-visual-editor-starter dispatch handler to parse and
validate shared_package_versions, add defensive checks for missing/invalid JSON,
or make this workflow conditionally include the field only when
build-shared-package-versions succeeds so the receiver remains
backward-compatible.

---

Nitpick comments:
In @.github/workflows/README.md:
- Around line 48-56: Add a short note to the README explaining that the package
named in "package_url" (e.g. "@yext/visual-editor") is intentionally excluded
from the "shared_package_versions" map, so readers understand why
"@yext/visual-editor" will not appear in "shared_package_versions"; update the
paragraph after the example payload to mention this exclusion and clarify that
"shared_package_versions" only lists other shared package names and versions.

In `@scripts/getSharedPackageVersions.mjs`:
- Around line 77-100: The script's stdout must only emit the single key=value
line to avoid corrupting GitHub Actions $GITHUB_OUTPUT; replace the final
console.log in main() that writes shared_package_versions with a single call to
process.stdout.write and ensure any diagnostics use console.error (or
process.stderr.write) instead, and optionally add a short inline comment near
main/await main() warning contributors not to use console.log for other output
so future debug prints don't break the workflow.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 8df4c5ee-e4c9-41cb-8274-377beb8d6e39

📥 Commits

Reviewing files that changed from the base of the PR and between 9489ed7 and 54d275d.

📒 Files selected for processing (3)
  • .github/workflows/README.md
  • .github/workflows/create-dev-release.yml
  • scripts/getSharedPackageVersions.mjs

Comment on lines +17 to +34
/**
* Builds a lookup of every dependency version the visual-editor package can source from.
*
* The order is intentional:
* 1. Runtime dependencies are used when present.
* 2. Peer dependencies can also supply versions for starter runtime dependencies.
* 3. Dev dependencies fill in shared tooling versions like TypeScript or Vite.
*
* @param {PackageManifest} packageManifest
* @returns {DependencyMap}
*/
function getSourceDependencyLookup(packageManifest) {
return {
...packageManifest.dependencies,
...packageManifest.peerDependencies,
...packageManifest.devDependencies,
};
}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Spread order contradicts the documented precedence.

The JSDoc states the intended precedence is (1) dependencies, (2) peerDependencies, (3) devDependencies — i.e., runtime deps should win when a package is present in multiple sections. But because later spreads overwrite earlier keys, the current code gives devDependencies the highest precedence and dependencies the lowest. If any package (e.g., typescript, vite, a peer dep that's also pinned in devDeps for local builds) appears in more than one section of packages/visual-editor/package.json with different version strings, the starter will be aligned to the devDep version rather than the runtime one.

🔧 Proposed fix
 function getSourceDependencyLookup(packageManifest) {
   return {
-    ...packageManifest.dependencies,
-    ...packageManifest.peerDependencies,
     ...packageManifest.devDependencies,
+    ...packageManifest.peerDependencies,
+    ...packageManifest.dependencies,
   };
 }
📝 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.

Suggested change
/**
* Builds a lookup of every dependency version the visual-editor package can source from.
*
* The order is intentional:
* 1. Runtime dependencies are used when present.
* 2. Peer dependencies can also supply versions for starter runtime dependencies.
* 3. Dev dependencies fill in shared tooling versions like TypeScript or Vite.
*
* @param {PackageManifest} packageManifest
* @returns {DependencyMap}
*/
function getSourceDependencyLookup(packageManifest) {
return {
...packageManifest.dependencies,
...packageManifest.peerDependencies,
...packageManifest.devDependencies,
};
}
/**
* Builds a lookup of every dependency version the visual-editor package can source from.
*
* The order is intentional:
* 1. Runtime dependencies are used when present.
* 2. Peer dependencies can also supply versions for starter runtime dependencies.
* 3. Dev dependencies fill in shared tooling versions like TypeScript or Vite.
*
* `@param` {PackageManifest} packageManifest
* `@returns` {DependencyMap}
*/
function getSourceDependencyLookup(packageManifest) {
return {
...packageManifest.devDependencies,
...packageManifest.peerDependencies,
...packageManifest.dependencies,
};
}
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@scripts/getSharedPackageVersions.mjs` around lines 17 - 34, The spread order
in getSourceDependencyLookup is backwards: later spreads overwrite earlier ones
so devDependencies currently win over peerDependencies and dependencies; reverse
the merge order so that packageManifest.devDependencies is spread first, then
packageManifest.peerDependencies, and finally packageManifest.dependencies (or
use Object.assign({}, dev, peer, deps)) so runtime dependencies in
packageManifest.dependencies take precedence when keys conflict.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant