2025-12-27 12:54:53 +08:00
|
|
|
// @ts-check
|
|
|
|
|
import { defineConfig } from 'astro/config';
|
|
|
|
|
import starlight from '@astrojs/starlight';
|
|
|
|
|
import vue from '@astrojs/vue';
|
|
|
|
|
import tailwindcss from '@tailwindcss/vite';
|
|
|
|
|
|
|
|
|
|
export default defineConfig({
|
|
|
|
|
integrations: [
|
|
|
|
|
starlight({
|
|
|
|
|
title: 'ESEngine',
|
|
|
|
|
logo: {
|
|
|
|
|
src: './src/assets/logo.svg',
|
|
|
|
|
replacesTitle: false,
|
|
|
|
|
},
|
|
|
|
|
social: [
|
|
|
|
|
{ icon: 'github', label: 'GitHub', href: 'https://github.com/esengine/esengine' }
|
|
|
|
|
],
|
|
|
|
|
defaultLocale: 'root',
|
|
|
|
|
locales: {
|
|
|
|
|
root: {
|
|
|
|
|
label: '简体中文',
|
|
|
|
|
lang: 'zh-CN',
|
|
|
|
|
},
|
|
|
|
|
en: {
|
|
|
|
|
label: 'English',
|
|
|
|
|
lang: 'en',
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
sidebar: [
|
|
|
|
|
{
|
|
|
|
|
label: '快速开始',
|
|
|
|
|
translations: { en: 'Getting Started' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '快速入门', slug: 'guide/getting-started', translations: { en: 'Quick Start' } },
|
|
|
|
|
{ label: '指南概览', slug: 'guide', translations: { en: 'Guide Overview' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '核心概念',
|
|
|
|
|
translations: { en: 'Core Concepts' },
|
|
|
|
|
items: [
|
2025-12-27 13:28:49 +08:00
|
|
|
{
|
|
|
|
|
label: '实体',
|
|
|
|
|
translations: { en: 'Entity' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/entity', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '组件操作', slug: 'guide/entity/component-operations', translations: { en: 'Component Operations' } },
|
|
|
|
|
{ label: '实体句柄', slug: 'guide/entity/entity-handle', translations: { en: 'Entity Handle' } },
|
|
|
|
|
{ label: '生命周期', slug: 'guide/entity/lifecycle', translations: { en: 'Lifecycle' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-12-27 12:54:53 +08:00
|
|
|
{ label: '层级结构', slug: 'guide/hierarchy', translations: { en: 'Hierarchy' } },
|
|
|
|
|
{
|
|
|
|
|
label: '组件',
|
|
|
|
|
translations: { en: 'Component' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/component', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '生命周期', slug: 'guide/component/lifecycle', translations: { en: 'Lifecycle' } },
|
|
|
|
|
{ label: 'EntityRef 装饰器', slug: 'guide/component/entity-ref', translations: { en: 'EntityRef' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/component/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '实体查询',
|
|
|
|
|
translations: { en: 'Entity Query' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/entity-query', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: 'Matcher API', slug: 'guide/entity-query/matcher-api', translations: { en: 'Matcher API' } },
|
|
|
|
|
{ label: '编译查询', slug: 'guide/entity-query/compiled-query', translations: { en: 'Compiled Query' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/entity-query/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '系统',
|
|
|
|
|
translations: { en: 'System' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/system', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '系统类型', slug: 'guide/system/types', translations: { en: 'System Types' } },
|
|
|
|
|
{ label: '生命周期', slug: 'guide/system/lifecycle', translations: { en: 'Lifecycle' } },
|
|
|
|
|
{ label: '命令缓冲区', slug: 'guide/system/command-buffer', translations: { en: 'Command Buffer' } },
|
|
|
|
|
{ label: '系统调度', slug: 'guide/system/scheduling', translations: { en: 'Scheduling' } },
|
|
|
|
|
{ label: '变更检测', slug: 'guide/system/change-detection', translations: { en: 'Change Detection' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/system/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
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
|
|
|
{
|
|
|
|
|
label: '场景',
|
|
|
|
|
translations: { en: 'Scene' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/scene', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '生命周期', slug: 'guide/scene/lifecycle', translations: { en: 'Lifecycle' } },
|
|
|
|
|
{ label: '实体管理', slug: 'guide/scene/entity-management', translations: { en: 'Entity Management' } },
|
|
|
|
|
{ label: '系统管理', slug: 'guide/scene/system-management', translations: { en: 'System Management' } },
|
|
|
|
|
{ label: '事件系统', slug: 'guide/scene/events', translations: { en: 'Events' } },
|
|
|
|
|
{ label: '调试与监控', slug: 'guide/scene/debugging', translations: { en: 'Debugging' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/scene/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-12-27 12:54:53 +08:00
|
|
|
{
|
|
|
|
|
label: '序列化',
|
|
|
|
|
translations: { en: 'Serialization' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/serialization', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '装饰器与继承', slug: 'guide/serialization/decorators', translations: { en: 'Decorators & Inheritance' } },
|
|
|
|
|
{ label: '增量序列化', slug: 'guide/serialization/incremental', translations: { en: 'Incremental' } },
|
|
|
|
|
{ label: '版本迁移', slug: 'guide/serialization/migration', translations: { en: 'Migration' } },
|
|
|
|
|
{ label: '使用场景', slug: 'guide/serialization/use-cases', translations: { en: 'Use Cases' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{ label: '事件系统', slug: 'guide/event-system', translations: { en: 'Event System' } },
|
|
|
|
|
{ label: '时间与定时器', slug: 'guide/time-and-timers', translations: { en: 'Time & Timers' } },
|
|
|
|
|
{ label: '日志系统', slug: 'guide/logging', translations: { en: 'Logging' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '高级功能',
|
|
|
|
|
translations: { en: 'Advanced Features' },
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
label: '服务容器',
|
|
|
|
|
translations: { en: 'Service Container' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/service-container', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '内置服务', slug: 'guide/service-container/built-in-services', translations: { en: 'Built-in Services' } },
|
|
|
|
|
{ label: '依赖注入', slug: 'guide/service-container/dependency-injection', translations: { en: 'Dependency Injection' } },
|
|
|
|
|
{ label: 'PluginServiceRegistry', slug: 'guide/service-container/plugin-service-registry', translations: { en: 'PluginServiceRegistry' } },
|
|
|
|
|
{ label: '高级用法', slug: 'guide/service-container/advanced', translations: { en: 'Advanced' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
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
|
|
|
{
|
|
|
|
|
label: '插件系统',
|
|
|
|
|
translations: { en: 'Plugin System' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/plugin-system', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '插件开发', slug: 'guide/plugin-system/development', translations: { en: 'Development' } },
|
|
|
|
|
{ label: '服务与系统', slug: 'guide/plugin-system/services-systems', translations: { en: 'Services & Systems' } },
|
|
|
|
|
{ label: '依赖管理', slug: 'guide/plugin-system/dependencies', translations: { en: 'Dependencies' } },
|
|
|
|
|
{ label: '插件管理', slug: 'guide/plugin-system/management', translations: { en: 'Management' } },
|
|
|
|
|
{ label: '示例插件', slug: 'guide/plugin-system/examples', translations: { en: 'Examples' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/plugin-system/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'Worker 系统',
|
|
|
|
|
translations: { en: 'Worker System' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'guide/worker-system', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '配置选项', slug: 'guide/worker-system/configuration', translations: { en: 'Configuration' } },
|
|
|
|
|
{ label: '完整示例', slug: 'guide/worker-system/examples', translations: { en: 'Examples' } },
|
|
|
|
|
{ label: '微信小游戏', slug: 'guide/worker-system/wechat', translations: { en: 'WeChat' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'guide/worker-system/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-12-27 12:54:53 +08:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '平台适配器',
|
|
|
|
|
translations: { en: 'Platform Adapters' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概览', slug: 'guide/platform-adapter', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '浏览器', slug: 'guide/platform-adapter/browser', translations: { en: 'Browser' } },
|
|
|
|
|
{ label: '微信小游戏', slug: 'guide/platform-adapter/wechat-minigame', translations: { en: 'WeChat Mini Game' } },
|
|
|
|
|
{ label: 'Node.js', slug: 'guide/platform-adapter/nodejs', translations: { en: 'Node.js' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '模块',
|
|
|
|
|
translations: { en: 'Modules' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '模块总览', slug: 'modules', translations: { en: 'Modules Overview' } },
|
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
|
|
|
{
|
|
|
|
|
label: '行为树',
|
|
|
|
|
translations: { en: 'Behavior Tree' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/behavior-tree', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '快速开始', slug: 'modules/behavior-tree/getting-started', translations: { en: 'Getting Started' } },
|
|
|
|
|
{ label: '核心概念', slug: 'modules/behavior-tree/core-concepts', translations: { en: 'Core Concepts' } },
|
|
|
|
|
{ label: '编辑器指南', slug: 'modules/behavior-tree/editor-guide', translations: { en: 'Editor Guide' } },
|
|
|
|
|
{ label: '编辑器工作流', slug: 'modules/behavior-tree/editor-workflow', translations: { en: 'Editor Workflow' } },
|
|
|
|
|
{ label: '资产管理', slug: 'modules/behavior-tree/asset-management', translations: { en: 'Asset Management' } },
|
|
|
|
|
{ label: '自定义节点', slug: 'modules/behavior-tree/custom-actions', translations: { en: 'Custom Actions' } },
|
|
|
|
|
{ label: '高级用法', slug: 'modules/behavior-tree/advanced-usage', translations: { en: 'Advanced Usage' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'modules/behavior-tree/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
{ label: 'Cocos 集成', slug: 'modules/behavior-tree/cocos-integration', translations: { en: 'Cocos Integration' } },
|
|
|
|
|
{ label: 'Laya 集成', slug: 'modules/behavior-tree/laya-integration', translations: { en: 'Laya Integration' } },
|
|
|
|
|
{ label: 'Node.js 使用', slug: 'modules/behavior-tree/nodejs-usage', translations: { en: 'Node.js Usage' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '状态机',
|
|
|
|
|
translations: { en: 'FSM' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/fsm', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: 'API 参考', slug: 'modules/fsm/api', translations: { en: 'API Reference' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/fsm/examples', translations: { en: 'Examples' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '定时器',
|
|
|
|
|
translations: { en: 'Timer' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/timer', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: 'API 参考', slug: 'modules/timer/api', translations: { en: 'API Reference' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/timer/examples', translations: { en: 'Examples' } },
|
|
|
|
|
{ label: '最佳实践', slug: 'modules/timer/best-practices', translations: { en: 'Best Practices' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '空间索引',
|
|
|
|
|
translations: { en: 'Spatial' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/spatial', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '空间索引 API', slug: 'modules/spatial/spatial-index', translations: { en: 'Spatial Index API' } },
|
|
|
|
|
{ label: 'AOI 兴趣区域', slug: 'modules/spatial/aoi', translations: { en: 'AOI' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/spatial/examples', translations: { en: 'Examples' } },
|
|
|
|
|
{ label: '工具与优化', slug: 'modules/spatial/utilities', translations: { en: 'Utilities' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '寻路',
|
|
|
|
|
translations: { en: 'Pathfinding' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/pathfinding', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '网格地图 API', slug: 'modules/pathfinding/grid-map', translations: { en: 'Grid Map API' } },
|
|
|
|
|
{ label: '导航网格 API', slug: 'modules/pathfinding/navmesh', translations: { en: 'NavMesh API' } },
|
|
|
|
|
{ label: '路径平滑', slug: 'modules/pathfinding/smoothing', translations: { en: 'Path Smoothing' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/pathfinding/examples', translations: { en: 'Examples' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '蓝图',
|
|
|
|
|
translations: { en: 'Blueprint' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/blueprint', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '虚拟机 API', slug: 'modules/blueprint/vm', translations: { en: 'VM API' } },
|
|
|
|
|
{ label: '自定义节点', slug: 'modules/blueprint/custom-nodes', translations: { en: 'Custom Nodes' } },
|
|
|
|
|
{ label: '内置节点', slug: 'modules/blueprint/nodes', translations: { en: 'Built-in Nodes' } },
|
|
|
|
|
{ label: '蓝图组合', slug: 'modules/blueprint/composition', translations: { en: 'Composition' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/blueprint/examples', translations: { en: 'Examples' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '程序生成',
|
|
|
|
|
translations: { en: 'Procgen' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/procgen', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '噪声函数', slug: 'modules/procgen/noise', translations: { en: 'Noise Functions' } },
|
|
|
|
|
{ label: '种子随机数', slug: 'modules/procgen/random', translations: { en: 'Seeded Random' } },
|
|
|
|
|
{ label: '采样工具', slug: 'modules/procgen/sampling', translations: { en: 'Sampling' } },
|
|
|
|
|
{ label: '实际示例', slug: 'modules/procgen/examples', translations: { en: 'Examples' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-12-27 13:28:49 +08:00
|
|
|
{
|
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
|
|
|
label: 'RPC 通信',
|
|
|
|
|
translations: { en: 'RPC' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/rpc', translations: { en: 'Overview' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '网络同步',
|
2025-12-27 13:28:49 +08:00
|
|
|
translations: { en: 'Network' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '概述', slug: 'modules/network', translations: { en: 'Overview' } },
|
|
|
|
|
{ label: '客户端', slug: 'modules/network/client', translations: { en: 'Client' } },
|
|
|
|
|
{ label: '服务器', slug: 'modules/network/server', translations: { en: 'Server' } },
|
|
|
|
|
{ label: '状态同步', slug: 'modules/network/sync', translations: { en: 'State Sync' } },
|
|
|
|
|
{ label: 'API 参考', slug: 'modules/network/api', translations: { en: 'API Reference' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
2025-12-27 12:54:53 +08:00
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '示例',
|
|
|
|
|
translations: { en: 'Examples' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '示例总览', slug: 'examples', translations: { en: 'Examples Overview' } },
|
|
|
|
|
{ label: 'Worker 系统演示', slug: 'examples/worker-system-demo', translations: { en: 'Worker System Demo' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: 'API 参考',
|
|
|
|
|
translations: { en: 'API Reference' },
|
|
|
|
|
autogenerate: { directory: 'api' },
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
label: '更新日志',
|
|
|
|
|
translations: { en: 'Changelog' },
|
|
|
|
|
items: [
|
|
|
|
|
{ label: '@esengine/ecs-framework', link: 'https://github.com/esengine/esengine/blob/master/packages/framework/core/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
{ label: '@esengine/behavior-tree', link: 'https://github.com/esengine/esengine/blob/master/packages/framework/behavior-tree/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
{ label: '@esengine/fsm', link: 'https://github.com/esengine/esengine/blob/master/packages/framework/fsm/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
{ label: '@esengine/timer', link: 'https://github.com/esengine/esengine/blob/master/packages/framework/timer/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
{ label: '@esengine/network', link: 'https://github.com/esengine/esengine/blob/master/packages/framework/network/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
{ label: '@esengine/cli', link: 'https://github.com/esengine/esengine/blob/master/packages/tools/cli/CHANGELOG.md', attrs: { target: '_blank' } },
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
customCss: ['./src/styles/custom.css'],
|
|
|
|
|
head: [
|
|
|
|
|
{ tag: 'meta', attrs: { name: 'theme-color', content: '#646cff' } },
|
|
|
|
|
],
|
|
|
|
|
components: {
|
|
|
|
|
Head: './src/components/Head.astro',
|
|
|
|
|
ThemeSelect: './src/components/ThemeSelect.astro',
|
|
|
|
|
},
|
|
|
|
|
}),
|
|
|
|
|
vue(),
|
|
|
|
|
],
|
|
|
|
|
vite: {
|
|
|
|
|
plugins: [tailwindcss()],
|
|
|
|
|
},
|
2025-12-27 13:28:49 +08:00
|
|
|
});
|