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

build: improve tsup config for turbo #3293

Merged
merged 1 commit into from
Oct 16, 2024
Merged

build: improve tsup config for turbo #3293

merged 1 commit into from
Oct 16, 2024

Conversation

holic
Copy link
Member

@holic holic commented Oct 16, 2024

This fixes the weirdness around running build/dev with explorer.

We have turbo configured to run build task for each dep as a prerequisite of dev task. Before this change, tsup was configured to only run DTS in a special dev mode using TSUP_SKIP_DTS (because DTS generation is slow). This meant that explorer couldn't find the DTS files it expects when building and the build would fail.

Instead, we now always build DTS when running a regular tsup build (not watch mode). When tsup is in watch mode, it skips DTS and also skips cleaning, to avoid deleting previously generated DTS files. We need this configured this way otherwise a fast task like building common package would run build + dev, where dev would clean DTS files, then explorer wouldn't be able to find them when it goes to build itself.

Copy link

changeset-bot bot commented Oct 16, 2024

⚠️ No Changeset found

Latest commit: 6d96b13

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

@@ -12,7 +13,7 @@
"build": "turbo run build --concurrency=100%",
"changelog:generate": "tsx scripts/changelog.ts",
"clean": "turbo run clean --concurrency=100%",
"dev": "TSUP_SKIP_DTS=true turbo run dev --concurrency=100% --filter !@latticexyz/explorer",
"dev": "turbo run dev --concurrency=999",
Copy link
Member Author

Choose a reason for hiding this comment

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

dev task uses persistent: true to mark it as a long running task (which helps warn when other tasks depend on a thing that will never complete)

thus, we need to manually specify concurrency > number of persistent tasks

@holic holic merged commit 8b2fda7 into main Oct 16, 2024
13 checks passed
@holic holic deleted the holic/tsup-watch branch October 16, 2024 11:25
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.

1 participant