@contractspec/bundle.library 3.9.7 → 3.9.8
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 +144 -140
- package/CHANGELOG.md +44 -0
- package/dist/components/docs/DocsIndexPage.js +1 -1
- package/dist/components/docs/docsManifest.js +1 -1
- package/dist/components/docs/getting-started/DataViewTutorialPage.js +40 -4
- package/dist/components/docs/getting-started/index.js +46 -10
- package/dist/components/docs/index.js +493 -268
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts +16 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.js +148 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.d.ts +1 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.js +148 -0
- package/dist/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
- package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
- package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/components/docs/libraries/index.d.ts +1 -0
- package/dist/components/docs/libraries/index.js +217 -64
- package/dist/components/docs/specs/SpecsDataViewsPage.js +37 -1
- package/dist/components/docs/specs/index.js +37 -1
- package/dist/index.js +503 -278
- package/dist/node/components/docs/DocsIndexPage.js +1 -1
- package/dist/node/components/docs/docsManifest.js +1 -1
- package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +40 -4
- package/dist/node/components/docs/getting-started/index.js +46 -10
- package/dist/node/components/docs/index.js +493 -268
- package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js +147 -0
- package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.js +147 -0
- package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
- package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
- package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/node/components/docs/libraries/index.js +217 -64
- package/dist/node/components/docs/specs/SpecsDataViewsPage.js +37 -1
- package/dist/node/components/docs/specs/index.js +37 -1
- package/dist/node/index.js +503 -278
- package/package.json +47 -23
- package/src/components/docs/docsManifest.ts +10 -0
- package/src/components/docs/getting-started/DataViewTutorialPage.tsx +40 -1
- package/src/components/docs/libraries/LibrariesApplicationShellPage.content.ts +170 -0
- package/src/components/docs/libraries/LibrariesApplicationShellPage.tsx +112 -0
- package/src/components/docs/libraries/LibrariesDataViewsPage.tsx +26 -5
- package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +9 -0
- package/src/components/docs/libraries/LibrariesOverviewPage.tsx +6 -0
- package/src/components/docs/libraries/index.ts +1 -0
- package/src/components/docs/specs/SpecsDataViewsPage.tsx +39 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var
|
|
2
|
+
var M=Object.defineProperty;var q=(h)=>h;function H(h,n){this[h]=q.bind(null,n)}var ve=(h,n)=>{for(var g in n)M(h,g,{get:n[g],enumerable:!0,configurable:!0,set:H.bind(n,g)})};var ye=(h,n)=>()=>(h&&(n=h(h=0)),n);import{CodeBlock as w,InstallCommand as F}from"@contractspec/lib.design-system";import V from"@contractspec/lib.ui-link";import{ChevronRight as U}from"lucide-react";import{jsx as a,jsxs as s}from"react/jsx-runtime";function W(){return s("div",{className:"space-y-8",children:[s("div",{className:"space-y-2",children:[a("h1",{className:"font-bold text-4xl",children:"ContractSpec CLI"}),a("p",{className:"text-lg text-muted-foreground",children:"Command-line interface for creating, building, and validating contract specifications with AI-powered code generation."})]}),s("div",{className:"space-y-6",children:[s("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Installation"}),a(F,{package:"contractspec",dev:!0})]}),s("div",{className:"space-y-3",children:[a("h2",{className:"font-bold text-2xl",children:"Quick Start"}),a(w,{language:"bash",code:`# Initialize project
|
|
3
3
|
contractspec onboard
|
|
4
4
|
bunx contractspec init
|
|
5
5
|
|
|
@@ -24,7 +24,7 @@ contractspec validate`})]}),s("div",{className:"space-y-4",children:[a("h2",{cla
|
|
|
24
24
|
"operations": "interactions/commands|queries",
|
|
25
25
|
"events": "events"
|
|
26
26
|
}
|
|
27
|
-
}`})]})]}),s("div",{className:"flex items-center gap-4 pt-4",children:[s(V,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",a(
|
|
27
|
+
}`})]})]}),s("div",{className:"flex items-center gap-4 pt-4",children:[s(V,{href:"/docs/getting-started/tools/vscode",className:"btn-primary",children:["Next: VS Code Extension ",a(U,{size:16})]}),a(V,{href:"/docs/getting-started/tools",className:"btn-ghost",children:"Back to Tools"})]})]})}import k from"@contractspec/lib.ui-link";import{ChevronRight as G}from"lucide-react";import{jsx as i,jsxs as p}from"react/jsx-runtime";function Q(){return p("div",{className:"space-y-8",children:[p("div",{className:"space-y-2",children:[i("h1",{className:"font-bold text-4xl",children:"Compatibility"}),i("p",{className:"text-lg text-muted-foreground",children:"Supported runtimes, frameworks, and agent modes for ContractSpec."})]}),p("div",{className:"space-y-6",children:[p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Runtimes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Node.js 20+"}),i("li",{children:"Bun 1.0+"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Frameworks"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"Next.js 14+ (App Router preferred)"}),i("li",{children:"Bun + Elysia or compatible HTTP servers"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Package managers"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"bun (recommended)"}),i("li",{children:"npm"}),i("li",{children:"pnpm"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"AI agent modes"}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"claude-code"}),i("li",{children:"openai-codex"}),i("li",{children:"cursor"}),i("li",{children:"opencode"}),i("li",{children:"simple (direct LLM)"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Datastores"}),i("p",{className:"text-muted-foreground",children:"ContractSpec ships with Prisma-friendly defaults and can integrate with custom adapters for other databases."}),p("ul",{className:"space-y-2 text-muted-foreground",children:[i("li",{children:"PostgreSQL via Prisma"}),i("li",{children:"Custom adapters for other SQL/NoSQL stores"})]})]}),p("div",{className:"card-subtle space-y-3 p-6",children:[i("h2",{className:"font-bold text-2xl",children:"Cross-platform UI architecture"}),p("p",{className:"text-muted-foreground",children:["Need the React and React Native component compatibility story? Read"," ",i(k,{href:"/docs/libraries/cross-platform-ui",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Cross-platform UI"})," ","for the runtime and UI-layer split."]})]})]}),p("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i(k,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),i(k,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),p(k,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",i(G,{size:16})]})]})]})}import{CodeBlock as P}from"@contractspec/lib.design-system";import L from"@contractspec/lib.ui-link";import{ChevronRight as _}from"lucide-react";import{jsx as r,jsxs as b}from"react/jsx-runtime";var J=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
|
|
28
28
|
import { ListTransactions } from './list-transactions';
|
|
29
29
|
|
|
30
30
|
export const TransactionHistory = defineDataView({
|
|
@@ -67,8 +67,44 @@ export const TransactionHistory = defineDataView({
|
|
|
67
67
|
{ key: 'account', label: 'Account', dataPath: 'account', sortable: true },
|
|
68
68
|
{ key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
|
|
69
69
|
{ key: 'status', label: 'Status', dataPath: 'status', sortable: true },
|
|
70
|
+
{
|
|
71
|
+
key: 'amount',
|
|
72
|
+
label: 'Amount',
|
|
73
|
+
dataPath: 'amount',
|
|
74
|
+
sortable: true,
|
|
75
|
+
format: { type: 'currency', currency: 'EUR', rounded: true },
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
key: 'renewalDate',
|
|
79
|
+
label: 'Renewal',
|
|
80
|
+
dataPath: 'renewalDate',
|
|
81
|
+
format: { type: 'date', dateStyle: 'medium' },
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
key: 'processingTime',
|
|
85
|
+
label: 'Processing time',
|
|
86
|
+
dataPath: 'processingMinutes',
|
|
87
|
+
format: { type: 'duration', unit: 'minute', display: 'digital' },
|
|
88
|
+
},
|
|
70
89
|
{ key: 'notes', label: 'Notes', dataPath: 'notes' },
|
|
71
90
|
],
|
|
91
|
+
filters: [
|
|
92
|
+
{ key: 'status', label: 'Status', field: 'status', type: 'enum' },
|
|
93
|
+
{
|
|
94
|
+
key: 'amount',
|
|
95
|
+
label: 'Amount',
|
|
96
|
+
field: 'amount',
|
|
97
|
+
type: 'currency',
|
|
98
|
+
valueMode: 'range',
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'renewalDate',
|
|
102
|
+
label: 'Renewal',
|
|
103
|
+
field: 'renewalDate',
|
|
104
|
+
type: 'date',
|
|
105
|
+
valueMode: 'range',
|
|
106
|
+
},
|
|
107
|
+
],
|
|
72
108
|
},
|
|
73
109
|
});`;function X(){return b("div",{className:"space-y-8",children:[b("div",{className:"space-y-4",children:[r("h1",{className:"font-bold text-4xl",children:"Display Data with DataViews"}),r("p",{className:"text-lg text-muted-foreground",children:"Define a filterable, sortable transaction history view that works across web and mobile without duplicating UI code."})]}),b("div",{className:"space-y-4",children:[r("h2",{className:"font-bold text-2xl",children:"1. Define the underlying query"}),r("p",{className:"text-muted-foreground",children:"First, create a query operation to fetch the data:"}),r(P,{language:"typescript",filename:"lib/specs/billing/list-transactions.ts",code:`import { defineQuery } from '@contractspec/lib.contracts-spec';
|
|
74
110
|
|
|
@@ -108,7 +144,7 @@ export function TransactionsPage() {
|
|
|
108
144
|
/>
|
|
109
145
|
</div>
|
|
110
146
|
);
|
|
111
|
-
}`})]}),b("div",{className:"card-subtle space-y-4 p-6",children:[r("h3",{className:"font-bold",children:"Why DataViews?"}),b("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),r("li",{children:"Filters, sorting, and pagination handled automatically"}),r("li",{children:"Column visibility, pinning, resizing, and row expansion stay contract-driven"}),r("li",{children:"
|
|
147
|
+
}`})]}),b("div",{className:"card-subtle space-y-4 p-6",children:[r("h3",{className:"font-bold",children:"Why DataViews?"}),b("ul",{className:"space-y-2 text-muted-foreground text-sm",children:[r("li",{children:"Same spec renders on web (React) and mobile (React Native)"}),r("li",{children:"Filters, sorting, and pagination handled automatically"}),r("li",{children:"Column visibility, pinning, resizing, and row expansion stay contract-driven"}),r("li",{children:"Typed format rules for numbers, percent values, currency, dates, times, datetimes, and durations applied consistently"}),r("li",{children:"Export to CSV/PDF using the same spec"}),r("li",{children:"A/B test different layouts without touching the backend"})]})]}),b("div",{className:"flex items-center gap-4 pt-4",children:[b(L,{href:"/docs/libraries/data-views",className:"btn-primary",children:["DataView API Reference ",r(_,{size:16})]}),r(L,{href:"/docs/specs/workflows",className:"btn-ghost",children:"Next: Workflows"})]})]})}import{CodeBlock as K,InstallCommand as Y}from"@contractspec/lib.design-system";import T from"@contractspec/lib.ui-link";import{ChevronRight as B,Code2 as $,Cpu as Z,Layers as x,Terminal as j}from"lucide-react";import{jsx as d,jsxs as v}from"react/jsx-runtime";function Me(){return v("div",{className:"space-y-8",children:[v("div",{className:"space-y-2",children:[d("h1",{className:"font-bold text-4xl",children:"Developer Tools"}),d("p",{className:"text-lg text-muted-foreground",children:"Use the OSS toolchain to define contracts, validate changes, inspect generated surfaces, and adopt the system incrementally across different environments."})]}),d("div",{className:"grid gap-6 md:grid-cols-2",children:[{name:"CLI",href:"/docs/getting-started/tools/cli",description:"Command-line interface for spec creation, building, validation, and CI/CD integration.",icon:j,status:"available",highlights:["AI-powered code generation","Multiple agent modes","SARIF/JSON output"]},{name:"VS Code Extension",href:"/docs/getting-started/tools/vscode",description:"Real-time validation, scaffolding, and navigation directly in your editor.",icon:$,status:"available",highlights:["Specs Explorer sidebar","Watch mode","Interactive walkthroughs"]},{name:"ContractSpec Studio",href:"https://www.contractspec.studio",description:"The operating layer on top of OSS ContractSpec for teams that want evidence-backed decisions, workflow automation, and managed delivery loops.",icon:x,status:"available",highlights:["Evidence-to-decision loop","Compiled spec diffs and task packs","Exports to Linear, Jira, Notion, and GitHub"]},{name:"JetBrains Plugin",href:"#",description:"Full ContractSpec support for IntelliJ, WebStorm, and other JetBrains IDEs.",icon:Z,status:"coming-soon",highlights:["Code navigation","Inline validation","Refactoring support"]}].map((n)=>{let g=n.icon,C=n.status==="coming-soon";return v("div",{className:`card-subtle relative space-y-4 p-6 ${C?"opacity-75":""}`,children:[C&&d("span",{className:"absolute -top-2 right-4 rounded-full bg-violet-500/20 px-2 py-0.5 font-medium text-violet-400 text-xs",children:"Coming Soon"}),v("div",{className:"flex items-center gap-3",children:[d("div",{className:"flex h-10 w-10 items-center justify-center rounded-lg bg-violet-500/10",children:d(g,{className:"h-5 w-5 text-violet-400"})}),d("h3",{className:"font-bold text-lg",children:n.name})]}),d("p",{className:"text-muted-foreground text-sm",children:n.description}),d("ul",{className:"space-y-1",children:n.highlights.map((E)=>v("li",{className:"flex items-center gap-2 text-muted-foreground text-sm",children:[d("span",{className:"text-violet-400",children:"-"}),E]},E))}),!C&&v(T,{href:n.href,className:"btn-ghost inline-flex items-center gap-1 text-sm",children:["Learn more ",d(B,{size:14})]})]},n.name)})}),v("div",{className:"card-subtle space-y-4 p-6",children:[d("h3",{className:"font-bold",children:"Quick Install"}),v("div",{className:"space-y-3",children:[v("div",{children:[d("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"CLI"}),d(Y,{package:"contractspec",dev:!0})]}),v("div",{children:[d("p",{className:"mb-2 font-medium text-muted-foreground text-xs",children:"VS Code Extension"}),d(K,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"})]})]})]}),v("div",{className:"flex items-center gap-4 pt-4",children:[v(T,{href:"/docs/getting-started/tools/cli",className:"btn-primary",children:["Get Started with CLI ",d(B,{size:16})]}),d(T,{href:"/docs/getting-started/tools/vscode",className:"btn-ghost",children:"VS Code Extension"})]})]})}import{CodeBlock as S}from"@contractspec/lib.design-system";import ee from"@contractspec/lib.ui-link";import{ChevronRight as te}from"lucide-react";import{jsx as o,jsxs as f}from"react/jsx-runtime";function ae(){return f("div",{className:"space-y-8",children:[f("div",{className:"space-y-2",children:[o("h1",{className:"font-bold text-4xl",children:"Your First Operation"}),o("p",{className:"text-lg text-muted-foreground",children:"Build a payment capture operation with policy enforcement in under 10 minutes."})]}),f("div",{className:"space-y-6",children:[f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"What you'll build"}),o("p",{className:"text-muted-foreground",children:"A real-world payment processing operation that validates input, enforces business rules, integrates with Stripe, and audits every transaction. This is production-ready code, not a toy example."})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"1. Define the operation spec"}),f("p",{className:"text-muted-foreground",children:["Create ",o("code",{children:"lib/specs/billing/capture-payment.ts"}),":"]}),o(S,{language:"typescript",filename:"lib/specs/billing/capture-payment.ts",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
|
|
112
148
|
import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
|
|
113
149
|
|
|
114
150
|
const CapturePaymentInput = new SchemaModel({
|
|
@@ -151,7 +187,7 @@ export const CapturePayment = defineCommand({
|
|
|
151
187
|
{ resource: 'invoice', action: 'pay', condition: 'owner' },
|
|
152
188
|
],
|
|
153
189
|
},
|
|
154
|
-
});`})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"2. Implement the handler"}),f("p",{className:"text-muted-foreground",children:["Create ",o("code",{children:"lib/handlers/billing/capture-payment.ts"}),":"]}),o(
|
|
190
|
+
});`})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"2. Implement the handler"}),f("p",{className:"text-muted-foreground",children:["Create ",o("code",{children:"lib/handlers/billing/capture-payment.ts"}),":"]}),o(S,{language:"typescript",filename:"lib/handlers/billing/capture-payment.ts",code:`import { CapturePayment } from '@/lib/specs/billing/capture-payment';
|
|
155
191
|
import { stripe } from '@/lib/integrations/stripe';
|
|
156
192
|
import { db } from '@/lib/db';
|
|
157
193
|
|
|
@@ -188,12 +224,12 @@ export async function handleCapturePayment(input, ctx) {
|
|
|
188
224
|
status: paymentIntent.status,
|
|
189
225
|
receiptUrl: paymentIntent.charges.data[0]?.receipt_url,
|
|
190
226
|
};
|
|
191
|
-
}`})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"3. Register and serve"}),f("p",{className:"text-muted-foreground",children:["Wire it up in ",o("code",{children:"lib/registry.ts"})," and"," ",o("code",{children:"app/api/ops/[...route]/route.ts"}),":"]}),o(
|
|
227
|
+
}`})]}),f("div",{className:"space-y-3",children:[o("h2",{className:"font-bold text-2xl",children:"3. Register and serve"}),f("p",{className:"text-muted-foreground",children:["Wire it up in ",o("code",{children:"lib/registry.ts"})," and"," ",o("code",{children:"app/api/ops/[...route]/route.ts"}),":"]}),o(S,{language:"typescript",filename:"lib/registry.ts",code:`import { OperationSpecRegistry, installOp } from '@contractspec/lib.contracts-spec';
|
|
192
228
|
import { CapturePayment } from './specs/billing/capture-payment';
|
|
193
229
|
import { handleCapturePayment } from './handlers/billing/capture-payment';
|
|
194
230
|
|
|
195
231
|
export const registry = new OperationSpecRegistry();
|
|
196
|
-
installOp(registry, CapturePayment, handleCapturePayment);`}),o(
|
|
232
|
+
installOp(registry, CapturePayment, handleCapturePayment);`}),o(S,{language:"typescript",filename:"app/api/ops/[...route]/route.ts",code:`import { makeNextAppHandler } from '@contractspec/lib.contracts-runtime-server-rest/rest-next-app';
|
|
197
233
|
import { registry } from '@/lib/registry';
|
|
198
234
|
import { auth } from '@/lib/auth';
|
|
199
235
|
|
|
@@ -206,12 +242,12 @@ export { handler as GET, handler as POST };`})]}),f("div",{className:"card-subtl
|
|
|
206
242
|
# Follow the interactive prompts to configure your project`})]}),y("div",{className:"space-y-3",children:[c("h2",{className:"font-bold text-2xl",children:"Initialize the database"}),c("p",{className:"text-muted-foreground",children:"If using Prisma, set up your schema and generate the client:"}),c(z,{language:"bash",filename:"installation-prisma",code:`bunx prisma init
|
|
207
243
|
# Edit prisma/schema.prisma with your models
|
|
208
244
|
bunx prisma generate
|
|
209
|
-
bunx prisma migrate dev --name init`})]}),c("div",{className:"flex items-center gap-4 pt-4",children:y(ie,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",c(oe,{size:16})]})})]})]})}import{CodeBlock as I,InstallCommand as re}from"@contractspec/lib.design-system";import
|
|
245
|
+
bunx prisma migrate dev --name init`})]}),c("div",{className:"flex items-center gap-4 pt-4",children:y(ie,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: First Operation ",c(oe,{size:16})]})})]})]})}import{CodeBlock as I,InstallCommand as re}from"@contractspec/lib.design-system";import D from"@contractspec/lib.ui-link";import{ChevronRight as ce}from"lucide-react";import{jsx as u,jsxs as N}from"react/jsx-runtime";function le(){return N("div",{className:"space-y-8",children:[N("div",{className:"space-y-2",children:[u("h1",{className:"font-bold text-4xl",children:"Start here"}),u("p",{className:"text-lg text-muted-foreground",children:"A fast onboarding path from install to your first generated contract."})]}),N("div",{className:"space-y-6",children:[N("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Install the CLI"}),u(re,{package:"contractspec",dev:!0})]}),N("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Generate repo-local guidance"}),u(I,{language:"bash",filename:"start-here-onboard",code:`contractspec onboard
|
|
210
246
|
# optional focused track
|
|
211
247
|
contractspec onboard knowledge --example knowledge-canon`})]}),N("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Initialize your project"}),u(I,{language:"bash",filename:"start-here-init",code:"bunx contractspec init"})]}),N("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Author your first contract"}),u(I,{language:"bash",filename:"start-here-create",code:"contractspec create --type operation"})]}),N("div",{className:"space-y-3",children:[u("h2",{className:"font-bold text-2xl",children:"Generate implementation"}),u(I,{language:"bash",filename:"start-here-build",code:`contractspec generate
|
|
212
|
-
contractspec validate`})]})]}),N("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[N(
|
|
248
|
+
contractspec validate`})]})]}),N("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[N(D,{href:"/docs/getting-started/hello-world",className:"btn-primary",children:["Next: Hello World ",u(ce,{size:16})]}),u(D,{href:"/docs/getting-started/troubleshooting",className:"btn-ghost",children:"Troubleshooting"}),u(D,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"})]})]})}import{CodeBlock as se}from"@contractspec/lib.design-system";import A from"@contractspec/lib.ui-link";import{ChevronRight as de}from"lucide-react";import{jsx as l,jsxs as m}from"react/jsx-runtime";function pe(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-2",children:[l("h1",{className:"font-bold text-4xl",children:"Troubleshooting"}),l("p",{className:"text-lg text-muted-foreground",children:"Common issues and fixes when installing or generating with ContractSpec."})]}),m("div",{className:"space-y-6",children:[m("div",{className:"card-subtle space-y-3 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"Command not found"}),m("ul",{className:"space-y-2 text-muted-foreground",children:[l("li",{children:"Reinstall the CLI and ensure it is in your PATH."}),l("li",{children:"Confirm Node.js 20+ or Bun 1.0+ is installed."})]})]}),m("div",{className:"card-subtle space-y-3 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"Specs not discovered"}),m("ul",{className:"space-y-2 text-muted-foreground",children:[m("li",{children:["Run ",l("code",{children:"contractspec list"})," to see discovered specs."]}),l("li",{children:"Verify your spec path conventions in .contractsrc.json."})]})]}),m("div",{className:"card-subtle space-y-3 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"Build or validate fails"}),m("ul",{className:"space-y-2 text-muted-foreground",children:[m("li",{children:["Run ",l("code",{children:"contractspec validate"})," to surface schema errors."]}),l("li",{children:"Check that generated files were not manually edited."})]})]}),m("div",{className:"space-y-3",children:[l("h2",{className:"font-bold text-2xl",children:"Diagnostics"}),l(se,{language:"bash",filename:"troubleshooting-diagnostics",code:`contractspec --version
|
|
213
249
|
contractspec list
|
|
214
|
-
contractspec validate src/contracts/mySpec.ts`})]}),m("div",{className:"card-subtle space-y-3 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),m("ul",{className:"space-y-2 text-muted-foreground",children:[l("li",{children:"Confirm compatibility requirements for runtime and framework."}),l("li",{children:"Re-run builds on a clean branch to isolate changes."}),l("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),m("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[l(
|
|
250
|
+
contractspec validate src/contracts/mySpec.ts`})]}),m("div",{className:"card-subtle space-y-3 p-6",children:[l("h2",{className:"font-bold text-2xl",children:"Still blocked?"}),m("ul",{className:"space-y-2 text-muted-foreground",children:[l("li",{children:"Confirm compatibility requirements for runtime and framework."}),l("li",{children:"Re-run builds on a clean branch to isolate changes."}),l("li",{children:"Use a new spec and minimal adapter to validate setup."})]})]})]}),m("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[l(A,{href:"/docs/getting-started/start-here",className:"btn-ghost",children:"Start here"}),l(A,{href:"/docs/getting-started/compatibility",className:"btn-ghost",children:"Compatibility"}),m(A,{href:"/docs/getting-started/installation",className:"btn-primary",children:["Next: Installation ",l(de,{size:16})]})]})]})}import{CodeBlock as me}from"@contractspec/lib.design-system";import O from"@contractspec/lib.ui-link";import{ChevronRight as ue,ExternalLink as fe}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function st(){let h=[{category:"Core Functionality",items:["Real-time validation with instant feedback on spec errors","Build/Scaffold handlers and components from specs","Interactive spec creation wizard","Watch mode for auto-rebuild on changes","Sync all specs in workspace with one command"]},{category:"Visual Navigation",items:["Specs Explorer sidebar with organized tree view","Dependencies view to visualize spec relationships","Build Results tracking with history","Circular dependency detection"]},{category:"Comparison & Export",items:["Semantic and text diff between specs","Git comparison with baseline branches","OpenAPI 3.1 specification export"]}],n=[{name:"Create New Spec",description:"Interactive wizard to create specs"},{name:"Validate Current Spec",description:"Validate the currently open spec"},{name:"Build/Scaffold from Current Spec",description:"Generate handler/component"},{name:"Toggle Watch Mode",description:"Auto-rebuild on changes"},{name:"Sync All Specs",description:"Build all specs in workspace"},{name:"Analyze Spec Dependencies",description:"Visualize spec dependencies"},{name:"Compare Specs",description:"Semantic or text diff between specs"},{name:"Export to OpenAPI",description:"Generate OpenAPI specification"}];return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-2",children:[e("h1",{className:"font-bold text-4xl",children:"VS Code Extension"}),e("p",{className:"text-lg text-muted-foreground",children:"Spec-first development directly in VS Code. Validate, scaffold, and explore your contract specifications with real-time feedback."})]}),t("div",{className:"flex flex-wrap gap-3",children:[t("a",{href:"https://marketplace.visualstudio.com/items?itemName=lssm.vscode-contractspec",target:"_blank",rel:"noopener noreferrer",className:"btn-primary inline-flex items-center gap-2",children:["Install Extension ",e(fe,{size:16})]}),e("a",{href:"vscode:extension/lssm.vscode-contractspec",className:"btn-ghost inline-flex items-center gap-2",children:"Open in VS Code"})]}),t("div",{className:"space-y-6",children:[t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),t("div",{className:"space-y-2",children:[t("p",{className:"text-muted-foreground text-sm",children:[e("strong",{children:"Option 1:"})," Install from VS Code Marketplace"]}),e(me,{language:"bash",code:"code --install-extension lssm.vscode-contractspec"}),t("p",{className:"mt-4 text-muted-foreground text-sm",children:[e("strong",{children:"Option 2:"}),' Search for "ContractSpec" in VS Code Extensions (Ctrl/Cmd+Shift+X)']})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Features"}),e("div",{className:"grid gap-4 md:grid-cols-3",children:h.map((g)=>t("div",{className:"card-subtle space-y-3 p-4",children:[e("h3",{className:"font-bold text-violet-400",children:g.category}),e("ul",{className:"space-y-2",children:g.items.map((C)=>t("li",{className:"flex items-start gap-2 text-muted-foreground text-sm",children:[e("span",{className:"mt-1 text-violet-400",children:"-"}),e("span",{children:C})]},C))})]},g.category))})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Commands"}),t("p",{className:"text-muted-foreground",children:["Access commands via Command Palette (Ctrl/Cmd+Shift+P) with prefix"," ",e("code",{children:"ContractSpec:"})]}),e("div",{className:"grid gap-3 md:grid-cols-2",children:n.map((g)=>e("div",{className:"card-subtle flex items-center gap-3 p-3",children:t("div",{className:"flex-1",children:[e("p",{className:"font-medium font-mono text-sm",children:g.name}),e("p",{className:"text-muted-foreground text-xs",children:g.description})]})},g.name))})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Sidebar Views"}),e("p",{className:"text-muted-foreground",children:"The extension adds a ContractSpec activity bar (icon in sidebar) with three views:"}),t("div",{className:"grid gap-4 md:grid-cols-3",children:[t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Specs Explorer"}),e("p",{className:"text-muted-foreground text-sm",children:"Browse all specs organized by type. Shows name, version, and stability. Click to open, right-click for actions."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Dependencies"}),e("p",{className:"text-muted-foreground text-sm",children:"Visualize spec relationships. Detect circular dependencies. Navigate to referenced specs."})]}),t("div",{className:"card-subtle space-y-2 p-4",children:[e("h4",{className:"font-bold",children:"Build Results"}),e("p",{className:"text-muted-foreground text-sm",children:"Track build history (last 20). Success/failure indicators. Click to open generated files."})]})]})]}),t("div",{className:"space-y-3",children:[e("h2",{className:"font-bold text-2xl",children:"Getting Started"}),t("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[e("li",{children:"Install the extension from VS Code Marketplace"}),e("li",{children:"Open a workspace with ContractSpec files (or create one)"}),e("li",{children:"Start the walkthrough: Help - Welcome - ContractSpec"}),t("li",{children:["Create your first spec: Click ",e("strong",{children:"+"})," in Specs Explorer or run ",e("code",{children:"ContractSpec: Create New Spec"})]}),e("li",{children:"Build from it: Click the build icon in the editor title bar"})]})]}),t("div",{className:"card-subtle space-y-4 p-6",children:[e("h3",{className:"font-bold",children:"Configuration"}),e("p",{className:"text-muted-foreground text-sm",children:"Configure the extension in VS Code Settings:"}),e("div",{className:"overflow-x-auto",children:t("table",{className:"w-full text-muted-foreground text-sm",children:[e("thead",{children:t("tr",{className:"border-border border-b",children:[e("th",{className:"p-2 text-left font-medium",children:"Setting"}),e("th",{className:"p-2 text-left font-medium",children:"Description"}),e("th",{className:"p-2 text-left font-medium",children:"Default"})]})}),t("tbody",{children:[t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onSave"}),e("td",{className:"p-2",children:"Run validation on save"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"validation.onOpen"}),e("td",{className:"p-2",children:"Run validation on open"}),e("td",{className:"p-2",children:"true"})]}),t("tr",{className:"border-border border-b",children:[e("td",{className:"p-2 font-mono text-xs",children:"api.baseUrl"}),e("td",{className:"p-2",children:"Base URL for ContractSpec API"}),e("td",{className:"p-2",children:"(empty)"})]})]})]})})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(O,{href:"/docs/getting-started/tools/cli",className:"btn-ghost",children:"Back: CLI"}),t(O,{href:"/docs/specs",className:"btn-primary",children:["Next: Core Concepts ",e(ue,{size:16})]})]})]})}import{registerDocBlocks as he}from"@contractspec/lib.contracts-spec/docs";var ge=[{id:"docs.getting-started.start-here",title:"Start here",summary:"Fast onboarding path from install to first generated contract.",kind:"usage",visibility:"public",route:"/docs/getting-started/start-here",tags:["getting-started","onboarding"],body:`# Start Here
|
|
215
251
|
|
|
216
252
|
Get ContractSpec running quickly and generate your first contract-backed code.
|
|
217
253
|
|
|
@@ -310,4 +346,4 @@ ContractSpec supports modern TypeScript stacks with spec-first workflows.
|
|
|
310
346
|
|
|
311
347
|
- PostgreSQL via Prisma
|
|
312
348
|
- Bring your own adapter for other databases
|
|
313
|
-
`}];he(ge);export{st as VSCodeExtensionPage,pe as TroubleshootingPage,le as StartHerePage,ne as InstallationPage,ae as HelloWorldPage,
|
|
349
|
+
`}];he(ge);export{st as VSCodeExtensionPage,pe as TroubleshootingPage,le as StartHerePage,ne as InstallationPage,ae as HelloWorldPage,Me as DeveloperToolsPage,X as DataViewTutorialPage,Q as CompatibilityPage,W as CLIPage};
|