@contractspec/example.crm-pipeline 3.7.6 → 3.7.7
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.
- package/.turbo/turbo-build.log +8 -8
- package/AGENTS.md +51 -33
- package/README.md +66 -148
- package/dist/browser/events/contact.event.js +1 -1
- package/dist/browser/events/deal.event.js +1 -1
- package/dist/browser/events/index.js +3 -3
- package/dist/browser/events/task.event.js +1 -1
- package/dist/browser/index.js +293 -293
- package/dist/browser/ui/CrmDashboard.js +221 -221
- package/dist/browser/ui/CrmDealCard.js +5 -5
- package/dist/browser/ui/CrmPipelineBoard.js +13 -13
- package/dist/browser/ui/hooks/index.js +2 -2
- package/dist/browser/ui/hooks/useDealList.js +1 -1
- package/dist/browser/ui/hooks/useDealMutations.js +1 -1
- package/dist/browser/ui/index.js +290 -290
- package/dist/browser/ui/modals/CreateDealModal.js +12 -12
- package/dist/browser/ui/modals/DealActionsModal.js +21 -21
- package/dist/browser/ui/modals/index.js +33 -33
- package/dist/browser/ui/renderers/index.js +116 -116
- package/dist/browser/ui/renderers/pipeline.renderer.js +97 -97
- package/dist/deal/index.d.ts +2 -2
- package/dist/events/contact.event.js +1 -1
- package/dist/events/deal.event.js +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/task.event.js +1 -1
- package/dist/handlers/index.d.ts +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +293 -293
- package/dist/node/events/contact.event.js +1 -1
- package/dist/node/events/deal.event.js +1 -1
- package/dist/node/events/index.js +3 -3
- package/dist/node/events/task.event.js +1 -1
- package/dist/node/index.js +293 -293
- package/dist/node/ui/CrmDashboard.js +221 -221
- package/dist/node/ui/CrmDealCard.js +5 -5
- package/dist/node/ui/CrmPipelineBoard.js +13 -13
- package/dist/node/ui/hooks/index.js +2 -2
- package/dist/node/ui/hooks/useDealList.js +1 -1
- package/dist/node/ui/hooks/useDealMutations.js +1 -1
- package/dist/node/ui/index.js +290 -290
- package/dist/node/ui/modals/CreateDealModal.js +12 -12
- package/dist/node/ui/modals/DealActionsModal.js +21 -21
- package/dist/node/ui/modals/index.js +33 -33
- package/dist/node/ui/renderers/index.js +116 -116
- package/dist/node/ui/renderers/pipeline.renderer.js +97 -97
- package/dist/operations/index.d.ts +1 -1
- package/dist/ui/CrmDashboard.js +221 -221
- package/dist/ui/CrmDealCard.js +5 -5
- package/dist/ui/CrmPipelineBoard.js +13 -13
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.js +2 -2
- package/dist/ui/hooks/useDealList.js +1 -1
- package/dist/ui/hooks/useDealMutations.d.ts +9 -0
- package/dist/ui/hooks/useDealMutations.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +290 -290
- package/dist/ui/modals/CreateDealModal.js +12 -12
- package/dist/ui/modals/DealActionsModal.js +21 -21
- package/dist/ui/modals/index.js +33 -33
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +116 -116
- package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
- package/dist/ui/renderers/pipeline.renderer.js +97 -97
- package/package.json +10 -10
- package/src/crm-pipeline.feature.ts +86 -86
- package/src/deal/deal.enum.ts +8 -8
- package/src/deal/deal.operation.ts +255 -255
- package/src/deal/deal.schema.ts +92 -92
- package/src/deal/deal.test-spec.ts +48 -48
- package/src/deal/index.ts +17 -19
- package/src/docs/crm-pipeline.docblock.ts +43 -43
- package/src/entities/company.entity.ts +52 -52
- package/src/entities/contact.entity.ts +67 -67
- package/src/entities/deal.entity.ts +134 -134
- package/src/entities/index.ts +27 -27
- package/src/entities/task.entity.ts +105 -105
- package/src/events/contact.event.ts +22 -22
- package/src/events/deal.event.ts +77 -77
- package/src/events/task.event.ts +19 -19
- package/src/example.ts +32 -32
- package/src/handlers/crm.handlers.ts +358 -357
- package/src/handlers/deal.handlers.ts +179 -179
- package/src/handlers/index.ts +18 -19
- package/src/handlers/mock-data.ts +167 -167
- package/src/index.ts +11 -11
- package/src/operations/index.ts +16 -16
- package/src/presentations/dashboard.presentation.ts +45 -45
- package/src/presentations/pipeline.presentation.ts +90 -90
- package/src/seeders/index.ts +26 -26
- package/src/shared/overlay-types.ts +23 -23
- package/src/ui/CrmDashboard.tsx +256 -256
- package/src/ui/CrmDealCard.tsx +64 -64
- package/src/ui/CrmPipelineBoard.tsx +105 -105
- package/src/ui/hooks/index.ts +3 -3
- package/src/ui/hooks/useDealList.ts +85 -85
- package/src/ui/hooks/useDealMutations.ts +151 -150
- package/src/ui/index.ts +5 -10
- package/src/ui/modals/CreateDealModal.tsx +217 -217
- package/src/ui/modals/DealActionsModal.tsx +390 -390
- package/src/ui/overlays/demo-overlays.ts +43 -43
- package/src/ui/renderers/index.ts +4 -3
- package/src/ui/renderers/pipeline.markdown.ts +165 -165
- package/src/ui/renderers/pipeline.renderer.tsx +17 -16
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/.turbo/turbo-build.log
CHANGED
|
@@ -3,15 +3,15 @@ $ bun run prebuild && bun run build:bundle && bun run build:types
|
|
|
3
3
|
$ contractspec-bun-build prebuild
|
|
4
4
|
$ contractspec-bun-build transpile
|
|
5
5
|
[contractspec-bun-build] transpile target=bun root=src entries=44 noBundle=false
|
|
6
|
-
Bundled 44 modules in
|
|
6
|
+
Bundled 44 modules in 82ms
|
|
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
11
|
./index.js 116.70 KB (entry point)
|
|
12
|
-
ui/index.js 74.
|
|
12
|
+
ui/index.js 74.42 KB (entry point)
|
|
13
13
|
ui/overlays/index.js 1.19 KB (entry point)
|
|
14
|
-
ui/renderers/index.js 28.
|
|
14
|
+
ui/renderers/index.js 28.46 KB (entry point)
|
|
15
15
|
ui/renderers/pipeline.markdown.js 17.75 KB (entry point)
|
|
16
16
|
ui/renderers/pipeline.renderer.js 10.71 KB (entry point)
|
|
17
17
|
ui/hooks/index.js 5.75 KB (entry point)
|
|
@@ -20,7 +20,7 @@ Bundled 44 modules in 85ms
|
|
|
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.
|
|
23
|
+
ui/CrmDashboard.js 54.57 KB (entry point)
|
|
24
24
|
ui/hooks/useDealList.js 2.49 KB (entry point)
|
|
25
25
|
ui/hooks/useDealMutations.js 3.18 KB (entry point)
|
|
26
26
|
ui/modals/CreateDealModal.js 8.89 KB (entry point)
|
|
@@ -51,7 +51,7 @@ Bundled 44 modules in 85ms
|
|
|
51
51
|
docs/crm-pipeline.docblock.js 4.43 KB (entry point)
|
|
52
52
|
|
|
53
53
|
[contractspec-bun-build] transpile target=node root=src entries=44 noBundle=false
|
|
54
|
-
Bundled 44 modules in
|
|
54
|
+
Bundled 44 modules in 96ms
|
|
55
55
|
|
|
56
56
|
./crm-pipeline.feature.js 2.54 KB (entry point)
|
|
57
57
|
seeders/index.js 0.99 KB (entry point)
|
|
@@ -61,7 +61,7 @@ Bundled 44 modules in 94ms
|
|
|
61
61
|
ui/overlays/index.js 1.19 KB (entry point)
|
|
62
62
|
ui/renderers/index.js 28.44 KB (entry point)
|
|
63
63
|
ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
|
|
64
|
-
ui/renderers/pipeline.renderer.js 10.
|
|
64
|
+
ui/renderers/pipeline.renderer.js 10.70 KB (entry point)
|
|
65
65
|
ui/hooks/index.js 5.74 KB (entry point)
|
|
66
66
|
ui/modals/index.js 27.52 KB (entry point)
|
|
67
67
|
ui/overlays/demo-overlays.js 1.19 KB (entry point)
|
|
@@ -99,7 +99,7 @@ Bundled 44 modules in 94ms
|
|
|
99
99
|
docs/crm-pipeline.docblock.js 4.41 KB (entry point)
|
|
100
100
|
|
|
101
101
|
[contractspec-bun-build] transpile target=browser root=src entries=44 noBundle=false
|
|
102
|
-
Bundled 44 modules in
|
|
102
|
+
Bundled 44 modules in 91ms
|
|
103
103
|
|
|
104
104
|
./crm-pipeline.feature.js 2.54 KB (entry point)
|
|
105
105
|
seeders/index.js 0.99 KB (entry point)
|
|
@@ -109,7 +109,7 @@ Bundled 44 modules in 99ms
|
|
|
109
109
|
ui/overlays/index.js 1.19 KB (entry point)
|
|
110
110
|
ui/renderers/index.js 28.44 KB (entry point)
|
|
111
111
|
ui/renderers/pipeline.markdown.js 17.74 KB (entry point)
|
|
112
|
-
ui/renderers/pipeline.renderer.js 10.
|
|
112
|
+
ui/renderers/pipeline.renderer.js 10.70 KB (entry point)
|
|
113
113
|
ui/hooks/index.js 5.74 KB (entry point)
|
|
114
114
|
ui/modals/index.js 27.52 KB (entry point)
|
|
115
115
|
ui/overlays/demo-overlays.js 1.19 KB (entry point)
|
package/AGENTS.md
CHANGED
|
@@ -1,42 +1,60 @@
|
|
|
1
|
-
# AI Agent Guide
|
|
1
|
+
# AI Agent Guide — `@contractspec/example.crm-pipeline`
|
|
2
2
|
|
|
3
3
|
Scope: `packages/examples/crm-pipeline/*`
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
CRM Pipeline - Contacts, Companies, Deals, Tasks.
|
|
6
6
|
|
|
7
7
|
## Quick Context
|
|
8
8
|
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
19
|
-
-
|
|
20
|
-
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
-
|
|
27
|
-
- `./
|
|
28
|
-
- `./
|
|
29
|
-
- `./
|
|
30
|
-
-
|
|
31
|
-
- `./
|
|
32
|
-
- `./
|
|
33
|
-
- `./docs`
|
|
34
|
-
- `./
|
|
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
|
-
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
-
|
|
42
|
-
-
|
|
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/README.md
CHANGED
|
@@ -1,159 +1,77 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @contractspec/example.crm-pipeline
|
|
2
2
|
|
|
3
|
-
Website: https://contractspec.io
|
|
3
|
+
Website: https://contractspec.io
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
**CRM Pipeline - Contacts, Companies, Deals, Tasks.**
|
|
6
6
|
|
|
7
|
-
## What
|
|
7
|
+
## What This Demonstrates
|
|
8
8
|
|
|
9
|
-
|
|
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, deal cards, hooks, modals, overlays, and renderers.
|
|
14
|
+
- Feature definition and capability pattern.
|
|
15
|
+
- Seeders and mock data.
|
|
10
16
|
|
|
11
|
-
|
|
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
|
|
17
|
+
## Running Locally
|
|
16
18
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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 |
|
|
19
|
+
From `packages/examples/crm-pipeline`:
|
|
20
|
+
- `bun run dev`
|
|
21
|
+
- `bun run build`
|
|
22
|
+
- `bun run test`
|
|
23
|
+
- `bun run typecheck`
|
|
126
24
|
|
|
127
25
|
## Usage
|
|
128
26
|
|
|
129
|
-
|
|
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
|
|
27
|
+
Use `@contractspec/example.crm-pipeline` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
|
|
140
28
|
|
|
141
|
-
|
|
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
|
|
29
|
+
## Architecture
|
|
154
30
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
31
|
+
- `src/crm-pipeline.feature.ts` defines a feature entrypoint.
|
|
32
|
+
- `src/deal` is part of the package's public or composition surface.
|
|
33
|
+
- `src/docs/` contains docblocks and documentation-facing exports.
|
|
34
|
+
- `src/entities/` contains domain entities and value objects.
|
|
35
|
+
- `src/events` is part of the package's public or composition surface.
|
|
36
|
+
- `src/example.ts` is the runnable example entrypoint.
|
|
37
|
+
- `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
|
|
38
|
+
|
|
39
|
+
## Public Entry Points
|
|
40
|
+
|
|
41
|
+
- Export `.` resolves through `./src/index.ts`.
|
|
42
|
+
- Export `./crm-pipeline.feature` resolves through `./src/crm-pipeline.feature.ts`.
|
|
43
|
+
- Export `./deal` resolves through `./src/deal/index.ts`.
|
|
44
|
+
- Export `./deal/deal.enum` resolves through `./src/deal/deal.enum.ts`.
|
|
45
|
+
- Export `./deal/deal.operation` resolves through `./src/deal/deal.operation.ts`.
|
|
46
|
+
- Export `./deal/deal.schema` resolves through `./src/deal/deal.schema.ts`.
|
|
47
|
+
- Export `./deal/deal.test-spec` resolves through `./src/deal/deal.test-spec.ts`.
|
|
48
|
+
- Export `./docs` resolves through `./src/docs/index.ts`.
|
|
49
|
+
- Export `./docs/crm-pipeline.docblock` resolves through `./src/docs/crm-pipeline.docblock.ts`.
|
|
50
|
+
- Export `./entities` resolves through `./src/entities/index.ts`.
|
|
51
|
+
- The package publishes 44 total export subpaths; keep docs aligned with `package.json`.
|
|
52
|
+
|
|
53
|
+
## Local Commands
|
|
54
|
+
|
|
55
|
+
- `bun run dev` — contractspec-bun-build dev
|
|
56
|
+
- `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
|
|
57
|
+
- `bun run test` — bun test --pass-with-no-tests
|
|
58
|
+
- `bun run lint` — bun lint:fix
|
|
59
|
+
- `bun run lint:check` — biome check .
|
|
60
|
+
- `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
|
|
61
|
+
- `bun run typecheck` — tsc --noEmit
|
|
62
|
+
- `bun run validate` — contractspec validate "src/**/*"
|
|
63
|
+
- `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
|
|
64
|
+
- `bun run publish:pkg:canary` — bun publish:pkg --tag canary
|
|
65
|
+
- `bun run clean` — rimraf dist .turbo
|
|
66
|
+
- `bun run build:bundle` — contractspec-bun-build transpile
|
|
67
|
+
- `bun run build:types` — contractspec-bun-build types
|
|
68
|
+
- `bun run prebuild` — contractspec-bun-build prebuild
|
|
69
|
+
|
|
70
|
+
## Recent Updates
|
|
71
|
+
|
|
72
|
+
- Replace eslint+prettier by biomejs to optimize speed.
|
|
73
|
+
- Missing contract layers.
|
|
74
|
+
|
|
75
|
+
## Notes
|
|
76
|
+
|
|
77
|
+
- Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.runtime-sandbox`, ...
|
|
@@ -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",
|