@energy8platform/platform-core 0.36.0 → 0.36.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@energy8platform/platform-core",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
4
4
  "description": "Energy8 platform core: Lua engine, DevBridge, RTP simulation, and SDK session orchestration. Renderer-agnostic — pair with any game framework (Pixi, Phaser, Three.js, custom).",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
@@ -11,7 +11,7 @@
11
11
  * binaries are published here, same discipline as the old Go simulate CLI.
12
12
  */
13
13
 
14
- import { createWriteStream, chmodSync, existsSync, mkdirSync } from 'fs';
14
+ import { createWriteStream, chmodSync, existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
15
15
  import { join, dirname } from 'path';
16
16
  import { fileURLToPath } from 'url';
17
17
  import { get } from 'https';
@@ -25,7 +25,7 @@ const REPO = process.env.E8_RELEASE_REPO || 'energy8platform/game-engine';
25
25
  // e8 binary version — bump when new Rust binaries are uploaded to Releases.
26
26
  // The binary is game-agnostic (it compiles any .spin), so it only needs to
27
27
  // move when the engine/CLI itself changes.
28
- const BINARY_VERSION = process.env.E8_BINARY_VERSION || '0.1.6';
28
+ const BINARY_VERSION = process.env.E8_BINARY_VERSION || '0.1.7';
29
29
 
30
30
  // Два бинаря на платформу: e8 (математика/симуляция) и e8-server
31
31
  // (дев-раунды для Vite-плагина).
@@ -51,11 +51,17 @@ async function main() {
51
51
  // Префикс e8-: в этом репо теги v* заняты релизами старого Go simulate CLI.
52
52
  const tag = `e8-v${BINARY_VERSION}`;
53
53
 
54
+ // Какая версия лежит в bin/ сейчас. Без маркера бамп BINARY_VERSION молча
55
+ // оставлял старый бинарь везде, где bin/ уже был (любая машина разработчика):
56
+ // «уже скачано» не отличалось от «скачано другой версией».
57
+ const marker = join(BIN_DIR, '.e8-version');
58
+ const installed = existsSync(marker) ? readFileSync(marker, 'utf8').trim() : '';
59
+
54
60
  for (const binaryName of binaryNames) {
55
61
  const dest = join(BIN_DIR, binaryName);
56
62
 
57
- // Skip if already downloaded
58
- if (existsSync(dest)) {
63
+ // Skip if this version is already downloaded
64
+ if (existsSync(dest) && installed === BINARY_VERSION) {
59
65
  continue;
60
66
  }
61
67
 
@@ -72,6 +78,7 @@ async function main() {
72
78
  }
73
79
  await download(url, dest);
74
80
  chmodSync(dest, 0o755);
81
+ writeFileSync(marker, `${BINARY_VERSION}\n`);
75
82
  console.log(`[e8] Installed ${binaryName}`);
76
83
  } catch (err) {
77
84
  // Non-fatal — Lua games are unaffected; spin games can use