fix(api): stop Trigger.dev deploy failing on @trycompai/auth/participation#3393
Merged
Merged
Conversation
…ation The API's Trigger.dev deploy bundles task notifiers with esbuild, which failed with "Could not resolve @trycompai/auth/participation". The auth package's dist is not built in the trigger deploy workflow (it builds db/email/integration- platform only), and the API's org-participation code — reachable from the task notifiers — imported that subpath, so esbuild had nothing to resolve. Mirror the app's approach for Trigger.dev-bundled code: use a dependency-free local copy of the tiny participation predicate (`org-participation-rule.ts`) instead of importing `@trycompai/auth`. This keeps the trigger bundle free of the auth package (which also pulls better-auth, unbundleable). A drift-guard spec asserts the mirror stays identical to `@trycompai/auth/participation`, and a jest moduleNameMapper resolves that subpath to source so the guard runs without needing the auth dist built. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XzEVwhhoFghng6SDMGecMq
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
claudfuen
pushed a commit
that referenced
this pull request
Jul 10, 2026
# [3.101.0](v3.100.1...v3.101.0) (2026-07-10) ### Bug Fixes * **api:** reject assignees that aren't members of the organization ([dd071b6](dd071b6)) * **api:** stop Trigger.dev deploy failing on @trycompai/auth/participation ([#3393](#3393)) ([1ba1d20](1ba1d20)) * **org:** address 2nd review pass — harden vendor assignee, unify UI rule, guard boundaries ([ef1a53f](ef1a53f)) * **org:** address review — align browser-automation, tighten null validation, keep dep boundary ([415ee40](415ee40)) * **org:** address review — spread-safe participant filter, confirm internal toggle ([26cecbe](26cecbe)) * **org:** unify participation where-fragment, guard deactivated author, skip needless query ([77df89c](77df89c)) ### Features * **isms:** add Roles, Responsibilities & Authorities document (CS-698) ([#3391](#3391)) ([c013515](c013515)) * **org:** treat platform admins as members in internal organizations ([e179c58](e179c58))
Contributor
|
🎉 This PR is included in version 3.101.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes the broken Deploy API to Trigger.dev job on
main(introduced by #3378):Why
The API's Trigger.dev deploy bundles the task notifiers with esbuild. The trigger deploy workflow builds
db/email/integration-platformbut not@trycompai/auth, so itsdist/doesn't exist. #3378 added@trycompai/auth/participationimports intoorg-participation.tsandtask-item-assignment-notifier.ts— both reachable from the bundled task notifiers — so esbuild had nothing to resolve. (The auth index is never reached in the bundle, which is why only the subpath failed.)How
Mirror the pattern the app already uses for Trigger.dev-bundled code (
apps/app/src/lib/org-participation-rule.ts): a dependency-free local copy of the tiny participation predicate, so the trigger bundle never imports@trycompai/auth(which also pulls in better-auth, unbundleable).apps/api/src/utils/org-participation-rule.ts— pure, zero imports.org-participation.ts+task-item-assignment-notifier.tsimport the local mirror instead of the subpath.@trycompai/auth/participationacross every role × internal-flag combination.moduleNameMapperresolves@trycompai/auth/participation→ source, so the guard runs without needing the auth dist built.This restores the trigger bundle to its known-good pre-#3378 state (no
@trycompai/authin the bundle).Verify
@trycompai/auth/participationanymore (only the spec, which isn't bundled).org-participation+task-item-assignment-notifierspecs pass (15 tests, incl. the drift guard).🤖 Generated with Claude Code
Summary by cubic
Fixes the API
Trigger.devdeploy by removing the broken@trycompai/auth/participationimport from bundled code. Uses a local, dependency‑free participation rule and adds a drift guard to keep it in sync.apps/api/src/utils/org-participation-rule.ts(pure, no imports).org-participation.tsand the task notifier to import the local rule.org-participation-rule.spec.tsto compare outputs with@trycompai/auth/participation.@trycompai/auth/participationto source in Jest so the guard runs without the authdist/.Written for commit 02f24fc. Summary will update on new commits.