@doki-land/live2d-loader 0.0.16 → 0.0.18
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/dist/index.d.ts
CHANGED
|
@@ -64,6 +64,11 @@ declare function resolveModelSourceUrl(source: string, options?: ResolveModelSou
|
|
|
64
64
|
|
|
65
65
|
/**
|
|
66
66
|
* `@doki-land/live2d-loader` — model JSON fetch and load pipeline.
|
|
67
|
+
*
|
|
68
|
+
* Layout:
|
|
69
|
+
* - `fetch/` — progress-aware fetch helpers
|
|
70
|
+
* - `pipeline/` — normalize settings + load middleware
|
|
71
|
+
* - `resolve/` — npm: / URL source resolution
|
|
67
72
|
*/
|
|
68
73
|
|
|
69
74
|
declare const LIVE2D_LOADER_VERSION: "0.0.0";
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// src/fetch
|
|
1
|
+
// src/fetch/index.ts
|
|
2
2
|
function safeProgress(onProgress, update) {
|
|
3
3
|
if (!onProgress) return;
|
|
4
4
|
try {
|
|
@@ -55,7 +55,7 @@ async function fetchJsonWithProgress(url, onProgress) {
|
|
|
55
55
|
return JSON.parse(text);
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
// src/pipeline.ts
|
|
58
|
+
// src/pipeline/index.ts
|
|
59
59
|
import { detectModelSettingsFormat } from "@doki-land/live2d-core";
|
|
60
60
|
function resolveAssetUrl(baseUrl, relative) {
|
|
61
61
|
if (/^(?:[a-z]+:)?\/\//i.test(relative) || relative.startsWith("data:")) {
|
|
@@ -197,7 +197,7 @@ function normalizeModelSettings(json, url) {
|
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
199
|
|
|
200
|
-
// src/resolve
|
|
200
|
+
// src/resolve/index.ts
|
|
201
201
|
var DEFAULT_NPM_CDN = "https://cdn.jsdelivr.net/npm";
|
|
202
202
|
function resolveNpmSpecifier(spec, cdnBase = DEFAULT_NPM_CDN) {
|
|
203
203
|
const trimmed = spec.trim().replace(/^\/+/, "");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@doki-land/live2d-loader",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.18",
|
|
4
4
|
"description": "Fetch and normalize Live2D model.json/model3.json, resolve npm: URLs, AssetResolver for moc/textures.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -42,7 +42,7 @@
|
|
|
42
42
|
"test": "vitest run"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@doki-land/live2d-core": "0.0.
|
|
45
|
+
"@doki-land/live2d-core": "0.0.18"
|
|
46
46
|
},
|
|
47
47
|
"sideEffects": false
|
|
48
48
|
}
|
package/src/index.ts
CHANGED
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `@doki-land/live2d-loader` — model JSON fetch and load pipeline.
|
|
3
|
+
*
|
|
4
|
+
* Layout:
|
|
5
|
+
* - `fetch/` — progress-aware fetch helpers
|
|
6
|
+
* - `pipeline/` — normalize settings + load middleware
|
|
7
|
+
* - `resolve/` — npm: / URL source resolution
|
|
3
8
|
*/
|
|
4
9
|
|
|
5
10
|
export {
|
|
6
11
|
type FetchProgressHandler,
|
|
7
12
|
fetchArrayBufferWithProgress,
|
|
8
13
|
fetchJsonWithProgress,
|
|
9
|
-
} from "./fetch
|
|
14
|
+
} from "./fetch/index.js";
|
|
10
15
|
export {
|
|
11
16
|
createUrlAssetResolver,
|
|
12
17
|
detectModelFormat,
|
|
@@ -17,12 +22,12 @@ export {
|
|
|
17
22
|
resolveAssetUrl,
|
|
18
23
|
runLoadPipeline,
|
|
19
24
|
type UrlAssetResolverOptions,
|
|
20
|
-
} from "./pipeline.js";
|
|
25
|
+
} from "./pipeline/index.js";
|
|
21
26
|
export {
|
|
22
27
|
DEFAULT_NPM_CDN,
|
|
23
28
|
type ResolveModelSourceOptions,
|
|
24
29
|
resolveModelSourceUrl,
|
|
25
30
|
resolveNpmSpecifier,
|
|
26
|
-
} from "./resolve
|
|
31
|
+
} from "./resolve/index.js";
|
|
27
32
|
|
|
28
33
|
export const LIVE2D_LOADER_VERSION = "0.0.0" as const;
|
|
@@ -11,7 +11,7 @@ import { detectModelSettingsFormat } from "@doki-land/live2d-core";
|
|
|
11
11
|
import {
|
|
12
12
|
fetchArrayBufferWithProgress,
|
|
13
13
|
fetchJsonWithProgress,
|
|
14
|
-
} from "
|
|
14
|
+
} from "../fetch/index.js";
|
|
15
15
|
|
|
16
16
|
/** Resolve a relative asset URL against the model settings URL. */
|
|
17
17
|
export function resolveAssetUrl(baseUrl: string, relative: string): string {
|
|
File without changes
|
|
File without changes
|