managarten/packages/shared-auth/tsconfig.json
Till JS 264c4c3087 feat(broadcast): M2 audience + editor + compose wizard
Core authoring loop works end-to-end: create a draft, filter an audience
from contacts, write content in a rich-text editor, save. Send is still
stubbed (M4 gets mana-mail's bulk endpoint).

Dependencies
- @tiptap/core + starter-kit + image + link + placeholder (3.22.4)
- shared-auth/tsconfig: allowImportingTsExtensions +
  rewriteRelativeImportExtensions so tsc accepts shared-types' explicit
  .ts imports. Was blocking EVERY pnpm install postinstall hook in the
  repo — fixing it here unblocks everyone, not just broadcast.

Module
- queries.ts: useAllCampaigns / useAllTemplates with scoped-db + crypto,
  computeStats (counts + open/click rates per year), formatRate helper
- stores/settings.svelte.ts: singleton with ensure/get/update, same
  pattern as invoices settings
- stores/campaigns.svelte.ts: createCampaign (pulls sender defaults from
  settings), updateCampaign / updateContent / updateAudience (draft-only
  edit guard), schedule / cancel / duplicate / deleteCampaign, plus an
  applyServerStatus hook for M4's orchestrator to write back progress

Audience
- audience/segment-builder.ts: pure matchContact / filterAudience /
  countAudience / describeAudience. AND semantics across filters. Drops
  contacts without a usable email so estimatedCount never inflates.
- audience/AudienceBuilder.svelte: tag-chip UI with live count, dedup
  (same tag twice toggles op instead of stacking), greys out already-
  referenced tags in the picker

Editor
- editor/Editor.svelte: Tiptap wrapper with onMount / onDestroy, toolbar
  (bold/italic/H1/H2/lists/link/image), bind on content (Tiptap JSON +
  derived HTML/plaintext). Image upload reuses invoices' mana-media
  uploader pragmatically; extract to @mana/shared-uload later.

Compose wizard
- views/ComposeView.svelte: 4-step stepper (Audience → Content →
  Preflight → Send). Steps 3+4 stubbed pragmatically. Autosave on step
  change so content survives navigation. Step 3/4 gated on earlier
  readiness so the user can't skip.

Routes
- /broadcasts/new: bootstraps a draft + redirects to edit
- /broadcasts/[id]/edit: guarded on status=='draft'
- ListView: working "+ Neue Kampagne" button, rows open edit

Tests
- 17 unit tests for segment-builder covering tag has/not-has/AND,
  email eq/contains case-insensitivity, no-email filtering, no-mutation,
  describeAudience resolver + fallback

Plan: docs/plans/broadcast-module.md §M2.
Next: M3 HTML-render with email-safe inlining + preview.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-04-20 20:41:09 +02:00

22 lines
546 B
JSON

{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"moduleResolution": "bundler",
"allowImportingTsExtensions": true,
"lib": ["ES2022", "DOM", "DOM.Iterable"],
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,
"declaration": true,
"declarationMap": true,
"outDir": "./dist",
"rootDir": "./src",
"noEmit": false,
"rewriteRelativeImportExtensions": true
},
"include": ["src/**/*"],
"exclude": ["node_modules", "dist"]
}