ugly-app 0.1.1081 → 0.1.1082
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/cli/version.d.ts +1 -1
- package/dist/cli/version.js +1 -1
- package/dist/client/crossOriginWorker.d.ts +1 -1
- package/dist/client/crossOriginWorker.d.ts.map +1 -1
- package/dist/client/crossOriginWorker.js +24 -2
- package/dist/client/crossOriginWorker.js.map +1 -1
- package/package.json +4 -3
- package/src/cli/version.ts +1 -1
- package/src/client/crossOriginWorker.test.ts +5 -5
- package/src/client/crossOriginWorker.ts +24 -2
- package/src/client/index.ts +4 -1
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.1082";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/dist/cli/version.js
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* shim would hand each caller its own private worker and silently break the
|
|
19
19
|
* sharing that is the entire point of the API.
|
|
20
20
|
*/
|
|
21
|
-
/**
|
|
21
|
+
/** Load the real script without dropping messages posted during its import. */
|
|
22
22
|
export declare function workerShimSource(href: string, type: WorkerType): string;
|
|
23
23
|
/**
|
|
24
24
|
* Whether `scriptURL` needs the blob shim — i.e. it resolves to a different
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossOriginWorker.d.ts","sourceRoot":"","sources":["../../src/client/crossOriginWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH
|
|
1
|
+
{"version":3,"file":"crossOriginWorker.d.ts","sourceRoot":"","sources":["../../src/client/crossOriginWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,+EAA+E;AAC/E,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,UAAU,GAAG,MAAM,CA0BvE;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAC7B,SAAS,EAAE,MAAM,GAAG,GAAG,EACvB,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,MAAM,GACX,OAAO,CAST;AAID;;;GAGG;AACH,wBAAgB,wBAAwB,IAAI,IAAI,CAsC/C"}
|
|
@@ -18,10 +18,32 @@
|
|
|
18
18
|
* shim would hand each caller its own private worker and silently break the
|
|
19
19
|
* sharing that is the entire point of the API.
|
|
20
20
|
*/
|
|
21
|
-
/**
|
|
21
|
+
/** Load the real script without dropping messages posted during its import. */
|
|
22
22
|
export function workerShimSource(href, type) {
|
|
23
23
|
return type === 'module'
|
|
24
|
-
?
|
|
24
|
+
? // WebKit rejects a static CDN import from a blob worker under COEP
|
|
25
|
+
// require-corp (even when the CDN permits CORS/CORP). A dynamic import
|
|
26
|
+
// works and preserves the module's original URL for relative imports.
|
|
27
|
+
// Unlike a static import, it yields to message delivery: hold their data, including transferred ports/buffers, until handlers are
|
|
28
|
+
// installed. Recreate events: Chromium retains stopImmediatePropagation
|
|
29
|
+
// when redispatching an original event.
|
|
30
|
+
`const pending = [];
|
|
31
|
+
const hold = event => { event.stopImmediatePropagation(); pending.push(event); };
|
|
32
|
+
self.addEventListener('message', hold);
|
|
33
|
+
self.addEventListener('messageerror', hold);
|
|
34
|
+
import(${JSON.stringify(href)}).then(() => {
|
|
35
|
+
self.removeEventListener('message', hold);
|
|
36
|
+
self.removeEventListener('messageerror', hold);
|
|
37
|
+
for (const event of pending) self.dispatchEvent(new MessageEvent(event.type, {
|
|
38
|
+
data: event.data, origin: event.origin, lastEventId: event.lastEventId, ports: event.ports,
|
|
39
|
+
}));
|
|
40
|
+
pending.length = 0;
|
|
41
|
+
}, error => {
|
|
42
|
+
pending.length = 0;
|
|
43
|
+
self.removeEventListener('message', hold);
|
|
44
|
+
self.removeEventListener('messageerror', hold);
|
|
45
|
+
setTimeout(() => { throw new Error('Worker module failed to load: ' + ${JSON.stringify(href)} + ': ' + String(error)); }, 0);
|
|
46
|
+
});`
|
|
25
47
|
: `importScripts(${JSON.stringify(href)});`;
|
|
26
48
|
}
|
|
27
49
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"crossOriginWorker.js","sourceRoot":"","sources":["../../src/client/crossOriginWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH
|
|
1
|
+
{"version":3,"file":"crossOriginWorker.js","sourceRoot":"","sources":["../../src/client/crossOriginWorker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAOH,+EAA+E;AAC/E,MAAM,UAAU,gBAAgB,CAAC,IAAY,EAAE,IAAgB;IAC7D,OAAO,IAAI,KAAK,QAAQ;QACtB,CAAC,CAAC,mEAAmE;YACnE,uEAAuE;YACvE,sEAAsE;YACtE,kIAAkI;YAClI,wEAAwE;YACxE,wCAAwC;YACxC;;;;SAIG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;;;;;;;;;;;0EAW6C,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC;IAC1F;QACA,CAAC,CAAC,iBAAiB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC;AAChD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,eAAe,CAC7B,SAAuB,EACvB,MAAc,EACd,IAAY;IAEZ,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,IAAI,CAAC,CAAC;QAC7C,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO,IAAI,GAAG,CAAC,QAAQ,KAAK,OAAO;YAAE,OAAO,KAAK,CAAC;QACvE,OAAO,GAAG,CAAC,MAAM,KAAK,MAAM,CAAC;IAC/B,CAAC;IAAC,MAAM,CAAC;QACP,oEAAoE;QACpE,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,IAAI,SAAS,GAAG,KAAK,CAAC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,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAC5C,IAAI,CAAC,SAAS,GAAG,GAAS,EAAE;oBAC1B,SAAS,EAAE,CAAC;oBACZ,GAAG,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;gBAC3B,CAAC,CAAC;YACJ,CAAC;QACH,CAAC;KACF;IAED,CAAC,CAAC,MAAM,GAAG,iBAAiB,CAAC;AAC/B,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.1082",
|
|
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": [
|
|
@@ -91,11 +91,12 @@
|
|
|
91
91
|
"release:quick": "SKIP_README=1 pnpm run release",
|
|
92
92
|
"test:e2e-pages": "playwright test --config playwright.e2e-pages.config.ts",
|
|
93
93
|
"test:character-gpu": "node scripts/character-stage2-gpu.mjs",
|
|
94
|
-
"test:full": "pnpm run test:parity && pnpm run test:e2e-pages",
|
|
94
|
+
"test:full": "pnpm run test:parity && pnpm run test:e2e-pages && pnpm run test:cross-origin-workers",
|
|
95
95
|
"test:template": "node scripts/test-template.mjs",
|
|
96
96
|
"pretty": "prettier --write .",
|
|
97
97
|
"lint": "ESLINT_USE_FLAT_CONFIG=true NODE_OPTIONS=--max-old-space-size=8192 eslint .",
|
|
98
|
-
"prepublishOnly": "pnpm run pretty && pnpm run lint"
|
|
98
|
+
"prepublishOnly": "pnpm run pretty && pnpm run lint",
|
|
99
|
+
"test:cross-origin-workers": "node scripts/cross-origin-worker-browser.mjs"
|
|
99
100
|
},
|
|
100
101
|
"dependencies": {
|
|
101
102
|
"@aws-sdk/client-s3": "^3.700.0",
|
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.1082";
|
|
@@ -63,9 +63,9 @@ describe('needsWorkerShim', () => {
|
|
|
63
63
|
});
|
|
64
64
|
|
|
65
65
|
describe('workerShimSource', () => {
|
|
66
|
-
it('imports
|
|
67
|
-
expect(workerShimSource('https://cdn.example/w.js', 'module')).
|
|
68
|
-
'import
|
|
66
|
+
it('dynamically imports a module worker for WebKit COEP compatibility', () => {
|
|
67
|
+
expect(workerShimSource('https://cdn.example/w.js', 'module')).toContain(
|
|
68
|
+
'import("https://cdn.example/w.js")',
|
|
69
69
|
);
|
|
70
70
|
});
|
|
71
71
|
|
|
@@ -77,8 +77,8 @@ describe('workerShimSource', () => {
|
|
|
77
77
|
|
|
78
78
|
// A quote or backslash in the URL must not break out of the string literal.
|
|
79
79
|
it('escapes the URL rather than interpolating it raw', () => {
|
|
80
|
-
expect(workerShimSource('https://cdn.example/a"b.js', 'module')).
|
|
81
|
-
'import
|
|
80
|
+
expect(workerShimSource('https://cdn.example/a"b.js', 'module')).toContain(
|
|
81
|
+
'import("https://cdn.example/a\\"b.js")',
|
|
82
82
|
);
|
|
83
83
|
});
|
|
84
84
|
});
|
|
@@ -24,10 +24,32 @@ interface WorkerCtor {
|
|
|
24
24
|
prototype: Worker;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
/**
|
|
27
|
+
/** Load the real script without dropping messages posted during its import. */
|
|
28
28
|
export function workerShimSource(href: string, type: WorkerType): string {
|
|
29
29
|
return type === 'module'
|
|
30
|
-
?
|
|
30
|
+
? // WebKit rejects a static CDN import from a blob worker under COEP
|
|
31
|
+
// require-corp (even when the CDN permits CORS/CORP). A dynamic import
|
|
32
|
+
// works and preserves the module's original URL for relative imports.
|
|
33
|
+
// Unlike a static import, it yields to message delivery: hold their data, including transferred ports/buffers, until handlers are
|
|
34
|
+
// installed. Recreate events: Chromium retains stopImmediatePropagation
|
|
35
|
+
// when redispatching an original event.
|
|
36
|
+
`const pending = [];
|
|
37
|
+
const hold = event => { event.stopImmediatePropagation(); pending.push(event); };
|
|
38
|
+
self.addEventListener('message', hold);
|
|
39
|
+
self.addEventListener('messageerror', hold);
|
|
40
|
+
import(${JSON.stringify(href)}).then(() => {
|
|
41
|
+
self.removeEventListener('message', hold);
|
|
42
|
+
self.removeEventListener('messageerror', hold);
|
|
43
|
+
for (const event of pending) self.dispatchEvent(new MessageEvent(event.type, {
|
|
44
|
+
data: event.data, origin: event.origin, lastEventId: event.lastEventId, ports: event.ports,
|
|
45
|
+
}));
|
|
46
|
+
pending.length = 0;
|
|
47
|
+
}, error => {
|
|
48
|
+
pending.length = 0;
|
|
49
|
+
self.removeEventListener('message', hold);
|
|
50
|
+
self.removeEventListener('messageerror', hold);
|
|
51
|
+
setTimeout(() => { throw new Error('Worker module failed to load: ' + ${JSON.stringify(href)} + ': ' + String(error)); }, 0);
|
|
52
|
+
});`
|
|
31
53
|
: `importScripts(${JSON.stringify(href)});`;
|
|
32
54
|
}
|
|
33
55
|
|
package/src/client/index.ts
CHANGED
|
@@ -190,7 +190,10 @@ export {
|
|
|
190
190
|
consumeLoginReturnPath,
|
|
191
191
|
} from './auth/startLogin.js';
|
|
192
192
|
export type { StartLoginOptions } from './auth/startLogin.js';
|
|
193
|
-
export {
|
|
193
|
+
export {
|
|
194
|
+
InstallPrompt,
|
|
195
|
+
installInstallPromptCapture,
|
|
196
|
+
} from './InstallPrompt.js';
|
|
194
197
|
export { NewVersionBanner } from './NewVersionBanner.js';
|
|
195
198
|
export { installStaleBuildReload } from './staleBuild.js';
|
|
196
199
|
export { Link, createRouter, lazyPage, lazyPageLoader } from './Router.js';
|