@contractspec/example.lifecycle-dashboard 0.0.0-canary-20260113162409

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.
@@ -0,0 +1,25 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/lifecycle-dashboard/tsdown.config.js
4
+ ℹ entry: src/example.ts, src/index.ts, src/docs/index.ts, src/docs/lifecycle-dashboard.docblock.ts, src/snippets/page.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 17 files
9
+ ℹ dist/snippets/page.js 1.82 kB │ gzip: 0.87 kB
10
+ ℹ dist/example.js 0.99 kB │ gzip: 0.53 kB
11
+ ℹ dist/docs/lifecycle-dashboard.docblock.js 0.98 kB │ gzip: 0.56 kB
12
+ ℹ dist/index.js 0.22 kB │ gzip: 0.14 kB
13
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
14
+ ℹ dist/snippets/page.js.map 1.91 kB │ gzip: 0.91 kB
15
+ ℹ dist/example.js.map 1.42 kB │ gzip: 0.72 kB
16
+ ℹ dist/docs/lifecycle-dashboard.docblock.js.map 1.32 kB │ gzip: 0.72 kB
17
+ ℹ dist/snippets/page.d.ts.map 0.14 kB │ gzip: 0.13 kB
18
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
+ ℹ dist/snippets/page.d.ts 1.89 kB │ gzip: 0.88 kB
20
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
21
+ ℹ dist/index.d.ts 0.16 kB │ gzip: 0.11 kB
22
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
23
+ ℹ dist/docs/lifecycle-dashboard.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ 15 files, total: 11.31 kB
25
+ ✔ Build complete in 22002ms
@@ -0,0 +1,26 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.19.0 powered by rolldown v1.0.0-beta.59
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/lifecycle-dashboard/tsdown.config.js
6
+ ℹ entry: src/example.ts, src/index.ts, src/docs/index.ts, src/docs/lifecycle-dashboard.docblock.ts, src/snippets/page.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/snippets/page.js 1.82 kB │ gzip: 0.87 kB
11
+ ℹ dist/example.js 0.99 kB │ gzip: 0.53 kB
12
+ ℹ dist/docs/lifecycle-dashboard.docblock.js 0.98 kB │ gzip: 0.56 kB
13
+ ℹ dist/index.js 0.22 kB │ gzip: 0.14 kB
14
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
+ ℹ dist/snippets/page.js.map 1.91 kB │ gzip: 0.91 kB
16
+ ℹ dist/example.js.map 1.42 kB │ gzip: 0.72 kB
17
+ ℹ dist/docs/lifecycle-dashboard.docblock.js.map 1.32 kB │ gzip: 0.72 kB
18
+ ℹ dist/snippets/page.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
20
+ ℹ dist/snippets/page.d.ts 1.89 kB │ gzip: 0.88 kB
21
+ ℹ dist/example.d.ts 0.25 kB │ gzip: 0.17 kB
22
+ ℹ dist/index.d.ts 0.16 kB │ gzip: 0.11 kB
23
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ dist/docs/lifecycle-dashboard.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
25
+ ℹ 15 files, total: 11.31 kB
26
+ ✔ Build complete in 23012ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,293 @@
1
+ # @contractspec/example.lifecycle-dashboard
2
+
3
+ ## 0.0.0-canary-20260113162409
4
+
5
+ ### Minor Changes
6
+
7
+ - caf8701: feat: add cli vibe command to run workflow
8
+ - c69b849: feat: add api web services (mcp & website)
9
+ - 42b8d78: feat: add cli `contractspec vibe` workflow to simplify usage
10
+ - fd38e85: feat: auto-fix contractspec issues
11
+
12
+ ### Patch Changes
13
+
14
+ - e7ded36: feat: improve stability (adding ts-morph)
15
+ - c231a8b: test: improve workspace stability
16
+ - Updated dependencies [e7ded36]
17
+ - Updated dependencies [caf8701]
18
+ - Updated dependencies [c69b849]
19
+ - Updated dependencies [c231a8b]
20
+ - Updated dependencies [42b8d78]
21
+ - Updated dependencies [fd38e85]
22
+ - @contractspec/lib.contracts@0.0.0-canary-20260113162409
23
+
24
+ ## 1.46.2
25
+
26
+ ### Patch Changes
27
+
28
+ - 7e21625: feat: library services (landing page & api)
29
+ - Updated dependencies [7e21625]
30
+ - @contractspec/lib.contracts@1.46.2
31
+
32
+ ## 1.46.1
33
+
34
+ ### Patch Changes
35
+
36
+ - 2d8a72b: fix: mcp for presentation
37
+ - Updated dependencies [2d8a72b]
38
+ - @contractspec/lib.contracts@1.46.1
39
+
40
+ ## 1.46.0
41
+
42
+ ### Minor Changes
43
+
44
+ - 07cb19b: feat: feat: cleaude code & opencode integrations
45
+
46
+ ### Patch Changes
47
+
48
+ - Updated dependencies [07cb19b]
49
+ - @contractspec/lib.contracts@1.46.0
50
+
51
+ ## 1.45.6
52
+
53
+ ### Patch Changes
54
+
55
+ - a913074: feat: improve ai agents rules management"
56
+ - Updated dependencies [a913074]
57
+ - @contractspec/lib.contracts@1.45.6
58
+
59
+ ## 1.45.5
60
+
61
+ ### Patch Changes
62
+
63
+ - 9ddd7fa: feat: improve versioning
64
+ - Updated dependencies [9ddd7fa]
65
+ - @contractspec/lib.contracts@1.45.5
66
+
67
+ ## 1.45.4
68
+
69
+ ### Patch Changes
70
+
71
+ - fix: github action
72
+ - Updated dependencies
73
+ - @contractspec/lib.contracts@1.45.4
74
+
75
+ ## 1.45.3
76
+
77
+ ### Patch Changes
78
+
79
+ - e74ea9e: feat: version management
80
+ - Updated dependencies [e74ea9e]
81
+ - @contractspec/lib.contracts@1.45.3
82
+
83
+ ## 1.45.2
84
+
85
+ ### Patch Changes
86
+
87
+ - 39ca241: code cleaning
88
+ - Updated dependencies [39ca241]
89
+ - @contractspec/lib.contracts@1.45.2
90
+
91
+ ## 1.45.1
92
+
93
+ ### Patch Changes
94
+
95
+ - feat: improve app config and examples contracts
96
+ - Updated dependencies
97
+ - @contractspec/lib.contracts@1.45.1
98
+ - @contractspec/lib.schema@1.45.1
99
+
100
+ ## 1.45.0
101
+
102
+ ### Minor Changes
103
+
104
+ - e73ca1d: feat: improve app config and examples contracts
105
+ feat: Contract layers support (features, examples, app-configs)
106
+
107
+ ### New CLI Commands
108
+ - `contractspec list layers` - List all contract layers with filtering
109
+
110
+ ### Enhanced Commands
111
+ - `contractspec ci` - New `layers` check category validates features/examples/config
112
+ - `contractspec doctor` - New `layers` health checks
113
+ - `contractspec integrity` - Now shows layer statistics
114
+
115
+ ### New APIs
116
+ - `discoverLayers()` - Scan workspace for all layer files
117
+ - `scanExampleSource()` - Parse ExampleSpec from source code
118
+ - `isExampleFile()` - Check if file is an example spec
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [e73ca1d]
123
+ - @contractspec/lib.contracts@1.45.0
124
+ - @contractspec/lib.schema@1.45.0
125
+
126
+ ## 1.44.1
127
+
128
+ ### Patch Changes
129
+
130
+ - 3c594fb: fix
131
+ - Updated dependencies [3c594fb]
132
+ - @contractspec/lib.contracts@1.44.1
133
+ - @contractspec/lib.schema@1.44.1
134
+
135
+ ## 1.44.0
136
+
137
+ ### Minor Changes
138
+
139
+ - 5f3a868: chore: isolate branding to contractspec.io
140
+
141
+ ### Patch Changes
142
+
143
+ - Updated dependencies [5f3a868]
144
+ - @contractspec/lib.contracts@1.44.0
145
+ - @contractspec/lib.schema@1.44.0
146
+
147
+ ## 1.43.4
148
+
149
+ ### Patch Changes
150
+
151
+ - 9216062: fix: cross-platform compatibility
152
+ - Updated dependencies [9216062]
153
+ - @contractspec/lib.contracts@1.43.4
154
+ - @contractspec/lib.schema@1.43.3
155
+
156
+ ## 1.43.3
157
+
158
+ ### Patch Changes
159
+
160
+ - 24d9759: improve documentation
161
+ - Updated dependencies [24d9759]
162
+ - @contractspec/lib.contracts@1.43.3
163
+ - @contractspec/lib.schema@1.43.2
164
+
165
+ ## 1.43.2
166
+
167
+ ### Patch Changes
168
+
169
+ - e147271: fix: improve stability
170
+ - Updated dependencies [e147271]
171
+ - @contractspec/lib.contracts@1.43.2
172
+ - @contractspec/lib.schema@1.43.1
173
+
174
+ ## 1.43.1
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [f28fdad]
179
+ - @contractspec/lib.contracts@1.43.1
180
+
181
+ ## 1.43.0
182
+
183
+ ### Minor Changes
184
+
185
+ - 042d072: feat: schema declaration using json schema, including zod
186
+
187
+ ### Patch Changes
188
+
189
+ - Updated dependencies [042d072]
190
+ - @contractspec/lib.contracts@1.43.0
191
+ - @contractspec/lib.schema@1.43.0
192
+
193
+ ## 1.42.10
194
+
195
+ ### Patch Changes
196
+
197
+ - 1e6a0f1: fix: mcp server
198
+ - Updated dependencies [1e6a0f1]
199
+ - @contractspec/lib.contracts@1.42.10
200
+ - @contractspec/lib.schema@1.42.10
201
+
202
+ ## 1.42.9
203
+
204
+ ### Patch Changes
205
+
206
+ - 9281db7: fix ModelRegistry
207
+ - Updated dependencies [9281db7]
208
+ - @contractspec/lib.contracts@1.42.9
209
+ - @contractspec/lib.schema@1.42.9
210
+
211
+ ## 1.42.8
212
+
213
+ ### Patch Changes
214
+
215
+ - e07b5ac: fix
216
+ - Updated dependencies [e07b5ac]
217
+ - @contractspec/lib.contracts@1.42.8
218
+ - @contractspec/lib.schema@1.42.8
219
+
220
+ ## 1.42.7
221
+
222
+ ### Patch Changes
223
+
224
+ - e9b575d: fix release
225
+ - Updated dependencies [e9b575d]
226
+ - @contractspec/lib.contracts@1.42.7
227
+ - @contractspec/lib.schema@1.42.7
228
+
229
+ ## 1.42.6
230
+
231
+ ### Patch Changes
232
+
233
+ - 1500242: fix tooling
234
+ - Updated dependencies [1500242]
235
+ - @contractspec/lib.contracts@1.42.6
236
+ - @contractspec/lib.schema@1.42.6
237
+
238
+ ## 1.42.5
239
+
240
+ ### Patch Changes
241
+
242
+ - 1299719: fix vscode
243
+ - Updated dependencies [1299719]
244
+ - @contractspec/lib.contracts@1.42.5
245
+ - @contractspec/lib.schema@1.42.5
246
+
247
+ ## 1.42.4
248
+
249
+ ### Patch Changes
250
+
251
+ - ac28b99: fix: generate from openapi
252
+ - Updated dependencies [ac28b99]
253
+ - @contractspec/lib.contracts@1.42.4
254
+ - @contractspec/lib.schema@1.42.4
255
+
256
+ ## 1.42.3
257
+
258
+ ### Patch Changes
259
+
260
+ - 3f5d015: fix(tooling): cicd
261
+ - Updated dependencies [3f5d015]
262
+ - @contractspec/lib.contracts@1.42.3
263
+ - @contractspec/lib.schema@1.42.3
264
+
265
+ ## 1.42.2
266
+
267
+ ### Patch Changes
268
+
269
+ - 1f9ac4c: fix
270
+ - Updated dependencies [1f9ac4c]
271
+ - @contractspec/lib.contracts@1.42.2
272
+ - @contractspec/lib.schema@1.42.2
273
+
274
+ ## 1.42.1
275
+
276
+ ### Patch Changes
277
+
278
+ - f043995: Fix release
279
+ - Updated dependencies [f043995]
280
+ - @contractspec/lib.contracts@1.42.1
281
+ - @contractspec/lib.schema@1.42.1
282
+
283
+ ## 1.42.0
284
+
285
+ ### Minor Changes
286
+
287
+ - 8eefd9c: initial release
288
+
289
+ ### Patch Changes
290
+
291
+ - Updated dependencies [8eefd9c]
292
+ - @contractspec/lib.contracts@1.42.0
293
+ - @contractspec/lib.schema@1.42.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,41 @@
1
+ ## Lifecycle Dashboard Example (Next.js)
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ This example shows a minimal App Router page that calls the lifecycle managed bundle via `/api/lifecycle/*` routes and renders a mobile-friendly status card.
7
+
8
+ ### Structure
9
+
10
+ - `app/page.tsx` – client component with tabs for Stage, Actions, Libraries.
11
+ - Expected API routes:
12
+ - `POST /api/lifecycle/assessments` → proxies to `LifecycleAssessmentService.runAssessment`
13
+ - `GET /api/lifecycle/playbooks/:stage` → proxies to `service.getStagePlaybook`
14
+
15
+ ### Run
16
+
17
+ ```bash
18
+ cd packages/examples/lifecycle-dashboard
19
+ bunx next dev
20
+ ```
21
+
22
+ Make sure you register the API routes in your actual Next.js app; the page assumes they exist.
23
+
24
+ This example is now packaged as `@contractspec/example.lifecycle-dashboard` and ships the page as a deterministic snippet:
25
+ - `@contractspec/example.lifecycle-dashboard/snippets/page`
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+
35
+
36
+
37
+
38
+
39
+
40
+
41
+
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./lifecycle-dashboard.docblock.js";
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,20 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/lifecycle-dashboard.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.lifecycle-dashboard",
6
+ title: "Lifecycle Dashboard (example snippet)",
7
+ summary: "Minimal dashboard page pattern that calls lifecycle-managed API routes and renders a status card.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/lifecycle-dashboard",
11
+ tags: [
12
+ "lifecycle",
13
+ "dashboard",
14
+ "example"
15
+ ],
16
+ body: `## What this example shows\n- A simple client-driven fetch to \`POST /api/lifecycle/assessments\`.\n- A card-shaped UI pattern for stage + confidence + recommendations.\n\n## Notes\n- Keep your app design-system-first (no raw HTML in application code).\n- Add explicit loading/error/empty states with accessible messaging.\n- Implement API routes in your app as thin adapters over lifecycle-managed services.`
17
+ }]);
18
+
19
+ //#endregion
20
+ //# sourceMappingURL=lifecycle-dashboard.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lifecycle-dashboard.docblock.js","names":[],"sources":["../../src/docs/lifecycle-dashboard.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.lifecycle-dashboard',\n title: 'Lifecycle Dashboard (example snippet)',\n summary:\n 'Minimal dashboard page pattern that calls lifecycle-managed API routes and renders a status card.',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/lifecycle-dashboard',\n tags: ['lifecycle', 'dashboard', 'example'],\n body: `## What this example shows\\n- A simple client-driven fetch to \\`POST /api/lifecycle/assessments\\`.\\n- A card-shaped UI pattern for stage + confidence + recommendations.\\n\\n## Notes\\n- Keep your app design-system-first (no raw HTML in application code).\\n- Add explicit loading/error/empty states with accessible messaging.\\n- Implement API routes in your app as thin adapters over lifecycle-managed services.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AAiBA,kBAd2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAa;EAAa;EAAU;CAC3C,MAAM;CACP,CACF,CAEwB"}
@@ -0,0 +1,7 @@
1
+ import * as _contractspec_lib_contracts0 from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.d.ts
4
+ declare const example: _contractspec_lib_contracts0.ExampleSpec;
5
+ //#endregion
6
+ export { example as default };
7
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";;;cAEM,SA0BJ,4BAAA,CA1BW"}
@@ -0,0 +1,43 @@
1
+ import { defineExample } from "@contractspec/lib.contracts";
2
+
3
+ //#region src/example.ts
4
+ const example = defineExample({
5
+ meta: {
6
+ key: "lifecycle-dashboard",
7
+ version: "1.0.0",
8
+ title: "Lifecycle Dashboard (snippet)",
9
+ description: "A minimal dashboard page pattern: call lifecycle-managed endpoints and render a mobile-friendly status card.",
10
+ kind: "blueprint",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: [
15
+ "lifecycle",
16
+ "dashboard",
17
+ "nextjs",
18
+ "snippet"
19
+ ]
20
+ },
21
+ docs: { rootDocId: "docs.examples.lifecycle-dashboard" },
22
+ entrypoints: {
23
+ packageName: "@contractspec/example.lifecycle-dashboard",
24
+ docs: "./docs"
25
+ },
26
+ surfaces: {
27
+ templates: true,
28
+ sandbox: {
29
+ enabled: true,
30
+ modes: ["markdown", "specs"]
31
+ },
32
+ studio: {
33
+ enabled: true,
34
+ installable: true
35
+ },
36
+ mcp: { enabled: true }
37
+ }
38
+ });
39
+ var example_default = example;
40
+
41
+ //#endregion
42
+ export { example_default as default };
43
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["import { defineExample } from '@contractspec/lib.contracts';\n\nconst example = defineExample({\n meta: {\n key: 'lifecycle-dashboard',\n version: '1.0.0',\n title: 'Lifecycle Dashboard (snippet)',\n description:\n 'A minimal dashboard page pattern: call lifecycle-managed endpoints and render a mobile-friendly status card.',\n kind: 'blueprint',\n visibility: 'public',\n stability: 'experimental',\n owners: ['@platform.core'],\n tags: ['lifecycle', 'dashboard', 'nextjs', 'snippet'],\n },\n docs: {\n rootDocId: 'docs.examples.lifecycle-dashboard',\n },\n entrypoints: {\n packageName: '@contractspec/example.lifecycle-dashboard',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown', 'specs'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n});\n\nexport default example;\n"],"mappings":";;;AAEA,MAAM,UAAU,cAAc;CAC5B,MAAM;EACJ,KAAK;EACL,SAAS;EACT,OAAO;EACP,aACE;EACF,MAAM;EACN,YAAY;EACZ,WAAW;EACX,QAAQ,CAAC,iBAAiB;EAC1B,MAAM;GAAC;GAAa;GAAa;GAAU;GAAU;EACtD;CACD,MAAM,EACJ,WAAW,qCACZ;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,YAAY,QAAQ;GAAE;EACxD,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF,CAAC;AAEF,sBAAe"}
@@ -0,0 +1,3 @@
1
+ import example from "./example.js";
2
+ import { lifecycleDashboardNextPageSnippet } from "./snippets/page.js";
3
+ export { example, lifecycleDashboardNextPageSnippet };
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import example_default from "./example.js";
2
+ import { lifecycleDashboardNextPageSnippet } from "./snippets/page.js";
3
+ import "./docs/index.js";
4
+
5
+ export { example_default as example, lifecycleDashboardNextPageSnippet };
@@ -0,0 +1,11 @@
1
+ //#region src/snippets/page.d.ts
2
+ /**
3
+ * Deterministic snippet for a Next.js App Router page.
4
+ *
5
+ * We keep this as a string so `packages/examples/*` stays design-system-first and
6
+ * avoids raw HTML in runnable application code.
7
+ */
8
+ declare const lifecycleDashboardNextPageSnippet = "'use client';\n\nimport { useEffect, useState } from 'react';\n\ntype StageCard = {\n stage: number;\n name: string;\n confidence: number;\n recommendation?: {\n actions: { id: string; title: string; description: string }[];\n };\n libraries?: { id: string; description: string }[];\n};\n\nexport default function LifecycleDashboardPage() {\n const [card, setCard] = useState<StageCard | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string>();\n\n useEffect(() => {\n void runAssessment();\n }, []);\n\n async function runAssessment() {\n try {\n setLoading(true);\n setError(undefined);\n const response = await fetch('/api/lifecycle/assessments', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ tenantId: 'demo' }),\n });\n if (!response.ok) throw new Error('Failed assessment');\n const data = await response.json();\n setCard({\n stage: data.assessment.stage,\n name: data.assessment.stageName ?? `Stage ${data.assessment.stage}`,\n confidence: data.assessment.confidence,\n recommendation: data.recommendation,\n libraries: data.libraries,\n });\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Unknown error');\n } finally {\n setLoading(false);\n }\n }\n\n // Render using your app's design system components in real code.\n return null;\n}\n";
9
+ //#endregion
10
+ export { lifecycleDashboardNextPageSnippet };
11
+ //# sourceMappingURL=page.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.d.ts","names":[],"sources":["../../src/snippets/page.ts"],"sourcesContent":[],"mappings":";;AAMA;;;;;cAAa,iCAAA"}
@@ -0,0 +1,63 @@
1
+ //#region src/snippets/page.ts
2
+ /**
3
+ * Deterministic snippet for a Next.js App Router page.
4
+ *
5
+ * We keep this as a string so `packages/examples/*` stays design-system-first and
6
+ * avoids raw HTML in runnable application code.
7
+ */
8
+ const lifecycleDashboardNextPageSnippet = `'use client';
9
+
10
+ import { useEffect, useState } from 'react';
11
+
12
+ type StageCard = {
13
+ stage: number;
14
+ name: string;
15
+ confidence: number;
16
+ recommendation?: {
17
+ actions: { id: string; title: string; description: string }[];
18
+ };
19
+ libraries?: { id: string; description: string }[];
20
+ };
21
+
22
+ export default function LifecycleDashboardPage() {
23
+ const [card, setCard] = useState<StageCard | null>(null);
24
+ const [loading, setLoading] = useState(false);
25
+ const [error, setError] = useState<string>();
26
+
27
+ useEffect(() => {
28
+ void runAssessment();
29
+ }, []);
30
+
31
+ async function runAssessment() {
32
+ try {
33
+ setLoading(true);
34
+ setError(undefined);
35
+ const response = await fetch('/api/lifecycle/assessments', {
36
+ method: 'POST',
37
+ headers: { 'Content-Type': 'application/json' },
38
+ body: JSON.stringify({ tenantId: 'demo' }),
39
+ });
40
+ if (!response.ok) throw new Error('Failed assessment');
41
+ const data = await response.json();
42
+ setCard({
43
+ stage: data.assessment.stage,
44
+ name: data.assessment.stageName ?? \`Stage \${data.assessment.stage}\`,
45
+ confidence: data.assessment.confidence,
46
+ recommendation: data.recommendation,
47
+ libraries: data.libraries,
48
+ });
49
+ } catch (err) {
50
+ setError(err instanceof Error ? err.message : 'Unknown error');
51
+ } finally {
52
+ setLoading(false);
53
+ }
54
+ }
55
+
56
+ // Render using your app's design system components in real code.
57
+ return null;
58
+ }
59
+ `;
60
+
61
+ //#endregion
62
+ export { lifecycleDashboardNextPageSnippet };
63
+ //# sourceMappingURL=page.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"page.js","names":[],"sources":["../../src/snippets/page.ts"],"sourcesContent":["/**\n * Deterministic snippet for a Next.js App Router page.\n *\n * We keep this as a string so `packages/examples/*` stays design-system-first and\n * avoids raw HTML in runnable application code.\n */\nexport const lifecycleDashboardNextPageSnippet = `'use client';\n\nimport { useEffect, useState } from 'react';\n\ntype StageCard = {\n stage: number;\n name: string;\n confidence: number;\n recommendation?: {\n actions: { id: string; title: string; description: string }[];\n };\n libraries?: { id: string; description: string }[];\n};\n\nexport default function LifecycleDashboardPage() {\n const [card, setCard] = useState<StageCard | null>(null);\n const [loading, setLoading] = useState(false);\n const [error, setError] = useState<string>();\n\n useEffect(() => {\n void runAssessment();\n }, []);\n\n async function runAssessment() {\n try {\n setLoading(true);\n setError(undefined);\n const response = await fetch('/api/lifecycle/assessments', {\n method: 'POST',\n headers: { 'Content-Type': 'application/json' },\n body: JSON.stringify({ tenantId: 'demo' }),\n });\n if (!response.ok) throw new Error('Failed assessment');\n const data = await response.json();\n setCard({\n stage: data.assessment.stage,\n name: data.assessment.stageName ?? \\`Stage \\${data.assessment.stage}\\`,\n confidence: data.assessment.confidence,\n recommendation: data.recommendation,\n libraries: data.libraries,\n });\n } catch (err) {\n setError(err instanceof Error ? err.message : 'Unknown error');\n } finally {\n setLoading(false);\n }\n }\n\n // Render using your app's design system components in real code.\n return null;\n}\n`;\n"],"mappings":";;;;;;;AAMA,MAAa,oCAAoC"}
package/example.ts ADDED
@@ -0,0 +1 @@
1
+ export { default } from './src/example';
package/package.json ADDED
@@ -0,0 +1,56 @@
1
+ {
2
+ "name": "@contractspec/example.lifecycle-dashboard",
3
+ "version": "0.0.0-canary-20260113162409",
4
+ "description": "Lifecycle dashboard example (snippet): how to call lifecycle-managed APIs and render a status card.",
5
+ "type": "module",
6
+ "types": "./dist/index.d.ts",
7
+ "exports": {
8
+ ".": "./dist/index.js",
9
+ "./docs": "./dist/docs/index.js",
10
+ "./docs/lifecycle-dashboard.docblock": "./dist/docs/lifecycle-dashboard.docblock.js",
11
+ "./example": "./dist/example.js",
12
+ "./snippets/page": "./dist/snippets/page.js",
13
+ "./*": "./*"
14
+ },
15
+ "scripts": {
16
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
17
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
18
+ "build": "bun build:types && bun build:bundle",
19
+ "build:bundle": "tsdown",
20
+ "build:types": "tsc --noEmit",
21
+ "dev": "bun build:bundle --watch",
22
+ "clean": "rimraf dist .turbo",
23
+ "lint": "bun lint:fix",
24
+ "lint:fix": "eslint src --fix",
25
+ "lint:check": "eslint src",
26
+ "test": "bun test"
27
+ },
28
+ "dependencies": {
29
+ "@contractspec/lib.contracts": "0.0.0-canary-20260113162409"
30
+ },
31
+ "devDependencies": {
32
+ "@contractspec/tool.tsdown": "0.0.0-canary-20260113162409",
33
+ "@contractspec/tool.typescript": "0.0.0-canary-20260113162409",
34
+ "tsdown": "^0.19.0",
35
+ "typescript": "^5.9.3"
36
+ },
37
+ "publishConfig": {
38
+ "access": "public",
39
+ "exports": {
40
+ ".": "./dist/index.js",
41
+ "./docs": "./dist/docs/index.js",
42
+ "./docs/lifecycle-dashboard.docblock": "./dist/docs/lifecycle-dashboard.docblock.js",
43
+ "./example": "./dist/example.js",
44
+ "./snippets/page": "./dist/snippets/page.js",
45
+ "./*": "./*"
46
+ },
47
+ "registry": "https://registry.npmjs.org/"
48
+ },
49
+ "license": "MIT",
50
+ "repository": {
51
+ "type": "git",
52
+ "url": "https://github.com/lssm-tech/contractspec.git",
53
+ "directory": "packages/examples/lifecycle-dashboard"
54
+ },
55
+ "homepage": "https://contractspec.io"
56
+ }
@@ -0,0 +1 @@
1
+ import './lifecycle-dashboard.docblock';