@contractspec/example.saas-boilerplate 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.
Files changed (114) hide show
  1. package/.turbo/turbo-build.log +8 -8
  2. package/AGENTS.md +50 -27
  3. package/README.md +64 -144
  4. package/dist/billing/billing.event.js +1 -1
  5. package/dist/billing/index.d.ts +6 -6
  6. package/dist/billing/index.js +1 -1
  7. package/dist/browser/billing/billing.event.js +1 -1
  8. package/dist/browser/billing/index.js +1 -1
  9. package/dist/browser/index.js +931 -932
  10. package/dist/browser/project/index.js +209 -209
  11. package/dist/browser/project/project.event.js +1 -1
  12. package/dist/browser/ui/SaasDashboard.js +45 -45
  13. package/dist/browser/ui/SaasProjectList.js +7 -7
  14. package/dist/browser/ui/SaasSettingsPanel.js +12 -12
  15. package/dist/browser/ui/hooks/index.js +2 -2
  16. package/dist/browser/ui/hooks/useProjectList.js +1 -1
  17. package/dist/browser/ui/hooks/useProjectMutations.js +1 -1
  18. package/dist/browser/ui/index.js +483 -484
  19. package/dist/browser/ui/modals/CreateProjectModal.js +10 -10
  20. package/dist/browser/ui/modals/ProjectActionsModal.js +13 -13
  21. package/dist/browser/ui/modals/index.js +23 -23
  22. package/dist/browser/ui/renderers/index.js +112 -112
  23. package/dist/browser/ui/renderers/project-list.renderer.js +7 -7
  24. package/dist/handlers/index.d.ts +2 -2
  25. package/dist/index.d.ts +4 -4
  26. package/dist/index.js +931 -932
  27. package/dist/node/billing/billing.event.js +1 -1
  28. package/dist/node/billing/index.js +1 -1
  29. package/dist/node/index.js +931 -932
  30. package/dist/node/project/index.js +209 -209
  31. package/dist/node/project/project.event.js +1 -1
  32. package/dist/node/ui/SaasDashboard.js +45 -45
  33. package/dist/node/ui/SaasProjectList.js +7 -7
  34. package/dist/node/ui/SaasSettingsPanel.js +12 -12
  35. package/dist/node/ui/hooks/index.js +2 -2
  36. package/dist/node/ui/hooks/useProjectList.js +1 -1
  37. package/dist/node/ui/hooks/useProjectMutations.js +1 -1
  38. package/dist/node/ui/index.js +483 -484
  39. package/dist/node/ui/modals/CreateProjectModal.js +10 -10
  40. package/dist/node/ui/modals/ProjectActionsModal.js +13 -13
  41. package/dist/node/ui/modals/index.js +23 -23
  42. package/dist/node/ui/renderers/index.js +112 -112
  43. package/dist/node/ui/renderers/project-list.renderer.js +7 -7
  44. package/dist/presentations/index.d.ts +1 -1
  45. package/dist/project/index.d.ts +7 -7
  46. package/dist/project/index.js +209 -209
  47. package/dist/project/project.event.js +1 -1
  48. package/dist/settings/index.d.ts +1 -1
  49. package/dist/ui/SaasDashboard.js +45 -45
  50. package/dist/ui/SaasProjectList.js +7 -7
  51. package/dist/ui/SaasSettingsPanel.js +12 -12
  52. package/dist/ui/hooks/index.d.ts +2 -2
  53. package/dist/ui/hooks/index.js +2 -2
  54. package/dist/ui/hooks/useProjectList.d.ts +5 -0
  55. package/dist/ui/hooks/useProjectList.js +1 -1
  56. package/dist/ui/hooks/useProjectMutations.d.ts +8 -0
  57. package/dist/ui/hooks/useProjectMutations.js +1 -1
  58. package/dist/ui/index.d.ts +4 -4
  59. package/dist/ui/index.js +483 -484
  60. package/dist/ui/modals/CreateProjectModal.js +10 -10
  61. package/dist/ui/modals/ProjectActionsModal.js +13 -13
  62. package/dist/ui/modals/index.js +23 -23
  63. package/dist/ui/renderers/index.d.ts +1 -1
  64. package/dist/ui/renderers/index.js +112 -112
  65. package/dist/ui/renderers/project-list.renderer.d.ts +1 -1
  66. package/dist/ui/renderers/project-list.renderer.js +7 -7
  67. package/package.json +10 -10
  68. package/src/billing/billing.entity.ts +132 -132
  69. package/src/billing/billing.enum.ts +9 -9
  70. package/src/billing/billing.event.ts +71 -71
  71. package/src/billing/billing.handler.ts +87 -87
  72. package/src/billing/billing.operations.ts +158 -158
  73. package/src/billing/billing.presentation.ts +45 -45
  74. package/src/billing/billing.schema.ts +76 -76
  75. package/src/billing/index.ts +43 -48
  76. package/src/dashboard/dashboard.presentation.ts +45 -45
  77. package/src/dashboard/index.ts +2 -2
  78. package/src/docs/saas-boilerplate.docblock.ts +43 -43
  79. package/src/example.ts +32 -32
  80. package/src/handlers/index.ts +9 -9
  81. package/src/handlers/saas.handlers.ts +250 -249
  82. package/src/index.ts +40 -41
  83. package/src/presentations/index.ts +18 -20
  84. package/src/project/index.ts +45 -50
  85. package/src/project/project.entity.ts +68 -68
  86. package/src/project/project.enum.ts +8 -8
  87. package/src/project/project.event.ts +79 -79
  88. package/src/project/project.handler.ts +103 -103
  89. package/src/project/project.operations.ts +236 -236
  90. package/src/project/project.presentation.ts +46 -46
  91. package/src/project/project.schema.ts +90 -90
  92. package/src/saas-boilerplate.feature.ts +100 -100
  93. package/src/seeders/index.ts +20 -20
  94. package/src/settings/index.ts +2 -3
  95. package/src/settings/settings.entity.ts +65 -65
  96. package/src/settings/settings.enum.ts +4 -4
  97. package/src/shared/mock-data.ts +92 -92
  98. package/src/shared/overlay-types.ts +23 -23
  99. package/src/tests/operations.test-spec.ts +96 -96
  100. package/src/ui/SaasDashboard.tsx +270 -270
  101. package/src/ui/SaasProjectList.tsx +90 -90
  102. package/src/ui/SaasSettingsPanel.tsx +84 -84
  103. package/src/ui/hooks/index.ts +3 -3
  104. package/src/ui/hooks/useProjectList.ts +69 -68
  105. package/src/ui/hooks/useProjectMutations.ts +144 -143
  106. package/src/ui/index.ts +8 -12
  107. package/src/ui/modals/CreateProjectModal.tsx +154 -154
  108. package/src/ui/modals/ProjectActionsModal.tsx +321 -321
  109. package/src/ui/overlays/demo-overlays.ts +49 -49
  110. package/src/ui/renderers/index.ts +5 -4
  111. package/src/ui/renderers/project-list.markdown.ts +204 -204
  112. package/src/ui/renderers/project-list.renderer.tsx +14 -13
  113. package/tsconfig.json +7 -8
  114. package/tsdown.config.js +7 -3
@@ -3,7 +3,7 @@ $ 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=48 noBundle=false
6
- Bundled 48 modules in 95ms
6
+ Bundled 48 modules in 67ms
7
7
 
8
8
  billing/billing.entity.js 3.54 KB (entry point)
9
9
  tests/operations.test-spec.js 2.91 KB (entry point)
@@ -30,7 +30,7 @@ Bundled 48 modules in 95ms
30
30
  settings/index.js 2.30 KB (entry point)
31
31
  settings/settings.entity.js 2.28 KB (entry point)
32
32
  settings/settings.enum.js 310 bytes (entry point)
33
- project/index.js 22.48 KB (entry point)
33
+ project/index.js 22.50 KB (entry point)
34
34
  project/project.entity.js 2.27 KB (entry point)
35
35
  project/project.event.js 3.31 KB (entry point)
36
36
  project/project.operations.js 10.13 KB (entry point)
@@ -55,7 +55,7 @@ Bundled 48 modules in 95ms
55
55
  billing/billing.enum.js 443 bytes (entry point)
56
56
 
57
57
  [contractspec-bun-build] transpile target=node root=src entries=48 noBundle=false
58
- Bundled 48 modules in 84ms
58
+ Bundled 48 modules in 68ms
59
59
 
60
60
  billing/billing.entity.js 3.53 KB (entry point)
61
61
  tests/operations.test-spec.js 2.90 KB (entry point)
@@ -63,7 +63,7 @@ Bundled 48 modules in 84ms
63
63
  shared/overlay-types.js 0 KB (entry point)
64
64
  presentations/index.js 8.93 KB (entry point)
65
65
  ./index.js 113.50 KB (entry point)
66
- ui/index.js 65.60 KB (entry point)
66
+ ui/index.js 65.61 KB (entry point)
67
67
  ui/modals/index.js 19.40 KB (entry point)
68
68
  ui/overlays/index.js 1.30 KB (entry point)
69
69
  ui/overlays/demo-overlays.js 1.30 KB (entry point)
@@ -82,7 +82,7 @@ Bundled 48 modules in 84ms
82
82
  settings/index.js 2.29 KB (entry point)
83
83
  settings/settings.entity.js 2.27 KB (entry point)
84
84
  settings/settings.enum.js 302 bytes (entry point)
85
- project/index.js 22.47 KB (entry point)
85
+ project/index.js 22.49 KB (entry point)
86
86
  project/project.entity.js 2.26 KB (entry point)
87
87
  project/project.event.js 3.30 KB (entry point)
88
88
  project/project.operations.js 10.12 KB (entry point)
@@ -107,7 +107,7 @@ Bundled 48 modules in 84ms
107
107
  billing/billing.enum.js 435 bytes (entry point)
108
108
 
109
109
  [contractspec-bun-build] transpile target=browser root=src entries=48 noBundle=false
110
- Bundled 48 modules in 106ms
110
+ Bundled 48 modules in 82ms
111
111
 
112
112
  billing/billing.entity.js 3.53 KB (entry point)
113
113
  tests/operations.test-spec.js 2.90 KB (entry point)
@@ -115,7 +115,7 @@ Bundled 48 modules in 106ms
115
115
  shared/overlay-types.js 0 KB (entry point)
116
116
  presentations/index.js 8.93 KB (entry point)
117
117
  ./index.js 113.50 KB (entry point)
118
- ui/index.js 65.60 KB (entry point)
118
+ ui/index.js 65.61 KB (entry point)
119
119
  ui/modals/index.js 19.40 KB (entry point)
120
120
  ui/overlays/index.js 1.30 KB (entry point)
121
121
  ui/overlays/demo-overlays.js 1.30 KB (entry point)
@@ -134,7 +134,7 @@ Bundled 48 modules in 106ms
134
134
  settings/index.js 2.29 KB (entry point)
135
135
  settings/settings.entity.js 2.27 KB (entry point)
136
136
  settings/settings.enum.js 302 bytes (entry point)
137
- project/index.js 22.47 KB (entry point)
137
+ project/index.js 22.49 KB (entry point)
138
138
  project/project.entity.js 2.26 KB (entry point)
139
139
  project/project.event.js 3.30 KB (entry point)
140
140
  project/project.operations.js 10.12 KB (entry point)
package/AGENTS.md CHANGED
@@ -1,36 +1,59 @@
1
- # AI Agent Guide -- `@contractspec/example.saas-boilerplate`
1
+ # AI Agent Guide `@contractspec/example.saas-boilerplate`
2
2
 
3
3
  Scope: `packages/examples/saas-boilerplate/*`
4
4
 
5
- SaaS Boilerplate: Users, Orgs, Projects, Billing, and Settings with full CRUD, events, and UI.
5
+ SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings.
6
6
 
7
7
  ## Quick Context
8
8
 
9
- - **Layer**: example
10
- - **Related Packages**: `lib.identity-rbac`, `lib.jobs`, `module.audit-trail`, `module.notifications`, `lib.contracts-spec`, `lib.schema`, `lib.example-shared-ui`, `lib.design-system`, `lib.runtime-sandbox`
11
-
12
- ## What This Demonstrates
13
-
14
- - Multi-domain SaaS architecture (billing, project, settings, dashboard)
15
- - Per-domain entity/enum/event/handler/operations/presentation/schema pattern
16
- - React UI with hooks, modals, overlays, renderers, and dashboard
17
- - Feature definition, seeders, and test-spec patterns
18
- - RBAC, audit trail, and notification module integration
19
-
20
- ## Public Exports
21
-
22
- - `.` -- root barrel
23
- - `./billing`, `./project`, `./settings`, `./dashboard` -- domain modules
24
- - `./handlers` -- SaaS handlers
25
- - `./presentations` -- presentation layer
26
- - `./seeders` -- demo data
27
- - `./saas-boilerplate.feature` -- feature definition
28
- - `./ui` -- SaasDashboard, SaasProjectList, SaasSettingsPanel, hooks, modals, overlays, renderers
29
- - `./docs`, `./example`
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.jobs`, `@contractspec/lib.runtime-sandbox`, ...
13
+
14
+ ## Architecture
15
+
16
+ - `src/billing` is part of the package's public or composition surface.
17
+ - `src/dashboard` is part of the package's public or composition surface.
18
+ - `src/docs/` contains docblocks and documentation-facing exports.
19
+ - `src/example.ts` is the runnable example entrypoint.
20
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
21
+ - `src/index.ts` is the root public barrel and package entrypoint.
22
+ - `src/presentations` is part of the package's public or composition surface.
23
+
24
+ ## Public Surface
25
+
26
+ - Export `.` resolves through `./src/index.ts`.
27
+ - Export `./billing` resolves through `./src/billing/index.ts`.
28
+ - Export `./billing/billing.entity` resolves through `./src/billing/billing.entity.ts`.
29
+ - Export `./billing/billing.enum` resolves through `./src/billing/billing.enum.ts`.
30
+ - Export `./billing/billing.event` resolves through `./src/billing/billing.event.ts`.
31
+ - Export `./billing/billing.handler` resolves through `./src/billing/billing.handler.ts`.
32
+ - Export `./billing/billing.operations` resolves through `./src/billing/billing.operations.ts`.
33
+ - Export `./billing/billing.presentation` resolves through `./src/billing/billing.presentation.ts`.
34
+ - Export `./billing/billing.schema` resolves through `./src/billing/billing.schema.ts`.
35
+ - Export `./dashboard` resolves through `./src/dashboard/index.ts`.
36
+ - The package publishes 48 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.jobs`, `@contractspec/lib.runtime-sandbox`, ....
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.jobs`, `@contractspec/lib.runtime-sandbox`, ...
30
44
 
31
45
  ## Local Commands
32
46
 
33
- - Build: `bun run build`
34
- - Dev: `bun run dev`
35
- - Test: `bun test --pass-with-no-tests`
36
- - 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 publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
55
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
56
+ - `bun run clean` — rimraf dist .turbo
57
+ - `bun run build:bundle` — contractspec-bun-build transpile
58
+ - `bun run build:types` — contractspec-bun-build types
59
+ - `bun run prebuild` — contractspec-bun-build prebuild
package/README.md CHANGED
@@ -1,155 +1,75 @@
1
- # SaaS Boilerplate
1
+ # @contractspec/example.saas-boilerplate
2
2
 
3
- Website: https://contractspec.io/
3
+ Website: https://contractspec.io
4
4
 
5
+ **SaaS Boilerplate - Users, Orgs, Projects, Billing, Settings.**
5
6
 
6
- A complete SaaS starter application demonstrating ContractSpec principles.
7
+ ## What This Demonstrates
7
8
 
8
- ## What's Included
9
+ - Multi-domain SaaS architecture (billing, project, settings, dashboard).
10
+ - Per-domain entity/enum/event/handler/operations/presentation/schema pattern.
11
+ - React UI with hooks, modals, overlays, renderers, and dashboard.
12
+ - Feature definition, seeders, and test-spec patterns.
13
+ - RBAC, audit trail, and notification module integration.
14
+ - `src/docs/` contains docblocks and documentation-facing exports.
9
15
 
10
- This example showcases a full SaaS application with:
16
+ ## Running Locally
11
17
 
12
- - **User Management**: User profiles, authentication, preferences
13
- - **Organizations**: Multi-tenant workspaces with members and roles
14
- - **Projects**: Team-scoped projects with CRUD operations
15
- - **Billing**: Usage tracking and subscription management
16
- - **Settings**: Application and user settings
17
-
18
- ## Architecture
19
-
20
- ```
21
- saas-boilerplate/
22
- ├── entities/ # Entity specs (generates Prisma schema)
23
- │ ├── project.ts
24
- │ ├── settings.ts
25
- │ └── billing.ts
26
- ├── contracts/ # API contracts (generates GraphQL/REST)
27
- │ ├── project.ts
28
- │ └── billing.ts
29
- ├── events/ # Domain events
30
- │ └── index.ts
31
- ├── schema.config.ts # Schema composition config
32
- └── README.md
33
- ```
34
-
35
- ## Cross-Cutting Modules Used
36
-
37
- | Module | Purpose |
38
- |--------|---------|
39
- | @contractspec/lib.identity-rbac | User, Org, Member, Role entities |
40
- | @contractspec/module.audit-trail | Activity logging |
41
- | @contractspec/module.notifications | User notifications |
42
- | @contractspec/lib.jobs | Background tasks |
43
-
44
- ## Entities
45
-
46
- ### Project
47
-
48
- Projects belong to organizations and track team work.
49
-
50
- ```typescript
51
- const ProjectEntity = defineEntity({
52
- name: 'Project',
53
- fields: {
54
- id: field.id(),
55
- name: field.string(),
56
- description: field.string({ isOptional: true }),
57
- organizationId: field.foreignKey(),
58
- createdBy: field.foreignKey(),
59
- status: field.enum('ProjectStatus'),
60
- // ...
61
- },
62
- });
63
- ```
64
-
65
- ### Settings
66
-
67
- Application and organization settings.
68
-
69
- ```typescript
70
- const SettingsEntity = defineEntity({
71
- name: 'Settings',
72
- fields: {
73
- id: field.id(),
74
- key: field.string(),
75
- value: field.json(),
76
- scope: field.enum('SettingsScope'), // 'app', 'org', 'user'
77
- // ...
78
- },
79
- });
80
- ```
81
-
82
- ### BillingUsage
83
-
84
- Track feature usage for billing.
85
-
86
- ```typescript
87
- const BillingUsageEntity = defineEntity({
88
- name: 'BillingUsage',
89
- fields: {
90
- id: field.id(),
91
- organizationId: field.foreignKey(),
92
- feature: field.string(),
93
- quantity: field.int(),
94
- billingPeriod: field.string(),
95
- // ...
96
- },
97
- });
98
- ```
99
-
100
- ## Contracts
101
-
102
- ### Project CRUD
103
-
104
- - `project.create` - Create a new project
105
- - `project.get` - Get project by ID
106
- - `project.update` - Update project
107
- - `project.delete` - Delete project
108
- - `project.list` - List org projects
109
-
110
- ### Billing
111
-
112
- - `billing.usage.record` - Record feature usage
113
- - `billing.usage.get` - Get usage summary
114
- - `billing.subscription.get` - Get subscription status
115
-
116
- ## Events
117
-
118
- | Event | Description |
119
- |-------|-------------|
120
- | project.created | New project created |
121
- | project.updated | Project modified |
122
- | project.deleted | Project removed |
123
- | billing.usage.recorded | Usage tracked |
124
- | billing.limit.reached | Usage limit hit |
18
+ From `packages/examples/saas-boilerplate`:
19
+ - `bun run dev`
20
+ - `bun run build`
21
+ - `bun run test`
22
+ - `bun run typecheck`
125
23
 
126
24
  ## Usage
127
25
 
128
- ### Generate Schema
129
-
130
- ```bash
131
- cd packages/examples/saas-boilerplate
132
- ```
133
-
134
- ### Load as Studio Template
135
-
136
- This example is registered in the ContractSpec Studio template registry as `saas-boilerplate`.
26
+ Use `@contractspec/example.saas-boilerplate` as a reference implementation, or import its exported surfaces into a workspace that composes ContractSpec examples and bundles.
137
27
 
138
- From the Studio UI:
139
- 1. Click "New Project"
140
- 2. Select "SaaS Boilerplate" template
141
- 3. Customize entities and contracts as needed
142
-
143
- ### Clone via Git
144
-
145
- ```bash
146
- npx degit lssm/contractspec/packages/examples/saas-boilerplate my-saas-app
147
- ```
148
-
149
- ## Customization Points
150
-
151
- 1. **Add Custom Entities**: Extend with your domain models
152
- 2. **Modify Billing**: Adapt to your pricing model
153
- 3. **Extend Settings**: Add app-specific configuration
154
- 4. **Add Workflows**: Integrate with @contractspec/lib.jobs for background tasks
28
+ ## Architecture
155
29
 
30
+ - `src/billing` is part of the package's public or composition surface.
31
+ - `src/dashboard` is part of the package's public or composition surface.
32
+ - `src/docs/` contains docblocks and documentation-facing exports.
33
+ - `src/example.ts` is the runnable example entrypoint.
34
+ - `src/handlers/` contains handlers or demo adapters wired to contract surfaces.
35
+ - `src/index.ts` is the root public barrel and package entrypoint.
36
+ - `src/presentations` is part of the package's public or composition surface.
37
+
38
+ ## Public Entry Points
39
+
40
+ - Export `.` resolves through `./src/index.ts`.
41
+ - Export `./billing` resolves through `./src/billing/index.ts`.
42
+ - Export `./billing/billing.entity` resolves through `./src/billing/billing.entity.ts`.
43
+ - Export `./billing/billing.enum` resolves through `./src/billing/billing.enum.ts`.
44
+ - Export `./billing/billing.event` resolves through `./src/billing/billing.event.ts`.
45
+ - Export `./billing/billing.handler` resolves through `./src/billing/billing.handler.ts`.
46
+ - Export `./billing/billing.operations` resolves through `./src/billing/billing.operations.ts`.
47
+ - Export `./billing/billing.presentation` resolves through `./src/billing/billing.presentation.ts`.
48
+ - Export `./billing/billing.schema` resolves through `./src/billing/billing.schema.ts`.
49
+ - Export `./dashboard` resolves through `./src/dashboard/index.ts`.
50
+ - The package publishes 48 total export subpaths; keep docs aligned with `package.json`.
51
+
52
+ ## Local Commands
53
+
54
+ - `bun run dev` — contractspec-bun-build dev
55
+ - `bun run build` — bun run prebuild && bun run build:bundle && bun run build:types
56
+ - `bun run test` — bun test --pass-with-no-tests
57
+ - `bun run lint` — bun lint:fix
58
+ - `bun run lint:check` — biome check .
59
+ - `bun run lint:fix` — biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .
60
+ - `bun run typecheck` — tsc --noEmit
61
+ - `bun run publish:pkg` — bun publish --tolerate-republish --ignore-scripts --verbose
62
+ - `bun run publish:pkg:canary` — bun publish:pkg --tag canary
63
+ - `bun run clean` — rimraf dist .turbo
64
+ - `bun run build:bundle` — contractspec-bun-build transpile
65
+ - `bun run build:types` — contractspec-bun-build types
66
+ - `bun run prebuild` — contractspec-bun-build prebuild
67
+
68
+ ## Recent Updates
69
+
70
+ - Replace eslint+prettier by biomejs to optimize speed.
71
+ - Missing contract layers.
72
+
73
+ ## Notes
74
+
75
+ - Works alongside `@contractspec/lib.contracts-spec`, `@contractspec/lib.design-system`, `@contractspec/lib.example-shared-ui`, `@contractspec/lib.identity-rbac`, `@contractspec/lib.jobs`, ...
@@ -1,7 +1,7 @@
1
1
  // @bun
2
2
  // src/billing/billing.event.ts
3
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
4
3
  import { defineEvent } from "@contractspec/lib.contracts-spec";
4
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
5
5
  var UsageRecordedPayload = defineSchemaModel({
6
6
  name: "UsageRecordedPayload",
7
7
  description: "Payload when feature usage is recorded",
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * Billing domain - subscription, usage tracking, and feature access.
3
3
  */
4
- export { SubscriptionStatusSchemaEnum, FeatureAccessReasonEnum, } from './billing.enum';
5
- export { SubscriptionModel, UsageSummaryModel, RecordUsageInputModel, RecordUsageOutputModel, UsageRecordedPayloadModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, } from './billing.schema';
6
- export { GetSubscriptionContract, RecordUsageContract, GetUsageSummaryContract, CheckFeatureAccessContract, } from './billing.operations';
7
- export { UsageRecordedEvent, UsageLimitReachedEvent, SubscriptionChangedEvent, } from './billing.event';
8
- export { SubscriptionStatusEnum, SubscriptionEntity, BillingUsageEntity, UsageLimitEntity, } from './billing.entity';
4
+ export { BillingUsageEntity, SubscriptionEntity, SubscriptionStatusEnum, UsageLimitEntity, } from './billing.entity';
5
+ export { FeatureAccessReasonEnum, SubscriptionStatusSchemaEnum, } from './billing.enum';
6
+ export { SubscriptionChangedEvent, UsageLimitReachedEvent, UsageRecordedEvent, } from './billing.event';
7
+ export { type CheckFeatureAccessInput, type CheckFeatureAccessOutput, mockCheckFeatureAccessHandler, mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler, type RecordUsageInput, type Subscription, type UsageSummary, } from './billing.handler';
8
+ export { CheckFeatureAccessContract, GetSubscriptionContract, GetUsageSummaryContract, RecordUsageContract, } from './billing.operations';
9
9
  export { SubscriptionPresentation, UsageDashboardPresentation, } from './billing.presentation';
10
- export { mockGetSubscriptionHandler, mockGetUsageSummaryHandler, mockRecordUsageHandler, mockCheckFeatureAccessHandler, type Subscription, type UsageSummary, type RecordUsageInput, type CheckFeatureAccessInput, type CheckFeatureAccessOutput, } from './billing.handler';
10
+ export { CheckFeatureAccessInputModel, CheckFeatureAccessOutputModel, GetUsageSummaryInputModel, GetUsageSummaryOutputModel, RecordUsageInputModel, RecordUsageOutputModel, SubscriptionModel, UsageRecordedPayloadModel, UsageSummaryModel, } from './billing.schema';
@@ -124,8 +124,8 @@ var FeatureAccessReasonEnum = defineEnum("FeatureAccessReason", [
124
124
  ]);
125
125
 
126
126
  // src/billing/billing.event.ts
127
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
128
127
  import { defineEvent } from "@contractspec/lib.contracts-spec";
128
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
129
129
  var UsageRecordedPayload = defineSchemaModel({
130
130
  name: "UsageRecordedPayload",
131
131
  description: "Payload when feature usage is recorded",
@@ -1,6 +1,6 @@
1
1
  // src/billing/billing.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 UsageRecordedPayload = defineSchemaModel({
5
5
  name: "UsageRecordedPayload",
6
6
  description: "Payload when feature usage is recorded",
@@ -123,8 +123,8 @@ var FeatureAccessReasonEnum = defineEnum("FeatureAccessReason", [
123
123
  ]);
124
124
 
125
125
  // src/billing/billing.event.ts
126
- import { ScalarTypeEnum, defineSchemaModel } from "@contractspec/lib.schema";
127
126
  import { defineEvent } from "@contractspec/lib.contracts-spec";
127
+ import { defineSchemaModel, ScalarTypeEnum } from "@contractspec/lib.schema";
128
128
  var UsageRecordedPayload = defineSchemaModel({
129
129
  name: "UsageRecordedPayload",
130
130
  description: "Payload when feature usage is recorded",