diff --git a/package-lock.json b/package-lock.json index 3dbac0a62..c3a741681 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,7 +30,7 @@ "eslint-plugin-n": "^17.14.0", "prettier": "^3.4.1", "turbo": "^2.3.3", - "typescript": "5.6.3" + "typescript": "5.7.2" } }, "node_modules/@ampproject/remapping": { @@ -2005,12 +2005,12 @@ } }, "node_modules/@types/node": { - "version": "22.9.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.9.3.tgz", - "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", + "version": "22.10.1", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.10.1.tgz", + "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", "license": "MIT", "dependencies": { - "undici-types": "~6.19.8" + "undici-types": "~6.20.0" } }, "node_modules/@types/node-forge": { @@ -2021,6 +2021,12 @@ "@types/node": "*" } }, + "node_modules/@types/node/node_modules/undici-types": { + "version": "6.20.0", + "resolved": "https://registry.npmmirror.com/undici-types/-/undici-types-6.20.0.tgz", + "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", + "license": "MIT" + }, "node_modules/@types/normalize-package-data": { "version": "2.4.4", "dev": true, @@ -10660,6 +10666,10 @@ "resolved": "packages/typescript-compat/v5.5.x", "link": true }, + "node_modules/ts5.6": { + "resolved": "packages/typescript-compat/v5.6.x", + "link": true + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "dev": true, @@ -10901,9 +10911,9 @@ } }, "node_modules/typescript": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", - "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "version": "5.7.2", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.7.2.tgz", + "integrity": "sha512-i5t66RHxDvVN40HfDd1PsEThGNnlMCMT3jMUuoh9/0TaqWevNontacunWyN02LA9/fIbEWlcHZcgTKb9QoaLfg==", "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", @@ -11962,7 +11972,7 @@ "@bufbuild/buf": "^1.47.2", "@bufbuild/protoc-gen-es": "^2.2.2", "esbuild": "^0.19.8", - "typescript": "^5.6.3" + "typescript": "^5.7.2" }, "engines": { "node": ">=18.14.1" @@ -11978,12 +11988,12 @@ } }, "packages/typescript-compat/v4.9.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", + "version": "22.9.3", + "resolved": "https://registry.npmmirror.com/@types/node/-/node-22.9.3.tgz", + "integrity": "sha512-F3u1fs/fce3FFk+DAxbxc78DF8x0cY09RRL8GnXLmkJ1jvx3TtPdWoTT5/NiYfI5ASqXBmfqJi9dZ3gxMx4lzw==", "license": "MIT", "dependencies": { - "undici-types": "~6.20.0" + "undici-types": "~6.19.8" } }, "packages/typescript-compat/v4.9.x/node_modules/typescript": { @@ -11997,12 +12007,6 @@ "node": ">=4.2.0" } }, - "packages/typescript-compat/v4.9.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.0.x": { "name": "ts5.0", "dependencies": { @@ -12012,15 +12016,6 @@ "typescript": "5.0.x" } }, - "packages/typescript-compat/v5.0.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.0.x/node_modules/typescript": { "version": "5.0.4", "license": "Apache-2.0", @@ -12032,12 +12027,6 @@ "node": ">=12.20" } }, - "packages/typescript-compat/v5.0.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.1.x": { "name": "ts5.1", "dependencies": { @@ -12047,15 +12036,6 @@ "typescript": "5.1.x" } }, - "packages/typescript-compat/v5.1.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.1.x/node_modules/typescript": { "version": "5.1.6", "license": "Apache-2.0", @@ -12067,12 +12047,6 @@ "node": ">=14.17" } }, - "packages/typescript-compat/v5.1.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.2.x": { "name": "ts5.2", "dependencies": { @@ -12082,15 +12056,6 @@ "typescript": "5.2.x" } }, - "packages/typescript-compat/v5.2.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.2.x/node_modules/typescript": { "version": "5.2.2", "license": "Apache-2.0", @@ -12102,12 +12067,6 @@ "node": ">=14.17" } }, - "packages/typescript-compat/v5.2.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.3.x": { "name": "ts5.3", "dependencies": { @@ -12117,15 +12076,6 @@ "typescript": "5.3.x" } }, - "packages/typescript-compat/v5.3.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.3.x/node_modules/typescript": { "version": "5.3.3", "license": "Apache-2.0", @@ -12137,12 +12087,6 @@ "node": ">=14.17" } }, - "packages/typescript-compat/v5.3.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.4.x": { "name": "ts5.4", "dependencies": { @@ -12152,15 +12096,6 @@ "typescript": "5.4.x" } }, - "packages/typescript-compat/v5.4.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.4.x/node_modules/typescript": { "version": "5.4.5", "license": "Apache-2.0", @@ -12172,12 +12107,6 @@ "node": ">=14.17" } }, - "packages/typescript-compat/v5.4.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" - }, "packages/typescript-compat/v5.5.x": { "name": "ts5.5", "dependencies": { @@ -12187,15 +12116,6 @@ "typescript": "5.5.x" } }, - "packages/typescript-compat/v5.5.x/node_modules/@types/node": { - "version": "22.10.1", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.10.1.tgz", - "integrity": "sha512-qKgsUwfHZV2WCWLAnVP1JqnpE6Im6h3Y0+fYgMTasNQ7V++CBX5OT1as0g0f+OyubbFqhf6XVNIsmN4IIhEgGQ==", - "license": "MIT", - "dependencies": { - "undici-types": "~6.20.0" - } - }, "packages/typescript-compat/v5.5.x/node_modules/typescript": { "version": "5.5.4", "license": "Apache-2.0", @@ -12207,11 +12127,27 @@ "node": ">=14.17" } }, - "packages/typescript-compat/v5.5.x/node_modules/undici-types": { - "version": "6.20.0", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz", - "integrity": "sha512-Ny6QZ2Nju20vw1SRHe3d9jVu6gJ+4e3+MMpqu7pqE5HT6WsTSlce++GQmK5UXS8mzV8DSYHrQH+Xrf2jVcuKNg==", - "license": "MIT" + "packages/typescript-compat/v5.6.x": { + "name": "ts5.6", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.10.1", + "typescript": "5.6.x" + } + }, + "packages/typescript-compat/v5.6.x/node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmmirror.com/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } } } } diff --git a/package.json b/package.json index 5f9a12986..bf9c84312 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,6 @@ "eslint-plugin-n": "^17.14.0", "turbo": "^2.3.3", "prettier": "^3.4.1", - "typescript": "5.6.3" + "typescript": "5.7.2" } } diff --git a/packages/connect-conformance/bin/connectconformance.cjs b/packages/connect-conformance/bin/connectconformance.cjs index 1a1f1a1cf..e5097d326 100755 --- a/packages/connect-conformance/bin/connectconformance.cjs +++ b/packages/connect-conformance/bin/connectconformance.cjs @@ -14,6 +14,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -const { run } = require("../dist/cjs/src/conformance.js"); +const { run } = require("../dist/cjs/conformance.js"); +const { scripts } = require("../package.json"); -run(); +// Extract conformance runner version from the `generate` script +const [, version] = /conformance:(v\d+\.\d+\.\d+)/.exec(scripts.generate) ?? [ + "?", +]; + +run(version); diff --git a/packages/connect-conformance/package.json b/packages/connect-conformance/package.json index cba7bab4f..758601733 100644 --- a/packages/connect-conformance/package.json +++ b/packages/connect-conformance/package.json @@ -3,11 +3,11 @@ "version": "2.0.0", "private": true, "type": "module", - "main": "./dist/cjs/src/index.js", + "main": "./dist/cjs/index.js", "exports": { ".": { - "import": "./dist/esm/src/index.js", - "require": "./dist/cjs/src/index.js" + "import": "./dist/esm/index.js", + "require": "./dist/cjs/index.js" } }, "bin": { @@ -19,7 +19,7 @@ "prebuild": "rm -rf ./dist/*", "build": "npm run build:cjs && npm run build:esm", "postbuild": "connectconformance --version", - "build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/src/package.json '{\"type\":\"commonjs\"}'", + "build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'", "build:esm": "tsc --project tsconfig.json --outDir ./dist/esm", "format": "prettier --write --ignore-unknown '.' '!dist' '!src/gen'", "license-header": "license-header", diff --git a/packages/connect-conformance/src/conformance.ts b/packages/connect-conformance/src/conformance.ts index 8c55adab6..379f17746 100644 --- a/packages/connect-conformance/src/conformance.ts +++ b/packages/connect-conformance/src/conformance.ts @@ -26,13 +26,8 @@ import * as tar from "tar-stream"; import { pipeline } from "node:stream/promises"; import { Readable } from "node:stream"; import { execFileSync } from "node:child_process"; -import { scripts } from "../package.json"; -export async function run() { - // Extract conformance runner version from the `generate` script - const [, version] = /conformance:(v\d+\.\d+\.\d+)/.exec(scripts.generate) ?? [ - "?", - ]; +export async function run(version: string) { const { archive, bin } = getArtifactNameForEnv(version); const tempDir = getTempDir(version); const binPath = joinPath(tempDir, bin); diff --git a/packages/example/package.json b/packages/example/package.json index acd69379e..ba7d5e6ee 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -24,6 +24,6 @@ "@bufbuild/buf": "^1.47.2", "@bufbuild/protoc-gen-es": "^2.2.2", "esbuild": "^0.19.8", - "typescript": "^5.6.3" + "typescript": "^5.7.2" } } diff --git a/packages/typescript-compat/v5.6.x/package.json b/packages/typescript-compat/v5.6.x/package.json new file mode 100644 index 000000000..c63a08bf1 --- /dev/null +++ b/packages/typescript-compat/v5.6.x/package.json @@ -0,0 +1,13 @@ +{ + "name": "ts5.6", + "private": true, + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.10.1", + "typescript": "5.6.x" + } +} diff --git a/packages/typescript-compat/v5.6.x/tsconfig.json b/packages/typescript-compat/v5.6.x/tsconfig.json new file mode 100644 index 000000000..9ad81dc17 --- /dev/null +++ b/packages/typescript-compat/v5.6.x/tsconfig.json @@ -0,0 +1,22 @@ +{ + "include": [ + "../../connect-conformance/src/index.ts", + "../../example/src/**/*.ts" + ], + // These are the default compiler options for TypeScript v5.4.x, created + // with `tsc --init` (except where noted in comments below) + "compilerOptions": { + "target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + "module": "commonjs", /* Specify what module code is generated. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + "strict": true, /* Enable all strict type-checking options. */ + // To guard against regression and ensure we are remaining backwards + // compatible, set the skipLibCheck flag to false explicitly. + "skipLibCheck": false, + // Certain errors are only triggered by actually emitting declaration files, + // see https://github.com/bufbuild/protobuf-es/pull/398 + "declaration": true, + "declarationMap": true + } +}