Turborepo Implementation & Monorepo standardization#3261
Conversation
|
|
A wrangler prerelease is available for testing. You can install this latest build in your project with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5245269842/npm-package-wrangler-3261You can reference the automatically updated head of this PR with: npm install --save-dev https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/prs/3261/npm-package-wrangler-3261Or you can use npx https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5245269842/npm-package-wrangler-3261 dev path/to/script.jsAdditional artifacts:npm install https://prerelease-registry.devprod.cloudflare.dev/workers-sdk/runs/5245269842/npm-package-cloudflare-pages-shared-3261Note that these links will no longer work once the GitHub Actions artifact expires. |
Codecov Report
@@ Coverage Diff @@
## main #3261 +/- ##
==========================================
- Coverage 75.42% 75.36% -0.07%
==========================================
Files 182 183 +1
Lines 11070 11022 -48
Branches 2903 2893 -10
==========================================
- Hits 8350 8307 -43
+ Misses 2720 2715 -5
|
40bd1ee to
500d896
Compare
petebacondarwin
left a comment
There was a problem hiding this comment.
Looking good. I asked a couple of clarifying questions before approving.
There was a problem hiding this comment.
| "test:watch": "npx vitest" | |
| "test:watch": "vitest" |
??
There was a problem hiding this comment.
vitest run will never watch and vitest will watch in local dev mode. TurboRepo will hang sometimes with vitest. Additionally npx is unnecessary, everything should be a dependency in the packages as a Monorepo standard convention.
There was a problem hiding this comment.
Yeah this comment was about the fact that there is inconsistent use (or non-use) of npx in these scripts. If a tool is installed locally (which it should be!) then npx should not be needed - for wrangler, vitest, etc.
There was a problem hiding this comment.
I agree there should be a consistent enforcement.
|
Running locally, I did a So I added Then I tried just running it again and now it failed on I think we need to ensure that all these tests can run successfully from a clean clone and install of the project before we land this. It feels like there is still some configuration that is missing? (It may be that the timeouts are due to the workerd permission pop-ups blocking the tests; and if you don't click accept quickly enough then the tests timeout?) |
This adds isolated caching for workspaces isolated tasks and localized pipelines more complex packages to exist in the monorepo
…t will be watched or run long term
GregBrimble
left a comment
There was a problem hiding this comment.
I have reviewed the code relevant to Pages, as well as the global-level stuff and smatterings not relevant to Pages. Pretty much all good to me. One tiny tiny nit and a suggestion about package naming (which isn't strictly relevant to this PR, but you do add some new packages which fall under have the same 'problem').
LGTM, thanks @JacobMGEvans! ✅
f0cee63 to
5f6e333
Compare
|
🥳 🥳 🥳 |



👋🏻 This has been a long time in the making #1990, we are finally here! The Repo has undergone a lot of initial growth and evolution as we worked to make the migration happen to TypeScript and further provide better development experiences for our users, this is now us doing the same for ourselves which will enable us to evolve AGAIN!
Why TurboRepo & Monorepo?
The goal of providing an architecture & system that decouples the Wrangler core so that it can be used in external modules, we would like to move the workers-sdk towards a Monorepo structure and manage it with a modern tooling built for Monorepos like Turborepo.
This would help us standardize and enforce Monorepo conventions. Additionally packages will share a core config, i.e. TSConfig & ESLint config, while also extending that to their own isolated config and environments, this will prevent global configs becoming increasing complex and potentially conflicts between local configs that don't necessarily need the global config.
This move will help to reduce build times and test failures by enabling caching of builds and by intelligently running tests and other checks only on parts of the codebase that have changed or are dependent on each other.
Future improvements & things this PR facilitates:
wrangler/cli,wrangler/core, etc...workers-sdkdue to the nature of them being created outside of theworkers-sdkrepo and migrated in laterConclusion
Overall, this is a move to improve the developer experience of a repo that many teams contribute to on a daily basis.
Comparisons
CI/CD Checks
TurboRepo Checks time (Linting, Types & Formatting combined in parallel)Before TurboRepo

Local Terminal Runs
TurboRepo Checks - uncached (Linting, Types & Formatting combined highly parallel)TurboRepo Checks - Cached (Linting, Types & Formatting combined)

Before TurboRepo - Linting, Types & Formatting concurrent w/ no caching comparison

Special Thanks
@anthonyshew - https://twitter.com/anthonysheww