Setup lerna#1291
Conversation
marvinchin
left a comment
There was a problem hiding this comment.
Did some poking around and things seem to work fine! Now to see if publishing works as we expect.
Some questions/thoughts:
- Do you know why the FontAwesome version was bumped? Ideally, we should retain the original version in this PR to keep these concerns separate and avoid unnecessary diffs.
- I feel that we should keep the
README.mdin the root. This can help new devs who first visit our repo some information on the project and how to get started at first glance. Maybe we should set up a new README forcliand each of the other leaf packages, with a short explanation on what each package does.
|
|
||
| !.eslintrc.js | ||
|
|
||
| # vue-components |
There was a problem hiding this comment.
Just wondering - is there any reason why we don't just use packages/vue-components here?
There was a problem hiding this comment.
Some questions/thoughts:
- Do you know why the FontAwesome version was bumped? Ideally, we should retain the original version in this PR to keep these concerns separate and avoid unnecessary diffs.
we previously installed the core package transitively via the cli package, so there was no package-lock there. so the latest semantic ver gets installed.
I'll get out a separate pr to update it though, then rebase this one on top of that
- I feel that we should keep the
README.mdin the root. This can help new devs who first visit our repo some information on the project and how to get started at first glance. Maybe we should set up a new README forcliand each of the other leaf packages, with a short explanation on what each package does.
🤦♂️ unintentional. Will revert and add some brief readmes for cli/core after the npmignore commit during the rebase above
| <popover header="Why **2** `ci` commands?" content="Our components subpackage depends on `node-sass` indirectly, which depends on `fsevents`.<br><br> `fsevents` is not needed nor compatible with Windows, and `npm ci` does not respect this since it uses `package-lock.json`.">(`ciwin:all` if you are on a Windows machine)</popover> | ||
| in the root folder of your cloned repo. | ||
| 1. **To bind your cloned version of MarkBind to your console** (instead of the released version of MarkBind), run `npm link` in the root folder of the cloned repo. | ||
| 1. **Install dependencies** by running <popover content="Under the hood, this calls `npm ci` and `lerna bootstrap`">`npm run setup`</popover> in the root folder of your cloned repo. |
There was a problem hiding this comment.
I had some issues due to existing node_modules directories in the existing packages. Do you think it's worth adding a note here for existing markbind devs to first run lerna clean before running npm run setup?
There was a problem hiding this comment.
lerna clean won't work unless you have it installed globally or have run npm ci (which npm run setup does) first unfortunately. I think the devguide should be written in the perspective of new developers always though. Experienced developers could always drop an issue / ping, and have a likely have a better understanding of node already 😁
| MarkBind uses <md>[lerna](https://github.com/lerna/lerna)</md>, a popular multi-package development tool, to manage it's dependencies. It is essentially a high level wrapper over node and npm's functionalities | ||
| </box> | ||
|
|
||
| 1. **To bind your cloned version of MarkBind to your console** (instead of the released version of MarkBind), run `npm link` in the `packages/cli` folder of the cloned repo. |
There was a problem hiding this comment.
Does this work for you now? I'm getting errors because our internal packages haven't been published yet.
There was a problem hiding this comment.
got that too, you could get around it by temporarily removing the @markbind/core dependency and npm link then undoing it
|
Updated:
https://github.com/lerna/lerna/blob/master/doc/hoist.md Also switched over to the second disadvantage mentioned isn't applicable either as |
| @@ -21,9 +21,9 @@ export default { | |||
| } | |||
| const pages = []; | |||
| const regexes = this.value.split(' ') | |||
| .filter((searchKeyword) => searchKeyword !== '') | |||
There was a problem hiding this comment.
Are these diffs intentional?
Ideally, fixing linting errors would be done in a separate PR, but if these new errors are introduced because of the changes we make to the eslint config to support lerna then I'm happy to keep it in this PR.
There was a problem hiding this comment.
yup the vue eslintrc now properly extends the previous root config
| @@ -0,0 +1,4683 @@ | |||
| { | |||
There was a problem hiding this comment.
I presume that these package-lock changes are done by lerna bootstrap? Ideally we'd be able to verify that our dependency versions are still the same, but these diffs seem a little too large to manually verify 🙁
There was a problem hiding this comment.
yep, I think that if our functional tests stay the same we should be good though, since package-lock is only effective in development environment
if there are changes (like the font awesome bundles), we can then investigate them and deal with the diff in a separate pr
|
Updated @marvinchin, seems to work. Travis seems to be broken on all prs though, likely unrelated to the changes here 494ba03 - rename the packages with |
|
This is a big PR with multiple steps. I feel that we should do a merge commit, rather than squashing the commit history here. I also think we should add some detail to commit 494ba03 explaining why we are doing the renaming. |
yup that's the plan
Just received npm permissions from @yamgent, will revert back to |
Development linting dependencies and configuration are duplicated throughout the packages. Let's hoist these to the root package as much as possible, removing such duplication. In doing so, some style standards are also corrected in the vue-components package. Let's fix the style violations resulting from this.
|
reverted to |
What is the purpose of this pull request? (put "X" next to an item, remove the rest)
• [x] Other, please explain:
Resolves #1285
What is the rationale for this request?
See #1285
What changes did you make? (Give an overview)
Commit order:
packages/cli5a56a69.gitignoreignore path accordingly.npmignorefor core package d7ca8bclerna init+lerna bootstrap) 7979698eslint ., and ditches separately runningeslint .in all packages. This allows vue-components' eslint to properly extend the root configIs there anything you'd like reviewers to focus on?
Testing instructions:
npm run testtestnpm script in all packages separatelyProposed commit message: (wrap lines at 72 characters)
The cli and core packages uses relative file specifiers to link
dependencies in the mono repo. This causes a published cli package to
fail to install.
Besides site generation, the core package also houses several other
things like templates, assets and plugins, which can be moved into
separate packages for better separation of concerns.
Let's extract the main cli package into packages/cli as such, resulting
in a flat package structure.
The multi package structure implies publishing all packages
independently, which fixes the usage of relative file specifiers.
Let's also setup lerna, which is a multi-package monorepo development
and dependency management helper.
This greatly reduces the amount of work needed to manage multiple
independent packages.