2.6 KiB
Migrate @suaveplan/api-plugin-campaigns (chunked: A → B → C)
Why
@suaveplan/api-plugin-campaigns mounts the campaigns / suppression / webhooks
HTTP surface (consumed by @suaveplan/campaigns, @suaveplan/delivery-tracking,
and a per-tenant CampaignSuppressionStore) onto the genesis API host. Two
prior single-agent migration attempts halted at the size of the full port, so
this change ships the package in three sequential, independently-greenable
chunks. Each chunk passes lint/typecheck/test/coverage on its own subset.
What changes
Add the package @suaveplan/api-plugin-campaigns@0.1.0 under
packages/api-stack/api/api-plugin-campaigns/, server-tier, sharing the shape
of the genesis-already-shipped @suaveplan/api-plugin-contacts.
- Chunk A (this change body) — foundation: package shell + vite/vitest/ts
configs, error-code namespace +
CampaignsApiError, OTel instrument bundle, Zod options schema, shared option/config types, plugin scaffold viadefinePluginfrom@suaveplan/api-pluginwith a no-oponInit(B/C wire the real lifecycle), package barrel. - Chunk B (follow-up) — repositories:
SurrealCampaignRepository,CampaignSuppressionStoreinterface +SurrealCampaignSuppressionStore, consumption of@suaveplan/delivery-tracking'sSurrealDeliveryEventStore, schema DDL bundle, repository registration insideonInit. - Chunk C (follow-up) — routes:
/campaignsCRUD + lifecycle endpoints,/suppressionlist/add/remove,/webhooks/:provideringestion, full Hono route wiring with OpenAPI registry, integration tests against the SurrealDB testcontainer.
Impact
- Affected specs: new capability
api-plugin-campaigns. - Affected code: new package only.
- Dependencies pulled:
@suaveplan/api-plugin,@suaveplan/api-openapi,@suaveplan/api-plugin-auth,@suaveplan/api-plugin-database,@suaveplan/api-plugin-contacts,@suaveplan/campaigns,@suaveplan/contacts,@suaveplan/delivery-tracking,@suaveplan/surrealdb,@suaveplan/events,@suaveplan/error,@suaveplan/types,@suaveplan/logger,@opentelemetry/api,hono,@hono/zod-openapi,tslib,zod. - Quality gates per chunk:
bunx turbo lint typecheck test --filtergreen andbunx turbo test:coverage --filter100/100/100/100 on the modules shipped in that chunk.
Why chunked
Two prior single-agent attempts halted at the full-package size. Splitting at the dependency boundaries (foundation ↔ data ↔ routes) keeps each chunk under the limit while leaving every intermediate state green.