andywer / typed-emitter

🔩 Type-safe event emitter interface for TypeScript
MIT License
268 stars 24 forks source link

Install as dev-dependency #10

Closed erfanium closed 4 years ago

erfanium commented 4 years ago

Why not install typed-emitter as a dev-dependency? This package doesn't have any runtime code and has no effect on the production javascript build

andywer commented 4 years ago

Yes and no. If you (as the user of typed-emitter) are building an app, then yes.

If you happen to build a package that is then used by others and you expose a typed event emitter instance, then you will need to make the package a real dependency, since otherwise your .d.ts file will have an import from typed-emitter without typed-emitter being installed, if I am not mistaken.

Pretty edge-casy, though. How about we suggest installing it as a dev dependency, but quickly outline when to make it a production dependency in a sentence or two?

erfanium commented 4 years ago

I think if someone wants to make a typescript package, then package dependencies should be managed by the package owner, and he/she has to decide which method to choose (installing typed-emitter as dependency or dev-dependency). We can only decide on the final user.

andywer commented 4 years ago

Thanks!