-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Adds support for ESM loaders to the SDKs #6278
Conversation
What's blocking this from being merged? |
For those can't wait just resolve package yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode wait for it to completely
node --version "eslint.runtime": "node", |
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) @ fe
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) @ fe
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) $ yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.0/bundles/@yarnpkg/plugin-nolyfill.js @ fe
…ngs.json $ yarn dlx -p '@yarnpkg/sdks@https://github.com/yarnpkg/berry#head=mael/eslint-flat-config-sdk&workspace=@yarnpkg/sdks' @yarnpkg/sdks vscode # yarnpkg/berry#6278 (comment) $ yarn plugin import https://raw.githubusercontent.com/wojtekmaj/yarn-plugin-nolyfill/v1.0.0/bundles/@yarnpkg/plugin-nolyfill.js @ fe
What's the problem this PR addresses?
ESM loaders aren't supported by the sdks because we only
require().setup()
but we don'tregister()
the ESM loader hook.Fixes #6219
How did you fix it?
Add support for ESM loaders to the SDK.
Check whether the
findPnpApi
function could be found in themodule
builtin. If not, tries to setup the environment accordingly. This is because in the case of the SDK, the subprocesses have been created without the--require .pnp.loader.mjs
flag, so the PnP runtime won't be setup.Checklist