chore: make package template a proper Yarn workspace - #10087
Conversation
Adds `scripts/create-package/package-template` to the monorepo's workspaces list so that Yarn constraints are enforced against it, making it easier to keep the template aligned with other packages. The template's package name is set to `@metamask/package-template` (a real resolvable name), with placeholders only for fields that vary per package. Constraints are relaxed where needed: the homepage uses a placeholder directory name, and the codeowner check is skipped for the template.
ade9889 to
b499356
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d92fd47. Configure here.
mcmire
left a comment
There was a problem hiding this comment.
We might want to move create-package itself into a workspace, but this is good on its own.
One question, but otherwise looks good.
|
|
||
| // Directories and file patterns generated by build/test tools that must not | ||
| // be copied from the package template into new packages. | ||
| const TEMPLATE_IGNORE_PATTERNS = [ |
There was a problem hiding this comment.
What do you think about putting this const at the top of the file along with the others?
mcmire
left a comment
There was a problem hiding this comment.
I tested out the create-package utility and yarn lint passes (aside from the requirement to assign a codeowner to the package). Looks good.

Explanation
The
scripts/create-package/package-templatedirectory was not previously listed as a Yarn workspace, which meant Yarn constraints were not checked against it. This made it easy for the template to drift out of alignment with the monorepo's other packages over time.This PR adds the template to the workspaces list and gives it a real package name (
@metamask/package-template) so that constraints can run against it. Fields that vary per package (description, directory name) remain as placeholders. Constraints are relaxed in two places where the template legitimately differs from real packages: the homepage uses a placeholder directory name, and the code owner check is skipped.References
N/A
Checklist
Note
Low Risk
Scaffolding and monorepo tooling changes only; no runtime product behavior.
Overview
Turns the new-package scaffold into a real workspace at
packages/package-templatenamed@metamask/package-template(markedprivate) so Yarn constraints keep it aligned with other packages, with targeted relaxations for placeholder homepage and skipped CODEOWNERS checks.create-packagenow copies from that workspace path instead ofscripts/create-package/package-template, skips build/test artifacts (dist/,coverage/,*.tsbuildinfo), and stripsprivatefrom generatedpackage.jsonfiles. Placeholder replacement uses the scoped template name in template files; roottsconfigreferences,teams.json, and the lockfile register the workspace.Reviewed by Cursor Bugbot for commit b33cb75. Bugbot is set up for automated code reviews on this repo. Configure here.