Yarn: Yarn does not run `prepack` when installing Git dependencies

Created on 5 Dec 2017  ·  3Comments  ·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
bug

What is the current behavior?
The dependency's prepack script is not run when installing a dependency that includes one.

If the current behavior is a bug, please provide the steps to reproduce.
Install a dependency via git that specifies a prepack script. NPM documentation specifically mentions this: https://docs.npmjs.com/misc/scripts

prepack: run BEFORE a tarball is packed (on npm pack, npm publish, and when installing git dependencies)

What is the expected behavior?
The prepack script is executed.

Please mention your node.js, yarn and operating system version.

› node -v
v8.1.4

› yarn -v
1.3.2

cat-bug help wanted triaged

Most helpful comment

Are there any plans on tackling this? Does anyone know if there is a work around?

All 3 comments

This is a primary reason i've avoided git deps as a forking mechanism considering their behavior then changes due to differences in .gitignore vs .npmignore.

This idea sounds like a great solution to the primary concerns.

However, postpack also needs to be ran!!

I use this script I wrote in postpack: https://github.com/aikar/json-object/blob/master/build/postpack.sh

This modifies the tarball, moving all dist/* down a level so that non entry point imports can be clean import bar from "foo/bar"; instead of from "foo/dist/bar";

If my library was to be imported as a git repo, this would result in a different file structure.

Hey there,

I've just came across with this issue, @rally25rs you marked it with the label help wanted, does this mean that if anyone submits a PR to fix this, then it's gonna be merged and included in the next release?

Are there any plans on tackling this? Does anyone know if there is a work around?

Was this page helpful?
0 / 5 - 0 ratings