Closed frangio closed 7 years ago
Travis failed because it uses npm 3.8.6 and prepare
was introduced in 4.0.0.
I've changed it to prepublish
which is the <4.0.0 equivalent.
I like this, but Truffle supports Windows and I think it will fail in those systems. Someone has suggested using https://www.npmjs.com/package/mkdirp but it may not be worth it.
Oh, it's true, mkdir -p
won't work on Windows. I just went ahead and added the mkdirp package as a dev dependency. It's worth it IMO.
LGTM
Rebased and merged manually. Commits are still attributed to you.
There is an issue with yarn
https://github.com/yarnpkg/yarn/issues/1671 which means the prepublish
isn't run when yarn runs. We then start getting a Error: Cannot find module './build/parser'
Thanks for pointing this out @elenadimitrova. There doesn't seem to be a clear solution for this problem. In the meantime, I suggest sticking with npm. The latest major version should dramatically improve install time, which was one of the main causes that prompted the creation of yarn.
This removes the build directory from the repo and instead adds a
prepare
task that npm will automatically run when installing the package locally or before publishing it.Since
build
is now in.gitignore
it's also necessary to have an empty.npmignore
file. This way thebuild
directory will be included in the package.