@directivegames/genesys.js 3.1.24 → 3.1.25

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 (281) hide show
  1. package/dist/games/animation-demo.d.ts +1 -1
  2. package/dist/games/animation-demo.js +2 -2
  3. package/dist/games/animation-retarget-demo.d.ts +1 -1
  4. package/dist/games/animation-retarget-demo.js +3 -3
  5. package/dist/games/behavior-tree-demo.d.ts +1 -1
  6. package/dist/games/behavior-tree-demo.js +2 -2
  7. package/dist/games/character_animation.d.ts +1 -1
  8. package/dist/games/character_animation.js +2 -2
  9. package/dist/games/collision-demo.d.ts +1 -1
  10. package/dist/games/collision-demo.js +2 -2
  11. package/dist/games/deprecated/advanced-grid-demo.d.ts +1 -1
  12. package/dist/games/deprecated/advanced-grid-demo.js +2 -2
  13. package/dist/games/deprecated/airplane-demo.d.ts +1 -1
  14. package/dist/games/deprecated/airplane-demo.js +2 -2
  15. package/dist/games/deprecated/character-controller.d.ts +1 -1
  16. package/dist/games/deprecated/character-controller.js +2 -2
  17. package/dist/games/deprecated/chase-game.d.ts +1 -1
  18. package/dist/games/deprecated/chase-game.js +2 -2
  19. package/dist/games/deprecated/collision-config.d.ts +1 -1
  20. package/dist/games/deprecated/collision-config.js +2 -2
  21. package/dist/games/deprecated/door-demo.d.ts +1 -1
  22. package/dist/games/deprecated/door-demo.js +2 -2
  23. package/dist/games/deprecated/fps-demo.d.ts +1 -1
  24. package/dist/games/deprecated/fps-demo.js +2 -2
  25. package/dist/games/deprecated/fps-shotgun-demo.d.ts +1 -1
  26. package/dist/games/deprecated/fps-shotgun-demo.js +2 -2
  27. package/dist/games/deprecated/lightmapping-demo.d.ts +1 -1
  28. package/dist/games/deprecated/lightmapping-demo.js +2 -2
  29. package/dist/games/deprecated/lights-demo.d.ts +1 -1
  30. package/dist/games/deprecated/lights-demo.js +2 -2
  31. package/dist/games/deprecated/matcap-demo.d.ts +1 -1
  32. package/dist/games/deprecated/matcap-demo.js +2 -2
  33. package/dist/games/deprecated/material-demo-2.d.ts +1 -1
  34. package/dist/games/deprecated/material-demo-2.js +2 -2
  35. package/dist/games/deprecated/material-demo.d.ts +1 -1
  36. package/dist/games/deprecated/material-demo.js +2 -2
  37. package/dist/games/deprecated/memory-leak-test.d.ts +1 -1
  38. package/dist/games/deprecated/memory-leak-test.js +2 -2
  39. package/dist/games/deprecated/model-stress-test.d.ts +1 -1
  40. package/dist/games/deprecated/model-stress-test.js +2 -2
  41. package/dist/games/deprecated/multiplayer-demo.d.ts +1 -1
  42. package/dist/games/deprecated/multiplayer-demo.js +2 -2
  43. package/dist/games/deprecated/physics-demo.d.ts +1 -1
  44. package/dist/games/deprecated/physics-demo.js +2 -2
  45. package/dist/games/deprecated/shadow-demo.d.ts +1 -1
  46. package/dist/games/deprecated/shadow-demo.js +2 -2
  47. package/dist/games/deprecated/shooting-demo.d.ts +1 -1
  48. package/dist/games/deprecated/shooting-demo.js +2 -2
  49. package/dist/games/deprecated/skybox-demo.d.ts +1 -1
  50. package/dist/games/deprecated/skybox-demo.js +2 -2
  51. package/dist/games/deprecated/sound-demo.d.ts +1 -1
  52. package/dist/games/deprecated/sound-demo.js +2 -2
  53. package/dist/games/deprecated/timer-demo.d.ts +1 -1
  54. package/dist/games/deprecated/timer-demo.js +2 -2
  55. package/dist/games/deprecated/voxel-demo.d.ts +1 -1
  56. package/dist/games/deprecated/voxel-demo.js +2 -2
  57. package/dist/games/deprecated/world-commands.d.ts +1 -1
  58. package/dist/games/deprecated/world-commands.js +2 -2
  59. package/dist/games/deprecated/world-loading.d.ts +1 -1
  60. package/dist/games/deprecated/world-loading.js +2 -2
  61. package/dist/games/examples/fps-advanced/enemies.d.ts +1 -1
  62. package/dist/games/examples/fps-advanced/enemies.js +2 -2
  63. package/dist/games/examples/fps-advanced/game-mode.d.ts +1 -1
  64. package/dist/games/examples/fps-advanced/game-mode.js +2 -2
  65. package/dist/games/examples/fps-advanced/game.d.ts +1 -1
  66. package/dist/games/examples/fps-advanced/game.js +2 -2
  67. package/dist/games/examples/fps-advanced/pickups.d.ts +1 -1
  68. package/dist/games/examples/fps-advanced/pickups.js +2 -2
  69. package/dist/games/examples/fps-advanced/player.d.ts +1 -1
  70. package/dist/games/examples/fps-advanced/player.js +2 -2
  71. package/dist/games/examples/fps-advanced/ui/endgame-ui.d.ts +1 -1
  72. package/dist/games/examples/fps-advanced/ui/endgame-ui.js +2 -2
  73. package/dist/games/examples/fps-advanced/ui/menu-ui.d.ts +1 -1
  74. package/dist/games/examples/fps-advanced/ui/menu-ui.js +2 -2
  75. package/dist/games/examples/fps-advanced/ui/weapon-hud.d.ts +1 -1
  76. package/dist/games/examples/fps-advanced/weapons.d.ts +1 -1
  77. package/dist/games/examples/fps-advanced/weapons.js +2 -2
  78. package/dist/games/examples/plugin-demo/game.d.ts +1 -1
  79. package/dist/games/examples/plugin-demo/game.js +3 -3
  80. package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.d.ts +1 -1
  81. package/dist/games/examples/plugin-demo/plugins/dynamic-lighting.js +2 -2
  82. package/dist/games/examples/plugin-demo/plugins/instanced-forest.d.ts +1 -1
  83. package/dist/games/examples/plugin-demo/plugins/instanced-forest.js +2 -2
  84. package/dist/games/examples/plugin-demo/plugins/particle-fountain.d.ts +1 -1
  85. package/dist/games/examples/plugin-demo/plugins/particle-fountain.js +2 -2
  86. package/dist/games/examples/plugin-demo/plugins/physics-playground.d.ts +1 -1
  87. package/dist/games/examples/plugin-demo/plugins/physics-playground.js +2 -2
  88. package/dist/games/examples/plugin-demo/plugins/robot-follower.d.ts +1 -1
  89. package/dist/games/examples/plugin-demo/plugins/robot-follower.js +2 -2
  90. package/dist/games/examples/plugin-demo/plugins/scatter-models.d.ts +1 -1
  91. package/dist/games/examples/plugin-demo/plugins/scatter-models.js +2 -2
  92. package/dist/games/examples/plugin-demo/plugins/simple-cube.d.ts +1 -1
  93. package/dist/games/examples/plugin-demo/plugins/simple-cube.js +2 -2
  94. package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.d.ts +1 -1
  95. package/dist/games/examples/plugin-demo/plugins/tic-tac-toe.js +2 -2
  96. package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.d.ts +1 -1
  97. package/dist/games/examples/plugin-demo/plugins/wobbling-sphere.js +2 -2
  98. package/dist/games/examples/side-scroller-advanced/game-mode.d.ts +1 -1
  99. package/dist/games/examples/side-scroller-advanced/game-mode.js +2 -2
  100. package/dist/games/examples/side-scroller-advanced/game.d.ts +1 -1
  101. package/dist/games/examples/side-scroller-advanced/game.js +2 -2
  102. package/dist/games/examples/side-scroller-advanced/level-generator.d.ts +1 -1
  103. package/dist/games/examples/side-scroller-advanced/level-generator.js +2 -2
  104. package/dist/games/examples/side-scroller-advanced/pickups.d.ts +1 -1
  105. package/dist/games/examples/side-scroller-advanced/pickups.js +2 -2
  106. package/dist/games/examples/side-scroller-advanced/player.d.ts +1 -1
  107. package/dist/games/examples/side-scroller-advanced/player.js +2 -2
  108. package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.d.ts +1 -1
  109. package/dist/games/examples/side-scroller-advanced/ui/endgame-ui.js +2 -2
  110. package/dist/games/examples/side-scroller-advanced/ui/menu-ui.d.ts +1 -1
  111. package/dist/games/examples/side-scroller-advanced/ui/menu-ui.js +2 -2
  112. package/dist/games/examples/vehicle/base-vehicle.d.ts +1 -1
  113. package/dist/games/examples/vehicle/base-vehicle.js +2 -2
  114. package/dist/games/examples/vehicle/game.d.ts +1 -1
  115. package/dist/games/examples/vehicle/game.js +2 -2
  116. package/dist/games/examples/vehicle/mesh-vehicle.d.ts +1 -1
  117. package/dist/games/examples/vehicle/mesh-vehicle.js +2 -2
  118. package/dist/games/examples/vehicle/player.d.ts +1 -1
  119. package/dist/games/examples/vehicle/player.js +2 -2
  120. package/dist/games/examples/vehicle/primitive-vehicle.d.ts +1 -1
  121. package/dist/games/examples/vehicle/primitive-vehicle.js +2 -2
  122. package/dist/games/examples/vr-game/VRAttachableCube.d.ts +1 -1
  123. package/dist/games/examples/vr-game/VRAttachableCube.js +2 -2
  124. package/dist/games/examples/vr-game/VRInteractableCylinder.d.ts +1 -1
  125. package/dist/games/examples/vr-game/VRInteractableCylinder.js +2 -2
  126. package/dist/games/examples/vr-game/VRPressableButton.d.ts +1 -1
  127. package/dist/games/examples/vr-game/VRPressableButton.js +2 -2
  128. package/dist/games/examples/vr-game/VRProjectileActor.d.ts +1 -1
  129. package/dist/games/examples/vr-game/VRProjectileActor.js +2 -2
  130. package/dist/games/examples/vr-game/VRRifleActor.d.ts +1 -1
  131. package/dist/games/examples/vr-game/VRRifleActor.js +2 -2
  132. package/dist/games/examples/vr-game/game.d.ts +1 -1
  133. package/dist/games/examples/vr-game/game.js +2 -2
  134. package/dist/games/examples/vr-game/scene.d.ts +1 -1
  135. package/dist/games/examples/vr-game/scene.js +2 -2
  136. package/dist/games/instanced-mesh-demo.d.ts +1 -1
  137. package/dist/games/instanced-mesh-demo.js +2 -2
  138. package/dist/games/manifold-demo.d.ts +1 -1
  139. package/dist/games/manifold-demo.js +2 -2
  140. package/dist/games/navigation-demo.d.ts +1 -1
  141. package/dist/games/navigation-demo.js +2 -2
  142. package/dist/games/navmesh-primitives-demo.d.ts +1 -1
  143. package/dist/games/navmesh-primitives-demo.js +2 -2
  144. package/dist/games/postprocess-demo.d.ts +1 -1
  145. package/dist/games/postprocess-demo.js +3 -3
  146. package/dist/games/ragdoll-demo-simple.d.ts +1 -1
  147. package/dist/games/ragdoll-demo-simple.js +2 -2
  148. package/dist/games/ragdoll-demo.d.ts +1 -1
  149. package/dist/games/ragdoll-demo.js +2 -2
  150. package/dist/games/swipe-tap-demo.d.ts +1 -1
  151. package/dist/games/swipe-tap-demo.js +2 -2
  152. package/dist/games/tween-demo.d.ts +1 -1
  153. package/dist/games/tween-demo.js +2 -2
  154. package/dist/games/ui-demo.d.ts +1 -1
  155. package/dist/games/ui-demo.js +2 -2
  156. package/dist/games/vfx-demo.d.ts +1 -1
  157. package/dist/games/vfx-demo.js +2 -2
  158. package/dist/games/vfx-wawa-demo.d.ts +1 -1
  159. package/dist/games/vfx-wawa-demo.js +2 -2
  160. package/dist/games/vr-ui-demo-minimal.d.ts +1 -1
  161. package/dist/games/vr-ui-demo-minimal.js +2 -2
  162. package/dist/games/vr-ui-demo.d.ts +1 -1
  163. package/dist/games/vr-ui-demo.js +2 -2
  164. package/dist/launcher.js +2 -2
  165. package/dist/scripts/dump-templates.js +2 -2
  166. package/dist/test/absolute-transform.test.js +2 -2
  167. package/dist/test/asset-path.test.js +2 -2
  168. package/dist/test/component.test.js +2 -2
  169. package/dist/test/construction.test.js +2 -2
  170. package/dist/test/default-options-validation.test.js +2 -2
  171. package/dist/test/metadata.test.js +2 -2
  172. package/dist/test/nodeStorage.d.ts +2 -2
  173. package/dist/test/nodeStorage.js +3 -3
  174. package/dist/test/prefab.test.js +2 -2
  175. package/dist/test/scene-component.test.js +2 -2
  176. package/dist/test/scene-graph.test.js +2 -2
  177. package/dist/test/serialization-v1.test.d.ts +1 -1
  178. package/dist/test/serialization-v1.test.js +3 -3
  179. package/dist/test/serialization.test.js +2 -2
  180. package/dist/test/spawn.test.js +2 -2
  181. package/dist/test/utils.d.ts +1 -1
  182. package/dist/test/utils.js +2 -2
  183. package/docs/guides/15-global-audio-manager.md +1 -1
  184. package/docs/guides/16-ragdoll-physics.md +1 -1
  185. package/docs/guides/18-lightmapping-system.md +3 -3
  186. package/docs/guides/19-webxr-virtual-reality.md +1 -1
  187. package/docs/guides/4-visuals-and-rendering.md +5 -5
  188. package/docs/guides/6-ai-and-behavior-trees.md +4 -4
  189. package/games/animation-demo.ts +1 -1
  190. package/games/animation-retarget-demo.ts +2 -2
  191. package/games/behavior-tree-demo.ts +1 -1
  192. package/games/character_animation.ts +1 -1
  193. package/games/collision-demo.ts +1 -1
  194. package/games/deprecated/advanced-grid-demo.ts +1 -1
  195. package/games/deprecated/airplane-demo.ts +1 -1
  196. package/games/deprecated/character-controller.ts +1 -1
  197. package/games/deprecated/chase-game.ts +1 -1
  198. package/games/deprecated/collision-config.ts +1 -1
  199. package/games/deprecated/door-demo.ts +1 -1
  200. package/games/deprecated/fps-demo.ts +1 -1
  201. package/games/deprecated/fps-shotgun-demo.ts +1 -1
  202. package/games/deprecated/index.ts +25 -25
  203. package/games/deprecated/lightmapping-demo.ts +1 -1
  204. package/games/deprecated/lights-demo.ts +1 -1
  205. package/games/deprecated/matcap-demo.ts +1 -1
  206. package/games/deprecated/material-demo-2.ts +1 -1
  207. package/games/deprecated/material-demo.ts +1 -1
  208. package/games/deprecated/memory-leak-test.ts +1 -1
  209. package/games/deprecated/model-stress-test.ts +1 -1
  210. package/games/deprecated/multiplayer-demo.ts +1 -1
  211. package/games/deprecated/physics-demo.ts +1 -1
  212. package/games/deprecated/shadow-demo.ts +1 -1
  213. package/games/deprecated/shooting-demo.ts +1 -1
  214. package/games/deprecated/skybox-demo.ts +1 -1
  215. package/games/deprecated/sound-demo.ts +1 -1
  216. package/games/deprecated/timer-demo.ts +1 -1
  217. package/games/deprecated/voxel-demo.ts +1 -1
  218. package/games/deprecated/world-commands.ts +1 -1
  219. package/games/deprecated/world-loading.ts +1 -1
  220. package/games/examples/fps-advanced/enemies.ts +1 -1
  221. package/games/examples/fps-advanced/game-mode.ts +1 -1
  222. package/games/examples/fps-advanced/game.ts +1 -1
  223. package/games/examples/fps-advanced/pickups.ts +1 -1
  224. package/games/examples/fps-advanced/player.ts +1 -1
  225. package/games/examples/fps-advanced/ui/endgame-ui.ts +1 -1
  226. package/games/examples/fps-advanced/ui/menu-ui.ts +1 -1
  227. package/games/examples/fps-advanced/ui/weapon-hud.ts +253 -253
  228. package/games/examples/fps-advanced/weapons.ts +1 -1
  229. package/games/examples/index.ts +5 -5
  230. package/games/examples/plugin-demo/game.ts +2 -2
  231. package/games/examples/plugin-demo/plugins/dynamic-lighting.ts +1 -1
  232. package/games/examples/plugin-demo/plugins/instanced-forest.ts +1 -1
  233. package/games/examples/plugin-demo/plugins/particle-fountain.ts +1 -1
  234. package/games/examples/plugin-demo/plugins/physics-playground.ts +1 -1
  235. package/games/examples/plugin-demo/plugins/robot-follower.ts +1 -1
  236. package/games/examples/plugin-demo/plugins/scatter-models.ts +1 -1
  237. package/games/examples/plugin-demo/plugins/simple-cube.ts +1 -1
  238. package/games/examples/plugin-demo/plugins/tic-tac-toe.ts +1 -1
  239. package/games/examples/plugin-demo/plugins/wobbling-sphere.ts +1 -1
  240. package/games/examples/side-scroller-advanced/game-mode.ts +1 -1
  241. package/games/examples/side-scroller-advanced/game.ts +1 -1
  242. package/games/examples/side-scroller-advanced/level-generator.ts +1 -1
  243. package/games/examples/side-scroller-advanced/pickups.ts +1 -1
  244. package/games/examples/side-scroller-advanced/player.ts +1 -1
  245. package/games/examples/side-scroller-advanced/ui/endgame-ui.ts +1 -1
  246. package/games/examples/side-scroller-advanced/ui/menu-ui.ts +1 -1
  247. package/games/examples/vehicle/base-vehicle.ts +1 -1
  248. package/games/examples/vehicle/game.ts +1 -1
  249. package/games/examples/vehicle/mesh-vehicle.ts +1 -1
  250. package/games/examples/vehicle/player.ts +1 -1
  251. package/games/examples/vehicle/primitive-vehicle.ts +1 -1
  252. package/games/examples/vr-game/VRAttachableCube.ts +1 -1
  253. package/games/examples/vr-game/VRInteractableCylinder.ts +1 -1
  254. package/games/examples/vr-game/VRPressableButton.ts +1 -1
  255. package/games/examples/vr-game/VRProjectileActor.ts +1 -1
  256. package/games/examples/vr-game/VRRifleActor.ts +1 -1
  257. package/games/examples/vr-game/game.ts +1 -1
  258. package/games/examples/vr-game/scene.ts +1 -1
  259. package/games/instanced-mesh-demo.ts +1 -1
  260. package/games/manifold-demo.ts +1 -1
  261. package/games/navigation-demo.ts +1 -1
  262. package/games/navmesh-primitives-demo.ts +1 -1
  263. package/games/postprocess-demo.ts +2 -2
  264. package/games/ragdoll-demo-simple.ts +1 -1
  265. package/games/ragdoll-demo.ts +1 -1
  266. package/games/swipe-tap-demo.ts +1 -1
  267. package/games/tween-demo.ts +1 -1
  268. package/games/ui-demo.ts +1 -1
  269. package/games/vfx-demo.ts +1 -1
  270. package/games/vfx-wawa-demo.ts +1 -1
  271. package/games/vr-ui-demo-minimal.ts +1 -1
  272. package/games/vr-ui-demo.ts +1 -1
  273. package/package.json +1 -1
  274. package/scripts/dump-templates.ts +1 -1
  275. package/src/global.d.ts +11 -11
  276. package/src/multiplayer/MovementPrediction.ts +202 -202
  277. package/src/templates/MyActor.ts +1 -1
  278. package/src/templates/MySceneComponent.ts +1 -1
  279. package/src/ui/UIResource.ts +20 -20
  280. package/src/utils/browser-polyfills/module.ts +35 -35
  281. package/src/utils/browser-polyfills/path.ts +231 -231
@@ -1,5 +1,5 @@
1
1
 
2
- import * as ENGINE from '@directivegames/../index.js';
2
+ import * as ENGINE from '../index.js';
3
3
 
4
4
 
5
5
  export interface MyActorOptions extends ENGINE.ActorOptions {
@@ -1,5 +1,5 @@
1
1
 
2
- import * as ENGINE from '@directivegames/../index.js';
2
+ import * as ENGINE from '../index.js';
3
3
 
4
4
 
5
5
  export interface MySceneComponentOptions extends ENGINE.SceneComponentOptions {
@@ -1,20 +1,20 @@
1
- import type { UIManager } from './UIManager.js';
2
-
3
- export abstract class UIResource {
4
- protected uiManager: WeakRef<UIManager> | null = null;
5
-
6
- public registerWithUIManager(uiManager: UIManager): void {
7
- if (this.uiManager) {
8
- throw new Error('UIResource already has a UIManager');
9
- }
10
- this.uiManager = new WeakRef(uiManager);
11
- }
12
-
13
- protected unregisterFromUIManager(): void {
14
- if (!this.uiManager) {
15
- return;
16
- }
17
- this.uiManager.deref()?.unregisterUIResource(this);
18
- this.uiManager = null;
19
- }
20
- }
1
+ import type { UIManager } from './UIManager.js';
2
+
3
+ export abstract class UIResource {
4
+ protected uiManager: WeakRef<UIManager> | null = null;
5
+
6
+ public registerWithUIManager(uiManager: UIManager): void {
7
+ if (this.uiManager) {
8
+ throw new Error('UIResource already has a UIManager');
9
+ }
10
+ this.uiManager = new WeakRef(uiManager);
11
+ }
12
+
13
+ protected unregisterFromUIManager(): void {
14
+ if (!this.uiManager) {
15
+ return;
16
+ }
17
+ this.uiManager.deref()?.unregisterUIResource(this);
18
+ this.uiManager = null;
19
+ }
20
+ }
@@ -1,36 +1,36 @@
1
- /**
2
- * Browser-compatible polyfill for Node.js module system
3
- * Provides minimal functionality needed for Genesys.js to work in browsers
4
- */
5
-
6
- /**
7
- * Browser-compatible createRequire implementation
8
- * This is a minimal implementation that should prevent errors when manifold-3d tries to use it
9
- */
10
- function createRequire(filename: string) {
11
- // In browser context, we return a mock require function
12
- // This should prevent the manifold-3d library from failing
13
- function mockRequire(id: string) {
14
- // For now, just throw an error with helpful message
15
- throw new Error(`Cannot require '${id}' in browser context. Module ID: ${id}, from: ${filename}`);
16
- }
17
-
18
- // Add properties that a real require function might have
19
- mockRequire.resolve = (id: string) => {
20
- throw new Error(`Cannot resolve '${id}' in browser context`);
21
- };
22
-
23
- mockRequire.cache = {};
24
- mockRequire.extensions = {};
25
- mockRequire.main = undefined;
26
-
27
- return mockRequire;
28
- }
29
-
30
- // Export as both default and named exports for compatibility
31
- const moduleExports = {
32
- createRequire
33
- };
34
-
35
- export default moduleExports;
1
+ /**
2
+ * Browser-compatible polyfill for Node.js module system
3
+ * Provides minimal functionality needed for Genesys.js to work in browsers
4
+ */
5
+
6
+ /**
7
+ * Browser-compatible createRequire implementation
8
+ * This is a minimal implementation that should prevent errors when manifold-3d tries to use it
9
+ */
10
+ function createRequire(filename: string) {
11
+ // In browser context, we return a mock require function
12
+ // This should prevent the manifold-3d library from failing
13
+ function mockRequire(id: string) {
14
+ // For now, just throw an error with helpful message
15
+ throw new Error(`Cannot require '${id}' in browser context. Module ID: ${id}, from: ${filename}`);
16
+ }
17
+
18
+ // Add properties that a real require function might have
19
+ mockRequire.resolve = (id: string) => {
20
+ throw new Error(`Cannot resolve '${id}' in browser context`);
21
+ };
22
+
23
+ mockRequire.cache = {};
24
+ mockRequire.extensions = {};
25
+ mockRequire.main = undefined;
26
+
27
+ return mockRequire;
28
+ }
29
+
30
+ // Export as both default and named exports for compatibility
31
+ const moduleExports = {
32
+ createRequire
33
+ };
34
+
35
+ export default moduleExports;
36
36
  export { createRequire };
@@ -1,232 +1,232 @@
1
- /**
2
- * Browser-compatible polyfill for Node.js path module
3
- * Provides minimal functionality needed for Genesys.js to work in browsers
4
- */
5
-
6
- interface PathObject {
7
- root: string;
8
- dir: string;
9
- base: string;
10
- ext: string;
11
- name: string;
12
- }
13
-
14
- /**
15
- * Join path segments using forward slashes (browser-friendly)
16
- */
17
- function join(...paths: string[]): string {
18
- if (paths.length === 0) return '.';
19
-
20
- let joined = '';
21
- for (let i = 0; i < paths.length; i++) {
22
- const path = paths[i];
23
- if (path && path.length > 0) {
24
- if (joined.length === 0) {
25
- joined += path;
26
- } else {
27
- joined += '/' + path;
28
- }
29
- }
30
- }
31
-
32
- return normalize(joined);
33
- }
34
-
35
- /**
36
- * Normalize a path (resolve . and .. segments)
37
- */
38
- function normalize(path: string): string {
39
- if (!path) return '.';
40
-
41
- const isAbsolute = path[0] === '/';
42
- const segments = path.split('/').filter(segment => segment !== '');
43
- const normalizedSegments: string[] = [];
44
-
45
- for (const segment of segments) {
46
- if (segment === '..') {
47
- if (normalizedSegments.length > 0 && normalizedSegments[normalizedSegments.length - 1] !== '..') {
48
- normalizedSegments.pop();
49
- } else if (!isAbsolute) {
50
- normalizedSegments.push('..');
51
- }
52
- } else if (segment !== '.') {
53
- normalizedSegments.push(segment);
54
- }
55
- }
56
-
57
- let result = normalizedSegments.join('/');
58
- if (isAbsolute) {
59
- result = '/' + result;
60
- } else if (!result) {
61
- result = '.';
62
- }
63
-
64
- return result;
65
- }
66
-
67
- /**
68
- * Resolve path segments into an absolute path
69
- */
70
- function resolve(...paths: string[]): string {
71
- let resolvedPath = '';
72
- let resolvedAbsolute = false;
73
-
74
- for (let i = paths.length - 1; i >= 0 && !resolvedAbsolute; i--) {
75
- const path = paths[i];
76
- if (path) {
77
- resolvedPath = path + '/' + resolvedPath;
78
- resolvedAbsolute = path[0] === '/';
79
- }
80
- }
81
-
82
- if (!resolvedAbsolute) {
83
- // In browser, we treat relative to current location
84
- resolvedPath = window.location.pathname + '/' + resolvedPath;
85
- }
86
-
87
- return normalize(resolvedPath);
88
- }
89
-
90
- /**
91
- * Check if path is absolute
92
- */
93
- function isAbsolute(path: string): boolean {
94
- return path.length > 0 && (path[0] === '/' || path.includes('://'));
95
- }
96
-
97
- /**
98
- * Get the directory name of a path
99
- */
100
- function dirname(path: string): string {
101
- if (!path) return '.';
102
-
103
- const lastSlash = path.lastIndexOf('/');
104
- if (lastSlash === -1) return '.';
105
- if (lastSlash === 0) return '/';
106
-
107
- return path.slice(0, lastSlash);
108
- }
109
-
110
- /**
111
- * Get the base name of a path
112
- */
113
- function basename(path: string, ext?: string): string {
114
- if (!path) return '';
115
-
116
- const lastSlash = path.lastIndexOf('/');
117
- let base = lastSlash === -1 ? path : path.slice(lastSlash + 1);
118
-
119
- if (ext && base.endsWith(ext)) {
120
- base = base.slice(0, -ext.length);
121
- }
122
-
123
- return base;
124
- }
125
-
126
- /**
127
- * Get the extension of a path
128
- */
129
- function extname(path: string): string {
130
- if (!path) return '';
131
-
132
- const base = basename(path);
133
- const lastDot = base.lastIndexOf('.');
134
-
135
- return lastDot === -1 ? '' : base.slice(lastDot);
136
- }
137
-
138
- /**
139
- * Parse a path into components
140
- */
141
- function parse(path: string): PathObject {
142
- const dir = dirname(path);
143
- const base = basename(path);
144
- const ext = extname(path);
145
- const name = basename(path, ext);
146
-
147
- return {
148
- root: isAbsolute(path) ? '/' : '',
149
- dir,
150
- base,
151
- ext,
152
- name
153
- };
154
- }
155
-
156
- /**
157
- * Format a path object into a string
158
- */
159
- function format(pathObject: PathObject): string {
160
- const dir = pathObject.dir || pathObject.root;
161
- const base = pathObject.base || pathObject.name + pathObject.ext;
162
-
163
- if (!dir) return base;
164
- return dir === pathObject.root ? dir + base : dir + '/' + base;
165
- }
166
-
167
- /**
168
- * Get relative path from one path to another
169
- */
170
- function relative(from: string, to: string): string {
171
- from = resolve(from);
172
- to = resolve(to);
173
-
174
- if (from === to) return '';
175
-
176
- const fromParts = from.split('/').filter(p => p);
177
- const toParts = to.split('/').filter(p => p);
178
-
179
- let commonLength = 0;
180
- const length = Math.min(fromParts.length, toParts.length);
181
-
182
- for (let i = 0; i < length; i++) {
183
- if (fromParts[i] === toParts[i]) {
184
- commonLength++;
185
- } else {
186
- break;
187
- }
188
- }
189
-
190
- const upCount = fromParts.length - commonLength;
191
- const downPath = toParts.slice(commonLength);
192
-
193
- const relativeParts = Array(upCount).fill('..').concat(downPath);
194
-
195
- return relativeParts.join('/') || '.';
196
- }
197
-
198
- // Browser-friendly path separator (always forward slash)
199
- const sep = '/';
200
- const delimiter = ':';
201
-
202
- // Export as both default and named exports for compatibility
203
- const pathModule = {
204
- join,
205
- normalize,
206
- resolve,
207
- isAbsolute,
208
- dirname,
209
- basename,
210
- extname,
211
- parse,
212
- format,
213
- relative,
214
- sep,
215
- delimiter
216
- };
217
-
218
- export default pathModule;
219
- export {
220
- join,
221
- normalize,
222
- resolve,
223
- isAbsolute,
224
- dirname,
225
- basename,
226
- extname,
227
- parse,
228
- format,
229
- relative,
230
- sep,
231
- delimiter
1
+ /**
2
+ * Browser-compatible polyfill for Node.js path module
3
+ * Provides minimal functionality needed for Genesys.js to work in browsers
4
+ */
5
+
6
+ interface PathObject {
7
+ root: string;
8
+ dir: string;
9
+ base: string;
10
+ ext: string;
11
+ name: string;
12
+ }
13
+
14
+ /**
15
+ * Join path segments using forward slashes (browser-friendly)
16
+ */
17
+ function join(...paths: string[]): string {
18
+ if (paths.length === 0) return '.';
19
+
20
+ let joined = '';
21
+ for (let i = 0; i < paths.length; i++) {
22
+ const path = paths[i];
23
+ if (path && path.length > 0) {
24
+ if (joined.length === 0) {
25
+ joined += path;
26
+ } else {
27
+ joined += '/' + path;
28
+ }
29
+ }
30
+ }
31
+
32
+ return normalize(joined);
33
+ }
34
+
35
+ /**
36
+ * Normalize a path (resolve . and .. segments)
37
+ */
38
+ function normalize(path: string): string {
39
+ if (!path) return '.';
40
+
41
+ const isAbsolute = path[0] === '/';
42
+ const segments = path.split('/').filter(segment => segment !== '');
43
+ const normalizedSegments: string[] = [];
44
+
45
+ for (const segment of segments) {
46
+ if (segment === '..') {
47
+ if (normalizedSegments.length > 0 && normalizedSegments[normalizedSegments.length - 1] !== '..') {
48
+ normalizedSegments.pop();
49
+ } else if (!isAbsolute) {
50
+ normalizedSegments.push('..');
51
+ }
52
+ } else if (segment !== '.') {
53
+ normalizedSegments.push(segment);
54
+ }
55
+ }
56
+
57
+ let result = normalizedSegments.join('/');
58
+ if (isAbsolute) {
59
+ result = '/' + result;
60
+ } else if (!result) {
61
+ result = '.';
62
+ }
63
+
64
+ return result;
65
+ }
66
+
67
+ /**
68
+ * Resolve path segments into an absolute path
69
+ */
70
+ function resolve(...paths: string[]): string {
71
+ let resolvedPath = '';
72
+ let resolvedAbsolute = false;
73
+
74
+ for (let i = paths.length - 1; i >= 0 && !resolvedAbsolute; i--) {
75
+ const path = paths[i];
76
+ if (path) {
77
+ resolvedPath = path + '/' + resolvedPath;
78
+ resolvedAbsolute = path[0] === '/';
79
+ }
80
+ }
81
+
82
+ if (!resolvedAbsolute) {
83
+ // In browser, we treat relative to current location
84
+ resolvedPath = window.location.pathname + '/' + resolvedPath;
85
+ }
86
+
87
+ return normalize(resolvedPath);
88
+ }
89
+
90
+ /**
91
+ * Check if path is absolute
92
+ */
93
+ function isAbsolute(path: string): boolean {
94
+ return path.length > 0 && (path[0] === '/' || path.includes('://'));
95
+ }
96
+
97
+ /**
98
+ * Get the directory name of a path
99
+ */
100
+ function dirname(path: string): string {
101
+ if (!path) return '.';
102
+
103
+ const lastSlash = path.lastIndexOf('/');
104
+ if (lastSlash === -1) return '.';
105
+ if (lastSlash === 0) return '/';
106
+
107
+ return path.slice(0, lastSlash);
108
+ }
109
+
110
+ /**
111
+ * Get the base name of a path
112
+ */
113
+ function basename(path: string, ext?: string): string {
114
+ if (!path) return '';
115
+
116
+ const lastSlash = path.lastIndexOf('/');
117
+ let base = lastSlash === -1 ? path : path.slice(lastSlash + 1);
118
+
119
+ if (ext && base.endsWith(ext)) {
120
+ base = base.slice(0, -ext.length);
121
+ }
122
+
123
+ return base;
124
+ }
125
+
126
+ /**
127
+ * Get the extension of a path
128
+ */
129
+ function extname(path: string): string {
130
+ if (!path) return '';
131
+
132
+ const base = basename(path);
133
+ const lastDot = base.lastIndexOf('.');
134
+
135
+ return lastDot === -1 ? '' : base.slice(lastDot);
136
+ }
137
+
138
+ /**
139
+ * Parse a path into components
140
+ */
141
+ function parse(path: string): PathObject {
142
+ const dir = dirname(path);
143
+ const base = basename(path);
144
+ const ext = extname(path);
145
+ const name = basename(path, ext);
146
+
147
+ return {
148
+ root: isAbsolute(path) ? '/' : '',
149
+ dir,
150
+ base,
151
+ ext,
152
+ name
153
+ };
154
+ }
155
+
156
+ /**
157
+ * Format a path object into a string
158
+ */
159
+ function format(pathObject: PathObject): string {
160
+ const dir = pathObject.dir || pathObject.root;
161
+ const base = pathObject.base || pathObject.name + pathObject.ext;
162
+
163
+ if (!dir) return base;
164
+ return dir === pathObject.root ? dir + base : dir + '/' + base;
165
+ }
166
+
167
+ /**
168
+ * Get relative path from one path to another
169
+ */
170
+ function relative(from: string, to: string): string {
171
+ from = resolve(from);
172
+ to = resolve(to);
173
+
174
+ if (from === to) return '';
175
+
176
+ const fromParts = from.split('/').filter(p => p);
177
+ const toParts = to.split('/').filter(p => p);
178
+
179
+ let commonLength = 0;
180
+ const length = Math.min(fromParts.length, toParts.length);
181
+
182
+ for (let i = 0; i < length; i++) {
183
+ if (fromParts[i] === toParts[i]) {
184
+ commonLength++;
185
+ } else {
186
+ break;
187
+ }
188
+ }
189
+
190
+ const upCount = fromParts.length - commonLength;
191
+ const downPath = toParts.slice(commonLength);
192
+
193
+ const relativeParts = Array(upCount).fill('..').concat(downPath);
194
+
195
+ return relativeParts.join('/') || '.';
196
+ }
197
+
198
+ // Browser-friendly path separator (always forward slash)
199
+ const sep = '/';
200
+ const delimiter = ':';
201
+
202
+ // Export as both default and named exports for compatibility
203
+ const pathModule = {
204
+ join,
205
+ normalize,
206
+ resolve,
207
+ isAbsolute,
208
+ dirname,
209
+ basename,
210
+ extname,
211
+ parse,
212
+ format,
213
+ relative,
214
+ sep,
215
+ delimiter
216
+ };
217
+
218
+ export default pathModule;
219
+ export {
220
+ join,
221
+ normalize,
222
+ resolve,
223
+ isAbsolute,
224
+ dirname,
225
+ basename,
226
+ extname,
227
+ parse,
228
+ format,
229
+ relative,
230
+ sep,
231
+ delimiter
232
232
  };