@energy8platform/game-engine 0.27.2 → 0.29.0

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/src/index.ts CHANGED
@@ -73,9 +73,9 @@ export type { DevBridgeConfig, ReplayConfig, ReplayLaunch } from '@energy8platfo
73
73
  export { FPSOverlay } from './debug/FPSOverlay';
74
74
 
75
75
  // ─── Lua ────────────────────────────────────────────────
76
- // Lua module is Node.js only (fengari). Use the sub-path import:
76
+ // (математика SpinML/e8; fengari удалён из platform-core)
77
77
  // import { LuaEngine } from '@energy8platform/game-engine/lua'
78
- // Re-export only types (zero runtime cost, no fengari in browser bundle).
78
+ // (математика SpinML/e8; fengari удалён из platform-core)
79
79
  export type {
80
80
  GameDefinition,
81
81
  ActionDefinition,
package/src/vite/index.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import type { UserConfig, Plugin } from 'vite';
2
- import { devBridgePlugin, luaPlugin } from '@energy8platform/platform-core/vite';
2
+ import { devBridgePlugin, spinPlugin } from '@energy8platform/platform-core/vite';
3
3
 
4
4
  // Re-export so users importing from `@energy8platform/game-engine/vite`
5
5
  // can still grab the plugins directly without a separate platform-core import.
6
- export { devBridgePlugin, luaPlugin } from '@energy8platform/platform-core/vite';
6
+ export { devBridgePlugin, spinPlugin } from '@energy8platform/platform-core/vite';
7
7
 
8
8
  // ─── Types ───────────────────────────────────────────────
9
9
 
@@ -17,6 +17,12 @@ export interface GameConfig {
17
17
  /** Path to DevBridge config file (default: './dev.config.ts') */
18
18
  devBridgeConfig?: string;
19
19
 
20
+ /** Path to the game's .spin math (default: './src/game/script.spin'). */
21
+ spinScript?: string;
22
+
23
+ /** Game id for the spin dev server (default: first loaded game). */
24
+ gameId?: string;
25
+
20
26
  /** Additional Vite config to merge */
21
27
  vite?: UserConfig;
22
28
  }
@@ -53,7 +59,13 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
53
59
  if (config.devBridge) {
54
60
  const configPath = config.devBridgeConfig ?? './dev.config';
55
61
  plugins.push(devBridgePlugin(configPath));
56
- plugins.push(luaPlugin(configPath));
62
+ // e8-server ведёт раунды и hot-reload .spin (математика — SpinML)
63
+ plugins.push(
64
+ spinPlugin({
65
+ spinPath: config.spinScript ?? './src/game/script.spin',
66
+ gameId: config.gameId,
67
+ }),
68
+ );
57
69
  }
58
70
 
59
71
  const userVite = config.vite ?? {};
@@ -97,9 +109,6 @@ export function defineGameConfig(config: GameConfig = {}): UserConfig {
97
109
  include: [
98
110
  'pixi.js',
99
111
  ],
100
- exclude: [
101
- 'fengari',
102
- ],
103
112
  esbuildOptions: {
104
113
  target: 'esnext',
105
114
  },