Skip to content

Conversation

@lukasholzer
Copy link
Contributor

@lukasholzer lukasholzer commented Jul 11, 2024

🎉 Thanks for submitting a pull request! 🎉

Summary

Fixes the issue where monorepos where not detected properly due to a undocumented feature in pnpm workspace definition.

Fixes https://linear.app/netlify/issue/FRP-774/help-investing-why-monorepo-detection-is-not-working

See https://netlify.slack.com/archives/C01TKAEBP3Q/p1720640110647669


For us to review and ship your PR efficiently, please perform the following steps:

  • Open a bug/issue before writing your code 🧑‍💻. This ensures
    we can discuss the changes and get feedback from everyone that should be involved. If you`re fixing a typo or
    something that`s on fire 🔥 (e.g. incident related), you can skip this step.
  • Read the contribution guidelines 📖. This ensures
    your code follows our style guide and passes our tests.
  • Update or add tests (if any source code was changed or added) 🧪
  • Update or add documentation (if features were changed or added) 📝
  • Make sure the status checks below are successful ✅

A picture of a cute animal (not mandatory, but encouraged)

@lukasholzer lukasholzer requested review from pieh and serhalp July 11, 2024 12:37
@lukasholzer lukasholzer requested review from a team as code owners July 11, 2024 12:37
Copy link
Member

@serhalp serhalp left a comment

Choose a reason for hiding this comment

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

LGTM

await Promise.all(
patterns.map((pattern) => {
const matcher = new Minimatch(pattern)
const cleanedPattern = pattern.replace(/^!?(\.\/)/, (match, p1) => match.replace(p1, ''))
Copy link
Member

Choose a reason for hiding this comment

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

maybe leave a comment here explaining why this is needed?

await Promise.all(
patterns.map((pattern) => {
const matcher = new Minimatch(pattern)
const cleanedPattern = pattern.replace(/^!?(\.\/)/, (match, p1) => match.replace(p1, ''))
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if anyone would ever want to use a path starting with ../? 🤔

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As it's the root of the workspace I don't think it make any sense

Copy link
Contributor

@pieh pieh left a comment

Choose a reason for hiding this comment

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

I suspect we might encounter some more issues here in the future for other undocumented ways to define workspaces, but this feels at least safe to do, so we might as well get this in to at least cover leading ./ cases that we at least know about

@lukasholzer lukasholzer merged commit 0b6b015 into main Jul 11, 2024
@lukasholzer lukasholzer deleted the fix/relative-path-pattern-in-workspace-definition branch July 11, 2024 13:35
This was referenced Jul 11, 2024
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.

4 participants