build(compiler-cli): update TypeScript 7 language service dependency to 7.1.0-dev

Upgrades the TypeScript 7 dependency in the preprocessor language service
and VS Code extension from the frozen @typescript/[email protected]
package to npm:[email protected], updates binary lookup for
@typescript/typescript-<platform>-<arch> (tsc), updates subpath imports from
/unstable/async to /async, and replaces api.updateSnapshot() with
api.getCurrentLanguageServerSnapshot().

(cherry picked from commit f442d775f0)
This commit is contained in:
Andrew Scott
2026-11-18 18:11:22 +00:00
committed by Alon Mishne
parent 575a9742e1
commit 48c7c0dcde
8 changed files with 93 additions and 67 deletions
@@ -93,8 +93,12 @@ export async function activate(context: vscode.ExtensionContext) {
function launchTs7Client(tsGoPath: string, context: vscode.ExtensionContext) {
const isNative =
tsGoPath.includes(`typescript-${process.platform}-${process.arch}`) ||
tsGoPath.includes(`native-preview-${process.platform}-${process.arch}`) ||
tsGoPath.endsWith('/lib/tsc') ||
tsGoPath.endsWith('/tsc.exe') ||
tsGoPath.endsWith('/tsgo.exe') ||
tsGoPath.endsWith('/built/local/tsc') ||
tsGoPath.endsWith('/built/local/tsgo');
const ts7ServerOptions: ServerOptions = isNative
? {
@@ -210,9 +214,14 @@ async function resolveTsGoPath(): Promise<string | null> {
const workspaceRoot = path.resolve(__dirname, '../../..');
const platformName = `@typescript/native-preview-${process.platform}-${process.arch}`;
const ext = process.platform === 'win32' ? '.exe' : '';
const tsPlatformName = `@typescript/typescript-${process.platform}-${process.arch}`;
const previewPlatformName = `@typescript/native-preview-${process.platform}-${process.arch}`;
const localCandidates = [
path.join(workspaceRoot, 'node_modules', platformName, 'lib', 'tsgo'),
path.join(workspaceRoot, 'node_modules', tsPlatformName, 'lib', `tsc${ext}`),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'lib', 'tsc.js'),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsc'),
path.join(workspaceRoot, 'node_modules', previewPlatformName, 'lib', `tsgo${ext}`),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsgo'),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsgo.js'),
];
@@ -229,6 +238,12 @@ async function resolveTsGoPath(): Promise<string | null> {
if (tsGoExtension) {
const extensionPath = tsGoExtension.extensionPath;
const candidates = [
path.join(extensionPath, 'lib', 'tsc'),
path.join(extensionPath, 'lib', 'tsc.exe'),
path.join(extensionPath, 'bin', 'tsc'),
path.join(extensionPath, 'bin', 'tsc.exe'),
path.join(extensionPath, 'tsc'),
path.join(extensionPath, 'tsc.exe'),
path.join(extensionPath, 'bin', 'tsgo'),
path.join(extensionPath, 'bin', 'tsgo.exe'),
path.join(extensionPath, 'lib', 'tsgo'),
+1 -1
View File
@@ -152,7 +152,7 @@
"watch": "pnpm --prefix client run watch & pnpm --prefix server run watch"
},
"dependencies": {
"@typescript/native-preview": "7.0.0-dev.20260707.2",
"@typescript/native-preview": "npm:typescript@7.1.0-dev.20261109.1",
"vscode-languageclient": "^10.1.0",
"vscode-languageserver": "^10.1.0",
"vscode-languageserver-textdocument": "^1.0.12",
@@ -4,7 +4,7 @@
"private": true,
"main": "out/server.js",
"dependencies": {
"@typescript/native-preview": "7.0.0-dev.20260707.2",
"@typescript/native-preview": "npm:typescript@7.1.0-dev.20261109.1",
"vscode-languageserver": "^10.1.0",
"vscode-languageserver-textdocument": "^1.0.12",
"vscode-uri": "^3.1.0"
@@ -8,7 +8,7 @@
import * as fs from 'node:fs/promises';
import {readConfiguration} from '@angular/compiler-cli';
import {API, Snapshot} from '@typescript/native-preview/unstable/async';
import {API, Snapshot} from '@typescript/native-preview/async';
import {HybridCompiler} from '../../../packages/compiler-cli/preprocessor/src/hybrid_compiler.js';
import {NapiAnalyzer} from '../../../packages/compiler-cli/preprocessor/src/analyzer_napi.js';
import {buildTypeCheckingConfig} from '../../../packages/compiler-cli/preprocessor/src/tcb';
@@ -29,7 +29,7 @@ export interface ProjectInstance {
export interface ProjectManagerOptions {
facade: TsGoFacade;
api?: API;
api?: API<true>;
nodeModulesPathOverride?: string;
onLog?: (msg: string) => void;
onError?: (msg: string) => void;
@@ -39,7 +39,7 @@ export class ProjectManager {
private projects = new Map<string, ProjectInstance>();
private pendingProjects = new Map<string, Promise<ProjectInstance | null>>();
private facade: TsGoFacade;
private api?: API;
private api?: API<true>;
private currentSnapshot?: Snapshot;
private nodeModulesPathOverride?: string;
/**
@@ -59,7 +59,7 @@ export class ProjectManager {
this.err = options.onError ?? (() => {});
}
setApi(api: API): void {
setApi(api: API<true>): void {
this.api = api;
this.currentSnapshot = undefined;
}
@@ -228,7 +228,7 @@ export class ProjectManager {
}
}
this.currentSnapshot = await this.api.updateSnapshot();
this.currentSnapshot = await this.api.getCurrentLanguageServerSnapshot();
const defaultProject = await this.currentSnapshot.getDefaultProjectForFile(targetPath);
if (defaultProject?.configFileName && (await pathExists(defaultProject.configFileName))) {
return await normalizePath(defaultProject.configFileName);
@@ -36,7 +36,7 @@ import {HandlerContext} from './handlers/utils';
import * as fs from 'node:fs/promises';
import * as rpc from 'vscode-jsonrpc/node';
import {API} from '@typescript/native-preview/unstable/async';
import {API} from '@typescript/native-preview/async';
import {TsGoFacade} from '../../../packages/compiler-cli/preprocessor/language-service/src/facade';
import {fileURLToPath} from 'node:url';
import {getTcbPath} from '../../../packages/compiler-cli/preprocessor/language-service/src/tcb_ls_util.js';
@@ -141,7 +141,7 @@ connection.onDidChangeWatchedFiles((params: DidChangeWatchedFilesParams) => {
connection.onInitialize(async (params: InitializeParams) => {
connection.console.log(`Initializing Angular Hybrid Language Server`);
let api: API | undefined;
let api: API<true> | undefined;
if (params.initializationOptions?.tsApiPipe) {
try {
api = await API.fromLSPConnection({pipe: params.initializationOptions.tsApiPipe});
@@ -3,7 +3,7 @@
"version": "0.0.1",
"private": true,
"dependencies": {
"@typescript/native-preview": "7.0.0-dev.20260707.2",
"@typescript/native-preview": "npm:typescript@7.1.0-dev.20261109.1",
"vscode-jsonrpc": "^9.0.1",
"vscode-languageserver": "^10.1.0",
"vscode-languageserver-textdocument": "^1.0.12",
@@ -146,26 +146,34 @@ export async function resolveTsGoPath(): Promise<string> {
return process.env['TSGO_BINARY_PATH'];
}
const ext = process.platform === 'win32' ? '.exe' : '';
try {
const req = createRequire(import.meta.url);
const previewPkg = req.resolve('@typescript/native-preview/package.json');
const previewReq = createRequire(previewPkg);
const platformPkgName = `@typescript/native-preview-${process.platform}-${process.arch}`;
const platPkg = previewReq.resolve(`${platformPkgName}/package.json`);
const exe = path.join(
path.dirname(platPkg),
'lib',
`tsgo${process.platform === 'win32' ? '.exe' : ''}`,
);
if (await pathExists(exe)) {
return exe;
const platformTargets = [
{pkg: `@typescript/typescript-${process.platform}-${process.arch}`, bin: `tsc${ext}`},
{pkg: `@typescript/native-preview-${process.platform}-${process.arch}`, bin: `tsgo${ext}`},
];
for (const target of platformTargets) {
try {
const platPkg = previewReq.resolve(`${target.pkg}/package.json`);
const exe = path.join(path.dirname(platPkg), 'lib', target.bin);
if (await pathExists(exe)) {
return exe;
}
} catch {}
}
} catch {}
const workspaceRoot = path.resolve(TESTS_DIR, '../..');
const platformName = `@typescript/native-preview-${process.platform}-${process.arch}`;
const tsPlatformName = `@typescript/typescript-${process.platform}-${process.arch}`;
const previewPlatformName = `@typescript/native-preview-${process.platform}-${process.arch}`;
const localCandidates = [
path.join(workspaceRoot, 'node_modules', platformName, 'lib', 'tsgo'),
path.join(workspaceRoot, 'node_modules', tsPlatformName, 'lib', `tsc${ext}`),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'lib', 'tsc.js'),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsc'),
path.join(workspaceRoot, 'node_modules', previewPlatformName, 'lib', `tsgo${ext}`),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsgo.js'),
path.join(workspaceRoot, 'node_modules', '@typescript', 'native-preview', 'bin', 'tsgo'),
];
@@ -176,12 +184,15 @@ export async function resolveTsGoPath(): Promise<string> {
}
}
throw new Error('Could not find tsgo binary.');
throw new Error('Could not find TypeScript 7 (tsc/tsgo) binary.');
}
export async function startTsgo(workspacePath: string) {
const binaryPath = await resolveTsGoPath();
const isJs = binaryPath.endsWith('.js');
const isJs =
binaryPath.endsWith('.js') ||
binaryPath.endsWith(`${path.sep}bin${path.sep}tsc`) ||
binaryPath.endsWith(`${path.sep}bin${path.sep}tsgo`);
const cmd = isJs ? process.execPath : binaryPath;
const args = isJs ? [binaryPath, '--lsp', '--stdio'] : ['--lsp', '--stdio'];
+42 -42
View File
@@ -1060,8 +1060,8 @@ importers:
ngp-vscode-ng-language-service:
dependencies:
'@typescript/native-preview':
specifier: 7.0.0-dev.20260707.2
version: 7.0.0-dev.20260707.2
specifier: npm:typescript@7.1.0-dev.20261109.1
version: typescript@7.1.0-dev.20261109.1
vscode-jsonrpc:
specifier: ^9.0.1
version: 9.0.3
@@ -1116,8 +1116,8 @@ importers:
ngp-vscode-ng-language-service/server:
dependencies:
'@typescript/native-preview':
specifier: 7.0.0-dev.20260707.2
version: 7.0.0-dev.20260707.2
specifier: npm:typescript@7.1.0-dev.20261109.1
version: typescript@7.1.0-dev.20261109.1
vscode-languageserver:
specifier: ^10.1.0
version: 10.1.2
@@ -1220,8 +1220,8 @@ importers:
packages/compiler-cli/preprocessor/language-service:
dependencies:
'@typescript/native-preview':
specifier: 7.0.0-dev.20260707.2
version: 7.0.0-dev.20260707.2
specifier: npm:typescript@7.1.0-dev.20261109.1
version: typescript@7.1.0-dev.20261109.1
vscode-jsonrpc:
specifier: ^9.0.1
version: 9.0.3
@@ -4985,53 +4985,48 @@ packages:
'@types/[email protected]':
resolution: {integrity: sha512-GD4Fk15UoP5NLCNor51YdfL9MSdldKCqOC9EssrRw3HVfar9wUZ5y8Lfnp+qVD6hIinLr8ygklDYnmlnlQo12Q==}
'@typescript/native-preview-darwin-arm64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-wny2pgKjGbiZtnOIHVa3tXC1UfDqxNEFzyPGmiqybedG8hipG2Nfp0l5UxbaKCjkLacUpH/W5bP2hBOMVhCOzg==}
'@typescript/typescript-darwin-arm64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-k5X3MB7j6U7c1Xs+rSscULDKX+KQzEzJny+mTN92vWgWE8ampF8RRS6uT2BbzlugySYif6FAQbpT7XoLUSKuLg==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [darwin]
'@typescript/native-preview-darwin-x64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-Afc7M5zOwo+GpfcYwz5Z8HMB2tPVsui7nNIqEuuFB73MPdVqNn/Wmpe4tP4MRri0AtJnJknoHBaTJ/VDAp/Jhw==}
'@typescript/typescript-darwin-x64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-8NvwXDDZHunOkNNw96hoQ0ev2LIVSsZdGTUI9W5S5HD6Iwvm4aSqs9V4w1zCtNqCwtZaEiOjURip6PVMLRsF6A==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [darwin]
'@typescript/native-preview-linux-arm64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-iITBa2WjjTI5N9t5l7Z4KoOSI+2zBlhbvFzsD/f8qX8QoKjz/Y4DPyBDgezYi8nkqjjksbgSOJ3/ykzhwrB9cg==}
'@typescript/typescript-linux-arm64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-UVHu4IKa2xc8ggnJdzFwrJCAMj8bcNKG2Ygp69fAuqLWQaORu2PbGsyuBMn0OgNMr00P8FKRL2eRSceTb4HAKw==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [linux]
'@typescript/native-preview-linux-arm@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-hJm/UOqZTr9FHmR7uNm8VGX4oKtfWk0Jem0zPeJFNC8ckGUfSBueyiEYMZB+XmRc1aG4x1E46y3CplP4CLHvGQ==}
'@typescript/typescript-linux-arm@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-NLakeoS9l5pSHrfTIAipq3hrUGRCxfBaGC7kMvgwuwvgGT8jmlLmfCdR+koxlnVIQxlJZXQOIWXKJ/EP4PeaFw==}
engines: {node: '>=16.20.0'}
cpu: [arm]
os: [linux]
'@typescript/native-preview-linux-x64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-du0dzi6y97Po5vDNdPJTyyijHCpaS22JLRnKZEJXBDaO9gCIymOv/5QQokFRuOlQm0bWl3i9PF4OVdGP6uAOQA==}
'@typescript/typescript-linux-x64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-ds2dWbkP603iCvpW3vLuurYJFCKRZBc/swX4w6GYV1irzZrgCZOSfnhifQIQNDZmWAJTmOyXdSP3zoIpHsSK0g==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [linux]
'@typescript/native-preview-win32-arm64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-SsAwfhyHJ1akgBc+99z4+hwdbHsdWaKB8EwCNIMA6JfSLMeUjffrYvxu+vfMyxVtOVOz7RrRXRoiDiu4a2sCtg==}
'@typescript/typescript-win32-arm64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-QlGuYPxAySkNsOWyriI0HficVfAvY53vaCKsvGOBmXnzqB6Cf+vfABRikRJdOHKQ3Fo92U0lg2TtUcB5INiG4g==}
engines: {node: '>=16.20.0'}
cpu: [arm64]
os: [win32]
'@typescript/native-preview-win32-x64@7.0.0-dev.20260707.2':
resolution: {integrity: sha512-DL4u27stv0fo71sVhOzHSwE+YMZsbBijVI+kg5dLDLilSH79WFTJ8RSQ46vJrCMt+Gjlv/JOZP1PuLJDfioYeQ==}
'@typescript/typescript-win32-x64@7.1.0-dev.20261109.1':
resolution: {integrity: sha512-DwVTepbRmBpsPPzEqGn3GBVwtL81M0fIL6RiUSjYRduHWSBNOyErjccMHvXrpeSotlQ3Ik5yYq2R9hVt6HmhGw==}
engines: {node: '>=16.20.0'}
cpu: [x64]
os: [win32]
'@typescript/[email protected]':
resolution: {integrity: sha512-oUGp+Rep/hqMhPunyinsALUwSlzHINSxitifPiSaeqoKOKD2OlR9NE3TaPqwsl4NlGslsOSUXI1JotWQzpYCPg==}
engines: {node: '>=16.20.0'}
hasBin: true
'@typescript/[email protected]':
resolution: {integrity: sha512-gXw0+tpchiQUjTcbnNIPnyLFIhbwJ7M1VaxLQ1vXhjQxtTBK3sdDLY1ih0jxCu1I5K3V0dDxq8CkVZtIMspC3A==}
peerDependencies:
@@ -10909,6 +10904,11 @@ packages:
engines: {node: '>=14.17'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-gWvPmRpUJ1SzahmGN6138gT0aLLK4bMUCC8MoTKJtVdRIJc65f/UuvpZpHGctvD0y/Nu3w3b5gLY9e/7+GSeJw==}
engines: {node: '>=16.20.0'}
hasBin: true
[email protected]:
resolution: {integrity: sha512-O3oYyCMPYgNNHuO7Jjk3uacJWZF8loBgwrfd/5LE/HyZ3lUIOdniQ7DNXJcIgZbwioZxk0fLfI4EVnetdiX5jg==}
hasBin: true
@@ -15436,37 +15436,27 @@ snapshots:
'@types/[email protected]': {}
'@typescript/native-preview-darwin-arm64@7.0.0-dev.20260707.2':
'@typescript/typescript-darwin-arm64@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-darwin-x64@7.0.0-dev.20260707.2':
'@typescript/typescript-darwin-x64@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-linux-arm64@7.0.0-dev.20260707.2':
'@typescript/typescript-linux-arm64@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-linux-arm@7.0.0-dev.20260707.2':
'@typescript/typescript-linux-arm@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-linux-x64@7.0.0-dev.20260707.2':
'@typescript/typescript-linux-x64@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-win32-arm64@7.0.0-dev.20260707.2':
'@typescript/typescript-win32-arm64@7.1.0-dev.20261109.1':
optional: true
'@typescript/native-preview-win32-x64@7.0.0-dev.20260707.2':
'@typescript/typescript-win32-x64@7.1.0-dev.20261109.1':
optional: true
'@typescript/[email protected]':
optionalDependencies:
'@typescript/native-preview-darwin-arm64': 7.0.0-dev.20260707.2
'@typescript/native-preview-darwin-x64': 7.0.0-dev.20260707.2
'@typescript/native-preview-linux-arm': 7.0.0-dev.20260707.2
'@typescript/native-preview-linux-arm64': 7.0.0-dev.20260707.2
'@typescript/native-preview-linux-x64': 7.0.0-dev.20260707.2
'@typescript/native-preview-win32-arm64': 7.0.0-dev.20260707.2
'@typescript/native-preview-win32-x64': 7.0.0-dev.20260707.2
'@typescript/[email protected]([email protected])([email protected])':
dependencies:
debug: 4.4.3([email protected])
@@ -22353,6 +22343,16 @@ snapshots:
[email protected]: {}
[email protected]:
optionalDependencies:
'@typescript/typescript-darwin-arm64': 7.1.0-dev.20261109.1
'@typescript/typescript-darwin-x64': 7.1.0-dev.20261109.1
'@typescript/typescript-linux-arm': 7.1.0-dev.20261109.1
'@typescript/typescript-linux-arm64': 7.1.0-dev.20261109.1
'@typescript/typescript-linux-x64': 7.1.0-dev.20261109.1
'@typescript/typescript-win32-arm64': 7.1.0-dev.20261109.1
'@typescript/typescript-win32-x64': 7.1.0-dev.20261109.1
[email protected]: {}
[email protected]: