YHH and GitHub
15c1d98305
docs: add database and database-drivers to sidebar navigation ( #414 )
...
- Add database module navigation (repository, user, query)
- Add database-drivers module navigation (mongo, redis)
- Create missing English documentation files for database module
- Create missing English documentation files for database-drivers module
2025-12-31 22:15:15 +08:00
yhh
4a3d8c3962
fix(core): ensure Core.destroy() cleans up scene manager
...
- Add sceneManager.destroy() call in Core.destroy()
- Update lawn-mower-demo submodule
2025-12-31 21:51:25 +08:00
YHH and GitHub
85171a0a5c
fix(database): include dist directory in npm package ( #412 )
...
* fix(database): include dist directory in npm package
* fix(ci): add database packages to release build
2025-12-31 18:10:40 +08:00
YHH and GitHub
71022abc99
feat(database): add database layer architecture ( #410 )
...
- Add @esengine/database-drivers for MongoDB/Redis connection management
- Add @esengine/database for Repository pattern with CRUD, pagination, soft delete
- Refactor @esengine/transaction MongoStorage to use shared connection
- Add comprehensive documentation in Chinese and English
2025-12-31 16:26:53 +08:00
YHH and GitHub
b9ea8d14cf
feat(behavior-tree): add action() and condition() methods to BehaviorTreeBuilder ( #408 )
...
- Add action(implementationType, name?, config?) for custom action executors
- Add condition(implementationType, name?, config?) for custom condition executors
- Update documentation (EN and CN) with usage examples
- Add test script to package.json
2025-12-31 14:30:31 +08:00
yhh
10d0fb1d5c
fix(rapier2d): fix external config path mismatch in tsup
2025-12-31 13:25:30 +08:00
YHH and GitHub
0de45279e6
fix(behavior-tree): export NodeExecutorMetadata as value instead of type ( #406 )
2025-12-31 12:16:17 +08:00
YHH and GitHub
902c0a1074
chore: add changeset for HTTP file routing ( #404 )
2025-12-31 10:06:40 +08:00
yhh
d3e489aad3
feat(server): add HTTP file-based routing support
...
- Add file-based HTTP routing with httpDir and httpPrefix config options
- Create defineHttp<TBody>() helper for type-safe route definitions
- Support dynamic routes with [param].ts file naming convention
- Add CORS support for cross-origin requests
- Allow merging file routes with inline http config
- RPC server now supports attaching to existing HTTP server via server option
- Add comprehensive documentation for HTTP routing
2025-12-31 09:53:12 +08:00
yhh
12051d987f
docs(network): add custom authentication provider documentation
...
- Add IAuthProvider interface documentation
- Add database password authentication example
- Add OAuth/third-party authentication example
- Add API Key authentication example
- Add guide for using and combining multiple providers
2025-12-30 22:46:40 +08:00
yhh
b38fe5ebf4
docs(editor): improve editor-app build documentation and add build:rapier2d script
...
- Add `pnpm build:rapier2d` command to automate Rapier2D WASM build process
- Fix gen-src.mjs path to correctly locate thirdparty/rapier.js
- Update init.ts to work with new wasm-pack web target (auto-initialization)
- Fix behavior-tree-editor build config for asset-system dependency
- Update README_CN.md and README.md with simplified build instructions
2025-12-30 22:33:06 +08:00
yhh
f01ce1e320
chore: update lawn-mower-demo submodule (airstrike sync fix)
2025-12-30 21:21:51 +08:00
YHH and GitHub
3e5b7783be
fix(ecs): resolve ESM require is not defined error ( #402 )
...
- Add RuntimeConfig module as standalone runtime environment storage
- Core.runtimeEnvironment and Scene.runtimeEnvironment now read from RuntimeConfig
- Remove require() call in Scene.ts to fix Node.js ESM compatibility
Fixes ReferenceError: require is not defined when using scene.isServer in ESM environment
2025-12-30 20:52:29 +08:00
YHH and GitHub
d2af9caae9
feat(behavior-tree): add pure BehaviorTreePlugin for Cocos/Laya integration ( #400 )
...
- Add BehaviorTreePlugin class that only depends on @esengine/ecs-framework
- Implement IPlugin interface with install(), uninstall(), setupScene() methods
- Remove esengine/ subdirectory that incorrectly depended on engine-core
- Update package documentation with correct usage examples
2025-12-30 20:31:52 +08:00
yhh
bb696c6a60
chore: update lawn-mower-demo submodule to 2.7.0
2025-12-30 18:56:44 +08:00
YHH and GitHub
1f3a76aabe
feat(ecs): 添加运行时环境区分机制 | add runtime environment detection ( #398 )
...
- Core 新增静态属性 runtimeEnvironment,支持 'server' | 'client' | 'standalone'
- Core 新增 isServer / isClient 静态只读属性
- ICoreConfig 新增 runtimeEnvironment 配置项
- Scene 新增 isServer / isClient 只读属性(默认从 Core 继承,可通过 config 覆盖)
- 新增 @ServerOnly() / @ClientOnly() / @NotServer() / @NotClient() 方法装饰器
- 更新中英文文档
用于网络游戏中区分服务端权威逻辑和客户端逻辑
2025-12-30 17:56:06 +08:00
YHH and GitHub
04b08f3f07
fix(ecs): add entity field to COMPONENT_ADDED event ( #396 )
...
Fix missing entity field in COMPONENT_ADDED event payload that caused
ECSRoom's @NetworkEntity auto-broadcast to fail with 'Cannot read
properties of undefined'
2025-12-30 16:57:11 +08:00
yhh
d9969d0b08
Merge branch 'master' of https://github.com/esengine/esengine
2025-12-30 16:23:54 +08:00
YHH and GitHub
bdbbf8a80a
feat(ecs): 添加 @NetworkEntity 装饰器,支持自动广播实体生成/销毁 ( #395 )
...
* docs: add editor-app README with setup instructions
* docs: add separate EN/CN editor setup guides
* feat(ecs): add @NetworkEntity decorator for auto spawn/despawn broadcasting
- Add @NetworkEntity decorator to mark components for automatic network broadcasting
- ECSRoom now auto-broadcasts spawn on component:added event
- ECSRoom now auto-broadcasts despawn on entity:destroyed event
- Entity.destroy() emits entity:destroyed event via ECSEventType
- Entity active state changes emit ENTITY_ENABLED/ENTITY_DISABLED events
- Add enableAutoNetworkEntity config option to ECSRoom (default true)
- Update documentation for both Chinese and English
2025-12-30 16:19:01 +08:00
yhh
1368473c71
Merge remote master
2025-12-30 12:29:24 +08:00
YHH and GitHub
b28169b186
fix(editor): fix build errors and refactor behavior-tree architecture ( #394 )
...
* docs: add editor-app README with setup instructions
* docs: add separate EN/CN editor setup guides
* fix(editor): fix build errors and refactor behavior-tree architecture
- Fix fairygui-editor tsconfig extends path and add missing tsconfig.build.json
- Refactor behavior-tree-editor to not depend on asset-system in runtime
- Create local BehaviorTreeRuntimeModule for pure runtime logic
- Move asset loader registration to editor module install()
- Add BehaviorTreeLoader for asset system integration
- Fix rapier2d WASM loader to not pass arguments to init()
- Add WASM base64 loader config to rapier2d tsup.config
- Update README documentation and simplify setup steps
2025-12-30 11:13:26 +08:00
yhh
e2598b2292
docs: add separate EN/CN editor setup guides
2025-12-30 10:02:53 +08:00
yhh
2e3889abed
docs: add editor-app README with setup instructions
2025-12-30 09:54:41 +08:00
YHH and GitHub
a08a84b7db
fix(sync): use GlobalComponentRegistry for network sync decoding ( #392 )
...
- Decoder.ts now uses GlobalComponentRegistry.getComponentType() instead of local registry
- @sync decorator uses getComponentTypeName() to get @ECSComponent decorator name
- @ECSComponent decorator updates SYNC_METADATA.typeId when defined
- Removed deprecated registerSyncComponent/autoRegisterSyncComponent functions
- Updated ComponentSync.ts in network package to use GlobalComponentRegistry
- Updated tests to use correct @ECSComponent type names
This ensures that components decorated with @ECSComponent are automatically
available for network sync decoding without any manual registration.
2025-12-30 09:39:17 +08:00
YHH and GitHub
1f297ac769
feat(ecs): ECS 网络状态同步系统 | add ECS network state synchronization ( #390 )
...
## @esengine/ecs-framework
新增 @sync 装饰器和二进制编解码器,支持基于 Component 的网络状态同步:
- `sync` 装饰器标记需要同步的字段
- `ChangeTracker` 组件变更追踪
- 二进制编解码器 (BinaryWriter/BinaryReader)
- `encodeSnapshot`/`decodeSnapshot` 批量编解码
- `encodeSpawn`/`decodeSpawn` 实体生成编解码
- `encodeDespawn`/`processDespawn` 实体销毁编解码
将以下方法标记为 @internal,用户应通过 Core.update() 驱动更新:
- Scene.update()
- SceneManager.update()
- WorldManager.updateAll()
## @esengine/network
- 新增 ComponentSyncSystem 基于 @sync 自动同步组件状态
- 将 ecs-framework 从 devDependencies 移到 peerDependencies
## @esengine/server
新增 ECSRoom,带有 ECS World 支持的房间基类:
- 每个 ECSRoom 在 Core.worldManager 中创建独立的 World
- Core.update() 统一更新 Time 和所有 World
- onTick() 只处理状态同步逻辑
- 自动创建/销毁玩家实体
- 增量状态广播
2025-12-29 21:08:34 +08:00
YHH and GitHub
afdeb00b4d
feat(server): 添加可插拔速率限制系统 | add pluggable rate limiting system ( #388 )
...
* feat(server): 添加可插拔速率限制系统 | add pluggable rate limiting system
- 新增令牌桶策略 (TokenBucketStrategy) - 推荐用于一般场景
- 新增滑动窗口策略 (SlidingWindowStrategy) - 精确跟踪
- 新增固定窗口策略 (FixedWindowStrategy) - 简单高效
- 新增房间速率限制 mixin (withRateLimit)
- 新增速率限制装饰器 (@rateLimit, @noRateLimit)
- 新增按消息类型限流装饰器 (@rateLimitMessage, @noRateLimitMessage)
- 支持与认证系统组合使用
- 添加中英文文档
- 导出路径: @esengine/server/ratelimit
* docs: 更新 README 添加新模块 | update README with new modules
- 添加程序化生成 (procgen) 模块
- 添加 RPC 框架模块
- 添加游戏服务器 (server) 模块
- 添加事务系统 (transaction) 模块
- 添加世界流送 (world-streaming) 模块
- 更新网络模块描述
- 更新项目结构目录
2025-12-29 17:12:54 +08:00
YHH and GitHub
61a13baca2
feat(server): 添加可插拔认证系统 | add pluggable authentication system ( #386 )
...
* feat(server): 添加可插拔认证系统 | add pluggable authentication system
- 新增 JWT 认证提供者 (createJwtAuthProvider)
- 新增 Session 认证提供者 (createSessionAuthProvider)
- 新增服务器认证 mixin (withAuth)
- 新增房间认证 mixin (withRoomAuth)
- 新增认证装饰器 (@requireAuth, @requireRole)
- 新增测试工具 (MockAuthProvider)
- 新增中英文文档
- 导出路径: @esengine/server/auth, @esengine/server/auth/testing
* fix(server): 使用加密安全的随机数生成 session ID | use crypto-secure random for session ID
2025-12-29 16:10:09 +08:00
YHH and GitHub
3b978384c7
feat(framework): server testing utils, transaction storage simplify, pathfinding tests ( #384 )
...
## Server Testing Utils
- Add TestServer, TestClient, MockRoom for unit testing
- Export testing utilities from @esengine/server/testing
## Transaction Storage (BREAKING)
- Simplify RedisStorage/MongoStorage to factory pattern only
- Remove DI client injection option
- Add lazy connection and Symbol.asyncDispose support
- Add 161 unit tests with full coverage
## Pathfinding Tests
- Add 150 unit tests covering all components
- BinaryHeap, Heuristics, AStarPathfinder, GridMap, NavMesh, PathSmoother
## Docs
- Update storage.md for new factory pattern API
2025-12-29 15:02:13 +08:00
YHH and GitHub
10c3891abd
docs: 添加缺失的侧边栏导航项 | add missing sidebar items ( #383 )
...
- RPC: 添加 server, client, codec 页面
- Network: 添加 prediction, aoi, delta 页面
- Transaction: 添加完整模块导航
- Changelog: 添加 transaction, rpc 链接
2025-12-29 11:29:42 +08:00
YHH and GitHub
d4cef828e1
feat(transaction): 添加游戏事务系统 | add game transaction system ( #381 )
...
- TransactionManager/TransactionContext 事务管理
- MemoryStorage/RedisStorage/MongoStorage 存储实现
- CurrencyOperation/InventoryOperation/TradeOperation 内置操作
- SagaOrchestrator 分布式 Saga 编排
- withTransactions() Room 集成
- 完整中英文文档
2025-12-29 10:54:00 +08:00
YHH and GitHub
fb8bde6485
feat(network): 网络模块增强 - 预测、AOI、增量压缩 ( #379 )
...
- 添加 NetworkPredictionSystem 客户端预测系统
- 添加 NetworkAOISystem 兴趣区域管理
- 添加 StateDeltaCompressor 状态增量压缩
- 添加断线重连和状态恢复
- 增强协议支持时间戳、序列号、速度
- 添加中英文文档
2025-12-29 10:42:48 +08:00
yhh
30437dc5d5
docs: add world-streaming to sidebar navigation
2025-12-28 19:50:44 +08:00
YHH and GitHub
9f84c2f870
chore: bump pathfinding and world-streaming to 1.1.0 ( #378 )
2025-12-28 19:36:34 +08:00
YHH and GitHub
0662b07445
chore: update pathfinding, add rpc/world-streaming docs, refactor world-streaming location ( #376 )
2025-12-28 19:18:28 +08:00
YHH and GitHub
a000cc07d7
feat(rpc): export RpcClient from main entry point ( #374 )
2025-12-28 14:09:16 +08:00
YHH and GitHub
9c41181875
fix(server): expose id property on ServerConnection type ( #372 )
2025-12-28 13:47:27 +08:00
YHH and GitHub
18df9d1cda
fix(server): allow define() to be called before start() ( #370 )
2025-12-28 13:29:17 +08:00
YHH and GitHub
66d5dc27f7
fix(server): 修复发布缺少 dist | fix missing dist ( #368 )
...
* fix(server): 修复发布缺少 dist | fix missing dist in publish
* ci: 添加 server 和 create-esengine-server 构建 | add server packages to build
* fix: 添加 create-esengine-server 到 changeset
2025-12-28 12:46:50 +08:00
YHH and GitHub
b6f1235239
feat(server): 添加游戏服务器框架 | add game server framework ( #366 )
...
**@esengine/server** - 游戏服务器框架 | Game server framework
- 文件路由系统 | File-based routing
- Room 生命周期 (onCreate, onJoin, onLeave, onTick, onDispose)
- @onMessage 装饰器 | Message handler decorator
- 玩家管理与断线处理 | Player management with auto-disconnect
- 内置 JoinRoom/LeaveRoom API | Built-in room APIs
- defineApi/defineMsg 类型安全辅助函数 | Type-safe helpers
**create-esengine-server** - CLI 脚手架工具 | CLI scaffolding
- 生成 shared/server/client 项目结构 | Project structure
- 类型安全的协议定义 | Type-safe protocol definitions
- 包含 GameRoom 示例 | Example implementation
**其他 | Other**
- 删除旧的 network-server 包 | Remove old network-server
- 更新服务器文档 | Update server documentation
2025-12-28 12:23:55 +08:00
yhh
7dadacc8f9
fix(ci): add @esengine/rpc to release workflow build
2025-12-28 10:58:15 +08:00
YHH and GitHub
7940f581a6
feat(rpc,network): 新增 RPC 库并迁移网络模块 ( #364 )
...
* feat(rpc,network): 新增 RPC 库并迁移网络模块
## @esengine/rpc (新增)
- 新增类型安全的 RPC 库,支持 WebSocket 通信
- 新增 RpcClient 类:connect/disconnect, call/send/on/off/once 方法
- 新增 RpcServer 类:Node.js WebSocket 服务端
- 新增编解码系统:支持 JSON 和 MessagePack
- 新增 TextEncoder/TextDecoder polyfill,兼容微信小游戏平台
- 新增 WebSocketAdapter 接口,支持跨平台 WebSocket 抽象
## @esengine/network (重构)
- 重构 NetworkService:拆分为 RpcService 基类和 GameNetworkService
- 新增 gameProtocol:类型安全的 API 和消息定义
- 新增类型安全便捷方法:sendInput(), onSync(), onSpawn(), onDespawn()
- 更新 NetworkPlugin 使用新的服务架构
- 移除 TSRPC 依赖,改用 @esengine/rpc
## 文档
- 新增 RPC 模块文档(中英文)
- 更新 Network 模块文档(中英文)
- 更新侧边栏导航
* fix(network,cli): 修复 CI 构建和更新 CLI 适配器
## 修复
- 在 tsconfig.build.json 添加 rpc 引用,修复类型声明生成
## CLI 更新
- 更新 nodejs 适配器使用新的 @esengine/rpc
- 生成的服务器代码使用 RpcServer 替代旧的 GameServer
- 添加 ws 和 @types/ws 依赖
- 更新 README 模板中的客户端连接示例
* chore: 添加 CLI changeset
* fix(ci): add @esengine/rpc to build and check scripts
- Add rpc package to CI build step (must build before network)
- Add rpc to type-check:framework, lint:framework, test:ci:framework
* fix(rpc,network): fix tsconfig for declaration generation
- Remove composite mode from rpc (not needed, causes CI issues)
- Remove rpc from network project references (resolves via node_modules)
- Remove unused references from network tsconfig.build.json
2025-12-28 10:54:51 +08:00
YHH and GitHub
8605888f11
docs: restructure documentation with modular sub-pages ( #363 )
...
* docs: split Entity docs into sub-modules and fix Starlight CI
- Split monolithic entity.md into 4 focused sub-documents:
- guide/entity/index.md - Overview and basic concepts
- guide/entity/component-operations.md - Component API operations
- guide/entity/entity-handle.md - EntityHandle system for safe references
- guide/entity/lifecycle.md - Lifecycle and persistence management
- Created bilingual versions (Chinese and English)
- Updated sidebar configuration in astro.config.mjs
- Fixed CI workflow for Starlight migration:
- Updated docs.yml to upload from docs/dist instead of .vitepress/dist
- Updated package.json scripts to use pnpm filter for docs
- Added docs directory to pnpm-workspace.yaml
- Renamed docs package to @esengine/docs
- Documented missing Entity APIs:
- createComponent() method
- addComponents() batch method
- getComponentByType() with inheritance support
- markDirty() for change detection
* docs: split Network docs and fix API errors
- Split network module into focused sub-documents:
- modules/network/index.md - Overview and quick start
- modules/network/client.md - Client-side usage
- modules/network/server.md - Server-side GameServer/Room
- modules/network/sync.md - Interpolation and prediction
- modules/network/api.md - Complete API reference
- Fixed incorrect API documentation:
- localClientId → clientId
- ENetworkState enum values (strings → numbers)
- connect() method signature
- Removed non-existent localPlayerId property
- Fixed onConnected callback signature
- Created bilingual versions (Chinese and English)
- Updated sidebar configuration
- Updated pnpm-lock.yaml for docs workspace
* docs(worker-system): split into focused sub-modules
Split 773-line worker-system.md into 5 focused documents:
- index.md: Core features and quick start
- configuration.md: IWorkerSystemConfig and processing modes
- examples.md: Complete particle physics implementation
- wechat.md: WeChat Mini Game limitations and solutions
- best-practices.md: Performance optimization tips
Updated sidebar config to reflect new structure.
Created both Chinese and English versions.
* docs(scene): split into focused sub-modules
Split 666-line scene.md into 7 focused documents:
- index.md: Overview and quick start
- lifecycle.md: Scene lifecycle methods
- entity-management.md: Entity creation, find, destroy
- system-management.md: System add, remove, control
- events.md: Event system usage
- debugging.md: Stats, performance monitoring
- best-practices.md: Design patterns and examples
Updated sidebar config to reflect new structure.
Created both Chinese and English versions.
* docs(plugin-system): split into focused sub-modules
Split 645-line plugin-system.md into 7 focused documents:
- index.md: Overview and quick start
- development.md: IPlugin interface and lifecycle
- services-systems.md: Register services and add systems
- dependencies.md: Dependency management
- management.md: Plugin management via Core/PluginManager
- examples.md: Complete plugin examples
- best-practices.md: Design guidelines and FAQ
Updated sidebar config to reflect new structure.
Created both Chinese and English versions.
* docs(behavior-tree): add English docs and expand sidebar navigation
- Add 12 English behavior-tree documentation pages
- Update sidebar config to show behavior-tree sub-navigation
- Include: overview, getting-started, core-concepts, custom-actions,
editor-guide, editor-workflow, asset-management, advanced-usage,
best-practices, cocos-integration, laya-integration, nodejs-usage
* docs(modules): split spatial and timer module docs
Spatial module (602 lines -> 5 files):
- index.md: Overview and quick start
- spatial-index.md: Grid index, range queries, raycasting API
- aoi.md: Area of Interest management
- examples.md: Combat, MMO sync, AI perception examples
- utilities.md: Geometry detection, performance tips
Timer module (481 lines -> 4 files):
- index.md: Overview and core concepts
- api.md: Complete timer and cooldown API
- examples.md: Skill cooldowns, DOT, buff systems
- best-practices.md: Usage tips, ECS integration
Also includes English versions and sidebar navigation updates.
* docs: split FSM, pathfinding, blueprint, procgen module docs
- FSM: Split into index, api, examples (3 files)
- Pathfinding: Split into index, grid-map, navmesh, smoothing, examples (5 files)
- Blueprint: Split into index, vm, custom-nodes, nodes, composition, examples (6 files)
- Procgen: Split into index, noise, random, sampling, examples (5 files)
- Added English versions for all split modules
- Updated sidebar navigation with sub-menus for all modules
2025-12-27 20:35:54 +08:00
YHH and GitHub
d57a007a42
docs: split Entity docs into sub-modules and fix Starlight CI ( #362 )
...
* docs: split Entity docs into sub-modules and fix Starlight CI
- Split monolithic entity.md into 4 focused sub-documents:
- guide/entity/index.md - Overview and basic concepts
- guide/entity/component-operations.md - Component API operations
- guide/entity/entity-handle.md - EntityHandle system for safe references
- guide/entity/lifecycle.md - Lifecycle and persistence management
- Created bilingual versions (Chinese and English)
- Updated sidebar configuration in astro.config.mjs
- Fixed CI workflow for Starlight migration:
- Updated docs.yml to upload from docs/dist instead of .vitepress/dist
- Updated package.json scripts to use pnpm filter for docs
- Added docs directory to pnpm-workspace.yaml
- Renamed docs package to @esengine/docs
- Documented missing Entity APIs:
- createComponent() method
- addComponents() batch method
- getComponentByType() with inheritance support
- markDirty() for change detection
* docs: split Network docs and fix API errors
- Split network module into focused sub-documents:
- modules/network/index.md - Overview and quick start
- modules/network/client.md - Client-side usage
- modules/network/server.md - Server-side GameServer/Room
- modules/network/sync.md - Interpolation and prediction
- modules/network/api.md - Complete API reference
- Fixed incorrect API documentation:
- localClientId → clientId
- ENetworkState enum values (strings → numbers)
- connect() method signature
- Removed non-existent localPlayerId property
- Fixed onConnected callback signature
- Created bilingual versions (Chinese and English)
- Updated sidebar configuration
- Updated pnpm-lock.yaml for docs workspace
2025-12-27 13:28:49 +08:00
YHH and GitHub
89cdfe396b
docs: migrate documentation from VitePress to Starlight ( #361 )
...
- Replace VitePress with Astro Starlight for documentation
- Reorganize document structure with better hierarchy
- Split large documents into sub-modules for better readability
- Add new sections: component, entity-query, serialization, system
- Support both Chinese (default) and English documentation
- Add responsive design and improved navigation
2025-12-27 12:54:53 +08:00
YHH and GitHub
aed91dbe45
feat(cli): add update command for ESEngine packages ( #359 )
...
* feat(cli): add update command for ESEngine packages
- Add 'update' command to check and update @esengine/* packages
- Support --check flag to only show available updates without installing
- Support --yes flag to skip confirmation prompt
- Display package update status with current vs latest version comparison
- Preserve version prefix (^ or ~) when updating
- Bump version to 1.4.0
* chore: add changeset for CLI update command
* fix(cli): handle 'latest' tag in update command
- Treat 'latest' and '*' version tags as needing update
- Pin to specific version (^x.x.x) when updating from 'latest'
- Show '(pin version)' hint in update status output
* fix(cli): minimize file system race condition in update command
Re-read package.json immediately before writing to reduce the window
for potential race conditions between reading and writing.
* fix(cli): use atomic file write to avoid race condition
Write to temp file first, then rename for atomic update.
2025-12-27 10:54:04 +08:00
yhh
5131ec3c52
chore: update pnpm-lock.yaml
2025-12-27 10:28:35 +08:00
yhh
7d74623710
fix(core): 配置 publishConfig.directory 确保从 dist 目录发布
2025-12-27 10:27:00 +08:00
YHH and GitHub
ce2db4e48a
fix(core): 修复 World cleanup 在打包环境下的兼容性问题 ( #356 )
...
- 使用 forEach 替代 spread + for...of 解构模式,避免某些打包工具转换后的兼容性问题
- 重构 World 和 WorldManager 类,提升代码质量
- 提取默认配置为常量
- 统一双语注释格式
2025-12-27 09:51:04 +08:00
yhh
b0b95c60b4
fix: 从 ignore 列表移除 network-server 以支持版本发布
2025-12-27 00:17:44 +08:00
yhh
683ac7a7d4
Merge branch 'master' of https://github.com/esengine/esengine
2025-12-27 00:16:12 +08:00
YHH and GitHub
1e240e86f2
feat(cli): 增强 Node.js 服务端适配器 ( #354 )
...
* docs(network): 添加网络模块文档和 CLI 支持
- 添加中英文网络模块文档
- 将 network、network-protocols、network-server 加入 CLI 模块列表
* feat(cli): 增强 Node.js 服务端适配器
- 添加 @esengine/network-server 依赖支持
- 生成完整的 ECS 游戏服务器项目结构
- 修复 network-server 包支持 ESM/CJS 双格式
- 添加 ws@8.18 .0 解决 Node.js 24 兼容性问题
- 组件使用 @ECSComponent 装饰器注册
- tsconfig 启用 experimentalDecorators
2025-12-27 00:13:58 +08:00
yhh
4d6c2fe7ff
Merge branch 'master' of https://github.com/esengine/esengine
2025-12-26 23:21:17 +08:00
YHH and GitHub
33e98b9a75
fix(cli): 修复 Cocos Creator 3.x 项目检测逻辑 ( #352 )
...
* docs(network): 添加网络模块文档和 CLI 支持
- 添加中英文网络模块文档
- 将 network、network-protocols、network-server 加入 CLI 模块列表
* fix(cli): 修复 Cocos Creator 3.x 项目检测逻辑
- 重构检测代码,提取通用辅助函数
- 优先检查 package.json 中的 creator.version 字段
- 添加 .creator 和 settings 目录检测
- 使用 getMajorVersion 统一版本号解析
* chore: add changeset
2025-12-26 23:14:23 +08:00
yhh
a42f2412d7
Merge branch 'master' of https://github.com/esengine/esengine
2025-12-26 23:04:47 +08:00
yhh
fdb19a33fb
docs(network): 添加网络模块文档和 CLI 支持
...
- 添加中英文网络模块文档
- 将 network、network-protocols、network-server 加入 CLI 模块列表
2025-12-26 23:01:07 +08:00
yhh
d66c18041e
fix(spatial): 修复 GridAOI 可见性更新问题
...
- 修复 addObserver 时现有观察者无法检测到新实体的问题
- 修复实体远距离移动时观察者可见性未正确更新的问题
- 重构 demos 抽取公共测试工具
2025-12-26 22:23:03 +08:00
yhh
881ffad3bc
feat(tools): 添加 CLI 模块管理命令和文档验证 demos
...
- CLI 新增 list/add/remove 命令管理项目模块
- 创建 demos 包验证模块文档正确性
- 包含 Timer/FSM/Pathfinding/Procgen/Spatial 5个模块的完整测试
2025-12-26 22:09:01 +08:00
YHH and GitHub
4a16e30794
docs(modules): 添加框架模块文档 ( #350 )
...
* docs(modules): 添加框架模块文档
添加以下模块的完整文档:
- FSM (状态机): 状态定义、转换条件、优先级、事件监听
- Timer (定时器): 定时器调度、冷却系统、服务令牌
- Spatial (空间索引): GridSpatialIndex、AOI 兴趣区域管理
- Pathfinding (寻路): A* 算法、网格地图、导航网格、路径平滑
- Procgen (程序化生成): 噪声函数、种子随机数、加权随机
所有文档均基于实际源码 API 编写,包含:
- 快速开始示例
- 完整 API 参考
- 实际使用案例
- 蓝图节点说明
- 最佳实践建议
* docs(modules): 添加 Blueprint 模块文档和所有模块英文版
新增中文文档:
- Blueprint (蓝图可视化脚本): VM、自定义节点、组合系统、触发器
新增英文文档 (docs/en/modules/):
- FSM: State machine API, transitions, ECS integration
- Timer: Timers, cooldowns, service tokens
- Spatial: Grid spatial index, AOI management
- Pathfinding: A*, grid map, NavMesh, path smoothing
- Procgen: Noise functions, seeded random, weighted random
- Blueprint: Visual scripting, custom nodes, composition
所有文档均基于实际源码 API 编写。
2025-12-26 20:02:21 +08:00
YHH and GitHub
76691cc198
docs: 重构文档结构,添加独立模块区域 ( #349 )
...
* docs: 重构文档结构,添加独立模块区域
- 新增 /modules/ 目录用于功能模块文档
- 移动 behavior-tree 从 /guide/ 到 /modules/
- 添加模块总览页面
- 更新导航栏添加"模块"入口
- 更新侧边栏:模块区域独立侧边栏
- 更新 i18n 配置支持新模块
* style(docs): 提高文字对比度
2025-12-26 19:15:08 +08:00
YHH and GitHub
ede440d277
chore: changeset for framework package configs ( #347 )
...
* chore: add changeset for framework package configs
* fix(docs): 修复 VitePress 配置中的包路径
2025-12-26 18:13:12 +08:00
YHH and GitHub
5cb83f0743
fix(framework): 补充包配置 peerDeps/repository/keywords ( #346 )
...
* fix(framework): 补充 peerDependencies, repository 和 keywords 配置
- fsm: 添加 peerDeps, repository, keywords
- timer: 添加 peerDeps, repository, keywords
- spatial: 添加 peerDeps, repository, keywords
- procgen: 添加 peerDeps, repository, keywords
- pathfinding: 移除重复的 dependencies,添加 repository, keywords
* chore: update pnpm-lock.yaml
2025-12-26 18:05:37 +08:00
yhh
7cbf92b8c7
fix(docs): 修复 tsconfig.json 中的 references 路径
2025-12-26 17:49:40 +08:00
YHH and GitHub
a049bbe2f5
fix: add private:true to packages not meant for npm ( #345 )
...
* fix(ci): run on all PRs with conditional skip
- Remove paths filter from pull_request trigger
- Add check-changes job to detect code changes
- Skip full CI if no code files changed
- Satisfies branch protection while avoiding unnecessary builds
* fix: add private:true to packages not meant for npm
Prevents changesets from trying to publish internal packages:
- engine/* (8 packages)
- rendering/* (8 packages)
- physics/* (2 packages)
- streaming/* (1 package)
- tools/sdk, tools/worker-generator
2025-12-26 17:45:00 +08:00
YHH and GitHub
9327c1cef5
fix(ci): run on all PRs with conditional skip ( #344 )
...
- Remove paths filter from pull_request trigger
- Add check-changes job to detect code changes
- Skip full CI if no code files changed
- Satisfies branch protection while avoiding unnecessary builds
2025-12-26 17:15:02 +08:00
YHH and GitHub
da5bf2116a
fix(changesets): remove network-protocols and build-config from ignore ( #342 )
...
* fix(changesets): remove network-protocols and build-config from ignore
These packages are dependencies of non-ignored packages:
- @esengine/network depends on @esengine/network-protocols
- Multiple packages depend on @esengine/build-config (private, won't publish)
* fix(ci): add .changeset to CI trigger paths
2025-12-26 17:05:41 +08:00
YHH and GitHub
67e97f89c6
fix(ci): update typedoc path and add workflow_dispatch ( #341 )
...
* fix: update Laya examples, add CLI docs, fix changesets workflow
- Update Laya examples to use Laya 3.x Script pattern (@regClass)
- Add CLI tool quick start section to README (npx @esengine/cli init)
- Fix changesets workflow to only build framework packages
- Remove unnecessary Rust/WASM build steps from changesets workflow
- Remove redundant 'pnpm build' from changeset:publish script
* docs: add CLI documentation and update Laya examples
- Add CLI quick start section to getting-started.md (zh/en)
- Update Laya examples to use Laya 3.x Script pattern
* fix(ci): update typedoc path and add workflow_dispatch
- Fix typedoc entry point: packages/core -> packages/framework/core
- Add workflow_dispatch to release-changesets for manual triggering
- Add deeper package paths to trigger on nested packages
2025-12-26 16:52:29 +08:00
YHH and GitHub
31fd34b221
fix: update Laya examples, add CLI docs, fix changesets workflow ( #340 )
...
* fix: update Laya examples, add CLI docs, fix changesets workflow
- Update Laya examples to use Laya 3.x Script pattern (@regClass)
- Add CLI tool quick start section to README (npx @esengine/cli init)
- Fix changesets workflow to only build framework packages
- Remove unnecessary Rust/WASM build steps from changesets workflow
- Remove redundant 'pnpm build' from changeset:publish script
* docs: add CLI documentation and update Laya examples
- Add CLI quick start section to getting-started.md (zh/en)
- Update Laya examples to use Laya 3.x Script pattern
2025-12-26 16:37:37 +08:00
YHH and GitHub
c4f7a13b74
feat(cli): add CLI tool for adding ECS framework to existing projects ( #339 )
...
* feat(cli): add CLI tool for adding ECS framework to existing projects
- Support Cocos Creator 2.x/3.x, LayaAir 3.x, and Node.js platforms
- Auto-detect project type based on directory structure
- Generate ECSManager with full configuration (debug, remote debug, WebSocket URL)
- Auto-install dependencies with npm/yarn/pnpm detection
- Platform-specific decorators and lifecycle methods
* chore: add changeset for @esengine/cli
* fix(ci): fix YAML syntax error in ai-issue-helper workflow
* fix(cli): resolve file system race conditions (CodeQL)
* chore(ci): remove unused and broken workflows
* fix(ci): fix YAML encoding in release.yml
2025-12-26 16:18:59 +08:00
YHH and GitHub
155411e743
refactor: reorganize package structure and decouple framework packages ( #338 )
...
* refactor: reorganize package structure and decouple framework packages
## Package Structure Reorganization
- Reorganized 55 packages into categorized subdirectories:
- packages/framework/ - Generic framework (Laya/Cocos compatible)
- packages/engine/ - ESEngine core modules
- packages/rendering/ - Rendering modules (WASM dependent)
- packages/physics/ - Physics modules
- packages/streaming/ - World streaming
- packages/network-ext/ - Network extensions
- packages/editor/ - Editor framework and plugins
- packages/rust/ - Rust WASM engine
- packages/tools/ - Build tools and SDK
## Framework Package Decoupling
- Decoupled behavior-tree and blueprint packages from ESEngine dependencies
- Created abstracted interfaces (IBTAssetManager, IBehaviorTreeAssetContent)
- ESEngine-specific code moved to esengine/ subpath exports
- Framework packages now usable with Cocos/Laya without ESEngine
## CI Configuration
- Updated CI to only type-check and lint framework packages
- Added type-check:framework and lint:framework scripts
## Breaking Changes
- Package import paths changed due to directory reorganization
- ESEngine integrations now use subpath imports (e.g., '@esengine/behavior-tree/esengine')
* fix: update es-engine file path after directory reorganization
* docs: update README to focus on framework over engine
* ci: only build framework packages, remove Rust/WASM dependencies
* fix: remove esengine subpath from behavior-tree and blueprint builds
ESEngine integration code will only be available in full engine builds.
Framework packages are now purely engine-agnostic.
* fix: move network-protocols to framework, build both in CI
* fix: update workflow paths from packages/core to packages/framework/core
* fix: exclude esengine folder from type-check in behavior-tree and blueprint
* fix: update network tsconfig references to new paths
* fix: add test:ci:framework to only test framework packages in CI
* fix: only build core and math npm packages in CI
* fix: exclude test files from CodeQL and fix string escaping security issue
2025-12-26 14:50:35 +08:00
YHH and GitHub
a84ff902e4
fix: 修复 changesets 验证错误 ( #337 )
...
- 简化 ignore 配置,只保留 editor-app
- 设置内部包为 private: true
- build-config, engine, ecs-engine-bindgen
- editor-core, editor-runtime
- 所有 *-editor 插件包
这样 changesets 可以正常工作,private 包不会被发布
2025-12-26 09:06:52 +08:00
YHH and GitHub
54038e3250
feat: 配置 changesets 版本管理和自动发布 ( #336 )
...
- 安装 @changesets/cli 和 @changesets/changelog-github
- 配置 .changeset/config.json
- 添加 npm scripts
- 创建 release-changesets.yml GitHub Action
2025-12-25 23:07:44 +08:00
yhh
5544fca002
docs: update changelog for v2.4.2
2025-12-25 20:42:15 +08:00
yhh
88b5ffc0a7
fix(ci): don't mark npm package releases as latest
2025-12-25 20:37:50 +08:00
yhh
0c0a5f10f7
chore(core): release v2.4.2
2025-12-25 20:31:51 +08:00
YHH and GitHub
56e322de7f
refactor(core): 优化 PlatformWorkerPool 和 IncrementalSerializer 代码规范 ( #335 )
...
PlatformWorkerPool:
- 添加 IWorkerPoolStatus 导出接口
- 添加便捷 getter: isDestroyed, workerCount, isReady, hasPendingTasks
- 提取 createTask/completeTask 方法减少重复代码
- 添加 ERROR_POOL_DESTROYED 常量
- 添加代码段分隔符和双语注释
IncrementalSerializer:
- 所有公共 API 添加 @zh/@en 双语注释
- 类型改用 interface 并添加 readonly
- SceneDataChange.value 从 any 改为 unknown
- 导出 SceneSnapshot, IIncrementalStats 接口
- 提取 DEFAULT_OPTIONS 常量
- 优化 getIncrementalStats 从 6 次 filter 改为 2 次循环
2025-12-25 18:39:15 +08:00
YHH and GitHub
c2ebd387f2
refactor(core): 优化 WorkerEntitySystem 实现 ( #334 )
...
重构改进:
- 分离 PlatformWorkerPool 到独立文件
- 使用 Map 管理 Worker 任务状态,替代 (worker as any)._currentTask
- 提取通用批次分割逻辑 splitIntoBatches
- 添加 IWorkerMessageData 接口提高类型安全
- 添加 WorkerState 枚举提高可读性
- 添加规范的双语注释 (@zh/@en)
- 导出新类型 IWorkerSystemConfig 和 ProcessingMode
- 保留 WorkerSystemConfig 类型别名向后兼容
代码组织:
- 按功能分组方法 (初始化/处理/批次/结果应用等)
- 减少 any 类型使用
- 统一命名风格
2025-12-25 18:08:17 +08:00
YHH and GitHub
e5e647f1a4
feat(pathfinding): 添加寻路系统模块 ( #333 )
...
* feat(pathfinding): 添加寻路系统模块
实现完整的寻路系统,支持 A* 算法、网格地图、导航网格和路径平滑:
A* 寻路算法:
- 高效的二叉堆优先队列
- 可配置的启发式权重
- 最大搜索节点限制
- 支持对角移动和穿角避免
网格地图 (GridMap):
- 基于二维数组的网格地图
- 支持 4 方向和 8 方向移动
- 可变移动代价
- 从数组或字符串加载地图
导航网格 (NavMesh):
- 凸多边形导航网格
- 自动检测相邻多边形
- 漏斗算法路径优化
- 适合复杂地形
路径平滑:
- Bresenham 视线检测
- 射线投射视线检测
- 视线简化器 (移除不必要的拐点)
- Catmull-Rom 曲线平滑
- 组合平滑器
启发式函数:
- 曼哈顿距离 (4方向)
- 欧几里得距离 (任意方向)
- 切比雪夫距离 (8方向)
- 八角距离 (8方向,对角线√2)
蓝图节点 (8个):
- FindPath: 基础寻路
- FindPathSmooth: 平滑寻路
- IsWalkable: 检查可通行性
- GetPathLength: 获取路径点数
- GetPathDistance: 获取路径距离
- GetPathPoint: 获取路径点
- MoveAlongPath: 沿路径移动
- HasLineOfSight: 视线检测
* chore: update pnpm-lock.yaml for pathfinding package
2025-12-25 17:24:24 +08:00
YHH and GitHub
4d501ba448
feat(effect): 添加效果系统模块 ( #332 )
...
实现 Buff/Debuff 效果管理和属性修改器系统:
核心功能:
- 效果容器管理效果的应用、移除和更新
- 支持持续时间类型: 永久/计时/条件
- 支持叠加规则: 刷新/叠加/独立/替换/忽略
- 效果标签系统用于分类和查询
- 效果优先级和互斥标签支持
- 效果事件系统 (应用/移除/叠加/刷新/跳动/过期)
修改器系统:
- 属性修改器支持加法/乘法/覆盖/最小值/最大值操作
- 优先级分层计算 (基础/加法/乘法/最终)
- 数值计算器自动按优先级应用修改器
蓝图节点 (12个):
- ApplyEffect: 应用效果
- RemoveEffect/RemoveEffectByTag: 移除效果
- HasEffect/HasEffectTag: 检查效果
- GetEffectStacks/GetEffectRemainingTime/GetEffectCount: 查询效果
- ClearAllEffects: 清除所有效果
- OnEffectApplied/OnEffectRemoved/OnEffectTick: 效果事件
2025-12-25 15:17:06 +08:00
YHH and GitHub
275124b66c
feat(procgen): 添加程序化生成工具包 ( #331 )
...
- 添加噪声函数 (Perlin, Simplex, Worley, FBM)
- 添加种子随机数生成器 (SeededRandom)
- 添加加权随机选择和洗牌工具
- 添加蓝图节点 (SampleNoise2D, SeededRandom, WeightedPick 等)
2025-12-25 14:33:19 +08:00
YHH and GitHub
25936c19e9
feat(network): 添加状态同步和客户端预测模块 ( #330 )
...
* feat(network): 添加状态同步和客户端预测模块
- 添加状态快照接口和快照缓冲区实现
- 实现线性插值和赫尔米特插值器
- 实现客户端预测和服务器校正系统
- 添加网络相关蓝图节点 (IsLocalPlayer, IsServer 等)
* chore: update pnpm-lock.yaml
2025-12-25 14:03:12 +08:00
YHH and GitHub
f43631a1e1
feat(spatial): 添加 AOI 兴趣区域系统 ( #329 )
...
添加 AOI (Area of Interest) 兴趣区域管理功能:
核心接口:
- IAOIManager<T> - AOI 管理器接口
- IAOIEvent<T> - AOI 事件类型
- IAOIObserverConfig - 观察者配置
实现:
- GridAOI<T> - 基于网格的 AOI 实现
- 实体进入/离开视野事件
- 视野范围配置
- 订阅者模式
蓝图节点:
- GetEntitiesInView - 获取视野内实体
- GetObserversOf - 获取能看到目标的观察者
- CanSee - 检查是否可见
- EventEntityEnterView - 实体进入视野事件
- EventEntityExitView - 实体离开视野事件
服务令牌:
- AOIManagerToken - AOI 管理器服务令牌
2025-12-25 13:24:26 +08:00
YHH and GitHub
f8c181836e
refactor(blueprint): 使用 ecs-framework 的 Entity 和 IScene 类型 ( #328 )
...
- 从 @esengine/ecs-framework 导入 Entity 和 IScene 类型
- 移除 ExecutionContext.ts 中的自定义 IEntity 和 IScene 接口
- 更新 BlueprintComponent.ts、BlueprintVM.ts、BlueprintSystem.ts 使用正确的类型
这使得 blueprint 包与 ecs-framework 的类型保持一致,避免重复定义接口。
2025-12-25 13:07:09 +08:00
YHH and GitHub
840eb3452e
feat(fsm): 添加有限状态机模块 ( #327 )
...
- 添加 IStateMachine 接口,支持泛型状态和上下文
- 添加 StateMachine 实现
- 支持状态定义 (onEnter/onExit/onUpdate)
- 支持转换定义和条件
- 支持事件监听 (onChange/onEnter/onExit)
- 添加 8 个蓝图节点:
- GetCurrentState, TransitionTo, CanTransition
- IsInState, WasInState, GetStateDuration
- EvaluateTransitions, ResetStateMachine
2025-12-25 12:51:52 +08:00
YHH and GitHub
0bf849e193
feat(blueprint): 蓝图组合系统 ( #326 )
...
* feat(blueprint): 添加蓝图组合系统
- 添加 IBlueprintFragment 接口和实现,支持可重用蓝图片段
- 添加 IBlueprintComposer 接口和实现,支持片段组合
- 添加 FragmentRegistry 片段注册表
- 支持暴露引脚连接和编译成完整蓝图
- 支持片段资产序列化格式
* fix(blueprint): 移除未使用的 ExposedPin 导入
2025-12-25 12:42:57 +08:00
YHH and GitHub
ebb984d354
feat(timer): 添加定时器和冷却系统 ( #325 )
...
- 添加 ITimerService 接口和 TimerService 实现
- 支持一次性定时器和重复定时器
- 支持冷却系统 (startCooldown/isCooldownReady/getCooldownProgress)
- 添加 8 个蓝图节点:
- StartCooldown, IsCooldownReady, GetCooldownProgress
- ResetCooldown, GetCooldownInfo
- HasTimer, CancelTimer, GetTimerRemaining
2025-12-25 12:29:59 +08:00
YHH and GitHub
068ca4bf69
feat(spatial): 空间查询和索引系统 ( #324 )
...
* feat(spatial): 添加空间查询包
- ISpatialQuery: 空间查询接口
- findInRadius, findInRect, findNearest, findKNearest
- raycast, raycastFirst
- IBounds, IRaycastHit, SpatialFilter 类型
- ISpatialIndex: 空间索引接口
- insert, remove, update, clear, getAll
- GridSpatialIndex: 网格空间索引实现
- 基于均匀网格的空间划分
- 支持所有 ISpatialQuery 操作
- 工具函数
- createBounds, isPointInBounds, boundsIntersect
- distanceSquared, distance
* feat(spatial): 添加空间查询蓝图节点
- 添加 FindInRadius/FindInRect/FindNearest/FindKNearest 节点
- 添加 Raycast/RaycastFirst 射线检测节点
- 每个节点包含模板和执行器
- 使用 menuPath: ['Spatial', ...] 组织节点菜单
2025-12-25 12:15:06 +08:00
YHH and GitHub
4089051731
feat(blueprint): 添加蓝图触发器系统 ( #323 )
...
* feat(blueprint): 添加蓝图触发器系统
- TriggerTypes: 定义触发器类型和上下文接口
- tick/input/collision/message/timer/stateEnter/stateExit/custom
- 各类型的上下文接口和工厂函数
- TriggerCondition: 触发条件系统
- ITriggerCondition 接口
- 复合条件 (CompositeCondition, NotCondition)
- 通用条件 (AlwaysTrue, AlwaysFalse, TriggerType, EntityId)
- 特定类型条件 (InputAction, MessageName, StateName, TimerId, CollisionEntity, CustomEvent)
- ConditionBuilder 链式 API
- BlueprintTrigger: 触发器核心实现
- IBlueprintTrigger 接口
- BlueprintTrigger 实现类
- TriggerRegistry 触发器注册表
- 各类型触发器工厂函数
- TriggerDispatcher: 触发器调度系统
- ITriggerDispatcher 调度器接口
- TriggerDispatcher 实现
- EntityTriggerManager 实体触发器管理器
* feat(blueprint): 添加触发器相关事件节点
- EventInput: 输入事件节点 (action/value/pressed/released)
- EventCollisionEnter/Exit: 碰撞事件节点
- EventMessage: 消息事件节点
- EventTimer: 定时器事件节点
- EventStateEnter/Exit: 状态机事件节点
2025-12-25 11:35:29 +08:00
YHH and GitHub
6b8b65ae16
feat(script-runtime): 服务器端蓝图执行模块 ( #322 )
...
* feat(script-runtime): 添加服务器端蓝图执行模块
- ServerBlueprintVM: 服务器端蓝图虚拟机
- CPULimiter: CPU 时间和步数限制
- IntentCollector: 意图收集系统
- FileMemoryStore: 文件系统持久化
- ServerExecutionContext: 服务器执行上下文
* refactor(script-runtime): 分离引擎接口与游戏逻辑
- 重构 IntentTypes.ts 只保留基础 IIntent 接口和通用常量
- IntentCollector 改为泛型类,支持任意意图类型
- ServerExecutionContext 改为泛型类,支持任意游戏状态类型
- ServerBlueprintVM 改为泛型类,使用 TGameState 和 TIntent 类型参数
- 移除游戏特定类型(IUnitState, ISpawnerState 等),由游戏项目定义
- 添加 IntentKeyExtractor 机制用于防止重复意图
* feat(script-runtime): 添加服务器端游戏循环框架
- PlayerSession: 封装单个玩家的 VM、蓝图和 Memory 状态
- TickScheduler: 管理所有玩家会话,调度每 tick 的蓝图执行
- IIntentProcessor: 意图处理器接口,由游戏项目实现
- IntentProcessorBase: 意图处理器基类,提供常用处理模式
- IntentProcessorRegistry: 按类型注册意图处理器
- GameLoop: 完整的游戏主循环,协调各组件工作
* feat(script-runtime): 添加通用蓝图节点
Memory 节点:
- GetMemory: 读取玩家 Memory
- SetMemory: 写入玩家 Memory
- HasMemoryKey: 检查键是否存在
- DeleteMemory: 删除 Memory 键
Log 节点:
- Log: 记录日志
- Warn: 记录警告
- Error: 记录错误
Game 信息节点:
- GetTick: 获取当前 tick
- GetPlayerId: 获取玩家 ID
- GetDeltaTime: 获取增量时间
- GetGameState: 获取游戏状态
提供 registerScriptRuntimeNodes() 用于批量注册节点
* fix(script-runtime): 修复 CI 构建错误
- 更新 tsconfig.json 继承 tsconfig.base.json
- 添加 references 到 core 和 blueprint 包
- 更新 pnpm-lock.yaml
* fix(script-runtime): 修复 DTS 构建错误
- 添加 tsconfig.build.json 用于 tsup 构建
- 更新 tsup.config.ts 使用 tsconfig.build.json
- 分离构建配置和类型检查配置
2025-12-25 11:00:43 +08:00
YHH and GitHub
a75c61c049
docs: 添加 Discord 社区链接 ( #321 )
2025-12-24 23:35:43 +08:00
YHH and GitHub
770c05402d
docs: 优化 README 包列表展示 ( #320 )
2025-12-24 23:33:12 +08:00
YHH and GitHub
9d581ccd8d
ci: 集成 Turborepo Remote Cache ( #319 )
2025-12-24 23:06:38 +08:00
YHH and GitHub
235c432edb
feat(network): 基于 TSRPC 的网络同步模块 ( #318 )
...
- network-protocols: 共享协议包,使用 TSRPC CLI 生成完整类型验证
- network: 浏览器客户端,提供 NetworkPlugin、NetworkService 和同步系统
- network-server: Node.js 服务端,提供 GameServer 和房间管理
2025-12-24 22:49:29 +08:00
YHH and GitHub
dbc6793dc4
refactor: 代码规范化与依赖清理 ( #317 )
...
* refactor(deps): 统一编辑器包依赖配置 & 优化分层架构
- 将 ecs-engine-bindgen 提升为 Layer 1 核心包
- 统一 9 个编辑器包的依赖声明模式
- 清理废弃的包目录 (ui, ui-editor, network-*)
* refactor(tokens): 修复 PrefabService 令牌冲突 & 补充 module.json
- 将 editor-core 的 PrefabServiceToken 改名为 EditorPrefabServiceToken
避免与 asset-system 的 PrefabServiceToken 冲突 (Symbol.for 冲突)
- 为 mesh-3d 添加 module.json
- 为 world-streaming 添加 module.json
* refactor(editor-core): 整理导出结构 & 添加 blueprint tokens.ts
- 按功能分组整理 editor-core 的 65 行导出
- 添加清晰的分组注释 (中英双语)
- 为 blueprint 添加占位符 tokens.ts
* chore(editor): 为 14 个编辑器插件包添加 module.json
统一编辑器包的模块配置,包含:
- isEditorPlugin 标识
- runtimeModule 关联
- exports 导出清单 (inspectors, panels, gizmos)
* refactor(core): 改进类型安全 - 减少 as any 使用
- 添加 GlobalTypes.ts 定义小游戏平台和 Chrome API 类型
- SoAStorage 使用 IComponentTypeMetadata 替代 as any
- PlatformDetector 使用类型安全的平台检测
- 添加 ISoAStorageStats/ISoAFieldStats 接口
* feat(editor): 添加 EditorServicesContext 解决 prop drilling
- 新增 contexts/EditorServicesContext.tsx 提供统一服务访问
- App.tsx 包裹 EditorServicesProvider
- 提供 useEditorServices/useMessageHub 等便捷 hooks
- SceneHierarchy 添加迁移注释,后续可移除 props
* docs(editor): 澄清 inspector 目录架构关系
- inspector/ 标记为内部实现,添加 @deprecated 警告
- inspectors/ 标记为公共 API 入口点
- 添加架构说明文档
* refactor(editor): 添加全局类型声明消除 window as any
- 创建 editor-app/src/global.d.ts 声明 Window 接口扩展
- 创建 editor-core/src/global.d.ts 声明 Window 接口扩展
- 更新 App.tsx 使用类型安全的 window 属性访问
- 更新 PluginLoader.ts 使用 window.__ESENGINE_PLUGINS__
- 更新 PluginSDKRegistry.ts 使用 window.__ESENGINE_SDK__
- 更新 UserCodeService.ts 使用类型安全的全局变量访问
* refactor(editor): 提取项目和场景操作到独立 hooks
- 创建 useProjectActions hook 封装项目操作
- 创建 useSceneActions hook 封装场景操作
- 为渐进式重构 App.tsx 做准备
* refactor(editor): 清理冗余代码和未使用文件
删除的目录和文件:
- application/state/ - 重复的状态管理(与 stores/ 重复)
- 8 个孤立 CSS 文件(对应组件不存在)
- AssetBrowser.tsx - 仅为 ContentBrowser 的向后兼容包装
- AssetPicker.tsx - 未被使用
- AssetPickerDialog.tsx (顶级) - 已被 dialogs/ 版本取代
- EntityInspector.tsx (顶级) - 已被 inspectors/views/ 版本取代
修复:
- 移除 App.tsx 中未使用的导入
- 更新 application/index.ts 移除已删除模块
- 修复 useProjectActions.ts 的 MutableRefObject 类型
* refactor(editor): 统一 inspectors 模块导出结构
- 在 inspectors/index.ts 重新导出 PropertyInspector
- 创建 inspectors/fields/index.ts barrel export
- 导出 views、fields、common 子模块
- 更新 EntityInspector 使用统一入口导入
* refactor(editor): 删除废弃的 Profiler 组件
删除未使用的组件(共 1059 行):
- ProfilerPanel.tsx (229 行)
- ProfilerWindow.tsx (589 行)
- ProfilerDockPanel.tsx (241 行)
- ProfilerPanel.css
- ProfilerDockPanel.css
保留:AdvancedProfiler + AdvancedProfilerWindow(正在使用)
* refactor(runtime-core): 统一依赖处理与插件状态管理
- 新增 DependencyUtils 统一拓扑排序和依赖验证
- 新增 PluginState 定义插件生命周期状态机
- 合并 UnifiedPluginLoader 到 PluginLoader
- 清理 index.ts 移除不必要的 Token re-exports
- 新增 RuntimeMode/UserCodeRealm/ImportMapGenerator
* refactor(editor-core): 使用统一的 ImportMapGenerator
- WebBuildPipeline 使用 runtime-core 的 generateImportMap
- UserCodeService 添加 ImportMap 相关接口
* feat(compiler): 增强 esbuild 查找策略
- 支持本地 node_modules、pnpm exec、npx、全局多种来源
- EngineService 使用 RuntimeMode
* refactor(runtime-core): 简化 GameRuntime 代码
- 合并 _disableGameLogicSystems/_enableGameLogicSystems 为 _setGameLogicSystemsEnabled
- 精简本地 Token 定义的注释
* refactor(editor-core): 引入 BaseRegistry 基类消除代码重复
- 新增 BaseRegistry 和 PrioritizedRegistry 基类
- 重构 CompilerRegistry, InspectorRegistry, FieldEditorRegistry
- 统一注册表的日志记录和错误处理
* refactor(editor-core): 扩展 BaseRegistry 重构
- ComponentInspectorRegistry 继承 PrioritizedRegistry
- EditorComponentRegistry 继承 BaseRegistry
- EntityCreationRegistry 继承 BaseRegistry
- PropertyRendererRegistry 继承 PrioritizedRegistry
- 导出 BaseRegistry 基类供外部使用
- 统一双语注释格式
* refactor(editor-core): 代码优雅性优化
CommandManager:
- 提取 tryMergeWithLast() 和 pushToUndoStack() 消除重复代码
- 统一双语注释格式
FileActionRegistry:
- 提取 normalizeExtension() 消除扩展名规范化重复
- 统一私有属性命名风格(_前缀)
- 使用 createRegistryToken 统一 Token 创建
BaseRegistry:
- 添加 IOrdered 接口
- 添加 sortByOrder() 排序辅助方法
EntityCreationRegistry:
- 使用 sortByOrder() 简化排序逻辑
* refactor(editor-core): 统一日志系统 & 代码规范优化
- GizmoRegistry: 使用 createLogger 替代 console.warn
- VirtualNodeRegistry: 使用 createLogger 替代 console.warn
- WindowRegistry: 使用 logger、添加 _ 前缀、导出 IWindowRegistry token
- EditorViewportService: 使用 createLogger 替代 console.warn
- ComponentActionRegistry: 使用 logger、添加 _ 前缀、返回值改进
- SettingsRegistry: 使用 logger、提取 ensureCategory/ensureSection 方法
- 添加 WindowRegistry 到主导出
* refactor(editor-core): ModuleRegistry 使用 logger 替代 console
* refactor(editor-core): SerializerRegistry/UIRegistry 添加 token 和 _ 前缀
* refactor(editor-core): UIRegistry 代码优雅性 & Token 命名统一
- UIRegistry: 提取 _sortByOrder 消除 6 处重复排序逻辑
- UIRegistry: 添加分节注释和双语文档
- FieldEditorRegistry: Token 重命名为 FieldEditorRegistryToken
- PropertyRendererRegistry: Token 重命名为 PropertyRendererRegistryToken
* refactor(core): 统一日志系统 - console 替换为 logger
- ComponentSerializer: 使用 logger 替代 console.warn
- ComponentRegistry: console.warn → logger.warn (已有 logger)
- SceneSerializer: 添加 logger,替换 console.warn/error
- SystemScheduler: 添加 logger,替换 console.warn
- VersionMigration: 添加 logger,替换所有 console.warn
- RuntimeModeService: console.error → logger.error
- Core.ts: _logger 改为 readonly,双语错误消息
- SceneSerializer 修复:使用 getComponentTypeName 替代 constructor.name
* fix(core): 修复 constructor.name 压缩后失效问题
- Scene.ts: 使用 system.systemName 替代 system.constructor.name
- CommandBuffer.ts: 使用 getComponentTypeName() 替代 constructor.name
* refactor(editor-core): 代码规范优化 - 私有方法命名 & 日志统一
- BuildService: console → logger
- FileActionRegistry: 添加 logger, 私有方法 _ 前缀
- SettingsRegistry: 私有方法 _ 前缀 (ensureCategory → _ensureCategory)
* refactor(core): Scene.ts 私有变量命名规范化
- logger → _logger (遵循私有变量 _ 前缀规范)
* refactor(editor-core): 服务类私有成员命名规范化
- CommandManager: 私有变量/方法添加 _ 前缀
- undoStack/redoStack/config/isExecuting
- tryMergeWithLast/pushToUndoStack
- LocaleService: 私有变量/方法添加 _ 前缀
- currentLocale/translations/changeListeners
- deepMerge/getNestedValue/loadSavedLocale/saveLocale
* refactor(core): 私有成员命名规范化 & 单例模式优化
- Component.ts: _idGenerator 私有静态变量规范化
- PlatformManager.ts: _instance, _adapter, _logger 规范化
- AutoProfiler.ts: _instance, _config 及所有私有方法规范化
- ProfilerSDK.ts: _instance, _config 及所有私有方法规范化
- ComponentPoolManager: _instance, _pools, _usageTracker 规范化
- GlobalEventBus: _instance 规范化
- 添加中英双语 JSDoc 注释
* refactor(editor-app,behavior-tree-editor): 私有成员 & 单例模式命名规范化
editor-app:
- EngineService: private static instance → _instance
- EditorEngineSync: 所有私有成员添加 _ 前缀
- RuntimeResolver: 所有私有成员和方法添加 _ 前缀
- SettingsService: 所有私有成员和方法添加 _ 前缀
behavior-tree-editor:
- GlobalBlackboardService: 所有私有成员和方法添加 _ 前缀
- NotificationService: private static instance → _instance
- NodeRegistryService: 所有私有成员和方法添加 _ 前缀
- TreeStateAdapter: private static instance → _instance
* fix(editor-runtime): 添加 editor-core 到 external 避免传递依赖问题
将 @esengine/editor-core 添加到 vite external 配置,
避免 editor-core → runtime-core → ecs-engine-bindgen 的传递依赖
被错误地打包进 editor-runtime.js,导致 CI 构建失败。
* fix(core): 修复空接口 lint 错误
将 IByteDanceMiniGameAPI、IAlipayMiniGameAPI、IBaiduMiniGameAPI 从空接口改为类型别名,修复 no-empty-object-type 规则报错
2025-12-24 20:57:08 +08:00
YHH and GitHub
58f70a5783
refactor(core): 代码结构优化 & 添加独立 ECS 框架文档 ( #316 )
...
Core 库优化:
- Scene.ts: 提取 _runSystemPhase() 消除 update/lateUpdate 重复代码
- World.ts: 可选链简化、提取 _isSceneCleanupCandidate() 消除重复条件
- Entity.ts: 移除过度设计的 EntityComparer
- 清理方法内部冗余注释,保持代码自解释
文档改进:
- 为 core 包创建独立 README (中英文)
- 明确 ECS 框架可独立用于 Cocos/Laya 等引擎
- 添加 sparse-checkout 命令说明,支持只克隆 core 源码
- 主 README 添加 ECS 独立使用提示
2025-12-23 18:00:21 +08:00
YHH and GitHub
828ff969e1
feat(3d): FBX/GLTF/OBJ 加载器与骨骼动画支持 ( #315 )
...
* feat(3d): FBX/GLTF/OBJ 加载器与骨骼动画支持
* chore: 更新 pnpm-lock.yaml
* fix: 移除未使用的变量和方法
* fix: 修复 mesh-3d-editor tsconfig 引用路径
* fix: 修复正则表达式 ReDoS 漏洞
2025-12-23 15:34:01 +08:00
yhh
49dd6a91c6
docs: v2.4.1 changelog
2025-12-23 15:22:33 +08:00
yhh
1e048d5c04
chore(core): bump version to 2.4.1
2025-12-23 15:20:19 +08:00
yhh
dff2ec564b
fix(core): IntervalSystem时间累加bug修复 & 添加Core.paused文档
...
- 修复 onCheckProcessing() 在 update/lateUpdate 被调用两次导致时间累加翻倍的问题
- 添加 Core.paused 游戏暂停文档(中/英文)
- 新增 IntervalSystem 相关测试用例
2025-12-23 09:41:22 +08:00
yhh
2381919a5c
fix(core): Cocos Creator 兼容性 - 类型导出修复
...
- 将 export interface 转换为 export type 以兼容 Rollup
- 分离类型导入/导出使用 import type 和 export type
- 修复 QueryCondition, QueryResult, SupportedTypedArray 等类型的重导出
2025-12-22 14:54:38 +08:00
yhh
66d9f428b3
feat: 3D 编辑器支持 - 网格、相机、Gizmo
2025-12-22 12:40:43 +08:00