@contractspec/example.crm-pipeline 1.48.0 → 1.48.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,10 +15,10 @@ $ tsdown
15
15
  ℹ dist/index.js  4.75 kB │ gzip: 1.15 kB
16
16
  ℹ dist/handlers/mock-data.js  4.50 kB │ gzip: 1.09 kB
17
17
  ℹ dist/ui/renderers/pipeline.markdown.js  4.48 kB │ gzip: 1.34 kB
18
+ ℹ dist/docs/crm-pipeline.docblock.js  4.36 kB │ gzip: 1.75 kB
18
19
  ℹ dist/ui/CrmPipelineBoard.js  3.88 kB │ gzip: 1.39 kB
19
20
  ℹ dist/events/deal.event.js  3.77 kB │ gzip: 0.67 kB
20
21
  ℹ dist/handlers/deal.handlers.js  3.73 kB │ gzip: 1.06 kB
21
- ℹ dist/docs/crm-pipeline.docblock.js  3.60 kB │ gzip: 1.44 kB
22
22
  ℹ dist/entities/deal.entity.js  3.56 kB │ gzip: 1.05 kB
23
23
  ℹ dist/ui/hooks/useDealMutations.js  3.49 kB │ gzip: 0.80 kB
24
24
  ℹ dist/entities/task.entity.js  3.41 kB │ gzip: 0.98 kB
@@ -44,7 +44,6 @@ $ tsdown
44
44
  ℹ dist/deal/deal.enum.js  0.44 kB │ gzip: 0.24 kB
45
45
  ℹ dist/presentations/index.js  0.40 kB │ gzip: 0.15 kB
46
46
  ℹ dist/events/index.js  0.32 kB │ gzip: 0.14 kB
47
- src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning: Could not resolve '@contractspec/example.crm-pipeline/handlers' in src/ui/renderers/pipeline.markdown.ts
48
47
  ℹ dist/ui/renderers/index.js  0.26 kB │ gzip: 0.12 kB
49
48
  ℹ dist/ui/hooks/index.js  0.16 kB │ gzip: 0.10 kB
50
49
  ℹ dist/ui/modals/index.js  0.16 kB │ gzip: 0.09 kB
@@ -53,32 +52,23 @@ src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning:[
53
52
  ℹ dist/shared/overlay-types.js  0.00 kB │ gzip: 0.02 kB
54
53
  ℹ dist/ui/modals/DealActionsModal.js.map 17.99 kB │ gzip: 4.12 kB
55
54
  ℹ dist/handlers/crm.handlers.js.map 13.46 kB │ gzip: 3.36 kB
56
- ╭─[ src/ui/renderers/pipeline.markdown.ts:10:8 ]
57
- │
58
55
  ℹ dist/ui/CrmDashboard.js.map 13.33 kB │ gzip: 3.99 kB
59
56
  ℹ dist/ui/modals/CreateDealModal.js.map  9.71 kB │ gzip: 3.02 kB
60
57
  ℹ dist/deal/deal.operation.js.map  9.58 kB │ gzip: 2.06 kB
61
- 10 │ } from '@contractspec/example.crm-pipeline/handlers';
62
58
  ℹ dist/deal/deal.schema.js.map  8.70 kB │ gzip: 1.25 kB
63
-  │ ──────────────────────┬──────────────────────
64
59
  ℹ dist/ui/renderers/pipeline.markdown.js.map  8.68 kB │ gzip: 2.47 kB
65
60
  ℹ dist/handlers/deal.handlers.js.map  7.82 kB │ gzip: 2.05 kB
66
61
  ℹ dist/handlers/mock-data.js.map  7.43 kB │ gzip: 1.54 kB
67
-  │ ╰──────────────────────── Module not found, treating it as an external dependency
68
-  │
69
62
  ℹ dist/ui/CrmPipelineBoard.js.map  6.91 kB │ gzip: 2.34 kB
70
-  │ Help: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
71
63
  ℹ dist/ui/hooks/useDealMutations.js.map  6.85 kB │ gzip: 1.65 kB
72
64
  ℹ dist/entities/deal.entity.js.map  6.68 kB │ gzip: 1.76 kB
73
65
  ℹ dist/entities/task.entity.js.map  6.10 kB │ gzip: 1.56 kB
74
66
  ℹ dist/events/deal.event.js.map  5.88 kB │ gzip: 1.02 kB
67
+ ℹ dist/docs/crm-pipeline.docblock.js.map  5.26 kB │ gzip: 1.97 kB
75
68
  ℹ dist/ui/hooks/useDealList.js.map  4.93 kB │ gzip: 1.83 kB
76
69
  ℹ dist/presentations/pipeline.presentation.js.map  4.69 kB │ gzip: 1.22 kB
77
- ℹ dist/docs/crm-pipeline.docblock.js.map  4.46 kB │ gzip: 1.65 kB
78
70
  ℹ dist/crm-pipeline.feature.js.map  4.43 kB │ gzip: 1.20 kB
79
- ────╯
80
71
  ℹ dist/entities/contact.entity.js.map  4.32 kB │ gzip: 1.37 kB
81
-
82
72
  ℹ dist/entities/company.entity.js.map  3.58 kB │ gzip: 1.17 kB
83
73
  ℹ dist/ui/CrmDealCard.js.map  3.37 kB │ gzip: 1.49 kB
84
74
  ℹ dist/presentations/dashboard.presentation.js.map  2.40 kB │ gzip: 0.86 kB
@@ -168,5 +158,15 @@ src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning:[
168
158
  ℹ dist/ui/overlays/index.d.ts  0.14 kB │ gzip: 0.09 kB
169
159
  ℹ dist/docs/crm-pipeline.docblock.d.ts  0.01 kB │ gzip: 0.03 kB
170
160
  ℹ dist/docs/index.d.ts  0.01 kB │ gzip: 0.03 kB
171
- ℹ 152 files, total: 371.73 kB
172
- ✔ Build complete in 31915ms
161
+ ℹ 152 files, total: 373.29 kB
162
+ src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning: Could not resolve '@contractspec/example.crm-pipeline/handlers' in src/ui/renderers/pipeline.markdown.ts
163
+ ╭─[ src/ui/renderers/pipeline.markdown.ts:10:8 ]
164
+ │
165
+ 10 │ } from '@contractspec/example.crm-pipeline/handlers';
166
+  │ ──────────────────────┬──────────────────────
167
+  │ ╰──────────────────────── Module not found, treating it as an external dependency
168
+  │
169
+  │ Help: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
170
+ ────╯
171
+
172
+ ✔ Build complete in 31714ms
@@ -16,10 +16,10 @@ $ tsdown
16
16
  ℹ dist/index.js  4.75 kB │ gzip: 1.15 kB
17
17
  ℹ dist/handlers/mock-data.js  4.50 kB │ gzip: 1.09 kB
18
18
  ℹ dist/ui/renderers/pipeline.markdown.js  4.48 kB │ gzip: 1.34 kB
19
+ ℹ dist/docs/crm-pipeline.docblock.js  4.36 kB │ gzip: 1.75 kB
19
20
  ℹ dist/ui/CrmPipelineBoard.js  3.88 kB │ gzip: 1.39 kB
20
21
  ℹ dist/events/deal.event.js  3.77 kB │ gzip: 0.67 kB
21
22
  ℹ dist/handlers/deal.handlers.js  3.73 kB │ gzip: 1.06 kB
22
- ℹ dist/docs/crm-pipeline.docblock.js  3.60 kB │ gzip: 1.44 kB
23
23
  ℹ dist/entities/deal.entity.js  3.56 kB │ gzip: 1.05 kB
24
24
  ℹ dist/ui/hooks/useDealMutations.js  3.49 kB │ gzip: 0.80 kB
25
25
  ℹ dist/entities/task.entity.js  3.41 kB │ gzip: 0.98 kB
@@ -65,9 +65,9 @@ $ tsdown
65
65
  ℹ dist/entities/deal.entity.js.map  6.68 kB │ gzip: 1.76 kB
66
66
  ℹ dist/entities/task.entity.js.map  6.10 kB │ gzip: 1.56 kB
67
67
  ℹ dist/events/deal.event.js.map  5.88 kB │ gzip: 1.02 kB
68
+ ℹ dist/docs/crm-pipeline.docblock.js.map  5.26 kB │ gzip: 1.97 kB
68
69
  ℹ dist/ui/hooks/useDealList.js.map  4.93 kB │ gzip: 1.83 kB
69
70
  ℹ dist/presentations/pipeline.presentation.js.map  4.69 kB │ gzip: 1.22 kB
70
- ℹ dist/docs/crm-pipeline.docblock.js.map  4.46 kB │ gzip: 1.65 kB
71
71
  ℹ dist/crm-pipeline.feature.js.map  4.43 kB │ gzip: 1.20 kB
72
72
  ℹ dist/entities/contact.entity.js.map  4.32 kB │ gzip: 1.37 kB
73
73
  ℹ dist/entities/company.entity.js.map  3.58 kB │ gzip: 1.17 kB
@@ -97,7 +97,7 @@ $ tsdown
97
97
  ℹ dist/entities/task.entity.d.ts.map  0.43 kB │ gzip: 0.26 kB
98
98
  ℹ dist/handlers/mock-data.d.ts.map  0.42 kB │ gzip: 0.26 kB
99
99
  ℹ dist/ui/hooks/useDealList.d.ts.map  0.34 kB │ gzip: 0.22 kB
100
- ℹ dist/presentations/pipeline.presentation.d.ts.map  0.31 kB │ gzip: 0.19 kB
100
+ ℹ dist/presentations/pipeline.presentation.d.ts.map  0.31 kB │ gzip: 0.20 kB
101
101
  ℹ dist/ui/CrmDealCard.d.ts.map  0.31 kB │ gzip: 0.21 kB
102
102
  ℹ dist/entities/contact.entity.d.ts.map  0.27 kB │ gzip: 0.19 kB
103
103
  ℹ dist/entities/company.entity.d.ts.map  0.26 kB │ gzip: 0.19 kB
@@ -115,11 +115,11 @@ $ tsdown
115
115
  ℹ dist/seeders/index.d.ts.map  0.16 kB │ gzip: 0.14 kB
116
116
  ℹ dist/entities/index.d.ts.map  0.15 kB │ gzip: 0.13 kB
117
117
  ℹ dist/example.d.ts.map  0.14 kB │ gzip: 0.13 kB
118
- ℹ dist/deal/deal.operation.d.ts 14.27 kB │ gzip: 0.97 kB
119
- ℹ dist/deal/deal.schema.d.ts  8.12 kB │ gzip: 0.84 kB
118
+ ℹ dist/deal/deal.operation.d.ts 14.01 kB │ gzip: 0.97 kB
119
+ ℹ dist/deal/deal.schema.d.ts  8.27 kB │ gzip: 0.84 kB
120
120
  ℹ dist/index.d.ts  4.79 kB │ gzip: 1.16 kB
121
- ℹ dist/entities/deal.entity.d.ts  3.54 kB │ gzip: 0.55 kB
122
- ℹ dist/events/deal.event.d.ts  3.28 kB │ gzip: 0.43 kB
121
+ ℹ dist/entities/deal.entity.d.ts  3.54 kB │ gzip: 0.56 kB
122
+ ℹ dist/events/deal.event.d.ts  3.31 kB │ gzip: 0.43 kB
123
123
  ℹ dist/entities/task.entity.d.ts  2.99 kB │ gzip: 0.51 kB
124
124
  ℹ dist/handlers/deal.handlers.d.ts  2.40 kB │ gzip: 0.69 kB
125
125
  ℹ dist/handlers/crm.handlers.d.ts  2.18 kB │ gzip: 0.69 kB
@@ -131,7 +131,7 @@ $ tsdown
131
131
  ℹ dist/shared/overlay-types.d.ts  1.00 kB │ gzip: 0.40 kB
132
132
  ℹ dist/ui/hooks/useDealList.d.ts  0.98 kB │ gzip: 0.47 kB
133
133
  ℹ dist/ui/hooks/useDealMutations.d.ts  0.96 kB │ gzip: 0.38 kB
134
- ℹ dist/events/contact.event.d.ts  0.93 kB │ gzip: 0.31 kB
134
+ ℹ dist/events/contact.event.d.ts  0.94 kB │ gzip: 0.31 kB
135
135
  ℹ dist/events/task.event.d.ts  0.93 kB │ gzip: 0.30 kB
136
136
  ℹ dist/handlers/index.d.ts  0.91 kB │ gzip: 0.28 kB
137
137
  ℹ dist/entities/index.d.ts  0.85 kB │ gzip: 0.32 kB
@@ -159,7 +159,7 @@ $ tsdown
159
159
  ℹ dist/ui/overlays/index.d.ts  0.14 kB │ gzip: 0.09 kB
160
160
  ℹ dist/docs/crm-pipeline.docblock.d.ts  0.01 kB │ gzip: 0.03 kB
161
161
  ℹ dist/docs/index.d.ts  0.01 kB │ gzip: 0.03 kB
162
- ℹ 152 files, total: 371.70 kB
162
+ ℹ 152 files, total: 373.19 kB
163
163
  src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning: Could not resolve '@contractspec/example.crm-pipeline/handlers' in src/ui/renderers/pipeline.markdown.ts
164
164
  â•­─[ src/ui/renderers/pipeline.markdown.ts:10:8 ]
165
165
  │
@@ -170,4 +170,4 @@ src/ui/renderers/pipeline.markdown.ts (10:7) [UNRESOLVED_IMPORT] Warning:[
170
170
   │ Help: The "main" field here was ignored. Main fields must be configured explicitly when using the "neutral" platform.
171
171
  ────╯
172
172
 
173
- ✔ Build complete in 35255ms
173
+ ✔ Build complete in 31791ms
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @contractspec/example.crm-pipeline
2
2
 
3
+ ## 1.48.1
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [c560ee7]
8
+ - Updated dependencies [1536bf3]
9
+ - @contractspec/lib.design-system@1.48.1
10
+ - @contractspec/lib.contracts@1.48.1
11
+ - @contractspec/lib.example-shared-ui@1.2.1
12
+ - @contractspec/lib.identity-rbac@1.48.1
13
+ - @contractspec/module.audit-trail@1.48.1
14
+ - @contractspec/module.notifications@1.48.1
15
+
3
16
  ## 1.48.0
4
17
 
5
18
  ### Minor Changes
package/README.md CHANGED
@@ -2,7 +2,6 @@
2
2
 
3
3
  Website: https://contractspec.io/
4
4
 
5
-
6
5
  A complete CRM (Customer Relationship Management) application demonstrating ContractSpec principles.
7
6
 
8
7
  ## What's Included
@@ -116,14 +115,14 @@ const StageEntity = defineEntity({
116
115
 
117
116
  ## Events
118
117
 
119
- | Event | Description |
120
- |-------|-------------|
121
- | contact.created | New contact added |
122
- | deal.created | New deal created |
123
- | deal.moved | Deal moved to new stage |
124
- | deal.won | Deal marked as won |
125
- | deal.lost | Deal marked as lost |
126
- | task.completed | Task marked complete |
118
+ | Event | Description |
119
+ | --------------- | ----------------------- |
120
+ | contact.created | New contact added |
121
+ | deal.created | New deal created |
122
+ | deal.moved | Deal moved to new stage |
123
+ | deal.won | Deal marked as won |
124
+ | deal.lost | Deal marked as lost |
125
+ | task.completed | Task marked complete |
127
126
 
128
127
  ## Usage
129
128
 
@@ -137,3 +136,24 @@ This example is registered as `crm-pipeline` in the ContractSpec Studio.
137
136
  npx degit lssm/contractspec/packages/examples/crm-pipeline my-crm-app
138
137
  ```
139
138
 
139
+ ## Adoption narrative
140
+
141
+ ### Before
142
+
143
+ - A CRM app with hand-written data models and handler logic.
144
+ - Pipeline stage rules live in code and drift across UI/API/events.
145
+ - Regeneration is risky because specs and implementations are not aligned.
146
+
147
+ ### After
148
+
149
+ - Contracts define deals, stages, and tasks as the source of truth.
150
+ - Regeneration keeps UI/API/events in sync when stages change.
151
+ - Compliance surfaces (audits, notifications) stay consistent with specs.
152
+
153
+ ### Minimal adoption steps
154
+
155
+ 1. Add ContractSpec CLI and core libraries.
156
+ 2. Define one operation (for example, `deal/create`).
157
+ 3. Run `contractspec build` to generate handlers and types.
158
+ 4. Wire the generated handler into your existing router.
159
+ 5. Expand to events and presentations as you add surface areas.
@@ -42,7 +42,27 @@ registerDocBlocks([
42
42
  ## Guardrails
43
43
  - Emit events for stage moves and task completions; log to Audit Trail.
44
44
  - Keep required fields enforced in contracts; avoid freeform state.
45
- - Redact contact PII in markdown/JSON outputs.`
45
+ - Redact contact PII in markdown/JSON outputs.
46
+
47
+ ## Adoption narrative
48
+
49
+ ### Before
50
+ - A CRM app with hand-written data models and handler logic.
51
+ - Pipeline stage rules live in code and drift across UI/API/events.
52
+ - Regeneration is risky because specs and implementations are not aligned.
53
+
54
+ ### After
55
+ - Contracts define deals, stages, and tasks as the source of truth.
56
+ - Regeneration keeps UI/API/events in sync when stages change.
57
+ - Compliance surfaces (audits, notifications) stay consistent with specs.
58
+
59
+ ### Minimal adoption steps
60
+ 1) Add ContractSpec CLI and core libraries.
61
+ 2) Define one operation (for example, deal/create).
62
+ 3) Run contractspec build to generate handlers and types.
63
+ 4) Wire the generated handler into your existing router.
64
+ 5) Expand to events and presentations as you add surface areas.
65
+ `
46
66
  },
47
67
  {
48
68
  id: "docs.examples.crm-pipeline.reference",
@@ -1 +1 @@
1
- {"version":3,"file":"crm-pipeline.docblock.js","names":[],"sources":["../../src/docs/crm-pipeline.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst crmPipelineDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.crm-pipeline.goal',\n title: 'CRM Pipeline — Goal',\n summary:\n 'Deals, stages, contacts, companies, and tasks with auditable stage movement.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/goal',\n tags: ['crm', 'goal'],\n body: `## Why it matters\n- Regenerable CRM flow for deals/stages without code drift.\n- Ensures stage movement, tasks, and contacts stay aligned across surfaces.\n\n## Business/Product goal\n- Give sales teams a governed pipeline with auditable moves and notifications.\n- Allow experimentation (feature flags) on stage definitions and task flows.\n\n## Success criteria\n- Stage/state changes emit events and remain declarative in spec.\n- PII (contacts) is scoped/redacted in presentations.`,\n },\n {\n id: 'docs.examples.crm-pipeline.usage',\n title: 'CRM Pipeline — Usage',\n summary: 'How to seed, extend, and regenerate the CRM pipeline.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/usage',\n tags: ['crm', 'usage'],\n body: `## Setup\n1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.\n2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.\n\n## Extend & regenerate\n1) Adjust stage schema/order, deal fields, task fields in the spec.\n2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.\n3) Use Feature Flags to trial new stages or SLA rules.\n\n## Guardrails\n- Emit events for stage moves and task completions; log to Audit Trail.\n- Keep required fields enforced in contracts; avoid freeform state.\n- Redact contact PII in markdown/JSON outputs.`,\n },\n {\n id: 'docs.examples.crm-pipeline.reference',\n title: 'CRM Pipeline — Reference',\n summary:\n 'Entities, contracts, events, and presentations for the CRM template.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline',\n tags: ['crm', 'reference'],\n body: `## Entities\n- Contact, Company, Deal, Pipeline, Stage, Task.\n\n## Contracts\n- deal/create, stage/move, contact/company CRUD, task create/complete.\n\n## Events\n- deal.created, stage.moved, task.completed, contact.updated.\n\n## Presentations\n- Pipelines/kanban, deal detail, contact/company profiles, task lists.\n\n## Notes\n- Stage definitions should be declarative; enforce via spec and regeneration.\n- Use Notifications for deal/task updates; Audit Trail for state changes.`,\n },\n {\n id: 'docs.examples.crm-pipeline.constraints',\n title: 'CRM Pipeline — Constraints & Safety',\n summary:\n 'Internal guardrails for stages, PII, and regeneration semantics in the CRM template.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/crm-pipeline/constraints',\n tags: ['crm', 'constraints', 'internal'],\n body: `## Constraints\n- Stage definitions/order must remain declarative; no imperative overrides in code.\n- Events to emit: deal.created, stage.moved, task.completed, contact.updated (minimum).\n- Regeneration should not alter stage semantics without explicit spec change.\n\n## PII\n- Mark contact/company PII (emails, phones) for redaction in presentations.\n- Ensure MCP/web outputs avoid raw PII when not needed.\n\n## Verification\n- Add fixtures for stage move rules and SLA/task changes.\n- Ensure Audit/Notifications remain wired for stage and task events.\n- Use Feature Flags for experimental stages/SLAs; default safe/off.`,\n },\n];\n\nregisterDocBlocks(crmPipelineDocBlocks);\n"],"mappings":";;;AAiGA,kBA9FyC;CACvC;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,OAAO;EACrB,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,QAAQ;EACtB,MAAM;;;;;;;;;;;;;EAaP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,YAAY;EAC1B,MAAM;;;;;;;;;;;;;;;EAeP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAO;GAAe;GAAW;EACxC,MAAM;;;;;;;;;;;;;EAaP;CACF,CAEsC"}
1
+ {"version":3,"file":"crm-pipeline.docblock.js","names":[],"sources":["../../src/docs/crm-pipeline.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst crmPipelineDocBlocks: DocBlock[] = [\n {\n id: 'docs.examples.crm-pipeline.goal',\n title: 'CRM Pipeline — Goal',\n summary:\n 'Deals, stages, contacts, companies, and tasks with auditable stage movement.',\n kind: 'goal',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/goal',\n tags: ['crm', 'goal'],\n body: `## Why it matters\n- Regenerable CRM flow for deals/stages without code drift.\n- Ensures stage movement, tasks, and contacts stay aligned across surfaces.\n\n## Business/Product goal\n- Give sales teams a governed pipeline with auditable moves and notifications.\n- Allow experimentation (feature flags) on stage definitions and task flows.\n\n## Success criteria\n- Stage/state changes emit events and remain declarative in spec.\n- PII (contacts) is scoped/redacted in presentations.`,\n },\n {\n id: 'docs.examples.crm-pipeline.usage',\n title: 'CRM Pipeline — Usage',\n summary: 'How to seed, extend, and regenerate the CRM pipeline.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline/usage',\n tags: ['crm', 'usage'],\n body: `## Setup\n1) Seed (if available) or create pipeline stages, deals, contacts, companies, tasks.\n2) Configure Notifications for stage changes/tasks; set policy.pii for contact data.\n\n## Extend & regenerate\n1) Adjust stage schema/order, deal fields, task fields in the spec.\n2) Regenerate to sync UI/API/events; ensure kanban/action buttons update.\n3) Use Feature Flags to trial new stages or SLA rules.\n\n## Guardrails\n- Emit events for stage moves and task completions; log to Audit Trail.\n- Keep required fields enforced in contracts; avoid freeform state.\n- Redact contact PII in markdown/JSON outputs.\n\n## Adoption narrative\n\n### Before\n- A CRM app with hand-written data models and handler logic.\n- Pipeline stage rules live in code and drift across UI/API/events.\n- Regeneration is risky because specs and implementations are not aligned.\n\n### After\n- Contracts define deals, stages, and tasks as the source of truth.\n- Regeneration keeps UI/API/events in sync when stages change.\n- Compliance surfaces (audits, notifications) stay consistent with specs.\n\n### Minimal adoption steps\n1) Add ContractSpec CLI and core libraries.\n2) Define one operation (for example, deal/create).\n3) Run contractspec build to generate handlers and types.\n4) Wire the generated handler into your existing router.\n5) Expand to events and presentations as you add surface areas.\n`,\n },\n {\n id: 'docs.examples.crm-pipeline.reference',\n title: 'CRM Pipeline — Reference',\n summary:\n 'Entities, contracts, events, and presentations for the CRM template.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/crm-pipeline',\n tags: ['crm', 'reference'],\n body: `## Entities\n- Contact, Company, Deal, Pipeline, Stage, Task.\n\n## Contracts\n- deal/create, stage/move, contact/company CRUD, task create/complete.\n\n## Events\n- deal.created, stage.moved, task.completed, contact.updated.\n\n## Presentations\n- Pipelines/kanban, deal detail, contact/company profiles, task lists.\n\n## Notes\n- Stage definitions should be declarative; enforce via spec and regeneration.\n- Use Notifications for deal/task updates; Audit Trail for state changes.`,\n },\n {\n id: 'docs.examples.crm-pipeline.constraints',\n title: 'CRM Pipeline — Constraints & Safety',\n summary:\n 'Internal guardrails for stages, PII, and regeneration semantics in the CRM template.',\n kind: 'reference',\n visibility: 'internal',\n route: '/docs/examples/crm-pipeline/constraints',\n tags: ['crm', 'constraints', 'internal'],\n body: `## Constraints\n- Stage definitions/order must remain declarative; no imperative overrides in code.\n- Events to emit: deal.created, stage.moved, task.completed, contact.updated (minimum).\n- Regeneration should not alter stage semantics without explicit spec change.\n\n## PII\n- Mark contact/company PII (emails, phones) for redaction in presentations.\n- Ensure MCP/web outputs avoid raw PII when not needed.\n\n## Verification\n- Add fixtures for stage move rules and SLA/task changes.\n- Ensure Audit/Notifications remain wired for stage and task events.\n- Use Feature Flags for experimental stages/SLAs; default safe/off.`,\n },\n];\n\nregisterDocBlocks(crmPipelineDocBlocks);\n"],"mappings":";;;AAqHA,kBAlHyC;CACvC;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,OAAO;EACrB,MAAM;;;;;;;;;;;EAWP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SAAS;EACT,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,QAAQ;EACtB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAiCP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM,CAAC,OAAO,YAAY;EAC1B,MAAM;;;;;;;;;;;;;;;EAeP;CACD;EACE,IAAI;EACJ,OAAO;EACP,SACE;EACF,MAAM;EACN,YAAY;EACZ,OAAO;EACP,MAAM;GAAC;GAAO;GAAe;GAAW;EACxC,MAAM;;;;;;;;;;;;;EAaP;CACF,CAEsC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/example.crm-pipeline",
3
- "version": "1.48.0",
3
+ "version": "1.48.1",
4
4
  "description": "CRM Pipeline - Contacts, Companies, Deals, Tasks",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -62,18 +62,19 @@
62
62
  "lint": "bun lint:fix",
63
63
  "lint:fix": "eslint src --fix",
64
64
  "lint:check": "eslint src",
65
- "test": "bun test"
65
+ "test": "bun test",
66
+ "validate": "contractspec validate"
66
67
  },
67
68
  "dependencies": {
68
- "@contractspec/lib.contracts": "1.48.0",
69
- "@contractspec/lib.design-system": "1.48.0",
70
- "@contractspec/lib.example-shared-ui": "1.2.0",
71
- "@contractspec/lib.identity-rbac": "1.48.0",
69
+ "@contractspec/lib.contracts": "1.48.1",
70
+ "@contractspec/lib.design-system": "1.48.1",
71
+ "@contractspec/lib.example-shared-ui": "1.2.1",
72
+ "@contractspec/lib.identity-rbac": "1.48.1",
72
73
  "@contractspec/lib.runtime-sandbox": "0.3.0",
73
74
  "@contractspec/lib.schema": "1.48.0",
74
75
  "@contractspec/lib.ui-kit-web": "1.48.0",
75
- "@contractspec/module.audit-trail": "1.48.0",
76
- "@contractspec/module.notifications": "1.48.0",
76
+ "@contractspec/module.audit-trail": "1.48.1",
77
+ "@contractspec/module.notifications": "1.48.1",
77
78
  "react": "19.2.3",
78
79
  "react-dom": "19.2.3"
79
80
  },
@@ -43,7 +43,27 @@ const crmPipelineDocBlocks: DocBlock[] = [
43
43
  ## Guardrails
44
44
  - Emit events for stage moves and task completions; log to Audit Trail.
45
45
  - Keep required fields enforced in contracts; avoid freeform state.
46
- - Redact contact PII in markdown/JSON outputs.`,
46
+ - Redact contact PII in markdown/JSON outputs.
47
+
48
+ ## Adoption narrative
49
+
50
+ ### Before
51
+ - A CRM app with hand-written data models and handler logic.
52
+ - Pipeline stage rules live in code and drift across UI/API/events.
53
+ - Regeneration is risky because specs and implementations are not aligned.
54
+
55
+ ### After
56
+ - Contracts define deals, stages, and tasks as the source of truth.
57
+ - Regeneration keeps UI/API/events in sync when stages change.
58
+ - Compliance surfaces (audits, notifications) stay consistent with specs.
59
+
60
+ ### Minimal adoption steps
61
+ 1) Add ContractSpec CLI and core libraries.
62
+ 2) Define one operation (for example, deal/create).
63
+ 3) Run contractspec build to generate handlers and types.
64
+ 4) Wire the generated handler into your existing router.
65
+ 5) Expand to events and presentations as you add surface areas.
66
+ `,
47
67
  },
48
68
  {
49
69
  id: 'docs.examples.crm-pipeline.reference',