Skip to content

Conversation

@mcmire
Copy link
Contributor

@mcmire mcmire commented Oct 24, 2025

Explanation

With the Yarn upgrade, the lint:teams package script now prints an error indicating that the npmMinimalAgeGate configuration option is unrecognized. This script uses the Yarn API to get the list of workspaces, so it's possible something changed internally to where we now need a different incantation to initialize Yarn.

This commit fixes the script so that it uses yarn workspaces to get information about the workspaces instead of the Yarn API. This has always been known to work in the past so hopefully it should avoid any future breakages.

References

(N/A)

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed, highlighting breaking changes as necessary
  • I've prepared draft pull requests for clients and consumer packages to resolve any breaking changes

Note

Switches lint-teams-json to use yarn workspaces via execa, removing Yarn API usage and adjusting name parsing.

  • Scripts:
    • scripts/lint-teams-json.ts:
      • Replace Yarn API usage with yarn workspaces list --json --no-private executed via execa and parse JSON lines.
      • Introduce Workspace type and adjust package name extraction to workspace.name.slice(1).
      • Update workspace discovery docs/comments accordingly.

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

After the Yarn upgrade, the `lint:teams` package script prints an error
indicating that the `npmMinimalAgeGate` configuration option is
unrecognized. This script uses the Yarn API to get the list of
workspaces, so it's possible something changed internally.

This commit fixes the script so that it uses `yarn workspaces` to get
information about the workspaces, hopefully avoiding any future
breakages.
@mcmire mcmire marked this pull request as ready for review October 24, 2025 15:22
return project.workspaces.filter((workspace) => {
return !workspace.manifest.private;
});
return stdout.split('\n').map((line) => JSON.parse(line));
Copy link

Choose a reason for hiding this comment

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

Bug: Trailing Newlines Break JSON Parsing

The getPublicWorkspaces function splits yarn workspaces list stdout by newlines and parses each line as JSON. Command-line tools often output trailing newlines or empty lines, which causes JSON.parse('') to throw a SyntaxError and crash the script. This is a regression in error handling.

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.

I suppose so. We use this in other scripts though and it hasn't been a problem there, so I'm okay with this.

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.

2 participants