@lepsto/sdk-app 89.7.0 → 89.7.2
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/CHANGELOG.md +8 -32
- package/README.md +18 -17
- package/dist/_types/gen/client.gen.d.ts +38 -1
- package/dist/_types/gen/manifest.gen.d.ts +1 -1
- package/dist/_types/gen/playground/connect.gen.d.ts +3 -0
- package/dist/_types/gen/playground/index.d.ts +3 -0
- package/dist/_types/gen/playground/queryOptions.gen.d.ts +70 -0
- package/dist/_types/gen/types.gen.d.ts +334 -8
- package/dist/chunk-OSI6GWYM.js +11531 -0
- package/dist/chunk-OSI6GWYM.js.map +1 -0
- package/dist/index.cjs +227 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +22 -11312
- package/dist/index.js.map +1 -1
- package/dist/playground/index.cjs +106 -0
- package/dist/playground/index.cjs.map +1 -0
- package/dist/playground/index.d.cts +1 -0
- package/dist/playground/index.d.ts +1 -0
- package/dist/playground/index.js +78 -0
- package/dist/playground/index.js.map +1 -0
- package/docs/README.md +8 -8
- package/docs/recipes/access.md +4 -4
- package/docs/recipes/federation.md +32 -25
- package/docs/recipes/local-dev.md +13 -13
- package/docs/recipes/sdk-usage.md +11 -11
- package/docs/rules.md +27 -25
- package/package.json +12 -2
- package/src/gen/bindings.gen.ts +216 -1
- package/src/gen/client.gen.ts +71 -0
- package/src/gen/manifest.gen.ts +21 -1
- package/src/gen/playground/connect.gen.ts +9 -0
- package/src/gen/playground/index.ts +4 -0
- package/src/gen/playground/queryOptions.gen.ts +119 -0
- package/src/gen/types.gen.ts +380 -8
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_types/gen/playground/index.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../_types/gen/playground/index.js';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { wsBindings } from '../chunk-OSI6GWYM.js';
|
|
2
|
+
|
|
3
|
+
// src/gen/playground/queryOptions.gen.ts
|
|
4
|
+
var playgroundAnalyticsOverviewQueryOptions = (sdk, input) => ({
|
|
5
|
+
queryKey: ["playground", "analytics", "overview", input],
|
|
6
|
+
queryFn: () => sdk["playground"]["analytics"]["overview"](input)
|
|
7
|
+
});
|
|
8
|
+
var playgroundBillingEntitlementsQueryOptions = (sdk, input) => ({
|
|
9
|
+
queryKey: ["playground", "billing", "entitlements", input],
|
|
10
|
+
queryFn: () => sdk["playground"]["billing"]["entitlements"](input)
|
|
11
|
+
});
|
|
12
|
+
var playgroundBillingRecordUsageMutationOptions = (sdk) => ({
|
|
13
|
+
mutationKey: ["playground", "billing", "record-usage"],
|
|
14
|
+
mutationFn: (input) => sdk["playground"]["billing"]["record-usage"](input)
|
|
15
|
+
});
|
|
16
|
+
var playgroundClickupCreateTaskMutationOptions = (sdk) => ({
|
|
17
|
+
mutationKey: ["playground", "clickup", "create-task"],
|
|
18
|
+
mutationFn: (input) => sdk["playground"]["clickup"]["create-task"](input)
|
|
19
|
+
});
|
|
20
|
+
var playgroundClickupGetLastWebhookQueryOptions = (sdk, input) => ({
|
|
21
|
+
queryKey: ["playground", "clickup", "get-last-webhook", input],
|
|
22
|
+
queryFn: () => sdk["playground"]["clickup"]["get-last-webhook"](input)
|
|
23
|
+
});
|
|
24
|
+
var playgroundClickupGetOverviewQueryOptions = (sdk, input) => ({
|
|
25
|
+
queryKey: ["playground", "clickup", "get-overview", input],
|
|
26
|
+
queryFn: () => sdk["playground"]["clickup"]["get-overview"](input)
|
|
27
|
+
});
|
|
28
|
+
var playgroundEchoPingQueryOptions = (sdk, input) => ({
|
|
29
|
+
queryKey: ["playground", "echo", "ping", input],
|
|
30
|
+
queryFn: () => sdk["playground"]["echo"]["ping"](input)
|
|
31
|
+
});
|
|
32
|
+
var playgroundGdriveGetLastChangeQueryOptions = (sdk, input) => ({
|
|
33
|
+
queryKey: ["playground", "gdrive", "get-last-change", input],
|
|
34
|
+
queryFn: () => sdk["playground"]["gdrive"]["get-last-change"](input)
|
|
35
|
+
});
|
|
36
|
+
var playgroundGdriveReadFileQueryOptions = (sdk, input) => ({
|
|
37
|
+
queryKey: ["playground", "gdrive", "read-file", input],
|
|
38
|
+
queryFn: () => sdk["playground"]["gdrive"]["read-file"](input)
|
|
39
|
+
});
|
|
40
|
+
var playgroundGoogleadsReadCustomerQueryOptions = (sdk, input) => ({
|
|
41
|
+
queryKey: ["playground", "googleads", "read-customer", input],
|
|
42
|
+
queryFn: () => sdk["playground"]["googleads"]["read-customer"](input)
|
|
43
|
+
});
|
|
44
|
+
var playgroundLifecycleGetStateQueryOptions = (sdk, input) => ({
|
|
45
|
+
queryKey: ["playground", "lifecycle", "get-state", input],
|
|
46
|
+
queryFn: () => sdk["playground"]["lifecycle"]["get-state"](input)
|
|
47
|
+
});
|
|
48
|
+
var playgroundLifecycleListEventsQueryOptions = (sdk, input) => ({
|
|
49
|
+
queryKey: ["playground", "lifecycle", "list-events", input],
|
|
50
|
+
queryFn: () => sdk["playground"]["lifecycle"]["list-events"](input)
|
|
51
|
+
});
|
|
52
|
+
var playgroundWebhookGetLastQueryOptions = (sdk, input) => ({
|
|
53
|
+
queryKey: ["playground", "webhook", "get-last", input],
|
|
54
|
+
queryFn: () => sdk["playground"]["webhook"]["get-last"](input)
|
|
55
|
+
});
|
|
56
|
+
var playgroundWorkflowEchoMutationOptions = (sdk) => ({
|
|
57
|
+
mutationKey: ["playground", "workflow", "echo"],
|
|
58
|
+
mutationFn: (input) => sdk["playground"]["workflow"]["echo"](input)
|
|
59
|
+
});
|
|
60
|
+
var playgroundWorkflowEchoListQueryOptions = (sdk, input) => ({
|
|
61
|
+
queryKey: ["playground", "workflow", "echo-list", input],
|
|
62
|
+
queryFn: () => sdk["playground"]["workflow"]["echo-list"](input)
|
|
63
|
+
});
|
|
64
|
+
var playgroundWorkflowPingMutationOptions = (sdk) => ({
|
|
65
|
+
mutationKey: ["playground", "workflow", "ping"],
|
|
66
|
+
mutationFn: (input) => sdk["playground"]["workflow"]["ping"](input)
|
|
67
|
+
});
|
|
68
|
+
var playgroundWorkflowSubjectsListQueryOptions = (sdk, input) => ({
|
|
69
|
+
queryKey: ["playground", "workflow", "subjects-list", input],
|
|
70
|
+
queryFn: () => sdk["playground"]["workflow"]["subjects-list"](input)
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
// src/gen/playground/connect.gen.ts
|
|
74
|
+
var playgroundWsEchoConnect = (sdk, input) => sdk.openStream(wsBindings["playground"]["ws"]["echo"], input);
|
|
75
|
+
|
|
76
|
+
export { playgroundAnalyticsOverviewQueryOptions, playgroundBillingEntitlementsQueryOptions, playgroundBillingRecordUsageMutationOptions, playgroundClickupCreateTaskMutationOptions, playgroundClickupGetLastWebhookQueryOptions, playgroundClickupGetOverviewQueryOptions, playgroundEchoPingQueryOptions, playgroundGdriveGetLastChangeQueryOptions, playgroundGdriveReadFileQueryOptions, playgroundGoogleadsReadCustomerQueryOptions, playgroundLifecycleGetStateQueryOptions, playgroundLifecycleListEventsQueryOptions, playgroundWebhookGetLastQueryOptions, playgroundWorkflowEchoListQueryOptions, playgroundWorkflowEchoMutationOptions, playgroundWorkflowPingMutationOptions, playgroundWorkflowSubjectsListQueryOptions, playgroundWsEchoConnect };
|
|
77
|
+
//# sourceMappingURL=index.js.map
|
|
78
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/gen/playground/queryOptions.gen.ts","../../src/gen/playground/connect.gen.ts"],"names":[],"mappings":";;;AAmCO,IAAM,uCAAA,GAA0C,CAAC,GAAA,EAAsB,KAAA,MAA6C;AAAA,EACzH,QAAA,EAAU,CAAC,YAAA,EAAc,WAAA,EAAa,YAAY,KAAK,CAAA;AAAA,EACvD,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,WAAW,CAAA,CAAE,UAAU,CAAA,CAAE,KAAK;AACjE,CAAA;AAEO,IAAM,yCAAA,GAA4C,CAAC,GAAA,EAAsB,KAAA,MAA+C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3D,OAAA,EAAS,MAAM,GAAA,CAAI,YAAY,EAAE,UAAU,CAAA,CAAE,eAAe,CAAA,CAAE,KAAK;AACrE,CAAA;;;AC/GO,IAAM,uBAAA,GAA0B,CAAC,GAAA,EAAyB,KAAA,KAC/D,GAAA,CAAI,UAAA,CAAW,UAAA,CAAW,YAAY,CAAA,CAAG,IAAI,CAAA,CAAG,MAAM,GAAI,KAAgC","file":"index.js","sourcesContent":["// AUTOGENERATED by scripts/generate.ts — do not edit.\nimport type { GeneratedClient } from '../client.gen';\nimport type {\n PlaygroundAnalyticsOverviewInput,\n PlaygroundAnalyticsOverviewOutput,\n PlaygroundBillingEntitlementsInput,\n PlaygroundBillingEntitlementsOutput,\n PlaygroundBillingRecordUsageInput,\n PlaygroundClickupCreateTaskInput,\n PlaygroundClickupGetLastWebhookInput,\n PlaygroundClickupGetLastWebhookOutput,\n PlaygroundClickupGetOverviewInput,\n PlaygroundClickupGetOverviewOutput,\n PlaygroundEchoPingInput,\n PlaygroundEchoPingOutput,\n PlaygroundGdriveGetLastChangeInput,\n PlaygroundGdriveGetLastChangeOutput,\n PlaygroundGdriveReadFileInput,\n PlaygroundGdriveReadFileOutput,\n PlaygroundGoogleadsReadCustomerInput,\n PlaygroundGoogleadsReadCustomerOutput,\n PlaygroundLifecycleGetStateInput,\n PlaygroundLifecycleGetStateOutput,\n PlaygroundLifecycleListEventsInput,\n PlaygroundLifecycleListEventsOutput,\n PlaygroundWebhookGetLastInput,\n PlaygroundWebhookGetLastOutput,\n PlaygroundWorkflowEchoInput,\n PlaygroundWorkflowEchoListInput,\n PlaygroundWorkflowEchoListOutput,\n PlaygroundWorkflowPingInput,\n PlaygroundWorkflowSubjectsListInput,\n PlaygroundWorkflowSubjectsListOutput,\n} from '../types.gen';\n\nexport const playgroundAnalyticsOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundAnalyticsOverviewInput) => ({\n queryKey: ['playground', 'analytics', 'overview', input] as const,\n queryFn: () => sdk['playground']['analytics']['overview'](input),\n});\n\nexport const playgroundBillingEntitlementsQueryOptions = (sdk: GeneratedClient, input: PlaygroundBillingEntitlementsInput) => ({\n queryKey: ['playground', 'billing', 'entitlements', input] as const,\n queryFn: () => sdk['playground']['billing']['entitlements'](input),\n});\n\nexport const playgroundBillingRecordUsageMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'billing', 'record-usage'],\n mutationFn: (input: PlaygroundBillingRecordUsageInput) => sdk['playground']['billing']['record-usage'](input),\n});\n\nexport const playgroundClickupCreateTaskMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'clickup', 'create-task'],\n mutationFn: (input: PlaygroundClickupCreateTaskInput) => sdk['playground']['clickup']['create-task'](input),\n});\n\nexport const playgroundClickupGetLastWebhookQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetLastWebhookInput) => ({\n queryKey: ['playground', 'clickup', 'get-last-webhook', input] as const,\n queryFn: () => sdk['playground']['clickup']['get-last-webhook'](input),\n});\n\nexport const playgroundClickupGetOverviewQueryOptions = (sdk: GeneratedClient, input: PlaygroundClickupGetOverviewInput) => ({\n queryKey: ['playground', 'clickup', 'get-overview', input] as const,\n queryFn: () => sdk['playground']['clickup']['get-overview'](input),\n});\n\nexport const playgroundEchoPingQueryOptions = (sdk: GeneratedClient, input: PlaygroundEchoPingInput) => ({\n queryKey: ['playground', 'echo', 'ping', input] as const,\n queryFn: () => sdk['playground']['echo']['ping'](input),\n});\n\nexport const playgroundGdriveGetLastChangeQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveGetLastChangeInput) => ({\n queryKey: ['playground', 'gdrive', 'get-last-change', input] as const,\n queryFn: () => sdk['playground']['gdrive']['get-last-change'](input),\n});\n\nexport const playgroundGdriveReadFileQueryOptions = (sdk: GeneratedClient, input: PlaygroundGdriveReadFileInput) => ({\n queryKey: ['playground', 'gdrive', 'read-file', input] as const,\n queryFn: () => sdk['playground']['gdrive']['read-file'](input),\n});\n\nexport const playgroundGoogleadsReadCustomerQueryOptions = (sdk: GeneratedClient, input: PlaygroundGoogleadsReadCustomerInput) => ({\n queryKey: ['playground', 'googleads', 'read-customer', input] as const,\n queryFn: () => sdk['playground']['googleads']['read-customer'](input),\n});\n\nexport const playgroundLifecycleGetStateQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleGetStateInput) => ({\n queryKey: ['playground', 'lifecycle', 'get-state', input] as const,\n queryFn: () => sdk['playground']['lifecycle']['get-state'](input),\n});\n\nexport const playgroundLifecycleListEventsQueryOptions = (sdk: GeneratedClient, input: PlaygroundLifecycleListEventsInput) => ({\n queryKey: ['playground', 'lifecycle', 'list-events', input] as const,\n queryFn: () => sdk['playground']['lifecycle']['list-events'](input),\n});\n\nexport const playgroundWebhookGetLastQueryOptions = (sdk: GeneratedClient, input: PlaygroundWebhookGetLastInput) => ({\n queryKey: ['playground', 'webhook', 'get-last', input] as const,\n queryFn: () => sdk['playground']['webhook']['get-last'](input),\n});\n\nexport const playgroundWorkflowEchoMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'workflow', 'echo'],\n mutationFn: (input: PlaygroundWorkflowEchoInput) => sdk['playground']['workflow']['echo'](input),\n});\n\nexport const playgroundWorkflowEchoListQueryOptions = (sdk: GeneratedClient, input: PlaygroundWorkflowEchoListInput) => ({\n queryKey: ['playground', 'workflow', 'echo-list', input] as const,\n queryFn: () => sdk['playground']['workflow']['echo-list'](input),\n});\n\nexport const playgroundWorkflowPingMutationOptions = (sdk: GeneratedClient) => ({\n mutationKey: ['playground', 'workflow', 'ping'],\n mutationFn: (input: PlaygroundWorkflowPingInput) => sdk['playground']['workflow']['ping'](input),\n});\n\nexport const playgroundWorkflowSubjectsListQueryOptions = (sdk: GeneratedClient, input: PlaygroundWorkflowSubjectsListInput) => ({\n queryKey: ['playground', 'workflow', 'subjects-list', input] as const,\n queryFn: () => sdk['playground']['workflow']['subjects-list'](input),\n});\n","// AUTOGENERATED by scripts/generate.ts — do not edit.\nimport { wsBindings } from '../bindings.gen';\nimport type { LesslyStream, LesslyStreamOpener } from '../../runtime/types';\nimport type {\n PlaygroundWsEchoInput,\n} from '../types.gen';\n\nexport const playgroundWsEchoConnect = (sdk: LesslyStreamOpener, input: PlaygroundWsEchoInput): LesslyStream =>\n sdk.openStream(wsBindings['playground']!['ws']!['echo']!, input as Record<string, unknown>);\n"]}
|
package/docs/README.md
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
# Building a
|
|
1
|
+
# Building a Lepsto App
|
|
2
2
|
|
|
3
|
-
This is the entry point for building a
|
|
3
|
+
This is the entry point for building a Lepsto **App** with `@lepsto/sdk-app`.
|
|
4
4
|
Read this file first, then `rules.md`, then whichever recipe under `recipes/`
|
|
5
5
|
matches the task in front of you.
|
|
6
6
|
|
|
7
7
|
This path is stable: every scaffolded app's `AGENTS.md` points agents at
|
|
8
|
-
`node_modules/@lepsto/sdk-app/docs/README.md
|
|
8
|
+
`node_modules/@lepsto/sdk-app/docs/README.md`. It will not move or be renamed.
|
|
9
9
|
|
|
10
10
|
## What an App is
|
|
11
11
|
|
|
12
|
-
A
|
|
12
|
+
A Lepsto **App** is a pure-frontend Module Federation remote built on
|
|
13
13
|
`@lepsto/sdk-app`. It ships no backend, no database, and no MCP endpoint — all
|
|
14
14
|
platform data access goes through the SDK, and all identity/session state is
|
|
15
15
|
handed to it by the shell that hosts it.
|
|
16
16
|
|
|
17
|
-
Contrast this with a
|
|
17
|
+
Contrast this with a Lepsto **extension**: an extension owns a backend
|
|
18
18
|
service, a database, and typically an MCP endpoint, and is built against the
|
|
19
19
|
toolkit-guide contracts (`MFST-*`, `PRD-*`, `MCP-*`, etc.). An App has none
|
|
20
20
|
of that surface. If your task involves a database migration, a service-to-service
|
|
@@ -32,7 +32,7 @@ does not apply.
|
|
|
32
32
|
product switching. An App reads the active product from props or the
|
|
33
33
|
`X-Product-Id` header — never from a token — and must not implement its own
|
|
34
34
|
auth.
|
|
35
|
-
- **Manifest is `
|
|
35
|
+
- **Manifest is `lepsto.app.yaml`, schema v1.** Exactly five top-level fields:
|
|
36
36
|
`app_schema_version: 1`, `id`, `title`, `version`, `nav` (`nav.icon`, plus an
|
|
37
37
|
optional `nav.sections` rail menu). No backend or extension manifest field
|
|
38
38
|
(`s2s`, `webhooks`, `billing`, `analytics`, `routing`, ...) is valid here.
|
|
@@ -43,12 +43,12 @@ does not apply.
|
|
|
43
43
|
## Quickstart
|
|
44
44
|
|
|
45
45
|
```sh
|
|
46
|
-
npm create
|
|
46
|
+
npm create lepsto-app@latest my-app
|
|
47
47
|
cd my-app
|
|
48
48
|
pnpm dev
|
|
49
49
|
```
|
|
50
50
|
|
|
51
|
-
The generated manifest (`
|
|
51
|
+
The generated manifest (`lepsto.app.yaml`) is the full v1 surface:
|
|
52
52
|
|
|
53
53
|
```yaml
|
|
54
54
|
app_schema_version: 1
|
package/docs/recipes/access.md
CHANGED
|
@@ -81,7 +81,7 @@ drift from the method it is meant to describe; the method cannot.
|
|
|
81
81
|
// src/App.tsx
|
|
82
82
|
import { useEffect } from 'react';
|
|
83
83
|
import { createLesslyApp } from '@lepsto/sdk-app';
|
|
84
|
-
import { TooltipProvider } from '@
|
|
84
|
+
import { TooltipProvider } from '@lepsto/ui';
|
|
85
85
|
|
|
86
86
|
export default function App({ productId }: { productId: string }) {
|
|
87
87
|
const app = useMemo(() => createLesslyApp({ baseUrl: '/api', productId }), [productId]);
|
|
@@ -119,7 +119,7 @@ refetched on a timer.
|
|
|
119
119
|
```tsx
|
|
120
120
|
import { accessReason } from '@lepsto/sdk-app';
|
|
121
121
|
import { useAccess, useCan } from '@lepsto/sdk-app/react';
|
|
122
|
-
import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@
|
|
122
|
+
import { Button, Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from '@lepsto/ui';
|
|
123
123
|
|
|
124
124
|
function AddDomainButton({ app, onClick }: { app: App; onClick: () => void }) {
|
|
125
125
|
const { state } = useAccess(app);
|
|
@@ -164,7 +164,7 @@ by keyboard and by touch even on an enabled control. That class sits in the **ba
|
|
|
164
164
|
`buttonVariants`, not in an icon-only branch — so the wrapper pattern applies to
|
|
165
165
|
*every* Button, not just the icon-only shape. The wrapping trigger carries
|
|
166
166
|
`tabIndex={0}` for the same reason: a keyboard user has to be able to reach the hint.
|
|
167
|
-
This mirrors what `@
|
|
167
|
+
This mirrors what `@lepsto/ui` documents above `ButtonIconOnlyProps` in `button.tsx`
|
|
168
168
|
(`Button --disabled-with-tooltip` shows both halves).
|
|
169
169
|
|
|
170
170
|
Controls that take no `title` at all — the kit's `Switch`, for one — have no other
|
|
@@ -543,7 +543,7 @@ Prefer **one line in the card's footer**, stating the constraint before anyone
|
|
|
543
543
|
starts editing:
|
|
544
544
|
|
|
545
545
|
```tsx
|
|
546
|
-
import { Card, CardNote } from '@
|
|
546
|
+
import { Card, CardNote } from '@lepsto/ui';
|
|
547
547
|
|
|
548
548
|
<Card title="Domain settings">
|
|
549
549
|
{fields}
|
|
@@ -28,7 +28,7 @@ There is no `./navigation` module. FED-011 — the shell's extension-menu
|
|
|
28
28
|
contract — is **RETIRED (2026-08)**: the shell never registers, preloads or
|
|
29
29
|
calls it, there is no `subscribeNavItems` (v1 or v2) and no
|
|
30
30
|
`navContractVersion` negotiation, and the menu the shell renders while your app
|
|
31
|
-
is open comes from **your own** `
|
|
31
|
+
is open comes from **your own** `lepsto.app.yaml` — the `nav.sections` block
|
|
32
32
|
(APP-011) — not from your App code, and not from a toolkit manifest.
|
|
33
33
|
|
|
34
34
|
Still mapping the expose is inert, not an error — you just ship a chunk nobody
|
|
@@ -46,7 +46,7 @@ router.
|
|
|
46
46
|
The rows the module used to publish are now data in your App's manifest:
|
|
47
47
|
|
|
48
48
|
```yaml
|
|
49
|
-
#
|
|
49
|
+
# lepsto.app.yaml
|
|
50
50
|
nav:
|
|
51
51
|
icon: flask-conical
|
|
52
52
|
sections:
|
|
@@ -68,7 +68,7 @@ how a change reaches production are in APP-011.
|
|
|
68
68
|
|
|
69
69
|
## Shared singletons: `>=` floors, not carets, on 0.x packages
|
|
70
70
|
|
|
71
|
-
`react`, `react-dom`, `react-router`, and `@
|
|
71
|
+
`react`, `react-dom`, `react-router`, and `@lepsto/ui` MUST be declared as
|
|
72
72
|
shared singletons, never bundled (FED-005), pinned via `@module-federation/vite`
|
|
73
73
|
at exactly `1.16.12` (FED-006):
|
|
74
74
|
|
|
@@ -77,18 +77,25 @@ const SHARED = {
|
|
|
77
77
|
react: { singleton: true, strictVersion: false, requiredVersion: '^19' },
|
|
78
78
|
'react-dom': { singleton: true, strictVersion: false, requiredVersion: '^19' },
|
|
79
79
|
'react-router': { singleton: true, strictVersion: false, requiredVersion: '^7.18' },
|
|
80
|
-
//
|
|
81
|
-
// so a routine shell
|
|
82
|
-
|
|
80
|
+
// The kit is shared on a `>=` floor, NOT a caret: a caret pins the share to one
|
|
81
|
+
// major (or, on a 0.x package, one minor), so a routine shell kit bump would fail
|
|
82
|
+
// Module Federation version negotiation.
|
|
83
|
+
'@lepsto/ui': { singleton: true, strictVersion: false, requiredVersion: '>=0.1.0' },
|
|
83
84
|
};
|
|
84
85
|
```
|
|
85
86
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
87
|
+
Two different ranges describe two different things here, and they are meant to
|
|
88
|
+
disagree:
|
|
89
|
+
|
|
90
|
+
- the **share range** (`requiredVersion` above) is deliberately open — `>=0.1.0`,
|
|
91
|
+
the same shape the shell declares. It only has to guarantee a floor, so it
|
|
92
|
+
survives every upstream bump of the kit without breaking MF negotiation.
|
|
93
|
+
- the **dependency range** in your `package.json` is `^9.0.0`, the major the
|
|
94
|
+
shell actually runs (see "Three things that are easy to get wrong" below).
|
|
95
|
+
|
|
96
|
+
Pin the share with a caret and the next kit bump in the shell fails version
|
|
97
|
+
negotiation and your remote won't load. Any other shared singleton you add
|
|
98
|
+
(e.g. an icon package) uses the same `>=` floor.
|
|
92
99
|
|
|
93
100
|
## Dual build: standalone + federation, merged into one `dist/`
|
|
94
101
|
|
|
@@ -153,16 +160,16 @@ Four files, ready to copy.
|
|
|
153
160
|
tailwindcss/theme.css at all. */
|
|
154
161
|
|
|
155
162
|
/* Layer order first, so positions are fixed before Tailwind emits its own.
|
|
156
|
-
Mirrors the shell's declaration in
|
|
163
|
+
Mirrors the shell's declaration in lepsto-workspace:apps/web/src/index.css. */
|
|
157
164
|
@layer theme, base, components, remote-utilities, utilities;
|
|
158
165
|
|
|
159
166
|
@config '../tailwind.config.ts';
|
|
160
167
|
@import 'tailwindcss/utilities.css' layer(remote-utilities);
|
|
161
|
-
@import '@
|
|
168
|
+
@import '@lepsto/ui/styles-federated.css';
|
|
162
169
|
|
|
163
|
-
/* Tailwind must scan the kit's compiled output, or the classes @
|
|
170
|
+
/* Tailwind must scan the kit's compiled output, or the classes @lepsto/ui
|
|
164
171
|
components use are never generated. */
|
|
165
|
-
@source '../node_modules/@
|
|
172
|
+
@source '../node_modules/@lepsto/ui/dist/index.js';
|
|
166
173
|
|
|
167
174
|
/* ...and must NOT scan your tests: a utility class named as a test fixture is
|
|
168
175
|
just a string to Tailwind, and would be compiled into the shipped sheet. */
|
|
@@ -178,12 +185,12 @@ Four files, ready to copy.
|
|
|
178
185
|
@config '../tailwind.config.ts';
|
|
179
186
|
@import 'tailwindcss';
|
|
180
187
|
@import url('https://fonts.googleapis.com/css2?family=Inter');
|
|
181
|
-
@import '@
|
|
188
|
+
@import '@lepsto/ui/styles.css';
|
|
182
189
|
@import './base.css';
|
|
183
190
|
|
|
184
191
|
/* Same reason as in the federation entry: Tailwind generates utilities per
|
|
185
192
|
entry, and neither entry's scan reaches node_modules on its own. */
|
|
186
|
-
@source '../node_modules/@
|
|
193
|
+
@source '../node_modules/@lepsto/ui/dist/index.js';
|
|
187
194
|
```
|
|
188
195
|
|
|
189
196
|
```css
|
|
@@ -197,10 +204,10 @@ Four files, ready to copy.
|
|
|
197
204
|
|
|
198
205
|
```ts
|
|
199
206
|
// tailwind.config.ts — the single source of scale vocabulary, for both entries
|
|
200
|
-
import {
|
|
207
|
+
import { lepstoPreset } from '@lepsto/ui/tailwind-preset';
|
|
201
208
|
|
|
202
209
|
export default {
|
|
203
|
-
presets: [
|
|
210
|
+
presets: [lepstoPreset],
|
|
204
211
|
content: ['./index.html', './src/**/*.{ts,tsx}'],
|
|
205
212
|
};
|
|
206
213
|
```
|
|
@@ -221,8 +228,8 @@ import './index.css';
|
|
|
221
228
|
|
|
222
229
|
**`theme.css` is optional, and it is not a token bridge.** There is no
|
|
223
230
|
`src/theme.css` in the layout above, and an app with no tokens of its own does
|
|
224
|
-
not need one. The kit's tokens come from `@
|
|
225
|
-
federation and `@
|
|
231
|
+
not need one. The kit's tokens come from `@lepsto/ui/styles-federated.css` in
|
|
232
|
+
federation and `@lepsto/ui/styles.css` in standalone; re-declaring them locally
|
|
226
233
|
is a hand-copied set that drifts from the kit silently, and an `@theme` block
|
|
227
234
|
restating the kit's scales is exactly what APP-009 forbids.
|
|
228
235
|
|
|
@@ -234,16 +241,16 @@ first paint. That exact block is what shipped the production font jump; it
|
|
|
234
241
|
belongs in `src/base.css`, standalone-only.
|
|
235
242
|
|
|
236
243
|
**The sanctioned federated export, not a hand-rolled filter.**
|
|
237
|
-
`@
|
|
244
|
+
`@lepsto/ui/styles-federated.css` is `styles.css` minus the `@font-face` blocks
|
|
238
245
|
and the `@layer base` — tokens, `--color-*` aliases, `.link`, the `.motion-*`
|
|
239
246
|
helpers and the compiled tw-animate-css layer are all still there. A prebuild
|
|
240
247
|
script that reads the kit's stylesheet out of `node_modules` and strips the
|
|
241
248
|
forbidden blocks itself breaks on any restructure of a file you don't own.
|
|
242
|
-
Depend on `@
|
|
249
|
+
Depend on `@lepsto/ui` at `^9.0.0`, the range the shell runs.
|
|
243
250
|
|
|
244
251
|
**`layer(remote-utilities)` only after the shell declares the order.** The
|
|
245
252
|
shell already ships `@layer theme, base, components, remote-utilities,
|
|
246
|
-
utilities;` (`
|
|
253
|
+
utilities;` (`lepsto-workspace:apps/web/src/index.css`). Adopt the layer
|
|
247
254
|
against a shell that hasn't, and `remote-utilities` becomes the last-declared —
|
|
248
255
|
and therefore highest-priority — layer, so every one of your utilities beats
|
|
249
256
|
every shell utility. Verify the shell first; adopting early is a regression,
|
|
@@ -11,29 +11,29 @@ pnpm dev
|
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
This starts the app on its own, outside any shell, proxied through
|
|
14
|
-
`@
|
|
14
|
+
`@lepsto/app-dev`'s local dev server. Platform API calls made through your
|
|
15
15
|
`sdk` (created with `createLesslyApp`, see `recipes/sdk-usage.md`) are
|
|
16
16
|
forwarded through a bearer proxy at exactly this path:
|
|
17
17
|
|
|
18
18
|
```
|
|
19
|
-
/
|
|
19
|
+
/lepsto-api
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
`@
|
|
23
|
-
proxies through `/
|
|
22
|
+
`@lepsto/app-dev` attaches your locally stored bearer token to everything it
|
|
23
|
+
proxies through `/lepsto-api`, so your SDK client just talks to that path in
|
|
24
24
|
dev — it never sees or handles the token itself.
|
|
25
25
|
|
|
26
|
-
So in dev you pass `baseUrl: '/
|
|
26
|
+
So in dev you pass `baseUrl: '/lepsto-api'` — a page-relative `baseUrl` is
|
|
27
27
|
supported and resolved against the current document (browser-only); see
|
|
28
28
|
`recipes/sdk-usage.md`.
|
|
29
29
|
|
|
30
30
|
### Device-code login
|
|
31
31
|
|
|
32
32
|
The first time you run `pnpm dev` (or once your local session expires),
|
|
33
|
-
`@
|
|
33
|
+
`@lepsto/app-dev` walks you through a device-code login: it prints a
|
|
34
34
|
verification URL and a short code, opens your browser, and polls until you
|
|
35
35
|
approve. Once approved, it stores the resulting bearer token locally and the
|
|
36
|
-
`/
|
|
36
|
+
`/lepsto-api` proxy starts attaching it automatically. You don't write any of
|
|
37
37
|
this — it's ambient, per APP-005: an App MUST NOT implement its own login,
|
|
38
38
|
token handling, or refresh.
|
|
39
39
|
|
|
@@ -97,15 +97,15 @@ go back to the deployed remote.
|
|
|
97
97
|
|
|
98
98
|
## Keeping your local setup current
|
|
99
99
|
|
|
100
|
-
Update the SDK and `@
|
|
100
|
+
Update the SDK and `@lepsto/app-dev` with the `@latest` form, never `npm
|
|
101
101
|
update`:
|
|
102
102
|
|
|
103
103
|
```sh
|
|
104
104
|
npm i @lepsto/sdk-app@latest
|
|
105
|
-
npm i @
|
|
105
|
+
npm i @lepsto/app-dev@latest
|
|
106
106
|
```
|
|
107
107
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
would never actually deliver those updates (see APP-007).
|
|
108
|
+
Both are pinned with caret ranges, and a caret range stops `npm update` at the
|
|
109
|
+
next major — or, for a pre-1.0 package like `@lepsto/app-dev`, at the next
|
|
110
|
+
minor. The SDK cuts majors routinely as the platform catalog changes, so
|
|
111
|
+
`npm update` would never actually deliver those updates (see APP-007).
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Recipe: calling the platform API
|
|
2
2
|
|
|
3
|
-
How to reach
|
|
3
|
+
How to reach Lepsto platform data from an App. The normative rule is APP-001
|
|
4
4
|
(all platform data access goes through `@lepsto/sdk-app`) and APP-006 (prefer
|
|
5
5
|
the generated option factories) — this page shows the *how*.
|
|
6
6
|
|
|
@@ -13,10 +13,10 @@ Proxy namespace tree:
|
|
|
13
13
|
import { createLesslyApp } from '@lepsto/sdk-app';
|
|
14
14
|
|
|
15
15
|
const sdk = createLesslyApp({
|
|
16
|
-
baseUrl: 'https://api.
|
|
16
|
+
baseUrl: 'https://api.lepsto.dev',
|
|
17
17
|
productId: 'prod_123',
|
|
18
|
-
// getCsrfToken defaults to reading the `lepsto_csrf` cookie
|
|
19
|
-
//
|
|
18
|
+
// getCsrfToken defaults to reading the `lepsto_csrf` cookie, then
|
|
19
|
+
// `lessly_csrf`; override for SSR/tests.
|
|
20
20
|
});
|
|
21
21
|
|
|
22
22
|
const connectors = await sdk.organization.connectors.list({ productId: 'prod_123' });
|
|
@@ -31,18 +31,18 @@ await sdk.organization.product.create({ name: 'Acme' });
|
|
|
31
31
|
|
|
32
32
|
`baseUrl` may be either form:
|
|
33
33
|
|
|
34
|
-
- **Absolute** — `'https://api.
|
|
34
|
+
- **Absolute** — `'https://api.lepsto.dev'`. Works anywhere, including SSR and
|
|
35
35
|
tests.
|
|
36
|
-
- **Page-relative** — `'/
|
|
36
|
+
- **Page-relative** — `'/lepsto-api'`, the path `pnpm dev` proxies through
|
|
37
37
|
(see `recipes/local-dev.md`). It is resolved against the current document via
|
|
38
38
|
`globalThis.location`, so it is **browser-only**: outside a browser the SDK
|
|
39
|
-
throws a named error (`@lepsto/sdk-app: relative baseUrl "/
|
|
39
|
+
throws a named error (`@lepsto/sdk-app: relative baseUrl "/lepsto-api" cannot
|
|
40
40
|
be resolved outside a browser`) instead of an opaque `Invalid URL`. Tests and
|
|
41
41
|
SSR must pass an absolute base.
|
|
42
42
|
|
|
43
43
|
```ts
|
|
44
44
|
const sdk = createLesslyApp({
|
|
45
|
-
baseUrl: import.meta.env.DEV ? '/
|
|
45
|
+
baseUrl: import.meta.env.DEV ? '/lepsto-api' : 'https://api.lepsto.dev',
|
|
46
46
|
productId: 'prod_123',
|
|
47
47
|
});
|
|
48
48
|
```
|
|
@@ -74,7 +74,7 @@ try {
|
|
|
74
74
|
### Missing CSRF cookie
|
|
75
75
|
|
|
76
76
|
Mutating calls (`POST`, `PUT`, `PATCH`, `DELETE`) require the `lepsto_csrf`
|
|
77
|
-
cookie, or
|
|
77
|
+
cookie, or `lessly_csrf` as a fallback. If both are absent, the SDK throws before any network call:
|
|
78
78
|
`LesslyApiError` with `status: 0` and `code: 'csrf_cookie_missing'`. There is no
|
|
79
79
|
retry and no hidden token refresh — re-establish the session, or supply
|
|
80
80
|
`getCsrfToken` for SSR/tests. Read-only calls are unaffected.
|
|
@@ -130,7 +130,7 @@ generated from the live catalog; check `client.gen.ts` (or your editor's
|
|
|
130
130
|
autocomplete) for which shape a given operation takes.
|
|
131
131
|
|
|
132
132
|
The available namespaces track the live catalog and **grow as platform
|
|
133
|
-
extensions migrate to `@
|
|
133
|
+
extensions migrate to `@lepsto-platform/tools`** — a namespace appears here only once its
|
|
134
134
|
tools carry a REST binding. Run `npm i @lepsto/sdk-app@latest` to pick up newly
|
|
135
135
|
migrated namespaces. To see exactly what a given version exposes, check its
|
|
136
136
|
subpaths in `package.json` `exports`, or the `manifest.gen.ts` namespace list.
|
|
@@ -147,7 +147,7 @@ the socket, and hands back a small handle:
|
|
|
147
147
|
import { createLesslyApp } from '@lepsto/sdk-app';
|
|
148
148
|
import { playgroundWsEchoConnect } from '@lepsto/sdk-app/playground';
|
|
149
149
|
|
|
150
|
-
const sdk = createLesslyApp({ baseUrl: 'https://api.
|
|
150
|
+
const sdk = createLesslyApp({ baseUrl: 'https://api.lepsto.dev', productId: 'prod_123' });
|
|
151
151
|
|
|
152
152
|
const stream = playgroundWsEchoConnect(sdk, { room: 'lobby' });
|
|
153
153
|
const off = stream.onMessage((frame) => console.log(frame));
|
package/docs/rules.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# App Rules
|
|
2
2
|
|
|
3
|
-
Normative rules for building a
|
|
3
|
+
Normative rules for building a Lepsto App on `@lepsto/sdk-app`. Read this
|
|
4
4
|
before writing code; see `README.md` for the map of the rest of the guide.
|
|
5
5
|
|
|
6
6
|
Severity (RFC 2119): **MUST** blocks merge, **SHOULD** is a strong
|
|
@@ -17,7 +17,7 @@ rationale, and examples.
|
|
|
17
17
|
|
|
18
18
|
### APP-001 (MUST) — All platform data access goes through `@lepsto/sdk-app`
|
|
19
19
|
|
|
20
|
-
Every read or write to a
|
|
20
|
+
Every read or write to a Lepsto platform API MUST go through a
|
|
21
21
|
`@lepsto/sdk-app` client created with `createLesslyApp`, or through the
|
|
22
22
|
generated `*QueryOptions`/`*MutationOptions` factories built on top of it. An
|
|
23
23
|
App MUST NOT `fetch` a platform host directly, and MUST NOT use any other HTTP
|
|
@@ -43,9 +43,9 @@ of its logic runs in the browser, built on `@lepsto/sdk-app` and the Module
|
|
|
43
43
|
Federation contract below. If a feature needs server-side state or a
|
|
44
44
|
service-to-service call, it belongs in an extension, not an App.
|
|
45
45
|
|
|
46
|
-
### APP-003 (MUST) — Manifest is `
|
|
46
|
+
### APP-003 (MUST) — Manifest is `lepsto.app.yaml`, schema v1
|
|
47
47
|
|
|
48
|
-
The manifest file is `
|
|
48
|
+
The manifest file is `lepsto.app.yaml`, and its top-level surface is exactly:
|
|
49
49
|
`app_schema_version: 1`, `id`, `title`, `version`, `nav`. No other top-level
|
|
50
50
|
field is valid — in particular, no extension/backend manifest field (`s2s`,
|
|
51
51
|
`webhooks`, `billing`, `analytics`, `routing`, `public`, ...) belongs in an App
|
|
@@ -61,7 +61,7 @@ being stripped.
|
|
|
61
61
|
|
|
62
62
|
An App exposes `./App` as its Module Federation remote entry, implementing
|
|
63
63
|
the shell's remote contract (FED-001). The Module Federation `name` MUST equal
|
|
64
|
-
the manifest `id` (FED-004). React, React DOM, React Router, and `@
|
|
64
|
+
the manifest `id` (FED-004). React, React DOM, React Router, and `@lepsto/ui`
|
|
65
65
|
MUST be declared as shared singletons, never bundled (FED-005), using
|
|
66
66
|
`@module-federation/vite` pinned at exactly `1.16.12` (FED-006). The asset
|
|
67
67
|
base in federation mode is the absolute path `/~/<id>/`. The build MUST
|
|
@@ -71,7 +71,7 @@ artifacts (FED-007).
|
|
|
71
71
|
`./App` is the **only** module an App exposes. There is no `./navigation`
|
|
72
72
|
contract: the shell no longer loads such a module, there is no
|
|
73
73
|
`subscribeNavItems` and no `navContractVersion` negotiation, and the menu the
|
|
74
|
-
shell renders comes from **your own** `
|
|
74
|
+
shell renders comes from **your own** `lepsto.app.yaml` — the `nav.sections`
|
|
75
75
|
block (APP-011) — not from your App code, and not from a toolkit manifest.
|
|
76
76
|
FED-011 is **RETIRED (2026-08)**. Still mapping the expose is inert rather than
|
|
77
77
|
an error — it just ships a chunk nobody fetches — but a new App MUST NOT add
|
|
@@ -115,10 +115,12 @@ current with:
|
|
|
115
115
|
npm i @lepsto/sdk-app@latest
|
|
116
116
|
```
|
|
117
117
|
|
|
118
|
-
Use this exact `@latest` form — not `npm update`.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
118
|
+
Use this exact `@latest` form — not `npm update`. A caret range never lets
|
|
119
|
+
`npm update` cross a major version, and this SDK cuts majors routinely: the
|
|
120
|
+
publish pipeline classifies a removed field, a narrowed enum or a newly
|
|
121
|
+
required input as a major, and the platform catalog produces those regularly.
|
|
122
|
+
So `npm update` would leave you behind on the SDK no matter which version you
|
|
123
|
+
are pinned at.
|
|
122
124
|
|
|
123
125
|
### APP-008 (MUST) — The federation CSS entry is slim and global-free
|
|
124
126
|
|
|
@@ -134,14 +136,14 @@ NOT contain:
|
|
|
134
136
|
`font-size`, `line-height`, `color`, `background`, `margin`, `padding`,
|
|
135
137
|
`border-*`, `box-sizing`, `-webkit-text-size-adjust` — on `html`, `body`,
|
|
136
138
|
`:root` or `*`;
|
|
137
|
-
- an `@import` of a web font, of `@
|
|
139
|
+
- an `@import` of a web font, of `@lepsto/ui/styles.css`, or of the full
|
|
138
140
|
`tailwindcss` entry (which bundles **preflight**).
|
|
139
141
|
|
|
140
142
|
The prohibition holds wherever the rule comes from, `@apply` included:
|
|
141
143
|
`body { @apply bg-bg-primary … }` in the App's own base layer is exactly as
|
|
142
144
|
forbidden as an imported reset. The App's base layer belongs in a separate
|
|
143
145
|
`src/base.css` that only the **standalone** entry imports. The standalone entry
|
|
144
|
-
is unconstrained by this rule: it keeps the fonts, `@
|
|
146
|
+
is unconstrained by this rule: it keeps the fonts, `@lepsto/ui/styles.css`, the
|
|
145
147
|
full `tailwindcss` import and the base layer, because there the App owns the
|
|
146
148
|
page.
|
|
147
149
|
|
|
@@ -150,25 +152,25 @@ page.
|
|
|
150
152
|
App's own subtree reads them. Inherited and visual properties are what is
|
|
151
153
|
forbidden, because the App is composed inside the shell's already-painted page
|
|
152
154
|
and a `body` or `*` rule addresses the whole live document, shell chrome
|
|
153
|
-
included. This line is load-bearing: `@
|
|
155
|
+
included. This line is load-bearing: `@lepsto/ui/styles-federated.css`
|
|
154
156
|
legitimately ships a `*, ::before, ::after, ::backdrop { --tw-*: … }` block
|
|
155
157
|
(Tailwind v4's internal variable shim), and a guard written against selectors
|
|
156
158
|
instead of declarations fails on the very import this rule prescribes.
|
|
157
159
|
|
|
158
160
|
**Kit tokens.** An App that needs the design-system variables MUST import
|
|
159
|
-
`@
|
|
161
|
+
`@lepsto/ui/styles-federated.css` — `styles.css` minus the `@font-face` blocks
|
|
160
162
|
and the `@layer base`, keeping the token variables, the `--color-*` aliases,
|
|
161
163
|
`.link`, the `.motion-*` helpers and the compiled tw-animate-css layer. Depend
|
|
162
|
-
on `@
|
|
164
|
+
on `@lepsto/ui` at `^9.0.0`, the range the shell itself runs. An App MUST NOT
|
|
163
165
|
hand-copy the kit's tokens into a local `theme.css` (it silently drifts from
|
|
164
|
-
the kit), and MUST NOT hand-filter `@
|
|
166
|
+
the kit), and MUST NOT hand-filter `@lepsto/ui/styles.css` with a prebuild
|
|
165
167
|
script (it breaks on any restructure of a file the App does not own).
|
|
166
168
|
|
|
167
169
|
**Scanning.** Tailwind generates only the classes it finds, and it scans the
|
|
168
170
|
project, not `node_modules`. The federation entry MUST therefore
|
|
169
171
|
`@source` the kit's compiled output
|
|
170
|
-
(`@source '../node_modules/@
|
|
171
|
-
`@
|
|
172
|
+
(`@source '../node_modules/@lepsto/ui/dist/index.js';`) or the classes
|
|
173
|
+
`@lepsto/ui` components use are never emitted — and it SHOULD exclude test
|
|
172
174
|
files (`@source not '../src/**/*.test.tsx';`), since a utility class named as a
|
|
173
175
|
test fixture is just a string to Tailwind and would otherwise be compiled into
|
|
174
176
|
the shipped stylesheet.
|
|
@@ -185,13 +187,13 @@ For the production defect this comes from — a remote's late-loading `body`
|
|
|
185
187
|
rule re-fonting the shell's chrome — see FED-008 in the toolkit-guide.
|
|
186
188
|
`recipes/federation.md` has the canonical stylesheets.
|
|
187
189
|
|
|
188
|
-
### APP-009 (MUST) — One source of scale vocabulary: `
|
|
190
|
+
### APP-009 (MUST) — One source of scale vocabulary: `lepstoPreset`
|
|
189
191
|
|
|
190
192
|
An App takes its **scale vocabulary** — type, spacing, radii, font weight,
|
|
191
193
|
line height, letter spacing — from the design-system preset the shell is built
|
|
192
|
-
on: `
|
|
194
|
+
on: `lepstoPreset`, exported by `@lepsto/ui/tailwind-preset`. Concretely:
|
|
193
195
|
|
|
194
|
-
- `tailwind.config.ts` sets `presets: [
|
|
196
|
+
- `tailwind.config.ts` sets `presets: [lepstoPreset]`;
|
|
195
197
|
- **both** CSS entries carry `@config '../tailwind.config.ts'`;
|
|
196
198
|
- the App declares no scales of its own and keeps no `@theme` block bridging
|
|
197
199
|
to them;
|
|
@@ -231,7 +233,7 @@ full `tailwindcss` import (APP-008), where the App owns the page and there is
|
|
|
231
233
|
nothing to rank against.
|
|
232
234
|
|
|
233
235
|
This works because the shell pre-declares the layer order in
|
|
234
|
-
`
|
|
236
|
+
`lepsto-workspace:apps/web/src/index.css`:
|
|
235
237
|
|
|
236
238
|
```css
|
|
237
239
|
@layer theme, base, components, remote-utilities, utilities;
|
|
@@ -257,7 +259,7 @@ the App's own nodes.
|
|
|
257
259
|
### APP-011 (SHOULD) — Declare the rail menu in your own manifest
|
|
258
260
|
|
|
259
261
|
The rail menu the shell draws while your App is open comes from your App's own
|
|
260
|
-
`
|
|
262
|
+
`lepsto.app.yaml`, in an optional `nav.sections` block. An App with more than
|
|
261
263
|
one page SHOULD declare it; without it the shell has nothing of yours to draw
|
|
262
264
|
(see *No block* below).
|
|
263
265
|
|
|
@@ -326,7 +328,7 @@ table rather than drawing a partial disclosure.
|
|
|
326
328
|
so adding, editing and removing sections all land without a `version` bump.
|
|
327
329
|
Bumping `version` on release remains APP-007.
|
|
328
330
|
|
|
329
|
-
**The scaffold's linter does not check this block.** `create-
|
|
331
|
+
**The scaffold's linter does not check this block.** `create-lepsto-app lint`
|
|
330
332
|
validates the top-level surface and `nav.icon` only; it neither rejects nor
|
|
331
333
|
warns on `nav.sections`, and it will not catch a malformed one. The platform's
|
|
332
334
|
registration validation is the authority — a menu that lints clean locally can
|
|
@@ -499,7 +501,7 @@ Pass the generated method rather than a hand-written tool id
|
|
|
499
501
|
(`app.access.can(app.mail.domain.create)`): the accessor path is a lossy view
|
|
500
502
|
of the tool id, so a literal string can silently drift from the call it gates.
|
|
501
503
|
|
|
502
|
-
One gap is known and accepted: `@
|
|
504
|
+
One gap is known and accepted: `@lepsto/ui`'s `ConfirmDialog` takes an `onError`
|
|
503
505
|
that returns a string, so the kit picks the tone and a refusal raised inside the
|
|
504
506
|
dialog cannot be painted neutrally yet. An App SHOULD still route that error
|
|
505
507
|
through `isAccessDenied()` for the *words*, and MUST NOT reimplement the confirm
|