Skip to content

Commit 1982349

Browse files
Update dependencies to latest compatible versions (#56561)
Co-authored-by: Ryan Cavanaugh <[email protected]>
1 parent 9ba8c7a commit 1982349

15 files changed

+1053
-525
lines changed

.dprint.jsonc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@
5656
],
5757
// Note: if adding new languages, make sure settings.template.json is updated too.
5858
"plugins": [
59-
"https://plugins.dprint.dev/typescript-0.88.8.wasm",
59+
"https://plugins.dprint.dev/typescript-0.88.9.wasm",
6060
"https://plugins.dprint.dev/json-0.19.1.wasm",
61-
"https://plugins.dprint.dev/prettier-0.32.1.json@19aa403ef0862ba8c41164e3dc6f84c0b7a66c2b11e42726b23dd25e6302ada9"
61+
"https://plugins.dprint.dev/prettier-0.35.0.json@0df49c4d878bb1051af2fa1d1f69ba6400f4b78633f49baa1f38954a6fd32b40"
6262
]
6363
}
File renamed without changes.

Herebyfile.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ import {
99
EventEmitter,
1010
} from "events";
1111
import fs from "fs";
12-
import _glob from "glob";
12+
import {
13+
glob,
14+
} from "glob";
1315
import {
1416
task,
1517
} from "hereby";
1618
import path from "path";
17-
import util from "util";
1819

1920
import {
2021
localizationDirectories,
@@ -41,8 +42,6 @@ import {
4142
rimraf,
4243
} from "./scripts/build/utils.mjs";
4344

44-
const glob = util.promisify(_glob);
45-
4645
/** @typedef {ReturnType<typeof task>} Task */
4746
void 0;
4847

package-lock.json

Lines changed: 993 additions & 437 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -40,46 +40,46 @@
4040
],
4141
"devDependencies": {
4242
"@esfx/canceltoken": "^1.0.0",
43-
"@octokit/rest": "^19.0.13",
44-
"@types/chai": "^4.3.4",
43+
"@octokit/rest": "^20.0.2",
44+
"@types/chai": "^4.3.11",
4545
"@types/glob": "^8.1.0",
46-
"@types/microsoft__typescript-etw": "^0.1.1",
47-
"@types/minimist": "^1.2.2",
48-
"@types/mocha": "^10.0.1",
49-
"@types/ms": "^0.7.31",
46+
"@types/microsoft__typescript-etw": "^0.1.3",
47+
"@types/minimist": "^1.2.5",
48+
"@types/mocha": "^10.0.6",
49+
"@types/ms": "^0.7.34",
5050
"@types/node": "latest",
51-
"@types/source-map-support": "^0.5.6",
52-
"@types/which": "^2.0.1",
53-
"@typescript-eslint/eslint-plugin": "^6.0.0",
54-
"@typescript-eslint/parser": "^6.0.0",
55-
"@typescript-eslint/utils": "^6.0.0",
56-
"azure-devops-node-api": "^12.0.0",
57-
"c8": "^7.14.0",
58-
"chai": "^4.3.7",
51+
"@types/source-map-support": "^0.5.10",
52+
"@types/which": "^3.0.3",
53+
"@typescript-eslint/eslint-plugin": "^6.19.0",
54+
"@typescript-eslint/parser": "^6.19.0",
55+
"@typescript-eslint/utils": "^6.19.0",
56+
"azure-devops-node-api": "^12.3.0",
57+
"c8": "^9.1.0",
58+
"chai": "^4.4.1",
5959
"chalk": "^4.1.2",
6060
"chokidar": "^3.5.3",
6161
"diff": "^5.1.0",
6262
"dprint": "^0.45.0",
63-
"esbuild": "^0.19.0",
64-
"eslint": "^8.22.0",
65-
"eslint-formatter-autolinkable-stylish": "^1.2.0",
66-
"eslint-plugin-local": "^1.0.0",
63+
"esbuild": "^0.19.11",
64+
"eslint": "^8.56.0",
65+
"eslint-formatter-autolinkable-stylish": "^1.3.0",
66+
"eslint-plugin-local": "^3.1.0",
6767
"eslint-plugin-no-null": "^1.0.2",
6868
"eslint-plugin-simple-import-sort": "^10.0.0",
69-
"fast-xml-parser": "^4.0.11",
70-
"glob": "^8.1.0",
71-
"hereby": "^1.6.4",
69+
"fast-xml-parser": "^4.3.3",
70+
"glob": "^10.3.10",
71+
"hereby": "^1.8.9",
7272
"jsonc-parser": "^3.2.0",
7373
"minimist": "^1.2.8",
7474
"mocha": "^10.2.0",
7575
"mocha-fivemat-progress-reporter": "^0.1.0",
7676
"ms": "^2.1.3",
77-
"node-fetch": "^3.2.10",
78-
"playwright": "^1.38.0",
77+
"node-fetch": "^3.3.2",
78+
"playwright": "^1.41.0",
7979
"source-map-support": "^0.5.21",
80-
"tslib": "^2.5.0",
81-
"typescript": "5.4.0-dev.20231206",
82-
"which": "^2.0.2"
80+
"tslib": "^2.6.2",
81+
"typescript": "5.4.0-dev.20240119",
82+
"which": "^3.0.1"
8383
},
8484
"overrides": {
8585
"typescript@*": "$typescript"

scripts/dtsBundler.mjs

Lines changed: 11 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -40,16 +40,6 @@ console.log(`Bundling ${entrypoint} to ${output} and ${internalOutput}`);
4040
const newLineKind = ts.NewLineKind.LineFeed;
4141
const newLine = newLineKind === ts.NewLineKind.LineFeed ? "\n" : "\r\n";
4242

43-
/** @type {(node: ts.Node) => node is ts.DeclarationStatement} */
44-
function isDeclarationStatement(node) {
45-
return /** @type {any} */ (ts).isDeclarationStatement(node);
46-
}
47-
48-
/** @type {(node: ts.Node) => boolean} */
49-
function isInternalDeclaration(node) {
50-
return /** @type {any} */ (ts).isInternalDeclaration(node, node.getSourceFile());
51-
}
52-
5343
/**
5444
* @param {ts.VariableDeclaration} node
5545
* @returns {ts.VariableStatement}
@@ -71,15 +61,12 @@ function getDeclarationStatement(node) {
7161
if (ts.isVariableDeclaration(node)) {
7262
return getParentVariableStatement(node);
7363
}
74-
else if (isDeclarationStatement(node)) {
64+
else if (ts.isDeclarationStatement(node)) {
7565
return node;
7666
}
7767
return undefined;
7868
}
7969

80-
/** @type {ts.TransformationContext} */
81-
const nullTransformationContext = /** @type {any} */ (ts).nullTransformationContext;
82-
8370
const program = ts.createProgram([entrypoint], { target: ts.ScriptTarget.ES5 });
8471

8572
const typeChecker = program.getTypeChecker();
@@ -207,7 +194,7 @@ function containsPublicAPI(symbol) {
207194

208195
for (const decl of symbol.declarations) {
209196
const statement = getDeclarationStatement(decl);
210-
if (statement && !isInternalDeclaration(statement)) {
197+
if (statement && !ts.isInternalDeclaration(statement)) {
211198
return true;
212199
}
213200
}
@@ -262,27 +249,20 @@ function isNonLocalAlias(symbol, excludes = ts.SymbolFlags.Value | ts.SymbolFlag
262249
return (symbol.flags & (ts.SymbolFlags.Alias | excludes)) === ts.SymbolFlags.Alias || !!(symbol.flags & ts.SymbolFlags.Alias && symbol.flags & ts.SymbolFlags.Assignment);
263250
}
264251

265-
/**
266-
* @param {ts.Symbol} symbol
267-
*/
268-
function resolveAlias(symbol) {
269-
return typeChecker.getAliasedSymbol(symbol);
270-
}
271-
272252
/**
273253
* @param {ts.Symbol} symbol
274254
* @param {boolean | undefined} [dontResolveAlias]
275255
*/
276256
function resolveSymbol(symbol, dontResolveAlias = undefined) {
277-
return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol;
257+
return !dontResolveAlias && isNonLocalAlias(symbol) ? typeChecker.getAliasedSymbol(symbol) : symbol;
278258
}
279259

280260
/**
281261
* @param {ts.Symbol} symbol
282262
* @returns {ts.Symbol}
283263
*/
284264
function getMergedSymbol(symbol) {
285-
return /** @type {any} */ (typeChecker).getMergedSymbol(symbol);
265+
return typeChecker.getMergedSymbol(symbol);
286266
}
287267

288268
/**
@@ -308,20 +288,12 @@ function symbolsConflict(s1, s2) {
308288
return true;
309289
}
310290

311-
/**
312-
* @param {ts.Node} node
313-
* @returns {boolean}
314-
*/
315-
function isPartOfTypeNode(node) {
316-
return /** @type {any} */ (ts).isPartOfTypeNode(node);
317-
}
318-
319291
/**
320292
* @param {ts.Statement} decl
321293
*/
322294
function verifyMatchingSymbols(decl) {
323295
ts.visitEachChild(decl, /** @type {(node: ts.Node) => ts.Node} */ function visit(node) {
324-
if (ts.isIdentifier(node) && isPartOfTypeNode(node)) {
296+
if (ts.isIdentifier(node) && ts.isPartOfTypeNode(node)) {
325297
if (ts.isQualifiedName(node.parent) && node !== node.parent.left) {
326298
return node;
327299
}
@@ -347,8 +319,8 @@ function verifyMatchingSymbols(decl) {
347319
}
348320
}
349321

350-
return ts.visitEachChild(node, visit, nullTransformationContext);
351-
}, nullTransformationContext);
322+
return ts.visitEachChild(node, visit, /*context*/ undefined);
323+
}, /*context*/ undefined);
352324
}
353325

354326
/**
@@ -397,20 +369,20 @@ function emitAsNamespace(name, moduleSymbol) {
397369

398370
verifyMatchingSymbols(statement);
399371

400-
const isInternal = isInternalDeclaration(statement);
372+
const isInternal = ts.isInternalDeclaration(statement);
401373
if (!isInternal) {
402374
const publicStatement = ts.visitEachChild(statement, node => {
403375
// No @internal comments in the public API.
404-
if (isInternalDeclaration(node)) {
376+
if (ts.isInternalDeclaration(node)) {
405377
return undefined;
406378
}
407379
return removeDeclareConstExport(node);
408-
}, nullTransformationContext);
380+
}, /*context*/ undefined);
409381

410382
writeNode(publicStatement, sourceFile, WriteTarget.Public);
411383
}
412384

413-
const internalStatement = ts.visitEachChild(statement, removeDeclareConstExport, nullTransformationContext);
385+
const internalStatement = ts.visitEachChild(statement, removeDeclareConstExport, /*context*/ undefined);
414386

415387
writeNode(internalStatement, sourceFile, WriteTarget.Internal);
416388
}

scripts/errorCheck.mjs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import fs from "fs";
22
import fsPromises from "fs/promises";
3-
import _glob from "glob";
4-
import util from "util";
5-
6-
const glob = util.promisify(_glob);
3+
import {
4+
glob,
5+
} from "glob";
76

87
async function checkErrorBaselines() {
98
const data = await fsPromises.readFile("src/compiler/diagnosticMessages.json", "utf-8");

scripts/produceLKG.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import fs from "fs";
2-
import glob from "glob";
2+
import {
3+
glob,
4+
} from "glob";
35
import path from "path";
46
import url from "url";
57

src/cancellationToken/cancellationToken.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
6060
}
6161
else {
6262
return {
63-
isCancellationRequested: () => pipeExists(cancellationPipeName!), // TODO: GH#18217
63+
isCancellationRequested: () => pipeExists(cancellationPipeName),
6464
setRequest: (_requestId: number): void => void 0,
6565
resetRequest: (_requestId: number): void => void 0,
6666
};

src/compiler/checker.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3566,7 +3566,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
35663566
(meaning & SymbolFlags.BlockScopedVariable ||
35673567
((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value))
35683568
) {
3569-
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result!);
3569+
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
35703570
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
35713571
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
35723572
}

src/compiler/moduleNameResolver.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1294,7 +1294,7 @@ function createModuleOrTypeReferenceResolutionCache<T>(
12941294
...nonRelativeNameResolutionCache,
12951295
clear,
12961296
update,
1297-
getPackageJsonInfoCache: () => packageJsonInfoCache!,
1297+
getPackageJsonInfoCache: () => packageJsonInfoCache,
12981298
clearAllExceptPackageJsonInfoCache,
12991299
optionsToRedirectsKey,
13001300
};

src/compiler/program.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2547,7 +2547,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
25472547
const resolutionsChanged = hasChangesInResolutions(
25482548
moduleNames,
25492549
resolutions,
2550-
name => oldProgram!.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation(newSourceFile, name)),
2550+
name => oldProgram.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation(newSourceFile, name)),
25512551
moduleResolutionIsEqualTo,
25522552
);
25532553
if (resolutionsChanged) structureIsReused = StructureIsReused.SafeModules;
@@ -2558,7 +2558,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
25582558
const typeReferenceResolutionsChanged = hasChangesInResolutions(
25592559
typesReferenceDirectives,
25602560
typeReferenceResolutions,
2561-
name => oldProgram!.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)),
2561+
name => oldProgram.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)),
25622562
typeDirectiveIsEqualTo,
25632563
);
25642564
if (typeReferenceResolutionsChanged) structureIsReused = StructureIsReused.SafeModules;
@@ -2601,7 +2601,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
26012601
}
26022602
if (oldFile.path === path) {
26032603
// Set the file as found during node modules search if it was found that way in old progra,
2604-
if (oldProgram!.isSourceFileFromExternalLibrary(oldFile)) {
2604+
if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) {
26052605
sourceFilesFoundSearchingNodeModules.set(oldFile.path, true);
26062606
}
26072607
return;

src/compiler/utilitiesPublic.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2641,6 +2641,6 @@ export function isInternalDeclaration(node: Node, sourceFile?: SourceFile) {
26412641
}
26422642
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
26432643
return !!forEach(leadingCommentRanges, range => {
2644-
return hasInternalAnnotation(range, sourceFile!);
2644+
return hasInternalAnnotation(range, sourceFile);
26452645
});
26462646
}

src/server/editorServices.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -953,12 +953,12 @@ function createWatchFactoryHostUsingWatchEvents(service: ProjectService, canUseW
953953
callbacks.add(callback);
954954
return {
955955
close() {
956-
const callbacks = idToCallbacks.get(id!);
956+
const callbacks = idToCallbacks.get(id);
957957
if (!callbacks?.delete(callback)) return;
958958
if (callbacks.size) return;
959-
idToCallbacks.delete(id!);
959+
idToCallbacks.delete(id);
960960
pathToId.delete(key);
961-
service.eventHandler!({ eventName: CloseFileWatcherEvent, data: { id: id! } });
961+
service.eventHandler!({ eventName: CloseFileWatcherEvent, data: { id } });
962962
},
963963
};
964964
}
@@ -3899,7 +3899,7 @@ export class ProjectService {
38993899
for (const project of arrayFrom(this.configuredProjects.values())) {
39003900
// If this project has potential project reference for any of the project we are loading ancestor tree for
39013901
// load this project first
3902-
if (forEachPotentialProjectReference(project, potentialRefPath => forProjects!.has(potentialRefPath))) {
3902+
if (forEachPotentialProjectReference(project, potentialRefPath => forProjects.has(potentialRefPath))) {
39033903
updateProjectIfDirty(project);
39043904
}
39053905
this.ensureProjectChildren(project, forProjects, seenProjects);

src/services/findAllReferences.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2390,7 +2390,7 @@ export namespace Core {
23902390
// If we have a 'super' container, we must have an enclosing class.
23912391
// Now make sure the owning class is the same as the search-space
23922392
// and has the same static qualifier as the original 'super's owner.
2393-
return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode!.symbol ? nodeEntry(node) : undefined;
2393+
return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : undefined;
23942394
});
23952395

23962396
return [{ definition: { type: DefinitionKind.Symbol, symbol: searchSpaceNode.symbol }, references }];

0 commit comments

Comments
 (0)