Closed cryptiklemur closed 4 years ago
That sounds like something you could do with a bash script and without typesync
by doing npm install @types/package; npm install package
.
That’s not what I want. Problems with that not-withstanding, I don’t want to use another script. I want typesync to integrate with npm/yarn
Closing as out of scope. Unix philosophy of composition applies here.
Thats a bummer. One of the flaws of Unix, in general, is the lack of focus on UX/DX. Stuff like "composition" requirement philosophies cause that.
You could set something pretty similar up for yourself with postinstall
, as I mentioned in #63
postinstall
still requires running npm i
or yarn
again. which ends up running this again. Its a pretty bad UX
Ahh, I guess you mean the following:
yarn add styled-components
postinstall
automatically runs typesync
, which adds @types/styled-components
to the package.json
yarn
needs to be run again, in order to install them againThat makes sense, for sure!
I suppose one workaround for now would be to do the postinstall
like this: typesync && yarn
. Not ideal (two install cycles), but it works.
Like you mention, a preinstall
hook or similar would be much better!
I'll add this to the other issue too.
This may already be possible with yarn, but it would be nice to be able to have typesync search for type packages to install before installing a requested package, so they all get installed at the same time.
Would seem that https://github.com/npm/cli/issues/481 is required for this on npm.
https://docs.npmjs.com/misc/scripts#hook-scripts might also work?