cayasso / mongo-oplog

Watch mongodb oplog in a simple way
381 stars 91 forks source link

typescript types aren't working #65

Closed ORESoftware closed 6 years ago

ORESoftware commented 6 years ago

I installed: "mongo-oplog": "^2.1.0",

and then I have

import MongoOplog from 'mongo-oplog'

I am seeing

screenshot 2018-03-15 23 25 57

Do you know why the types aren't being recognized? I see an index.d.ts file in this project. So I shouldn't have to use @types/mongo-oplog (which doesn't exist anyway).

ORESoftware commented 6 years ago

I did some sleuthing because I am cool like that and I see this:

screenshot 2018-03-15 23 27 47

The index.d.ts file is not being moved from src to lib when it gets published. Instead of transpiling from src to lib, maybe consider just putting all the files in lib (.ts, .d.ts, .js). I have seen things done both ways, frankly keeping them all in one places is fine.

Boxie5 commented 6 years ago

I guess this maybe is because src folder is set to be ignored here in .npmignore

node_modules examples npm-debug.log dump.rdb src/

thus, the types info set in package.json is useless

"types": "./src/index.d.ts"

cayasso commented 6 years ago

This should be fixed in 2.1.4