diff --git a/package.json b/package.json index 4fe9c55..9917e14 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "spectacles-ts", - "version": "1.0.6", + "version": "1.0.7", "main": "./dist/index.js", "types": "./dist/index.d.ts", "sideEffects": false, @@ -16,7 +16,7 @@ "watch:tsc": "yarn run tsc -w -p tsconfig.build.json", "watch:tsd": "nodemon --watch './**/*.ts' --ignore './dist' --exec 'ts-node' --transpile-only scripts/run-type-tests.ts", "fix:lint": "yarn run eslint . --fix", - "prepublishOnly": "yarn fix:lint && yarn test" + "prepublishOnly": "yarn fix:lint && yarn build && yarn test" }, "dependencies": { "monocle-ts": "^2.3.5" diff --git a/test/tsd/get.spec.ts b/test/tsd/get.spec.ts index b3335e8..36ec77c 100644 --- a/test/tsd/get.spec.ts +++ b/test/tsd/get.spec.ts @@ -13,6 +13,7 @@ expectType(definite); // gets an optional value const optional = pipe(data, get("type:A.a.?some.c")); expectType>(optional); +// @ts-expect-error: should not return never expectError>(optional); // has checked record access @@ -35,6 +36,8 @@ expectType>(infersEq); const infersOptionalEq = pipe(O.getEq(StringEq), Eq.contramap(get("a.b?"))); expectType>(infersOptionalEq); +// @ts-expect-error: get should enforce an Optional eq for an optional path expectError>(pipe(StringEq, Eq.contramap(get("a.b?")))); +// @ts-expect-error: get should enforce a non-Optional eq for a non-optional (lens) path expectError>(pipe(O.getEq(StringEq), Eq.contramap(get("a.b")))); diff --git a/tsconfig.build.json b/tsconfig.build.json index 96d449a..95269d7 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -9,5 +9,5 @@ "rootDirs": [], "esModuleInterop": true }, - "include": ["src/**/*.ts"], + "include": ["src"], } diff --git a/tsconfig.json b/tsconfig.json index 777b9ae..213b3c1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,5 +5,5 @@ "module": "commonjs", "noEmit": true }, - "include": ["src/**/*.ts", "test/jest/**/*.ts"], + "include": ["src", "test", "scripts"], }