Closed knpwrs closed 6 years ago
sounds good, thanks for the PR! not sure what CI is yapping about. @ikatyang?
We use prepublish
to build types after npm install
, you probably have to add yarn run build
to .travis.yml
as well.
Yep, that appears to have fixed it!
Thanks!
So, yarn is mandatory if I want to use @types/ramda ?
Yes, but when performing
npm install --save-dev types/npm-ramda#dist
I get:
> @types/ramda@0.25.0 prepack /Users/***/.npm/_cacache/tmp/git-clone-73a2dbb0`
> yarn run build
sh: yarn: command not found
Ah, sorry. I didn't notice that'll trigger the prepack
script after installing from git. Reverted in bf2c978.
prepack: run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies)
@ikatyang would it possibly be best to change the package.json
script to use npm
instead of yarn
? As it stood previously, prepublish
would require yarn
. Not particularly a big deal if all the maintainers use yarn
. Ultimately the change to use the prepack
script is meant to reduce the chance of a possible error getting published.
Actually, the problem is that we don't need to build
from source, the files from dist
branch are already built. And currently, we do not publish anything to npm since @types
namespace are handled by DefinitelyTyped.
I don't know all the considerations for yarn, but I think recent npm releases did fix much of their original issues.
prepublish
is no longer the correct way to build beforepublish
. The correct script to use isprepack
. The reason for this is thatprepublish
runs afterpack
and beforepublish
, andpack
is the script which defines what is published duringpublish
, i.e., the package being published is already created by the timeprepublish
is called. By building inprepack
the package will be created properly duringpack
and then published duringpublish
. Usingprepublish
relies on having an already-done, possibly stale build.