A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
refactor: Replace shell scripts with Node.js build pipeline
esengine15dd77b2338a
diff --git a/.gitignore b/.gitignoreindex 9473c1002..966134260 100644--- a/.gitignore+++ b/.gitignore@@ -1,12 +1,15 @@# Build directoriesbuild/build-*/+!build-tools/build_*/out/dist/# Node.jsnode_modules/+package-lock.json+pnpm-lock.yamlpnpm-debug.log*# Rust/Tauridiff --git a/CMakeLists.txt b/CMakeLists.txtindex e58606040..0e3ed01aa 100644--- a/CMakeLists.txt+++ b/CMakeLists.txt@@ -7,7 +7,6 @@ set(CMAKE_CXX_EXTENSIONS OFF)option(ES_BUILD_WEB "Build for Web/Emscripten" OFF)option(ES_BUILD_WXGAME "Build for WeChat MiniGame" OFF)-option(ES_BUILD_MODULAR "Build modular WASM (side modules)" OFF)option(ES_BUILD_TESTS "Build tests" ON)option(ES_BUILD_SINGLE_FILE "Build single-file SDK (WASM inlined)" OFF)@@ -16,9 +15,6 @@ include(ESEngineConfig)if(ES_BUILD_WEB OR ES_BUILD_WXGAME)include(Emscripten)- if(ES_BUILD_MODULAR)- include(ModularBuild)- endif()endif()add_subdirectory(third_party)@@ -152,7 +148,6 @@ endif()target_include_directories(esenginePUBLIC$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/stb>$<INSTALL_INTERFACE:include>PRIVATEdiff --git a/build-tools/build.config.js b/build-tools/build.config.jsnew file mode 100644index 000000000..bcc768427--- /dev/null+++ b/build-tools/build.config.js@@ -0,0 +1,81 @@+import path from 'path';+import { fileURLToPath } from 'url';++const __dirname = path.dirname(fileURLToPath(import.meta.url));++export default {+ paths: {+ root: path.resolve(__dirname, '..'),+ output: path.resolve(__dirname, '../build'),+ cache: path.resolve(__dirname, '../build/.cache'),+ desktop: path.resolve(__dirname, '../desktop/public'),+ sdk: path.resolve(__dirname, '../sdk'),+ },++ wasm: {+ web: {+ buildDir: 'build-web',+ cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF'],+ targets: ['esengine_sdk'],+ outputs: {+ 'sdk/esengine.js': 'wasm/web/esengine.js',+ 'sdk/esengine.wasm': 'wasm/web/esengine.wasm',+ },+ },+ wechat: {+ buildDir: 'build-wxgame',+ cmakeFlags: ['-DES_BUILD_WXGAME=ON', '-DES_BUILD_TESTS=OFF'],+ targets: ['esengine_wxgame'],+ outputs: {+ 'sdk/esengine.wxgame.js': 'wasm/wechat/esengine.wxgame.js',+ 'sdk/esengine.wxgame.wasm': 'wasm/wechat/esengine.wxgame.wasm',+ },+ },+ playable: {+ buildDir: 'build-playable',+ cmakeFlags: ['-DES_BUILD_WEB=ON', '-DES_BUILD_TESTS=OFF', '-DES_BUILD_SINGLE_FILE=ON'],+ targets: ['esengine_single'],+ outputs: {+ 'sdk/esengine.single.js': 'wasm/playable/esengine.single.js',+ },+ },+ },++ sdk: {+ esm: {+ input: 'src/index.ts',+ output: 'esm/index.js',+ format: 'esm',+ },+ cjs: {+ input: 'src/index.wechat.ts',+ output: 'cjs/index.wechat.js',+ format: 'cjs',+ },+ },++ eht: {+ inputDir: 'src/esengine/ecs/components',+ outputDir: 'src/esengine/bindings',+ tsOutputDir: 'sdk/src',+ script: 'tools/eht.py',+ },++ watch: {+ cpp: ['src/**/*.cpp', 'src/**/*.hpp'],+ ts: ['sdk/src/**/*.ts'],+ components: ['src/esengine/ecs/components/**/*.hpp'],+ },++ sync: {+ wasm: {+ 'build/wasm/web': 'desktop/public/wasm',+ 'build/wasm/wechat': 'desktop/public/wasm',+ 'build/wasm/playable': 'desktop/public/wasm',+ },+ sdk: {+ 'build/sdk/esm': 'desktop/public/sdk/esm',+ 'build/sdk/cjs': 'desktop/public/sdk/cjs',+ },+ },+};diff --git a/build-tools/cli.js b/build-tools/cli.jsnew file mode 100644index 000000000..1cda7684e--- /dev/null+++ b/build-tools/cli.js@@ -0,0 +1,178 @@+#!/usr/bin/env node++import { program } from 'commander';+import { rm, mkdir } from 'fs/promises';+import { existsSync } from 'fs';+import config from './build.config.js';+import * as logger from './utils/logger.js';+import { checkEnvironment } from './utils/emscripten.js';+import { runEht } from './tasks/eht.js';+import { buildWasm, cleanWasm } from './tasks/wasm.js';+import { buildSdk, cleanSdk } from './tasks/sdk.js';+import { syncToDesktop } from './tasks/sync.js';+import { startWatch } from './tasks/watch.js';++program+ .name('esengine-build')+ .description('ESEngine build tools')+ .version('1.0.0');++program+ .command('build')+ .description('Build ESEngine')+ .option('-t, --target <target>', 'Build target (web, wechat, playable, sdk, all)', 'web')+ .option('-d, --debug', 'Debug build', false)+ .option('-r, --release', 'Release build (default)', true)+ .option('-c, --clean', 'Clean before build', false)+ .option('--no-cache', 'Disable EHT cache')+ .option('-v, --verbose', 'Verbose output', false)+ .option('--no-sync', 'Skip syncing to desktop/public')+ .action(async (options) => {+ logger.setVerbose(options.verbose);+ const startTime = Date.now();++ try {+ logger.header('ESEngine Build');++ if (!await checkEnvironment()) {+ process.exit(1);+ }++ const isDebug = options.debug && !options.release;+ const targets = options.target === 'all'+ ? ['web', 'wechat', 'playable']+ : [options.target];++ if (options.clean) {+ await cleanAll();+ }++ const wasmTargets = targets.filter(t => t !== 'sdk');+ const buildSdkFlag = options.target === 'all' || options.target === 'sdk' || wasmTargets.length > 0;++ if (wasmTargets.length > 0) {+ await runEht({ noCache: !options.cache });++ for (const target of wasmTargets) {+ await buildWasm(target, { debug: isDebug, clean: options.clean });+ }+ }++ if (buildSdkFlag) {+ await buildSdk();+ }++ if (options.sync) {+ await syncToDesktop();+ }++ logger.printTime(startTime);+ } catch (err) {+ logger.error(err.message);+ if (options.verbose) {+ console.error(err);+ }+ process.exit(1);+ }+ });++program+ .command('watch')+ .description('Watch mode for development')+ .option('-t, --target <target>', 'Build target for WASM', 'web')+ .option('-v, --verbose', 'Verbose output', false)+ .action(async (options) => {+ logger.setVerbose(options.verbose);++ try {+ if (!await checkEnvironment()) {+ process.exit(1);+ }++ await startWatch({ target: options.target });+ } catch (err) {+ logger.error(err.message);+ process.exit(1);+ }+ });++program+ .command('clean')+ .description('Clean build outputs')+ .option('-a, --all', 'Clean all build directories', false)+ .option('-t, --target <target>', 'Clean specific target')+ .action(async (options) => {+ try {+ logger.header('Clean');++ if (options.all || !options.target) {+ await cleanAll();+ } else {+ await cleanWasm(options.target);+ }++ logger.success('Clean complete');+ } catch (err) {+ logger.error(err.message);+ process.exit(1);+ }+ });++program+ .command('eht')+ .description('Run EHT code generation only')+ .option('--no-cache', 'Disable cache')+ .option('-v, --verbose', 'Verbose output', false)+ .action(async (options) => {+ logger.setVerbose(options.verbose);++ try {+ await runEht({ noCache: !options.cache });+ } catch (err) {+ logger.error(err.message);+ process.exit(1);+ }+ });++program+ .command('sdk')+ .description('Build SDK only')+ .option('-v, --verbose', 'Verbose output', false)+ .action(async (options) => {+ logger.setVerbose(options.verbose);++ try {+ await buildSdk();+ await syncToDesktop({ wasm: false, sdk: true });+ } catch (err) {+ logger.error(err.message);+ process.exit(1);+ }+ });++program+ .command('sync')+ .description('Sync build outputs to desktop/public')+ .action(async () => {+ try {+ await syncToDesktop();+ } catch (err) {+ logger.error(err.message);+ process.exit(1);+ }+ });++async function cleanAll() {+ logger.step('Cleaning all build outputs...');++ const outputDir = config.paths.output;+ if (existsSync(outputDir)) {+ await rm(outputDir, { recursive: true, force: true });+ logger.debug('Removed build/');+ }++ await cleanWasm();+ await cleanSdk();+}++program.parse();diff --git a/build-tools/package.json b/build-tools/package.jsonnew file mode 100644index 000000000..1de6bfcb4--- /dev/null+++ b/build-tools/package.json@@ -0,0 +1,8 @@+{+ "name": "esengine-build-tools",+ "version": "1.0.0",+ "private": true,+ "type": "module",+ "description": "ESEngine build pipeline tools",+ "main": "cli.js"+}diff --git a/build-tools/tasks/eht.js b/build-tools/tasks/eht.jsnew file mode 100644index 000000000..9505122ab--- /dev/null+++ b/build-tools/tasks/eht.js@@ -0,0 +1,89 @@+import path from 'path';+import { glob } from 'fs/promises';+import config from '../build.config.js';+import * as logger from '../utils/logger.js';+import { runCommand } from '../utils/emscripten.js';+import { hashFiles, HashCache } from '../utils/hash.js';++export async function runEht(options = {}) {+ const { noCache = false } = options;++ logger.step('Running EHT code generation...');++ const rootDir = config.paths.root;+ const inputDir = path.join(rootDir, config.eht.inputDir);+ const script = path.join(rootDir, config.eht.script);++ const componentFiles = await getComponentFiles(inputDir);++ if (componentFiles.length === 0) {+ logger.warn('No component files found');+ return { skipped: true, reason: 'no-files' };+ }++ logger.debug(`Found ${componentFiles.length} component files`);++ if (!noCache) {+ const cache = new HashCache(config.paths.cache);+ await cache.load();++ const allFiles = [script, ...componentFiles];+ const currentHash = await hashFiles(allFiles);++ if (!await cache.isChanged('eht', currentHash)) {+ logger.success('EHT: No changes detected (cached)');+ return { skipped: true, reason: 'cached' };+ }++ try {+ await executeEht(rootDir, script);+ cache.set('eht', currentHash);+ await cache.save();+ } catch (err) {+ throw err;+ }+ } else {+ await executeEht(rootDir, script);+ }++ logger.success('EHT: Code generation complete');+ return { skipped: false };+}++async function getComponentFiles(inputDir) {+ const files = [];+ try {+ const { readdir, stat } = await import('fs/promises');++ async function walk(dir) {+ const entries = await readdir(dir, { withFileTypes: true });+ for (const entry of entries) {+ const fullPath = path.join(dir, entry.name);+ if (entry.isDirectory()) {+ await walk(fullPath);+ } else if (entry.isFile() && entry.name.endsWith('.hpp')) {+ files.push(fullPath);+ }+ }+ }++ await walk(inputDir);+ } catch {+ // Directory doesn't exist+ }+ return files;+}++async function executeEht(rootDir, script) {+ const outputDir = path.join(rootDir, config.eht.outputDir);+ const tsOutputDir = path.join(rootDir, config.eht.tsOutputDir);++ await runCommand('python3', [+ script,+ '--input', path.join(rootDir, config.eht.inputDir),+ '--output', outputDir,+ '--ts-output', tsOutputDir,+ ], {+ cwd: rootDir,+ });+}diff --git a/build-tools/tasks/sdk.js b/build-tools/tasks/sdk.jsnew file mode 100644index 000000000..d068a18c9--- /dev/null+++ b/build-tools/tasks/sdk.js@@ -0,0 +1,90 @@+import path from 'path';+import { mkdir, cp, readFile, writeFile } from 'fs/promises';+import { existsSync } from 'fs';+import config from '../build.config.js';+import * as logger from '../utils/logger.js';+import { runCommand } from '../utils/emscripten.js';++export async function buildSdk(options = {}) {+ logger.step('Building SDK...');++ const sdkDir = config.paths.sdk;+ const outputDir = path.join(config.paths.output, 'sdk');++ await mkdir(outputDir, { recursive: true });++ await runCommand('npm', ['run', 'build'], { cwd: sdkDir });++ await copyDistOutputs(sdkDir, outputDir);++ logger.success('SDK: Build complete');+ return { outputDir };+}++async function copyDistOutputs(sdkDir, outputDir) {+ const distDir = path.join(sdkDir, 'dist');++ if (!existsSync(distDir)) {+ logger.warn('SDK dist directory not found');+ return;+ }++ const esmDir = path.join(outputDir, 'esm');+ const cjsDir = path.join(outputDir, 'cjs');++ await mkdir(esmDir, { recursive: true });+ await mkdir(cjsDir, { recursive: true });++ const files = [+ { src: 'index.js', dest: path.join(esmDir, 'index.js') },+ { src: 'index.d.ts', dest: path.join(esmDir, 'index.d.ts') },+ { src: 'wasm.js', dest: path.join(esmDir, 'wasm.js') },+ { src: 'wasm.d.ts', dest: path.join(esmDir, 'wasm.d.ts') },+ { src: 'index.wechat.js', dest: path.join(cjsDir, 'index.wechat.js') },+ ];++ for (const { src, dest } of files) {+ const srcPath = path.join(distDir, src);+ if (existsSync(srcPath)) {+ await cp(srcPath, dest);+ logger.debug(`Copied ${src}`);+ }+ }+}++export async function buildSdkDirect(format = 'all') {+ logger.step(`Building SDK (${format})...`);++ const sdkDir = config.paths.sdk;+ const outputDir = path.join(config.paths.output, 'sdk');++ await mkdir(outputDir, { recursive: true });++ const args = ['rollup', '-c'];+ if (format !== 'all') {+ args.push('--environment', `FORMAT:${format}`);+ }++ await runCommand('npx', args, { cwd: sdkDir });++ await copyDistOutputs(sdkDir, outputDir);++ logger.success(`SDK (${format}): Build complete`);+}++export async function cleanSdk() {+ const sdkDistDir = path.join(config.paths.sdk, 'dist');+ const outputSdkDir = path.join(config.paths.output, 'sdk');++ const { rm } = await import('fs/promises');++ if (existsSync(sdkDistDir)) {+ await rm(sdkDistDir, { recursive: true, force: true });+ logger.debug('Removed sdk/dist');+ }++ if (existsSync(outputSdkDir)) {+ await rm(outputSdkDir, { recursive: true, force: true });+ logger.debug('Removed build/sdk');+ }+}diff --git a/build-tools/tasks/sync.js b/build-tools/tasks/sync.jsnew file mode 100644index 000000000..90bbe13ac--- /dev/null+++ b/build-tools/tasks/sync.js@@ -0,0 +1,78 @@+import path from 'path';+import { mkdir, cp, readdir, stat } from 'fs/promises';+import { existsSync } from 'fs';+import config from '../build.config.js';+import * as logger from '../utils/logger.js';++export async function syncToDesktop(options = {}) {+ const { wasm = true, sdk = true } = options;++ logger.step('Syncing to desktop/public...');++ const rootDir = config.paths.root;+ let synced = 0;++ if (wasm) {+ for (const [src, dest] of Object.entries(config.sync.wasm)) {+ const srcPath = path.join(rootDir, src);+ const destPath = path.join(rootDir, dest);++ if (existsSync(srcPath)) {+ synced += await copyDirectory(srcPath, destPath);+ }+ }+ }++ if (sdk) {+ for (const [src, dest] of Object.entries(config.sync.sdk)) {+ const srcPath = path.join(rootDir, src);+ const destPath = path.join(rootDir, dest);++ if (existsSync(srcPath)) {+ synced += await copyDirectory(srcPath, destPath);+ }+ }+ }++ if (synced > 0) {+ logger.success(`Sync: ${synced} files copied to desktop/public`);+ } else {+ logger.info('Sync: No files to sync');+ }++ return { synced };+}++async function copyDirectory(srcDir, destDir) {+ if (!existsSync(srcDir)) {+ return 0;+ }++ await mkdir(destDir, { recursive: true });++ let count = 0;+ const entries = await readdir(srcDir, { withFileTypes: true });++ for (const entry of entries) {+ const srcPath = path.join(srcDir, entry.name);+ const destPath = path.join(destDir, entry.name);++ if (entry.isDirectory()) {+ count += await copyDirectory(srcPath, destPath);+ } else if (entry.isFile()) {+ await cp(srcPath, destPath);+ logger.debug(`Synced ${entry.name}`);+ count++;+ }+ }++ return count;+}++export async function syncWasmOnly() {+ return syncToDesktop({ wasm: true, sdk: false });+}++export async function syncSdkOnly() {+ return syncToDesktop({ wasm: false, sdk: true });+}diff --git a/build-tools/tasks/wasm.js b/build-tools/tasks/wasm.jsnew file mode 100644index 000000000..89a2d1c37--- /dev/null+++ b/build-tools/tasks/wasm.js@@ -0,0 +1,99 @@+import path from 'path';+import { mkdir, cp, rm } from 'fs/promises';+import { existsSync } from 'fs';+import config from '../build.config.js';+import * as logger from '../utils/logger.js';+import { runCommand, getCpuCount } from '../utils/emscripten.js';++export async function buildWasm(target, options = {}) {+ const { debug = false, clean = false } = options;++ const targetConfig = config.wasm[target];+ if (!targetConfig) {+ throw new Error(`Unknown target: ${target}. Available: ${Object.keys(config.wasm).join(', ')}`);+ }++ logger.step(`Building WASM for ${target}...`);++ const rootDir = config.paths.root;+ const buildDir = path.join(rootDir, targetConfig.buildDir);+ const outputDir = config.paths.output;++ if (clean && existsSync(buildDir)) {+ logger.debug(`Cleaning ${buildDir}`);+ await rm(buildDir, { recursive: true, force: true });+ }++ await mkdir(buildDir, { recursive: true });++ const buildType = debug ? 'Debug' : 'Release';+ const cmakeArgs = [+ 'cmake',+ ...targetConfig.cmakeFlags,+ `-DCMAKE_BUILD_TYPE=${buildType}`,+ rootDir,+ ];++ logger.debug(`CMake configure: emcmake ${cmakeArgs.join(' ')}`);+ await runCommand('emcmake', cmakeArgs, { cwd: buildDir });++ const cpuCount = getCpuCount();+ const buildArgs = ['--build', '.', '-j', String(cpuCount)];++ if (targetConfig.targets && targetConfig.targets.length > 0) {+ buildArgs.push('--target', ...targetConfig.targets);+ }++ logger.debug(`CMake build: cmake ${buildArgs.join(' ')}`);+ await runCommand('cmake', buildArgs, { cwd: buildDir });++ await copyOutputs(buildDir, outputDir, targetConfig.outputs);++ logger.success(`WASM ${target}: Build complete`);+ return { target, buildDir, outputDir };+}++async function copyOutputs(buildDir, outputDir, outputs) {+ for (const [src, dest] of Object.entries(outputs)) {+ const srcPath = path.join(buildDir, src);+ const destPath = path.join(outputDir, dest);++ if (!existsSync(srcPath)) {+ logger.warn(`Output file not found: ${srcPath}`);+ continue;+ }++ await mkdir(path.dirname(destPath), { recursive: true });+ await cp(srcPath, destPath);+ logger.debug(`Copied ${src} → ${dest}`);+ }+}++export async function buildAllWasm(options = {}) {+ const results = [];+ for (const target of Object.keys(config.wasm)) {+ const result = await buildWasm(target, options);+ results.push(result);+ }+ return results;+}++export async function cleanWasm(target = null) {+ const rootDir = config.paths.root;++ if (target) {+ const targetConfig = config.wasm[target];+ if (!targetConfig) {+ throw new Error(`Unknown target: ${target}`);+ }+ const buildDir = path.join(rootDir, targetConfig.buildDir);+ if (existsSync(buildDir)) {+ await rm(buildDir, { recursive: true, force: true });+ logger.debug(`Removed ${buildDir}`);+ }+ } else {+ for (const t of Object.keys(config.wasm)) {+ await cleanWasm(t);+ }+ }+}diff --git a/build-tools/tasks/watch.js b/build-tools/tasks/watch.jsnew file mode 100644index 000000000..3ebef7aef--- /dev/null+++ b/build-tools/tasks/watch.js@@ -0,0 +1,109 @@+import path from 'path';+import chokidar from 'chokidar';+import config from '../build.config.js';+import * as logger from '../utils/logger.js';+import { runEht } from './eht.js';+import { buildWasm } from './wasm.js';+import { buildSdk } from './sdk.js';+import { syncToDesktop } from './sync.js';++export async function startWatch(options = {}) {+ const { target = 'web' } = options;++ logger.header('Watch Mode');+ logger.info(`Watching for changes (target: ${target})`);+ logger.info('Press Ctrl+C to stop');+ logger.divider();++ const rootDir = config.paths.root;++ let isBuilding = false;+ let pendingBuild = null;++ async function rebuild(type, file) {+ if (isBuilding) {+ pendingBuild = { type, file };+ return;+ }++ isBuilding = true;+ const relFile = path.relative(rootDir, file);+ logger.info(`File changed: ${relFile}`);++ try {+ if (type === 'component') {+ await runEht({ noCache: true });+ await buildWasm(target, { debug: true });+ await buildSdk();+ } else if (type === 'cpp') {+ await buildWasm(target, { debug: true });+ } else if (type === 'ts') {+ await buildSdk();+ }++ await syncToDesktop();+ logger.success('Rebuild complete');+ } catch (err) {+ logger.error(`Build failed: ${err.message}`);+ }++ isBuilding = false;++ if (pendingBuild) {+ const pending = pendingBuild;+ pendingBuild = null;+ await rebuild(pending.type, pending.file);+ }+ }++ const componentWatcher = chokidar.watch(+ config.watch.components.map(p => path.join(rootDir, p)),+ {+ ignoreInitial: true,+ awaitWriteFinish: { stabilityThreshold: 300 },+ }+ );++ const cppWatcher = chokidar.watch(+ config.watch.cpp.map(p => path.join(rootDir, p)),+ {+ ignoreInitial: true,+ awaitWriteFinish: { stabilityThreshold: 300 },+ ignored: config.watch.components.map(p => path.join(rootDir, p)),+ }+ );++ const tsWatcher = chokidar.watch(+ config.watch.ts.map(p => path.join(rootDir, p)),+ {+ ignoreInitial: true,+ awaitWriteFinish: { stabilityThreshold: 300 },+ }+ );++ componentWatcher.on('change', (file) => rebuild('component', file));+ componentWatcher.on('add', (file) => rebuild('component', file));++ cppWatcher.on('change', (file) => {+ if (!isComponentFile(file)) {+ rebuild('cpp', file);+ }+ });++ tsWatcher.on('change', (file) => rebuild('ts', file));+ tsWatcher.on('add', (file) => rebuild('ts', file));++ process.on('SIGINT', () => {+ logger.info('Stopping watch mode...');+ componentWatcher.close();+ cppWatcher.close();+ tsWatcher.close();+ process.exit(0);+ });++ await new Promise(() => {});+}++function isComponentFile(file) {+ return file.includes('ecs/components') && file.endsWith('.hpp');+}diff --git a/build-tools/utils/emscripten.js b/build-tools/utils/emscripten.jsnew file mode 100644index 000000000..24274a124--- /dev/null+++ b/build-tools/utils/emscripten.js@@ -0,0 +1,89 @@+import { spawn } from 'child_process';+import os from 'os';+import * as logger from './logger.js';++export async function checkEmscripten() {+ try {+ await runCommand('emcmake', ['--version'], { silent: true });+ return true;+ } catch {+ return false;+ }+}++export async function checkPython() {+ try {+ await runCommand('python3', ['--version'], { silent: true });+ return true;+ } catch {+ return false;+ }+}++export async function checkEnvironment() {+ const checks = {+ emscripten: await checkEmscripten(),+ python: await checkPython(),+ };++ if (!checks.emscripten) {+ logger.error('Emscripten not found. Please install and activate emsdk:');+ logger.info(' source /path/to/emsdk/emsdk_env.sh');+ return false;+ }++ if (!checks.python) {+ logger.error('Python 3 not found. Please install Python 3.');+ return false;+ }++ logger.debug('Environment check passed');+ return true;+}++export function runCommand(command, args, options = {}) {+ return new Promise((resolve, reject) => {+ const { cwd, silent = false, env } = options;++ logger.debug(`Running: ${command} ${args.join(' ')}`);++ const proc = spawn(command, args, {+ cwd,+ env: { ...process.env, ...env },+ stdio: silent ? 'pipe' : 'inherit',+ shell: process.platform === 'win32',+ });++ let stdout = '';+ let stderr = '';++ if (silent) {+ proc.stdout?.on('data', (data) => {+ stdout += data.toString();+ });+ proc.stderr?.on('data', (data) => {+ stderr += data.toString();+ });+ }++ proc.on('close', (code) => {+ if (code === 0) {+ resolve({ stdout, stderr, code });+ } else {+ const error = new Error(`Command failed with code ${code}`);+ error.code = code;+ error.stdout = stdout;+ error.stderr = stderr;+ reject(error);+ }+ });++ proc.on('error', (err) => {+ reject(err);+ });+ });+}++export function getCpuCount() {+ return os.cpus().length;+}diff --git a/build-tools/utils/hash.js b/build-tools/utils/hash.jsnew file mode 100644index 000000000..5898c32b3--- /dev/null+++ b/build-tools/utils/hash.js@@ -0,0 +1,133 @@+import { createHash } from 'crypto';+import { readFile, writeFile, mkdir, readdir, stat } from 'fs/promises';+import path from 'path';+import * as logger from './logger.js';++export async function hashFile(filePath) {+ try {+ const content = await readFile(filePath);+ return createHash('md5').update(content).digest('hex');+ } catch {+ return null;+ }+}++export async function hashFiles(filePaths) {+ const hash = createHash('md5');+ const sortedPaths = [...filePaths].sort();++ for (const filePath of sortedPaths) {+ try {+ const content = await readFile(filePath);+ hash.update(filePath);+ hash.update(content);+ } catch {+ hash.update(filePath);+ hash.update('MISSING');+ }+ }++ return hash.digest('hex');+}++export async function hashDirectory(dirPath, pattern = null) {+ const files = await getFilesRecursive(dirPath, pattern);+ return hashFiles(files);+}++async function getFilesRecursive(dirPath, pattern = null) {+ const files = [];++ async function walk(dir) {+ try {+ const entries = await readdir(dir, { withFileTypes: true });+ for (const entry of entries) {+ const fullPath = path.join(dir, entry.name);+ if (entry.isDirectory()) {+ await walk(fullPath);+ } else if (entry.isFile()) {+ if (!pattern || matchPattern(entry.name, pattern)) {+ files.push(fullPath);+ }+ }+ }+ } catch {+ // Directory doesn't exist or isn't accessible+ }+ }++ await walk(dirPath);+ return files;+}++function matchPattern(filename, pattern) {+ if (pattern instanceof RegExp) {+ return pattern.test(filename);+ }+ if (typeof pattern === 'string') {+ if (pattern.startsWith('*.')) {+ return filename.endsWith(pattern.slice(1));+ }+ return filename === pattern;+ }+ return true;+}++export class HashCache {+ constructor(cacheDir) {+ this.cacheDir = cacheDir;+ this.cacheFile = path.join(cacheDir, 'hashes.json');+ this.cache = {};+ this.loaded = false;+ }++ async load() {+ if (this.loaded) return;++ try {+ const content = await readFile(this.cacheFile, 'utf-8');+ this.cache = JSON.parse(content);+ logger.debug(`Loaded cache with ${Object.keys(this.cache).length} entries`);+ } catch {+ this.cache = {};+ logger.debug('No existing cache found, starting fresh');+ }+ this.loaded = true;+ }++ async save() {+ try {+ await mkdir(this.cacheDir, { recursive: true });+ await writeFile(this.cacheFile, JSON.stringify(this.cache, null, 2));+ logger.debug('Cache saved');+ } catch (err) {+ logger.warn(`Failed to save cache: ${err.message}`);+ }+ }++ get(key) {+ return this.cache[key];+ }++ set(key, value) {+ this.cache[key] = value;+ }++ has(key) {+ return key in this.cache;+ }++ async isChanged(key, currentHash) {+ await this.load();+ const cachedHash = this.get(key);+ return cachedHash !== currentHash;+ }++ async updateIfChanged(key, currentHash) {+ const changed = await this.isChanged(key, currentHash);+ if (changed) {+ this.set(key, currentHash);+ }+ return changed;+ }+}diff --git a/build-tools/utils/logger.js b/build-tools/utils/logger.jsnew file mode 100644index 000000000..fcfdb2c0d--- /dev/null+++ b/build-tools/utils/logger.js@@ -0,0 +1,116 @@+import chalk from 'chalk';+import ora from 'ora';++let verbose = false;+let spinner = null;++export function setVerbose(value) {+ verbose = value;+}++export function isVerbose() {+ return verbose;+}++export function info(message) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.blue('ℹ'), message);+ if (spinner) {+ spinner.start();+ }+}++export function success(message) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.green('✓'), message);+ if (spinner) {+ spinner.start();+ }+}++export function warn(message) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.yellow('⚠'), message);+ if (spinner) {+ spinner.start();+ }+}++export function error(message) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.red('✗'), message);+ if (spinner) {+ spinner.start();+ }+}++export function debug(message) {+ if (verbose) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.gray(' →'), chalk.gray(message));+ if (spinner) {+ spinner.start();+ }+ }+}++export function step(message) {+ if (spinner) {+ spinner.stop();+ }+ console.log(chalk.cyan('▸'), message);+ if (spinner) {+ spinner.start();+ }+}++export function startSpinner(message) {+ spinner = ora({+ text: message,+ color: 'cyan',+ }).start();+ return spinner;+}++export function stopSpinner(success = true, message = null) {+ if (spinner) {+ if (success) {+ spinner.succeed(message || spinner.text);+ } else {+ spinner.fail(message || spinner.text);+ }+ spinner = null;+ }+}++export function updateSpinner(message) {+ if (spinner) {+ spinner.text = message;+ }+}++export function header(title) {+ console.log('');+ console.log(chalk.bold.white(`═══ ${title} ═══`));+ console.log('');+}++export function divider() {+ console.log(chalk.gray('─'.repeat(50)));+}++export function printTime(startTime) {+ const elapsed = ((Date.now() - startTime) / 1000).toFixed(2);+ console.log('');+ console.log(chalk.gray(`Done in ${elapsed}s`));+}diff --git a/cmake/ModularBuild.cmake b/cmake/ModularBuild.cmakedeleted file mode 100644index 1b50b3959..000000000--- a/cmake/ModularBuild.cmake+++ /dev/null@@ -1,291 +0,0 @@-# =============================================================================-# ESEngine Modular Build Configuration-# =============================================================================-#-# This file configures the modular WASM build using Emscripten's dynamic linking.-#-# Module Structure:-# - es_core (SIDE_MODULE): Platform, Application, Log, Input-# - es_ecs (SIDE_MODULE): ECS system (header-only, minimal cpp)-# - es_renderer (SIDE_MODULE): Shader, Texture, Buffer, RenderPipeline-# - es_resource (SIDE_MODULE): ResourceManager, Loaders-# - es_ui_core (SIDE_MODULE): UIContext, Widget base, Layout, SystemFont-# - es_ui_widgets (SIDE_MODULE): Button, Label, ScrollView, etc.-# - es_ui_docking (SIDE_MODULE): Editor-only docking system-#-# Usage:-# emcmake cmake -B build-modular -DES_BUILD_WEB=ON -DES_BUILD_MODULAR=ON-# cmake --build build-modular-#--if(NOT ES_BUILD_MODULAR)- return()-endif()--if(NOT ES_BUILD_WEB)- message(FATAL_ERROR "ES_BUILD_MODULAR requires ES_BUILD_WEB=ON")-endif()--message(STATUS "")-message(STATUS "=== ESEngine Modular Build Configuration ===")-message(STATUS "")--# Common include directories for all modules-set(ES_COMMON_INCLUDES- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>- $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/third_party/stb>-)--# Common compile definitions-set(ES_COMMON_DEFINITIONS ES_PLATFORM_WEB ES_BUILD_MODULAR)--# =============================================================================-# es_core - Platform Core Module-# =============================================================================--set(ES_CORE_SOURCES- src/esengine/core/Application.cpp- src/esengine/core/Engine.cpp- src/esengine/core/Log.cpp- src/esengine/platform/input/Input.cpp- src/esengine/platform/PathResolver.cpp- src/esengine/platform/web/WebPlatform.cpp- src/esengine/platform/web/WebFileSystem.cpp-)--add_library(es_core SHARED ${ES_CORE_SOURCES})-target_include_directories(es_core PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_core PRIVATE glm)-target_compile_definitions(es_core PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_core)--set_target_properties(es_core PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# es_renderer - Rendering Module-# =============================================================================--set(ES_RENDERER_SOURCES- src/esengine/renderer/RenderContext.cpp- src/esengine/renderer/Renderer.cpp- src/esengine/renderer/Shader.cpp- src/esengine/renderer/Buffer.cpp- src/esengine/renderer/Texture.cpp- src/esengine/renderer/Framebuffer.cpp- src/esengine/renderer/RenderPipeline.cpp-)--add_library(es_renderer SHARED ${ES_RENDERER_SOURCES})-target_include_directories(es_renderer PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_renderer PRIVATE glm)-target_compile_definitions(es_renderer PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_renderer)--set_target_properties(es_renderer PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# es_resource - Resource Management Module-# =============================================================================--set(ES_RESOURCE_SOURCES- src/esengine/resource/ResourceManager.cpp- src/esengine/resource/ShaderParser.cpp- src/esengine/resource/loaders/ShaderLoader.cpp-)--add_library(es_resource SHARED ${ES_RESOURCE_SOURCES})-target_include_directories(es_resource PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_resource PRIVATE glm)-target_compile_definitions(es_resource PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_resource)--set_target_properties(es_resource PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# es_ui_core - UI Core Module (includes SystemFont)-# =============================================================================--set(ES_UI_CORE_SOURCES- src/esengine/ui/UIContext.cpp- src/esengine/ui/rendering/UIBatchRenderer.cpp- src/esengine/ui/layout/StackLayout.cpp- src/esengine/ui/layout/WrapLayout.cpp- src/esengine/ui/widgets/Widget.cpp- src/esengine/ui/widgets/Panel.cpp- src/esengine/ui/font/SystemFont.cpp- src/esengine/ui/text/TextMeasureHelper.cpp-)--add_library(es_ui_core SHARED ${ES_UI_CORE_SOURCES})-target_include_directories(es_ui_core PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_ui_core PRIVATE glm)-target_compile_definitions(es_ui_core PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_ui_core)--set_target_properties(es_ui_core PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# es_ui_widgets - UI Widgets Module-# =============================================================================--set(ES_UI_WIDGETS_SOURCES- src/esengine/ui/widgets/Label.cpp- src/esengine/ui/widgets/Button.cpp- src/esengine/ui/widgets/Checkbox.cpp- src/esengine/ui/widgets/Slider.cpp- src/esengine/ui/widgets/ClickablePanel.cpp-)--add_library(es_ui_widgets SHARED ${ES_UI_WIDGETS_SOURCES})-target_include_directories(es_ui_widgets PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_ui_widgets PRIVATE glm)-target_compile_definitions(es_ui_widgets PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_ui_widgets)--set_target_properties(es_ui_widgets PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# es_scrollview-# =============================================================================--add_library(es_scrollview SHARED src/esengine/ui/widgets/ScrollView.cpp)-target_include_directories(es_scrollview PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_scrollview PRIVATE glm)-target_compile_definitions(es_scrollview PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_scrollview)-set_target_properties(es_scrollview PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")--# =============================================================================-# es_textfield-# =============================================================================--add_library(es_textfield SHARED src/esengine/ui/widgets/TextField.cpp)-target_include_directories(es_textfield PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_textfield PRIVATE glm)-target_compile_definitions(es_textfield PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_textfield)-set_target_properties(es_textfield PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")--# =============================================================================-# es_dropdown-# =============================================================================--add_library(es_dropdown SHARED src/esengine/ui/widgets/Dropdown.cpp)-target_include_directories(es_dropdown PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_dropdown PRIVATE glm)-target_compile_definitions(es_dropdown PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_dropdown)-set_target_properties(es_dropdown PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")--# =============================================================================-# es_treeview-# =============================================================================--add_library(es_treeview SHARED src/esengine/ui/widgets/TreeView.cpp)-target_include_directories(es_treeview PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_treeview PRIVATE glm)-target_compile_definitions(es_treeview PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_treeview)-set_target_properties(es_treeview PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")--# =============================================================================-# es_contextmenu-# =============================================================================--add_library(es_contextmenu SHARED src/esengine/ui/widgets/ContextMenu.cpp)-target_include_directories(es_contextmenu PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_contextmenu PRIVATE glm)-target_compile_definitions(es_contextmenu PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_contextmenu)-set_target_properties(es_contextmenu PROPERTIES LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules")--# =============================================================================-# es_ui_docking - UI Docking Module (Editor only)-# =============================================================================--set(ES_UI_DOCKING_SOURCES- src/esengine/ui/docking/DockNode.cpp- src/esengine/ui/docking/DockPanel.cpp- src/esengine/ui/docking/DockTabBar.cpp- src/esengine/ui/docking/DockZone.cpp- src/esengine/ui/docking/DockArea.cpp- src/esengine/ui/docking/DockLayoutSerializer.cpp-)--add_library(es_ui_docking SHARED ${ES_UI_DOCKING_SOURCES})-target_include_directories(es_ui_docking PUBLIC ${ES_COMMON_INCLUDES})-target_link_libraries(es_ui_docking PRIVATE glm)-target_compile_definitions(es_ui_docking PUBLIC ${ES_COMMON_DEFINITIONS})-es_apply_side_module_settings(es_ui_docking)--set_target_properties(es_ui_docking PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"-)--# =============================================================================-# Optional Font Modules-# =============================================================================--if(ES_FEATURE_SDF_FONT)- set(ES_FONT_SDF_SOURCES- src/esengine/ui/font/SDFFont.cpp- src/esengine/ui/font/MSDFFont.cpp- )-- add_library(es_font_sdf SHARED ${ES_FONT_SDF_SOURCES})- target_include_directories(es_font_sdf PUBLIC- ${ES_COMMON_INCLUDES}- ${CMAKE_SOURCE_DIR}/third_party/freetype/include- ${CMAKE_SOURCE_DIR}/third_party/msdfgen- )- target_link_libraries(es_font_sdf PRIVATE glm freetype msdfgen-core msdfgen-ext)- target_compile_definitions(es_font_sdf PUBLIC ${ES_COMMON_DEFINITIONS} ES_FEATURE_SDF_FONT=1)- es_apply_side_module_settings(es_font_sdf)-- set_target_properties(es_font_sdf PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"- )-- message(STATUS " - es_font_sdf: ENABLED")-endif()--if(ES_FEATURE_BITMAP_FONT)- add_library(es_font_bitmap SHARED src/esengine/ui/font/BitmapFont.cpp)- target_include_directories(es_font_bitmap PUBLIC ${ES_COMMON_INCLUDES})- target_link_libraries(es_font_bitmap PRIVATE glm)- target_compile_definitions(es_font_bitmap PUBLIC ${ES_COMMON_DEFINITIONS} ES_FEATURE_BITMAP_FONT=1)- es_apply_side_module_settings(es_font_bitmap)-- set_target_properties(es_font_bitmap PROPERTIES- LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/modules"- )-- message(STATUS " - es_font_bitmap: ENABLED")-endif()--# =============================================================================-# Print Summary-# =============================================================================--message(STATUS "")-message(STATUS "Modular build targets (output: build-modular/modules/):")-message(STATUS " Core:")-message(STATUS " - es_core, es_renderer, es_resource")-message(STATUS " UI:")-message(STATUS " - es_ui_core, es_ui_widgets")-message(STATUS " - es_scrollview, es_textfield, es_dropdown")-message(STATUS " - es_treeview, es_contextmenu")-message(STATUS " Editor:")-message(STATUS " - es_ui_docking")-message(STATUS "")diff --git a/include/esengine/ESEngine.hpp b/include/esengine/ESEngine.hppdeleted file mode 100644index 69e848e26..000000000--- a/include/esengine/ESEngine.hpp+++ /dev/null@@ -1,6 +0,0 @@-#pragma once--// ESEngine Public API-// Include this file in your application--#include "../../src/esengine/ESEngine.hpp"diff --git a/package.json b/package.jsonnew file mode 100644index 000000000..f6eadc6d8--- /dev/null+++ b/package.json@@ -0,0 +1,28 @@+{+ "name": "esengine",+ "version": "0.3.0",+ "private": true,+ "type": "module",+ "description": "ESEngine - Entity System Game Engine",+ "scripts": {+ "build": "node build-tools/cli.js build",+ "build:web": "node build-tools/cli.js build -t web",+ "build:wechat": "node build-tools/cli.js build -t wechat",+ "build:playable": "node build-tools/cli.js build -t playable",+ "build:sdk": "node build-tools/cli.js sdk",+ "build:all": "node build-tools/cli.js build -t all",+ "dev": "node build-tools/cli.js watch",+ "clean": "node build-tools/cli.js clean -a",+ "eht": "node build-tools/cli.js eht",+ "sync": "node build-tools/cli.js sync"+ },+ "dependencies": {+ "chalk": "^5.3.0",+ "chokidar": "^3.6.0",+ "commander": "^12.0.0",+ "ora": "^8.0.0"+ },+ "engines": {+ "node": ">=18.0.0"+ }+}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex d09a79c21..4ca988bee 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -6,6 +6,21 @@ settings:importers:+ .:+ dependencies:+ chalk:+ specifier: ^5.3.0+ version: 5.6.2+ chokidar:+ specifier: ^3.6.0+ version: 3.6.0+ commander:+ specifier: ^12.0.0+ version: 12.1.0+ ora:+ specifier: ^8.0.0+ version: 8.2.0+desktop:dependencies:'@esengine/editor':@@ -22,7 +37,7 @@ importers:version: 2.4.5'@tauri-apps/plugin-shell':specifier: ^2.0.0- version: 2.3.4+ version: 2.3.5esengine:specifier: workspace:*version: link:../sdk@@ -520,8 +535,8 @@ packages:'@tauri-apps/[email protected]':resolution: {integrity: sha512-dVxWWGE6VrOxC7/jlhyE+ON/Cc2REJlM35R3PJX3UvFw2XwYhLGQVAIyrehenDdKjotipjYEVc4YjOl3qq90fA==}- '@tauri-apps/[email protected]':- resolution: {integrity: sha512-ktsRWf8wHLD17aZEyqE8c5x98eNAuTizR1FSX475zQ4TxaiJnhwksLygQz+AGwckJL5bfEP13nWrlTNQJUpKpA==}+ '@tauri-apps/[email protected]':+ resolution: {integrity: sha512-jewtULhiQ7lI7+owCKAjc8tYLJr92U16bPOeAa472LHJdgaibLP83NcfAF2e+wkEcA53FxKQAZ7byDzs2eeizg==}'@types/[email protected]':resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==}@@ -545,12 +560,40 @@ packages:resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==}engines: {node: '>=12'}+ resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==}+ engines: {node: '>= 8'}+resolution: {integrity: sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==}+ resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==}+ resolution: {integrity: sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==}+ engines: {node: '>=8'}++ resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==}+ engines: {node: ^12.17.0 || ^14.13 || >=16.0.0}++ resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==}+ engines: {node: '>= 8.10.0'}++ resolution: {integrity: sha512-aCj4O5wKyszjMmDT4tZj93kxyydN/K5zPWSCe6/0AV/AA1pqe5ZBIw0a2ZfPQV7lL5/yb5HsUreJ6UFAF1tEQw==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg==}+ engines: {node: '>=6'}+resolution: {integrity: sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==}engines: {node: '>=7.0.0'}@@ -558,6 +601,10 @@ packages:resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==}+ resolution: {integrity: sha512-Vw8qHK3bZM9y/P10u3Vib8o/DdkvA2OtPtZvD871QKjy74Wj1WSKFILMPRPSdUSx5RFK1arlJzEtA4PkFgnbuA==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==}engines: {node: '>= 8'}@@ -569,6 +616,9 @@ packages:resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==}+ resolution: {integrity: sha512-toUI84YS5YmxW219erniWD0CIVOo46xGKColeNQRgOzDorgBi1v4D71/OFzgD9GO2UGKIv1C3Sp8DAn0+j5w7A==}+resolution: {integrity: sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==}@@ -588,6 +638,10 @@ packages:resolution: {integrity: sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w==}+ resolution: {integrity: sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-gIXjKqtFuWEgzFRJA9WCQeSJLZDjgJUOMCMzxtvFq/37KojM1BFGufqsCy0r4qSQmYLsZYMeyRqzIWOMup03sw==}engines: {node: '>=14'}@@ -600,25 +654,62 @@ packages:resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==}+ resolution: {integrity: sha512-QZjmEOC+IT1uk6Rx0sX22V6uHWVwbdbxf1faPqJ1QhLdGgsRGCZoyaQBm/piRdJy/D2um6hM1UP7ZEeQ4EkP+Q==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==}+ engines: {node: '>= 6'}+resolution: {integrity: sha512-DfXN8DfhJ7NH3Oe7cFmu3NCu1wKbkReJ8TorzSAFbSKrlNaQSKfIzqYqVY8zlbs2NLBbWpRiU52GX2PbaBVNkg==}+ deprecated: Old versions of glob are not supported, and contain widely publicized security vulnerabilities, which have been fixed in the current version. Please update. Support for old versions may be purchased (at exorbitant rates) by contacting [email protected]hasBin: trueresolution: {integrity: sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==}+ engines: {node: '>=8'}+resolution: {integrity: sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==}+ engines: {node: '>=0.10.0'}+resolution: {integrity: sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==}engines: {node: '>=8'}+ resolution: {integrity: sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==}+ engines: {node: '>=0.10.0'}++ resolution: {integrity: sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==}+ engines: {node: '>=12'}+resolution: {integrity: sha512-51ypPSPCoTEIN9dy5Oy+h4pShgJmPCygKfyRCISBI+JoWT/2oJvK8QPxmwv7b/p239jXrm9M1mlQbyKJ5A152g==}+ resolution: {integrity: sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==}+ engines: {node: '>=0.12.0'}++ resolution: {integrity: sha512-43r2mRvz+8JRIKnWJ+3j8JtjRKZ6GmjzfaE/qiBJnikNnYv/6bagRJ1kUhNk8R5EX/GkobD+r+sfxCPJsiKBLQ==}+ engines: {node: '>=12'}++ resolution: {integrity: sha512-mE00Gnza5EEB3Ds0HfMyllZzbBrmLOX3vfWoj9A9PEnTfratQ/BcaJOuMhnkhjXvb2+FkY3VuHqtAGpTPmglFQ==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==}@@ -628,6 +719,10 @@ packages:resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==}+ resolution: {integrity: sha512-i24m8rpwhmPIS4zscNzK6MSEhk0DUWa/8iYQWxhffV8jkI4Phvs3F+quL5xvS0gdQR0FyTCMMH33Y78dDTzzIw==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==}@@ -637,6 +732,10 @@ packages:resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}+ resolution: {integrity: sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-xSxV1onUDkwBRRqxAQgu+Xct1Ose74Ol2ESefE/hUpxH+7oY/eAFUvEaQB8hKL/2TZNx4RMIduEZv4Z5cAuvYg==}@@ -653,6 +752,18 @@ packages:engines: {node: ^10 || ^12 || ^13.7 || ^14 || >=15.0.1}hasBin: true+ resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==}+ engines: {node: '>=0.10.0'}++ resolution: {integrity: sha512-VXJjc87FScF88uafS3JllDgvAm+c/Slfz06lorj2uAY34rlUu0Nt+v8wreiImcrgAjjIHp1rXpTDlLOGw29WwQ==}+ engines: {node: '>=18'}++ resolution: {integrity: sha512-weP+BZ8MVNnlCm8c0Qdc1WSWq4Qn7I+9CJGm7Qali6g44e/PUzbjNqJX5NJ9ljlNMosfJvg1fKEGILklK9cwnw==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==}@@ -670,6 +781,10 @@ packages:resolution: {integrity: sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==}+ resolution: {integrity: sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==}+ engines: {node: '>=8.6'}+resolution: {integrity: sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==}engines: {node: '>=12'}@@ -678,11 +793,19 @@ packages:resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==}engines: {node: ^10 || ^12 || >=14}+ resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==}+ engines: {node: '>=8.10.0'}+resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==}engines: {node: '>= 0.4'}hasBin: true+ resolution: {integrity: sha512-oMA2dcrw6u0YfxJQXm342bFKX/E4sG9rbTzO9ptUcR/e8A33cHuvStiYOwH7fszkZlZ1z/ta9AAoPk2F4qIOHA==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-l0OE8wL34P4nJH/H2ffoaniAokM2qSmrtXHmlpvYr5AVVX8msAyW0l8NVJFDxlSK4u3Uh/f41cQheDVdnYijwQ==}hasBin: true@@ -715,6 +838,10 @@ packages:resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==}engines: {node: '>=0.10.0'}+ resolution: {integrity: sha512-UhDfHmA92YAlNnCfhmq0VeNL5bDbiZGg7sZ2IvPsXubGkiNa9EC+tUTsjBRsYUAz87btI6/1wf4XoVvQ3uRnmQ==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==}engines: {node: '>=8'}@@ -723,6 +850,10 @@ packages:resolution: {integrity: sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==}engines: {node: '>=12'}+ resolution: {integrity: sha512-tsaTIkKW9b4N+AEj+SVA+WhJzV7/zMhcSu78mLKWSk7cXMOSHsBKFWUs0fWwq8QyK3MgJBQRX6Gbi4kYbdvGkQ==}+ engines: {node: '>=18'}+resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==}engines: {node: '>=8'}@@ -735,6 +866,10 @@ packages:resolution: {integrity: sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==}engines: {node: '>= 0.4'}+ resolution: {integrity: sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==}+ engines: {node: '>=8.0'}+resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==}@@ -1045,7 +1180,7 @@ snapshots:dependencies:'@tauri-apps/api': 2.10.1- '@tauri-apps/[email protected]':+ '@tauri-apps/[email protected]':dependencies:'@tauri-apps/api': 2.10.1@@ -1063,18 +1198,51 @@ snapshots:+ dependencies:+ normalize-path: 3.0.0+ picomatch: 2.3.1++ [email protected]: {}+dependencies:balanced-match: 1.0.2+ dependencies:+ fill-range: 7.1.1++ [email protected]: {}++ dependencies:+ anymatch: 3.1.3+ braces: 3.0.3+ glob-parent: 5.1.2+ is-binary-path: 2.1.0+ is-glob: 4.0.3+ normalize-path: 3.0.0+ readdirp: 3.6.0+ optionalDependencies:+ fsevents: 2.3.3++ dependencies:+ restore-cursor: 5.1.0++ [email protected]: {}+dependencies:color-name: 1.1.4+ [email protected]: {}+dependencies:path-key: 3.1.1@@ -1085,6 +1253,8 @@ snapshots:+ [email protected]: {}+@@ -1119,6 +1289,10 @@ snapshots:+ dependencies:+ to-regex-range: 5.0.1+dependencies:cross-spawn: 7.0.6@@ -1129,6 +1303,12 @@ snapshots:+ [email protected]: {}++ dependencies:+ is-glob: 4.0.3+dependencies:foreground-child: 3.3.1@@ -1142,14 +1322,32 @@ snapshots:dependencies:function-bind: 1.1.2+ dependencies:+ binary-extensions: 2.3.0+dependencies:hasown: 2.0.2+ [email protected]: {}++ dependencies:+ is-extglob: 2.1.1++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}++ [email protected]: {}+@@ -1161,6 +1359,11 @@ snapshots:optional: true+ dependencies:+ chalk: 5.6.2+ is-unicode-supported: 1.3.0+@@ -1169,6 +1372,8 @@ snapshots:dependencies:'@jridgewell/sourcemap-codec': 1.5.5+ [email protected]: {}+@@ -1179,6 +1384,24 @@ snapshots:+ [email protected]: {}++ dependencies:+ mimic-function: 5.0.1++ dependencies:+ chalk: 5.6.2+ cli-cursor: 5.0.0+ cli-spinners: 2.9.2+ is-interactive: 2.0.0+ is-unicode-supported: 2.1.0+ log-symbols: 6.0.0+ stdin-discarder: 0.2.2+ string-width: 7.2.0+ strip-ansi: 7.1.2+@@ -1192,6 +1415,8 @@ snapshots:+ [email protected]: {}+@@ -1200,12 +1425,21 @@ snapshots:picocolors: 1.1.1source-map-js: 1.2.1+ dependencies:+ picomatch: 2.3.1+dependencies:is-core-module: 2.16.1path-parse: 1.0.7supports-preserve-symlinks-flag: 1.0.0+ dependencies:+ onetime: 7.0.0+ signal-exit: 4.1.0+dependencies:glob: 10.5.0@@ -1259,6 +1493,8 @@ snapshots:+ [email protected]: {}+dependencies:emoji-regex: 8.0.0@@ -1271,6 +1507,12 @@ snapshots:emoji-regex: 9.2.2strip-ansi: 7.1.2+ dependencies:+ emoji-regex: 10.6.0+ get-east-asian-width: 1.4.0+ strip-ansi: 7.1.2+dependencies:ansi-regex: 5.0.1@@ -1281,6 +1523,10 @@ snapshots:+ dependencies:+ is-number: 7.0.0+diff --git a/scripts/build-editor.bat b/scripts/build-editor.batdeleted file mode 100644index d7ab97a13..000000000--- a/scripts/build-editor.bat+++ /dev/null@@ -1,27 +0,0 @@-@echo off-setlocal--cd /d "%~dp0.."--if not exist build (- echo Creating build directory...- mkdir build- cd build- cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Debug-) else (- cd build-)--echo Building Editor...-mingw32-make esengine_editor -j%NUMBER_OF_PROCESSORS%--if %ERRORLEVEL% EQU 0 (- echo.- echo [OK] Editor built successfully!- echo Run: bin\esengine_editor.exe-) else (- echo.- echo [ERROR] Build failed!-)--pausediff --git a/scripts/build-playable.bat b/scripts/build-playable.batdeleted file mode 100644index 6722850ce..000000000--- a/scripts/build-playable.bat+++ /dev/null@@ -1,58 +0,0 @@-@echo off-setlocal--cd /d "%~dp0\.."--echo === Building Playable HTML ===-echo.--REM Step 1: Build SDK-echo [1/4] Building SDK...-cd sdk-call npm run build-if errorlevel 1 goto :error-cd ..--REM Step 2: Build Playground (IIFE format)-echo [2/4] Building Playground (IIFE)...-cd sdk\examples\playground-call npm run build:playable-if errorlevel 1 goto :error-cd ..\..\..--REM Step 3: Check if WASM SDK exists-echo [3/4] Checking WASM SDK...-if not exist "build-web-single\sdk\esengine.single.js" (- echo.- echo WARNING: Single-file WASM SDK not found!- echo Please run: scripts\build-web-single.bat first- echo.- echo Or if you have a regular WASM build, you can manually run:- echo node tools/bundle-playable.js --wasm YOUR_WASM.js --game sdk/examples/playground/build/playable/game.js --output playable.html- goto :end-)--REM Step 4: Bundle into single HTML-echo [4/4] Bundling into single HTML...-node tools\bundle-playable.js ^- --wasm build-web-single\sdk\esengine.single.js ^- --game sdk\examples\playground\build\playable\game.js ^- --assets sdk\examples\playground\assets ^- --output playable.html--if errorlevel 1 goto :error--echo.-echo === Success! ===-echo Output: playable.html-goto :end--:error-echo.-echo === Build Failed ===-pause-exit /b 1--:end-endlocal-pausediff --git a/scripts/build-web-single.bat b/scripts/build-web-single.batdeleted file mode 100644index ac4334f5e..000000000--- a/scripts/build-web-single.bat+++ /dev/null@@ -1,38 +0,0 @@-@echo off-setlocal--cd /d "%~dp0\.."--set BUILD_DIR=build-web-single--if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"-cd "%BUILD_DIR%"--call emcmake cmake .. -DES_BUILD_WEB=ON -DES_BUILD_TESTS=OFF -DES_BUILD_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release-if errorlevel 1 goto :error--call emmake make esengine_single -j4-if errorlevel 1 goto :error--echo.-echo Single-file SDK built:-dir sdk\esengine.single.js--echo.-echo Copying to desktop/public/wasm...-if not exist "%~dp0\..\desktop\public\wasm" mkdir "%~dp0\..\desktop\public\wasm"-copy /Y sdk\esengine.single.js "%~dp0\..\desktop\public\wasm\"-if errorlevel 1 goto :error--echo.-echo SDK copied to desktop/public/wasm/esengine.single.js-goto :end--:error-echo Build failed!-pause-exit /b 1--:end-endlocal-pausediff --git a/scripts/build-web-single.sh b/scripts/build-web-single.shdeleted file mode 100755index 4ca6b849c..000000000--- a/scripts/build-web-single.sh+++ /dev/null@@ -1,24 +0,0 @@-#!/bin/bash-set -e--cd "$(dirname "$0")/.."--BUILD_DIR=build-web-single--mkdir -p "$BUILD_DIR"-cd "$BUILD_DIR"--emcmake cmake .. -DES_BUILD_WEB=ON -DES_BUILD_TESTS=OFF -DES_BUILD_SINGLE_FILE=ON -DCMAKE_BUILD_TYPE=Release-emmake make esengine_single -j$(sysctl -n hw.ncpu)--echo ""-echo "Single-file SDK built:"-ls -la sdk/esengine.single.js--echo ""-echo "Bundling playable HTML..."-node "$(dirname "$0")/../tools/bundle-playable.js" --wasm sdk/esengine.single.js --game "$(dirname "$0")/../sdk/examples/playground/build/playable/game.js" --output sdk/playable.html--echo ""-echo "Final output:"-ls -la sdk/playable.htmldiff --git a/scripts/build-web-test.bat b/scripts/build-web-test.batdeleted file mode 100644index 5195c32fb..000000000--- a/scripts/build-web-test.bat+++ /dev/null@@ -1,28 +0,0 @@-@echo off-setlocal--cd /d "%~dp0\.."--set BUILD_DIR=build-web-set TEST_DIR=sdk\examples\playground\build--cd "%BUILD_DIR%"--call emmake make -j4-if errorlevel 1 goto :error--cd ..-copy /Y "%BUILD_DIR%\sdk\esengine.js" "%TEST_DIR%\"-copy /Y "%BUILD_DIR%\sdk\esengine.wasm" "%TEST_DIR%\"--echo.-echo Build and copy complete!-goto :end--:error-echo Build failed!-pause-exit /b 1--:end-pausediff --git a/scripts/build-web.bat b/scripts/build-web.batdeleted file mode 100644index ef1dd2c0f..000000000--- a/scripts/build-web.bat+++ /dev/null@@ -1,36 +0,0 @@-@echo off-setlocal--cd /d "%~dp0\.."--set BUILD_DIR=build-web--if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"-cd "%BUILD_DIR%"--call emcmake cmake .. -DES_BUILD_WEB=ON -DES_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release-if errorlevel 1 goto :error--call emmake make -j4-if errorlevel 1 goto :error--echo.-echo Build complete: %BUILD_DIR%\sdk\-dir sdk\--echo.-echo Copying to desktop/public/wasm...-if not exist "..\desktop\public\wasm" mkdir "..\desktop\public\wasm"-copy /Y sdk\esengine.js "..\desktop\public\wasm\"-copy /Y sdk\esengine.wasm "..\desktop\public\wasm\"-echo Done!-goto :end--:error-echo Build failed!-pause-exit /b 1--:end-endlocal-pausediff --git a/scripts/build-web.sh b/scripts/build-web.shdeleted file mode 100755index 38cdf3d9a..000000000--- a/scripts/build-web.sh+++ /dev/null@@ -1,23 +0,0 @@-#!/bin/bash-set -e--cd "$(dirname "$0")/.."--BUILD_DIR=build-web--mkdir -p "$BUILD_DIR"-cd "$BUILD_DIR"--emcmake cmake .. -DES_BUILD_WEB=ON -DES_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release-emmake make -j$(sysctl -n hw.ncpu)--echo ""-echo "Build complete: $BUILD_DIR/sdk/"-ls -la sdk/--echo ""-echo "Copying to desktop/public/wasm..."-mkdir -p ../desktop/public/wasm-cp -f sdk/esengine.js ../desktop/public/wasm/-cp -f sdk/esengine.wasm ../desktop/public/wasm/-echo "Done!"diff --git a/scripts/build-wxgame.bat b/scripts/build-wxgame.batdeleted file mode 100644index 5ea0fd714..000000000--- a/scripts/build-wxgame.bat+++ /dev/null@@ -1,42 +0,0 @@-@echo off-setlocal--cd /d "%~dp0\.."--set BUILD_DIR=build-wxgame-set OUTPUT_DIR=desktop\public\wasm--echo === Building ESEngine for WeChat MiniGame ===--if not exist "%BUILD_DIR%" mkdir "%BUILD_DIR%"-cd "%BUILD_DIR%"--echo Configuring...-call emcmake cmake .. -DES_BUILD_WXGAME=ON -DCMAKE_BUILD_TYPE=Release-if errorlevel 1 goto :error--echo Building...-call cmake --build . --target esengine_wxgame -j4-if errorlevel 1 goto :error--echo.-echo Copying to %OUTPUT_DIR%...-if not exist "..\%OUTPUT_DIR%" mkdir "..\%OUTPUT_DIR%"-copy /Y sdk\esengine.wxgame.js "..\%OUTPUT_DIR%\"-copy /Y sdk\esengine.wxgame.wasm "..\%OUTPUT_DIR%\"--echo.-echo === Build complete ===-echo Output files:-echo - %OUTPUT_DIR%\esengine.wxgame.js-echo - %OUTPUT_DIR%\esengine.wxgame.wasm-goto :end--:error-echo Build failed!-pause-exit /b 1--:end-endlocal-pausediff --git a/scripts/build-wxgame.sh b/scripts/build-wxgame.shdeleted file mode 100755index 2f94ffb93..000000000--- a/scripts/build-wxgame.sh+++ /dev/null@@ -1,34 +0,0 @@-#!/bin/bash-set -e--SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"-ROOT_DIR="$(dirname "$SCRIPT_DIR")"-BUILD_DIR="$ROOT_DIR/build-wxgame"-OUTPUT_DIR="$ROOT_DIR/desktop/public/wasm"--echo "=== Building ESEngine for WeChat MiniGame ==="--if ! command -v emcmake &> /dev/null; then- echo "Error: Emscripten not found. Please install and activate emsdk first:"- echo " source /path/to/emsdk/emsdk_env.sh"- exit 1-fi--mkdir -p "$BUILD_DIR"-cd "$BUILD_DIR"--echo "Configuring..."-emcmake cmake -DES_BUILD_WXGAME=ON -DCMAKE_BUILD_TYPE=Release "$ROOT_DIR"--echo "Building..."-cmake --build . --target esengine_wxgame -j$(nproc 2>/dev/null || sysctl -n hw.ncpu)--echo "Copying to $OUTPUT_DIR..."-mkdir -p "$OUTPUT_DIR"-cp "$BUILD_DIR/sdk/esengine.wxgame.js" "$OUTPUT_DIR/"-cp "$BUILD_DIR/sdk/esengine.wxgame.wasm" "$OUTPUT_DIR/"--echo "=== Build complete ==="-echo "Output files:"-echo " - $OUTPUT_DIR/esengine.wxgame.js"-echo " - $OUTPUT_DIR/esengine.wxgame.wasm"diff --git a/scripts/rebuild-web.bat b/scripts/rebuild-web.batdeleted file mode 100644index 57fd34680..000000000--- a/scripts/rebuild-web.bat+++ /dev/null@@ -1,27 +0,0 @@-@echo off-setlocal--cd /d "%~dp0.."--echo === Running EHT ===-python tools/eht.py --verbose-if %ERRORLEVEL% NEQ 0 (- echo [ERROR] EHT failed!- pause- exit /b 1-)--echo.-echo === Building Web SDK ===-cd build-web-call emmake mingw32-make esengine_sdk -j%NUMBER_OF_PROCESSORS%--if %ERRORLEVEL% EQU 0 (- echo.- echo [OK] Build complete!-) else (- echo.- echo [ERROR] Build failed!-)--pausediff --git a/scripts/rebuild-web.sh b/scripts/rebuild-web.shdeleted file mode 100755index 1f9bc9fe1..000000000--- a/scripts/rebuild-web.sh+++ /dev/null@@ -1,13 +0,0 @@-#!/bin/bash-set -e--cd "$(dirname "$0")/.."--BUILD_DIR=build-web--if [ -d "$BUILD_DIR" ]; then- echo "Removing existing build directory..."- rm -rf "$BUILD_DIR"-fi--exec "$(dirname "$0")/build-web.sh"diff --git a/scripts/run-eht.bat b/scripts/run-eht.batdeleted file mode 100644index ac2e0ec4e..000000000--- a/scripts/run-eht.bat+++ /dev/null@@ -1,4 +0,0 @@-@echo off-cd /d "%~dp0.."-python tools/eht.py --verbose-pausediff --git a/sdk/rollup.config.js b/sdk/rollup.config.jsindex 7a7213503..106ac0550 100644--- a/sdk/rollup.config.js+++ b/sdk/rollup.config.js@@ -1,150 +1,47 @@import typescript from '@rollup/plugin-typescript';import dts from 'rollup-plugin-dts';-// =============================================================================-// Module Entries-// =============================================================================+const tsPlugin = typescript({+ tsconfig: './tsconfig.json',+ declaration: false,+});-const modules = {- 'index': 'src/index.ts', // Web entry- 'index.wechat': 'src/index.wechat.ts', // WeChat entry- 'wasm': 'src/wasm.ts',+const treeshake = {+ moduleSideEffects: false,};-// =============================================================================-// Local Dist Builds (ESM)-// =============================================================================--const esmBuilds = Object.entries(modules).map(([name, input]) => ({- input,- output: {- file: `dist/${name}.js`,- format: 'esm',- sourcemap: true,+const esmBuilds = [+ {+ input: 'src/index.ts',+ output: { file: 'dist/index.js', format: 'esm', sourcemap: true },+ plugins: [tsPlugin],+ treeshake,},- plugins: [- typescript({- tsconfig: './tsconfig.json',- declaration: false,- }),- ],- treeshake: {- moduleSideEffects: false,+ {+ input: 'src/index.wechat.ts',+ output: { file: 'dist/index.wechat.js', format: 'esm', sourcemap: true },+ plugins: [typescript({ tsconfig: './tsconfig.json', declaration: false })],+ treeshake,},-}));--// =============================================================================-// Type Declarations-// =============================================================================+ {+ input: 'src/wasm.ts',+ output: { file: 'dist/wasm.js', format: 'esm', sourcemap: true },+ plugins: [typescript({ tsconfig: './tsconfig.json', declaration: false })],+ treeshake,+ },+];-// Only generate .d.ts for main entries (Web and WeChat share the same types)const dtsBuilds = [{input: 'src/index.ts',- output: {- file: 'dist/index.d.ts',- format: 'esm',- },+ output: { file: 'dist/index.d.ts', format: 'esm' },plugins: [dts()],},{input: 'src/wasm.ts',- output: {- file: 'dist/wasm.d.ts',- format: 'esm',- },+ output: { file: 'dist/wasm.d.ts', format: 'esm' },plugins: [dts()],},];-// =============================================================================-// Desktop Public Builds-// =============================================================================--// ESM build for editor preview (Web)-const esmPublicBuild = {- input: 'src/index.ts',- output: {- file: '../desktop/public/sdk/esm/esengine.js',- format: 'esm',- sourcemap: false,- },- plugins: [- typescript({- tsconfig: './tsconfig.json',- declaration: false,- }),- ],- treeshake: {- moduleSideEffects: false,- },-};--// CJS build for WeChat Mini Game (includes WeChat adapter)-const cjsWechatBuild = {- input: 'src/index.wechat.ts',- output: {- file: '../desktop/public/sdk/cjs/esengine.wechat.js',- format: 'cjs',- sourcemap: false,- exports: 'named',- },- plugins: [- typescript({- tsconfig: './tsconfig.json',- declaration: false,- }),- ],- treeshake: {- moduleSideEffects: false,- },-};--// CJS build for Web (no WeChat code)-const cjsWebBuild = {- input: 'src/index.ts',- output: {- file: '../desktop/public/sdk/cjs/esengine.js',- format: 'cjs',- sourcemap: false,- exports: 'named',- },- plugins: [- typescript({- tsconfig: './tsconfig.json',- declaration: false,- }),- ],- treeshake: {- moduleSideEffects: false,- },-};--// IIFE build for playable ads (Web, no WeChat code)-const iifePublicBuild = {- input: 'src/index.ts',- output: {- file: '../desktop/public/sdk/iife/esengine.js',- format: 'iife',- name: 'ES',- sourcemap: false,- },- plugins: [- typescript({- tsconfig: './tsconfig.json',- declaration: false,- }),- ],- treeshake: {- moduleSideEffects: false,- },-};--export default [- ...esmBuilds,- ...dtsBuilds,- esmPublicBuild,- cjsWebBuild,- cjsWechatBuild,- iifePublicBuild,-];+export default [...esmBuilds, ...dtsBuilds];