-
-
Notifications
You must be signed in to change notification settings - Fork 529
Add Turborepo #2027
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
Add Turborepo #2027
Conversation
|
Deploying openapi-ts with
|
Latest commit: |
9cee0b7
|
Status: | ✅ Deploy successful! |
Preview URL: | https://f7cff6b2.openapi-ts.pages.dev |
Branch Preview URL: | https://turbo.openapi-ts.pages.dev |
7c532c2
to
e5f08f6
Compare
size-limit report 📦
|
@@ -6,6 +6,9 @@ on: | |||
- main | |||
pull_request: | |||
|
|||
env: | |||
GITHUB_TOKEN: ${{ secrets.OPENAPI_TS_BOT_GITHUB_TOKEN }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this was added because Turborepo adds a “shield” around env vars and doesn’t accidentally expose something sensitive, so you declare what to expose. But the flipside is it throws an error when this isn’t set. I may be missing a configuration setting, but until then, this was simpler.
@@ -20,7 +23,7 @@ jobs: | |||
node-version: 22 | |||
- uses: pnpm/action-setup@v4 | |||
with: | |||
version: latest | |||
version: 9.14.4 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: Turborepo does require version-locking the package manager, which is the only annoyance I have with it. So this can be bumped any time! But sadly we can’t be as loosey-goosey with it as before.
"globalEnv": ["GITHUB_TOKEN"], | ||
"tasks": { | ||
"build": { | ||
"dependsOn": ["^build"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Recommended to read the Turborepo docs, but the ^
character means “it has no dependencies.” Why they did this, and not an empty array, I do not know. But that’s the way it is.
"dependsOn": ["build"] | ||
}, | ||
"test": { | ||
"dependsOn": ["build"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is something cool—here’s where we depend on another task, so it will get fancy here and only run the minimal build commands needed. So now, you don’t need to remember to run pnpm run build && pnpm test
; you can just let Turborepo handle it for you.
Changes
Fixes #2016 by adding Turborepo. This is merely a helper to reduce complexity in the monorepo, e.g. remembering to run
pnpm run build
in the right packages before runningpnpm test
. I like adopting build tooling minimally in that it can be “opted out” from the people that don’t want to deal with it, and that’s why it’s only in the workspace root (for now).Ideally no one notices it’s there, because it just automatically sets up and installs with
pnpm i
with no changes. It just reduces footguns especially as one optimizes it.How to Review
Checklist
docs/
updated (if necessary)pnpm run update:examples
run (only applicable for openapi-typescript)