grantila / suretype

Typesafe JSON (Schema) validator
502 stars 9 forks source link

suretype 3.0.0 package.json has incorrect "types" value #24

Closed mkfmnn closed 2 years ago

mkfmnn commented 2 years ago

https://github.com/grantila/suretype/blob/f3e62294f02c7ec98ab60fa25a69bb3c392b5d74/package.json#L13

package.json should have:

 "types": "./dist/index-nodejs.d.ts", 

The current value is missing "js".

In a module that depends on suretype 3.0.0, the following code:

import { v } from "suretype";

Results in the tsc error:

src/types.ts:1:19 - error TS7016: Could not find a declaration file for module 'suretype'. '.../node_modules/suretype/dist/index-nodejs.js' implicitly has an 'any' type.

A workaround is to explicitly import "suretype/dist/index-nodejs.js"

grantila commented 2 years ago

absolutely right, thanks for this!

github-actions[bot] commented 2 years ago

:tada: This issue has been resolved in version 3.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: