Instruction file imported from EdgeDesk-MB/EdgeDesk (
.cursor/rules/alert-module-boundaries.mdc). Copyright stays with the author.
Alert module boundaries
/api/state imports daily-tasks-digest → free-bet-lots. If that lots module
imports @/lib/services/quiet-alerts, Turbopack compiles quiet-alerts into the
state route. A missing or not-yet-bound named export then fails the entire
app with Export X doesn't exist in target module.
Do
- Put dedupe key helpers in
edgeways/src/lib/alerts/expiring-alert-keys.ts(leaf: no db, noserver-only, norules.ts). - Import those keys from
quiet-alerts.ts. Do not import@/lib/alerts/rulesfromquiet-alerts.ts. - Call
quietOfferAlerts/quietFreeBetAlertsfrom the mutation API (api/accounts/free-bets,api/offers/[id]) or fromoffers.tsstatus transitions. Add a test import of any newquiet*export inquiet-alerts.test.tsin the same change.
Do not
- Import
@/lib/services/quiet-alertsfromfree-bet-lots.ts, othersrc/lib/accounts/*modules,daily-tasks-digest.ts, orstate.ts. - Add a
quiet*function in an importer before it exists onquiet-alerts.ts.