@diffenderfer-games/hub 2.0.0-next.0 → 2.0.0-next.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.
Files changed (98) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/LICENSE +21 -21
  3. package/README.md +191 -139
  4. package/dist/doctor/cli.mjs +49 -19
  5. package/dist/doctor/cli.mjs.map +1 -1
  6. package/dist/shared/client-version.gen.js +1 -1
  7. package/dist/shared/daily.js +1 -1
  8. package/dist/shared/globals.js +8 -3
  9. package/dist/shared/globals.js.map +1 -1
  10. package/dist/shared/index.d.ts +1 -1
  11. package/package.json +89 -89
  12. package/src/auto.ts +39 -39
  13. package/src/core/connection.ts +299 -299
  14. package/src/core/errors.ts +147 -147
  15. package/src/core/game-data.ts +38 -38
  16. package/src/core/hub-economy.ts +179 -179
  17. package/src/core/hub-progress.ts +205 -205
  18. package/src/core/hub.ts +131 -131
  19. package/src/core/menu-control.ts +61 -61
  20. package/src/core/offline/events.ts +50 -50
  21. package/src/core/offline/favorites.ts +21 -21
  22. package/src/core/offline/local-store.ts +261 -261
  23. package/src/core/offline/queue.ts +171 -171
  24. package/src/core/page.ts +74 -74
  25. package/src/core/rest/endpoint-types.ts +22 -22
  26. package/src/core/rest/rest-client.ts +152 -152
  27. package/src/core/storage/json-guards.ts +74 -74
  28. package/src/core/storage/key-value.ts +66 -66
  29. package/src/core/ticket.ts +43 -43
  30. package/src/core/types.ts +134 -134
  31. package/src/core/version/client-version.gen.ts +1 -1
  32. package/src/core/version/hub-version.ts +62 -62
  33. package/src/core/version/semver.ts +97 -97
  34. package/src/daily/daily-system.ts +161 -161
  35. package/src/daily/page-daily.ts +36 -36
  36. package/src/daily/types.ts +67 -67
  37. package/src/daily.ts +10 -10
  38. package/src/doctor/checks.ts +78 -76
  39. package/src/doctor/cli.ts +98 -106
  40. package/src/doctor/hub-version-fetch.ts +43 -0
  41. package/src/doctor/tsconfig.json +12 -12
  42. package/src/globals.ts +115 -110
  43. package/src/index.ts +50 -50
  44. package/src/input/device-state.ts +146 -146
  45. package/src/input/edges.ts +55 -55
  46. package/src/input/gamepad.ts +61 -61
  47. package/src/input/input-events.ts +32 -32
  48. package/src/input/input-registry.ts +164 -164
  49. package/src/input/input-system.ts +393 -393
  50. package/src/input/legacy-controls.ts +64 -64
  51. package/src/input/nav-state.ts +191 -191
  52. package/src/input/navigator.ts +171 -171
  53. package/src/input/on-screen-controls.ts +101 -101
  54. package/src/input/page-control.ts +43 -43
  55. package/src/input/page-input.ts +193 -193
  56. package/src/input/player-remaps.ts +77 -77
  57. package/src/input/source-values.ts +116 -116
  58. package/src/input/spatial.ts +47 -47
  59. package/src/input/types.ts +331 -331
  60. package/src/input/zero-config.ts +177 -177
  61. package/src/input.ts +22 -22
  62. package/src/mp.ts +10 -10
  63. package/src/overlay/controls-panel.ts +163 -163
  64. package/src/overlay/dom.ts +46 -46
  65. package/src/overlay/layout-clusters.ts +162 -162
  66. package/src/overlay/layout-geometry.ts +136 -136
  67. package/src/overlay/layout.ts +203 -203
  68. package/src/overlay/listener-scope.ts +23 -23
  69. package/src/overlay/on-screen-keyboard.ts +137 -137
  70. package/src/overlay/overlay.ts +208 -208
  71. package/src/overlay/styles.ts +9 -9
  72. package/src/overlay/virtual-controls.ts +262 -262
  73. package/src/race.ts +10 -10
  74. package/src/realtime/bridge.ts +121 -121
  75. package/src/realtime/cross-bundle.ts +29 -29
  76. package/src/realtime/fallback-notice.ts +48 -48
  77. package/src/realtime/hub-link.ts +65 -65
  78. package/src/realtime/latest-state.ts +33 -33
  79. package/src/realtime/multiplayer-forwarder.ts +28 -28
  80. package/src/realtime/multiplayer-types.ts +52 -52
  81. package/src/realtime/page-runtime.ts +60 -60
  82. package/src/realtime/race-forwarder.ts +59 -59
  83. package/src/realtime/race-types.ts +132 -132
  84. package/src/realtime/room-types.ts +125 -125
  85. package/src/realtime/rooms-forwarder.ts +79 -79
  86. package/src/realtime/runtime-api.ts +49 -49
  87. package/src/realtime/runtime-opener.ts +61 -61
  88. package/src/realtime/social-forwarder.ts +72 -72
  89. package/src/realtime/social-types.ts +78 -78
  90. package/src/realtime/types.ts +53 -53
  91. package/src/realtime/wire-types.ts +72 -72
  92. package/src/rooms.ts +10 -10
  93. package/src/social.ts +18 -18
  94. package/src/types.ts +13 -13
  95. package/src/uistack/page-stack.ts +45 -45
  96. package/src/uistack/play-suspension.ts +82 -82
  97. package/src/uistack/types.ts +76 -76
  98. package/src/uistack/ui-stack.ts +144 -144
package/package.json CHANGED
@@ -1,89 +1,89 @@
1
- {
2
- "name": "@diffenderfer-games/hub",
3
- "version": "2.0.0-next.0",
4
- "description": "The diffenderfer.games hub client for games: accounts, saves, stats, leaderboards, inventory, daily challenges, the input system and the social/multiplayer forwarders, typed from the hub contract.",
5
- "license": "MIT",
6
- "type": "module",
7
- "sideEffects": [
8
- "./dist/auto.js",
9
- "./src/auto.ts"
10
- ],
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/diffenderfer-games/diffenderfer-games.git",
14
- "directory": "next/packages/public/hub"
15
- },
16
- "engines": {
17
- "node": ">=20"
18
- },
19
- "files": [
20
- "dist",
21
- "src",
22
- "README.md",
23
- "CHANGELOG.md",
24
- "LICENSE"
25
- ],
26
- "exports": {
27
- ".": {
28
- "source": "./src/index.ts",
29
- "types": "./dist/index.d.ts",
30
- "default": "./dist/index.js"
31
- },
32
- "./input": {
33
- "source": "./src/input.ts",
34
- "types": "./dist/input.d.ts",
35
- "default": "./dist/input.js"
36
- },
37
- "./daily": {
38
- "source": "./src/daily.ts",
39
- "types": "./dist/daily.d.ts",
40
- "default": "./dist/daily.js"
41
- },
42
- "./race": {
43
- "source": "./src/race.ts",
44
- "types": "./dist/race.d.ts",
45
- "default": "./dist/race.js"
46
- },
47
- "./social": {
48
- "source": "./src/social.ts",
49
- "types": "./dist/social.d.ts",
50
- "default": "./dist/social.js"
51
- },
52
- "./mp": {
53
- "source": "./src/mp.ts",
54
- "types": "./dist/mp.d.ts",
55
- "default": "./dist/mp.js"
56
- },
57
- "./rooms": {
58
- "source": "./src/rooms.ts",
59
- "types": "./dist/rooms.d.ts",
60
- "default": "./dist/rooms.js"
61
- },
62
- "./types": {
63
- "source": "./src/types.ts",
64
- "types": "./dist/types.d.ts",
65
- "default": "./dist/types.js"
66
- },
67
- "./auto": {
68
- "source": "./src/auto.ts",
69
- "types": "./dist/auto.d.ts",
70
- "default": "./dist/auto.js"
71
- },
72
- "./package.json": "./package.json"
73
- },
74
- "types": "./dist/index.d.ts",
75
- "bin": {
76
- "hub-doctor": "dist/doctor/cli.mjs"
77
- },
78
- "scripts": {
79
- "build": "tsx --conditions=source ../../../tools/hub-client/generate-cli.ts && tsdown",
80
- "typecheck": "tsc -p tsconfig.json"
81
- },
82
- "dependencies": {
83
- "@ayepi/core": "0.4.1",
84
- "@diffenderfer-games/hub-contract": "2.0.0-next.0"
85
- },
86
- "publishConfig": {
87
- "access": "public"
88
- }
89
- }
1
+ {
2
+ "name": "@diffenderfer-games/hub",
3
+ "version": "2.0.0-next.1",
4
+ "description": "The diffenderfer.games hub client for games: accounts, saves, stats, leaderboards, inventory, daily challenges, the input system and the social/multiplayer forwarders, typed from the hub contract.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": [
8
+ "./dist/auto.js",
9
+ "./src/auto.ts"
10
+ ],
11
+ "repository": {
12
+ "type": "git",
13
+ "url": "git+https://github.com/diffenderfer-games/diffenderfer-games.git",
14
+ "directory": "next/packages/public/hub"
15
+ },
16
+ "engines": {
17
+ "node": ">=20"
18
+ },
19
+ "files": [
20
+ "dist",
21
+ "src",
22
+ "README.md",
23
+ "CHANGELOG.md",
24
+ "LICENSE"
25
+ ],
26
+ "exports": {
27
+ ".": {
28
+ "source": "./src/index.ts",
29
+ "types": "./dist/index.d.ts",
30
+ "default": "./dist/index.js"
31
+ },
32
+ "./input": {
33
+ "source": "./src/input.ts",
34
+ "types": "./dist/input.d.ts",
35
+ "default": "./dist/input.js"
36
+ },
37
+ "./daily": {
38
+ "source": "./src/daily.ts",
39
+ "types": "./dist/daily.d.ts",
40
+ "default": "./dist/daily.js"
41
+ },
42
+ "./race": {
43
+ "source": "./src/race.ts",
44
+ "types": "./dist/race.d.ts",
45
+ "default": "./dist/race.js"
46
+ },
47
+ "./social": {
48
+ "source": "./src/social.ts",
49
+ "types": "./dist/social.d.ts",
50
+ "default": "./dist/social.js"
51
+ },
52
+ "./mp": {
53
+ "source": "./src/mp.ts",
54
+ "types": "./dist/mp.d.ts",
55
+ "default": "./dist/mp.js"
56
+ },
57
+ "./rooms": {
58
+ "source": "./src/rooms.ts",
59
+ "types": "./dist/rooms.d.ts",
60
+ "default": "./dist/rooms.js"
61
+ },
62
+ "./types": {
63
+ "source": "./src/types.ts",
64
+ "types": "./dist/types.d.ts",
65
+ "default": "./dist/types.js"
66
+ },
67
+ "./auto": {
68
+ "source": "./src/auto.ts",
69
+ "types": "./dist/auto.d.ts",
70
+ "default": "./dist/auto.js"
71
+ },
72
+ "./package.json": "./package.json"
73
+ },
74
+ "types": "./dist/index.d.ts",
75
+ "bin": {
76
+ "hub-doctor": "dist/doctor/cli.mjs"
77
+ },
78
+ "scripts": {
79
+ "build": "tsx --conditions=source ../../../tools/hub-client/generate-cli.ts && tsdown",
80
+ "typecheck": "tsc -p tsconfig.json"
81
+ },
82
+ "dependencies": {
83
+ "@ayepi/core": "0.4.1",
84
+ "@diffenderfer-games/hub-contract": "2.0.0-next.1"
85
+ },
86
+ "publishConfig": {
87
+ "access": "public"
88
+ }
89
+ }
package/src/auto.ts CHANGED
@@ -1,39 +1,39 @@
1
- /**
2
- * `@diffenderfer-games/hub/auto`: everything the main entry exports, plus a
3
- * side effect: it installs `window.HubSDK` (`{ hub, createHub, Hub, HubError,
4
- * OfflineError, ContentRejectedError }`), exactly as the v1 `/_hub/hub.js`
5
- * did. The host builds `/_hub/hub.js` from this entry, for games without a
6
- * build step (`import('/_hub/hub.js')` or `window.HubSDK.hub`).
7
- *
8
- * @packageDocumentation
9
- */
10
- import { ContentRejectedError, createHub, Hub, hub, HubError, OfflineError } from './index';
11
-
12
- export * from './index';
13
-
14
- /** What `window.HubSDK` holds. */
15
- export interface HubSdkGlobal {
16
- /** The page's client. */
17
- readonly hub: Hub;
18
- /** Create another client. */
19
- readonly createHub: typeof createHub;
20
- /** The client class. */
21
- readonly Hub: typeof Hub;
22
- /** The base error class. */
23
- readonly HubError: typeof HubError;
24
- /** The offline error class. */
25
- readonly OfflineError: typeof OfflineError;
26
- /** The content-rejected error class. */
27
- readonly ContentRejectedError: typeof ContentRejectedError;
28
- }
29
-
30
- declare global {
31
- interface Window {
32
- /** The hub client for games without a build step (installed by `@diffenderfer-games/hub/auto`). */
33
- HubSDK?: HubSdkGlobal;
34
- }
35
- }
36
-
37
- if (typeof window !== 'undefined') {
38
- window.HubSDK = { hub, createHub, Hub, HubError, OfflineError, ContentRejectedError };
39
- }
1
+ /**
2
+ * `@diffenderfer-games/hub/auto`: everything the main entry exports, plus a
3
+ * side effect: it installs `window.HubSDK` (`{ hub, createHub, Hub, HubError,
4
+ * OfflineError, ContentRejectedError }`), exactly as the v1 `/_hub/hub.js`
5
+ * did. The host builds `/_hub/hub.js` from this entry, for games without a
6
+ * build step (`import('/_hub/hub.js')` or `window.HubSDK.hub`).
7
+ *
8
+ * @packageDocumentation
9
+ */
10
+ import { ContentRejectedError, createHub, Hub, hub, HubError, OfflineError } from './index';
11
+
12
+ export * from './index';
13
+
14
+ /** What `window.HubSDK` holds. */
15
+ export interface HubSdkGlobal {
16
+ /** The page's client. */
17
+ readonly hub: Hub;
18
+ /** Create another client. */
19
+ readonly createHub: typeof createHub;
20
+ /** The client class. */
21
+ readonly Hub: typeof Hub;
22
+ /** The base error class. */
23
+ readonly HubError: typeof HubError;
24
+ /** The offline error class. */
25
+ readonly OfflineError: typeof OfflineError;
26
+ /** The content-rejected error class. */
27
+ readonly ContentRejectedError: typeof ContentRejectedError;
28
+ }
29
+
30
+ declare global {
31
+ interface Window {
32
+ /** The hub client for games without a build step (installed by `@diffenderfer-games/hub/auto`). */
33
+ HubSDK?: HubSdkGlobal;
34
+ }
35
+ }
36
+
37
+ if (typeof window !== 'undefined') {
38
+ window.HubSDK = { hub, createHub, Hub, HubError, OfflineError, ContentRejectedError };
39
+ }