wclr / yalc

Work with yarn/npm packages locally like a boss.
MIT License
5.64k stars 147 forks source link

'yalc push' does not trigger 'npm prePublishOnly' script. #205

Open zanerock opened 2 years ago

zanerock commented 2 years ago

Overview

In the docs, it says that yalc push is an alias for yalc publish --push. Except the latter will invoke npm 'prepublishOnly' (and pepare, prepublish, etc.) while the latter does not.

To reproduce

In package.json define a prepublishOnly action:

{
  ...,
  "scripts": {
    "prepublishOnly": "echo -e "\nHi!\n"
  },
  ...
}

Now you should see:

$ yalc publish --push

Hi!

@foo/bar@1.0.0-beta.93 published in store.
Pushing @foo/bar@1.0.0-beta.93 in /Users/joe/.liq/playground/foo/baz

but

$ yalc push
@foo/bar@1.0.0-beta.93 published in store.
Pushing @foo/bar@1.0.0-beta.93 in /Users/joe/.liq/playground/foo/baz

Solution

yalc push should behave the same / call the same internal method as yalc publish --push