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

feature: add monorepo tooling to minimize maintenance #464

Merged
merged 34 commits into from
Sep 18, 2023

Conversation

byCedric
Copy link
Member

@byCedric byCedric commented Sep 16, 2023

Why

This is another attempt to implement proper monorepo tooling to minimize maintenance as much as possible.

How

  • Added turbo as monorepo tool
  • Configured through turbo.json (with .vscode/settings.json to set it to jsonc/json5)
  • Revamped snackager/Dockerfile to remove hardcoded paths
    • This now uses turbo to remove unused workspaces, which auto-updates once they are added/removed.
    • It also reuses previously built files when possible, minimizing build time as well.
  • Revamped website/Dockerfile to remove hardcoded paths (same as snackager)

Docker sizes

Dockerfile Before After
snackager Dockerfile before this change Dockerfile after this change
snackpub Dockerfile after this change Dockerfile after this change
website Dockerfile before this change Dockerfile after this change

Test Plan

Since this is a big change, have to fully test this on staging first.

@byCedric byCedric force-pushed the @bycedric/monorepo-tools branch 3 times, most recently from 903f302 to ad7dd0e Compare September 16, 2023 10:09
@byCedric byCedric temporarily deployed to snackager-staging September 16, 2023 10:15 — with GitHub Actions Inactive
@byCedric byCedric requested a review from Kudo September 16, 2023 10:27
Copy link
Collaborator

@Kudo Kudo left a comment

Choose a reason for hiding this comment

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

basically looks good to me. good to learn the turbo prune --docker.
didn't see any big problem in this pr, just have to deploy and we will know.

snackager/package.json Outdated Show resolved Hide resolved
@byCedric
Copy link
Member Author

byCedric commented Sep 16, 2023

@Kudo We definitely need to just try it in deployment, that's why Snack staging is already running this image 😄 And so far, its looking good.

Edit: both Website and Snackager are now running these Dockerfiles 👍 It's also insane to me how much build cache we still shipped with the website image. It's now reduced by a factor of 3.9x 🙈

@byCedric byCedric force-pushed the @bycedric/monorepo-tools branch 5 times, most recently from a85498b to 8c65276 Compare September 16, 2023 17:29
@byCedric byCedric temporarily deployed to snackager-staging September 16, 2023 19:51 — with GitHub Actions Inactive
@byCedric byCedric temporarily deployed to website-staging September 16, 2023 19:51 — with GitHub Actions Inactive
@byCedric byCedric temporarily deployed to snackpub-staging September 17, 2023 09:16 — with GitHub Actions Inactive
@byCedric byCedric temporarily deployed to website-staging September 17, 2023 09:16 — with GitHub Actions Inactive
@byCedric byCedric temporarily deployed to snackager-staging September 17, 2023 09:17 — with GitHub Actions Inactive
@byCedric byCedric marked this pull request as ready for review September 17, 2023 09:35
Base automatically changed from @bycedric/upgrade/sdk-49 to main September 18, 2023 08:41
@byCedric byCedric merged commit 975219b into main Sep 18, 2023
22 checks passed
@byCedric byCedric deleted the @bycedric/monorepo-tools branch September 18, 2023 08:41
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