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

Replace lerna with turborepo #1367

Merged
merged 38 commits into from
Sep 13, 2024
Merged

Replace lerna with turborepo #1367

merged 38 commits into from
Sep 13, 2024

Conversation

piotrpospiech
Copy link
Collaborator

@piotrpospiech piotrpospiech commented Sep 8, 2024

Description

This is minimal setup of turborepo. It replaces lerna package. I focused on keeping it as simple as possible, so current configuration can be (and should be) updated in the future. For example, eslint and typescript configs can be moved to internal packages (docs).

During implementation, I had issues with reproductions and website projects and couldn't make them work. They have been removed for now in order to create this draft pull request. Removed files in the reproductions, website and docs can be ignored in the code review process.

Build process

The biggest change is a new building process. To take full advantage of the new project structure, I changed the build process from incrementally building with tsc in the root directory to running each packages' tsc build script in parallel. It's faster on cold start, but also incredibly fast when it comes to cache utilization. There are results after running it with Node v22.8.0 and npm v10.8.3 (cold start):

master turborepo
build 49s 21s
test 37s 14s

Missing features (to be implemented)

  • reproductions project
  • Documentation (website & docs directories)
  • Publishing process

lerna had already implemented publishing process (package versioning and publishing them to the NPM registry). turborepo doesn't have such feature. It is recommended to use changesets (docs).

I suggest to implement docs and publishing process in other PRs.

List of changes

  • Removed lerna package
  • Added turbo package
  • Changed build process
  • Removed reproductions and docs (temporary)
  • Added devDependencies and moved some packages from dependencies. It can be refactored further though.
  • Simplified tsconfig files to remove incremental build
  • Added simple-schema.d.ts to the uniforms-bridge-simple-schema-2. This file was originally located in the website directory. This directory was temporary removed and missing file was causing type issues during testing process.
  • Removed publish script as it was based on lerna
  • Removed unused packages in the root directory

How to test changes

Use Node v22 (check current version in the .nvmrc) and npm v10 (check current version in the package.json -> packageManager)

  1. Checkout to turborepo branch
  2. Run npm run clean (it deletes packages' builds)
  3. Run npm run reset (it deletes node_modules, turbo cache, etc)
  4. Run npm ci (it also runs build script)
  5. To run manually building process for packages - run npm run build
  6. Run npm test

@github-actions github-actions bot added Area: Theme Affects some of the theme packages Area: Bridge Affects some of the bridge packages Area: Docs Affects the documentation or reproductions seed Theme: AntD Affects the uniforms-antd package Theme: Bootstrap 4 Affects the uniforms-bootstrap4 package Theme: Bootstrap 5 Affects the uniforms-bootstrap5 package Theme: MUI Affects the uniforms-mui package Theme: Semantic UI Affects the uniforms-semantic package Theme: Unstyled Affects the uniforms-unstyled package Bridge: JSON Schema Affects the uniforms-bridge-json-schema package Bridge: SimpleSchema (v2) Affects the uniforms-bridge-simple-schema-2 package Bridge: Zod Affects the uniforms-bridge-zod package labels Sep 8, 2024
@piotrpospiech piotrpospiech linked an issue Sep 8, 2024 that may be closed by this pull request
Copy link

codecov bot commented Sep 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.17%. Comparing base (6c5ad48) to head (62a90df).
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1367      +/-   ##
==========================================
+ Coverage   94.90%   96.17%   +1.27%     
==========================================
  Files         175      175              
  Lines        2904     2904              
  Branches      778      778              
==========================================
+ Hits         2756     2793      +37     
  Misses         59       59              
+ Partials       89       52      -37     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kestarumper
Copy link
Member

It would be great to have some new instructions in README.md

@piotrpospiech piotrpospiech marked this pull request as ready for review September 13, 2024 12:36
@piotrpospiech piotrpospiech mentioned this pull request Sep 13, 2024
<script type="module" src="./index.tsx"></script>
</body>

</html>
Copy link
Member

Choose a reason for hiding this comment

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

missing newline at the end of file

@kestarumper
Copy link
Member

Amazing work! 🚀

@piotrpospiech piotrpospiech merged commit e020a5e into master Sep 13, 2024
8 checks passed
@piotrpospiech piotrpospiech deleted the turborepo branch September 13, 2024 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Bridge Affects some of the bridge packages Area: Core Affects the uniforms package Area: Docs Affects the documentation or reproductions seed Area: Infra Affects the repository itself (e.g., CI, dependencies) Area: Theme Affects some of the theme packages Bridge: JSON Schema Affects the uniforms-bridge-json-schema package Bridge: SimpleSchema (v2) Affects the uniforms-bridge-simple-schema-2 package Bridge: Zod Affects the uniforms-bridge-zod package Theme: AntD Affects the uniforms-antd package Theme: Bootstrap 4 Affects the uniforms-bootstrap4 package Theme: Bootstrap 5 Affects the uniforms-bootstrap5 package Theme: MUI Affects the uniforms-mui package Theme: Semantic UI Affects the uniforms-semantic package Theme: Unstyled Affects the uniforms-unstyled package
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Replace Lerna with Turbo
3 participants