Skip to content

Commit

Permalink
Fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
martenrichter committed Dec 30, 2023
1 parent 3b07ca0 commit 083d4db
Show file tree
Hide file tree
Showing 8 changed files with 80 additions and 45 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ jobs:

- name: Build types
if: needs.version-check.outputs.changed == 'true'
run: npm run types --workspaces
run: npm run types

- run: npm publish --tag stable --workspace main --workspace transports/http3-quiche
if: ${{ needs.version-check.outputs.changed == 'true' && github.ref == 'refs/heads/master' }}
Expand Down
15 changes: 15 additions & 0 deletions main/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"compilerOptions": {
"outDir": "dist",
"rootDir": "../",
},
"extends": "../tsconfig.base.json",
"include": [
"lib",
"test",
"../transports/http3-quiche/lib"
],
"exclude": [
"test/testinone.js"
]
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"test:chromium:http2:ponyfill": "npm run test:chromium:http2:ponyfill --workspace main",
"oldtest": "npm run oldtest --workspace main",
"oldtesthttp2": "npm run oldtesthttp2 --workspace main",
"types": "npm run types --workspaces",
"types": "tsc --build",
"lint": "npm run lint --workspaces",
"prebuild": "npm run prebuild --workspace transports/http3-quiche",
"build-debug": "npm run build-debug --workspace transports/http3-quiche",
Expand Down
11 changes: 11 additions & 0 deletions transports/http3-quiche/lib/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import type {
WebTransportOptions
} from '../../../main/lib/dom'

export interface UDPServerSocketSend {
msg: Uint8Array
Expand All @@ -12,4 +15,12 @@ export interface UDPServerSocketSend {
error: (formatter: any, ...args: any[]) => void
trace: (formatter: any, ...args: any[]) => void
}

export interface HttpWebTransportInit extends WebTransportOptions {
host: string
port: string | number
quicheLogVerbose?: number
forceIpv6?: boolean
localPort?: number
}

1 change: 0 additions & 1 deletion transports/http3-quiche/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"rebuild-debug": "node build.js rebuild-debug -D",
"build-debug": "node build.js build-debug",
"prebuild": "node build.js prebuild",
"types": "tsc",
"lint": "eslint lib"
},
"repository": {
Expand Down
12 changes: 12 additions & 0 deletions transports/http3-quiche/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"compilerOptions": {
"outDir": "dist",
"rootDir": "../.."
},
"extends" : "../../tsconfig.base.json",
"include": [
"lib",
"../../main/lib"
],
"references": [{ "path": "../../main" }]
}
34 changes: 34 additions & 0 deletions tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"compilerOptions": {
"strict": true,
// project options
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2022",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
}
}
48 changes: 6 additions & 42 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,43 +1,7 @@
{
"compilerOptions": {
"strict": true,
// project options
"outDir": "dist",
"allowJs": true,
"checkJs": true,
"target": "ES2020",
"module": "ES2022",
"lib": ["ES2021", "ES2021.Promise", "ES2021.String", "ES2020.BigInt", "DOM", "DOM.Iterable"],
"noEmit": false,
"noEmitOnError": true,
"emitDeclarationOnly": true,
"declaration": true,
"declarationMap": true,
"incremental": true,
"composite": true,
"isolatedModules": true,
"removeComments": false,
"sourceMap": true,
// module resolution
"esModuleInterop": true,
"moduleResolution": "node",
// linter checks
"noImplicitReturns": false,
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"noUnusedParameters": false,
// advanced
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
"stripInternal": true,
"resolveJsonModule": true
},
"include": [
"main/lib",
"main/test",
"transports/http3-quiche/lib"
],
"exclude": [
"main/test/testinone.js"
]
}
"files": [],
"references": [
{ "path": "main" },
{ "path": "transports/http3-quiche" }
]
}

0 comments on commit 083d4db

Please sign in to comment.