@kubohiroya/turbowarp-asset-cache 0.1.0 → 0.2.1
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 +2 -9
- package/dist/types/server-manifest.d.ts +11 -14
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -4,13 +4,6 @@ A browser-local image, audio, and runtime-text asset cache for TurboWarp project
|
|
|
4
4
|
|
|
5
5
|
Asset Cache intentionally keeps the legacy `isLoaded` and cache lifecycle semantics. It is not a general server object store: every block is marked `server.supported: false` in the format 2 manifest. Use [`@kubohiroya/turbowarp-kvs`](https://github.com/kubohiroya/turbowarp-kvs) for portable namespace/key persistence and server lowering.
|
|
6
6
|
|
|
7
|
-
`@kubohiroya/turbowarp-asset-manager` is deprecated. Composition consumers can replace its import
|
|
8
|
-
path with `@kubohiroya/turbowarp-asset-cache/composition` for asset registration, rendering,
|
|
9
|
-
playback, DOM image resources, and verified remote-cache APIs. Import binary object, bundle, and
|
|
10
|
-
session-backing APIs directly from `@kubohiroya/turbowarp-kvs`. Standalone projects must also
|
|
11
|
-
replace the extension ID `kubohiroyaassetmanager` with `kubohiroyaassetcache`; published historical
|
|
12
|
-
SB3 artifacts should remain pinned to their original extension.
|
|
13
|
-
|
|
14
7
|
## User Guide
|
|
15
8
|
|
|
16
9
|
For setup, safety notes, recipes, and the illustrated block guide, see the [English user guide](https://kubohiroya.github.io/turbowarp-asset-cache/) or [Japanese user guide](https://kubohiroya.github.io/turbowarp-asset-cache/ja/).
|
|
@@ -48,13 +41,13 @@ The built JavaScript file is committed to this repository so users do not need t
|
|
|
48
41
|
The versioned npm package contains the same reviewed build:
|
|
49
42
|
|
|
50
43
|
```bash
|
|
51
|
-
pnpm add --save-exact @kubohiroya/turbowarp-asset-cache@0.1
|
|
44
|
+
pnpm add --save-exact @kubohiroya/turbowarp-asset-cache@0.2.1
|
|
52
45
|
```
|
|
53
46
|
|
|
54
47
|
Load `node_modules/@kubohiroya/turbowarp-asset-cache/dist/asset-cache.js`, or use the version-pinned CDN URL:
|
|
55
48
|
|
|
56
49
|
```text
|
|
57
|
-
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.1
|
|
50
|
+
https://cdn.jsdelivr.net/npm/@kubohiroya/turbowarp-asset-cache@0.2.1/dist/asset-cache.js
|
|
58
51
|
```
|
|
59
52
|
|
|
60
53
|
## Quick Start
|
|
@@ -1,16 +1,13 @@
|
|
|
1
1
|
import { type ExtensionManifest, type ExtensionManifestBlock } from '@kubohiroya/turbowarp-extension-manifest';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
blocks: AssetCacheManifestBlock[];
|
|
14
|
-
}
|
|
15
|
-
export declare function createAssetCacheManifest(id: string, definitions: unknown): AssetCacheManifest;
|
|
2
|
+
/** The format version 2 fields, which the package models as optional on a block. */
|
|
3
|
+
export type AssetCacheBlockMetadata = Required<Pick<ExtensionManifestBlock, 'effect' | 'errors' | 'immutable' | 'resultType' | 'server'>>;
|
|
4
|
+
/**
|
|
5
|
+
* Derives this extension's format version 2 metadata from its block definitions.
|
|
6
|
+
*
|
|
7
|
+
* The contract itself — which fields exist and what values they may take — belongs to
|
|
8
|
+
* @kubohiroya/turbowarp-extension-manifest. Only the policy is local: which of these blocks writes
|
|
9
|
+
* to the asset store, and which merely reports.
|
|
10
|
+
*/
|
|
11
|
+
export declare function assetCacheBlockMetadata(definitions: unknown): Record<string, AssetCacheBlockMetadata>;
|
|
12
|
+
export declare function createAssetCacheManifest(id: string, definitions: unknown): ExtensionManifest;
|
|
16
13
|
export declare function serializeAssetCacheManifest(id: string, definitions: unknown): string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kubohiroya/turbowarp-asset-cache",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "A browser-local image, audio, and runtime-text asset cache for TurboWarp projects.",
|
|
5
5
|
"author": "Hiroya Kubo <hiroya@cuc.ac.jp>",
|
|
6
6
|
"type": "module",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
},
|
|
61
61
|
"devDependencies": {
|
|
62
62
|
"@eslint/js": "^9.39.5",
|
|
63
|
+
"@kubohiroya/turbowarp-extension-manifest": "0.3.0",
|
|
63
64
|
"@kubohiroya/turbowarp-named-data": "0.1.0",
|
|
64
|
-
"@kubohiroya/turbowarp-extension-manifest": "0.2.0",
|
|
65
65
|
"@kubohiroya/vite-plugin-turbowarp-extension": "0.4.0",
|
|
66
66
|
"@types/node": "^22.20.1",
|
|
67
67
|
"@xmldom/xmldom": "0.9.11",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"vitest": "^4.1.10"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"@kubohiroya/turbowarp-named-data": "
|
|
76
|
+
"@kubohiroya/turbowarp-named-data": ">=0.1.0 <1"
|
|
77
77
|
},
|
|
78
78
|
"keywords": [
|
|
79
79
|
"turbowarp",
|