@cosmicdrift/kumiko-bundled-features 0.189.0 → 0.191.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cosmicdrift/kumiko-bundled-features",
3
- "version": "0.189.0",
3
+ "version": "0.191.0",
4
4
  "description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
5
5
  "license": "BUSL-1.1",
6
6
  "author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
@@ -67,6 +67,7 @@
67
67
  "./document-ingest-foundation": "./src/document-ingest-foundation/index.ts",
68
68
  "./file-provider-s3-env": "./src/file-provider-s3-env/index.ts",
69
69
  "./file-provider-inmemory": "./src/file-provider-inmemory/index.ts",
70
+ "./file-derivatives": "./src/file-derivatives/index.ts",
70
71
  "./files": "./src/files/index.ts",
71
72
  "./user-data-rights": "./src/user-data-rights/index.ts",
72
73
  "./user-data-rights/web": "./src/user-data-rights/web/index.ts",
@@ -123,12 +124,12 @@
123
124
  "./step-dispatcher": "./src/step-dispatcher/index.ts"
124
125
  },
125
126
  "dependencies": {
126
- "@cosmicdrift/kumiko-dispatcher-live": "0.189.0",
127
- "@cosmicdrift/kumiko-framework": "0.189.0",
128
- "@cosmicdrift/kumiko-headless": "0.189.0",
129
- "@cosmicdrift/kumiko-renderer": "0.189.0",
130
- "@cosmicdrift/kumiko-renderer-web": "0.189.0",
131
- "@cosmicdrift/kumiko-types": "0.189.0",
127
+ "@cosmicdrift/kumiko-dispatcher-live": "0.191.0",
128
+ "@cosmicdrift/kumiko-framework": "0.191.0",
129
+ "@cosmicdrift/kumiko-headless": "0.191.0",
130
+ "@cosmicdrift/kumiko-renderer": "0.191.0",
131
+ "@cosmicdrift/kumiko-renderer-web": "0.191.0",
132
+ "@cosmicdrift/kumiko-types": "0.191.0",
132
133
  "@mollie/api-client": "^4.5.0",
133
134
  "imapflow": "^1.3.3",
134
135
  "mailparser": "^3.9.8",
@@ -0,0 +1 @@
1
+ []
@@ -0,0 +1,33 @@
1
+ // kumiko-feature-version: 1
2
+ //
3
+ // Same extension-point/provider-feature pattern as file-foundation — see
4
+ // r.describe below for what this feature does. Unlike `fileProvider`,
5
+ // renderer selection is MIME-type-deterministic, not per-tenant
6
+ // configurable, so this feature has no `r.config` and no
7
+ // `r.extensionSelector`.
8
+
9
+ import { defineFeature, EXT_DERIVATIVE_RENDERER } from "@cosmicdrift/kumiko-framework/engine";
10
+
11
+ const FEATURE_NAME = "file-derivatives";
12
+
13
+ export const fileDerivativesFeature = defineFeature(FEATURE_NAME, (r) => {
14
+ r.describe(
15
+ "Declares the `derivativeRenderer` extension point. `ctx.derivatives.variant(fileRefId, spec, name)` derives a variant of a tracked FileRef the first time it's requested and reuses the stored result afterwards (derive-on-first-use, keyed by a hash of the spec). Mount at least one `derivatives-*` renderer feature alongside this one — without a registered renderer for the FileRef's MIME type, every `variant(...)` call throws.",
16
+ );
17
+ r.uiHints({
18
+ displayLabel: "File Derivatives",
19
+ category: "storage",
20
+ recommended: false,
21
+ });
22
+ // Needs a storage provider to read the original + write the variant —
23
+ // without file-foundation there's nothing to derive from or write to.
24
+ r.requires("file-foundation");
25
+
26
+ r.extendsRegistrar(EXT_DERIVATIVE_RENDERER, {
27
+ onRegister: () => {
28
+ // No side-effects at register-time — resolution (exact MIME match,
29
+ // then `<type>/*` wildcard) happens at request-time in
30
+ // resolveRenderer, mirrors file-foundation's fileProvider point.
31
+ },
32
+ });
33
+ });
@@ -0,0 +1,2 @@
1
+ export { fileDerivativesFeature } from "./feature";
2
+ export { card, full, hero, thumb } from "./presets";
@@ -0,0 +1,6 @@
1
+ import type { VariantSpec } from "@cosmicdrift/kumiko-types/derivatives-types";
2
+
3
+ export const thumb = { maxEdge: 160, fit: "cover", format: "webp" } as const satisfies VariantSpec;
4
+ export const card = { maxEdge: 640, fit: "inside", format: "webp" } as const satisfies VariantSpec;
5
+ export const hero = { maxEdge: 1600, fit: "inside", format: "webp" } as const satisfies VariantSpec;
6
+ export const full = { maxEdge: 2560, fit: "inside", format: "webp" } as const satisfies VariantSpec;