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

Add support for configurable package locations #332

Closed
wants to merge 3 commits into from

Conversation

gigabo
Copy link
Contributor

@gigabo gigabo commented Sep 7, 2016

This adds a packages configuration option to lerna.json:

{
  "lerna": "2.0.0-beta.27",
  "version": "0.2.3",
  "packages": [
    {"glob": "packages/{core,plugins}/*/package.json"},
    {"glob": "build-tools/package.json"},
    {"glob": "integration-tests/**/package.json"}
  ]
}

The default is [{"glob": "packages/*/package.json"}], which is equivalent to
the historical layout of a Lerna repo.

This addresses #126 and #231.


Still TODO:

  • documentation
  • new tests

@@ -13,7 +13,7 @@ export default class Repository {
GitUtilities.init();
}

this.rootPath = GitUtilities.getTopLevelDirectory();
this.rootPath = path.resolve(GitUtilities.getTopLevelDirectory());
Copy link
Contributor

@rygine rygine Sep 7, 2016

Choose a reason for hiding this comment

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

i was about to comment to add path.resolve() here 😉

ran into the same thing with #237

Copy link
Contributor Author

Choose a reason for hiding this comment

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

:feelsgood:

@steelbrain
Copy link
Contributor

I implemented it in a different way in motion#1
thoughts?

@gigabo
Copy link
Contributor Author

gigabo commented Sep 8, 2016

@steelbrain Nice! Looks like the main difference from a user perspective is this uses globs instead of directories? It's also wrapping the items in objects ({"glob":"..."}). My thought there is eventually we'll wind up with config for package groups.

@steelbrain
Copy link
Contributor

@gigabo The idea of globs is certainly tempting but in a realistic view, this could stray the package from it's main purpose. Having two separate package directories allows sorting packages based on their roles but still enforces them to be purely mono repo package directories, in our use case it was apps and modules.

If we allow users to mix lerna packages with other things in deep directories, it's only gonna get messy. but that's just my opinion :)

@gigabo
Copy link
Contributor Author

gigabo commented Sep 8, 2016

Oh, it's still all packages!

The globs resolve to package.json files for packages that are managed by Lerna.

@steelbrain
Copy link
Contributor

Ohhhh, in that case sounds good 👍

@gigabo
Copy link
Contributor Author

gigabo commented Sep 8, 2016

That reminds me... I'm missing documentation here! Also new tests... 😅

This adds a `packages` configuration option to `lerna.json`:

```json
{
  "lerna": "2.0.0-beta.27",
  "version": "0.2.3",
  "packages": [
    {"glob": "packages/{core,plugins}/*/package.json"},
    {"glob": "build-tools/package.json"},
    {"glob": "integration-tests/**/package.json"}
  ]
}
```

The default is `[{"glob": "packages/*/package.json"}]`, which is equivalent to
the historical layout of a Lerna repo.

This addresses lerna#126 and lerna#231.
@seansfkelley
Copy link
Contributor

Does this teach Lerna how to do anything with these package groups as a unit, or does it just allow you to split the "global Lerna namespace" across multiple directories? Example: if I have e.g. "apps" and "modules" as mentioned above, am I able to run things on only one glob, or do I still have to name packages in a way that --scope does what I want/name the npm scripts in a way that I can differentiate with lerna run?

@zkochan
Copy link
Contributor

zkochan commented Sep 30, 2016

This is ready, right? Just documentation has to be added.

@nruhe
Copy link

nruhe commented Oct 7, 2016

If the only thing holding this change back is documentation, I'd be happy to volunteer to write it.

@gigabo
Copy link
Contributor Author

gigabo commented Oct 7, 2016

Oh, whoops meant to close this! Moved to Asini. Had some issues beyond documentation.

@gigabo gigabo closed this Oct 7, 2016
@gigabo gigabo deleted the configurable-package-locations branch October 7, 2016 19:07
@smrq
Copy link

smrq commented Oct 7, 2016

Huh? Is there any real reason this isn't being added to Lerna?

@steelbrain
Copy link
Contributor

I must be misunderstanding something, how are Lerna and Asini different?

@gigabo
Copy link
Contributor Author

gigabo commented Oct 7, 2016

Asini is a fork of Lerna. I need features that are unavailable in Lerna and ran into a situation where I'm unfortunately no longer comfortable contributing here.

@jamiebuilds
Copy link
Contributor

Moving to #365

@lock
Copy link

lock bot commented Dec 27, 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 27, 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

Successfully merging this pull request may close these issues.

None yet

8 participants