Skip to content

Conversation

@ccharly
Copy link
Contributor

@ccharly ccharly commented Jan 21, 2026

Deps might actually be undefined if some of our packages don't depend on any others (like for the account-api).

So we need to add fallback records for those cases.


Note

Ensures the preview build script tolerates packages without dependency sections.

  • In scripts/prepare-preview-builds.ts, default dependencies and peerDependencies to {} before mutation when moving peer deps to dependencies and when pinning workspace versions in dependencies/devDependencies
  • Prevents errors when a package lacks dependencies/peerDependencies

Written by Cursor Bugbot for commit d09be21. This will update automatically on new commits. Configure here.

@ccharly ccharly requested a review from a team as a code owner January 21, 2026 10:13
@ccharly ccharly changed the title fix: fix prepare-preview-builds.ts fix: fix prepare-preview-builds.ts Jan 21, 2026
@ccharly ccharly added this pull request to the merge queue Jan 21, 2026
Merged via the queue into main with commit 3fac128 Jan 21, 2026
37 checks passed
@ccharly ccharly deleted the cc/fix/fix-preview-builds-build branch January 21, 2026 10:16
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

// (see `updateWorkspaceResolutions`)
for (const depKey of ['dependencies', 'devDependencies']) {
const deps = pkgJson.content[depKey] as DependenciesRecord;
const deps: DependenciesRecord = pkgJson.content[depKey] ?? {};
Copy link

Choose a reason for hiding this comment

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

Empty dependency objects added to package.json unnecessarily

Medium Severity

When pkgJson.content[depKey] is undefined, the fallback ?? {} creates an empty object. The code then unconditionally calls pkgJson.update({ [depKey]: deps }) even when no modifications were made. This adds empty dependencies: {} or devDependencies: {} to package.json files that didn't originally have these fields, polluting the manifests of packages like account-api that don't depend on other workspace packages.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's ok. We use preview builds for dev purposes. As long as we're not overwriting any deps, we're good.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants