diff --git a/.gitignore b/.gitignore index 98f977560..cda848b02 100644 --- a/.gitignore +++ b/.gitignore @@ -2,5 +2,6 @@ .wrangler node_modules /packages/*/dist +/packages/typescript-compat/*/dist /packages/connect-web/conformance/logs/* packages/connect-web/local.log diff --git a/README.md b/README.md index e84085243..57dbe76e4 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ be more than happy to chat! - [@connectrpc/connect-express](https://www.npmjs.com/package/@connectrpc/connect-express): Adds your services to an [Express](https://expressjs.com/) server. -The libraries and the generated code are compatible with ES2017 and TypeScript 4.1. +The libraries and the generated code are compatible with ES2017 and TypeScript 4.9.5. ## Ecosystem diff --git a/package-lock.json b/package-lock.json index cb721401b..67c47f64a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,8 @@ "packages/example", "packages/connect-migrate", "packages/connect-conformance", - "packages/connect-cloudflare" + "packages/connect-cloudflare", + "packages/typescript-compat/*" ], "devDependencies": { "@arethetypeswrong/cli": "^0.15.3", @@ -8866,6 +8867,30 @@ "dev": true, "license": "MIT" }, + "node_modules/ts4.9": { + "resolved": "packages/typescript-compat/v4.9.x", + "link": true + }, + "node_modules/ts5.0": { + "resolved": "packages/typescript-compat/v5.0.x", + "link": true + }, + "node_modules/ts5.1": { + "resolved": "packages/typescript-compat/v5.1.x", + "link": true + }, + "node_modules/ts5.2": { + "resolved": "packages/typescript-compat/v5.2.x", + "link": true + }, + "node_modules/ts5.3": { + "resolved": "packages/typescript-compat/v5.3.x", + "link": true + }, + "node_modules/ts5.4": { + "resolved": "packages/typescript-compat/v5.4.x", + "link": true + }, "node_modules/tsconfig-paths": { "version": "3.15.0", "dev": true, @@ -9963,6 +9988,231 @@ "engines": { "node": ">=18.14.1" } + }, + "packages/protoc-gen-connect-es": { + "extraneous": true + }, + "packages/typescript-compat/v4.9.x": { + "name": "ts4.9", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "4.9.x" + } + }, + "packages/typescript-compat/v4.9.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v4.9.x/node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } + }, + "packages/typescript-compat/v4.9.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "packages/typescript-compat/v5.0.x": { + "name": "ts5.0", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.0.x" + } + }, + "packages/typescript-compat/v5.0.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v5.0.x/node_modules/typescript": { + "version": "5.0.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", + "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=12.20" + } + }, + "packages/typescript-compat/v5.0.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "packages/typescript-compat/v5.1.x": { + "name": "ts5.1", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.1.x" + } + }, + "packages/typescript-compat/v5.1.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v5.1.x/node_modules/typescript": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.6.tgz", + "integrity": "sha512-zaWCozRZ6DLEWAWFrVDz1H6FVXzUSfTy5FUMWsQlU8Ym5JP9eO4xkTIROFCQvhQf61z6O/G6ugw3SgAnvvm+HA==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/typescript-compat/v5.1.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "packages/typescript-compat/v5.2.x": { + "name": "ts5.2", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.2.x" + } + }, + "packages/typescript-compat/v5.2.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v5.2.x/node_modules/typescript": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz", + "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/typescript-compat/v5.2.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "packages/typescript-compat/v5.3.x": { + "name": "ts5.3", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.3.x" + } + }, + "packages/typescript-compat/v5.3.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v5.3.x/node_modules/typescript": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz", + "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/typescript-compat/v5.3.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" + }, + "packages/typescript-compat/v5.4.x": { + "name": "ts5.4", + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.4.x" + } + }, + "packages/typescript-compat/v5.4.x/node_modules/@types/node": { + "version": "22.5.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.5.4.tgz", + "integrity": "sha512-FDuKUJQm/ju9fT/SeX/6+gBzoPzlVCzfzmGkwKvRHQVxi4BntVbyIwf6a4Xn62mrvndLiml6z/UBXIdEVjQLXg==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.19.2" + } + }, + "packages/typescript-compat/v5.4.x/node_modules/typescript": { + "version": "5.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz", + "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==", + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "packages/typescript-compat/v5.4.x/node_modules/undici-types": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", + "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==", + "license": "MIT" } } } diff --git a/package.json b/package.json index f34e11290..1d101c9c0 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "packages/example", "packages/connect-migrate", "packages/connect-conformance", - "packages/connect-cloudflare" + "packages/connect-cloudflare", + "packages/typescript-compat/*" ], "scripts": { "all": "turbo run --ui tui build format test conformance bundle-size lint attw license-header", diff --git a/packages/example/src/server.ts b/packages/example/src/server.ts index eef1c4a5a..04b39bea5 100644 --- a/packages/example/src/server.ts +++ b/packages/example/src/server.ts @@ -21,7 +21,7 @@ import type { ConverseRequest, } from "./gen/eliza_pb.js"; import * as esbuild from "esbuild"; -import http2 from "http2"; +import * as http2 from "http2"; import { readFileSync } from "fs"; import { stdout } from "process"; diff --git a/packages/typescript-compat/README.md b/packages/typescript-compat/README.md new file mode 100644 index 000000000..2f995a143 --- /dev/null +++ b/packages/typescript-compat/README.md @@ -0,0 +1,47 @@ +# TypeScript compatibility tests + +Each package in this directory tests compatibility with a TypeScript version. + +Our compatibility tests use the default settings for `tsconfig.json` that are +generated by running `tsc --init` (with a few minor exceptions). As a result, +for any version we support, we inherently support the default settings +respective to that version of TypeScript. + +### Which versions are tested + +- the earliest TypeScript version we support +- the latest patch release of all minor versions up to the current release + +### Adding a new version + +To add a new minor or major version of TypeScript to the tests, copy the directory +with the latest version, and make the following updates: + +#### package.json + +- Set an appropriate "name" field, for example `"ts5.2.x"`. +- Set the version constraint for the `typescript` dependency, for example `"5.2.x"`. +- Set the version for the `@types/node` dependency. The package uses dist-tags + to tag releases for older TypeScript versions. You have to look up the + corresponding version number on https://www.npmjs.com/package/@types/node?activeTab=versions. + +Delete the `node_modules` directory in the package if it exists, and run `npm install` +from the repository root. + +#### tsconfig.json + +Generate a new `tsconfig.json` with default values with `node_modules/.bin/tsc --init`, +and merge it with the existing one: +- We want to use the default target, module, and other settings. +- We have to include the test sources. +- We explicitly want to emit declaration and declaration maps, because some + transpilation issues only occur when emitting them. +- We explicitly want to check libs. + +### Running and maintaining the tests + +Run `npx turbo run test -F './packages/typescript-compat/*'` to run all tests. + +Unfortunately, `npm` has no mechanism to pin to a dist-tag for `@types/node`, +but the actual version is a moving target. It is necessary to manually verify +that we still use appropriate versions. diff --git a/packages/typescript-compat/v4.9.x/package.json b/packages/typescript-compat/v4.9.x/package.json new file mode 100644 index 000000000..1c1b43190 --- /dev/null +++ b/packages/typescript-compat/v4.9.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts4.9", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "4.9.x" + } +} diff --git a/packages/typescript-compat/v4.9.x/tsconfig.json b/packages/typescript-compat/v4.9.x/tsconfig.json new file mode 100644 index 000000000..6a3b765ba --- /dev/null +++ b/packages/typescript-compat/v4.9.x/tsconfig.json @@ -0,0 +1,24 @@ +{ + "include": [ + "../../connect-conformance/src/index.ts", + "../../example/src/**/*.ts" + ], + // These are the default compiler options for TypeScript v4.9.x, created + // with `tsc --init` (except where noted in comments below) + "compilerOptions": { + // By default, target is es5. For iterables, we need target 2015 or higher, + // or downLevelIteration. + "target": "es2015", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + // 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 + } +} diff --git a/packages/typescript-compat/v5.0.x/package.json b/packages/typescript-compat/v5.0.x/package.json new file mode 100644 index 000000000..b8fc84cc2 --- /dev/null +++ b/packages/typescript-compat/v5.0.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts5.0", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.0.x" + } +} diff --git a/packages/typescript-compat/v5.0.x/tsconfig.json b/packages/typescript-compat/v5.0.x/tsconfig.json new file mode 100644 index 000000000..2d73702db --- /dev/null +++ b/packages/typescript-compat/v5.0.x/tsconfig.json @@ -0,0 +1,24 @@ +{ + "include": [ + "../../connect-conformance/src/index.ts", + "../../example/src/**/*.ts" + ], + // These are the default compiler options for TypeScript v5.0.x, created + // with `tsc --init` (except where noted in comments below) + "compilerOptions": { + // By default, target is es5. For iterables, we need target 2015 or higher, + // or downLevelIteration. + "target": "es2015", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + // 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 + } +} diff --git a/packages/typescript-compat/v5.1.x/package.json b/packages/typescript-compat/v5.1.x/package.json new file mode 100644 index 000000000..46d348278 --- /dev/null +++ b/packages/typescript-compat/v5.1.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts5.1", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.1.x" + } +} diff --git a/packages/typescript-compat/v5.1.x/tsconfig.json b/packages/typescript-compat/v5.1.x/tsconfig.json new file mode 100644 index 000000000..e41b66362 --- /dev/null +++ b/packages/typescript-compat/v5.1.x/tsconfig.json @@ -0,0 +1,24 @@ +{ + "include": [ + "../../connect-conformance/src/index.ts", + "../../example/src/**/*.ts" + ], + // These are the default compiler options for TypeScript v5.1.x, created + // with `tsc --init` (except where noted in comments below) + "compilerOptions": { + // By default, target is es5. For iterables, we need target 2015 or higher, + // or downLevelIteration. + "target": "es2015", + "module": "commonjs", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + // 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 + } +} diff --git a/packages/typescript-compat/v5.2.x/package.json b/packages/typescript-compat/v5.2.x/package.json new file mode 100644 index 000000000..86ccbcfb2 --- /dev/null +++ b/packages/typescript-compat/v5.2.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts5.2", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.2.x" + } +} diff --git a/packages/typescript-compat/v5.2.x/tsconfig.json b/packages/typescript-compat/v5.2.x/tsconfig.json new file mode 100644 index 000000000..c6824ed0b --- /dev/null +++ b/packages/typescript-compat/v5.2.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.2.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 + } +} diff --git a/packages/typescript-compat/v5.3.x/package.json b/packages/typescript-compat/v5.3.x/package.json new file mode 100644 index 000000000..c2859dcee --- /dev/null +++ b/packages/typescript-compat/v5.3.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts5.3", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.3.x" + } +} diff --git a/packages/typescript-compat/v5.3.x/tsconfig.json b/packages/typescript-compat/v5.3.x/tsconfig.json new file mode 100644 index 000000000..d2c9a2d4c --- /dev/null +++ b/packages/typescript-compat/v5.3.x/tsconfig.json @@ -0,0 +1,21 @@ +{ + "include": [ + "../../connect-conformance/src/index.ts", + "../../example/src/**/*.ts" + ], + // These are the default compiler options for TypeScript v5.3.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. */ + "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 + } +} diff --git a/packages/typescript-compat/v5.4.x/package.json b/packages/typescript-compat/v5.4.x/package.json new file mode 100644 index 000000000..ecf78b4f0 --- /dev/null +++ b/packages/typescript-compat/v5.4.x/package.json @@ -0,0 +1,12 @@ +{ + "name": "ts5.4", + "scripts": { + "test": "node_modules/.bin/tsc --outDir dist" + }, + "dependencies": { + "@connectrpc/connect-conformance": "*", + "@connectrpc/example": "*", + "@types/node": "22.5.4", + "typescript": "5.4.x" + } +} diff --git a/packages/typescript-compat/v5.4.x/tsconfig.json b/packages/typescript-compat/v5.4.x/tsconfig.json new file mode 100644 index 000000000..9ad81dc17 --- /dev/null +++ b/packages/typescript-compat/v5.4.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 + } +}