@kosdev-code/kos-asset-manager 0.0.1-next.34 → 0.0.1-next.36
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 +21 -3
- package/index.js +223 -45392
- package/package.json +3 -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`,
|
|
233
|
-
`entries` — which are expanded into what the device
|
|
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.
|