Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Robustly discover packages for any tool #8

Merged

Conversation

NullVoxPopuli
Copy link
Contributor

@NullVoxPopuli NullVoxPopuli commented Jan 11, 2024

manypkg gets all packages, including the root workspace.

This means release-plan does not need to care about the "singlePackage" thing and that code can be removed.

(tho, release-plan will probably need a similar change)

Can test on your own repo with an override:

"pnpm": {
  "overrides": {
    "@ef4/lerna-changelog": "github:NullVoxPopuli/lerna-changelog#rdp-dist-PR-8"
  }
}

}

function getPackages(rootPath: string): { name: string; path: string }[] {
let { packages } = getPackagesSync(rootPath) as PackagesResult;
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 couldn't find types for manypkg, so I just made a rough minimal set, based on what I was seeing as output

type: 'pnpm' | 'yarn' | 'npm';
};
packages: Package[]
rootPackage: Package;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

the rootPackage is included in packages, so this is what will allow release-plan to work for single-package monorepos (or monorepos with nested workspaces, like https://github.com/universal-ember/kolay/).

@NullVoxPopuli NullVoxPopuli changed the title Robustly discovery packages for any tool Robustly discover packages for any tool Jan 11, 2024
Copy link
Member

@mansona mansona left a comment

Choose a reason for hiding this comment

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

I'm feeling a bit iffy on this one because we don't have fixture based tests with all the different types of monorepos and non-monorepos 🤔 but I'm not going to hold this PR back, we can add that next time a bug is reported and we try to fix something

@mansona mansona merged commit d8b8872 into embroider-build:master Jan 11, 2024
5 checks passed
@github-actions github-actions bot mentioned this pull request Jan 11, 2024
@mansona mansona added enhancement New feature or request and removed breaking labels Jan 11, 2024
@NullVoxPopuli NullVoxPopuli deleted the robustly-discovery-packages branch January 11, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants