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

Convert to monorepo using lerna.js #153

Merged
merged 1,411 commits into from
Jan 16, 2019
Merged

Convert to monorepo using lerna.js #153

merged 1,411 commits into from
Jan 16, 2019

Conversation

mlnmln
Copy link
Contributor

@mlnmln mlnmln commented Jan 2, 2019

@simonsmith @giuseppeg

  • Moves suit to a monorepo using lerna.js.
  • imports all non-deprecated packages with their commit history.
  • Bootstraps all packages using the yarn client.
  • Updates mocha in generator-suit and removes pre publishnsp (bc of reported security issue, lerna bootstrap would not finish otherwise).
  • Updates uris for repo, homepage and bugs in all packages.

Use

  • lerna bootstrap to install all packages

To test lerna versioning

  • Use lerna version patch --yes --no-push to test locally before doing anything on remote.

To publish

  • npm login, then
  • lerna publish patch --yes

This results in the following version bumps, everything should stay 100% backwards compatible.

 - suitcss-base: 5.0.0 => 5.0.1
 - suitcss-components-arrange: 1.1.1 => 1.1.2
 - suitcss-components-button: 6.0.2 => 6.0.3
 - suitcss-components-flex-embed: 2.0.4 => 2.0.5
 - suitcss-components-grid: 4.0.0 => 4.0.1
 - suitcss-components-test: 1.0.0 => 1.0.1
 - suitcss-components: 2.0.0 => 2.0.1
 - generator-suit: 1.0.2 => 1.0.3
 - suitcss-preprocessor: 4.0.0 => 4.0.1
 - stylelint-config-suitcss: 14.0.0 => 14.0.1
 - stylelint-suitcss: 3.0.0 => 3.0.1
 - suitcss-theme: 1.0.0 => 1.0.1
 - suitcss-utils-after: 1.0.1 => 1.0.2
 - suitcss-utils-align: 1.0.0 => 1.0.1
 - suitcss-utils-before: 1.0.1 => 1.0.2
 - suitcss-utils-display: 1.0.2 => 1.0.3
 - suitcss-utils-flex: 2.0.1 => 2.0.2
 - suitcss-utils-layout: 1.0.1 => 1.0.2
 - suitcss-utils-link: 1.0.1 => 1.0.2
 - suitcss-utils-offset: 1.0.0 => 1.0.1
 - suitcss-utils-position: 1.0.1 => 1.0.2
 - suitcss-utils-size: 2.0.1 => 2.0.2
 - suitcss-utils-text: 1.0.0 => 1.0.1
 - suitcss-utils: 3.0.0 => 3.0.1

This PR is limited in scope intentionally and should be a good foundation for further development work with a monorepo approach.

#151

necolas and others added 30 commits December 30, 2018 14:57
'adjoining-classes': SUIT is ok with adjoining classes, and requires
them for component state.

'compatible-vendor-prefixes': this rule isn't useful and doesn't take
into account browser market share (so it keeps warning about
vendor-prefixes that you don't want). The framework also favours using a
preprocessor to handle and update vendor prefixes automatically.
Everything is covered in the generated component's README
Doesn't provide enough value and inadequate plugin support (for things
like code style and not warning about variable syntax).
* Add npm support.
* Include latest build tools.
* Correct names in manifests.
* Update generated test file.
* Update code style in generated component.
…ed-pkg

Update modules in generated package
Rewrite and Change in generator API
Fixes suitcss#4
Rename the package.json template to be extensionless
Fixes suitcss#9
Fix: prefix modulePackageName with suitcss-
* package.json template:
 * Update dependencies
 * Make 0.1.0 the default ver
 * Add license
* Fix indentation in the lib/*.css templates
Add year and author name to package.json and LICENSE.md templates
Includes latest change to CSS variables syntax.
Copy link
Member

@giuseppeg giuseppeg left a comment

Choose a reason for hiding this comment

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

thanks @mlnmln !! I took a look at the PR and this is a first round of feedback. Hopefully next week I will have some time to clone and play with it.

package.json Outdated
@@ -12,6 +12,7 @@
"suitcss-utils": "^3.0.0"
Copy link
Member

Choose a reason for hiding this comment

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

Currently suitcss/suit is a package on its own. Is it necessary or does it make sense to create a pkg in packages/suit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

#151 (comment)

It is not necessary, but I would recommend moving it to packages/suit. That way the docs could stay at root and the code would be in its own folder.

@@ -1,4 +1,3 @@
bower_components
build
components
Copy link
Member

Choose a reason for hiding this comment

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

you didn't remove this from other packages. Should we do for all of them or for none?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

lerna version was (wrongfully?) complaining that some packages would be under gitignore, e.g. components-button. It think it would be safe to remove it from all packages. component itself is deprecated for more than 3 years now.

@@ -0,0 +1,4 @@
language: node_js
Copy link
Member

Choose a reason for hiding this comment

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

I think that with the monorepo now we need a centralized .travis.yml config and maybe even a centralized test runner

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed, but I would track that in a separate issue.

Copy link
Member

Choose a reason for hiding this comment

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

yep makes sense, thanks!

@@ -0,0 +1,4 @@
language: node_js
sudo: false
node_js:
Copy link
Member

Choose a reason for hiding this comment

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

we should normalize this field too. I'd pick node 8 and 10, 6 is going out the LTS maintenance in April.


* [npm](http://npmjs.org/): `npm install suitcss-base`
* [Component(1)](http://github.com/component/component): `component install suitcss/base`
* [Download](https://github.com/suitcss/base/releases)
Copy link
Member

Choose a reason for hiding this comment

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

probably we should remove these download links

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed.

## Installation

* [npm](http://npmjs.org/): `npm install suitcss-base`
* [Component(1)](http://github.com/component/component): `component install suitcss/base`
Copy link
Member

Choose a reason for hiding this comment

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

will this keep working?

Copy link
Contributor Author

@mlnmln mlnmln Jan 7, 2019

Choose a reason for hiding this comment

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

It's not even working right now. :)

mlnmln@localhost ~/d/component> component install suitcss/base

   installed : suitcss/[email protected] in 2099ms

       fatal : no remote found for dependency "necolas/[email protected]". Visit http://component.github.io/troubleshooting for help.

having said that. for as long as we keep the original repo and archive it, . component installation should still work.

@mlnmln
Copy link
Contributor Author

mlnmln commented Jan 7, 2019

@giuseppeg Thanks for the feedback, I added my points.

My main goal now, would be to have a shared understanding of scope / task breakdown.

This PR allows publishing new versions for each package through lerna.js, (hopefully) without breaking anything.

I would strongly recommend splitting any other features (shared test runner, travis config etc., ) into separate issues, unless you think they are critical for landing the PR.

Otherwise we can work on this indefinitely.

@simonsmith
Copy link
Member

simonsmith commented Jan 7, 2019

I think this looks good!

This PR is limited in scope intentionally and should be a good foundation for further development work with a monorepo approach.

I agree with this. This work will give us the push to get carry on with other outstanding issues and we can refine the lerna setup as we go.

Great stuff @mlnmln.

One question regarding the root level package.json. If we were to bump and publish say, suitcss-base do we then need to bump the version in the root package.json and publish the suit package?

@mlnmln
Copy link
Contributor Author

mlnmln commented Jan 9, 2019

@simonsmith

I agree with this. This work will give us the push to get carry on with other outstanding issues and we can refine the lerna setup as we go.

Glad to hear.

One question regarding the root level package.json. If we were to bump and publish say, suitcss-base do we then need to bump the version in the root package.json and publish the suit package?

For as long as we use independent versioning, I don't think so, no.

We would only bump the suit package when we want it to use a new version of suitcss-base outside its current caret range.

But to have that more clearly separated I think we should take action on #153 (comment)

Then we essentially would have a (private) root package that is not suit.
SEE: https://github.com/babel/babel/blob/master/package.json#L3

That package then would take care of shared dev dependencies etc in the long run, but is not installable on its own via npm.

It relatively easy and I could do it during the next couple of days. What do you think?

@simonsmith
Copy link
Member

But to have that more clearly separated I think we should take action on #153 (comment)

That seems a logical approach to me, yes

@mlnmln mlnmln changed the title WIP: Convert to monorepo using lerna.js Convert to monorepo using lerna.js Jan 10, 2019
@mlnmln
Copy link
Contributor Author

mlnmln commented Jan 10, 2019

@simonsmith @giuseppeg

  • I moved suit to its own package now, the root package now only includes lerna.js.
  • I did not know how to split up the readme for the package exactly, so I left it at root.
  • In the midterm this should be split into a project and a package readme for the suit package only.
  • Also I did not touch the links to old the releases for now.

@giuseppeg
Copy link
Member

In the midterm this should be split into a project and a package readme for the suit package only.

@mlnmln I guess that for now we can duplicate it

@mlnmln
Copy link
Contributor Author

mlnmln commented Jan 10, 2019

@mlnmln I guess that for now we can duplicate it

works for me.

@giuseppeg
Copy link
Member

@simonsmith I just pushed a pre-monorepo branch to save a copy of the status quo. Feel free to merge when you've taken a look at the PR.

@mlnmln thank you a lot for your help and patience :)

@simonsmith
Copy link
Member

Looks great to me. Merging

@simonsmith simonsmith merged commit 64e1f13 into suitcss:master Jan 16, 2019
@simonsmith simonsmith mentioned this pull request Jan 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.