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

Converts project into a Lerna monorepo #83

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

ctrlplusb
Copy link

@ctrlplusb ctrlplusb commented Nov 14, 2018

Mostly there 👍

What I have done:

  • Configured the project as a lerna monorepo, utilising a versioning system that keeps all packages on the same version number. We may want to consider moving to independent versioning.
  • Configured yarn workspaces. Yarn workspaces is a must IMO when working with a monorepo.
  • Created three packages:
    • react-automata: The core package
    • react-automata-test-utilities: Contains the test helper
    • react-automata-utilities: "Internal" utilities shared between the other packages. May want to consider a rename of this.
  • All build/dev tools remain in root of mono repo. You build all 3 packages via the root. I kept the package.json scripts in the root and as they were in order to reduce friction with moving into the monorepo.
  • Updated to latest version of babel to get around some issues I was having with running tests at root
  • Updated eslint configurations

To be done:

  • Revise the root README
  • Create a README for each package?
  • Fix the travis config
  • Validate publishing / versioning works as expected

Build is working, and so are the tests. 👍

Note: when performing updates across the packages you may need to perform a build prior to test. It would be cool if there was a mechanism to build on the fly whilst running tests in watch mode.

Closes #32

@ctrlplusb ctrlplusb changed the title Converts project into a Lerna/Yarn monorepo Converts project into a Lerna monorepo Nov 14, 2018
'@babel/plugin-proposal-object-rest-spread',
'babel-plugin-idx',
'annotate-pure-calls',
NODE_ENV !== 'test' && [
Copy link
Author

@ctrlplusb ctrlplusb Nov 14, 2018

Choose a reason for hiding this comment

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

This plugin was breaking my tests. I don't think it is critical to remove prop-types in tests so I have inserted this condition to avoid the issue.

{
"npmClient": "yarn",
"packages": ["packages/*"],
"version": "4.0.4",
Copy link
Author

@ctrlplusb ctrlplusb Nov 14, 2018

Choose a reason for hiding this comment

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

We can change the value for version to "independent" in order to move towards independent version numbers.

plugins: [babel()],
})

export default [
Copy link
Author

@ctrlplusb ctrlplusb Nov 14, 2018

Choose a reason for hiding this comment

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

All 3 packages share the same rollup config. Simples.

@MicheleBertoli
Copy link
Owner

This is FANTASTIC, thank you very much @ctrlplusb 💖
I'll review and merge ASAP.

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.

2 participants