@bloopjs/web 0.0.99 → 0.0.101
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/App.d.ts.map +1 -1
- package/dist/mod.js +13 -3
- package/dist/mod.js.map +5 -5
- package/package.json +8 -4
- package/src/App.ts +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloopjs/web",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.101",
|
|
4
4
|
"author": "Neil Sarkar",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -24,17 +24,21 @@
|
|
|
24
24
|
"scripts": {
|
|
25
25
|
"build": "bun build src/mod.ts --outdir=dist --sourcemap=linked --jsx-import-source=preact --jsx-runtime=automatic && bunx tsc -p publish/tsconfig.publish.json",
|
|
26
26
|
"ci:jsr": "bunx jsr publish --dry-run --allow-dirty",
|
|
27
|
-
"ci:tsc": "tsc --noEmit"
|
|
27
|
+
"ci:tsc": "tsc --noEmit",
|
|
28
|
+
"test:e2e": "playwright test",
|
|
29
|
+
"test:e2e:ui": "playwright test --ui",
|
|
30
|
+
"test:e2e:update": "playwright test --update-snapshots"
|
|
28
31
|
},
|
|
29
32
|
"devDependencies": {
|
|
33
|
+
"@playwright/test": "^1.49.0",
|
|
30
34
|
"@types/bun": "latest"
|
|
31
35
|
},
|
|
32
36
|
"peerDependencies": {
|
|
33
37
|
"typescript": "^5"
|
|
34
38
|
},
|
|
35
39
|
"dependencies": {
|
|
36
|
-
"@bloopjs/bloop": "0.0.
|
|
37
|
-
"@bloopjs/engine": "0.0.
|
|
40
|
+
"@bloopjs/bloop": "0.0.101",
|
|
41
|
+
"@bloopjs/engine": "0.0.101",
|
|
38
42
|
"@preact/signals": "^1.3.1",
|
|
39
43
|
"partysocket": "^1.1.6",
|
|
40
44
|
"preact": "^10.25.4"
|
package/src/App.ts
CHANGED
|
@@ -66,6 +66,23 @@ export async function start(opts: StartOptions): Promise<App> {
|
|
|
66
66
|
debugOpts,
|
|
67
67
|
);
|
|
68
68
|
|
|
69
|
+
// Expose app for e2e testing when ?e2e query param is present
|
|
70
|
+
if (
|
|
71
|
+
typeof window !== "undefined" &&
|
|
72
|
+
new URLSearchParams(window.location.search).has("e2e")
|
|
73
|
+
) {
|
|
74
|
+
(window as any).__BLOOP_APP__ = app;
|
|
75
|
+
|
|
76
|
+
// Auto-pause when reaching target frame (for deterministic screenshots)
|
|
77
|
+
app.afterFrame.subscribe((frame) => {
|
|
78
|
+
const target = (window as any).__BLOOP_TARGET_FRAME;
|
|
79
|
+
if (target !== undefined && frame >= target) {
|
|
80
|
+
app.sim.pause();
|
|
81
|
+
delete (window as any).__BLOOP_TARGET_FRAME;
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
|
|
69
86
|
return app;
|
|
70
87
|
}
|
|
71
88
|
|