@contractspec/example.lifecycle-dashboard 1.57.0 → 1.59.0

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,22 @@
1
+ // src/docs/lifecycle-dashboard.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
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: ["lifecycle", "dashboard", "example"],
12
+ body: `## What this example shows
13
+ - A simple client-driven fetch to \`POST /api/lifecycle/assessments\`.
14
+ - A card-shaped UI pattern for stage + confidence + recommendations.
15
+
16
+ ## Notes
17
+ - Keep your app design-system-first (no raw HTML in application code).
18
+ - Add explicit loading/error/empty states with accessible messaging.
19
+ - Implement API routes in your app as thin adapters over lifecycle-managed services.`
20
+ }
21
+ ];
22
+ registerDocBlocks(blocks);
@@ -0,0 +1,22 @@
1
+ // src/docs/lifecycle-dashboard.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
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: ["lifecycle", "dashboard", "example"],
12
+ body: `## What this example shows
13
+ - A simple client-driven fetch to \`POST /api/lifecycle/assessments\`.
14
+ - A card-shaped UI pattern for stage + confidence + recommendations.
15
+
16
+ ## Notes
17
+ - Keep your app design-system-first (no raw HTML in application code).
18
+ - Add explicit loading/error/empty states with accessible messaging.
19
+ - Implement API routes in your app as thin adapters over lifecycle-managed services.`
20
+ }
21
+ ];
22
+ registerDocBlocks(blocks);
@@ -0,0 +1,32 @@
1
+ // src/example.ts
2
+ import { defineExample } from "@contractspec/lib.contracts";
3
+ var example = defineExample({
4
+ meta: {
5
+ key: "lifecycle-dashboard",
6
+ version: "1.0.0",
7
+ title: "Lifecycle Dashboard (snippet)",
8
+ description: "A minimal dashboard page pattern: call lifecycle-managed endpoints and render a mobile-friendly status card.",
9
+ kind: "blueprint",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["lifecycle", "dashboard", "nextjs", "snippet"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.lifecycle-dashboard"
17
+ },
18
+ entrypoints: {
19
+ packageName: "@contractspec/example.lifecycle-dashboard",
20
+ docs: "./docs"
21
+ },
22
+ surfaces: {
23
+ templates: true,
24
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
25
+ studio: { enabled: true, installable: true },
26
+ mcp: { enabled: true }
27
+ }
28
+ });
29
+ var example_default = example;
30
+ export {
31
+ example_default as default
32
+ };
@@ -0,0 +1,109 @@
1
+ // src/docs/lifecycle-dashboard.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
3
+ var blocks = [
4
+ {
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: ["lifecycle", "dashboard", "example"],
12
+ body: `## What this example shows
13
+ - A simple client-driven fetch to \`POST /api/lifecycle/assessments\`.
14
+ - A card-shaped UI pattern for stage + confidence + recommendations.
15
+
16
+ ## Notes
17
+ - Keep your app design-system-first (no raw HTML in application code).
18
+ - Add explicit loading/error/empty states with accessible messaging.
19
+ - Implement API routes in your app as thin adapters over lifecycle-managed services.`
20
+ }
21
+ ];
22
+ registerDocBlocks(blocks);
23
+ // src/example.ts
24
+ import { defineExample } from "@contractspec/lib.contracts";
25
+ var example = defineExample({
26
+ meta: {
27
+ key: "lifecycle-dashboard",
28
+ version: "1.0.0",
29
+ title: "Lifecycle Dashboard (snippet)",
30
+ description: "A minimal dashboard page pattern: call lifecycle-managed endpoints and render a mobile-friendly status card.",
31
+ kind: "blueprint",
32
+ visibility: "public",
33
+ stability: "experimental",
34
+ owners: ["@platform.core"],
35
+ tags: ["lifecycle", "dashboard", "nextjs", "snippet"]
36
+ },
37
+ docs: {
38
+ rootDocId: "docs.examples.lifecycle-dashboard"
39
+ },
40
+ entrypoints: {
41
+ packageName: "@contractspec/example.lifecycle-dashboard",
42
+ docs: "./docs"
43
+ },
44
+ surfaces: {
45
+ templates: true,
46
+ sandbox: { enabled: true, modes: ["markdown", "specs"] },
47
+ studio: { enabled: true, installable: true },
48
+ mcp: { enabled: true }
49
+ }
50
+ });
51
+ var example_default = example;
52
+
53
+ // src/snippets/page.ts
54
+ var lifecycleDashboardNextPageSnippet = `'use client';
55
+
56
+ import { useEffect, useState } from 'react';
57
+
58
+ type StageCard = {
59
+ stage: number;
60
+ name: string;
61
+ confidence: number;
62
+ recommendation?: {
63
+ actions: { id: string; title: string; description: string }[];
64
+ };
65
+ libraries?: { id: string; description: string }[];
66
+ };
67
+
68
+ export default function LifecycleDashboardPage() {
69
+ const [card, setCard] = useState<StageCard | null>(null);
70
+ const [loading, setLoading] = useState(false);
71
+ const [error, setError] = useState<string>();
72
+
73
+ useEffect(() => {
74
+ void runAssessment();
75
+ }, []);
76
+
77
+ async function runAssessment() {
78
+ try {
79
+ setLoading(true);
80
+ setError(undefined);
81
+ const response = await fetch('/api/lifecycle/assessments', {
82
+ method: 'POST',
83
+ headers: { 'Content-Type': 'application/json' },
84
+ body: JSON.stringify({ tenantId: 'demo' }),
85
+ });
86
+ if (!response.ok) throw new Error('Failed assessment');
87
+ const data = await response.json();
88
+ setCard({
89
+ stage: data.assessment.stage,
90
+ name: data.assessment.stageName ?? \`Stage \${data.assessment.stage}\`,
91
+ confidence: data.assessment.confidence,
92
+ recommendation: data.recommendation,
93
+ libraries: data.libraries,
94
+ });
95
+ } catch (err) {
96
+ setError(err instanceof Error ? err.message : 'Unknown error');
97
+ } finally {
98
+ setLoading(false);
99
+ }
100
+ }
101
+
102
+ // Render using your app's design system components in real code.
103
+ return null;
104
+ }
105
+ `;
106
+ export {
107
+ lifecycleDashboardNextPageSnippet,
108
+ example_default as example
109
+ };
@@ -0,0 +1,56 @@
1
+ // src/snippets/page.ts
2
+ var lifecycleDashboardNextPageSnippet = `'use client';
3
+
4
+ import { useEffect, useState } from 'react';
5
+
6
+ type StageCard = {
7
+ stage: number;
8
+ name: string;
9
+ confidence: number;
10
+ recommendation?: {
11
+ actions: { id: string; title: string; description: string }[];
12
+ };
13
+ libraries?: { id: string; description: string }[];
14
+ };
15
+
16
+ export default function LifecycleDashboardPage() {
17
+ const [card, setCard] = useState<StageCard | null>(null);
18
+ const [loading, setLoading] = useState(false);
19
+ const [error, setError] = useState<string>();
20
+
21
+ useEffect(() => {
22
+ void runAssessment();
23
+ }, []);
24
+
25
+ async function runAssessment() {
26
+ try {
27
+ setLoading(true);
28
+ setError(undefined);
29
+ const response = await fetch('/api/lifecycle/assessments', {
30
+ method: 'POST',
31
+ headers: { 'Content-Type': 'application/json' },
32
+ body: JSON.stringify({ tenantId: 'demo' }),
33
+ });
34
+ if (!response.ok) throw new Error('Failed assessment');
35
+ const data = await response.json();
36
+ setCard({
37
+ stage: data.assessment.stage,
38
+ name: data.assessment.stageName ?? \`Stage \${data.assessment.stage}\`,
39
+ confidence: data.assessment.confidence,
40
+ recommendation: data.recommendation,
41
+ libraries: data.libraries,
42
+ });
43
+ } catch (err) {
44
+ setError(err instanceof Error ? err.message : 'Unknown error');
45
+ } finally {
46
+ setLoading(false);
47
+ }
48
+ }
49
+
50
+ // Render using your app's design system components in real code.
51
+ return null;
52
+ }
53
+ `;
54
+ export {
55
+ lifecycleDashboardNextPageSnippet
56
+ };
@@ -1,11 +1,8 @@
1
- //#region src/snippets/page.d.ts
2
1
  /**
3
2
  * Deterministic snippet for a Next.js App Router page.
4
3
  *
5
4
  * We keep this as a string so `packages/examples/*` stays design-system-first and
6
5
  * avoids raw HTML in runnable application code.
7
6
  */
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 };
7
+ export 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";
11
8
  //# sourceMappingURL=page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.d.ts","names":[],"sources":["../../src/snippets/page.ts"],"mappings":";;AAMA;;;;;cAAa,iCAAA"}
1
+ {"version":3,"file":"page.d.ts","sourceRoot":"","sources":["../../src/snippets/page.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,eAAO,MAAM,iCAAiC,y+CAmD7C,CAAC"}
@@ -1,11 +1,6 @@
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';
1
+ // @bun
2
+ // src/snippets/page.ts
3
+ var lifecycleDashboardNextPageSnippet = `'use client';
9
4
 
10
5
  import { useEffect, useState } from 'react';
11
6
 
@@ -57,7 +52,6 @@ export default function LifecycleDashboardPage() {
57
52
  return null;
58
53
  }
59
54
  `;
60
-
61
- //#endregion
62
- export { lifecycleDashboardNextPageSnippet };
63
- //# sourceMappingURL=page.js.map
55
+ export {
56
+ lifecycleDashboardNextPageSnippet
57
+ };
package/package.json CHANGED
@@ -1,48 +1,85 @@
1
1
  {
2
2
  "name": "@contractspec/example.lifecycle-dashboard",
3
- "version": "1.57.0",
3
+ "version": "1.59.0",
4
4
  "description": "Lifecycle dashboard example (snippet): how to call lifecycle-managed APIs and render a status card.",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
7
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
- "./*": "./*"
8
+ ".": "./src/index.ts",
9
+ "./docs": "./src/docs/index.ts",
10
+ "./docs/index": "./src/docs/index.ts",
11
+ "./docs/lifecycle-dashboard.docblock": "./src/docs/lifecycle-dashboard.docblock.ts",
12
+ "./example": "./src/example.ts",
13
+ "./snippets/page": "./src/snippets/page.ts"
14
14
  },
15
15
  "scripts": {
16
16
  "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
17
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",
18
+ "build": "bun run prebuild && bun run build:bundle && bun run build:types",
19
+ "build:bundle": "contractspec-bun-build transpile",
20
+ "build:types": "contractspec-bun-build types",
21
+ "dev": "contractspec-bun-build dev",
22
22
  "clean": "rimraf dist .turbo",
23
23
  "lint": "bun lint:fix",
24
24
  "lint:fix": "eslint src --fix",
25
25
  "lint:check": "eslint src",
26
- "test": "bun test"
26
+ "test": "bun test",
27
+ "prebuild": "contractspec-bun-build prebuild",
28
+ "typecheck": "tsc --noEmit"
27
29
  },
28
30
  "dependencies": {
29
- "@contractspec/lib.contracts": "1.57.0"
31
+ "@contractspec/lib.contracts": "1.59.0"
30
32
  },
31
33
  "devDependencies": {
32
- "@contractspec/tool.tsdown": "1.57.0",
33
- "@contractspec/tool.typescript": "1.57.0",
34
- "tsdown": "^0.20.3",
35
- "typescript": "^5.9.3"
34
+ "@contractspec/tool.typescript": "1.59.0",
35
+ "typescript": "^5.9.3",
36
+ "@contractspec/tool.bun": "1.58.0"
36
37
  },
37
38
  "publishConfig": {
38
39
  "access": "public",
39
40
  "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
- "./*": "./*"
41
+ ".": {
42
+ "types": "./dist/index.d.ts",
43
+ "bun": "./dist/index.js",
44
+ "node": "./dist/node/index.mjs",
45
+ "browser": "./dist/browser/index.js",
46
+ "default": "./dist/index.js"
47
+ },
48
+ "./docs": {
49
+ "types": "./dist/docs/index.d.ts",
50
+ "bun": "./dist/docs/index.js",
51
+ "node": "./dist/node/docs/index.mjs",
52
+ "browser": "./dist/browser/docs/index.js",
53
+ "default": "./dist/docs/index.js"
54
+ },
55
+ "./docs/index": {
56
+ "types": "./dist/docs/index.d.ts",
57
+ "bun": "./dist/docs/index.js",
58
+ "node": "./dist/node/docs/index.mjs",
59
+ "browser": "./dist/browser/docs/index.js",
60
+ "default": "./dist/docs/index.js"
61
+ },
62
+ "./docs/lifecycle-dashboard.docblock": {
63
+ "types": "./dist/docs/lifecycle-dashboard.docblock.d.ts",
64
+ "bun": "./dist/docs/lifecycle-dashboard.docblock.js",
65
+ "node": "./dist/node/docs/lifecycle-dashboard.docblock.mjs",
66
+ "browser": "./dist/browser/docs/lifecycle-dashboard.docblock.js",
67
+ "default": "./dist/docs/lifecycle-dashboard.docblock.js"
68
+ },
69
+ "./example": {
70
+ "types": "./dist/example.d.ts",
71
+ "bun": "./dist/example.js",
72
+ "node": "./dist/node/example.mjs",
73
+ "browser": "./dist/browser/example.js",
74
+ "default": "./dist/example.js"
75
+ },
76
+ "./snippets/page": {
77
+ "types": "./dist/snippets/page.d.ts",
78
+ "bun": "./dist/snippets/page.js",
79
+ "node": "./dist/node/snippets/page.mjs",
80
+ "browser": "./dist/browser/snippets/page.js",
81
+ "default": "./dist/snippets/page.js"
82
+ }
46
83
  },
47
84
  "registry": "https://registry.npmjs.org/"
48
85
  },
package/tsdown.config.js CHANGED
@@ -1,5 +1,4 @@
1
- import { defineConfig } from 'tsdown';
2
- import { moduleLibrary } from '@contractspec/tool.tsdown';
1
+ import { defineConfig, moduleLibrary } from '@contractspec/tool.bun';
3
2
 
4
3
  export default defineConfig(() => ({
5
4
  ...moduleLibrary,
@@ -1,30 +0,0 @@
1
- $ tsdown
2
- ℹ tsdown v0.20.3 powered by rolldown v1.0.0-rc.3
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/docs/lifecycle-dashboard.docblock.js 0.98 kB │ gzip: 0.56 kB
11
- ℹ dist/example.js 0.95 kB │ gzip: 0.52 kB
12
- ℹ dist/index.js 0.19 kB │ gzip: 0.13 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.41 kB │ gzip: 0.71 kB
16
- ℹ dist/docs/lifecycle-dashboard.docblock.js.map 1.32 kB │ gzip: 0.72 kB
17
- ℹ dist/example.d.ts.map 0.13 kB │ gzip: 0.13 kB
18
- ℹ dist/snippets/page.d.ts.map 0.12 kB │ gzip: 0.12 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.20 kB
25
- [PLUGIN_TIMINGS] Warning: Your build spent significant time in plugins. Here is a breakdown:
26
- - rolldown-plugin-dts:generate (59%)
27
- - tsdown:external (40%)
28
- See https://rolldown.rs/options/checks#plugintimings for more details.
29
-
30
- ✔ Build complete in 21576ms
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}
@@ -1 +0,0 @@
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"}