Skip to content

Commit

Permalink
Merge pull request #1796 from endojs/ta/type-coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
turadg authored Oct 18, 2023
2 parents 41e1215 + 72f9a4f commit 54ff59f
Show file tree
Hide file tree
Showing 164 changed files with 924 additions and 463 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"eslint-plugin-jsdoc": "^46.4.3",
"lerna": "^5.6.2",
"lerna-update-wizard": "^0.17.5",
"type-coverage": "^2.26.3",
"typescript": "~5.2.2"
},
"scripts": {
Expand All @@ -45,5 +46,8 @@
"prettier": {
"arrowParens": "avoid",
"singleQuote": true
},
"typeCoverage": {
"atLeast": 0
}
}
4 changes: 0 additions & 4 deletions packages/base64/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/base64/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@
},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"cover": "c8 ava",
"lint": "yarn lint:types && yarn lint:js",
"lint-fix": "eslint --fix .",
"lint:js": "eslint .",
"lint:types": "tsc -p jsconfig.json",
"lint:types": "tsc",
"test": "ava"
},
"devDependencies": {
Expand Down Expand Up @@ -72,5 +72,8 @@
"test/**/test-*.js"
],
"timeout": "2m"
},
"typeCoverage": {
"atLeast": 95.21
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"extends": "./jsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": ["test/"]
"exclude": [
"test/"
]
}
9 changes: 9 additions & 0 deletions packages/base64/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.eslint-base.json",
"include": [
"*.js",
"*.ts",
"src/**/*.js",
"src/**/*.ts"
]
}
7 changes: 0 additions & 7 deletions packages/bundle-source/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/bundle-source/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"test": "ava",
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
Expand All @@ -26,7 +26,7 @@
"lint-check-jessie": "eslint -c '.eslintrc-jessie.js' '**/*.js'",
"lint": "yarn lint:types && yarn lint:eslint",
"lint:eslint": "eslint '**/*.js'",
"lint:types": "tsc -p jsconfig.json"
"lint:types": "tsc"
},
"dependencies": {
"@agoric/babel-generator": "^7.17.4",
Expand Down Expand Up @@ -82,5 +82,8 @@
"extends": [
"plugin:@endo/internal"
]
},
"typeCoverage": {
"atLeast": 67.65
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"extends": "./jsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": ["test/"]
"exclude": [
"test/"
]
}
13 changes: 13 additions & 0 deletions packages/bundle-source/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.eslint-base.json",
"compilerOptions": {
"maxNodeModuleJsDepth": 1,
"checkJs": false
},
"include": [
"*.js",
"*.ts",
"src/**/*.js",
"src/**/*.ts"
]
}
7 changes: 0 additions & 7 deletions packages/captp/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/captp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"test": "ava",
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js",
Expand All @@ -39,7 +39,7 @@
"lint-fix": "yarn lint:eslint --fix && yarn lint:types",
"lint": "yarn lint:eslint && yarn lint:types",
"lint:eslint": "eslint '**/*.js'",
"lint:types": "tsc -p jsconfig.json"
"lint:types": "tsc"
},
"devDependencies": {
"@endo/init": "^0.5.60",
Expand Down Expand Up @@ -69,5 +69,8 @@
"extends": [
"plugin:@endo/internal"
]
},
"typeCoverage": {
"atLeast": 86.52
}
}
8 changes: 6 additions & 2 deletions packages/captp/src/ts-types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
/* eslint-disable */
// eslint-disable-next-line spaced-comment

import type { Unpromise } from '@endo/eventual-send';
// @ts-expect-error FIXME these aren't defined
import type { ESingleMethod, Unpromise } from '@endo/eventual-send';

/**
* In order to type using Trap with a handler TrapHandler<T>, this template type
Expand All @@ -21,11 +22,14 @@ export type TrapHandler<T> = T extends (...args: infer P) => infer R
/* Types for Trap proxy calls. */
type TrapSingleMethod<T> = {
readonly [P in keyof T]: (
// @ts-expect-error FIXME Type 'T[P]' does not satisfy the constraint '(...args: any) => any'.
...args: Parameters<T[P]>
// @ts-expect-error FIXME ditto
) => Unpromise<ReturnType<T[P]>>;
};
type TrapSingleCall<T> = T extends Function
? ((...args: Parameters<T>) => Unpromise<ReturnType<T>>) &
? // @ts-expect-error FIXME ditto
((...args: Parameters<T>) => Unpromise<ReturnType<T>>) &
ESingleMethod<Required<T>>
: ESingleMethod<Required<T>>;
type TrapSingleGet<T> = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"extends": "./jsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": ["test/"]
"exclude": [
"test/"
]
}
13 changes: 13 additions & 0 deletions packages/captp/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "../../tsconfig.eslint-base.json",
"compilerOptions": {
"checkJs": true,
"maxNodeModuleJsDepth": 2
},
"include": [
"*.js",
"*.ts",
"src/**/*.js",
"src/**/*.ts"
]
}
4 changes: 0 additions & 4 deletions packages/check-bundle/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/check-bundle/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@
},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"lint": "yarn lint:types && yarn lint:js",
"lint-fix": "eslint --fix .",
"lint:js": "eslint .",
"lint:types": "tsc -p jsconfig.json",
"lint:types": "tsc",
"test": "ava",
"test:c8": "c8 $C8_OPTIONS ava --config=ava-nesm.config.js"
},
Expand Down Expand Up @@ -77,5 +77,8 @@
"test/**/test-*.js"
],
"timeout": "2m"
},
"typeCoverage": {
"atLeast": 86.95
}
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
{
"extends": "./jsconfig.json",
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": ["test/"]
"exclude": [
"test/"
]
}
9 changes: 9 additions & 0 deletions packages/check-bundle/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.eslint-base.json",
"include": [
"*.js",
"*.ts",
"src/**/*.js",
"src/**/*.ts"
]
}
10 changes: 0 additions & 10 deletions packages/cjs-module-analyzer/jsconfig.build.json

This file was deleted.

4 changes: 0 additions & 4 deletions packages/cjs-module-analyzer/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/cjs-module-analyzer/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"cover": "c8 ava",
"lint": "yarn lint:types && yarn lint:js",
"lint-fix": "eslint --fix .",
"lint:js": "eslint .",
"lint:types": "tsc -p jsconfig.json",
"lint:types": "tsc",
"test": "ava"
},
"devDependencies": {
Expand Down Expand Up @@ -61,5 +61,8 @@
"test/**/test-*.js"
],
"timeout": "2m"
},
"typeCoverage": {
"atLeast": 39.57
}
}
13 changes: 13 additions & 0 deletions packages/cjs-module-analyzer/tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"allowJs": true,
"noEmit": false,
"declaration": true,
"emitDeclarationOnly": true,
"declarationMap": true
},
"exclude": [
"test/"
]
}
9 changes: 9 additions & 0 deletions packages/cjs-module-analyzer/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"extends": "../../tsconfig.eslint-base.json",
"include": [
"*.js",
"*.ts",
"src/**/*.js",
"src/**/*.ts"
]
}
10 changes: 0 additions & 10 deletions packages/cli/jsconfig.build.json

This file was deleted.

7 changes: 0 additions & 7 deletions packages/cli/jsconfig.json

This file was deleted.

7 changes: 5 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
"exports": {},
"scripts": {
"build": "exit 0",
"prepack": "tsc --build jsconfig.build.json",
"prepack": "tsc --build tsconfig.build.json",
"postpack": "git clean -f '*.d.ts*'",
"lint": "yarn lint:types && yarn lint:js",
"lint-fix": "eslint --fix .",
"lint:js": "eslint .",
"lint:types": "tsc -p jsconfig.json",
"lint:types": "tsc",
"test": "exit 0"
},
"dependencies": {
Expand Down Expand Up @@ -65,5 +65,8 @@
"test/**/test-*.js"
],
"timeout": "2m"
},
"typeCoverage": {
"atLeast": 86.18
}
}
Loading

0 comments on commit 54ff59f

Please sign in to comment.