Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong script runed after install #783

Closed
chemzqm opened this issue Oct 12, 2016 · 1 comment · Fixed by #800
Closed

Wrong script runed after install #783

chemzqm opened this issue Oct 12, 2016 · 1 comment · Fixed by #800

Comments

@chemzqm
Copy link

chemzqm commented Oct 12, 2016

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

Should be a bug.

What is the current behavior?

propublish script is runned after I use yarn

screen shot 2016-10-12 at 9 41 56 am

This is scripts part of my package.json:

  "scripts": {
    "postinstall": "webpack",
    "prepublish": "webpack --config webpack.prod.js"
  },

If the current behavior is a bug, please provide the steps to reproduce.

Run yarn command

What is the expected behavior?

It should run postinstall script.

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

node v6.0
MacOs
yarn 0.15.1

@FLGMwt
Copy link
Contributor

FLGMwt commented Oct 12, 2016

Running prepublish is correct in terms of npm compatibility (see https://github.com/yarnpkg/yarn/blob/master/src/cli/commands/install.js#L736), but you're right, postinstall should also be run immediately before prepublish.

EDIT:
Looking at npm install at https://github.com/npm/npm/blob/8fa75cd0313e3cea8459f89b79208461e54b033b/lib/install.js#L551, it looks like we should be executing the following "magic" scripts in this order after a successful install for full compatibility:

  1. build
  2. install
  3. postinstall
  4. test IF npat flag is on
  5. prepublish IF not a production build

I'm happy to pick this up, but how much parity do we want to implement with yarn? Should we add 1-3 and wrap prepublish in an if dev?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants