Skip to content

Commit

Permalink
Move compiler option to emit declarations to tsconfig.base.json (#1371)
Browse files Browse the repository at this point in the history
  • Loading branch information
timostamm authored Dec 19, 2024
1 parent a9b4b83 commit ebc1880
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 17 deletions.
4 changes: 2 additions & 2 deletions packages/connect-conformance/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"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 --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/src/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/src/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",
"lint": "eslint --max-warnings 0 .",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-express/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"test": "jasmine --config=jasmine.json",
"conformance": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-express.yaml -v -- tsx ./conformance/server.ts",
"format": "prettier --write --ignore-unknown '.' '!dist'",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-fastify/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"conformance": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-fastify.yaml -v -- tsx ./conformance/server.ts",
"format": "prettier --write --ignore-unknown '.' '!dist'",
"license-header": "license-header",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"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'",
"license-header": "license-header",
"lint": "eslint --max-warnings 0 .",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-node/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --moduleResolution node10 --verbatimModuleSyntax false --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --moduleResolution node10 --verbatimModuleSyntax false --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"test": "jasmine --config=jasmine.json",
"conformance:server": "tsc --noEmit && connectconformance --mode server --conf ./conformance/conformance-node.yaml -v -- tsx ./conformance/server.ts",
"conformance:client": "tsc --noEmit && connectconformance --mode client --conf ./conformance/conformance-node.yaml -v -- tsx ./conformance/client.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
"scripts": {
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"build:cjs": "tsc --project tsconfig.build.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.build.json --outDir ./dist/esm",
"conformance:safari": "npm run conformance:safari:promise && npm run conformance:client:safari:callback",
"conformance:safari:promise": "connectconformance --mode client --conf conformance/conformance-web.yaml -- tsx conformance/client.ts --browser safari",
"conformance:safari:callback": "connectconformance --mode client --conf conformance/conformance-web.yaml -- tsx conformance/client.ts --browser safari --useCallbackClient",
Expand Down
4 changes: 2 additions & 2 deletions packages/connect/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"postgenerate": "license-header src/protocol-grpc/gen",
"prebuild": "rm -rf ./dist/*",
"build": "npm run build:cjs && npm run build:esm",
"build:cjs": "tsc --project tsconfig.json --module commonjs --verbatimModuleSyntax false --moduleResolution node10 --outDir ./dist/cjs --declaration --declarationDir ./dist/cjs && echo >./dist/cjs/package.json '{\"type\":\"commonjs\"}'",
"build:esm": "tsc --project tsconfig.json --outDir ./dist/esm --declaration --declarationDir ./dist/esm",
"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",
"postbuild": "node scripts/update-user-agent.mjs",
"test": "jasmine --config=jasmine.json",
"format": "prettier --write --ignore-unknown '.' '!dist' '!src/protocol-grpc/gen'",
Expand Down
8 changes: 5 additions & 3 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,12 @@
// ES2018.AsyncIterable for AsyncIterator
"ES2018.AsyncIterable"
],
"declaration": true,
// We don't have dependencies that require interop
"esModuleInterop": false,
"forceConsistentCasingInFileNames": true,
// As strict as possible
"strict": true,
"forceConsistentCasingInFileNames": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
Expand All @@ -22,8 +25,7 @@
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,

// We need node's module resolution, so we do not have to skip lib checks
// We're building with Node16 module resolution
"moduleResolution": "Node16",
"module": "Node16",
"verbatimModuleSyntax": true,
Expand Down

0 comments on commit ebc1880

Please sign in to comment.