X Tutup
Skip to content

feat(types): add ChangesetsPackages#1872

Open
marcalexiei wants to merge 1 commit intochangesets:nextfrom
marcalexiei:changeset-packages-type
Open

feat(types): add ChangesetsPackages#1872
marcalexiei wants to merge 1 commit intochangesets:nextfrom
marcalexiei:changeset-packages-type

Conversation

@marcalexiei
Copy link
Contributor

This PR introduces ChangesetsPackages types to reduce the number of package relying on @manypkg/get-packages

@changeset-bot
Copy link

changeset-bot bot commented Mar 4, 2026

⚠️ No Changeset found

Latest commit: 33627f7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

changesets: string[];
};

export interface ChangesetsPackage {
Copy link
Member

Choose a reason for hiding this comment

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

given we are in the scope of Changesets already, I'd prefer to remove the Changesets prefix from those types

const packagesByName: { [key: string]: Package } = {
[packages.root.packageJson.name]: packages.root,
const packagesByName: { [key: string]: ChangesetsPackage } = {
[packages.root!.packageJson.name]: packages.root!,
Copy link
Member

Choose a reason for hiding this comment

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

isn't root required in the new type?


export default function getDependencyGraph(
packages: Packages,
packages: Pick<ChangesetsPackages, "packages" | "root">,
Copy link
Member

Choose a reason for hiding this comment

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

q: why do we use Pick here now?

await git.commit("first commit", tempDir);

try {
const { root, packages, tool } = await getPackages(tempDir);
Copy link
Member

Choose a reason for hiding this comment

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

q: so now tool is just a string so we wrap it in { type: tool } to conform to thy manypkg's v2 shape, right? once we migrate to it this value will change, we'll be able to just pass in tool directly because it will be an object with a .type property. On our end, in Changesets, we'll only require the .type to exist though

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

X Tutup