diff --git a/.custom-gcl.yml b/.custom-gcl.yml index be8e70810f821..12d992a5a0deb 100644 --- a/.custom-gcl.yml +++ b/.custom-gcl.yml @@ -1,6 +1,6 @@ # yaml-language-server: $schema=https://golangci-lint.run/jsonschema/custom-gcl.jsonschema.json -version: v2.13.2 +version: v2.14.0 destination: ./tools diff --git a/.dprint.jsonc b/.dprint.jsonc index 3d1c246824cb3..b2bde51235de3 100644 --- a/.dprint.jsonc +++ b/.dprint.jsonc @@ -6,7 +6,7 @@ "useTabs": false, "typescript": { "newLineKind": "lf", - "semiColons": "always", + "semicolons": "always", "quoteStyle": "preferDouble", "quoteProps": "consistent", "useBraces": "whenNotSingleLine", diff --git a/Herebyfile.mjs b/Herebyfile.mjs index 4fd9348279da3..176c30f2d2893 100644 --- a/Herebyfile.mjs +++ b/Herebyfile.mjs @@ -510,8 +510,9 @@ export const generateTristate = goGenerateTask("generate:tristate", [ stringerGenerator("tsc/internal/core/tristate.go", "Tristate", "tristate_stringer_generated.go"), ]); -export const generateDiagnostics = goGenerateTask("generate:diagnostics", [ - { +export const generateDiagnostics = goGenerateTask( + "generate:diagnostics", + [{ file: "tsc/internal/diagnostics/diagnostics.go", inputs: ["generate.go", "diagnosticMessages.json", "../../../tools/LocProject.json", "../{collections,json}/*.go", "loc/*.generated.json"], exclude: ["**/*_test.go"], @@ -534,9 +535,9 @@ export const generateDiagnostics = goGenerateTask("generate:diagnostics", [ ], ["dprint", "fmt", "diagnostics_generated.go", "loc_generated.go"], ], - }, - stringerGenerator("tsc/internal/diagnostics/diagnostics.go", "Category", "stringer_generated.go"), -], ["tsc/internal/diagnostics/loc"]); + }, stringerGenerator("tsc/internal/diagnostics/diagnostics.go", "Category", "stringer_generated.go")], + ["tsc/internal/diagnostics/loc"], +); export const generateAutoImport = goGenerateTask("generate:autoimport", [ stringerGenerator("tsc/internal/ls/autoimport/export.go", "ExportSyntax", "export_stringer_generated.go"), @@ -2119,15 +2120,13 @@ async function sign(filelist, unchangedOutputOkay = false) { const tmp = await getSignTempDir(); const propsPath = path.resolve(tmp, `signing-items-${signCount++}.props`); const signingItems = signingFilelist.SignFileRecordList.flatMap(record => record.SignFileList.map(file => ({ path: file.SrcPath, cert: record.Certs, macAppName: record.MacAppName }))); - const items = signingItems.map(({ path: filePath, cert, macAppName }) => - ` + const items = signingItems.map(({ path: filePath, cert, macAppName }) => ` ${assertMsbuildXmlValue(cert)} None${ - macAppName ? ` + macAppName ? ` ${assertMsbuildXmlValue(macAppName)}` : "" - } - ` - ).join("\n"); + } + `).join("\n"); await fs.promises.writeFile( propsPath, ` diff --git a/package-lock.json b/package-lock.json index e695517383412..e084f360fc487 100644 --- a/package-lock.json +++ b/package-lock.json @@ -12,8 +12,8 @@ "packages/*" ], "devDependencies": { - "@dprint/json": "^0.25.2", - "@dprint/typescript": "^0.96.1", + "@dprint/json": "^0.26.0", + "@dprint/typescript": "^0.101.0", "@jakebailey/dprint-plugin-gofumpt": "^0.0.20", "@types/node": "^22.20.5", "@unicode/unicode-15.1.0": "^2.1.0", @@ -23,7 +23,7 @@ "dprint": "^0.64.3", "dprint-plugin-yaml": "^0.6.0", "hereby": "^1.15.2", - "tar": "^7.5.22", + "tar": "^7.5.23", "tinyexec": "^1.3.1", "typescript": "^6.0.3" }, @@ -60,9 +60,9 @@ } }, "node_modules/@azure/core-client": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.1.tgz", - "integrity": "sha512-2QygG2F76ZpMP2eMztiJvAiFMu71M9rDeU7vO/QKg5Css7MgM4frUOslFjhVjRhbGaCNPtz/S8M6y46/fFKVuQ==", + "version": "1.11.2", + "resolved": "https://registry.npmjs.org/@azure/core-client/-/core-client-1.11.2.tgz", + "integrity": "sha512-ajuIU1aMoTs/ERYrKnIqQrV5Vz3RL8mwDC5RdedIXUvR7pi6cWzeYmt0LfNz6+W91CuCO4WJG0zA6+PhU1X+hw==", "dev": true, "license": "MIT", "dependencies": { @@ -89,9 +89,9 @@ } }, "node_modules/@azure/core-rest-pipeline": { - "version": "1.25.0", - "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.0.tgz", - "integrity": "sha512-bMs8ekJLjX8wPV+9IPBges1SLPyuDtE9g5gLDWOpxzKcoOFQnpLGkbcT1tdw3FaAmDS1gnPmMmJ6y/T5B96kIA==", + "version": "1.25.1", + "resolved": "https://registry.npmjs.org/@azure/core-rest-pipeline/-/core-rest-pipeline-1.25.1.tgz", + "integrity": "sha512-fTIA3CAm/cdODqiXkO6jYOIkU2Ylld7vq65KGc70gTwl12sLQsC8v7I5t6tp2N2CfUONzZBXyeFw7KEu6Ks2zg==", "dev": true, "license": "MIT", "dependencies": { @@ -100,7 +100,7 @@ "@azure/core-tracing": "^1.3.0", "@azure/core-util": "^1.13.0", "@azure/logger": "^1.3.0", - "@typespec/ts-http-runtime": "^0.3.4", + "@typespec/ts-http-runtime": "^0.3.10", "tslib": "^2.6.2" }, "engines": { @@ -174,22 +174,22 @@ } }, "node_modules/@azure/msal-browser": { - "version": "5.28.0", - "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-5.28.0.tgz", - "integrity": "sha512-f3yY518Z++x3ZogCbcLK6vnABgpxc8rAKGKtQibcUJKAVU9gamgh5mNAPJIRwduzXQvO2xtHx/gtmPz8iuZ8+w==", + "version": "5.29.1", + "resolved": "https://registry.npmjs.org/@azure/msal-browser/-/msal-browser-5.29.1.tgz", + "integrity": "sha512-+TMoU/4h3KYUvQKZH+p1/9/iDaepDlVJQ7UMUAB6q8prPsMfsOoqA9m2alpPqLUQ48Bp7sXqN2wdhA9rOg9q1A==", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.16.0" + "@azure/msal-common": "16.16.2" }, "engines": { "node": ">=0.8.0" } }, "node_modules/@azure/msal-common": { - "version": "16.16.0", - "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.16.0.tgz", - "integrity": "sha512-EZgd8h5nczsdRAQAgXA0A0pC5L/zj43n1jePXvUMgdwXMbH2zhb7b7Hp+Oe7ZOODK/sch2x+soD6FOrtgUbx/w==", + "version": "16.16.2", + "resolved": "https://registry.npmjs.org/@azure/msal-common/-/msal-common-16.16.2.tgz", + "integrity": "sha512-IVoPgAup0hnpzwC8esxPxrrnDDVe0n3mmK+UU3JRmKWySKxBQrl+a30tTP3okmJ9Wc7dh+IgoNaUXkCxb2DBSg==", "dev": true, "license": "MIT", "engines": { @@ -197,13 +197,13 @@ } }, "node_modules/@azure/msal-node": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-7.2.0.tgz", - "integrity": "sha512-Y87VJsMWF4jiqLqq8XYLb1o+rGc/HacwS3Zydi3bDtaVm5Sa8FlB7YrKrBFKRIYj27RJXAaDkErImMAqtM10Pg==", + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@azure/msal-node/-/msal-node-7.2.2.tgz", + "integrity": "sha512-MjsAHC+KUSXYYC8P57lVXy5IgSeO+PraXzLLHZI6hcX7nx/hCokY6gTPm2JcKLI3W88mu7ozjObBVGKExZUhww==", "dev": true, "license": "MIT", "dependencies": { - "@azure/msal-common": "16.16.0", + "@azure/msal-common": "16.16.2", "jsonwebtoken": "^9.0.0" }, "engines": { @@ -295,9 +295,9 @@ ] }, "node_modules/@dprint/json": { - "version": "0.25.2", - "resolved": "https://registry.npmjs.org/@dprint/json/-/json-0.25.2.tgz", - "integrity": "sha512-QpOGNXL3cOunsB7IBPJxlIisMhFcIeMXSAWoavJKwjJjtOZW5sDojlgn2MPYNdHVgknZeQsUqDYyhGqqN1bYuQ==", + "version": "0.26.0", + "resolved": "https://registry.npmjs.org/@dprint/json/-/json-0.26.0.tgz", + "integrity": "sha512-yuesFKq2aFAx8VU1I2A3HFVMlX8ED52ZKUKGW6+WKviRFtvgkxxE7zcQ7pqTZURH/TLHj84mHaBjMOqTYR3m6Q==", "dev": true, "license": "MIT" }, @@ -489,9 +489,9 @@ ] }, "node_modules/@dprint/typescript": { - "version": "0.96.1", - "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.96.1.tgz", - "integrity": "sha512-mz/nINSFQh1R5i2Qy90SWOCCK4SgNGRkNhCZba7LYmUkE4Zi8/45p8l8pqc9yN1fb4XY5Muhrzdh5Q3jFsYimw==", + "version": "0.101.0", + "resolved": "https://registry.npmjs.org/@dprint/typescript/-/typescript-0.101.0.tgz", + "integrity": "sha512-UesK6sSHYFaQW8T1nbvjXTKm63dgbkobApw/AGRyovP+MnlqkgEM+GfVYnBP/b0GWmaBmk/GOkoR4j9DVSrAnQ==", "dev": true, "license": "MIT" }, @@ -1932,9 +1932,9 @@ } }, "node_modules/@typespec/ts-http-runtime": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.9.tgz", - "integrity": "sha512-edSdeAqkdxBVzA1yL1LrLCml1YjyCVvPMtMqJpbF+6K609tHe8V6sQUzFQSGcYNhcuhOceZtjvN32+mpIth30A==", + "version": "0.3.11", + "resolved": "https://registry.npmjs.org/@typespec/ts-http-runtime/-/ts-http-runtime-0.3.11.tgz", + "integrity": "sha512-KZlacW7zFdcIOAcpNiV5U9fy0Tfgw7xdEc4rVyuUtQS+UR1Sn32PXuAz+AJ70Y0yzTWh62/pEEpFmWUJl6YySw==", "dev": true, "license": "MIT", "dependencies": { @@ -1973,9 +1973,9 @@ } }, "node_modules/@vscode/vsce": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-4.1.0.tgz", - "integrity": "sha512-iWNykEfLWTAU7FC2iBiE0vJvnJDpGm3GlL89dsBtRs62F+8tkPtq80Imi0QSFHjNBWu4QIdYII+3F9v/ZQRExw==", + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@vscode/vsce/-/vsce-4.1.1.tgz", + "integrity": "sha512-JYw4KtAmePIik4F+sGZo8GAfX6IApSQTBhXb28ivfmbzUoojfJHL9mupjV0E/cckzSdrxdu4jUCj8tKDddV5kQ==", "dev": true, "license": "MIT", "dependencies": { @@ -1986,7 +1986,7 @@ "@secretlint/secretlint-rule-preset-recommend": "^10.2.2", "@secretlint/source-creator": "^10.2.2", "@secretlint/types": "^10.2.2", - "@vscode/vsce-sign": "^2.1.0", + "@vscode/vsce-sign": "^2.1.1", "azure-devops-node-api": "^12.5.0", "cockatiel": "^3.2.1", "commander": "^12.1.0", @@ -2014,28 +2014,28 @@ } }, "node_modules/@vscode/vsce-sign": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.1.0.tgz", - "integrity": "sha512-9AQrqazrBgTgRSuwleLVXUrIUphY02/SFCh2TKYoLV/xifJAdblhdmEmw5gUrYSPQ3sRwNs9iyCMD14sATEE6g==", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign/-/vsce-sign-2.1.1.tgz", + "integrity": "sha512-Fm9SrvxonXpmzN0eKHKS/AHb/3Gc19c7SkGfSnhYOGPiLy2o8hJlIzx314IVSH//uEiKaAbE40P47wwFtyDByg==", "dev": true, "hasInstallScript": true, "license": "SEE LICENSE IN LICENSE.txt", "optionalDependencies": { - "@vscode/vsce-sign-alpine-arm64": "2.0.6", - "@vscode/vsce-sign-alpine-x64": "2.0.6", - "@vscode/vsce-sign-darwin-arm64": "2.0.6", - "@vscode/vsce-sign-darwin-x64": "2.0.6", - "@vscode/vsce-sign-linux-arm": "2.0.6", - "@vscode/vsce-sign-linux-arm64": "2.0.6", - "@vscode/vsce-sign-linux-x64": "2.0.6", - "@vscode/vsce-sign-win32-arm64": "2.0.6", - "@vscode/vsce-sign-win32-x64": "2.0.6" + "@vscode/vsce-sign-alpine-arm64": "2.0.8", + "@vscode/vsce-sign-alpine-x64": "2.0.8", + "@vscode/vsce-sign-darwin-arm64": "2.0.8", + "@vscode/vsce-sign-darwin-x64": "2.0.8", + "@vscode/vsce-sign-linux-arm": "2.0.8", + "@vscode/vsce-sign-linux-arm64": "2.0.8", + "@vscode/vsce-sign-linux-x64": "2.0.8", + "@vscode/vsce-sign-win32-arm64": "2.0.8", + "@vscode/vsce-sign-win32-x64": "2.0.8" } }, "node_modules/@vscode/vsce-sign-alpine-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.6.tgz", - "integrity": "sha512-wKkJBsvKF+f0GfsUuGT0tSW0kZL87QggEiqNqK6/8hvqsXvpx8OsTEc3mnE1kejkh5r+qUyQ7PtF8jZYN0mo8Q==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-arm64/-/vsce-sign-alpine-arm64-2.0.8.tgz", + "integrity": "sha512-3HSEDf4R2zhI3/eckZPWBoeFUiLpnG9O0/NBW8xCM3j+Ri0uhmOPvCDuCYsUmIsFVUJETaMu+JMY2DF8v8hNPg==", "cpu": [ "arm64" ], @@ -2047,9 +2047,9 @@ ] }, "node_modules/@vscode/vsce-sign-alpine-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.6.tgz", - "integrity": "sha512-YoAGlmdK39vKi9jA18i4ufBbd95OqGJxRvF3n6ZbCyziwy3O+JgOpIUPxv5tjeO6gQfx29qBivQ8ZZTUF2Ba0w==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-alpine-x64/-/vsce-sign-alpine-x64-2.0.8.tgz", + "integrity": "sha512-rHbdV7+esCVn/t8KnbSN9CyMGImAmGnxFb1K9d2uSrt0WNPYfL12FGFekhz2yI8sFhIhyxD+vIKTSp9+kLx+5A==", "cpu": [ "x64" ], @@ -2061,9 +2061,9 @@ ] }, "node_modules/@vscode/vsce-sign-darwin-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.6.tgz", - "integrity": "sha512-5HMHaJRIQuozm/XQIiJiA0W9uhdblwwl2ZNDSSAeXGO9YhB9MH5C4KIHOmvyjUnKy4UCuiP43VKpIxW1VWP4tQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-arm64/-/vsce-sign-darwin-arm64-2.0.8.tgz", + "integrity": "sha512-/JSzSLCbXSlc+X7PfmHWnXczFHRmKURCwN1MGmJXjUJlWHgTDpaqjaJNMnBNqruyrbb6LRE/DMXTfRY9iwr4jA==", "cpu": [ "arm64" ], @@ -2075,9 +2075,9 @@ ] }, "node_modules/@vscode/vsce-sign-darwin-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.6.tgz", - "integrity": "sha512-25GsUbTAiNfHSuRItoQafXOIpxlYj+IXb4/qarrXu7kmbH94jlm5sdWSCKrrREs8+GsXF1b+l3OB7VJy5jsykw==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-darwin-x64/-/vsce-sign-darwin-x64-2.0.8.tgz", + "integrity": "sha512-iowH17iKIaAiC6TNGIksLmwtcKOHh/HT/pwKHwPZnuTLvdKWZ/8VOT+MphEt71EcWttohqUXx41SjdiCfUPBiA==", "cpu": [ "x64" ], @@ -2089,9 +2089,9 @@ ] }, "node_modules/@vscode/vsce-sign-linux-arm": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.6.tgz", - "integrity": "sha512-UndEc2Xlq4HsuMPnwu7420uqceXjs4yb5W8E2/UkaHBB9OWCwMd3/bRe/1eLe3D8kPpxzcaeTyXiK3RdzS/1CA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm/-/vsce-sign-linux-arm-2.0.8.tgz", + "integrity": "sha512-SVzcxe2fx+1meLyO745eUiywrRDQIXwK/oZcwTrzYEkoVh4Val4/8CtDHIc5Z3EhHnwVBnqGqsbNwkR44k7rXA==", "cpu": [ "arm" ], @@ -2103,9 +2103,9 @@ ] }, "node_modules/@vscode/vsce-sign-linux-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.6.tgz", - "integrity": "sha512-cfb1qK7lygtMa4NUl2582nP7aliLYuDEVpAbXJMkDq1qE+olIw/es+C8j1LJwvcRq1I2yWGtSn3EkDp9Dq5FdA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-arm64/-/vsce-sign-linux-arm64-2.0.8.tgz", + "integrity": "sha512-94aBLOVdO6eAOylUsyJ40/BdHtRrHuKAa/29KNOci2QtwUBAH9jTWJLpn1Yv+xjlUOaSjQC8UlAUtjqz/g6FPA==", "cpu": [ "arm64" ], @@ -2117,9 +2117,9 @@ ] }, "node_modules/@vscode/vsce-sign-linux-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.6.tgz", - "integrity": "sha512-/olerl1A4sOqdP+hjvJ1sbQjKN07Y3DVnxO4gnbn/ahtQvFrdhUi0G1VsZXDNjfqmXw57DmPi5ASnj/8PGZhAA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-linux-x64/-/vsce-sign-linux-x64-2.0.8.tgz", + "integrity": "sha512-i55pKFRMF1nR94CMcFHbr3VQz7rQ8DFURvUd2Jymcbtv8qzhPX2otIHWzkcmAVr4dQApbYYCvRPjbP+i12ImQQ==", "cpu": [ "x64" ], @@ -2131,9 +2131,9 @@ ] }, "node_modules/@vscode/vsce-sign-win32-arm64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.6.tgz", - "integrity": "sha512-ivM/MiGIY0PJNZBoGtlRBM/xDpwbdlCWomUWuLmIxbi1Cxe/1nooYrEQoaHD8ojVRgzdQEUzMsRbyF5cJJgYOg==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-arm64/-/vsce-sign-win32-arm64-2.0.8.tgz", + "integrity": "sha512-2CoVlRNow2XkNboxlfx8hGdKLR2hvyBRg1O8gafx8I4F+scm1MLHdGcYV3+u3jXDsJaiSyDshTO5vPcLjQpVug==", "cpu": [ "arm64" ], @@ -2145,9 +2145,9 @@ ] }, "node_modules/@vscode/vsce-sign-win32-x64": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.6.tgz", - "integrity": "sha512-mgth9Kvze+u8CruYMmhHw6Zgy3GRX2S+Ed5oSokDEK5vPEwGGKnmuXua9tmFhomeAnhgJnL4DCna3TiNuGrBTQ==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/@vscode/vsce-sign-win32-x64/-/vsce-sign-win32-x64-2.0.8.tgz", + "integrity": "sha512-93c+KXIvOsLlNLMEPtQBgJJgn2eaypv3G3+4O9RailUQTh9zL3ul/Fhnqf0O+NKOGKky9d/v+GYWhBwsAjZaww==", "cpu": [ "x64" ], @@ -2284,9 +2284,9 @@ "license": "BSD-2-Clause" }, "node_modules/brace-expansion": { - "version": "5.0.12", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.12.tgz", - "integrity": "sha512-YovQ3rzhaLMIrDjNDMkNS01tea93qhEhG5xy8f6+R0l+dw3Ki+5sCoIoI942iuLZTHWogWktgwVDhU09iNEimQ==", + "version": "5.0.13", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.13.tgz", + "integrity": "sha512-Vh3dmFbc4wZeox7M9I/0L9GfFd83Su4+yCck/OF9Gi/P/dAHn0RT7X4K9R7gMNMhDck3DvhR6QXsnQdjjgwNvQ==", "license": "MIT", "dependencies": { "balanced-match": "^4.0.2" @@ -2590,9 +2590,9 @@ "license": "MIT" }, "node_modules/entities": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-8.1.0.tgz", - "integrity": "sha512-kxL7msIffSuh9aaFAMD7rxAIuTRMAHMeBtgHW2yUdWw732ZNh4MehkF2gdjvtdmikkaIP9bFDDJOPlsvm7avrA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-9.0.0.tgz", + "integrity": "sha512-oJFNDJg3kTPwAD1cNn2+WmUq4wFoo09npc3Ydf1D7ED4smRiWrsKnaLxykrTWgyGEcusc87P5dxlAleol9kpkg==", "dev": true, "license": "BSD-2-Clause", "engines": { @@ -2778,11 +2778,11 @@ } }, "node_modules/graceful-fs": { - "version": "4.2.11", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", - "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "version": "4.2.12", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.12.tgz", + "integrity": "sha512-iuyGF2E4oafQfPsRrG2wtY2ILupMhvtdrhzrxB+0VcjsPpSPttpfYdjnGFGsTi5MaJFjI1jOKHPQ6UTbTj9TAw==", "dev": true, - "license": "ISC" + "license": "BlueOak-1.0.0" }, "node_modules/has-symbols": { "version": "1.1.0", @@ -3079,9 +3079,9 @@ "license": "ISC" }, "node_modules/marked": { - "version": "18.1.2", - "resolved": "https://registry.npmjs.org/marked/-/marked-18.1.2.tgz", - "integrity": "sha512-DfOnvLAQ6WYeWxWO1u4RyFOeqyHup6dks5PPqnoFiooU7ipRvidO/2j8plhAHIiZg574E9ZlzSjUiPMLAzFkgg==", + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/marked/-/marked-18.2.0.tgz", + "integrity": "sha512-KaeL+tAbtvI930q7HE2PN5lYXYdT8EiSmxHlN6F3rsfb57wd5mp5W5TLazpdj4inTQBJdgjYwbs40W/0VUGU+Q==", "dev": true, "license": "MIT", "bin": { @@ -3205,13 +3205,13 @@ } }, "node_modules/parse5": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.0.1.tgz", - "integrity": "sha512-z1e/HMG90obSGeidlli3hj7cbocou0/wa5HacvI3ASx34PecNjNQeaHNo5WIZpWofN9kgkqV1q5YvXe3F0FoPw==", + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-8.1.1.tgz", + "integrity": "sha512-EcR/6WDcU7b2N3vQSxKALCk9lXGtUMQxXio008OEMBE0kavu/7JLfBEeFPzi43nMqVDSbEn3QCK+BMCc9zO//w==", "dev": true, "license": "MIT", "dependencies": { - "entities": "^8.0.0" + "entities": "^9.0.0" }, "funding": { "url": "https://github.com/inikulin/parse5?sponsor=1" @@ -3238,13 +3238,13 @@ } }, "node_modules/playwright": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.64.1.tgz", - "integrity": "sha512-HCrVhHr5QQuwYoswEUGTb7gGp522yflbv/ST8nF4sFWGuLjQCt17Q/EubpGGSNKYn1tsTCPZxqHhHCfVURu7UA==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright/-/playwright-1.65.1.tgz", + "integrity": "sha512-vJ1FuoOrNwOKHUIVEvSt3jT1L+wjjDpwhwIstKtfvTh8XIG4FG4bIFuvNdMxi81LGfAhUgUZleVFaOLY4RIUUw==", "dev": true, "license": "Apache-2.0", "dependencies": { - "playwright-core": "1.64.1" + "playwright-core": "1.65.1" }, "bin": { "playwright": "cli.js" @@ -3254,9 +3254,9 @@ } }, "node_modules/playwright-core": { - "version": "1.64.1", - "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.64.1.tgz", - "integrity": "sha512-BC4s8y6SEVA6Q1rSxZTto8hI1KUI3xXlHGZgvGqP4IqPdI/a6FX9H29IDNz7vKo9l21b6LfYosScPL6M3xxyDQ==", + "version": "1.65.1", + "resolved": "https://registry.npmjs.org/playwright-core/-/playwright-core-1.65.1.tgz", + "integrity": "sha512-hqPpz7blSMPxWVdoeE1yiBSzXsKiVOd2k+kjCvmUywD2GPO2Dd9HfcWnq9NN0GHbNZDFgZ9JfBFr+X5/BLo0qw==", "dev": true, "license": "Apache-2.0", "bin": { @@ -3400,9 +3400,9 @@ } }, "node_modules/semver": { - "version": "7.8.5", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz", - "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==", + "version": "7.8.6", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.6.tgz", + "integrity": "sha512-9lpSSU4Mly3mrtruwLs1eLK6+gzbzqeBFwRNjIjE+9LuDpWdYctrQlQ3ej1Ilgi7gknpsTRnPoLP8DpCHqHIJw==", "license": "ISC", "bin": { "semver": "bin/semver.js" @@ -3533,9 +3533,9 @@ } }, "node_modules/tar": { - "version": "7.5.22", - "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.22.tgz", - "integrity": "sha512-MFO/QzvtAOmJbkhOaCTvbGcFN9L9b+JunIsDwaKljSOdcLMea3NJ1k9Usz/rjdfSXTq4dfzfeS7W4p4YOAAHeA==", + "version": "7.5.23", + "resolved": "https://registry.npmjs.org/tar/-/tar-7.5.23.tgz", + "integrity": "sha512-lkukzdoGngZHJZXxW4S/E4Fp9ghTDlyZXrQGRNoJ/LXvDKcXUTq2sg5yQe74po7Voea6n/IN09+wE/QvJMiifA==", "dev": true, "license": "BlueOak-1.0.0", "dependencies": { @@ -3575,9 +3575,9 @@ } }, "node_modules/tinybench": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz", - "integrity": "sha512-nIZ2N2dFpjBsg2hgitKu7mA+FvsIJuGJOwysRngmVRRmWgR/UyPjwJj8c/fT/dhm8EkHnF5EOogRf+0Z2qrimA==", + "version": "6.2.3", + "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.3.tgz", + "integrity": "sha512-Al01C2JIBnO2CXCAPbpAl6sUiOZHeThGtHYNTa51JRw9PyWOCdr+9Ong05R4qg/Sk3+H645E8ov1h2c58ityNw==", "dev": true, "license": "MIT", "engines": { @@ -3889,8 +3889,8 @@ }, "devDependencies": { "@types/node": "^22.20.5", - "playwright": "^1.64.1", - "tinybench": "^6.2.2", + "playwright": "^1.65.1", + "tinybench": "^6.2.3", "vscode-jsonrpc": "^10.0.0" }, "engines": { @@ -3914,7 +3914,7 @@ "@types/vscode": "~1.125.0", "@typescript/bundled-typescript": "npm:typescript@7.0.2", "@typescript/typescript": "0.0.0", - "@vscode/vsce": "4.1.0", + "@vscode/vsce": "4.1.1", "@vscode/wasm-wasi": "^1.0.2", "esbuild": "^0.28.2" }, diff --git a/package.json b/package.json index 54f0c1c7fdb94..7425d88df5940 100644 --- a/package.json +++ b/package.json @@ -24,8 +24,8 @@ "setup-hooks": "node tools/scripts/link-hooks.mjs" }, "devDependencies": { - "@dprint/json": "^0.25.2", - "@dprint/typescript": "^0.96.1", + "@dprint/json": "^0.26.0", + "@dprint/typescript": "^0.101.0", "@jakebailey/dprint-plugin-gofumpt": "^0.0.20", "@types/node": "^22.20.5", "@unicode/unicode-15.1.0": "^2.1.0", @@ -35,7 +35,7 @@ "dprint": "^0.64.3", "dprint-plugin-yaml": "^0.6.0", "hereby": "^1.15.2", - "tar": "^7.5.22", + "tar": "^7.5.23", "tinyexec": "^1.3.1", "typescript": "^6.0.3" }, @@ -52,6 +52,6 @@ "allowScripts": { "dprint@0.64.3": true, "esbuild@0.28.2": true, - "@vscode/vsce-sign@2.1.0": true + "@vscode/vsce-sign@2.1.1": true } } diff --git a/packages/typescript/package.json b/packages/typescript/package.json index 2a375beedce6f..002debcad7ed1 100644 --- a/packages/typescript/package.json +++ b/packages/typescript/package.json @@ -121,8 +121,8 @@ }, "devDependencies": { "@types/node": "^22.20.5", - "playwright": "^1.64.1", - "tinybench": "^6.2.2", + "playwright": "^1.65.1", + "tinybench": "^6.2.3", "vscode-jsonrpc": "^10.0.0" } } diff --git a/packages/typescript/src/ast/scanner.ts b/packages/typescript/src/ast/scanner.ts index 0f5c53d94dc59..e08e86331036b 100644 --- a/packages/typescript/src/ast/scanner.ts +++ b/packages/typescript/src/ast/scanner.ts @@ -299,7 +299,7 @@ function scanJSDocCommentForTags(text: string, tokenFlags: TokenFlags): TokenFla } if ( (tokenFlags & (TokenFlags.PrecedingJSDocWithDeprecated | TokenFlags.PrecedingJSDocWithSeeOrLink)) === - (TokenFlags.PrecedingJSDocWithDeprecated | TokenFlags.PrecedingJSDocWithSeeOrLink) + (TokenFlags.PrecedingJSDocWithDeprecated | TokenFlags.PrecedingJSDocWithSeeOrLink) ) { return tokenFlags; } diff --git a/packages/typescript/test/async/api.test.ts b/packages/typescript/test/async/api.test.ts index 99a808b8d9a71..17261d7db5f5d 100644 --- a/packages/typescript/test/async/api.test.ts +++ b/packages/typescript/test/async/api.test.ts @@ -798,9 +798,7 @@ describe("API", { concurrency }, () => { }); assert.equal(isolatedDeclarationModuleOutput.diagnostics?.length ?? 0, 0); - const moduleFileOutput = await api.transpileModuleFromFile({ uri: "file:///input.ts" }, { - compilerOptions: { module: ModuleKind.CommonJS }, - }); + const moduleFileOutput = await api.transpileModuleFromFile({ uri: "file:///input.ts" }, { compilerOptions: { module: ModuleKind.CommonJS } }); assert.match(moduleFileOutput.outputText, /exports\.x = 1/); const declarationOutput = await api.transpileDeclaration("export const x: number = 1;"); @@ -1293,12 +1291,15 @@ describe("API", { concurrency }, () => { "/workspace/project/types/pkg/index.d.ts": "export {};", }), }); - const resolver = await api.createModuleResolver({ typeRoots: ["types"], traceResolution: true }, { - moduleResolutions: { fallback: "unresolved", entries: [] }, - resolveModuleName: () => { - assert.fail("Type references must not invoke the module-name callback"); + const resolver = await api.createModuleResolver( + { typeRoots: ["types"], traceResolution: true }, + { + moduleResolutions: { fallback: "unresolved", entries: [] }, + resolveModuleName: () => { + assert.fail("Type references must not invoke the module-name callback"); + }, }, - }); + ); const result = await resolver.resolveTypeReferenceDirective("pkg", "src/index.ts"); assert.equal(result.resolvedTypeReferenceDirective?.resolvedFileName, "/workspace/project/types/pkg/index.d.ts"); assert.equal(result.resolvedTypeReferenceDirective?.primary, true); @@ -3208,11 +3209,14 @@ describe("SourceFile", { concurrency }, () => { }); test("Program statistics reflect checker work without forcing diagnostics", async () => { - await using api = spawnAPI({ - "/src/main.ts": `type Box = { value: T }; + await using api = spawnAPI( + { + "/src/main.ts": `type Box = { value: T }; export const box: Box = { value: "hello" }; export const other: { value: string } = box;`, - }, { collectTiming: true }); + }, + { collectTiming: true }, + ); const snapshot = await api.createSnapshot({ createPrograms: [{ rootFiles: ["/src/main.ts"], compilerOptions: { noLib: true } }], }); @@ -3278,9 +3282,7 @@ export const other: { value: string } = box;`, const references = await program.getProjectReferences(); assert.equal(references?.length, 4); - await using synthetic = await api.createProgram([], { noLib: true }, { - projectReferences: [{ path: "/a/tsconfig.json" }, { path: "/missing/tsconfig.json" }], - }); + await using synthetic = await api.createProgram([], { noLib: true }, { projectReferences: [{ path: "/a/tsconfig.json" }, { path: "/missing/tsconfig.json" }] }); assert.equal((await synthetic.getProjectReferences())!.length, 2); }); @@ -4827,10 +4829,7 @@ export const value = 1; test("snapshot-owned symbols resolve cached file-owned parents", async () => { const source = `interface Box { value: T; }\ndeclare const box: Box;\nbox;`; - await using api = spawnAPI({ - "/tsconfig.json": JSON.stringify({ compilerOptions: { strict: true }, files: ["/src/box.ts"] }), - "/src/box.ts": source, - }, { collectTiming: true }); + await using api = spawnAPI({ "/tsconfig.json": JSON.stringify({ compilerOptions: { strict: true }, files: ["/src/box.ts"] }), "/src/box.ts": source }, { collectTiming: true }); const snapshot = await api.createSnapshot({ openProjects: ["/tsconfig.json"] }); const project = snapshot.getConfiguredProject("/tsconfig.json")!; const box = await project.checker.getSymbolAtPosition("/src/box.ts", source.indexOf("Box")); @@ -9938,12 +9937,7 @@ describe("Program - selected file emit", { concurrency }, () => { const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = await project.program.getJavaScriptEmit(["/src/a.ts", "/src/b.ts"]); assert.equal(result.emitSkipped, false); - assert.deepEqual([...result.outputFiles.keys()], [ - "/src/a.js", - "/src/a.js.map", - "/src/b.js", - "/src/b.js.map", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/src/a.js", "/src/a.js.map", "/src/b.js", "/src/b.js.map"]); const outputFileName = toRootedFilePath("/src/a.js", undefined); assert.equal(result.outputFiles.get(outputFileName)?.sourceFileName, "/src/a.ts"); assert.match(result.outputFiles.get(outputFileName)!.text, /export const a = 1/); @@ -9958,12 +9952,7 @@ describe("Program - selected file emit", { concurrency }, () => { const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = await project.program.getDeclarationEmit(["/src/a.ts", "/src/b.ts"]); assert.equal(result.emitSkipped, false); - assert.deepEqual([...result.outputFiles.keys()], [ - "/src/a.d.ts", - "/src/a.d.ts.map", - "/src/b.d.ts", - "/src/b.d.ts.map", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/src/a.d.ts", "/src/a.d.ts.map", "/src/b.d.ts", "/src/b.d.ts.map"]); assert.equal(result.outputFiles.get(toRootedFilePath("/src/a.d.ts", undefined))?.sourceFileName, "/src/a.ts"); assert.equal(fs.readFile(toRootedFilePath("/src/a.d.ts", undefined)), serverFS.useOS); }); @@ -10968,10 +10957,7 @@ describe("Program - emit", { concurrency }, () => { const snapshot = await api.createSnapshot({ openProjects: ["/tsconfig.json"] }); const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = await project.program.emitToString(EmitOnly.OnlyDts); - assert.deepEqual([...result.outputFiles.keys()], [ - "/dist/src/index.d.ts", - "/dist/src/testing.d.ts", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/dist/src/index.d.ts", "/dist/src/testing.d.ts"]); assert.equal(fs.readFile(toRootedFilePath("/dist/src/index.js", undefined)), serverFS.useOS); }); @@ -11006,16 +10992,10 @@ describe("Program - emit", { concurrency }, () => { assert.ok(fs.fileExists?.(toRootedFilePath("/dist/src/index.d.ts.map", undefined))); const js = await project.program.emitToString(EmitOnly.OnlyJs); - assert.deepEqual([...js.outputFiles.keys()], [ - "/dist/src/index.js", - "/dist/src/index.js.map", - ]); + assert.deepEqual([...js.outputFiles.keys()], ["/dist/src/index.js", "/dist/src/index.js.map"]); const dts = await project.program.emitToString(EmitOnly.OnlyDts); - assert.deepEqual([...dts.outputFiles.keys()], [ - "/dist/src/index.d.ts", - "/dist/src/index.d.ts.map", - ]); + assert.deepEqual([...dts.outputFiles.keys()], ["/dist/src/index.d.ts", "/dist/src/index.d.ts.map"]); }); test("noEmitOnError reports diagnostics without writing output", async () => { diff --git a/packages/typescript/test/async/astnav.test.ts b/packages/typescript/test/async/astnav.test.ts index 1e0ba12b6085f..8baf3332e2a25 100644 --- a/packages/typescript/test/async/astnav.test.ts +++ b/packages/typescript/test/async/astnav.test.ts @@ -2,6 +2,10 @@ import { API } from "@typescript/typescript/async"; // @sync-skip // @sync-only-start // import { API } from "@typescript/typescript/sync"; // @sync-only-end +import type { + Node, + SourceFile, +} from "@typescript/typescript/ast"; import { findNextToken, findPrecedingToken, @@ -9,10 +13,6 @@ import { getTokenAtPosition, getTouchingPropertyName, } from "@typescript/typescript/ast"; -import type { - Node, - SourceFile, -} from "@typescript/typescript/ast"; import assert from "node:assert"; import { readFileSync } from "node:fs"; import { resolve } from "node:path"; diff --git a/packages/typescript/test/path.test.ts b/packages/typescript/test/path.test.ts index cb99f1a662080..9555523846b57 100644 --- a/packages/typescript/test/path.test.ts +++ b/packages/typescript/test/path.test.ts @@ -321,9 +321,7 @@ test("createVirtualFileSystem supports object prototype path components", () => }); test("createVirtualFileSystem respects case sensitivity", () => { - const fs = createVirtualFileSystem({ - "/Workspace/Foo.ts": "content", - }, { caseSensitivity: CaseSensitivity.Insensitive }); + const fs = createVirtualFileSystem({ "/Workspace/Foo.ts": "content" }, { caseSensitivity: CaseSensitivity.Insensitive }); assert.strictEqual(fs.readFile(toRootedFilePath("/workspace/foo.ts", undefined)), "content"); assert.deepStrictEqual(fs.getAccessibleEntries(toRootedDirectoryPath("/workspace", undefined)), { files: ["Foo.ts"], diff --git a/packages/typescript/test/proto.test.ts b/packages/typescript/test/proto.test.ts index 17a1d063cfae9..4bf4fc0c2af77 100644 --- a/packages/typescript/test/proto.test.ts +++ b/packages/typescript/test/proto.test.ts @@ -5,11 +5,11 @@ import type { SymbolOwner as ProtocolSymbolOwner, SymbolResponse as ProtocolSymbolResponse, } from "../src/api/proto.generated.ts"; +import type { ProjectId } from "../src/api/proto.ts"; import { validateSymbolOwner, validateSymbolResponse, } from "../src/api/proto.ts"; -import type { ProjectId } from "../src/api/proto.ts"; import { SourceFileCache } from "../src/api/sourceFileCache.ts"; import type { PathKey, diff --git a/packages/typescript/test/sync/api.test.ts b/packages/typescript/test/sync/api.test.ts index 2359913ec1362..06a91c66032ee 100644 --- a/packages/typescript/test/sync/api.test.ts +++ b/packages/typescript/test/sync/api.test.ts @@ -787,9 +787,7 @@ describe("API", { concurrency }, () => { }); assert.equal(isolatedDeclarationModuleOutput.diagnostics?.length ?? 0, 0); - const moduleFileOutput = api.transpileModuleFromFile({ uri: "file:///input.ts" }, { - compilerOptions: { module: ModuleKind.CommonJS }, - }); + const moduleFileOutput = api.transpileModuleFromFile({ uri: "file:///input.ts" }, { compilerOptions: { module: ModuleKind.CommonJS } }); assert.match(moduleFileOutput.outputText, /exports\.x = 1/); const declarationOutput = api.transpileDeclaration("export const x: number = 1;"); @@ -1280,12 +1278,15 @@ describe("API", { concurrency }, () => { "/workspace/project/types/pkg/index.d.ts": "export {};", }), }); - const resolver = api.createModuleResolver({ typeRoots: ["types"], traceResolution: true }, { - moduleResolutions: { fallback: "unresolved", entries: [] }, - resolveModuleName: () => { - assert.fail("Type references must not invoke the module-name callback"); + const resolver = api.createModuleResolver( + { typeRoots: ["types"], traceResolution: true }, + { + moduleResolutions: { fallback: "unresolved", entries: [] }, + resolveModuleName: () => { + assert.fail("Type references must not invoke the module-name callback"); + }, }, - }); + ); const result = resolver.resolveTypeReferenceDirective("pkg", "src/index.ts"); assert.equal(result.resolvedTypeReferenceDirective?.resolvedFileName, "/workspace/project/types/pkg/index.d.ts"); assert.equal(result.resolvedTypeReferenceDirective?.primary, true); @@ -3024,11 +3025,14 @@ describe("SourceFile", { concurrency }, () => { }); test("Program statistics reflect checker work without forcing diagnostics", () => { - using api = spawnAPI({ - "/src/main.ts": `type Box = { value: T }; + using api = spawnAPI( + { + "/src/main.ts": `type Box = { value: T }; export const box: Box = { value: "hello" }; export const other: { value: string } = box;`, - }, { collectTiming: true }); + }, + { collectTiming: true }, + ); const snapshot = api.createSnapshot({ createPrograms: [{ rootFiles: ["/src/main.ts"], compilerOptions: { noLib: true } }], }); @@ -3094,9 +3098,7 @@ export const other: { value: string } = box;`, const references = program.getProjectReferences(); assert.equal(references?.length, 4); - using synthetic = api.createProgram([], { noLib: true }, { - projectReferences: [{ path: "/a/tsconfig.json" }, { path: "/missing/tsconfig.json" }], - }); + using synthetic = api.createProgram([], { noLib: true }, { projectReferences: [{ path: "/a/tsconfig.json" }, { path: "/missing/tsconfig.json" }] }); assert.equal((synthetic.getProjectReferences())!.length, 2); }); @@ -4610,10 +4612,7 @@ export const value = 1; test("snapshot-owned symbols resolve cached file-owned parents", () => { const source = `interface Box { value: T; }\ndeclare const box: Box;\nbox;`; - using api = spawnAPI({ - "/tsconfig.json": JSON.stringify({ compilerOptions: { strict: true }, files: ["/src/box.ts"] }), - "/src/box.ts": source, - }, { collectTiming: true }); + using api = spawnAPI({ "/tsconfig.json": JSON.stringify({ compilerOptions: { strict: true }, files: ["/src/box.ts"] }), "/src/box.ts": source }, { collectTiming: true }); const snapshot = api.createSnapshot({ openProjects: ["/tsconfig.json"] }); const project = snapshot.getConfiguredProject("/tsconfig.json")!; const box = project.checker.getSymbolAtPosition("/src/box.ts", source.indexOf("Box")); @@ -9696,12 +9695,7 @@ describe("Program - selected file emit", { concurrency }, () => { const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = project.program.getJavaScriptEmit(["/src/a.ts", "/src/b.ts"]); assert.equal(result.emitSkipped, false); - assert.deepEqual([...result.outputFiles.keys()], [ - "/src/a.js", - "/src/a.js.map", - "/src/b.js", - "/src/b.js.map", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/src/a.js", "/src/a.js.map", "/src/b.js", "/src/b.js.map"]); const outputFileName = toRootedFilePath("/src/a.js", undefined); assert.equal(result.outputFiles.get(outputFileName)?.sourceFileName, "/src/a.ts"); assert.match(result.outputFiles.get(outputFileName)!.text, /export const a = 1/); @@ -9716,12 +9710,7 @@ describe("Program - selected file emit", { concurrency }, () => { const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = project.program.getDeclarationEmit(["/src/a.ts", "/src/b.ts"]); assert.equal(result.emitSkipped, false); - assert.deepEqual([...result.outputFiles.keys()], [ - "/src/a.d.ts", - "/src/a.d.ts.map", - "/src/b.d.ts", - "/src/b.d.ts.map", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/src/a.d.ts", "/src/a.d.ts.map", "/src/b.d.ts", "/src/b.d.ts.map"]); assert.equal(result.outputFiles.get(toRootedFilePath("/src/a.d.ts", undefined))?.sourceFileName, "/src/a.ts"); assert.equal(fs.readFile(toRootedFilePath("/src/a.d.ts", undefined)), serverFS.useOS); }); @@ -10726,10 +10715,7 @@ describe("Program - emit", { concurrency }, () => { const snapshot = api.createSnapshot({ openProjects: ["/tsconfig.json"] }); const project = snapshot.getConfiguredProject("/tsconfig.json")!; const result = project.program.emitToString(EmitOnly.OnlyDts); - assert.deepEqual([...result.outputFiles.keys()], [ - "/dist/src/index.d.ts", - "/dist/src/testing.d.ts", - ]); + assert.deepEqual([...result.outputFiles.keys()], ["/dist/src/index.d.ts", "/dist/src/testing.d.ts"]); assert.equal(fs.readFile(toRootedFilePath("/dist/src/index.js", undefined)), serverFS.useOS); }); @@ -10764,16 +10750,10 @@ describe("Program - emit", { concurrency }, () => { assert.ok(fs.fileExists?.(toRootedFilePath("/dist/src/index.d.ts.map", undefined))); const js = project.program.emitToString(EmitOnly.OnlyJs); - assert.deepEqual([...js.outputFiles.keys()], [ - "/dist/src/index.js", - "/dist/src/index.js.map", - ]); + assert.deepEqual([...js.outputFiles.keys()], ["/dist/src/index.js", "/dist/src/index.js.map"]); const dts = project.program.emitToString(EmitOnly.OnlyDts); - assert.deepEqual([...dts.outputFiles.keys()], [ - "/dist/src/index.d.ts", - "/dist/src/index.d.ts.map", - ]); + assert.deepEqual([...dts.outputFiles.keys()], ["/dist/src/index.d.ts", "/dist/src/index.d.ts.map"]); }); test("noEmitOnError reports diagnostics without writing output", () => { diff --git a/packages/typescript/test/sync/ast.test.ts b/packages/typescript/test/sync/ast.test.ts index e71ee4b0847d4..79bea68575797 100644 --- a/packages/typescript/test/sync/ast.test.ts +++ b/packages/typescript/test/sync/ast.test.ts @@ -46,6 +46,7 @@ import { getSynthesizedDeepClone, getSynthesizedDeepClones, } from "@typescript/typescript/ast/clone"; +import * as factory from "@typescript/typescript/ast/factory"; import { cloneNode, createBinaryExpression, @@ -62,7 +63,6 @@ import { createStringLiteral, createToken, } from "@typescript/typescript/ast/factory"; -import * as factory from "@typescript/typescript/ast/factory"; import { visitEachChild, visitNode, diff --git a/packages/typescript/test/sync/astnav.test.ts b/packages/typescript/test/sync/astnav.test.ts index 23fbb4889d156..fa0f69bb940ba 100644 --- a/packages/typescript/test/sync/astnav.test.ts +++ b/packages/typescript/test/sync/astnav.test.ts @@ -6,6 +6,10 @@ // Source: test/async/astnav.test.ts // Regenerate: npm run generate (from packages/typescript) // +import type { + Node, + SourceFile, +} from "@typescript/typescript/ast"; import { findNextToken, findPrecedingToken, @@ -13,10 +17,6 @@ import { getTokenAtPosition, getTouchingPropertyName, } from "@typescript/typescript/ast"; -import type { - Node, - SourceFile, -} from "@typescript/typescript/ast"; import { API } from "@typescript/typescript/sync"; import assert from "node:assert"; import { readFileSync } from "node:fs"; diff --git a/packages/vscode-typescript/package.json b/packages/vscode-typescript/package.json index fc85667031a2a..cd20eb07cb15e 100644 --- a/packages/vscode-typescript/package.json +++ b/packages/vscode-typescript/package.json @@ -418,7 +418,7 @@ "@typescript/typescript": "0.0.0", "@types/vscode": "~1.125.0", "@typescript/bundled-typescript": "npm:typescript@7.0.2", - "@vscode/vsce": "4.1.0", + "@vscode/vsce": "4.1.1", "@vscode/wasm-wasi": "^1.0.2", "esbuild": "^0.28.2" } diff --git a/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts b/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts index a0dabf2062f80..5fa510e0f92dc 100644 --- a/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts +++ b/packages/vscode-typescript/src/workspaceSymbolMiddleware.ts @@ -1,5 +1,5 @@ -import * as vscode from "vscode"; import type { CancellationToken } from "vscode"; +import * as vscode from "vscode"; import type { MessageSignature } from "vscode-languageserver-protocol"; import { isSupportedLanguageMode } from "./util"; diff --git a/tools/go.mod b/tools/go.mod index 78ff453be701b..7716d383ac174 100644 --- a/tools/go.mod +++ b/tools/go.mod @@ -4,10 +4,10 @@ go 1.27 require ( github.com/anchore/quill v0.7.1 - github.com/blacktop/go-macho v1.1.296 + github.com/blacktop/go-macho v1.1.298 github.com/golangci/plugin-module-register v0.1.2 - golang.org/x/mod v0.42.0 - golang.org/x/tools v0.52.0 + golang.org/x/mod v0.43.0 + golang.org/x/tools v0.53.0 gotest.tools/v3 v3.5.2 ) @@ -30,11 +30,11 @@ require ( github.com/scylladb/go-set v1.0.3-0.20200225121959-cc7b2070d91e // indirect github.com/sirupsen/logrus v1.10.2 // indirect github.com/stretchr/testify v1.12.1 // indirect - golang.org/x/crypto v0.58.0 // indirect - golang.org/x/sync v0.24.0 // indirect - golang.org/x/sys v0.49.0 // indirect - golang.org/x/term v0.47.0 // indirect - golang.org/x/text v0.43.0 // indirect + golang.org/x/crypto v0.59.0 // indirect + golang.org/x/sync v0.25.0 // indirect + golang.org/x/sys v0.50.0 // indirect + golang.org/x/term v0.48.0 // indirect + golang.org/x/text v0.44.0 // indirect gotest.tools/gotestsum v1.13.0 // indirect software.sslmate.com/src/go-pkcs12 v0.7.2 // indirect ) diff --git a/tools/go.sum b/tools/go.sum index 8f470cb1fbda4..cbaf78c2c8a2c 100644 --- a/tools/go.sum +++ b/tools/go.sum @@ -10,8 +10,8 @@ github.com/bitfield/gotestdox v0.2.2 h1:x6RcPAbBbErKLnapz1QeAlf3ospg8efBsedU93CD github.com/bitfield/gotestdox v0.2.2/go.mod h1:D+gwtS0urjBrzguAkTM2wodsTQYFHdpx8eqRJ3N+9pY= github.com/blacktop/go-dwarf v1.1.0 h1:mCnIHOVYQ6v+jsiCYv0WYOF96WrDbPJMd/MbOt7+zTE= github.com/blacktop/go-dwarf v1.1.0/go.mod h1:4W2FKgSFYcZLDwnR7k+apv5i3nrau4NGl9N6VQ9DSTo= -github.com/blacktop/go-macho v1.1.296 h1:KFv1JkjaTwLtNEL/7mRGWjjOV1t/1/bVYARzkQd+pGA= -github.com/blacktop/go-macho v1.1.296/go.mod h1:aSp14PbMDypuft8t2+D97hjRVV0mrY1WERGBptuquYs= +github.com/blacktop/go-macho v1.1.298 h1:gFIVMeuI+rgpwnMdbJnWPOsSz+g/3SP0vAHuAE9L5JI= +github.com/blacktop/go-macho v1.1.298/go.mod h1:aSp14PbMDypuft8t2+D97hjRVV0mrY1WERGBptuquYs= github.com/certifi/gocertifi v0.0.0-20180118203423-deb3ae2ef261/go.mod h1:GJKEexRPVJrBSOjoqN5VNOIKJ5Q3RViH6eu3puDRwx4= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= @@ -61,25 +61,25 @@ go.yaml.in/yaml/v3 v3.0.5 h1:N6y/pJk8buWs9NY5ERU2HSMfm+IuD/OtfdAnq6kESPw= go.yaml.in/yaml/v3 v3.0.5/go.mod h1:HVTZu1O7/Vkt2N+BFy8Zza+lnLsABggaTM2ZpNIGuKg= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.58.0 h1:COkYLr4k7nDI4r6QtMML2AfzeIswWHAJthLS6K/M/54= -golang.org/x/crypto v0.58.0/go.mod h1:Xh+kl5A+M0gMiWDytH2Hhr5Z7WbNCpv/eB/EFgfSk+w= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= +golang.org/x/crypto v0.59.0 h1:xS2jhqYbzNrpvkWP2YTDf4TJwBy3ykR03i8vFDxEc7c= +golang.org/x/crypto v0.59.0/go.mod h1:veDyUwATGs3c+vN3VfTbzViMGXeTBk3WyhBOkn+F/4U= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs= +golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= -golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk= +golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= -golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= +golang.org/x/tools v0.53.0 h1:T3bIVp3zjHG9/aEiFk6BXxFh5/Vcbk7JA5hRq1cG8IU= +golang.org/x/tools v0.53.0/go.mod h1:vg+Vrb7y5mTTtxZLTdbTK8G745wcaLcsCtgCWgQONCI= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/tools/pipelines/steps/setup-vsce.yml b/tools/pipelines/steps/setup-vsce.yml index 1160e6cf2f85c..92b36e8fc3f47 100644 --- a/tools/pipelines/steps/setup-vsce.yml +++ b/tools/pipelines/steps/setup-vsce.yml @@ -24,6 +24,6 @@ steps: workingFile: .npmrc displayName: 'Authenticate npm' - - bash: npm install --no-save @vscode/vsce@4.1.0 + - bash: npm install --no-save @vscode/vsce@4.1.1 condition: ${{ parameters.condition }} displayName: 'Install vsce' diff --git a/tools/scripts/tsc/generate-options.ts b/tools/scripts/tsc/generate-options.ts index be733dcf4af25..ff734be30d94c 100644 --- a/tools/scripts/tsc/generate-options.ts +++ b/tools/scripts/tsc/generate-options.ts @@ -354,70 +354,70 @@ function showConfig(): string { return `func serializeCompilerOptions(options *core.CompilerOptions, configFilePath tspath.RootedFilePath, caseSensitivity tspath.CaseSensitivity) *collections.OrderedMap[string, any] { result := collections.NewOrderedMapWithSizeHint[string, any](32) ${ - serializedOptions.map(option => { - const field = `options.${fieldName(option)}`; - const name = JSON.stringify(option.name); - const declaration = option.declaration!; - let value = field; - let condition = `${field} != ${zeroValue(option)}`; - switch (optionKind(option)) { - case "Enum": - return `if ${condition} { + serializedOptions.map(option => { + const field = `options.${fieldName(option)}`; + const name = JSON.stringify(option.name); + const declaration = option.declaration!; + let value = field; + let condition = `${field} != ${zeroValue(option)}`; + switch (optionKind(option)) { + case "Enum": + return `if ${condition} { if value := serializeCompilerOptionEnum(${field}); value != "" { result.Set(${name}, value) } }`; - case "Boolean": - condition = `${field} == core.TSTrue || ${field} == core.TSFalse`; - value = `${field} == core.TSTrue`; - break; - case "String": - if (option.pathKind === "file" || option.pathKind === "directory") { - value = `serializeCompilerOptionPath(${field}.AsPath(), configFilePath, caseSensitivity)`; - } - else if (option.pathKind === "fileOrDirectory") { - value = `serializeCompilerOptionPath(${field}, configFilePath, caseSensitivity)`; - } - break; - case "List": { - const element = options.elements[option.name]; - if (option.pathKind === "directory") { - assert.equal(option.type, "[]string", `Unsupported file path list: ${option.name}`); - value = `core.Map(${field}, func(value tspath.RootedDirectoryPath) string { + case "Boolean": + condition = `${field} == core.TSTrue || ${field} == core.TSFalse`; + value = `${field} == core.TSTrue`; + break; + case "String": + if (option.pathKind === "file" || option.pathKind === "directory") { + value = `serializeCompilerOptionPath(${field}.AsPath(), configFilePath, caseSensitivity)`; + } + else if (option.pathKind === "fileOrDirectory") { + value = `serializeCompilerOptionPath(${field}, configFilePath, caseSensitivity)`; + } + break; + case "List": { + const element = options.elements[option.name]; + if (option.pathKind === "directory") { + assert.equal(option.type, "[]string", `Unsupported file path list: ${option.name}`); + value = `core.Map(${field}, func(value tspath.RootedDirectoryPath) string { if value == "" { return "" } return serializeCompilerOptionPath(value.AsPath(), configFilePath, caseSensitivity) })`; - } - else if (element?.kind === "Enum") { - assert.equal(option.type, "[]string", `Unsupported enum list: ${option.name}`); - value = `serializeCompilerOptionEnumList(${field}, ${options.enumMaps[option.name].goName})`; - } - break; } + else if (element?.kind === "Enum") { + assert.equal(option.type, "[]string", `Unsupported enum list: ${option.name}`); + value = `serializeCompilerOptionEnumList(${field}, ${options.enumMaps[option.name].goName})`; + } + break; } - return `if ${condition} { + } + return `if ${condition} { result.Set(${name}, ${value}) }`; - }).join("\n") - } + }).join("\n") +} return result } func serializeCompilerOptionEnum(value any) string { switch value := value.(type) { ${ - enumOptions.map(option => { - const seen = new Set(); - const entries = options.enumMaps[option.name].values.filter(entry => { - const value = goValue(entry.value); - if (seen.has(value)) return false; - seen.add(value); - return true; - }); - return `case core.${option.type}: + enumOptions.map(option => { + const seen = new Set(); + const entries = options.enumMaps[option.name].values.filter(entry => { + const value = goValue(entry.value); + if (seen.has(value)) return false; + seen.add(value); + return true; + }); + return `case core.${option.type}: ${entries.map(entry => `if value == ${goValue(entry.value)} { return ${JSON.stringify(entry.name)} }`).join("\n")}`; - }).join("\n") - } + }).join("\n") +} } return "" } @@ -429,19 +429,19 @@ function configDirSubstitution(): string { return `func handleOptionConfigDirTemplateSubstitution(compilerOptions *parsedCompilerOptions, basePath tspath.RootedDirectoryPath) { if compilerOptions == nil { return } ${ - substitutedOptions.map(option => { - const field = `compilerOptions.${fieldName(option)}`; - switch (option.type) { - case "string": - return `if startsWithConfigDirTemplate(${field}) { + substitutedOptions.map(option => { + const field = `compilerOptions.${fieldName(option)}`; + switch (option.type) { + case "string": + return `if startsWithConfigDirTemplate(${field}) { ${field} = getSubstitutedPathWithConfigDirTemplate(${field}, basePath) }`; - case "[]string": - return `if substitution := getSubstitutedStringArrayWithConfigDirTemplate(${field}, basePath); substitution != nil { + case "[]string": + return `if substitution := getSubstitutedStringArrayWithConfigDirTemplate(${field}, basePath); substitution != nil { ${field} = substitution }`; - case "*collections.OrderedMap[string, []string]": - return `{ + case "*collections.OrderedMap[string, []string]": + return `{ var paths *collections.OrderedMap[string, []string] for k, v := range ${field}.Entries() { if substitution := getSubstitutedStringArrayWithConfigDirTemplate(v, basePath); substitution != nil { @@ -453,11 +453,11 @@ ${ } } }`; - default: - throw new Error(`Unsupported configDir substitution type for ${option.name}: ${option.type}`); - } - }).join("\n") - } + default: + throw new Error(`Unsupported configDir substitution type for ${option.name}: ${option.type}`); + } + }).join("\n") +} for key, value := range compilerOptions.unresolvedPaths { option := CommandLineCompilerOptionsMap.Get(key) if option.Kind == CommandLineOptionTypeList { @@ -477,16 +477,16 @@ ${ function mergeCompilerOptions(): string { return `func mergeCompilerOptionFields(targetOptions, sourceOptions *core.CompilerOptions, explicitNullFields collections.Set[string]) { ${ - options.compilerOptions.map(option => { - const field = fieldName(option); - const zero = zeroValue(option); - return `if explicitNullFields.Has(${JSON.stringify(option.name)}) { + options.compilerOptions.map(option => { + const field = fieldName(option); + const zero = zeroValue(option); + return `if explicitNullFields.Has(${JSON.stringify(option.name)}) { targetOptions.${field} = ${zero} } else if sourceOptions.${field} != ${zero} { targetOptions.${field} = sourceOptions.${field} }`; - }).join("\n") - } + }).join("\n") +} } `; } @@ -500,17 +500,17 @@ import "github.com/microsoft/TypeScript/tsc/internal/core" func setOptionsForTranspile(options *core.CompilerOptions, declaration bool) { ${ - transformedOptions.map(option => { - const { value, declarationValue, unless } = option.transpile!; - const field = `options.${fieldName(option)}`; - const assigned = value === "clear" ? zeroValue(option) : value ? "core.TSTrue" : "core.TSFalse"; - let code = `${field} = ${assigned}`; - if (declarationValue === "preserve") code = `if !declaration { ${code} }`; - else if (declarationValue !== undefined) code = `if declaration { ${field} = ${declarationValue ? "core.TSTrue" : "core.TSFalse"} } else { ${code} }`; - if (unless) code = `if !options.${fieldName(options.compilerOptions.find(option => option.name === unless)!)}.IsTrue() { ${code} }`; - return code; - }).join("\n") - } + transformedOptions.map(option => { + const { value, declarationValue, unless } = option.transpile!; + const field = `options.${fieldName(option)}`; + const assigned = value === "clear" ? zeroValue(option) : value ? "core.TSTrue" : "core.TSFalse"; + let code = `${field} = ${assigned}`; + if (declarationValue === "preserve") code = `if !declaration { ${code} }`; + else if (declarationValue !== undefined) code = `if declaration { ${field} = ${declarationValue ? "core.TSTrue" : "core.TSFalse"} } else { ${code} }`; + if (unless) code = `if !options.${fieldName(options.compilerOptions.find(option => option.name === unless)!)}.IsTrue() { ${code} }`; + return code; + }).join("\n") +} } `; } @@ -520,12 +520,10 @@ function generateBuildInfoOptions(): string { return `// ForEachCompilerOptionAffectingBuildInfo visits nonzero options in CompilerOptions field order. func ForEachCompilerOptionAffectingBuildInfo(options *core.CompilerOptions, fn func(option *CommandLineOption, value any)) { ${ - storedOptions.map(option => - `if options.${fieldName(option)} != ${zeroValue(option)} { + storedOptions.map(option => `if options.${fieldName(option)} != ${zeroValue(option)} { fn(CommandLineCompilerOptionsMap.Get(${JSON.stringify(option.name)}), options.${fieldName(option)}) -}` - ).join("\n") - } +}`).join("\n") +} } `; } @@ -572,13 +570,13 @@ function enumStrings(): string { case 0: panic("should not use zero value of ${enumDef.name}") ${ - enumDef.members.filter(member => typeof member.value === "number" && member.value !== 0).map(member => { - const constant = `${enumDef.name}${member.name}`; - const text = stringer === "name" ? member.name : options.enumMaps[stringer.enumMap].values.find(entry => typeof entry.value === "object" && entry.value.go === `core.${constant}`)?.name; - assert(text, `Missing display name for ${constant}`); - return `case ${constant}: return ${JSON.stringify(text)}`; - }).join("\n") - } + enumDef.members.filter(member => typeof member.value === "number" && member.value !== 0).map(member => { + const constant = `${enumDef.name}${member.name}`; + const text = stringer === "name" ? member.name : options.enumMaps[stringer.enumMap].values.find(entry => typeof entry.value === "object" && entry.value.go === `core.${constant}`)?.name; + assert(text, `Missing display name for ${constant}`); + return `case ${constant}: return ${JSON.stringify(text)}`; + }).join("\n") + } default: panic("unhandled case in ${enumDef.name}.String") } @@ -589,14 +587,12 @@ function enumStrings(): string { function numericEnums(): string { return `${ - options.enums.map(enumDef => - `type ${enumDef.name} int32 + options.enums.map(enumDef => `type ${enumDef.name} int32 const ( ${enumDef.members.map(member => `${member.comment ? "// " + member.comment.replaceAll("\n", "\n// ") + "\n" : ""}${enumDef.name}${member.name} ${enumDef.name} = ${typeof member.value === "number" ? member.value : enumDef.name + member.value}${member.trailingComment ? " // " + member.trailingComment : ""}`).join("\n")} ) -` - ).join("\n") +`).join("\n") } var ModuleKindToModuleResolutionKind = map[ModuleKind]ModuleResolutionKind{ @@ -758,12 +754,12 @@ func getDefaultCompilerOptions(configFileName tspath.RootedFilePath) *parsedComp if configFileName != "" && configFileName.BaseName() == "jsconfig.json" { options = &core.CompilerOptions{ ${ - options.compilerOptions.filter(option => option.jsconfigDefault !== undefined).map(option => { - const value = option.jsconfigDefault!; - const expression = typeof value === "boolean" ? `core.TS${value ? "True" : "False"}` : typeof value === "number" ? `new(${value})` : JSON.stringify(value); - return `${fieldName(option)}: ${expression},`; - }).join("\n") - } + options.compilerOptions.filter(option => option.jsconfigDefault !== undefined).map(option => { + const value = option.jsconfigDefault!; + const expression = typeof value === "boolean" ? `core.TS${value ? "True" : "False"}` : typeof value === "number" ? `new(${value})` : JSON.stringify(value); + return `${fieldName(option)}: ${expression},`; + }).join("\n") + } } } return &parsedCompilerOptions{ @@ -878,11 +874,11 @@ import "github.com/microsoft/TypeScript/tsc/internal/collections" var compilerVaryBy = collections.NewSetFromItems( ${ - options.compilerOptions.filter(option => - option.declaration && !option.declaration.isCommandLineOnly && - (optionKind(option) === "Boolean" || optionKind(option) === "Enum") - ).map(option => option.name.toLowerCase()).sort().map(name => `${JSON.stringify(name)},`).join("\n") - } + options.compilerOptions.filter(option => + option.declaration && !option.declaration.isCommandLineOnly && + (optionKind(option) === "Boolean" || optionKind(option) === "Enum") + ).map(option => option.name.toLowerCase()).sort().map(name => `${JSON.stringify(name)},`).join("\n") +} ) `, ], diff --git a/tsc/go.mod b/tsc/go.mod index cf6c847268a57..c5975f36c94fc 100644 --- a/tsc/go.mod +++ b/tsc/go.mod @@ -5,14 +5,14 @@ go 1.27 require ( github.com/Microsoft/go-winio v0.6.4 github.com/google/go-cmp v0.7.0 - github.com/klauspost/compress v1.20.3 + github.com/klauspost/compress v1.20.5 github.com/mackerelio/go-osstat v0.2.8 github.com/peter-evans/patience v0.3.0 github.com/zeebo/xxh3 v1.1.0 - golang.org/x/sync v0.24.0 - golang.org/x/sys v0.49.0 - golang.org/x/term v0.47.0 - golang.org/x/text v0.43.0 + golang.org/x/sync v0.25.0 + golang.org/x/sys v0.50.0 + golang.org/x/term v0.48.0 + golang.org/x/text v0.44.0 gotest.tools/v3 v3.5.2 ) @@ -20,8 +20,8 @@ require ( github.com/klauspost/cpuid/v2 v2.2.10 // indirect github.com/matryer/moq v0.8.1 // indirect github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect - golang.org/x/mod v0.42.0 // indirect - golang.org/x/tools v0.52.0 // indirect + golang.org/x/mod v0.43.0 // indirect + golang.org/x/tools v0.53.0 // indirect ) tool ( diff --git a/tsc/go.sum b/tsc/go.sum index 5570ad7f447d0..7ad7630470530 100644 --- a/tsc/go.sum +++ b/tsc/go.sum @@ -2,8 +2,8 @@ github.com/Microsoft/go-winio v0.6.4 h1:kJF2pamtYCWXf0xAT8sAkwKC0pMl2HYBrRPHAqyU github.com/Microsoft/go-winio v0.6.4/go.mod h1:1xl5JXG4ze/m74GH6Dc4Mwxfc3VL5siRVQjIAlHH07U= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= -github.com/klauspost/compress v1.20.3 h1:zWNoFqq/lSuYQRim3dUXlXeA0IqwuZGicdG5ZTfY5j4= -github.com/klauspost/compress v1.20.3/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= +github.com/klauspost/compress v1.20.5 h1:rJj5VjH4xQxbnLphg6eqUcDxRFCw1jpMdDY9qXlrwSs= +github.com/klauspost/compress v1.20.5/go.mod h1:LUdAzn7YLVvxLpc7y3V1m40wESHTgc1422pwwBSKYuI= github.com/klauspost/cpuid/v2 v2.2.10 h1:tBs3QSyvjDyFTq3uoc/9xFpCuOsJQFNPiAhYdw2skhE= github.com/klauspost/cpuid/v2 v2.2.10/go.mod h1:hqwkgyIinND0mEev00jJYCxPNVRVXFQeu1XKlok6oO0= github.com/mackerelio/go-osstat v0.2.8 h1:I2duicTaCGWoM53XwAwA9OIe1inu0xnVs8/pqOWWVr4= @@ -18,17 +18,17 @@ github.com/zeebo/assert v1.3.0 h1:g7C04CbJuIDKNPFHmsk4hwZDO5O+kntRxzaUoNXj+IQ= github.com/zeebo/assert v1.3.0/go.mod h1:Pq9JiuJQpG8JLJdtkwrJESF0Foym2/D9XMU5ciN/wJ0= github.com/zeebo/xxh3 v1.1.0 h1:s7DLGDK45Dyfg7++yxI0khrfwq9661w9EN78eP/UZVs= github.com/zeebo/xxh3 v1.1.0/go.mod h1:IisAie1LELR4xhVinxWS5+zf1lA4p0MW4T+w+W07F5s= -golang.org/x/mod v0.42.0 h1:ICeL3t2L30ljSPHHxDnR4fqVcBt/zR2zJAb9juavmQg= -golang.org/x/mod v0.42.0/go.mod h1:u5fzIrRInkL8MaO1cbRkUHT64v303YIT5KEqpNr7jRs= -golang.org/x/sync v0.24.0 h1:iqiDrGoDgyuvAKrhLQthUEzU/R378N78gXbBjxed7oA= -golang.org/x/sync v0.24.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= -golang.org/x/sys v0.49.0 h1:XbzkgYJHdqh/8m2Uu0W/dQv8nktxx4BFHp1M0gROTXA= -golang.org/x/sys v0.49.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= -golang.org/x/term v0.47.0 h1:cpyOwQkr2Nzxe2p6KnrTG7Ei2wtzjsuSjhpXXepZ/BM= -golang.org/x/term v0.47.0/go.mod h1:efAfAuG6RKABvg1ArGebRkvX6LXul14SM67o2e4mUCY= -golang.org/x/text v0.43.0 h1:1QivrlhwAsnMOcqgOdl9my7s9OyZl8O5/UGUTJVXoWc= -golang.org/x/text v0.43.0/go.mod h1:hbSIYA/amXcRXTFSZqh8tWHEoqRvvbKPJ2uz/KU+a+s= -golang.org/x/tools v0.52.0 h1:ryxg4U63oaUYk7uOLTF37n43f4qgtGvqV4Ioit1BaEs= -golang.org/x/tools v0.52.0/go.mod h1:ItcP5UNaVGG+Yc4eIYmaFLNJ4soEopkx5Y2d4lcEurs= +golang.org/x/mod v0.43.0 h1:MFuq5J6s35W9D3IjkwyWc9vHh0nENOrt5K8Iof4ofmg= +golang.org/x/mod v0.43.0/go.mod h1:4ec1JnuyBz5+FIVhg86UsA39YG8BpnrZdJYSNHmGzHY= +golang.org/x/sync v0.25.0 h1:dJnifr0nMV8/SBnBvdo4eSGGnrc3O4FFx6IqvtLcmRs= +golang.org/x/sync v0.25.0/go.mod h1:sUUOizhqBxiL6pEWpqNLUiaJn1ShEbZ6BBqskPbjZm0= +golang.org/x/sys v0.50.0 h1:dkKZEFTEKaLr1sjhs0WiKqoi8Jj5nHbS3Njmx1UoMJs= +golang.org/x/sys v0.50.0/go.mod h1:hNLxWAXmnKAxqDtdwIYC4bM9oQPEecfsnNMuSxOs3og= +golang.org/x/term v0.48.0 h1:G6UU1eiSB8nl3DzeUGt7Mg+2SctI8tPS6Z5/mBt6cOk= +golang.org/x/term v0.48.0/go.mod h1:BRDLHCZr2SUjIeBHHpRyQeC9xzSAVbzY2rvKgafnHf4= +golang.org/x/text v0.44.0 h1:YItdp/mQNGnsmrgpcdA5yQ3bnRxCfo/Tj/iByGW9GGo= +golang.org/x/text v0.44.0/go.mod h1:S4FR1waQ9LbjQTls97SyRjDaUUVkaM+cXwwuG/G+MwY= +golang.org/x/tools v0.53.0 h1:T3bIVp3zjHG9/aEiFk6BXxFh5/Vcbk7JA5hRq1cG8IU= +golang.org/x/tools v0.53.0/go.mod h1:vg+Vrb7y5mTTtxZLTdbTK8G745wcaLcsCtgCWgQONCI= gotest.tools/v3 v3.5.2 h1:7koQfIKdy+I8UTetycgUqXWSDwpgv193Ka+qRsmBY8Q= gotest.tools/v3 v3.5.2/go.mod h1:LtdLGcnqToBH83WByAAi/wiwSFCArdFIUV/xxN4pcjA= diff --git a/tsc/internal/diagnostics/loc/cs-CZ.json.gz b/tsc/internal/diagnostics/loc/cs-CZ.json.gz index d20f99809de9f..5947ac358a6a0 100644 Binary files a/tsc/internal/diagnostics/loc/cs-CZ.json.gz and b/tsc/internal/diagnostics/loc/cs-CZ.json.gz differ diff --git a/tsc/internal/diagnostics/loc/de-DE.json.gz b/tsc/internal/diagnostics/loc/de-DE.json.gz index 4373adb189376..15980a9914a05 100644 Binary files a/tsc/internal/diagnostics/loc/de-DE.json.gz and b/tsc/internal/diagnostics/loc/de-DE.json.gz differ diff --git a/tsc/internal/diagnostics/loc/es-ES.json.gz b/tsc/internal/diagnostics/loc/es-ES.json.gz index ebde62fff12ed..35775e19bccf9 100644 Binary files a/tsc/internal/diagnostics/loc/es-ES.json.gz and b/tsc/internal/diagnostics/loc/es-ES.json.gz differ diff --git a/tsc/internal/diagnostics/loc/fr-FR.json.gz b/tsc/internal/diagnostics/loc/fr-FR.json.gz index 4a23d7575cdf2..5fd66a5250471 100644 Binary files a/tsc/internal/diagnostics/loc/fr-FR.json.gz and b/tsc/internal/diagnostics/loc/fr-FR.json.gz differ diff --git a/tsc/internal/diagnostics/loc/it-IT.json.gz b/tsc/internal/diagnostics/loc/it-IT.json.gz index 876c1156834fc..73c9537844a38 100644 Binary files a/tsc/internal/diagnostics/loc/it-IT.json.gz and b/tsc/internal/diagnostics/loc/it-IT.json.gz differ diff --git a/tsc/internal/diagnostics/loc/ja-JP.json.gz b/tsc/internal/diagnostics/loc/ja-JP.json.gz index 78b88fa86c122..1dd403aff3877 100644 Binary files a/tsc/internal/diagnostics/loc/ja-JP.json.gz and b/tsc/internal/diagnostics/loc/ja-JP.json.gz differ diff --git a/tsc/internal/diagnostics/loc/ko-KR.json.gz b/tsc/internal/diagnostics/loc/ko-KR.json.gz index 2b448217dab84..27952a4fc6411 100644 Binary files a/tsc/internal/diagnostics/loc/ko-KR.json.gz and b/tsc/internal/diagnostics/loc/ko-KR.json.gz differ diff --git a/tsc/internal/diagnostics/loc/pl-PL.json.gz b/tsc/internal/diagnostics/loc/pl-PL.json.gz index e5181f0774bd5..d921969066c07 100644 Binary files a/tsc/internal/diagnostics/loc/pl-PL.json.gz and b/tsc/internal/diagnostics/loc/pl-PL.json.gz differ diff --git a/tsc/internal/diagnostics/loc/pt-BR.json.gz b/tsc/internal/diagnostics/loc/pt-BR.json.gz index 1e880d7b2db3c..c0a32fd4e41df 100644 Binary files a/tsc/internal/diagnostics/loc/pt-BR.json.gz and b/tsc/internal/diagnostics/loc/pt-BR.json.gz differ diff --git a/tsc/internal/diagnostics/loc/ru-RU.json.gz b/tsc/internal/diagnostics/loc/ru-RU.json.gz index 9d397b6fa1071..bbd8f1f89e1a0 100644 Binary files a/tsc/internal/diagnostics/loc/ru-RU.json.gz and b/tsc/internal/diagnostics/loc/ru-RU.json.gz differ diff --git a/tsc/internal/diagnostics/loc/tr-TR.json.gz b/tsc/internal/diagnostics/loc/tr-TR.json.gz index 194afd5be0bb6..182996ed9689a 100644 Binary files a/tsc/internal/diagnostics/loc/tr-TR.json.gz and b/tsc/internal/diagnostics/loc/tr-TR.json.gz differ diff --git a/tsc/internal/diagnostics/loc/zh-CN.json.gz b/tsc/internal/diagnostics/loc/zh-CN.json.gz index 39a70e12ba1b7..24e37aa64791e 100644 Binary files a/tsc/internal/diagnostics/loc/zh-CN.json.gz and b/tsc/internal/diagnostics/loc/zh-CN.json.gz differ diff --git a/tsc/internal/diagnostics/loc/zh-TW.json.gz b/tsc/internal/diagnostics/loc/zh-TW.json.gz index 67f878f942ec5..ebf27439665e0 100644 Binary files a/tsc/internal/diagnostics/loc/zh-TW.json.gz and b/tsc/internal/diagnostics/loc/zh-TW.json.gz differ