slorber / awesome-debounce-promise

Debounce your API calls easily and stay in promised land.
https://sebastienlorber.com
391 stars 9 forks source link

Missing dependency @types/debounce-promise #8

Closed tkrotoff closed 5 years ago

tkrotoff commented 5 years ago

@types/debounce-promise should be a dependency instead of a dev dependency. Otherwise when used inside a TypeScript app (1):

node_modules/awesome-debounce-promise/dist/index.d.ts:1:34 - error TS7016: Could not find a declaration file for module 'debounce-promise'. 'node_modules/debounce-promise/dist/index.js' implicitly has an 'any' type.
  Try `npm install @types/debounce-promise` if it exists or add a new declaration (.d.ts) file containing `declare module 'debounce-promise';`

1 import * as DebouncePromise from 'debounce-promise';
                                   ~~~~~~~~~~~~~~~~~~



While adding @types/debounce-promise as a dependency, I've noticed:

The same could be done for https://github.com/slorber/awesome-imperative-promise: https://github.com/slorber/awesome-imperative-promise/blob/0b111a167aa9330f5a20543219c48062f6688b0e/package.json#L24



(1) General rule with a TypeScript library or app: add the @types/ packages of your dependencies inside the dependencies section of your package.json (not inside devDependencies).

slorber commented 5 years ago

thanks!

Maybe you could contribute all this back into https://github.com/alexjoverm/typescript-library-starter because it's what I used for the initial setup, just modified some little things here and there (ts version, remove react example, prettier...)

slorber commented 5 years ago

awesome-debounce-promise@2.0.1

tkrotoff commented 5 years ago

Maybe you could contribute all this back into https://github.com/alexjoverm/typescript-library-starter

It's a starter kit that you clone, the files generated are part of your repo. It is a good source of inspiration and a good start.

However, I believe that everything that goes into your repository is your responsibility (package.json, webpack.config.js, tsconfig.json, jest.config.js, .eslintrc.js...): you have to master it, know why it's there, test it, fix it, improve it, maintain it... like the rest of your code. It's just part of the job.

I remember Yeoman, a glorified starter kit/scaffolding. It was all the rage back then with famous people behind (Addy Osmani, Sindre Sorhus, Paul Irish...). It's now dead: https://trends.google.com/trends/explore?cat=31&date=2010-01-01%202019-02-24&q=yeoman

screen shot 2019-02-24 at 10 36 04

slorber commented 5 years ago

Agree. That's why I picked a very small lib boilerplate and removed stuff I don't need. Just wanted to say that some things like the single strict could be used in the starter

tkrotoff commented 5 years ago

single strict could be used in the starter

It's already the case: https://github.com/alexjoverm/typescript-library-starter/blob/d75d4480604eb39fbcc46b273f42c2e9f64234de/tsconfig.json