Skip to content

Introducing bootstrap strategies #215

Closed

Description

@rygine

i’ve been working on something for a while to help my company bootstrap packages better. it can optimize installation of external packages, and solve the issue with nested folders in package dependencies. i’m calling it bootstrap strategies.

read all about it here: https://github.com/awakenetworks/lerna/blob/bootstrap-strategy/bootstrap_strategies.md

in short, it allows you to customize your bootstrapping process with a "strategy" for local packages and external modules. i’m not sure if it’s the best way forward. perhaps just optimizing the current bootstrap process will suffice.

we're currently using the link strategy for local packages, which symlinks all of your packages to the root node_modules folder, and the root strategy for external modules, which installs all common external dependencies in the root node_modules folder (versioning is important for this to work properly). if done right, this will dramatically decrease install times.

this setup is achieved with lerna bootstrap --strategy=link:root after you're set up. instructions in the link above.

i'd like to remind everyone that once you've bootstrapped, symlinked modules in the node_modules folder can cause problems if you try to install more dependencies manually via npm install.

feedback and suggestions are welcome.

Activity

  1. jamiebuilds commented on Jun 14, 2016

    @jamiebuilds
    Contributor

    I don't know how good of an idea it is to have many different types of structures between Lerna repos. If someone wanted to build something on top of Lerna there would be way too many things they'd have to consider.

  2. rygine commented on Jun 14, 2016

    @rygine
    ContributorAuthor

    I pretty much came to the same conclusion shortly after I finished working on this. I'm more inclined to have 1 standard bootstrap process. However, I'd like to optimize it using the same techniques outlined here.

  3. jamiebuilds commented on Jun 15, 2016

    @jamiebuilds
    Contributor

    Yeah, I want to focus on just one way of handling things, whether that be pseudo-linking or real symlinks I don't know yet.

  4. bradleyayers commented on Jun 28, 2016

    @bradleyayers

    @rygine thanks for the work on bootstrap-strategies! The link strategy worked well for me and it might be good enough for me until there's a blessed solution. What are the standard pitfalls of symlinking with node_modules?

  5. lock commented on Dec 28, 2018

    @lock

    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.

  6. locked as resolved and limited conversation to collaborators on Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions