Skip to content

Commit

Permalink
revert expect-type package to version 0.15.0
Browse files Browse the repository at this point in the history
  • Loading branch information
electrovir committed May 31, 2023
1 parent 63b1b75 commit 6f4c5f9
Show file tree
Hide file tree
Showing 15 changed files with 380 additions and 368 deletions.
4 changes: 1 addition & 3 deletions configs/ncu.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ export const ncuConfig: RunOptions = {
upgrade: true,
root: true,
// exclude these
reject: [
'@types/node',
],
reject: ['expect-type'],
// include only these
filter: [],
};
651 changes: 338 additions & 313 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "augment-vir",
"version": "14.2.1",
"version": "14.2.2",
"private": true,
"homepage": "https://github.com/electrovir/augment-vir",
"bugs": {
Expand Down Expand Up @@ -37,7 +37,7 @@
"devDependencies": {
"cspell": "^6.31.1",
"esbuild": "^0.17.19",
"markdown-code-example-inserter": "^0.3.0",
"markdown-code-example-inserter": "^0.3.1",
"npm-check-updates": "^16.10.12",
"prettier": "^2.8.8",
"prettier-plugin-interpolated-html-tags": "^0.0.4",
Expand Down
6 changes: 3 additions & 3 deletions packages/browser-testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/browser-testing",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -23,8 +23,8 @@
"test:coverage": "npm test"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/testing": "^14.2.1",
"@augment-vir/common": "^14.2.2",
"@augment-vir/testing": "^14.2.2",
"@open-wc/testing": "^3.1.8",
"@types/mocha": "^10.0.1",
"@web/test-runner-commands": "^0.7.0",
Expand Down
6 changes: 3 additions & 3 deletions packages/browser/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/browser",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/browser",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -22,10 +22,10 @@
"test:coverage": "npm test coverage"
},
"dependencies": {
"@augment-vir/common": "^14.2.1"
"@augment-vir/common": "^14.2.2"
},
"devDependencies": {
"@augment-vir/browser-testing": "^14.2.1",
"@augment-vir/browser-testing": "^14.2.2",
"@open-wc/testing": "^3.1.8",
"@types/mocha": "^10.0.1",
"@web/dev-server-esbuild": "^0.4.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/chai/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/chai",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -23,8 +23,8 @@
"test:coverage": "npm test"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/testing": "^14.2.1",
"@augment-vir/common": "^14.2.2",
"@augment-vir/testing": "^14.2.2",
"type-fest": "^3.11.1"
},
"devDependencies": {
Expand Down
6 changes: 3 additions & 3 deletions packages/common-tests/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/common-tests",
"version": "14.2.1",
"version": "14.2.2",
"private": true,
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common-tests",
"bugs": {
Expand All @@ -22,8 +22,8 @@
"test:types": "tsc --noEmit"
},
"devDependencies": {
"@augment-vir/chai": "^14.2.1",
"@augment-vir/node-js": "^14.2.1",
"@augment-vir/chai": "^14.2.2",
"@augment-vir/node-js": "^14.2.2",
"@electrovir/nyc": "^15.1.0-fix0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.5",
Expand Down
2 changes: 1 addition & 1 deletion packages/common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/common",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/common",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand Down
6 changes: 3 additions & 3 deletions packages/docker/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/docker",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/docker",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -22,8 +22,8 @@
"test:coverage": "npm test"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/node-js": "^14.2.1"
"@augment-vir/common": "^14.2.2",
"@augment-vir/node-js": "^14.2.2"
},
"devDependencies": {
"typescript": "^5.0.4"
Expand Down
6 changes: 3 additions & 3 deletions packages/element-vir/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/element-vir",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/element-vir",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -22,10 +22,10 @@
"test:coverage": "npm test coverage"
},
"dependencies": {
"@augment-vir/common": "^14.2.1"
"@augment-vir/common": "^14.2.2"
},
"devDependencies": {
"@augment-vir/browser-testing": "^14.2.1",
"@augment-vir/browser-testing": "^14.2.2",
"@open-wc/testing": "^3.1.8",
"@types/mocha": "^10.0.1",
"@web/dev-server-esbuild": "^0.4.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/node-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/node-js",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/node-js",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -22,15 +22,15 @@
"test:coverage": "npm test coverage"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/common": "^14.2.2",
"ansi-colors": "^4.1.3",
"axios": "^1.4.0",
"fs-extra": "^11.1.1",
"ts-node": "^10.9.1",
"type-fest": "^3.11.1"
},
"devDependencies": {
"@augment-vir/chai": "^14.2.1",
"@augment-vir/chai": "^14.2.2",
"@electrovir/nyc": "^15.1.0-fix0",
"@istanbuljs/nyc-config-typescript": "^1.0.2",
"@types/chai": "^4.3.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/prisma-node-js/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/prisma-node-js",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/prisma-node-js",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -22,8 +22,8 @@
"test:coverage": "npm test"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/node-js": "^14.2.1"
"@augment-vir/common": "^14.2.2",
"@augment-vir/node-js": "^14.2.2"
},
"devDependencies": {
"istanbul-smart-text-reporter": "^1.1.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/scripts/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/scripts",
"version": "14.2.1",
"version": "14.2.2",
"private": true,
"license": "MIT",
"author": {
Expand All @@ -14,8 +14,8 @@
"verify": "ts-node src/index.ts"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"@augment-vir/node-js": "^14.2.1"
"@augment-vir/common": "^14.2.2",
"@augment-vir/node-js": "^14.2.2"
},
"devDependencies": {
"@electrovir/nyc": "^15.1.0-fix0",
Expand Down
6 changes: 3 additions & 3 deletions packages/testing/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@augment-vir/testing",
"version": "14.2.1",
"version": "14.2.2",
"homepage": "https://github.com/electrovir/augment-vir/tree/main/packages/testing",
"bugs": {
"url": "https://github.com/electrovir/augment-vir/issues"
Expand All @@ -23,8 +23,8 @@
"test:coverage": "npm test coverage"
},
"dependencies": {
"@augment-vir/common": "^14.2.1",
"expect-type": "^0.16.0",
"@augment-vir/common": "^14.2.2",
"expect-type": "^0.15.0",
"type-fest": "^3.11.1"
},
"devDependencies": {
Expand Down
27 changes: 8 additions & 19 deletions packages/testing/src/augments/assert-type-of.ts
Original file line number Diff line number Diff line change
@@ -1,34 +1,23 @@
import {Overwrite} from '@augment-vir/common';
import {ExpectTypeOf, ExpectTypeOfOptions, Not} from 'expect-type';
import {ExpectTypeOf, Not} from 'expect-type';

type ExtraTypeChecks<TestingType, B extends ExpectTypeOfOptions> = {
type ExtraTypeChecks<TestingType, B extends boolean> = {
toBeAssignableTo: ExpectTypeOf<TestingType, B>['toMatchTypeOf'];
};

type WithExtraNotTypeChecks<TestingType, B extends ExpectTypeOfOptions> = Overwrite<
type WithExtraNotTypeChecks<TestingType, B extends boolean> = Overwrite<
ExpectTypeOf<TestingType, B>,
{
not: ExpectTypeOf<TestingType, B>['not'] &
ExtraTypeChecks<TestingType, B & {positive: Not<B['positive']>}>;
not: ExpectTypeOf<TestingType, B>['not'] & ExtraTypeChecks<TestingType, Not<B>>;
}
>;

type AssertTypeOf<TestingType, B extends ExpectTypeOfOptions> = WithExtraNotTypeChecks<
TestingType,
B
> &
type AssertTypeOf<TestingType, B extends boolean> = WithExtraNotTypeChecks<TestingType, B> &
ExtraTypeChecks<TestingType, B>;

export function assertTypeOf<TestingType>(
input: TestingType,
): AssertTypeOf<TestingType, {branded: false; positive: true}>;
export function assertTypeOf<TestingType>(): AssertTypeOf<
TestingType,
{branded: false; positive: true}
>;
export function assertTypeOf<TestingType>(
input?: TestingType,
): AssertTypeOf<TestingType, {branded: false; positive: true}> {
export function assertTypeOf<TestingType>(input: TestingType): AssertTypeOf<TestingType, true>;
export function assertTypeOf<TestingType>(): AssertTypeOf<TestingType, true>;
export function assertTypeOf<TestingType>(input?: TestingType): AssertTypeOf<TestingType, true> {
// run time implementation for this doesn't matter
const runtimeProxy = new Proxy(
{},
Expand Down

0 comments on commit 6f4c5f9

Please sign in to comment.