Skip to content

Conversation

@johnf
Copy link
Contributor

@johnf johnf commented Sep 27, 2017

Move publish, prepublish and prepare hooks to run before tar ball is
created.

Also switch the order of prepare to be consistent with
https://docs.npmjs.com/misc/scripts

Summary

Currently publish hooks are being run after tarball creation, this means that any output of this process e.g. processing by babel isn't included in the published artifacts.

Fixes #4515

Test plan

Create following package.json

{
  "name": "hubber-iot",
  "scripts": {
    "build": "echo foo > bar.txt",
    "prepublish": "yarn run build",
  },
  "version": "1.0.0"
}

Then yarn publish bar.txt should be included in the module

johnf and others added 2 commits September 27, 2017 18:18
Move publish, prepublish and prepare hooks to run before tar ball is
created.

Also switch the order of prepare to be consistent with
https://docs.npmjs.com/misc/scripts
@BYK BYK requested review from arcanis and kaylie-alexa September 27, 2017 12:38
@BYK
Copy link
Member

BYK commented Sep 27, 2017

LGTM. Deferring to @arcanis and @kaylieEB for approval and merge.

PS: I merged master into your branch which should clear the CI failure.

Copy link
Member

@arcanis arcanis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@arcanis arcanis merged commit 8cf5f5d into yarnpkg:master Sep 27, 2017
@johnf johnf deleted the fix_prepublish branch September 27, 2017 22:15
joaolucasl pushed a commit to joaolucasl/yarn that referenced this pull request Oct 27, 2017
Move publish, prepublish and prepare hooks to run before tar ball is
created.

Also switch the order of prepare to be consistent with
https://docs.npmjs.com/misc/scripts
yhatt added a commit to yhatt/markdown-it-incremental-dom that referenced this pull request Dec 30, 2017
`yarn publish` is already supported prepack script in yarn 1.0.0.
(and prepublish scripts is running before packing in yarn 1.2.0)

See:
yarnpkg/yarn#4193
yarnpkg/yarn#4553
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 this pull request may close these issues.

3 participants