[Feature] Yarn SDKs without contribution

Open
#5,488 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
25/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale

Research direction

No implementation file or test is named. Start by reading the contributing guide and the current Yarn SDK approach, then determine how a user-provided package, paths, and VS Code configuration could be supported. Done means authors can generate SDKs without adding their packages to this repository, with documented behavior and tests.

Written by the indexing model from the issue text.

Description

enhancement
  • I'd be willing to implement this feature (contributing guide)
  • This feature is important to have in this repository; a contrib plugin wouldn't do

Describe the user story

As a developer,
I want an API to generate Yarn SDKs,
So that my team and others don't need to contribute to Yarn.

Describe the solution you'd like

Right now, working with TypeScript or ESLint (as examples) in VS Code requires using Yarn SDKs to help resolve the locally installed packages. This is important as it allows users to control versions.

The current SDK approach makes sense, but it means that packages must be listed in this repo, and later updated if and when package structure changes. For authors of things like VS Code extensions - including possibly private/internal extensions - it would be great if they could use a solution where users instead provide instructions to the SDK package, for example:

# yarn dlx @yarnpkg/sdks
sdks create --package="@scope/package" --path="dist/api.js" --vscode="myExtension.packagePath"

This could be a JS API too, so that the extension could self-configure:

import { create } from '@yarnpkg/sdks';

create('@scope/package',
  { paths: ['dist/api.js', 'dist/advanced.js'] },
  (sdkPath) => ({ 
    vscode: {
      "myExtension.packagePath": sdkPath + '/dist/api.js',
    },
  }),
);

The above are for example purposes and are not intended to be API proposals.

Describe the drawbacks of your solution

I realise that from a Yarn perspective, it's easier to manage changes when all of the code lives in this repo.

For VS Code extensions authors, this now puts the responsibility to support Yarn back onto them and their teams.

Describe alternatives you've considered

Authors can manually create SDK files.

Dominant language
TypeScript
Stars
8.1k
Forks
1.3k
PR merge metrics
No merged PRs in 30d

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from yarnpkg/berry

All issues in yarnpkg/berry

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.