@contractspec/example.crm-pipeline 3.7.6 → 3.7.10

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.
Files changed (130) hide show
  1. package/.turbo/turbo-build.log +45 -42
  2. package/AGENTS.md +51 -33
  3. package/CHANGELOG.md +36 -0
  4. package/README.md +67 -148
  5. package/dist/browser/docs/crm-pipeline.docblock.js +1 -1
  6. package/dist/browser/docs/index.js +1 -1
  7. package/dist/browser/events/contact.event.js +1 -1
  8. package/dist/browser/events/deal.event.js +1 -1
  9. package/dist/browser/events/index.js +3 -3
  10. package/dist/browser/events/task.event.js +1 -1
  11. package/dist/browser/handlers/crm.handlers.js +13 -2
  12. package/dist/browser/handlers/index.js +13 -2
  13. package/dist/browser/index.js +680 -447
  14. package/dist/browser/ui/CrmDashboard.js +574 -352
  15. package/dist/browser/ui/CrmDealCard.js +5 -5
  16. package/dist/browser/ui/CrmPipelineBoard.js +13 -13
  17. package/dist/browser/ui/hooks/index.js +21 -10
  18. package/dist/browser/ui/hooks/useDealList.js +20 -9
  19. package/dist/browser/ui/hooks/useDealMutations.js +1 -1
  20. package/dist/browser/ui/index.js +683 -450
  21. package/dist/browser/ui/modals/CreateDealModal.js +12 -12
  22. package/dist/browser/ui/modals/DealActionsModal.js +21 -21
  23. package/dist/browser/ui/modals/index.js +33 -33
  24. package/dist/browser/ui/renderers/index.js +140 -118
  25. package/dist/browser/ui/renderers/pipeline.markdown.js +13 -2
  26. package/dist/browser/ui/renderers/pipeline.renderer.js +108 -97
  27. package/dist/browser/ui/tables/DealListTab.js +390 -0
  28. package/dist/deal/index.d.ts +2 -2
  29. package/dist/docs/crm-pipeline.docblock.js +1 -1
  30. package/dist/docs/index.js +1 -1
  31. package/dist/events/contact.event.js +1 -1
  32. package/dist/events/deal.event.js +1 -1
  33. package/dist/events/index.js +3 -3
  34. package/dist/events/task.event.js +1 -1
  35. package/dist/handlers/crm.handlers.d.ts +2 -0
  36. package/dist/handlers/crm.handlers.js +13 -2
  37. package/dist/handlers/index.d.ts +2 -2
  38. package/dist/handlers/index.js +13 -2
  39. package/dist/index.d.ts +3 -3
  40. package/dist/index.js +680 -447
  41. package/dist/node/docs/crm-pipeline.docblock.js +1 -1
  42. package/dist/node/docs/index.js +1 -1
  43. package/dist/node/events/contact.event.js +1 -1
  44. package/dist/node/events/deal.event.js +1 -1
  45. package/dist/node/events/index.js +3 -3
  46. package/dist/node/events/task.event.js +1 -1
  47. package/dist/node/handlers/crm.handlers.js +13 -2
  48. package/dist/node/handlers/index.js +13 -2
  49. package/dist/node/index.js +680 -447
  50. package/dist/node/ui/CrmDashboard.js +574 -352
  51. package/dist/node/ui/CrmDealCard.js +5 -5
  52. package/dist/node/ui/CrmPipelineBoard.js +13 -13
  53. package/dist/node/ui/hooks/index.js +21 -10
  54. package/dist/node/ui/hooks/useDealList.js +20 -9
  55. package/dist/node/ui/hooks/useDealMutations.js +1 -1
  56. package/dist/node/ui/index.js +683 -450
  57. package/dist/node/ui/modals/CreateDealModal.js +12 -12
  58. package/dist/node/ui/modals/DealActionsModal.js +21 -21
  59. package/dist/node/ui/modals/index.js +33 -33
  60. package/dist/node/ui/renderers/index.js +140 -118
  61. package/dist/node/ui/renderers/pipeline.markdown.js +13 -2
  62. package/dist/node/ui/renderers/pipeline.renderer.js +108 -97
  63. package/dist/node/ui/tables/DealListTab.js +390 -0
  64. package/dist/operations/index.d.ts +1 -1
  65. package/dist/ui/CrmDashboard.js +574 -352
  66. package/dist/ui/CrmDealCard.js +5 -5
  67. package/dist/ui/CrmPipelineBoard.js +13 -13
  68. package/dist/ui/hooks/index.d.ts +2 -2
  69. package/dist/ui/hooks/index.js +21 -10
  70. package/dist/ui/hooks/useDealList.d.ts +8 -2
  71. package/dist/ui/hooks/useDealList.js +20 -9
  72. package/dist/ui/hooks/useDealMutations.d.ts +9 -0
  73. package/dist/ui/hooks/useDealMutations.js +1 -1
  74. package/dist/ui/index.d.ts +3 -3
  75. package/dist/ui/index.js +683 -450
  76. package/dist/ui/modals/CreateDealModal.js +12 -12
  77. package/dist/ui/modals/DealActionsModal.js +21 -21
  78. package/dist/ui/modals/index.js +33 -33
  79. package/dist/ui/renderers/index.d.ts +1 -1
  80. package/dist/ui/renderers/index.js +140 -118
  81. package/dist/ui/renderers/pipeline.markdown.js +13 -2
  82. package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
  83. package/dist/ui/renderers/pipeline.renderer.js +108 -97
  84. package/dist/ui/tables/DealListTab.d.ts +20 -0
  85. package/dist/ui/tables/DealListTab.js +391 -0
  86. package/dist/ui/tables/DealListTab.smoke.test.d.ts +1 -0
  87. package/package.json +29 -14
  88. package/src/crm-pipeline.feature.ts +86 -86
  89. package/src/deal/deal.enum.ts +8 -8
  90. package/src/deal/deal.operation.ts +255 -255
  91. package/src/deal/deal.schema.ts +92 -92
  92. package/src/deal/deal.test-spec.ts +48 -48
  93. package/src/deal/index.ts +17 -19
  94. package/src/docs/crm-pipeline.docblock.ts +44 -44
  95. package/src/entities/company.entity.ts +52 -52
  96. package/src/entities/contact.entity.ts +67 -67
  97. package/src/entities/deal.entity.ts +134 -134
  98. package/src/entities/index.ts +27 -27
  99. package/src/entities/task.entity.ts +105 -105
  100. package/src/events/contact.event.ts +22 -22
  101. package/src/events/deal.event.ts +77 -77
  102. package/src/events/task.event.ts +19 -19
  103. package/src/example.ts +32 -32
  104. package/src/handlers/crm.handlers.ts +375 -357
  105. package/src/handlers/deal.handlers.ts +179 -179
  106. package/src/handlers/index.ts +18 -19
  107. package/src/handlers/mock-data.ts +167 -167
  108. package/src/index.ts +11 -11
  109. package/src/operations/index.ts +16 -16
  110. package/src/presentations/dashboard.presentation.ts +45 -45
  111. package/src/presentations/pipeline.presentation.ts +90 -90
  112. package/src/seeders/index.ts +26 -26
  113. package/src/shared/overlay-types.ts +23 -23
  114. package/src/ui/CrmDashboard.tsx +210 -279
  115. package/src/ui/CrmDealCard.tsx +64 -64
  116. package/src/ui/CrmPipelineBoard.tsx +105 -105
  117. package/src/ui/hooks/index.ts +3 -3
  118. package/src/ui/hooks/useDealList.ts +113 -85
  119. package/src/ui/hooks/useDealMutations.ts +151 -150
  120. package/src/ui/index.ts +5 -10
  121. package/src/ui/modals/CreateDealModal.tsx +217 -217
  122. package/src/ui/modals/DealActionsModal.tsx +390 -390
  123. package/src/ui/overlays/demo-overlays.ts +43 -43
  124. package/src/ui/renderers/index.ts +4 -3
  125. package/src/ui/renderers/pipeline.markdown.ts +165 -165
  126. package/src/ui/renderers/pipeline.renderer.tsx +17 -16
  127. package/src/ui/tables/DealListTab.smoke.test.tsx +149 -0
  128. package/src/ui/tables/DealListTab.tsx +276 -0
  129. package/tsconfig.json +7 -8
  130. package/tsdown.config.js +7 -3
@@ -2,34 +2,35 @@ $ contractspec-bun-build prebuild
2
2
  $ bun run prebuild && bun run build:bundle && bun run build:types
3
3
  $ contractspec-bun-build prebuild
4
4
  $ contractspec-bun-build transpile
5
- [contractspec-bun-build] transpile target=bun root=src entries=44 noBundle=false
6
- Bundled 44 modules in 85ms
5
+ [contractspec-bun-build] transpile target=bun root=src entries=45 noBundle=false
6
+ Bundled 45 modules in 38ms
7
7
 
8
8
  ./crm-pipeline.feature.js 2.54 KB (entry point)
9
9
  seeders/index.js 1.00 KB (entry point)
10
10
  shared/overlay-types.js 8 bytes (entry point)
11
- ./index.js 116.70 KB (entry point)
12
- ui/index.js 74.41 KB (entry point)
11
+ ./index.js 122.92 KB (entry point)
12
+ ui/index.js 80.58 KB (entry point)
13
13
  ui/overlays/index.js 1.19 KB (entry point)
14
- ui/renderers/index.js 28.45 KB (entry point)
15
- ui/renderers/pipeline.markdown.js 17.75 KB (entry point)
16
- ui/renderers/pipeline.renderer.js 10.71 KB (entry point)
17
- ui/hooks/index.js 5.75 KB (entry point)
14
+ ui/renderers/index.js 29.47 KB (entry point)
15
+ ui/renderers/pipeline.markdown.js 18.13 KB (entry point)
16
+ ui/renderers/pipeline.renderer.js 11.35 KB (entry point)
17
+ ui/hooks/index.js 6.38 KB (entry point)
18
18
  ui/modals/index.js 27.54 KB (entry point)
19
19
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
20
20
  presentations/index.js 9.78 KB (entry point)
21
21
  presentations/dashboard.presentation.js 1.55 KB (entry point)
22
22
  presentations/pipeline.presentation.js 8.20 KB (entry point)
23
- ui/CrmDashboard.js 54.56 KB (entry point)
24
- ui/hooks/useDealList.js 2.49 KB (entry point)
23
+ ui/CrmDashboard.js 60.35 KB (entry point)
24
+ ui/tables/DealListTab.js 12.29 KB (entry point)
25
+ ui/hooks/useDealList.js 3.12 KB (entry point)
25
26
  ui/hooks/useDealMutations.js 3.18 KB (entry point)
26
27
  ui/modals/CreateDealModal.js 8.89 KB (entry point)
27
28
  ui/modals/DealActionsModal.js 18.56 KB (entry point)
28
29
  ui/CrmPipelineBoard.js 7.49 KB (entry point)
29
30
  ui/CrmDealCard.js 2.29 KB (entry point)
30
31
  ./example.js 1.0 KB (entry point)
31
- handlers/index.js 13.62 KB (entry point)
32
- handlers/crm.handlers.js 5.81 KB (entry point)
32
+ handlers/index.js 14.00 KB (entry point)
33
+ handlers/crm.handlers.js 6.19 KB (entry point)
33
34
  handlers/deal.handlers.js 7.76 KB (entry point)
34
35
  handlers/mock-data.js 4.33 KB (entry point)
35
36
  operations/index.js 11.35 KB (entry point)
@@ -47,37 +48,38 @@ Bundled 44 modules in 85ms
47
48
  deal/deal.operation.js 11.11 KB (entry point)
48
49
  deal/deal.schema.js 5.41 KB (entry point)
49
50
  deal/deal.enum.js 333 bytes (entry point)
50
- docs/index.js 4.43 KB (entry point)
51
- docs/crm-pipeline.docblock.js 4.43 KB (entry point)
51
+ docs/index.js 4.48 KB (entry point)
52
+ docs/crm-pipeline.docblock.js 4.48 KB (entry point)
52
53
 
53
- [contractspec-bun-build] transpile target=node root=src entries=44 noBundle=false
54
- Bundled 44 modules in 94ms
54
+ [contractspec-bun-build] transpile target=node root=src entries=45 noBundle=false
55
+ Bundled 45 modules in 56ms
55
56
 
56
57
  ./crm-pipeline.feature.js 2.54 KB (entry point)
57
58
  seeders/index.js 0.99 KB (entry point)
58
59
  shared/overlay-types.js 0 KB (entry point)
59
- ./index.js 116.65 KB (entry point)
60
- ui/index.js 74.38 KB (entry point)
60
+ ./index.js 122.87 KB (entry point)
61
+ ui/index.js 80.54 KB (entry point)
61
62
  ui/overlays/index.js 1.19 KB (entry point)
62
- ui/renderers/index.js 28.44 KB (entry point)
63
- ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
64
- ui/renderers/pipeline.renderer.js 10.69 KB (entry point)
65
- ui/hooks/index.js 5.74 KB (entry point)
63
+ ui/renderers/index.js 29.45 KB (entry point)
64
+ ui/renderers/pipeline.markdown.js 18.12 KB (entry point)
65
+ ui/renderers/pipeline.renderer.js 11.33 KB (entry point)
66
+ ui/hooks/index.js 6.38 KB (entry point)
66
67
  ui/modals/index.js 27.52 KB (entry point)
67
68
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
68
69
  presentations/index.js 9.78 KB (entry point)
69
70
  presentations/dashboard.presentation.js 1.55 KB (entry point)
70
71
  presentations/pipeline.presentation.js 8.19 KB (entry point)
71
- ui/CrmDashboard.js 54.53 KB (entry point)
72
- ui/hooks/useDealList.js 2.48 KB (entry point)
72
+ ui/CrmDashboard.js 60.31 KB (entry point)
73
+ ui/tables/DealListTab.js 12.29 KB (entry point)
74
+ ui/hooks/useDealList.js 3.12 KB (entry point)
73
75
  ui/hooks/useDealMutations.js 3.17 KB (entry point)
74
76
  ui/modals/CreateDealModal.js 8.88 KB (entry point)
75
77
  ui/modals/DealActionsModal.js 18.54 KB (entry point)
76
78
  ui/CrmPipelineBoard.js 7.47 KB (entry point)
77
79
  ui/CrmDealCard.js 2.28 KB (entry point)
78
80
  ./example.js 1.0 KB (entry point)
79
- handlers/index.js 13.61 KB (entry point)
80
- handlers/crm.handlers.js 5.80 KB (entry point)
81
+ handlers/index.js 13.99 KB (entry point)
82
+ handlers/crm.handlers.js 6.18 KB (entry point)
81
83
  handlers/deal.handlers.js 7.75 KB (entry point)
82
84
  handlers/mock-data.js 4.32 KB (entry point)
83
85
  operations/index.js 11.34 KB (entry point)
@@ -95,37 +97,38 @@ Bundled 44 modules in 94ms
95
97
  deal/deal.operation.js 11.1 KB (entry point)
96
98
  deal/deal.schema.js 5.40 KB (entry point)
97
99
  deal/deal.enum.js 325 bytes (entry point)
98
- docs/index.js 4.41 KB (entry point)
99
- docs/crm-pipeline.docblock.js 4.41 KB (entry point)
100
+ docs/index.js 4.46 KB (entry point)
101
+ docs/crm-pipeline.docblock.js 4.46 KB (entry point)
100
102
 
101
- [contractspec-bun-build] transpile target=browser root=src entries=44 noBundle=false
102
- Bundled 44 modules in 99ms
103
+ [contractspec-bun-build] transpile target=browser root=src entries=45 noBundle=false
104
+ Bundled 45 modules in 69ms
103
105
 
104
106
  ./crm-pipeline.feature.js 2.54 KB (entry point)
105
107
  seeders/index.js 0.99 KB (entry point)
106
108
  shared/overlay-types.js 0 KB (entry point)
107
- ./index.js 116.65 KB (entry point)
108
- ui/index.js 74.38 KB (entry point)
109
+ ./index.js 122.87 KB (entry point)
110
+ ui/index.js 80.54 KB (entry point)
109
111
  ui/overlays/index.js 1.19 KB (entry point)
110
- ui/renderers/index.js 28.44 KB (entry point)
111
- ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
112
- ui/renderers/pipeline.renderer.js 10.69 KB (entry point)
113
- ui/hooks/index.js 5.74 KB (entry point)
112
+ ui/renderers/index.js 29.45 KB (entry point)
113
+ ui/renderers/pipeline.markdown.js 18.12 KB (entry point)
114
+ ui/renderers/pipeline.renderer.js 11.33 KB (entry point)
115
+ ui/hooks/index.js 6.38 KB (entry point)
114
116
  ui/modals/index.js 27.52 KB (entry point)
115
117
  ui/overlays/demo-overlays.js 1.19 KB (entry point)
116
118
  presentations/index.js 9.78 KB (entry point)
117
119
  presentations/dashboard.presentation.js 1.55 KB (entry point)
118
120
  presentations/pipeline.presentation.js 8.19 KB (entry point)
119
- ui/CrmDashboard.js 54.53 KB (entry point)
120
- ui/hooks/useDealList.js 2.48 KB (entry point)
121
+ ui/CrmDashboard.js 60.31 KB (entry point)
122
+ ui/tables/DealListTab.js 12.29 KB (entry point)
123
+ ui/hooks/useDealList.js 3.12 KB (entry point)
121
124
  ui/hooks/useDealMutations.js 3.17 KB (entry point)
122
125
  ui/modals/CreateDealModal.js 8.88 KB (entry point)
123
126
  ui/modals/DealActionsModal.js 18.54 KB (entry point)
124
127
  ui/CrmPipelineBoard.js 7.47 KB (entry point)
125
128
  ui/CrmDealCard.js 2.28 KB (entry point)
126
129
  ./example.js 1.0 KB (entry point)
127
- handlers/index.js 13.61 KB (entry point)
128
- handlers/crm.handlers.js 5.80 KB (entry point)
130
+ handlers/index.js 13.99 KB (entry point)
131
+ handlers/crm.handlers.js 6.18 KB (entry point)
129
132
  handlers/deal.handlers.js 7.75 KB (entry point)
130
133
  handlers/mock-data.js 4.32 KB (entry point)
131
134
  operations/index.js 11.34 KB (entry point)
@@ -143,7 +146,7 @@ Bundled 44 modules in 99ms
143
146
  deal/deal.operation.js 11.1 KB (entry point)
144
147
  deal/deal.schema.js 5.40 KB (entry point)
145
148
  deal/deal.enum.js 325 bytes (entry point)
146
- docs/index.js 4.41 KB (entry point)
147
- docs/crm-pipeline.docblock.js 4.41 KB (entry point)
149
+ docs/index.js 4.46 KB (entry point)
150
+ docs/crm-pipeline.docblock.js 4.46 KB (entry point)
148
151
 
149
152
  $ contractspec-bun-build types
package/AGENTS.md CHANGED
@@ -1,42 +1,60 @@
1
- # AI Agent Guide -- `@contractspec/example.crm-pipeline`
1
+ # AI Agent Guide `@contractspec/example.crm-pipeline`
2
2
 
3
3
  Scope: `packages/examples/crm-pipeline/*`
4
4
 
5
- Demonstrates a full CRM pipeline with Contacts, Companies, Deals, and Tasks using spec-first entities, events, and UI.
5
+ CRM Pipeline - Contacts, Companies, Deals, Tasks.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `lib.contracts-spec`, `lib.schema`, `lib.design-system`, `lib.example-shared-ui`, `lib.identity-rbac`, `lib.runtime-sandbox`, `lib.ui-kit-web`, `module.audit-trail`, `module.notifications`
11
-
12
- ## What This Demonstrates
13
-
14
- - Multi-entity domain model (Contact, Company, Deal, Task)
15
- - Deal pipeline with stage enums, operations, and test-specs
16
- - Event-driven architecture (contact, deal, task events)
17
- - Presentation layer with dashboard and pipeline views
18
- - React UI with pipeline board, deal cards, hooks, modals, overlays, and renderers
19
- - Feature definition and capability pattern
20
- - Seeders and mock data
21
-
22
- ## Public Exports
23
-
24
- - `.` -- root barrel
25
- - `./crm-pipeline.feature` -- feature definition
26
- - `./deal` -- deal enum, operation, schema, test-spec
27
- - `./entities` -- contact, company, deal, task entities
28
- - `./events` -- contact, deal, task events
29
- - `./handlers` -- CRM and deal handlers with mock data
30
- - `./operations`, `./presentations` -- domain operations and presentations
31
- - `./seeders` -- demo data
32
- - `./ui` -- React components, hooks, modals, overlays, renderers
33
- - `./docs` -- DocBlock documentation
34
- - `./example` -- runnable example entry point
9
+ - Layer: `example`.
10
+ - Package visibility: published package.
11
+ - Primary consumers are example explorers, template authors, and documentation readers.
12
+ - Related packages: `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, ...
13
+
14
+ ## Architecture
15
+
16
+ - `src/crm-pipeline.feature.ts` defines a feature entrypoint.
17
+ - `src/deal` is part of the package's public or composition surface.
18
+ - `src/docs/` contains docblocks and documentation-facing exports.
19
+ - `src/entities/` contains domain entities and value objects.
20
+ - `src/events` is part of the package's public or composition surface.
21
+ - `src/example.ts` is the runnable example entrypoint.
22
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
23
+
24
+ ## Public Surface
25
+
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./crm-pipeline.feature` resolves through `./src/crm-pipeline.feature.ts`.
28
+ - Export `./deal` resolves through `./src/deal/index.ts`.
29
+ - Export `./deal/deal.enum` resolves through `./src/deal/deal.enum.ts`.
30
+ - Export `./deal/deal.operation` resolves through `./src/deal/deal.operation.ts`.
31
+ - Export `./deal/deal.schema` resolves through `./src/deal/deal.schema.ts`.
32
+ - Export `./deal/deal.test-spec` resolves through `./src/deal/deal.test-spec.ts`.
33
+ - Export `./docs` resolves through `./src/docs/index.ts`.
34
+ - Export `./docs/crm-pipeline.docblock` resolves through `./src/docs/crm-pipeline.docblock.ts`.
35
+ - Export `./entities` resolves through `./src/entities/index.ts`.
36
+ - The package publishes 44 total export subpaths; keep docs aligned with `package.json`.
37
+
38
+ ## Guardrails
39
+
40
+ - Keep the example package demonstrative, buildable, and aligned with the exported feature surface.
41
+ - Do not add hidden production assumptions that are not actually implemented in the example.
42
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, ....
43
+ - Changes here can affect downstream packages such as `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.runtime-sandbox`, `@contractspec/lib.schema`, ...
35
44
 
36
45
  ## Local Commands
37
46
 
38
- - Build: `bun run build`
39
- - Dev: `bun run dev`
40
- - Test: `bun test`
41
- - Validate: `bun run validate`
42
- - Typecheck: `bun run typecheck`
47
+ - `bun run dev` — contractspec-bun-build dev
48
+ - `bun run build`bun run prebuild && bun run build:bundle && bun run build:types
49
+ - `bun run test`bun test --pass-with-no-tests
50
+ - `bun run lint` — bun lint:fix
51
+ - `bun run lint:check` — biome check .
52
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
53
+ - `bun run typecheck` — tsc --noEmit
54
+ - `bun run validate` — contractspec validate "src/**/*"
55
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
56
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
57
+ - `bun run clean` — rimraf dist .turbo
58
+ - `bun run build:bundle` — contractspec-bun-build transpile
59
+ - `bun run build:types` — contractspec-bun-build types
60
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
1
  # @contractspec/example.crm-pipeline
2
2
 
3
+ ## 3.7.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 1a44cb6: feat: improve examples to increase coverage of Contracts type
8
+ - Updated dependencies [1a44cb6]
9
+ - @contractspec/lib.example-shared-ui@6.0.10
10
+ - @contractspec/module.notifications@3.7.10
11
+ - @contractspec/lib.runtime-sandbox@2.7.9
12
+ - @contractspec/lib.contracts-spec@4.1.2
13
+ - @contractspec/module.audit-trail@3.7.10
14
+ - @contractspec/lib.design-system@3.8.3
15
+ - @contractspec/lib.identity-rbac@3.7.10
16
+ - @contractspec/lib.ui-kit-web@3.9.2
17
+ - @contractspec/lib.schema@3.7.8
18
+
19
+ ## 3.7.9
20
+
21
+ ### Patch Changes
22
+
23
+ - fix: release
24
+ - Updated dependencies
25
+ - @contractspec/lib.example-shared-ui@6.0.9
26
+ - @contractspec/module.notifications@3.7.9
27
+ - @contractspec/lib.runtime-sandbox@2.7.8
28
+ - @contractspec/lib.contracts-spec@4.1.1
29
+ - @contractspec/module.audit-trail@3.7.9
30
+ - @contractspec/lib.design-system@3.8.2
31
+ - @contractspec/lib.identity-rbac@3.7.9
32
+ - @contractspec/lib.ui-kit-web@3.9.1
33
+ - @contractspec/lib.schema@3.7.7
34
+
3
35
  ## 3.7.6
4
36
 
5
37
  ### Patch Changes
@@ -622,6 +654,7 @@
622
654
  - 7f3203a: fix: make workspace test runs resilient when packages have no tests
623
655
 
624
656
  Updates package test scripts to pass cleanly when no matching test files exist:
657
+
625
658
  - Uses `bun test --pass-with-no-tests` in Bun-based packages that currently ship without test files.
626
659
  - Uses `jest --passWithNoTests` for the UI kit web package.
627
660
  - Adds `.vscode-test.mjs` for `vscode-contractspec` so VS Code extension test runs have an explicit config and stop failing on missing default configuration.
@@ -1122,14 +1155,17 @@
1122
1155
  feat: Contract layers support (features, examples, app-configs)
1123
1156
 
1124
1157
  ### New CLI Commands
1158
+
1125
1159
  - `contractspec list layers` - List all contract layers with filtering
1126
1160
 
1127
1161
  ### Enhanced Commands
1162
+
1128
1163
  - `contractspec ci` - New `layers` check category validates features/examples/config
1129
1164
  - `contractspec doctor` - New `layers` health checks
1130
1165
  - `contractspec integrity` - Now shows layer statistics
1131
1166
 
1132
1167
  ### New APIs
1168
+
1133
1169
  - `discoverLayers()` - Scan workspace for all layer files
1134
1170
  - `scanExampleSource()` - Parse ExampleSpec from source code
1135
1171
  - `isExampleFile()` - Check if file is an example spec
package/README.md CHANGED
@@ -1,159 +1,78 @@
1
- # CRM Pipeline
1
+ # @contractspec/example.crm-pipeline
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
- A complete CRM (Customer Relationship Management) application demonstrating ContractSpec principles.
5
+ **CRM Pipeline - Contacts, Companies, Deals, Tasks.**
6
6
 
7
- ## What's Included
7
+ ## What This Demonstrates
8
8
 
9
- This example showcases a CRM system with:
9
+ - Multi-entity domain model (Contact, Company, Deal, Task).
10
+ - Deal pipeline with stage enums, operations, and test-specs.
11
+ - Event-driven architecture (contact, deal, task events).
12
+ - Presentation layer with dashboard and pipeline views.
13
+ - React UI with pipeline board, hooks, modals, overlays, renderers, and a server-mode shared `DataTable` for deals.
14
+ - Shared table capabilities including sorting, pagination, multi-row selection, column visibility, pinning, resizing, and expandable deal details.
15
+ - Feature definition and capability pattern.
16
+ - Seeders and mock data.
10
17
 
11
- - **Contacts**: Individual people with contact information
12
- - **Companies**: Organizations/accounts that contacts belong to
13
- - **Deals**: Sales opportunities with pipeline stages
14
- - **Pipelines**: Customizable sales pipelines with stages
15
- - **Tasks**: Follow-up activities tied to contacts/deals
18
+ ## Running Locally
16
19
 
17
- ## Architecture
18
-
19
- ```
20
- crm-pipeline/
21
- ├── entities/ # Entity specs (generates Prisma schema)
22
- │ ├── contact.ts
23
- │ ├── company.ts
24
- │ ├── deal.ts
25
- │ ├── pipeline.ts
26
- │ └── task.ts
27
- ├── contracts/ # API contracts
28
- │ ├── contact.ts
29
- │ ├── deal.ts
30
- │ └── task.ts
31
- ├── events/ # Domain events
32
- │ └── index.ts
33
- └── README.md
34
- ```
35
-
36
- ## Entities
37
-
38
- ### Contact
39
-
40
- ```typescript
41
- const ContactEntity = defineEntity({
42
- name: 'Contact',
43
- fields: {
44
- id: field.id(),
45
- firstName: field.string(),
46
- lastName: field.string(),
47
- email: field.email({ isOptional: true }),
48
- phone: field.string({ isOptional: true }),
49
- companyId: field.foreignKey({ isOptional: true }),
50
- ownerId: field.foreignKey(),
51
- // ...
52
- },
53
- });
54
- ```
55
-
56
- ### Company
57
-
58
- ```typescript
59
- const CompanyEntity = defineEntity({
60
- name: 'Company',
61
- fields: {
62
- id: field.id(),
63
- name: field.string(),
64
- domain: field.string({ isOptional: true }),
65
- industry: field.string({ isOptional: true }),
66
- size: field.enum('CompanySize'),
67
- // ...
68
- },
69
- });
70
- ```
71
-
72
- ### Deal
73
-
74
- ```typescript
75
- const DealEntity = defineEntity({
76
- name: 'Deal',
77
- fields: {
78
- id: field.id(),
79
- name: field.string(),
80
- value: field.decimal(),
81
- currency: field.string(),
82
- stageId: field.foreignKey(),
83
- contactId: field.foreignKey({ isOptional: true }),
84
- companyId: field.foreignKey({ isOptional: true }),
85
- // ...
86
- },
87
- });
88
- ```
89
-
90
- ### Pipeline & Stage
91
-
92
- ```typescript
93
- const PipelineEntity = defineEntity({
94
- name: 'Pipeline',
95
- fields: {
96
- id: field.id(),
97
- name: field.string(),
98
- isDefault: field.boolean(),
99
- // ...
100
- },
101
- });
102
-
103
- const StageEntity = defineEntity({
104
- name: 'Stage',
105
- fields: {
106
- id: field.id(),
107
- name: field.string(),
108
- pipelineId: field.foreignKey(),
109
- position: field.int(),
110
- probability: field.int(), // Win probability %
111
- // ...
112
- },
113
- });
114
- ```
115
-
116
- ## Events
117
-
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 |
20
+ From `packages/examples/crm-pipeline`:
21
+ - `bun run dev`
22
+ - `bun run build`
23
+ - `bun run test`
24
+ - `bun run typecheck`
126
25
 
127
26
  ## Usage
128
27
 
129
- ### Load as Studio Template
130
-
131
- This example is registered as `crm-pipeline` in the ContractSpec Studio.
132
-
133
- ### Clone via Git
134
-
135
- ```bash
136
- npx degit lssm/contractspec/packages/examples/crm-pipeline my-crm-app
137
- ```
138
-
139
- ## Adoption narrative
28
+ Use `@contractspec/example.crm-pipeline` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
140
29
 
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
30
+ ## Architecture
154
31
 
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.
32
+ - `src/crm-pipeline.feature.ts` defines a feature entrypoint.
33
+ - `src/deal` is part of the package's public or composition surface.
34
+ - `src/docs/` contains docblocks and documentation-facing exports.
35
+ - `src/entities/` contains domain entities and value objects.
36
+ - `src/events` is part of the package's public or composition surface.
37
+ - `src/example.ts` is the runnable example entrypoint.
38
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
39
+
40
+ ## Public Entry Points
41
+
42
+ - Export `.` resolves through `./src/index.ts`.
43
+ - Export `./crm-pipeline.feature` resolves through `./src/crm-pipeline.feature.ts`.
44
+ - Export `./deal` resolves through `./src/deal/index.ts`.
45
+ - Export `./deal/deal.enum` resolves through `./src/deal/deal.enum.ts`.
46
+ - Export `./deal/deal.operation` resolves through `./src/deal/deal.operation.ts`.
47
+ - Export `./deal/deal.schema` resolves through `./src/deal/deal.schema.ts`.
48
+ - Export `./deal/deal.test-spec` resolves through `./src/deal/deal.test-spec.ts`.
49
+ - Export `./docs` resolves through `./src/docs/index.ts`.
50
+ - Export `./docs/crm-pipeline.docblock` resolves through `./src/docs/crm-pipeline.docblock.ts`.
51
+ - Export `./entities` resolves through `./src/entities/index.ts`.
52
+ - The package publishes 44 total export subpaths; keep docs aligned with `package.json`.
53
+
54
+ ## Local Commands
55
+
56
+ - `bun run dev` — contractspec-bun-build dev
57
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
58
+ - `bun run test` — bun test --pass-with-no-tests
59
+ - `bun run lint` — bun lint:fix
60
+ - `bun run lint:check` — biome check .
61
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
62
+ - `bun run typecheck` — tsc --noEmit
63
+ - `bun run validate` — contractspec validate "src/**/*"
64
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
65
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
66
+ - `bun run clean` — rimraf dist .turbo
67
+ - `bun run build:bundle` — contractspec-bun-build transpile
68
+ - `bun run build:types` — contractspec-bun-build types
69
+ - `bun run prebuild` — contractspec-bun-build prebuild
70
+
71
+ ## Recent Updates
72
+
73
+ - Replace eslint+prettier by biomejs to optimize speed.
74
+ - Missing contract layers.
75
+
76
+ ## Notes
77
+
78
+ - Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.runtime-sandbox`, ...
@@ -81,7 +81,7 @@ var crmPipelineDocBlocks = [
81
81
  - deal.created, stage.moved, task.completed, contact.updated.
82
82
 
83
83
  ## Presentations
84
- - Pipelines/kanban, deal detail, contact/company profiles, task lists.
84
+ - Pipelines/kanban, deal detail, contact/company profiles, task lists, and a server-mode shared table for the deal list.
85
85
 
86
86
  ## Notes
87
87
  - Stage definitions should be declarative; enforce via spec and regeneration.
@@ -81,7 +81,7 @@ var crmPipelineDocBlocks = [
81
81
  - deal.created, stage.moved, task.completed, contact.updated.
82
82
 
83
83
  ## Presentations
84
- - Pipelines/kanban, deal detail, contact/company profiles, task lists.
84
+ - Pipelines/kanban, deal detail, contact/company profiles, task lists, and a server-mode shared table for the deal list.
85
85
 
86
86
  ## Notes
87
87
  - Stage definitions should be declarative; enforce via spec and regeneration.
@@ -1,6 +1,6 @@
1
1
  // src/events/contact.event.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var ContactCreatedPayload = defineSchemaModel({
5
5
  name: "ContactCreatedPayload",
6
6
  description: "Payload when a contact is created",
@@ -1,6 +1,6 @@
1
1
  // src/events/deal.event.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var DealCreatedPayload = defineSchemaModel({
5
5
  name: "DealCreatedPayload",
6
6
  description: "Payload when a deal is created",
@@ -1,6 +1,6 @@
1
1
  // src/events/contact.event.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var ContactCreatedPayload = defineSchemaModel({
5
5
  name: "ContactCreatedPayload",
6
6
  description: "Payload when a contact is created",
@@ -28,8 +28,8 @@ var ContactCreatedEvent = defineEvent({
28
28
  });
29
29
 
30
30
  // src/events/deal.event.ts
31
- import { ScalarTypeEnum as ScalarTypeEnum2, defineSchemaModel as defineSchemaModel2 } from "@contractspec/lib.schema";
32
31
  import { defineEvent as defineEvent2 } from "@contractspec/lib.contracts-spec";
32
+ import { defineSchemaModel as defineSchemaModel2, ScalarTypeEnum as ScalarTypeEnum2 } from "@contractspec/lib.schema";
33
33
  var DealCreatedPayload = defineSchemaModel2({
34
34
  name: "DealCreatedPayload",
35
35
  description: "Payload when a deal is created",
@@ -124,8 +124,8 @@ var DealLostEvent = defineEvent2({
124
124
  });
125
125
 
126
126
  // src/events/task.event.ts
127
- import { ScalarTypeEnum as ScalarTypeEnum3, defineSchemaModel as defineSchemaModel3 } from "@contractspec/lib.schema";
128
127
  import { defineEvent as defineEvent3 } from "@contractspec/lib.contracts-spec";
128
+ import { defineSchemaModel as defineSchemaModel3, ScalarTypeEnum as ScalarTypeEnum3 } from "@contractspec/lib.schema";
129
129
  var TaskCompletedPayload = defineSchemaModel3({
130
130
  name: "TaskCompletedPayload",
131
131
  description: "Payload when a task is completed",
@@ -1,6 +1,6 @@
1
1
  // src/events/task.event.ts
2
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
3
2
  import { defineEvent } from "@contractspec/lib.contracts-spec";
3
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
4
4
  var TaskCompletedPayload = defineSchemaModel({
5
5
  name: "TaskCompletedPayload",
6
6
  description: "Payload when a task is completed",