Skip to content

Update dependencies to latest compatible versions #56561

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

Merged
merged 24 commits into from
Jan 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .dprint.jsonc
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
],
// Note: if adding new languages, make sure settings.template.json is updated too.
"plugins": [
"https://plugins.dprint.dev/typescript-0.88.8.wasm",
"https://plugins.dprint.dev/typescript-0.88.9.wasm",
"https://plugins.dprint.dev/json-0.19.1.wasm",
"https://plugins.dprint.dev/prettier-0.32.1.json@19aa403ef0862ba8c41164e3dc6f84c0b7a66c2b11e42726b23dd25e6302ada9"
"https://plugins.dprint.dev/prettier-0.35.0.json@0df49c4d878bb1051af2fa1d1f69ba6400f4b78633f49baa1f38954a6fd32b40"
]
}
File renamed without changes.
7 changes: 3 additions & 4 deletions Herebyfile.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,13 @@ import {
EventEmitter,
} from "events";
import fs from "fs";
import _glob from "glob";
import {
glob,
} from "glob";
import {
task,
} from "hereby";
import path from "path";
import util from "util";

import {
localizationDirectories,
Expand All @@ -41,8 +42,6 @@ import {
rimraf,
} from "./scripts/build/utils.mjs";

const glob = util.promisify(_glob);

/** @typedef {ReturnType<typeof task>} Task */
void 0;

Expand Down
1,430 changes: 993 additions & 437 deletions package-lock.json

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,46 +40,46 @@
],
"devDependencies": {
"@esfx/canceltoken": "^1.0.0",
"@octokit/rest": "^19.0.13",
"@types/chai": "^4.3.4",
"@octokit/rest": "^20.0.2",
"@types/chai": "^4.3.11",
"@types/glob": "^8.1.0",
"@types/microsoft__typescript-etw": "^0.1.1",
"@types/minimist": "^1.2.2",
"@types/mocha": "^10.0.1",
"@types/ms": "^0.7.31",
"@types/microsoft__typescript-etw": "^0.1.3",
"@types/minimist": "^1.2.5",
"@types/mocha": "^10.0.6",
"@types/ms": "^0.7.34",
"@types/node": "latest",
"@types/source-map-support": "^0.5.6",
"@types/which": "^2.0.1",
"@typescript-eslint/eslint-plugin": "^6.0.0",
"@typescript-eslint/parser": "^6.0.0",
"@typescript-eslint/utils": "^6.0.0",
"azure-devops-node-api": "^12.0.0",
"c8": "^7.14.0",
"chai": "^4.3.7",
"@types/source-map-support": "^0.5.10",
"@types/which": "^3.0.3",
"@typescript-eslint/eslint-plugin": "^6.19.0",
"@typescript-eslint/parser": "^6.19.0",
"@typescript-eslint/utils": "^6.19.0",
"azure-devops-node-api": "^12.3.0",
"c8": "^9.1.0",
"chai": "^4.4.1",
"chalk": "^4.1.2",
"chokidar": "^3.5.3",
"diff": "^5.1.0",
"dprint": "^0.45.0",
"esbuild": "^0.19.0",
"eslint": "^8.22.0",
"eslint-formatter-autolinkable-stylish": "^1.2.0",
"eslint-plugin-local": "^1.0.0",
"esbuild": "^0.19.11",
"eslint": "^8.56.0",
"eslint-formatter-autolinkable-stylish": "^1.3.0",
"eslint-plugin-local": "^3.1.0",
"eslint-plugin-no-null": "^1.0.2",
"eslint-plugin-simple-import-sort": "^10.0.0",
"fast-xml-parser": "^4.0.11",
"glob": "^8.1.0",
"hereby": "^1.6.4",
"fast-xml-parser": "^4.3.3",
"glob": "^10.3.10",
"hereby": "^1.8.9",
"jsonc-parser": "^3.2.0",
"minimist": "^1.2.8",
"mocha": "^10.2.0",
"mocha-fivemat-progress-reporter": "^0.1.0",
"ms": "^2.1.3",
"node-fetch": "^3.2.10",
"playwright": "^1.38.0",
"node-fetch": "^3.3.2",
"playwright": "^1.41.0",
"source-map-support": "^0.5.21",
"tslib": "^2.5.0",
"typescript": "5.4.0-dev.20231206",
"which": "^2.0.2"
"tslib": "^2.6.2",
"typescript": "5.4.0-dev.20240119",
"which": "^3.0.1"
},
"overrides": {
"typescript@*": "$typescript"
Expand Down
50 changes: 11 additions & 39 deletions scripts/dtsBundler.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,6 @@ console.log(`Bundling ${entrypoint} to ${output} and ${internalOutput}`);
const newLineKind = ts.NewLineKind.LineFeed;
const newLine = newLineKind === ts.NewLineKind.LineFeed ? "\n" : "\r\n";

/** @type {(node: ts.Node) => node is ts.DeclarationStatement} */
function isDeclarationStatement(node) {
return /** @type {any} */ (ts).isDeclarationStatement(node);
}

/** @type {(node: ts.Node) => boolean} */
function isInternalDeclaration(node) {
return /** @type {any} */ (ts).isInternalDeclaration(node, node.getSourceFile());
}

/**
* @param {ts.VariableDeclaration} node
* @returns {ts.VariableStatement}
Expand All @@ -71,15 +61,12 @@ function getDeclarationStatement(node) {
if (ts.isVariableDeclaration(node)) {
return getParentVariableStatement(node);
}
else if (isDeclarationStatement(node)) {
else if (ts.isDeclarationStatement(node)) {
return node;
}
return undefined;
}

/** @type {ts.TransformationContext} */
const nullTransformationContext = /** @type {any} */ (ts).nullTransformationContext;

const program = ts.createProgram([entrypoint], { target: ts.ScriptTarget.ES5 });

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

for (const decl of symbol.declarations) {
const statement = getDeclarationStatement(decl);
if (statement && !isInternalDeclaration(statement)) {
if (statement && !ts.isInternalDeclaration(statement)) {
return true;
}
}
Expand Down Expand Up @@ -262,27 +249,20 @@ function isNonLocalAlias(symbol, excludes = ts.SymbolFlags.Value | ts.SymbolFlag
return (symbol.flags & (ts.SymbolFlags.Alias | excludes)) === ts.SymbolFlags.Alias || !!(symbol.flags & ts.SymbolFlags.Alias && symbol.flags & ts.SymbolFlags.Assignment);
}

/**
* @param {ts.Symbol} symbol
*/
function resolveAlias(symbol) {
return typeChecker.getAliasedSymbol(symbol);
}

/**
* @param {ts.Symbol} symbol
* @param {boolean | undefined} [dontResolveAlias]
*/
function resolveSymbol(symbol, dontResolveAlias = undefined) {
return !dontResolveAlias && isNonLocalAlias(symbol) ? resolveAlias(symbol) : symbol;
return !dontResolveAlias && isNonLocalAlias(symbol) ? typeChecker.getAliasedSymbol(symbol) : symbol;
}

/**
* @param {ts.Symbol} symbol
* @returns {ts.Symbol}
*/
function getMergedSymbol(symbol) {
return /** @type {any} */ (typeChecker).getMergedSymbol(symbol);
return typeChecker.getMergedSymbol(symbol);
}

/**
Expand All @@ -308,20 +288,12 @@ function symbolsConflict(s1, s2) {
return true;
}

/**
* @param {ts.Node} node
* @returns {boolean}
*/
function isPartOfTypeNode(node) {
return /** @type {any} */ (ts).isPartOfTypeNode(node);
}

/**
* @param {ts.Statement} decl
*/
function verifyMatchingSymbols(decl) {
ts.visitEachChild(decl, /** @type {(node: ts.Node) => ts.Node} */ function visit(node) {
if (ts.isIdentifier(node) && isPartOfTypeNode(node)) {
if (ts.isIdentifier(node) && ts.isPartOfTypeNode(node)) {
if (ts.isQualifiedName(node.parent) && node !== node.parent.left) {
return node;
}
Expand All @@ -347,8 +319,8 @@ function verifyMatchingSymbols(decl) {
}
}

return ts.visitEachChild(node, visit, nullTransformationContext);
}, nullTransformationContext);
return ts.visitEachChild(node, visit, /*context*/ undefined);
}, /*context*/ undefined);
}

/**
Expand Down Expand Up @@ -397,20 +369,20 @@ function emitAsNamespace(name, moduleSymbol) {

verifyMatchingSymbols(statement);

const isInternal = isInternalDeclaration(statement);
const isInternal = ts.isInternalDeclaration(statement);
if (!isInternal) {
const publicStatement = ts.visitEachChild(statement, node => {
// No @internal comments in the public API.
if (isInternalDeclaration(node)) {
if (ts.isInternalDeclaration(node)) {
return undefined;
}
return removeDeclareConstExport(node);
}, nullTransformationContext);
}, /*context*/ undefined);

writeNode(publicStatement, sourceFile, WriteTarget.Public);
}

const internalStatement = ts.visitEachChild(statement, removeDeclareConstExport, nullTransformationContext);
const internalStatement = ts.visitEachChild(statement, removeDeclareConstExport, /*context*/ undefined);

writeNode(internalStatement, sourceFile, WriteTarget.Internal);
}
Expand Down
7 changes: 3 additions & 4 deletions scripts/errorCheck.mjs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import fs from "fs";
import fsPromises from "fs/promises";
import _glob from "glob";
import util from "util";

const glob = util.promisify(_glob);
import {
glob,
} from "glob";

async function checkErrorBaselines() {
const data = await fsPromises.readFile("src/compiler/diagnosticMessages.json", "utf-8");
Expand Down
4 changes: 3 additions & 1 deletion scripts/produceLKG.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import fs from "fs";
import glob from "glob";
import {
glob,
} from "glob";
import path from "path";
import url from "url";

Expand Down
2 changes: 1 addition & 1 deletion src/cancellationToken/cancellationToken.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function createCancellationToken(args: string[]): ServerCancellationToken {
}
else {
return {
isCancellationRequested: () => pipeExists(cancellationPipeName!), // TODO: GH#18217
isCancellationRequested: () => pipeExists(cancellationPipeName),
setRequest: (_requestId: number): void => void 0,
resetRequest: (_requestId: number): void => void 0,
};
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3566,7 +3566,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
(meaning & SymbolFlags.BlockScopedVariable ||
((meaning & SymbolFlags.Class || meaning & SymbolFlags.Enum) && (meaning & SymbolFlags.Value) === SymbolFlags.Value))
) {
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result!);
const exportOrLocalSymbol = getExportSymbolOfValueSymbolIfExported(result);
if (exportOrLocalSymbol.flags & SymbolFlags.BlockScopedVariable || exportOrLocalSymbol.flags & SymbolFlags.Class || exportOrLocalSymbol.flags & SymbolFlags.Enum) {
checkResolvedBlockScopedVariable(exportOrLocalSymbol, errorLocation);
}
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/moduleNameResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ function createModuleOrTypeReferenceResolutionCache<T>(
...nonRelativeNameResolutionCache,
clear,
update,
getPackageJsonInfoCache: () => packageJsonInfoCache!,
getPackageJsonInfoCache: () => packageJsonInfoCache,
clearAllExceptPackageJsonInfoCache,
optionsToRedirectsKey,
};
Expand Down
6 changes: 3 additions & 3 deletions src/compiler/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2547,7 +2547,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
const resolutionsChanged = hasChangesInResolutions(
moduleNames,
resolutions,
name => oldProgram!.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation(newSourceFile, name)),
name => oldProgram.getResolvedModule(newSourceFile, name.text, getModeForUsageLocation(newSourceFile, name)),
moduleResolutionIsEqualTo,
);
if (resolutionsChanged) structureIsReused = StructureIsReused.SafeModules;
Expand All @@ -2558,7 +2558,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
const typeReferenceResolutionsChanged = hasChangesInResolutions(
typesReferenceDirectives,
typeReferenceResolutions,
name => oldProgram!.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)),
name => oldProgram.getResolvedTypeReferenceDirective(newSourceFile, getTypeReferenceResolutionName(name), getModeForFileReference(name, newSourceFile.impliedNodeFormat)),
typeDirectiveIsEqualTo,
);
if (typeReferenceResolutionsChanged) structureIsReused = StructureIsReused.SafeModules;
Expand Down Expand Up @@ -2601,7 +2601,7 @@ export function createProgram(rootNamesOrOptions: readonly string[] | CreateProg
}
if (oldFile.path === path) {
// Set the file as found during node modules search if it was found that way in old progra,
if (oldProgram!.isSourceFileFromExternalLibrary(oldFile)) {
if (oldProgram.isSourceFileFromExternalLibrary(oldFile)) {
sourceFilesFoundSearchingNodeModules.set(oldFile.path, true);
}
return;
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/utilitiesPublic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2641,6 +2641,6 @@ export function isInternalDeclaration(node: Node, sourceFile?: SourceFile) {
}
const leadingCommentRanges = parseTreeNode && getLeadingCommentRangesOfNode(parseTreeNode, sourceFile);
return !!forEach(leadingCommentRanges, range => {
return hasInternalAnnotation(range, sourceFile!);
return hasInternalAnnotation(range, sourceFile);
});
}
8 changes: 4 additions & 4 deletions src/server/editorServices.ts
Original file line number Diff line number Diff line change
Expand Up @@ -953,12 +953,12 @@ function createWatchFactoryHostUsingWatchEvents(service: ProjectService, canUseW
callbacks.add(callback);
return {
close() {
const callbacks = idToCallbacks.get(id!);
const callbacks = idToCallbacks.get(id);
if (!callbacks?.delete(callback)) return;
if (callbacks.size) return;
idToCallbacks.delete(id!);
idToCallbacks.delete(id);
pathToId.delete(key);
service.eventHandler!({ eventName: CloseFileWatcherEvent, data: { id: id! } });
service.eventHandler!({ eventName: CloseFileWatcherEvent, data: { id } });
},
};
}
Expand Down Expand Up @@ -3899,7 +3899,7 @@ export class ProjectService {
for (const project of arrayFrom(this.configuredProjects.values())) {
// If this project has potential project reference for any of the project we are loading ancestor tree for
// load this project first
if (forEachPotentialProjectReference(project, potentialRefPath => forProjects!.has(potentialRefPath))) {
if (forEachPotentialProjectReference(project, potentialRefPath => forProjects.has(potentialRefPath))) {
updateProjectIfDirty(project);
}
this.ensureProjectChildren(project, forProjects, seenProjects);
Expand Down
2 changes: 1 addition & 1 deletion src/services/findAllReferences.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2390,7 +2390,7 @@ export namespace Core {
// If we have a 'super' container, we must have an enclosing class.
// Now make sure the owning class is the same as the search-space
// and has the same static qualifier as the original 'super's owner.
return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode!.symbol ? nodeEntry(node) : undefined;
return container && isStatic(container) === !!staticFlag && container.parent.symbol === searchSpaceNode.symbol ? nodeEntry(node) : undefined;
});

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