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

Add yarn workspaces support #1258

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

magelle
Copy link
Contributor

@magelle magelle commented Oct 18, 2022

What did you implement:

Support for yarn workspaces when including external packages.
There were issue with the yarn.lock wich isn't in the project folder but in the yarn workspace root folder.

Closes #XXXXX

How did you implement it:

I added a dependency to get the root path of a yarn workspace. If the project is not a yarn workspaces project it default to the current behavior.

How can we verify it:

I added a e2e test which represente the problem I had : examples/include-external-npm-packages-with-yarn-workspaces/

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification config / commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
@j0k3r j0k3r requested a review from vicary October 20, 2022 12:32
Copy link
Member

@j0k3r j0k3r left a comment

Choose a reason for hiding this comment

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

Looks ok to me!

@magelle
Copy link
Contributor Author

magelle commented Oct 20, 2022

Great, thanks for your help :)

@j0k3r j0k3r enabled auto-merge October 20, 2022 17:47
@j0k3r j0k3r disabled auto-merge October 20, 2022 17:47
@j0k3r
Copy link
Member

j0k3r commented Oct 21, 2022

I'm waiting for a review from @vicary, in the mean time, I think you can squash our commits :)

@magelle magelle force-pushed the add-yarn-workspaces-support branch from 10dc06c to a32ceef Compare October 21, 2022 07:25
@magelle magelle force-pushed the add-yarn-workspaces-support branch from a32ceef to 7391ff8 Compare October 21, 2022 07:31
Copy link
Member

@vicary vicary left a comment

Choose a reason for hiding this comment

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

I don't have a yarn workspace project to test this with, the changes looks fine.

Despite recent activities in GitHub, find-yarn-workspace-root has no new releases for 2 years. We should keep that in mind if yarn breaks this in 4+.

@gruckion
Copy link

Did you test if this works with Yarn PnP on Yarn Berry?

I was trying to package an external module whilst using Yarn workspaces and PnP. But I get warnings.

webpack compiled successfully
Warning: Could not check for peer dependencies of datadog-lambda-js. Set nodeModulesRelativeDir if node_modules is in different directory.
Package lock found - Using locked versions
Packing external modules: datadog-lambda-js@^6.87.0
Warning: Could not check for peer dependencies of datadog-lambda-js. Set nodeModulesRelativeDir if node_modules is in different directory.

✔ Service packaged (15s)

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