feat(marketing-pages): subscribe to auth.user.signed-up

Generated handler + Payload event-task via gen event consume,
threaded through symbols / both binders / cms re-export at the
configured anchors. bus.subscribe wires the in-memory delivery in
dev-seed; the __events.auth.user.signed-up.marketing-pages Payload
task closes the production-bus loop.

Also fixes two generator-level issues found during Phase 8:
- Drop publisher prompt's `when` clause so --args can supply the
  4th positional argument (Plop limitation: --args cannot bypass
  conditional prompts). Validate runs only in consume mode.
- Switch event-task.ts.hbs from TaskConfig<"slug-string"> to
  TaskConfig<{ input: ...; output: object }> since runtime-generated
  event slugs are not keys of TypedJobs['tasks'].
This commit is contained in:
2026-05-08 16:33:14 +02:00
parent c1b8a7e434
commit 6b57a34c0c
11 changed files with 114 additions and 7 deletions

View File

@@ -0,0 +1,15 @@
// packages/marketing-pages/src/events/handlers/on-auth-user-signed-up.handler.test.ts
import { describe, it, expect } from "vitest";
import { onAuthUserSignedUpHandler } from "@/events/handlers/on-auth-user-signed-up.handler";
describe("onAuthUserSignedUpHandler", () => {
it("returns a function (factory shape)", () => {
const handler = onAuthUserSignedUpHandler();
expect(typeof handler).toBe("function");
});
it("does not throw on a valid stub event", async () => {
const handler = onAuthUserSignedUpHandler();
await expect(handler({} as never)).resolves.toBeUndefined();
});
});

View File

@@ -0,0 +1,14 @@
// packages/marketing-pages/src/events/handlers/on-auth-user-signed-up.handler.ts
import type { UserSignedUpEvent } from "@repo/auth";
export type IOnAuthUserSignedUpHandler = ReturnType<
typeof onAuthUserSignedUpHandler
>;
export const onAuthUserSignedUpHandler =
() =>
async (_event: UserSignedUpEvent): Promise<void> => {
// TODO: implement the reaction. Inject dependencies via the factory's
// constructor and use them here. The handler runs inside the consumer's
// span+capture sandwich, so just throwing on failure is the right shape.
};