Skip to content

chore(plugin-pnp): add enum NodeLinker #5848

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

Closed

Conversation

trivikr
Copy link
Contributor

@trivikr trivikr commented Oct 24, 2023

What's the problem this PR addresses?

Fixes: #5847
Previous attempt: #5070

How did you fix it?

Add enum NodeLinker which can used wherever nodeLinker configuration is used.

Checklist

  • I have read the Contributing Guide.
  • I have set the packages that need to be released for my changes to be effective.
  • I will check that all automated PR checks pass before the PR gets reviewed.

@trivikr trivikr force-pushed the config-node-linker-option-pnpm branch from 0e09d1b to cee4fd1 Compare October 24, 2023 18:52
@trivikr trivikr changed the title chore(pnp): add enum NodeLinker chore(plugin-pnp): add enum NodeLinker Oct 24, 2023
Copy link
Member

@merceyz merceyz left a comment

Choose a reason for hiding this comment

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

Similarly to my objection in #5070 (review), I don't like that the PnP linker has to "know about" the others and vice versa.

I'd be fine with just updating the description but in the long run I think this would be better solved by something along the lines of:

  1. a @yarnpkg/plugin-node plugin that only registers the nodeLinker configuration with a description
  2. the linkers register the nodeLinker configuration only providing the valid value(s) for itself, a description for said value(s), and if any of them should be the default.
  3. the core merges them and provides validation solving [Enhancement] Throw on invalid nodeLinker value #2656.

@trivikr trivikr closed this Oct 24, 2023
@trivikr trivikr deleted the config-node-linker-option-pnpm branch October 24, 2023 19:39
@trivikr
Copy link
Contributor Author

trivikr commented Oct 24, 2023

I posted a fix to mention pnpm in nodeLinker description as of now #5850

The suggestion by @merceyz for creating @yarnpkg/plugin-node can be taken up separately.

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.

[Bug?]: pnpm is not listed as an option in config for nodeLinker
2 participants