fix(sdks): migrate VSCode TypeScript settings - #7219
Open
arko1995 wants to merge 3 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What's the problem this PR addresses?
@yarnpkg/sdks currently generates the deprecated VS Code TypeScript settings:
{
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true
}
These settings have been replaced by the unified JavaScript and TypeScript settings:
{
"js/ts.tsdk.path": ".yarn/sdks/typescript/lib",
"js/ts.tsdk.promptToUseWorkspaceVersion": true
}
Simply adding the new settings isn't sufficient for existing projects, since the deprecated settings would remain in .vscode/settings.json.
Fixes #7107.
...
How did you fix it?
Updated the VS Code TypeScript SDK generator to use the new js/ts.tsdk.* settings.
Extended the workspace configuration helper so obsolete settings can be removed before applying a patch.
Removed the deprecated typescript.tsdk and typescript.enablePromptUseWorkspaceTsdk settings during migration.
Preserved unrelated user-defined VS Code settings.
Updated the SDK command help text to reference the new setting name.
Added tests for both fresh settings generation and migration of an existing settings file.
The removal and replacement happen during the same settings-file update.
Tests
Added tests covering:
Generating the unified settings for a new project.
Removing deprecated settings from an existing project.
Preserving unrelated user settings during migration.
yarn test:unit packages/yarnpkg-sdks/tests/vscode.test.ts --runInBand
Result:
Test Suites: 1 passed, 1 total
Tests: 2 passed, 2 total
Related work
I'm aware of #7116 and #7119, which also address #7107. This implementation focuses on performing the migration in a single configuration update and includes automated coverage for both fresh and existing projects.
...
The Netlify failure appears unrelated to this PR.
I reproduced the exact same failure from a clean detached worktree at the current
origin/mastercommit (0a230c14e):This PR only changes
packages/yarnpkg-sdksand its release metadata.origin/master...HEADreports0 3, and none of the PR changes referencecatalog,exampleKeys,patternProperties, or the Docusaurus configuration.Could the Netlify check be waived/retried after the base documentation build is fixed?
Checklist