yarnpkg / berry

📦🐈 Active development trunk for Yarn ⚒
https://yarnpkg.com
BSD 2-Clause "Simplified" License
7.23k stars 1.07k forks source link

Adds support for ESM loaders to the SDKs #6278

Closed arcanis closed 3 weeks ago

arcanis commented 1 month ago

What's the problem this PR addresses?

ESM loaders aren't supported by the sdks because we only require().setup() but we don't register() the ESM loader hook.

Fixes #6219

How did you fix it?

Checklist

macalinao commented 1 month ago

What's blocking this from being merged?

n0099 commented 4 weeks ago

What's blocking this from being merged?

https://github.com/yarnpkg/berry/issues/6219#issuecomment-2123394931

For those can't wait just resolve package @yarnpkg/sdks to the branch of this pr: https://stackoverflow.com/questions/43411864/how-to-install-package-from-github-repo-in-yarn/67779901#67779901

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 git clone this LARGE repo.

not working, ignore Or manually [`git clone --filter+git sparse-checkout`](https://stackoverflow.com/questions/600079/how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934) but also for [`/*`](https://stackoverflow.com/questions/75311408/how-to-prevent-git-clone-filter-blobnone-sparse-from-downloading-files-on-t) ```bash git clone https://github.com/yarnpkg/berry --branch mael/eslint-flat-config-sdk --depth 1 --filter=blob:none --sparse berry cd berry git sparse-checkout add packages/yarnpkg-{sdks,core} cd packages/yarnpkg-sdks touch yarn.lock yarn install ``` Or download online archive [`packages/yarnpkg-sdks`](https://download-directory.github.io/?url=https%3A%2F%2Fgithub.com%2Fyarnpkg%2Fberry%2Ftree%2Fmael%2Feslint-flat-config-sdk%2Fpackages%2Fyarnpkg-sdks) then resolve it with [`file:` protocol](https://stackoverflow.com/questions/40102686/how-to-install-package-with-local-path-by-yarn-it-couldnt-find-package) ```bash yarn dlx -p '@yarnpkg/sdks@./berry/packages/yarnpkg-sdks' @yarnpkg/sdks vscode ``` instead.
  1. let vscode extension dbaeumer.vscode-eslint>=3.0.5 run with Node >v20.6.0, v18.19.0 by setting eslint.runtime in settings.json: https://stackoverflow.com/questions/69179099/enforcing-node-version-on-eslint-server
    node --version
    "eslint.runtime": "node",