@kosdev-code/kos-asset-manager 0.0.1-next.33 → 0.0.1-next.35

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 (2) hide show
  1. package/README.md +21 -3
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -119,6 +119,23 @@ keys when the declaration is generated:
119
119
 
120
120
  A pattern that matches nothing is reported during the build.
121
121
 
122
+ `entries` is the exception: it takes exact keys, not patterns, and adds to
123
+ an entry the build has already derived from disk rather than declaring one.
124
+ The key is the final one, after `keys` and `.kosassets` bindings are applied.
125
+ Three fields are read:
126
+
127
+ | Field | Type | Effect |
128
+ | --- | --- | --- |
129
+ | `preload` | `boolean` | readied by `preloadDeclared()` |
130
+ | `aliases` | `string[]` | extra keys that resolve to the same entry |
131
+ | `poster` | `string` | for a video, the key of its poster image |
132
+
133
+ Anything else in an entry is dropped, and the derived fields (`path`, `type`,
134
+ `size`, `hash`, dimensions) can't be overridden. A key with no file behind it
135
+ is reported during the build. Marker files carry bindings only, so these
136
+ settings live in `.kos.json`; to mark a whole folder for preloading, declare
137
+ a group instead and hand it to `preloadAssets`.
138
+
122
139
  ## Media somewhere else
123
140
 
124
141
  `src/assets/media` is the ui default. A content project — a brandset, a
@@ -229,9 +246,9 @@ one wins by the order it lists them in `contexts`.
229
246
  Everything you author under `kondra.ui.assets` carries through to the
230
247
  declaration, with what the build derives landing on top. The exception is the
231
248
  handful of settings that drive the build rather than describe the result —
232
- `keys`, `tags`, `mediaSrc`, `mediaRoot`, and the pattern form of `groups` and
233
- `entries` — which are expanded into what the device reads and not shipped as
234
- written.
249
+ `keys`, `tags`, `mediaSrc`, `mediaRoot`, the pattern form of `groups`, and
250
+ the per-key settings in `entries` — which are expanded into what the device
251
+ reads and not shipped as written.
235
252
 
236
253
  ## Installing
237
254
 
@@ -406,6 +423,7 @@ sequence, so one bad file cannot stop a device from starting.
406
423
 
407
424
  `preloadDeclared(options?)` readies every loaded asset whose declaration set
408
425
  `preload: true`, so the application doesn't have to know which those are.
426
+ The flag is set per key under `entries` in `.kos.json`.
409
427
  `releaseAssets()` drops the decoded images preloading is holding — worth
410
428
  calling when leaving a section whose assets are large and won't be shown
411
429
  again.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kosdev-code/kos-asset-manager",
3
- "version": "0.0.1-next.33",
3
+ "version": "0.0.1-next.35",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "kos": {
27
27
  "build": {
28
- "gitHash": "a4c9d29dcddff2eae1f6320fe8dc5fa175add07f"
28
+ "gitHash": "d691c493e8f2d98dbb23ec8ce8043b570196eeb6"
29
29
  }
30
30
  },
31
31
  "publishConfig": {