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

Infer which files should SDKs include using manifest data #5703

Merged
merged 9 commits into from
Oct 18, 2023

Conversation

clemyan
Copy link
Member

@clemyan clemyan commented Aug 30, 2023

What's the problem this PR addresses?

Some SDKs do not include all exposed files, making some features inaccessible to some editor integration. In particular, the ESLint SDK does not include lib/unsupported-api.js needed for its experimental flat config feature.

Closes #5231
Closes #5471

How did you fix it?

As outlined in #5231, the list of exposed files can be inferred by reading the main, bin, and exports fields of the manifest. This PR switches all existing SDK generators to doing so. Some SDKs (e.g. Typescript) still requires some special treatment so the PR keeps some escape hatches.

Questions

  1. I don't know if this is considered a breaking change, I have marked @yarnpkg/sdks for a minor release for now.
  2. typescript-language-server has not exposed a CJS entrypoint since 1.0.0, and as far as I know the SDK mechanism cannot support ESM files since loaders cannot be dynamically added once userland code starts execution. Should we just remove that SDK?
  3. In the same vein, should we just ignore any conditional exports that require the import condition? .mjs files?

Checklist

  • 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.

@clemyan
Copy link
Member Author

clemyan commented Sep 6, 2023

Any thoughts on the questions?

  • I don't know if this is considered a breaking change, I have marked @yarnpkg/sdks for a minor release for now.
  • typescript-language-server has not exposed a CJS entrypoint since 1.0.0, and as far as I know the SDK mechanism cannot support ESM files since loaders cannot be dynamically added once userland code starts execution. Should we just remove that SDK?
  • In the same vein, should we just ignore any conditional exports that require the import condition? .mjs files?

@arcanis
Copy link
Member

arcanis commented Oct 18, 2023

Any thoughts on the questions?

  • I don't know if this is considered a breaking change, I have marked @yarnpkg/sdks for a minor release for now.
  • typescript-language-server has not exposed a CJS entrypoint since 1.0.0, and as far as I know the SDK mechanism cannot support ESM files since loaders cannot be dynamically added once userland code starts execution. Should we just remove that SDK?
  • In the same vein, should we just ignore any conditional exports that require the import condition? .mjs files?

Sorry, missed this notification

  • It doesn't matter for @yarnpkg/sdks because dlx always pulls latest, which in the case of sdks is the current RC 😅
  • There's now a register API to dynamically register loaders: register

@arcanis arcanis merged commit 3c1be68 into yarnpkg:master Oct 18, 2023
14 of 15 checks passed
@clemyan clemyan deleted the manifest-based-sdks branch October 24, 2023 19:27
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.

[Feature] ESLint SDK should export eslint/use-at-you-own-risk
2 participants