@lessly/sdk-app 47.0.0 → 47.1.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.
- package/dist/analytics/index.d.cts +1 -1
- package/dist/analytics/index.d.ts +1 -1
- package/dist/brain/index.d.cts +1 -1
- package/dist/brain/index.d.ts +1 -1
- package/dist/{client.gen-BFHxhTU7.d.cts → client.gen-BsvWS7J-.d.cts} +8 -0
- package/dist/{client.gen-BFHxhTU7.d.ts → client.gen-BsvWS7J-.d.ts} +8 -0
- package/dist/consent/index.d.cts +1 -1
- package/dist/consent/index.d.ts +1 -1
- package/dist/content/index.d.cts +1 -1
- package/dist/content/index.d.ts +1 -1
- package/dist/deployment/index.d.cts +1 -1
- package/dist/deployment/index.d.ts +1 -1
- package/dist/index.cjs +8 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/mail/index.d.cts +2 -2
- package/dist/mail/index.d.ts +2 -2
- package/dist/observe/index.d.cts +1 -1
- package/dist/observe/index.d.ts +1 -1
- package/dist/organization/index.d.cts +1 -1
- package/dist/organization/index.d.ts +1 -1
- package/dist/playground/index.d.cts +1 -1
- package/dist/playground/index.d.ts +1 -1
- package/dist/realtime/index.d.cts +1 -1
- package/dist/realtime/index.d.ts +1 -1
- package/dist/support/index.d.cts +1 -1
- package/dist/support/index.d.ts +1 -1
- package/dist/tracking/index.d.cts +1 -1
- package/dist/tracking/index.d.ts +1 -1
- package/dist/users/index.d.cts +1 -1
- package/dist/users/index.d.ts +1 -1
- package/dist/waitlist/index.d.cts +1 -1
- package/dist/waitlist/index.d.ts +1 -1
- package/docs/README.md +1 -1
- package/docs/recipes/federation.md +158 -10
- package/docs/rules.md +150 -4
- package/package.json +2 -2
- package/src/gen/bindings.gen.ts +8 -0
- package/src/gen/types.gen.ts +8 -0
package/docs/rules.md
CHANGED
|
@@ -47,10 +47,22 @@ MUST be declared as shared singletons, never bundled (FED-005), using
|
|
|
47
47
|
`@module-federation/vite` pinned at exactly `1.16.12` (FED-006). The asset
|
|
48
48
|
base in federation mode is the absolute path `/~/<id>/`. The build MUST
|
|
49
49
|
produce one merged dual-mode `dist/` covering both standalone and federation
|
|
50
|
-
artifacts (FED-007).
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
artifacts (FED-007).
|
|
51
|
+
|
|
52
|
+
`./App` is the **only** module an App exposes. There is no `./navigation`
|
|
53
|
+
contract: the shell no longer loads such a module, there is no
|
|
54
|
+
`subscribeNavItems` and no `navContractVersion` negotiation, and the extension
|
|
55
|
+
menu the shell renders is static (a single Home row). FED-011 is **RETIRED
|
|
56
|
+
(2026-08)**. Still mapping the expose is inert rather than an error — it just
|
|
57
|
+
ships a chunk nobody fetches — but a new App MUST NOT add it, and an existing
|
|
58
|
+
one SHOULD delete `src/federation/navigation.ts`, drop the expose, and move
|
|
59
|
+
whatever that module fed the menu (environment lists, tool groups, badges,
|
|
60
|
+
status dots, a settings gear) into its own pages under `./App`'s relative
|
|
61
|
+
routes (FED-003).
|
|
62
|
+
|
|
63
|
+
This rule states the contract; it does not restate FED-001, FED-004, FED-005,
|
|
64
|
+
FED-006, or FED-007 — see those rules for exact wording, rationale, and
|
|
65
|
+
examples.
|
|
54
66
|
|
|
55
67
|
### APP-005 (MUST) — Auth is ambient; an App does not own it
|
|
56
68
|
|
|
@@ -87,3 +99,137 @@ Use this exact `@latest` form — not `npm update`. `@lessly/sdk-app` is
|
|
|
87
99
|
pre-1.0 and pinned with a caret range, so `npm update` never crosses a minor
|
|
88
100
|
version; since this SDK also bumps its minor version whenever the platform
|
|
89
101
|
ships a new tool, `npm update` would never actually deliver those updates.
|
|
102
|
+
|
|
103
|
+
### APP-008 (MUST) — The federation CSS entry is slim and global-free
|
|
104
|
+
|
|
105
|
+
An App has two CSS entries: the **federation** entry (imported by the `./App`
|
|
106
|
+
remote module) and the **standalone** entry (imported by the SPA entry). The
|
|
107
|
+
federation entry's whole transitive graph — that stylesheet, everything it
|
|
108
|
+
`@import`s, and every `@layer base { … }` block the App writes itself — MUST
|
|
109
|
+
NOT contain:
|
|
110
|
+
|
|
111
|
+
- `@font-face`;
|
|
112
|
+
- a `@layer base { … }` block;
|
|
113
|
+
- any rule declaring an inherited or visual property — `font-family`,
|
|
114
|
+
`font-size`, `line-height`, `color`, `background`, `margin`, `padding`,
|
|
115
|
+
`border-*`, `box-sizing`, `-webkit-text-size-adjust` — on `html`, `body`,
|
|
116
|
+
`:root` or `*`;
|
|
117
|
+
- an `@import` of a web font, of `@lessly/ui/styles.css`, or of the full
|
|
118
|
+
`tailwindcss` entry (which bundles **preflight**).
|
|
119
|
+
|
|
120
|
+
The prohibition holds wherever the rule comes from, `@apply` included:
|
|
121
|
+
`body { @apply bg-bg-primary … }` in the App's own base layer is exactly as
|
|
122
|
+
forbidden as an imported reset. The App's base layer belongs in a separate
|
|
123
|
+
`src/base.css` that only the **standalone** entry imports. The standalone entry
|
|
124
|
+
is unconstrained by this rule: it keeps the fonts, `@lessly/ui/styles.css`, the
|
|
125
|
+
full `tailwindcss` import and the base layer, because there the App owns the
|
|
126
|
+
page.
|
|
127
|
+
|
|
128
|
+
**Custom properties are the boundary.** Declarations of `--*` on `html`,
|
|
129
|
+
`body`, `:root` or `*` are fine — they paint nothing until something inside the
|
|
130
|
+
App's own subtree reads them. Inherited and visual properties are what is
|
|
131
|
+
forbidden, because the App is composed inside the shell's already-painted page
|
|
132
|
+
and a `body` or `*` rule addresses the whole live document, shell chrome
|
|
133
|
+
included. This line is load-bearing: `@lessly/ui/styles-federated.css`
|
|
134
|
+
legitimately ships a `*, ::before, ::after, ::backdrop { --tw-*: … }` block
|
|
135
|
+
(Tailwind v4's internal variable shim), and a guard written against selectors
|
|
136
|
+
instead of declarations fails on the very import this rule prescribes.
|
|
137
|
+
|
|
138
|
+
**Kit tokens.** An App that needs the design-system variables MUST import
|
|
139
|
+
`@lessly/ui/styles-federated.css` — `styles.css` minus the `@font-face` blocks
|
|
140
|
+
and the `@layer base`, keeping the token variables, the `--color-*` aliases,
|
|
141
|
+
`.link`, the `.motion-*` helpers and the compiled tw-animate-css layer. Depend
|
|
142
|
+
on `@lessly/ui` at `^4.0.0`, the range the shell itself runs. An App MUST NOT
|
|
143
|
+
hand-copy the kit's tokens into a local `theme.css` (it silently drifts from
|
|
144
|
+
the kit), and MUST NOT hand-filter `@lessly/ui/styles.css` with a prebuild
|
|
145
|
+
script (it breaks on any restructure of a file the App does not own).
|
|
146
|
+
|
|
147
|
+
**Scanning.** Tailwind generates only the classes it finds, and it scans the
|
|
148
|
+
project, not `node_modules`. The federation entry MUST therefore
|
|
149
|
+
`@source` the kit's compiled output
|
|
150
|
+
(`@source '../node_modules/@lessly/ui/dist/index.js';`) or the classes
|
|
151
|
+
`@lessly/ui` components use are never emitted — and it SHOULD exclude test
|
|
152
|
+
files (`@source not '../src/**/*.test.tsx';`), since a utility class named as a
|
|
153
|
+
test fixture is just a string to Tailwind and would otherwise be compiled into
|
|
154
|
+
the shipped stylesheet.
|
|
155
|
+
|
|
156
|
+
**Gate test.** The repository MUST carry a test asserting all of the above over
|
|
157
|
+
the **built** federation CSS, not over the entry file's import list: the source
|
|
158
|
+
imports can read clean while an imported stylesheet carries the base layer. Two
|
|
159
|
+
shapes must not be confused — `@layer base, components;` (semicolon) only
|
|
160
|
+
declares layer order and is harmless; the forbidden shape is the block,
|
|
161
|
+
`@layer\s+base\s*\{`. And a universal rule is a violation only if it declares
|
|
162
|
+
more than custom properties.
|
|
163
|
+
|
|
164
|
+
For the production defect this comes from — a remote's late-loading `body`
|
|
165
|
+
rule re-fonting the shell's chrome — see FED-008 in the extensions-guide.
|
|
166
|
+
`recipes/federation.md` has the canonical stylesheets.
|
|
167
|
+
|
|
168
|
+
### APP-009 (MUST) — One source of scale vocabulary: `lesslyPreset`
|
|
169
|
+
|
|
170
|
+
An App takes its **scale vocabulary** — type, spacing, radii, font weight,
|
|
171
|
+
line height, letter spacing — from the design-system preset the shell is built
|
|
172
|
+
on: `lesslyPreset`, exported by `@lessly/ui/tailwind-preset`. Concretely:
|
|
173
|
+
|
|
174
|
+
- `tailwind.config.ts` sets `presets: [lesslyPreset]`;
|
|
175
|
+
- **both** CSS entries carry `@config '../tailwind.config.ts'`;
|
|
176
|
+
- the App declares no scales of its own and keeps no `@theme` block bridging
|
|
177
|
+
to them;
|
|
178
|
+
- the federation graph MUST NOT import `tailwindcss/theme.css` at all — not in
|
|
179
|
+
`layer(theme)`, and not with `theme(reference)`.
|
|
180
|
+
|
|
181
|
+
**`theme(reference)` does not solve this.** It removes the `:root` emission,
|
|
182
|
+
but Tailwind still inlines the literal as the utility's fallback
|
|
183
|
+
(`var(--text-sm,.875rem)`), so the utility keeps its own value and keeps
|
|
184
|
+
landing on the shell's markup. Measured: the emission went away and the page
|
|
185
|
+
stayed broken.
|
|
186
|
+
|
|
187
|
+
**The norm is "one source of vocabulary", not "no variables on `:root`".**
|
|
188
|
+
Variables that coincide on `:root` between the App and the shell are expected
|
|
189
|
+
and harmless — that is one source reaching the page twice. The absence
|
|
190
|
+
criterion measures **green on a broken page**: the shell declares no `--text-*`
|
|
191
|
+
variable at all (its preset compiles literals into the utilities), so three
|
|
192
|
+
repositories passed that check while the shell's sidebar type was being resized
|
|
193
|
+
by their sheets. Do not write a guard that way.
|
|
194
|
+
|
|
195
|
+
When both sides build on the same preset, rules that share a class name compile
|
|
196
|
+
identically and the collision stops existing. See FED-013 in the
|
|
197
|
+
extensions-guide for the measurements (13px → 14px, line-height 19.5 → 20) and
|
|
198
|
+
for the three wrong fixes it rules out.
|
|
199
|
+
|
|
200
|
+
### APP-010 (MUST) — Federation utilities land in `layer(remote-utilities)`
|
|
201
|
+
|
|
202
|
+
The **federation** entry MUST import Tailwind's utilities into a dedicated
|
|
203
|
+
layer:
|
|
204
|
+
|
|
205
|
+
```css
|
|
206
|
+
@import 'tailwindcss/utilities.css' layer(remote-utilities);
|
|
207
|
+
```
|
|
208
|
+
|
|
209
|
+
never `layer(utilities)`. The **standalone** entry is exempt — it keeps the
|
|
210
|
+
full `tailwindcss` import (APP-008), where the App owns the page and there is
|
|
211
|
+
nothing to rank against.
|
|
212
|
+
|
|
213
|
+
This works because the shell pre-declares the layer order in
|
|
214
|
+
`lessly-workspace:apps/web/src/index.css`:
|
|
215
|
+
|
|
216
|
+
```css
|
|
217
|
+
@layer theme, base, components, remote-utilities, utilities;
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
so every App utility ranks below every shell utility whatever order the sheets
|
|
221
|
+
happen to load in. The App's federation entry SHOULD repeat that same order
|
|
222
|
+
declaration as its first line, so the layer positions are fixed before Tailwind
|
|
223
|
+
emits its own.
|
|
224
|
+
|
|
225
|
+
**Rollout order is strict and asymmetric.** That shell-side declaration MUST be
|
|
226
|
+
in production before an App adopts the layer. Against a shell that has not
|
|
227
|
+
declared the order, `remote-utilities` becomes the last-declared — and
|
|
228
|
+
therefore **highest**-priority — layer, so every App utility beats every shell
|
|
229
|
+
utility: strictly worse than the defect. Verify the shell first; adopting early
|
|
230
|
+
is a regression, not a head start.
|
|
231
|
+
|
|
232
|
+
See FED-014 in the extensions-guide for the measurement (App `.px-2` against
|
|
233
|
+
shell `.sm:px-2.5` — different rule names, so no shared preset can reach them;
|
|
234
|
+
5 of 283 shell chrome nodes affected) and for the accepted symmetric risk on
|
|
235
|
+
the App's own nodes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lessly/sdk-app",
|
|
3
|
-
"version": "47.
|
|
3
|
+
"version": "47.1.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"engines": {
|
|
@@ -111,5 +111,5 @@
|
|
|
111
111
|
"require": "./dist/waitlist/index.cjs"
|
|
112
112
|
}
|
|
113
113
|
},
|
|
114
|
-
"sdkContentHash": "sha256:
|
|
114
|
+
"sdkContentHash": "sha256:2f632b330fc44b037d7df7383647730045f6139639c7188e3aa2e9e9db004f36"
|
|
115
115
|
}
|
package/src/gen/bindings.gen.ts
CHANGED
|
@@ -1369,6 +1369,14 @@ export const bindings: BindingsMap = {
|
|
|
1369
1369
|
{
|
|
1370
1370
|
"in": "query",
|
|
1371
1371
|
"name": "offset"
|
|
1372
|
+
},
|
|
1373
|
+
{
|
|
1374
|
+
"in": "query",
|
|
1375
|
+
"name": "scheduledFrom"
|
|
1376
|
+
},
|
|
1377
|
+
{
|
|
1378
|
+
"in": "query",
|
|
1379
|
+
"name": "scheduledTo"
|
|
1372
1380
|
}
|
|
1373
1381
|
],
|
|
1374
1382
|
"path": "/content/publications",
|
package/src/gen/types.gen.ts
CHANGED
|
@@ -2931,6 +2931,14 @@ postId?: string
|
|
|
2931
2931
|
* Return only publications to this channel.
|
|
2932
2932
|
*/
|
|
2933
2933
|
channelId?: string
|
|
2934
|
+
/**
|
|
2935
|
+
* Return only publications scheduled at or before this ISO-8601 time.
|
|
2936
|
+
*/
|
|
2937
|
+
scheduledTo?: string
|
|
2938
|
+
/**
|
|
2939
|
+
* Return only publications scheduled at or after this ISO-8601 time.
|
|
2940
|
+
*/
|
|
2941
|
+
scheduledFrom?: string
|
|
2934
2942
|
}
|
|
2935
2943
|
|
|
2936
2944
|
export interface ContentPublicationsListOutput {
|