jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

Question: Why not include @types/jest as TSDX's dependencies? #633

Closed rockmandash closed 4 years ago

rockmandash commented 4 years ago

Current Behavior

@types/jest is in newly generated package's devDependencies.

Desired Behavior

Why not include @types/jest as TSDX's dependencies?

This way, the newly generated boilerplate package's devDependencis will be cleaner.

Suggested Solution

Actually, if the newly generated boilerplate package's devDependencis includes only TSDX, that will be awesome, and I think it's doable.

Who does this impact? Who is this for?

All users

Describe alternatives you've considered

None.

JustFly1984 commented 4 years ago

Please don’t bloat dependencies, it requires maintaining, updating and time to download/install for every deploy

rockmandash commented 4 years ago

TSDX's dependencies include "jest": "^24.8.0".

When I generate a new project using TSDX, I get "@types/jest": "^25.1.4".

The version is a mismatch, this is not a problem about bloat dependencies.

agilgur5 commented 4 years ago

I don't know for sure, but I'm pretty sure the reason for that is historical rather than intentional. TSDX was originally written in JS and most of the tests are still in JS (I've got a TODO to rewrite them, hopefully won't be too hard -- EDIT: it wasn't, see #649).

@types/jest was only added as a devDep in #146 which added the first and only TS test.

Also seems like @types/shelljs made its way in as a dep instead of a devDep too in #244

PR welcome to change both/either of those. Might need to be careful with the yarn.lock file when doing so


ts-jest's installation instructions do say to install @types/jest.

Side note: We're able to get away with most types as devDeps because TSDX is a CLI and so not generally imported into any TS code

agilgur5 commented 4 years ago

@allcontributors please add @rockmandash for bug

allcontributors[bot] commented 4 years ago

@agilgur5

I've put up a pull request to add @rockmandash! :tada:

tony commented 3 years ago

If you're working with Karma on a project (@types/karma), this as a hard-dependency makes life much harder.

I like tsdx for the build and watch, but the test opinions may be good to be optional

(I also have projects with jest, so those are fine)