@vardum/shared 0.4.1 → 0.4.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/README.md +29 -9
- package/dist/wire.d.ts +14 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -4,9 +4,12 @@ Wire types and accepted-format tables shared by the Vardum API, dashboard,
|
|
|
4
4
|
CLI and MCP server. Published because `@vardum/cli` and `@vardum/mcp` depend on
|
|
5
5
|
it at runtime; it carries no dependencies of its own.
|
|
6
6
|
|
|
7
|
-
This README describes [shared **0.4.
|
|
8
|
-
used by CLI **0.8.
|
|
9
|
-
|
|
7
|
+
This README describes [shared **0.4.2**](https://www.npmjs.com/package/@vardum/shared/v/0.4.2),
|
|
8
|
+
used by [CLI **0.8.3**](https://www.npmjs.com/package/@vardum/cli/v/0.8.3) and
|
|
9
|
+
[MCP **0.4.2**](https://www.npmjs.com/package/@vardum/mcp/v/0.4.2).
|
|
10
|
+
It publishes the optional `Transformation` fields `bg`, `pad`, `layer`,
|
|
11
|
+
`darkLayer`, `darkColor`, `render: "v2"` and the `"svg"` output format.
|
|
12
|
+
Client snapshot and manifest schemas are unchanged.
|
|
10
13
|
|
|
11
14
|
Shared 0.4.0 adds the guarded-editor wire contract: `VardEditorDefinition`
|
|
12
15
|
requires the opaque `revision` and each manual item's literal nullable
|
|
@@ -16,20 +19,37 @@ resolved delivery versions. It retains `mediaStem`, `mediaOutputPath`, format
|
|
|
16
19
|
tables. This client batch keeps CLI schema 2 snapshots; the wire manifest remains
|
|
17
20
|
schema 1. It does not introduce schema 3.
|
|
18
21
|
|
|
19
|
-
CLI 0.8.
|
|
20
|
-
archives require `@vardum/shared: ^0.4.
|
|
22
|
+
CLI 0.8.3 and MCP 0.4.2 retain `workspace:^` dependencies in source; their release
|
|
23
|
+
archives require `@vardum/shared: ^0.4.2`, which npm resolves transitively.
|
|
21
24
|
|
|
22
|
-
For a direct consumer, pin **shared 0.4.
|
|
25
|
+
For a direct consumer, pin **shared 0.4.2**:
|
|
23
26
|
|
|
24
27
|
```sh
|
|
25
|
-
npm install --save-exact @vardum/shared@0.4.
|
|
28
|
+
npm install --save-exact @vardum/shared@0.4.2
|
|
26
29
|
```
|
|
27
30
|
|
|
28
31
|
```ts
|
|
29
|
-
import { mimeForFilename, supportedMimeTypes, type VardEditorDefinition } from "@vardum/shared";
|
|
32
|
+
import { mimeForFilename, supportedMimeTypes, type Transformation, type VardEditorDefinition } from "@vardum/shared";
|
|
33
|
+
|
|
34
|
+
const raster: Transformation = {
|
|
35
|
+
w: 256, h: 256, fit: "contain", format: "png",
|
|
36
|
+
bg: "#f4f0e8", pad: 12.5, render: "v2",
|
|
37
|
+
};
|
|
38
|
+
const vector: Transformation = {
|
|
39
|
+
format: "svg", layer: "logo", darkLayer: "logo", darkColor: "#e8e4d9",
|
|
40
|
+
};
|
|
30
41
|
```
|
|
31
42
|
|
|
32
|
-
|
|
43
|
+
For a new SVG-to-raster output with `bg`, choose `render: "v2"` explicitly.
|
|
44
|
+
Omission retains the legacy renderer identity. Positive `pad` requires `w`, `h`,
|
|
45
|
+
an explicit format and `fit: "contain"`. SVG output and group/color selection
|
|
46
|
+
require a supported passive geometric SVG; `darkLayer` and `darkColor` are paired,
|
|
47
|
+
and SVG output does not accept `q`.
|
|
48
|
+
|
|
49
|
+
Types alone do not enable backend features. These recipe fields need a matching
|
|
50
|
+
API and renderer; `vardEditRevision: 1` does not advertise transformation support.
|
|
51
|
+
Existing recipes and frozen snapshots are not automatically migrated.
|
|
52
|
+
Editable Vard reads and mutations
|
|
33
53
|
require a server advertising `vardEditRevision: 1` at `GET /api/capabilities`
|
|
34
54
|
and implementing the guarded `/editor` endpoints. Folder-upload mutation requires
|
|
35
55
|
`folderUploadResume: 1`; importing uploaded files into a Vard also requires
|
package/dist/wire.d.ts
CHANGED
|
@@ -7,8 +7,21 @@ export type Transformation = {
|
|
|
7
7
|
w?: number;
|
|
8
8
|
h?: number;
|
|
9
9
|
fit?: "cover" | "contain" | "fill" | "inside" | "outside";
|
|
10
|
-
format?: "avif" | "jpeg" | "png" | "webp";
|
|
10
|
+
format?: "avif" | "jpeg" | "png" | "webp" | "svg";
|
|
11
11
|
q?: number;
|
|
12
|
+
/** Opaque output background, normalized to lowercase #rrggbb. Requires format. */
|
|
13
|
+
bg?: string;
|
|
14
|
+
/** Inset on each edge, as a percent (0–45, at most two decimal places) of the shorter final side.
|
|
15
|
+
* Positive padding requires w, h, format and fit: "contain". */
|
|
16
|
+
pad?: number;
|
|
17
|
+
/** Geometric SVG group ID; keeps the original canvas and ancestor transforms. */
|
|
18
|
+
layer?: string;
|
|
19
|
+
/** Filled shapes in this SVG group use darkColor for a dark color scheme. */
|
|
20
|
+
darkLayer?: string;
|
|
21
|
+
/** Lowercase #rrggbb, paired with darkLayer; requires format: "svg". */
|
|
22
|
+
darkColor?: string;
|
|
23
|
+
/** Opt-in SVG-to-raster background renderer; omission retains legacy rendering. */
|
|
24
|
+
render?: "v2";
|
|
12
25
|
};
|
|
13
26
|
export type VardItem = {
|
|
14
27
|
id: string;
|