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

bootstrap --use-workspaces does not trigger lifecycle scripts #1021

Closed
Quramy opened this issue Sep 21, 2017 · 4 comments
Closed

bootstrap --use-workspaces does not trigger lifecycle scripts #1021

Quramy opened this issue Sep 21, 2017 · 4 comments

Comments

@Quramy
Copy link

Quramy commented Sep 21, 2017

Hi. I've attempted Lerna v2.2.0 and yarn v1.0.2's workspaces feature and it seems that --use-workspaces option obstructs packages' lifecycle scripts.

Expected Behavior

lerna bootstrap --use-workspace triggers prepublish and prepare script in each package.

Current Behavior

Bootstrap command does not run lifecycle scripts.

yarn run v1.0.2
$ "/Users/yosuke/workspaces/javascript/lerna-yarn-workspaces-example/node_modules/.bin/lerna" "bootstrap"
lerna info version 2.2.0
lerna info Bootstrapping 2 packages
lerna info hoist Finished installing in root
lerna success Bootstrapped 2 packages

For now, I execute lerna run prepublish explicitly...

Possible Solution

Steps to Reproduce (for bugs)

  1. clone https://github.com/Quramy/lerna-yarn-workspaces-example
  2. exec yarn run lerna bootstrap
lerna.json

{
  "lerna": "2.2.0",
  "packages": [
    "packages/*"
  ],
  "npmClient": "yarn",
  "useWorkspaces": true,
  "version": "1.0.0"
}

lerna-debug.log

<!-- If you have a `lerna-debug.log` available, please paste it here -->
<!-- Otherwise, feel free to delete this <details> block -->

Context

Your Environment

Executable Version
lerna --version 2.2.0
npm --version 5.4.2
yarn --version 1.0.2
node --version 8.1.3
OS Version
macOS Sierra 10.12.6
@alex-pex
Copy link

alex-pex commented Sep 21, 2017

Is lerna bootstrap still useful in most yarn workspace scenarios? I used lerna to install all packages and symlink between them, but now with yarn workspace I don't see what lerna bootstrap does but yarn install doesn't.

I'm still using lerna to run commands on all packages.

@nhducit
Copy link
Contributor

nhducit commented Oct 2, 2017

Change this line "useWorkspaces": true ==>false,
I have a similar issue, after turn off useWorkspaces options, it works.
#1014

@evocateur
Copy link
Member

lerna bootstrap when useWorkspaces is enabled just calls yarn install once in the root. If the lifecycle scripts aren't being called, that's an issue with yarn, not lerna.

@lock
Copy link

lock bot commented Dec 28, 2018

This thread has been automatically locked because there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Dec 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants