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 lerna.json #11

Closed
jantimon opened this issue Sep 7, 2018 · 10 comments
Closed

Add support for lerna.json #11

jantimon opened this issue Sep 7, 2018 · 10 comments

Comments

@jantimon
Copy link

jantimon commented Sep 7, 2018

Usually people set different globs in the lerna.json.
For example the official lerna git repository:

https://github.com/lerna/lerna/blob/901e6d54a47151dfed3d6ed2912804b97d05c6b5/lerna.json#L2-L6

Would it be possible to use that data instead of a default glob?

@JamieMason
Copy link
Owner

Nice idea, thanks. I am away for a few days but maybe sketch up a proposal for the CLI options how you'd like it to work? Thanks

@jantimon
Copy link
Author

jantimon commented Sep 7, 2018

All cli tools I know use their related configuration file even if no cli options are given.
E.g.
npm -> package.json
babel -> .babel.rc
lerna -> lerna.json
webpack -> webpack.config.js
typescript -> tsconfig.json

So imho the correct behaviour would be to pick up the settings from lerna.json by default.
Unfortunately that would be a breaking change for syncpack. 🤔

lerna-update-wizard (also a third party cli for lerna) is already following this approach:
https://github.com/Anifacted/lerna-update-wizard/blob/ea4958b3af2e3f1259543e9c69bdbe587f828bdf/src/index.js#L50

@JamieMason
Copy link
Owner

Sure 👍 just want to be clear we're thinking of the same thing before we go ahead.

@jantimon
Copy link
Author

Thanks @JamieMason 👍

@JamieMason
Copy link
Owner

You're welcome Jan

@JamieMason
Copy link
Owner

It's taken me a while to work out the cause but I've realised this change is behind some slightly undesirable behaviour @jantimon. In my project I have "packages": ["packages/*"], in my lerna.json which means that when I run eg. syncpack format it only formats ./packages/* and not also ./package.json – so I have to redefine the --source patterns.

Would you mind please letting me know a bit more behind your usage of syncpack that led to this issue? I don't want to undo anything you were asking for when trying to improve my own workflow.

Thanks.

@JamieMason JamieMason reopened this Feb 5, 2019
@jantimon
Copy link
Author

jantimon commented Feb 7, 2019

Actually it would be nice to include the base ./package.json as well.

Usually my base package.json does not contain many dependencies but some linters

I use syncpack to reduce module duplication in lernas hoist mode.

@JamieMason
Copy link
Owner

Thanks a lot @jantimon, that should be a pretty easy fix 👍

@jantimon
Copy link
Author

jantimon commented Feb 8, 2019

Thanks for your work! :)

@JamieMason
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants