@vardum/shared 0.4.0 → 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.
Files changed (3) hide show
  1. package/README.md +39 -10
  2. package/dist/wire.d.ts +14 -1
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -4,10 +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.0**, used by CLI **0.8.0** and MCP **0.4.0**.
8
- Check [release status and compatibility](https://github.com/f-tuma/vardum/blob/main/docs/npm-release.md)
9
- to confirm npm availability before installing this version. The historical
10
- server compatibility fixture continues to use shared 0.2.0.
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.
11
13
 
12
14
  Shared 0.4.0 adds the guarded-editor wire contract: `VardEditorDefinition`
13
15
  requires the opaque `revision` and each manual item's literal nullable
@@ -17,16 +19,43 @@ resolved delivery versions. It retains `mediaStem`, `mediaOutputPath`, format
17
19
  tables. This client batch keeps CLI schema 2 snapshots; the wire manifest remains
18
20
  schema 1. It does not introduce schema 3.
19
21
 
20
- CLI 0.8.0 and MCP 0.4.0 retain `workspace:^` dependencies in source; their release
21
- archives require `@vardum/shared: ^0.4.0`, which npm resolves transitively.
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.
22
24
 
23
- For a direct consumer, **this installation targets shared 0.4.0** once the
24
- release-status page confirms it is available:
25
+ For a direct consumer, pin **shared 0.4.2**:
25
26
 
26
27
  ```sh
27
- npm install --save-exact @vardum/shared@0.4.0
28
+ npm install --save-exact @vardum/shared@0.4.2
28
29
  ```
29
30
 
30
31
  ```ts
31
- 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
+ };
32
41
  ```
42
+
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
53
+ require a server advertising `vardEditRevision: 1` at `GET /api/capabilities`
54
+ and implementing the guarded `/editor` endpoints. Folder-upload mutation requires
55
+ `folderUploadResume: 1`; importing uploaded files into a Vard also requires
56
+ `folderVardImport: 1`. The upload backend needs migrations through
57
+ `0015_upload_request_checksum.sql` and ready-version checksum metadata.
58
+
59
+ Private delivery still needs a workspace read key. Keep API keys out of source
60
+ control and client-side applications; this package contains no authentication,
61
+ credential storage or server upgrades.
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vardum/shared",
3
- "version": "0.4.0",
3
+ "version": "0.4.2",
4
4
  "description": "Shared Vardum wire types and accepted-format tables",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -25,7 +25,7 @@
25
25
  "url": "git+https://github.com/f-tuma/vardum.git",
26
26
  "directory": "packages/shared"
27
27
  },
28
- "homepage": "https://github.com/f-tuma/vardum/tree/main/packages/shared#readme",
28
+ "homepage": "https://vardum.com",
29
29
  "bugs": {
30
30
  "url": "https://github.com/f-tuma/vardum/issues"
31
31
  },