ugly-app 0.1.950 → 0.1.951
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 +1 -0
- package/dist/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/dist/client/audio/workletLoader.d.ts +4 -1
- package/dist/client/audio/workletLoader.d.ts.map +1 -1
- package/dist/client/audio/workletLoader.js +11 -3
- package/dist/client/audio/workletLoader.js.map +1 -1
- package/package.json +1 -1
- package/src/cli/version.ts +1 -1
- package/src/client/audio/workletLoader.test.ts +12 -0
- package/src/client/audio/workletLoader.ts +14 -3
package/README.md
CHANGED
|
@@ -27,6 +27,7 @@ npm run dev
|
|
|
27
27
|
| `ugly-app/server/adapter/workers` | Cloudflare Workers entry (Hono router + Durable Objects + Neon HTTP driver + R2). |
|
|
28
28
|
| `ugly-app/server/ssr` | SSR renderer used by the Workers adapter. |
|
|
29
29
|
| `ugly-app/conversation/{shared,server,client,engine}` | AI chat sessions with persisted history. |
|
|
30
|
+
| `ugly-app/character/{shared,server,client}` | `CharacterSpec` store + WebGPU `CharacterCanvas` / `CharacterCreator`. |
|
|
30
31
|
| `ugly-app/collab/{server,client}` | Yjs-based collaborative editing. |
|
|
31
32
|
| `ugly-app/markdown/{shared,client}` | Markdown rendering + editor. |
|
|
32
33
|
| `ugly-app/search/{shared,server}` | Search primitives. |
|
package/dist/cli/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.1.
|
|
1
|
+
export declare const CLI_VERSION = "0.1.951";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cli/version.js
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
* `import.meta.url` of the calling module points at the app's built JS (or the
|
|
4
4
|
* dev-server module URL), so the asset sits beside it; `baseUri`
|
|
5
5
|
* (`document.baseURI`) is the fallback for bundles where `import.meta.url` is
|
|
6
|
-
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs).
|
|
6
|
+
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs). `baseUri` MAY be a
|
|
7
|
+
* `file:` URL — an Electron shell window loads its page over file:// and the
|
|
8
|
+
* worklet sits beside the html (document only exists in a browser, so SSR
|
|
9
|
+
* still gets null); `import.meta.url` stays http(s)-only.
|
|
7
10
|
*/
|
|
8
11
|
export declare function staticWorkletUrl(fileName: string, importMetaUrl?: string, baseUri?: string): string | null;
|
|
9
12
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workletLoader.d.ts","sourceRoot":"","sources":["../../../src/client/audio/workletLoader.ts"],"names":[],"mappings":"AAWA
|
|
1
|
+
{"version":3,"file":"workletLoader.d.ts","sourceRoot":"","sources":["../../../src/client/audio/workletLoader.ts"],"names":[],"mappings":"AAWA;;;;;;;;;GASG;AACH,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,aAAa,CAAC,EAAE,MAAM,EACtB,OAAO,CAAC,EAAE,MAAM,GACf,MAAM,GAAG,IAAI,CAef;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,WAAW,CAAC,EACxC,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,OAAO,EAAE,MAAM,MAAM,GACpB,OAAO,CAAC,IAAI,CAAC,CAUf"}
|
|
@@ -13,11 +13,19 @@
|
|
|
13
13
|
* `import.meta.url` of the calling module points at the app's built JS (or the
|
|
14
14
|
* dev-server module URL), so the asset sits beside it; `baseUri`
|
|
15
15
|
* (`document.baseURI`) is the fallback for bundles where `import.meta.url` is
|
|
16
|
-
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs).
|
|
16
|
+
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs). `baseUri` MAY be a
|
|
17
|
+
* `file:` URL — an Electron shell window loads its page over file:// and the
|
|
18
|
+
* worklet sits beside the html (document only exists in a browser, so SSR
|
|
19
|
+
* still gets null); `import.meta.url` stays http(s)-only.
|
|
17
20
|
*/
|
|
18
21
|
export function staticWorkletUrl(fileName, importMetaUrl, baseUri) {
|
|
19
|
-
for (const base of [
|
|
20
|
-
|
|
22
|
+
for (const [base, allowFile] of [
|
|
23
|
+
[importMetaUrl, false],
|
|
24
|
+
[baseUri, true],
|
|
25
|
+
]) {
|
|
26
|
+
if (!base)
|
|
27
|
+
continue;
|
|
28
|
+
if (!/^https?:\/\//.test(base) && !(allowFile && base.startsWith('file://')))
|
|
21
29
|
continue;
|
|
22
30
|
try {
|
|
23
31
|
return new URL(fileName, base).href;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"workletLoader.js","sourceRoot":"","sources":["../../../src/client/audio/workletLoader.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,4DAA4D;AAC5D,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,qCAAqC;AAErC
|
|
1
|
+
{"version":3,"file":"workletLoader.js","sourceRoot":"","sources":["../../../src/client/audio/workletLoader.ts"],"names":[],"mappings":"AAAA,oCAAoC;AACpC,4DAA4D;AAC5D,EAAE;AACF,0EAA0E;AAC1E,yEAAyE;AACzE,8EAA8E;AAC9E,6EAA6E;AAC7E,4EAA4E;AAC5E,+EAA+E;AAC/E,qCAAqC;AAErC;;;;;;;;;GASG;AACH,MAAM,UAAU,gBAAgB,CAC9B,QAAgB,EAChB,aAAsB,EACtB,OAAgB;IAEhB,KAAK,MAAM,CAAC,IAAI,EAAE,SAAS,CAAC,IAAI;QAC9B,CAAC,aAAa,EAAE,KAAK,CAAC;QACtB,CAAC,OAAO,EAAE,IAAI,CAAC;KACP,EAAE,CAAC;QACX,IAAI,CAAC,IAAI;YAAE,SAAS;QACpB,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,SAAS,IAAI,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;YAC1E,SAAS;QACX,IAAI,CAAC;YACH,OAAO,IAAI,GAAG,CAAC,QAAQ,EAAE,IAAI,CAAC,CAAC,IAAI,CAAC;QACtC,CAAC;QAAC,MAAM,CAAC;YACP,sCAAsC;QACxC,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;GAKG;AACH,MAAM,CAAC,KAAK,UAAU,4BAA4B,CAChD,OAAwC,EACxC,SAAwB,EACxB,OAAqB;IAErB,IAAI,SAAS,EAAE,CAAC;QACd,IAAI,CAAC;YACH,MAAM,OAAO,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YACnC,OAAO;QACT,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;QACtE,CAAC;IACH,CAAC;IACD,MAAM,OAAO,CAAC,SAAS,CAAC,OAAO,EAAE,CAAC,CAAC;AACrC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ugly-app",
|
|
3
3
|
"packageManager": "pnpm@10.34.5",
|
|
4
|
-
"version": "0.1.
|
|
4
|
+
"version": "0.1.951",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"comment:files": "Allowlist what ships to npm. dist = runtime; src = sourcemap targets (dist/*.js.map reference ../../src/); templates = CLI scaffold. Everything else at repo root (.pgdata local Postgres, coverage, assets/icons sources, test/, test-results/) is excluded by omission. The !negations strip the scaffold's installed deps + cruft (templates/node_modules is 200MB+ and must never ship). package.json/README/LICENSE ship automatically.",
|
|
7
7
|
"files": [
|
package/src/cli/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated by prebuild — do not edit manually
|
|
2
|
-
export const CLI_VERSION = "0.1.
|
|
2
|
+
export const CLI_VERSION = "0.1.951";
|
|
@@ -52,6 +52,18 @@ describe('staticWorkletUrl', () => {
|
|
|
52
52
|
staticWorkletUrl('audioPlayer.worklet.js', 'file:///srv/bundle.js'),
|
|
53
53
|
).toBeNull();
|
|
54
54
|
});
|
|
55
|
+
|
|
56
|
+
it('accepts a file: document.baseURI (Electron shell window)', () => {
|
|
57
|
+
expect(
|
|
58
|
+
staticWorkletUrl(
|
|
59
|
+
'audioPlayer.worklet.js',
|
|
60
|
+
undefined,
|
|
61
|
+
'file:///Applications/app/dist/studio-electron/chrome.html',
|
|
62
|
+
),
|
|
63
|
+
).toBe(
|
|
64
|
+
'file:///Applications/app/dist/studio-electron/audioPlayer.worklet.js',
|
|
65
|
+
);
|
|
66
|
+
});
|
|
55
67
|
});
|
|
56
68
|
|
|
57
69
|
describe('addWorkletModuleWithFallback', () => {
|
|
@@ -14,15 +14,26 @@
|
|
|
14
14
|
* `import.meta.url` of the calling module points at the app's built JS (or the
|
|
15
15
|
* dev-server module URL), so the asset sits beside it; `baseUri`
|
|
16
16
|
* (`document.baseURI`) is the fallback for bundles where `import.meta.url` is
|
|
17
|
-
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs).
|
|
17
|
+
* shimmed away (CJS/IIFE) or non-http (SSR `file:` URLs). `baseUri` MAY be a
|
|
18
|
+
* `file:` URL — an Electron shell window loads its page over file:// and the
|
|
19
|
+
* worklet sits beside the html (document only exists in a browser, so SSR
|
|
20
|
+
* still gets null); `import.meta.url` stays http(s)-only.
|
|
18
21
|
*/
|
|
19
22
|
export function staticWorkletUrl(
|
|
20
23
|
fileName: string,
|
|
21
24
|
importMetaUrl?: string,
|
|
22
25
|
baseUri?: string,
|
|
23
26
|
): string | null {
|
|
24
|
-
for (const base of [
|
|
25
|
-
|
|
27
|
+
for (const [base, allowFile] of [
|
|
28
|
+
[importMetaUrl, false],
|
|
29
|
+
[baseUri, true],
|
|
30
|
+
] as const) {
|
|
31
|
+
if (!base) continue;
|
|
32
|
+
if (
|
|
33
|
+
!/^https?:\/\//.test(base) &&
|
|
34
|
+
!(allowFile && base.startsWith('file://'))
|
|
35
|
+
)
|
|
36
|
+
continue;
|
|
26
37
|
try {
|
|
27
38
|
return new URL(fileName, base).href;
|
|
28
39
|
} catch {
|