@contractspec/bundle.library 3.9.3 → 3.9.5
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 +9 -6
- package/CHANGELOG.md +72 -0
- package/dist/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -4
- package/dist/components/docs/advanced/index.js +10 -10
- package/dist/components/docs/index.js +168 -168
- package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.content.d.ts +3 -3
- package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.content.js +2 -2
- package/dist/components/docs/libraries/LibrariesCrossPlatformUIPage.js +2 -2
- package/dist/components/docs/libraries/index.js +2 -2
- package/dist/index.js +179 -179
- package/dist/node/components/docs/advanced/AdvancedSpecExperimentsPage.js +4 -4
- package/dist/node/components/docs/advanced/index.js +10 -10
- package/dist/node/components/docs/index.js +168 -168
- package/dist/node/components/docs/libraries/LibrariesCrossPlatformUIPage.content.js +2 -2
- package/dist/node/components/docs/libraries/LibrariesCrossPlatformUIPage.js +2 -2
- package/dist/node/components/docs/libraries/index.js +2 -2
- package/dist/node/index.js +179 -179
- package/package.json +27 -27
- package/src/components/docs/advanced/AdvancedSpecExperimentsPage.tsx +22 -14
- package/src/components/docs/generated/docs-index.manifest.json +1 -1
- package/src/components/docs/libraries/LibrariesCrossPlatformUIPage.content.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.library",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.5",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -1938,27 +1938,27 @@
|
|
|
1938
1938
|
"react": "19.2.0"
|
|
1939
1939
|
},
|
|
1940
1940
|
"dependencies": {
|
|
1941
|
-
"@contractspec/bundle.workspace": "4.5.
|
|
1941
|
+
"@contractspec/bundle.workspace": "4.5.3",
|
|
1942
1942
|
"@apollo/client": "^4.1.7",
|
|
1943
1943
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
1944
|
-
"@contractspec/example.data-grid-showcase": "3.8.
|
|
1945
|
-
"@contractspec/lib.ai-providers": "3.7.
|
|
1946
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
1947
|
-
"@contractspec/lib.contracts-library": "3.7.
|
|
1948
|
-
"@contractspec/lib.content-gen": "3.7.
|
|
1949
|
-
"@contractspec/lib.contracts-runtime-server-mcp": "3.8.
|
|
1950
|
-
"@contractspec/lib.design-system": "
|
|
1951
|
-
"@contractspec/lib.surface-runtime": "0.5.
|
|
1952
|
-
"@contractspec/lib.provider-ranking": "0.7.
|
|
1953
|
-
"@contractspec/lib.example-shared-ui": "7.0.
|
|
1954
|
-
"@contractspec/lib.knowledge": "3.7.
|
|
1955
|
-
"@contractspec/lib.logger": "3.7.
|
|
1956
|
-
"@contractspec/lib.runtime-sandbox": "3.0.
|
|
1944
|
+
"@contractspec/example.data-grid-showcase": "3.8.17",
|
|
1945
|
+
"@contractspec/lib.ai-providers": "3.7.16",
|
|
1946
|
+
"@contractspec/lib.contracts-spec": "5.6.0",
|
|
1947
|
+
"@contractspec/lib.contracts-library": "3.7.23",
|
|
1948
|
+
"@contractspec/lib.content-gen": "3.7.23",
|
|
1949
|
+
"@contractspec/lib.contracts-runtime-server-mcp": "3.8.3",
|
|
1950
|
+
"@contractspec/lib.design-system": "4.0.0",
|
|
1951
|
+
"@contractspec/lib.surface-runtime": "0.5.23",
|
|
1952
|
+
"@contractspec/lib.provider-ranking": "0.7.16",
|
|
1953
|
+
"@contractspec/lib.example-shared-ui": "7.0.2",
|
|
1954
|
+
"@contractspec/lib.knowledge": "3.7.23",
|
|
1955
|
+
"@contractspec/lib.logger": "3.7.16",
|
|
1956
|
+
"@contractspec/lib.runtime-sandbox": "3.0.2",
|
|
1957
1957
|
"@contractspec/lib.schema": "3.7.14",
|
|
1958
|
-
"@contractspec/lib.ui-kit-web": "3.
|
|
1959
|
-
"@contractspec/lib.ui-link": "3.7.
|
|
1960
|
-
"@contractspec/module.context-storage": "0.7.
|
|
1961
|
-
"@contractspec/module.examples": "4.0.
|
|
1958
|
+
"@contractspec/lib.ui-kit-web": "3.12.0",
|
|
1959
|
+
"@contractspec/lib.ui-link": "3.7.18",
|
|
1960
|
+
"@contractspec/module.context-storage": "0.7.22",
|
|
1961
|
+
"@contractspec/module.examples": "4.0.2",
|
|
1962
1962
|
"@dnd-kit/core": "^6.1.0",
|
|
1963
1963
|
"@dnd-kit/sortable": "^10.0.0",
|
|
1964
1964
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -1969,22 +1969,22 @@
|
|
|
1969
1969
|
"elysia": "^1.4.28",
|
|
1970
1970
|
"framer-motion": "^12.38.0",
|
|
1971
1971
|
"lucide-react": "^1.8.0",
|
|
1972
|
-
"posthog-js": "^1.
|
|
1973
|
-
"posthog-node": "^5.29.
|
|
1974
|
-
"posthog-react-native": "^4.
|
|
1972
|
+
"posthog-js": "^1.369.5",
|
|
1973
|
+
"posthog-node": "^5.29.4",
|
|
1974
|
+
"posthog-react-native": "^4.42.3",
|
|
1975
1975
|
"react-hook-form": "^7.72.1",
|
|
1976
1976
|
"zod": "^4.3.5",
|
|
1977
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
1978
|
-
"@contractspec/lib.contracts-runtime-server-rest": "3.8.
|
|
1979
|
-
"@contractspec/lib.contracts-runtime-server-graphql": "3.8.
|
|
1980
|
-
"@contractspec/lib.contracts-runtime-client-react": "3.
|
|
1977
|
+
"@contractspec/lib.contracts-integrations": "3.8.15",
|
|
1978
|
+
"@contractspec/lib.contracts-runtime-server-rest": "3.8.2",
|
|
1979
|
+
"@contractspec/lib.contracts-runtime-server-graphql": "3.8.2",
|
|
1980
|
+
"@contractspec/lib.contracts-runtime-client-react": "3.11.0"
|
|
1981
1981
|
},
|
|
1982
1982
|
"devDependencies": {
|
|
1983
1983
|
"@types/react": "~19.2.14",
|
|
1984
1984
|
"@contractspec/tool.typescript": "3.7.13",
|
|
1985
1985
|
"typescript": "^5.9.3",
|
|
1986
1986
|
"@types/bun": "^1.3.12",
|
|
1987
|
-
"@contractspec/tool.bun": "3.7.
|
|
1987
|
+
"@contractspec/tool.bun": "3.7.18"
|
|
1988
1988
|
},
|
|
1989
1989
|
"repository": {
|
|
1990
1990
|
"type": "git",
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Code,
|
|
3
|
+
H1,
|
|
4
|
+
H2,
|
|
5
|
+
H3,
|
|
6
|
+
P,
|
|
7
|
+
} from '@contractspec/lib.design-system/components/typography';
|
|
8
|
+
|
|
1
9
|
export function AdvancedSpecExperimentsPage() {
|
|
2
10
|
return (
|
|
3
11
|
<div className="space-y-8">
|
|
4
12
|
<div className="space-y-4">
|
|
5
|
-
<
|
|
6
|
-
<
|
|
13
|
+
<H1 className="font-bold text-4xl">Spec Experiments</H1>
|
|
14
|
+
<P className="text-lg text-muted-foreground">
|
|
7
15
|
Run controlled experiments on ContractSpec operations, gradually shift
|
|
8
16
|
traffic, and roll back automatically when guardrails trip.
|
|
9
|
-
</
|
|
17
|
+
</P>
|
|
10
18
|
</div>
|
|
11
19
|
|
|
12
20
|
<div className="space-y-3">
|
|
13
|
-
<
|
|
14
|
-
<
|
|
21
|
+
<H2 className="font-bold text-2xl">Define control + variants</H2>
|
|
22
|
+
<Code className="rounded-lg border bg-muted p-4 text-sm">
|
|
15
23
|
{`import { SpecExperimentRegistry } from '@contractspec/lib.growth/spec-experiments';
|
|
16
24
|
|
|
17
25
|
const registry = new SpecExperimentRegistry().register({
|
|
@@ -33,24 +41,24 @@ const registry = new SpecExperimentRegistry().register({
|
|
|
33
41
|
rolloutStages: [0.01, 0.1, 0.5, 1],
|
|
34
42
|
guardrails: { errorRateThreshold: 0.02, latencyP99ThresholdMs: 500 },
|
|
35
43
|
});`}
|
|
36
|
-
</
|
|
44
|
+
</Code>
|
|
37
45
|
</div>
|
|
38
46
|
|
|
39
47
|
<div className="space-y-3">
|
|
40
|
-
<
|
|
41
|
-
<
|
|
48
|
+
<H2 className="font-bold text-2xl">Attach to runtime</H2>
|
|
49
|
+
<Code className="rounded-lg border bg-muted p-4 text-sm">
|
|
42
50
|
{`import { createSpecVariantResolver } from '@contractspec/lib.growth/spec-experiments';
|
|
43
51
|
|
|
44
52
|
adapterContext.specVariantResolver = createSpecVariantResolver({
|
|
45
53
|
adapter,
|
|
46
54
|
resolveUserId: (ctx) => ctx.userId ?? ctx.organizationId ?? 'anon',
|
|
47
55
|
});`}
|
|
48
|
-
</
|
|
56
|
+
</Code>
|
|
49
57
|
</div>
|
|
50
58
|
|
|
51
59
|
<div className="space-y-3">
|
|
52
|
-
<
|
|
53
|
-
<
|
|
60
|
+
<H2 className="font-bold text-2xl">Track outcomes + auto-rollback</H2>
|
|
61
|
+
<Code className="rounded-lg border bg-muted p-4 text-sm">
|
|
54
62
|
{`import {
|
|
55
63
|
SpecExperimentAnalyzer,
|
|
56
64
|
SpecExperimentController,
|
|
@@ -62,7 +70,7 @@ const controller = new SpecExperimentController({
|
|
|
62
70
|
analyzer,
|
|
63
71
|
onRollback: (target, evaluation) => notifyOps(target, evaluation.reasons),
|
|
64
72
|
});`}
|
|
65
|
-
</
|
|
73
|
+
</Code>
|
|
66
74
|
</div>
|
|
67
75
|
|
|
68
76
|
<div className="grid gap-4 md:grid-cols-2">
|
|
@@ -79,8 +87,8 @@ const controller = new SpecExperimentController({
|
|
|
79
87
|
},
|
|
80
88
|
].map((card) => (
|
|
81
89
|
<div key={card.title} className="card-subtle space-y-2 p-4">
|
|
82
|
-
<
|
|
83
|
-
<
|
|
90
|
+
<H3 className="font-semibold text-lg">{card.title}</H3>
|
|
91
|
+
<P className="text-muted-foreground text-sm">{card.description}</P>
|
|
84
92
|
</div>
|
|
85
93
|
))}
|
|
86
94
|
</div>
|
|
@@ -102,7 +102,7 @@ export const gotchas = [
|
|
|
102
102
|
'Prefer root runtime imports when alias helpers matter. Metro remaps the root @contractspec/lib.presentation-runtime-react package, not arbitrary deep hook subpaths.',
|
|
103
103
|
'Metro only rewrites @contractspec/lib.ui-kit-web/ui/* imports. Router-specific web packages and other web-only helpers still need platform-aware imports.',
|
|
104
104
|
'presentation-runtime-core is headless. It owns models and config helpers, not rendered React components.',
|
|
105
|
-
'design-system compatibility comes from paired .tsx / .
|
|
105
|
+
'design-system compatibility comes from paired .tsx / .native.tsx implementations and token helpers such as withPlatformUI and mapTokensForPlatform.',
|
|
106
106
|
'Form controls should come from @contractspec/lib.design-system when product code needs ThemeSpec or TranslationSpec support.',
|
|
107
107
|
'Stack primitives are similar across platforms, but the prop surface is not identical. Stay inside the common subset for shared renderers.',
|
|
108
108
|
'Alias helpers solve module resolution only. They do not replace app-level monorepo watchFolders, Expo Router setup, or other Next configuration.',
|
|
@@ -234,7 +234,7 @@ export const customerPolicyMarkdown = `# Cross-Surface Rendering Policy
|
|
|
234
234
|
- Use \`@contractspec/lib.ui-kit\` only for native-specific primitive lanes.
|
|
235
235
|
- Keep shared layout code inside the common \`VStack\` / \`HStack\` / \`Box\` subset.
|
|
236
236
|
- Do not use removed \`withPresentationNextAliases\`.
|
|
237
|
-
- Treat \`.tsx\` / \`.
|
|
237
|
+
- Treat \`.tsx\` / \`.native.tsx\` pairs as the standard design-system compatibility boundary.`;
|
|
238
238
|
|
|
239
239
|
export const customerChecklistMarkdown = `# Cross-Surface Rendering Checklist
|
|
240
240
|
|
|
@@ -246,7 +246,7 @@ export const customerChecklistMarkdown = `# Cross-Surface Rendering Checklist
|
|
|
246
246
|
- web primitive: \`@contractspec/lib.ui-kit-web\`
|
|
247
247
|
- native primitive: \`@contractspec/lib.ui-kit\`
|
|
248
248
|
- shared product surface: \`@contractspec/lib.design-system\`
|
|
249
|
-
4. Verify mirrored \`.tsx\` / \`.
|
|
249
|
+
4. Verify mirrored \`.tsx\` / \`.native.tsx\` implementations where the design-system owns the surface.
|
|
250
250
|
5. Wrap product surfaces in \`DesignSystemThemeProvider\` and \`DesignSystemTranslationProvider\` when ThemeSpec or TranslationSpec data is available.
|
|
251
251
|
6. In shared layout code, set \`gap\`, \`align\`, \`justify\`, and \`wrap\` explicitly.
|
|
252
252
|
7. Check docs and examples for root imports and current helper names before copying them into product code.`;
|