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

chore: Replace lerna with turborepo + changesets #2321

Merged
merged 68 commits into from
Apr 29, 2022

Conversation

florian-richter
Copy link

@florian-richter florian-richter commented Apr 1, 2022

Closes SAP/cloud-sdk-backlog#579.

What is included?

  1. An ADR discussing tooling for an efficient monorepo.
  2. All changes necessary to use "turborepo" and "changesets" instead of "lerna".
    • Adjusted package.json files (mostly changed npm scripts + moved some scripts from top level to the individual packages)
    • Updated documentation
    • Split test-services package into more granular dependencies (common test services are now no longer part of odata-common)
    • Split and changed some script files so they run on individual packages rather than everything (use turbo to run it for everything)
    • Generated files use file mode 100755 instead of 100644 which is a technical limitation of turborepo
    • Created turbo.json configuration file
  3. Replaced import foo = require('foo'); with import foo from 'foo'; which is effectively equivalent.
  4. Update to yarn 1.22.18 (from 1.22.10)

What to review?

  1. Check the ADR for context and details on the proposed solution.
  2. Consider reading this article in the turbo docs to get an understanding how it works.
  3. Check the root package.json and turbo.json.
  4. Try scripts in the root package.json (see if everything works locally).
  5. Check the test-services-* test-packages (in comparison to the previous setup).
  6. Verify if changes for releasing with "changesets" are clear and reasonable.

TODO:

  • generate:common
  • Release script
  • Add details on changesets to ADR
  • Add details on changes to the package scripts to ADR
  • Implement ^generate as prerequisite of test
  • Add action / PR template to add changeset
  • Evaluate nx
  • Migrate changes for next release to changesets

@florian-richter florian-richter changed the title chore: Replace lerna with turborepo + X? chore: Replace lerna with turborepo + changesets Apr 14, 2022
@florian-richter florian-richter marked this pull request as ready for review April 20, 2022 17:31
`;
const disableEslint = '/* eslint-disable */';

generateCommonEntity();
Copy link
Contributor

Choose a reason for hiding this comment

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

Minor: Perhaps you can add a technical debt ticket that we rename this to generate-common-service and create also service,api, complextype... files so that this service is more like the other ones - but this is really if we have not something better to do so most likely never.

Copy link
Author

Choose a reason for hiding this comment

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

I agree that we may want to improve but a ticket feels unnecessary because it will be super low prio. Also it is quite obvious that this is different and a bit lacking so it wont be hard to find this if you somehow find time to work on it. @marikaner would you prefer I add this tech debt item?

- CLI is amazingly simple:
- Create a changeset with `yarn changeset`.
- Apply changeset with `yarn changeset version`.
- Create release with `yarn changeset publish` or `yarn changeset publish --tag beta`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Serious Question: How we plan to do the intermediate period? Let's say we merge this PR tonight, then there are already unpublished changes on the main branch which are not modeled in the per package changeset. However, our release script relies now on the changeset - will this cause problem?

Copy link
Contributor

Choose a reason for hiding this comment

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

Or do we simply do a bit handy work for the next release on the generated changelog file and after this the lib will work fine because there are no untracked changes?

Copy link
Author

Choose a reason for hiding this comment

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

Good point. I will migrate the changes we have so far into the changesets format. We may need a check before the next release that nothing was added without a changeset, but that should be low effort.

Copy link
Contributor

@FrankEssenberger FrankEssenberger left a comment

Choose a reason for hiding this comment

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

I played around with it in the afternoon and I am really pleased with the performance and convinience generated by the turbo monorepo tool. I only had some questions - I approve once they are clear to me.

Copy link
Contributor

@FrankEssenberger FrankEssenberger left a comment

Choose a reason for hiding this comment

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

Last open point were the missing cheanges in the changelog which are not present since there nothing unpublished customer facing content. So good to merge from my side.

@florian-richter florian-richter merged commit a2997ce into main Apr 29, 2022
@florian-richter florian-richter deleted the monorepo-tools-adr branch April 29, 2022 14:37
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