@frontfriend/sdk 1.2.4 → 1.2.6
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/README.md +13 -3
- package/dist/application-adoption.d.ts +15 -1
- package/dist/cli.js +194 -194
- package/dist/lib/core/adoption.js +1 -1
- package/dist/lib/core/api-client.js +6 -6
- package/dist/lib/core/application-adoption.js +18 -18
- package/dist/lib/core/cached-components-config.js +4 -4
- package/dist/lib/core/credentials.js +6 -6
- package/dist/lib/core/token-artifact-client.js +4 -4
- package/dist/mcp.cjs +100 -100
- package/dist/next.js +4 -4
- package/dist/package.json +1 -1
- package/dist/vite.js +9 -9
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -326,7 +326,7 @@ npx frontfriend init --tag <tag-name-or-id>
|
|
|
326
326
|
|
|
327
327
|
`--version` takes a Release ID, not an SDK version. A Studio refusal, such as a missing login or no access to the Design System, stops initialization.
|
|
328
328
|
|
|
329
|
-
After the tokens, an online `init` registers the App named in `frontfriend.config.js` on its tag (`--tag`, then `tag`) with its `framework` and `primitive`, so `update` and the design reads find it. When Studio refuses the registration, `init` stops with the reason; the installed tokens stay. During an outage it keeps the tokens and asks you to run `init` again. When the App adopts contracts and `frontfriend.lock.json` pins a design snapshot, `init` also writes that snapshot's contracts to `.frontfriend/design/` and, when they are missing or belong to another snapshot, its rules to `.frontfriend/rules/`: the same files `update` writes.
|
|
329
|
+
After the tokens, an online `init` signed in as a person registers the App named in `frontfriend.config.js` on its tag (`--tag`, then `tag`) with its `framework` and `primitive`, so `update` and the design reads find it. When Studio refuses the registration, `init` stops with the reason; the installed tokens stay. With a machine credential, or with `--no-register`, `init` installs the selected tokens and never registers the App or changes its Release tag (see [Builds and CI](#builds-and-ci)). During an outage it keeps the tokens and asks you to run `init` again. When the App adopts contracts and `frontfriend.lock.json` pins a design snapshot, `init` also writes that snapshot's contracts to `.frontfriend/design/` and, when they are missing or belong to another snapshot, its rules to `.frontfriend/rules/`: the same files `update` writes.
|
|
330
330
|
|
|
331
331
|
`frontfriend.lock.json` lists its contract pins by slug, then kind, and its `adoptionDigest` does not depend on the order of the pins. A lock written by an earlier SDK in another order is still valid; `update` keeps its bytes until the adoption itself changes.
|
|
332
332
|
|
|
@@ -346,9 +346,19 @@ The default API uses the production token CDN automatically. For a custom API, s
|
|
|
346
346
|
|
|
347
347
|
Downloads validate artifact identity and integrity. Access refusals and invalid data stop initialization. Token delivery does not update component files or publish changes; `init --offline` also does not register the application or write contracts. Run `init`, `connect` or `design sync` online for those operations. External fonts and images have their own availability.
|
|
348
348
|
|
|
349
|
-
## CI
|
|
349
|
+
## Builds and CI
|
|
350
350
|
|
|
351
|
-
|
|
351
|
+
Builds authenticate with a machine credential: create one with the `components:read` permission on the **API keys** page of the Workspace in Studio, and set it as `FF_AUTH_TOKEN` through your CI secret store. Do not commit it to project configuration or print it in build logs. Online token delivery, private components and design rules require it; `init --offline` does not.
|
|
352
|
+
|
|
353
|
+
In CI or a Docker build, select the tag the build ships:
|
|
354
|
+
|
|
355
|
+
```sh
|
|
356
|
+
FF_AUTH_TOKEN=<machine credential> npx frontfriend init --tag <tag-name>
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
A machine credential is read-only for the App. `init` installs the tokens of the requested tag and prints `Build mode: App registration skipped (machine credential).`; it never registers the App or moves its Release tag in Studio, so a preview build on `next` does not move a production App off `base`. Pass `--no-register` to get the same behavior with any credential. Studio never changes an App for a machine credential either: it answers the registration of an earlier SDK with the App unchanged, so those builds also install the requested tag and leave the App on its own tag. If Studio refuses a registration with `MACHINE_CREDENTIAL_READ_ONLY`, `init` reports the registration as skipped and succeeds.
|
|
360
|
+
|
|
361
|
+
`update`, `adopt`, `download` and `add` with a machine credential use the App's current Release tag. They stop with a message when the selection would bind the App or move it to another tag. `connect` stops at its login step: it registers the App, which needs a person's login (`frontfriend login`, with `FF_AUTH_TOKEN` unset). Change an App's tag in Studio or with a person's login.
|
|
352
362
|
|
|
353
363
|
## Existing Tailwind clients
|
|
354
364
|
|
|
@@ -4,7 +4,8 @@ export type AdoptionFile = {
|
|
|
4
4
|
path: string;
|
|
5
5
|
installedHash: string | null;
|
|
6
6
|
baselineHash: string;
|
|
7
|
-
|
|
7
|
+
/** The upstream source itself, written by SDK 1.2.5 and earlier. */
|
|
8
|
+
baseline?: string;
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export type AdoptionComponent = {
|
|
@@ -87,6 +88,19 @@ export class ApplicationAdoption {
|
|
|
87
88
|
});
|
|
88
89
|
inspect(resolved: unknown, options?: Record<string, unknown>): unknown;
|
|
89
90
|
diff(lock: unknown): unknown[];
|
|
91
|
+
missingBaselines(
|
|
92
|
+
resolved: unknown,
|
|
93
|
+
lock: unknown,
|
|
94
|
+
): Array<{
|
|
95
|
+
identity: string;
|
|
96
|
+
versionId: string;
|
|
97
|
+
sourceReleaseId: string | null;
|
|
98
|
+
baselineHashes: string[];
|
|
99
|
+
}>;
|
|
100
|
+
baselinesFrom(
|
|
101
|
+
source: unknown,
|
|
102
|
+
missing: ReturnType<ApplicationAdoption["missingBaselines"]>,
|
|
103
|
+
): Record<string, string>;
|
|
90
104
|
planUpdate(
|
|
91
105
|
resolved: unknown,
|
|
92
106
|
options?: Record<string, unknown>,
|