Skip to content

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

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Add Turborepo #2027

merged 2 commits into from
Dec 2, 2024

Conversation

drwpow
Copy link
Contributor

@drwpow drwpow commented Dec 2, 2024

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 running pnpm 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

  • CI should pass

Checklist

  • Unit tests updated
  • docs/ updated (if necessary)
  • pnpm run update:examples run (only applicable for openapi-typescript)

Copy link

changeset-bot bot commented Dec 2, 2024

⚠️ No Changeset found

Latest commit: 9cee0b7

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

cloudflare-workers-and-pages bot commented Dec 2, 2024

Deploying openapi-ts with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9cee0b7
Status: ✅  Deploy successful!
Preview URL: https://f7cff6b2.openapi-ts.pages.dev
Branch Preview URL: https://turbo.openapi-ts.pages.dev

View logs

@drwpow drwpow force-pushed the turbo branch 5 times, most recently from 7c532c2 to e5f08f6 Compare December 2, 2024 03:12
@drwpow drwpow marked this pull request as ready for review December 2, 2024 03:12
@drwpow drwpow requested a review from a team as a code owner December 2, 2024 03:12
@drwpow drwpow requested a review from gzm0 December 2, 2024 03:12
Copy link
Contributor

github-actions bot commented Dec 2, 2024

size-limit report 📦

Path Size
packages/openapi-fetch/dist/index.min.js 6.26 KB (0%)

@drwpow drwpow merged commit 75399f8 into main Dec 2, 2024
10 checks passed
@drwpow drwpow deleted the turbo branch December 2, 2024 03:29
@@ -6,6 +6,9 @@ on:
- main
pull_request:

env:
GITHUB_TOKEN: ${{ secrets.OPENAPI_TS_BOT_GITHUB_TOKEN }}
Copy link
Contributor Author

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
Copy link
Contributor Author

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"]
Copy link
Contributor Author

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"]
Copy link
Contributor Author

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.

@drwpow drwpow mentioned this pull request Dec 2, 2024
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.

(Chore) Add Turborepo
1 participant