-
-
Notifications
You must be signed in to change notification settings - Fork 621
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
Lerna workspace #353
Lerna workspace #353
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please, clean yarn.lock
and lerna-debug.log
lerna-debug.log
Outdated
@@ -0,0 +1,34 @@ | |||
0 silly input [] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add lerna-debug.log
to .gitignore
@@ -1,6 +1,6 @@ | |||
"use strict"; | |||
|
|||
const defineTest = require("../../utils//defineTest"); | |||
const defineTest = require("webpack-cli-utils//defineTest"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is there double slash //
? It's even present on master.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is in the master, I don't want to change this with this PR. And anyhow it is not higher priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhruvdutt Typo ^^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is this even working? Shouldn't it throw an error? 😅
Might be doing sanitization.
{ | ||
"name": "webpack-cli-migrate", | ||
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please add description and readme (which would be visible on npm pages) for all packages?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That could be added later
}, | ||
"dependencies": { | ||
"webpack-cli-generators": "2.0.12", | ||
"yeoman-environment": "^2.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're using yeoman-environment
in all of the packages except webpack-cli-generators
. Is there something that can be done about it to make it easier for maintaining a single version of it across all packages else we'll have to keep all versions of yeoman-environment
in parity while upgrading in future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you mean here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dhruvdutt I don't think it's possible. I totally understand your point and it would great to just change the version in one single place and that's it!
@sendilkumarn It means that if we have to upgrade the yeoman-environment
we have to it everywhere (and we have to remember to do it). @dhruvdutt is suggesting if there's a way to update just in one place so we avoid problems (or less problems). I don't know much about how lerna works, maybe there's a solution for that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is what lerna exactly tries to do, may be that is the whole reason to use something like lerna. add
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we use yeoman
in all packages
packages/generators/package.json
Outdated
"log-symbols": "2.2.0", | ||
"mkdirp": "^0.5.1", | ||
"webpack-addons": "^1.1.5", | ||
"webpack-cli-generators": "2.0.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
webpack-cli-generators
depends on webpack-cli-generators
? ↩️
Recursive dependency. 😄
packages/generators/package.json
Outdated
"webpack-addons": "^1.1.5", | ||
"webpack-cli-generators": "2.0.12", | ||
"webpack-cli-init": "2.0.12", | ||
"webpack-cli-utils": "2.0.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we using locked package versions everywhere? "2.0.12"
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, we're going to keep the versions of all packages in parity, right? Upgrade to one will cause all of the packages to bump versions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is the default config with lerna and lets do it in this way.
package.json
Outdated
@@ -15,10 +15,14 @@ | |||
"engines": { | |||
"node": ">=6.11.5" | |||
}, | |||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do all the packages have private
flag?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would'nt this cause lerna to not publish this package? Or if i misunderstood the docs it won't publish just packages inside packages/
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's true, we must update them
packages/migrate/package.json
Outdated
"webpack-cli-utils": "2.0.12", | ||
"yeoman-environment": "^2.0.0", | ||
"yeoman-generator": "^2.0.3" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There seems to be a lot of extraneous dependencies everywhere like cross-spawn
, global-modules
, got
, yeoman-environment
which can be cleaned.
prettier
is part of utils
- runPrettier
. Shouldn't be included here.
We don't use yeoman-generator
as well in migrate.
packages/utils/package.json
Outdated
"global-modules": "^1.0.0", | ||
"got": "^8.2.0", | ||
"jscodeshift": "^0.5.0", | ||
"p-each-series": "^1.0.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please clean extraneous dependencies here as well as in other packages.
@@ -111,6 +115,7 @@ | |||
}, | |||
"devDependencies": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to start cleaning dependencies
and devDependencies
from the main package.
For instance inquirer
is used only while migration and carries a weight of 815.9 kB
.
We should better shift dependencies under the packages it is required and lighten up webpack-cli
package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as long as you move them into a separate repo, I think this doesn't make any sense. replacing inquirer
for CLI is not advisable AFAICT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sendilkumarn I've resolved the conflicts and made a PR. Please check #1. |
ccd9e15
to
64cfef7
Compare
@sendilkumarn Could you provide some context/description to your PR please? I know the title is self explaining but it would be nice to give a description of the work you've done - which is a lot! - so also the rest of the community can have a better understanding |
@ematipico my bad, this was described in the old PR #275 and it was discussed across. But, yeah updated the ticket. |
Awesome job @sendilkumarn ! |
We got some conflicts :( |
@ematipico done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just flagged some changes to apply, mainly to remove the 'private' flag from the package.json files
package.json
Outdated
@@ -15,10 +15,14 @@ | |||
"engines": { | |||
"node": ">=6.11.5" | |||
}, | |||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that's true, we must update them
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also here, we have to get rid of the private: true
packages/generators/package.json
Outdated
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove
packages/init/package.json
Outdated
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove
packages/migrate/package.json
Outdated
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove
packages/utils/package.json
Outdated
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To remove
"version":"2.0.12", | ||
"description": "CLI for webpack & friends", | ||
"license": "MIT", | ||
"private": true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be removed as the others.
@sendilkumarn Thanks for your update. I labeled the Pull Request so reviewers will review it again. @ematipico Please review the new changes. |
@sendilkumarn Please review the following output log for errors:
See complete report here. |
@sendilkumarn Can you merge with next and provide us with steps to test the monorepo? |
@ev1stensberg I would like to locally link & use this branch for testing. | release a next version with this branch Then go ahead and create / update any project with CLI ( The next should be use only what is needed (i.e only those packages that are needed) Then finally, we should make webpack-cli as a holder and make use of sub-packages wherever necessary. (In other words, add |
All the packages have to be pushed on npm right? Same for the |
Yes. Unless we want to publish webpack-cli too. |
Followup and refined #275
This PR tries to make this webpack-cli repo into monorepo using lerna.