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
This commit is contained in:
YHH
2025-12-26 14:50:35 +08:00
committed by GitHub
parent a84ff902e4
commit 155411e743
1936 changed files with 4147 additions and 11578 deletions

View File

@@ -0,0 +1,137 @@
/**
* English translations for Behavior Tree Editor
* 行为树编辑器英文翻译
*/
export const en = {
// ========================================
// Toolbar
// ========================================
toolbar: {
openFile: 'Open File (Ctrl+O)',
save: 'Save (Ctrl+S)',
saveUnsaved: 'Save (Ctrl+S) - Unsaved changes',
export: 'Export Runtime Config',
copyToClipboard: 'Copy JSON to Clipboard',
run: 'Run (Play)',
resume: 'Resume',
pause: 'Pause',
stop: 'Stop',
step: 'Step',
resetView: 'Reset View (scroll to zoom, Alt+drag to pan)',
undo: 'Undo (Ctrl+Z)',
redo: 'Redo (Ctrl+Shift+Z / Ctrl+Y)',
goToRoot: 'Go to Root Node'
},
// ========================================
// Execution Status
// ========================================
execution: {
idle: 'Idle',
running: 'Running',
paused: 'Paused'
},
// ========================================
// Node
// ========================================
node: {
executionOrder: 'Execution Order: {{order}}',
initialValue: 'Initial Value',
currentValue: 'Current Value'
},
// ========================================
// Context Menu
// ========================================
contextMenu: {
delete: 'Delete',
duplicate: 'Duplicate',
copy: 'Copy',
paste: 'Paste'
},
// ========================================
// Quick Create Menu
// ========================================
quickCreate: {
searchPlaceholder: 'Search nodes...',
uncategorized: 'Uncategorized',
noMatchingNodes: 'No matching nodes found'
},
// ========================================
// Blackboard Panel
// ========================================
blackboard: {
title: 'Blackboard',
variableName: 'variable.name',
copy: 'Copy',
edit: 'Edit',
delete: 'Delete',
addVariable: 'Add Variable'
},
// ========================================
// Compiler
// ========================================
compiler: {
name: 'Behavior Tree Compiler',
description: 'Compile behavior tree assets',
selectAssetOutput: 'Select asset output directory...',
selectTypeOutput: 'Select type definition output directory...',
compile: 'Compile',
compiling: 'Compiling...',
success: 'Compilation successful',
failed: 'Compilation failed'
},
// ========================================
// Notifications
// ========================================
notifications: {
fileSaved: 'File saved: {{path}}',
fileSaveFailed: 'Failed to save file',
fileOpened: 'File opened: {{path}}',
fileOpenFailed: 'Failed to open file',
copiedToClipboard: 'Copied to clipboard',
exportSuccess: 'Export successful',
exportFailed: 'Export failed',
validationError: 'Validation error: {{message}}'
},
// ========================================
// Dialogs
// ========================================
dialogs: {
createBehaviorTree: 'Create Behavior Tree Asset',
confirmDelete: 'Are you sure you want to delete this node?',
unsavedChanges: 'You have unsaved changes. Do you want to save before closing?'
},
// ========================================
// Panel
// ========================================
panel: {
title: 'Behavior Tree Editor',
noFileOpen: 'No behavior tree file is open',
dropToOpen: 'Drop a .btree file here or use Open button'
},
// ========================================
// Validation Errors
// ========================================
validation: {
rootNodeMaxChildren: 'Root node can only connect to one child node',
decoratorNodeMaxChildren: 'Decorator node can only connect to one child node',
leafNodeNoChildren: 'Leaf node cannot have children',
circularReference: 'Circular reference detected, node {{nodeId}} cannot connect to itself or its descendants',
invalidConnection: 'Invalid connection: {{reason}}',
nodeIdRequired: 'Node ID cannot be empty',
nodeTemplateRequired: 'Node template cannot be empty',
sourceNodeNotFound: 'Connection source node not found: {{nodeId}}',
targetNodeNotFound: 'Connection target node not found: {{nodeId}}',
selfConnection: 'Node cannot connect to itself',
cycleDetected: 'Circular reference detected in behavior tree'
}
};

View File

@@ -0,0 +1,138 @@
/**
* Spanish translations for Behavior Tree Editor
* Traducciones en español del Editor de Árbol de Comportamiento
*/
export const es = {
// ========================================
// Toolbar
// ========================================
toolbar: {
openFile: 'Abrir Archivo (Ctrl+O)',
save: 'Guardar (Ctrl+S)',
saveUnsaved: 'Guardar (Ctrl+S) - Cambios sin guardar',
export: 'Exportar Configuración de Ejecución',
copyToClipboard: 'Copiar JSON al Portapapeles',
run: 'Ejecutar (Play)',
resume: 'Continuar',
pause: 'Pausar',
stop: 'Detener',
step: 'Paso a Paso',
resetView: 'Restablecer Vista (scroll para zoom, Alt+arrastrar para desplazar)',
undo: 'Deshacer (Ctrl+Z)',
redo: 'Rehacer (Ctrl+Shift+Z / Ctrl+Y)',
goToRoot: 'Ir al Nodo Raíz'
},
// ========================================
// Execution Status
// ========================================
execution: {
idle: 'Inactivo',
running: 'Ejecutando',
paused: 'Pausado'
},
// ========================================
// Node
// ========================================
node: {
executionOrder: 'Orden de Ejecución: {{order}}',
initialValue: 'Valor Inicial',
currentValue: 'Valor Actual'
},
// ========================================
// Context Menu
// ========================================
contextMenu: {
delete: 'Eliminar',
duplicate: 'Duplicar',
copy: 'Copiar',
paste: 'Pegar'
},
// ========================================
// Quick Create Menu
// ========================================
quickCreate: {
searchPlaceholder: 'Buscar nodos...',
uncategorized: 'Sin categoría',
noMatchingNodes: 'No se encontraron nodos coincidentes'
},
// ========================================
// Blackboard Panel
// ========================================
blackboard: {
title: 'Pizarra',
variableName: 'nombre.variable',
copy: 'Copiar',
edit: 'Editar',
delete: 'Eliminar',
addVariable: 'Agregar Variable'
},
// ========================================
// Compiler
// ========================================
compiler: {
name: 'Compilador de Árbol de Comportamiento',
description: 'Compilar recursos de árbol de comportamiento',
selectAssetOutput: 'Seleccionar directorio de salida de recursos...',
selectTypeOutput: 'Seleccionar directorio de salida de definiciones de tipo...',
compile: 'Compilar',
compiling: 'Compilando...',
success: 'Compilación exitosa',
failed: 'Compilación fallida'
},
// ========================================
// Notifications
// ========================================
notifications: {
fileSaved: 'Archivo guardado: {{path}}',
fileSaveFailed: 'Error al guardar archivo',
fileOpened: 'Archivo abierto: {{path}}',
fileOpenFailed: 'Error al abrir archivo',
copiedToClipboard: 'Copiado al portapapeles',
exportSuccess: 'Exportación exitosa',
exportFailed: 'Exportación fallida',
validationError: 'Error de validación: {{message}}'
},
// ========================================
// Dialogs
// ========================================
dialogs: {
createBehaviorTree: 'Crear Recurso de Árbol de Comportamiento',
confirmDelete: '¿Está seguro de que desea eliminar este nodo?',
unsavedChanges: 'Tiene cambios sin guardar. ¿Desea guardar antes de cerrar?'
},
// ========================================
// Panel
// ========================================
panel: {
title: 'Editor de Árbol de Comportamiento',
noFileOpen: 'No hay archivo de árbol de comportamiento abierto',
dropToOpen: 'Arrastre un archivo .btree aquí o use el botón Abrir'
},
// ========================================
// Validation Errors
// Errores de validación
// ========================================
validation: {
rootNodeMaxChildren: 'El nodo raíz solo puede conectar a un nodo hijo',
decoratorNodeMaxChildren: 'El nodo decorador solo puede conectar a un nodo hijo',
leafNodeNoChildren: 'El nodo hoja no puede tener hijos',
circularReference: 'Referencia circular detectada, el nodo {{nodeId}} no puede conectarse a sí mismo o a sus descendientes',
invalidConnection: 'Conexión inválida: {{reason}}',
nodeIdRequired: 'El ID del nodo no puede estar vacío',
nodeTemplateRequired: 'La plantilla del nodo no puede estar vacía',
sourceNodeNotFound: 'Nodo fuente de conexión no encontrado: {{nodeId}}',
targetNodeNotFound: 'Nodo destino de conexión no encontrado: {{nodeId}}',
selfConnection: 'El nodo no puede conectarse a sí mismo',
cycleDetected: 'Referencia circular detectada en el árbol de comportamiento'
}
};

View File

@@ -0,0 +1,9 @@
/**
* Behavior Tree Editor Locales
* 行为树编辑器多语言支持
*/
export { en } from './en';
export { zh } from './zh';
export { es } from './es';
export type BehaviorTreeTranslations = typeof import('./en').en;

View File

@@ -0,0 +1,138 @@
/**
* Chinese translations for Behavior Tree Editor
* 行为树编辑器中文翻译
*/
export const zh = {
// ========================================
// Toolbar
// ========================================
toolbar: {
openFile: '打开文件 (Ctrl+O)',
save: '保存 (Ctrl+S)',
saveUnsaved: '保存 (Ctrl+S) - 有未保存的更改',
export: '导出运行时配置',
copyToClipboard: '复制JSON到剪贴板',
run: '运行 (Play)',
resume: '继续',
pause: '暂停',
stop: '停止',
step: '单步执行',
resetView: '重置视图 (滚轮缩放, Alt+拖动平移)',
undo: '撤销 (Ctrl+Z)',
redo: '重做 (Ctrl+Shift+Z / Ctrl+Y)',
goToRoot: '回到根节点'
},
// ========================================
// Execution Status
// ========================================
execution: {
idle: '空闲',
running: '运行中',
paused: '已暂停'
},
// ========================================
// Node
// ========================================
node: {
executionOrder: '执行顺序: {{order}}',
initialValue: '初始值',
currentValue: '当前值'
},
// ========================================
// Context Menu
// ========================================
contextMenu: {
delete: '删除',
duplicate: '复制',
copy: '复制',
paste: '粘贴'
},
// ========================================
// Quick Create Menu
// ========================================
quickCreate: {
searchPlaceholder: '搜索节点...',
uncategorized: '未分类',
noMatchingNodes: '未找到匹配的节点'
},
// ========================================
// Blackboard Panel
// ========================================
blackboard: {
title: '黑板',
variableName: '变量名',
copy: '复制',
edit: '编辑',
delete: '删除',
addVariable: '添加变量'
},
// ========================================
// Compiler
// ========================================
compiler: {
name: '行为树编译器',
description: '编译行为树资产',
selectAssetOutput: '选择资产输出目录...',
selectTypeOutput: '选择类型定义输出目录...',
compile: '编译',
compiling: '编译中...',
success: '编译成功',
failed: '编译失败'
},
// ========================================
// Notifications
// ========================================
notifications: {
fileSaved: '文件已保存: {{path}}',
fileSaveFailed: '保存文件失败',
fileOpened: '文件已打开: {{path}}',
fileOpenFailed: '打开文件失败',
copiedToClipboard: '已复制到剪贴板',
exportSuccess: '导出成功',
exportFailed: '导出失败',
validationError: '验证错误: {{message}}'
},
// ========================================
// Dialogs
// ========================================
dialogs: {
createBehaviorTree: '创建行为树资产',
confirmDelete: '确定要删除这个节点吗?',
unsavedChanges: '有未保存的更改。关闭前是否保存?'
},
// ========================================
// Panel
// ========================================
panel: {
title: '行为树编辑器',
noFileOpen: '没有打开的行为树文件',
dropToOpen: '拖放 .btree 文件到这里或使用打开按钮'
},
// ========================================
// Validation Errors
// 验证错误
// ========================================
validation: {
rootNodeMaxChildren: '根节点只能连接一个子节点',
decoratorNodeMaxChildren: '装饰节点只能连接一个子节点',
leafNodeNoChildren: '叶子节点不能有子节点',
circularReference: '检测到循环引用,节点 {{nodeId}} 不能连接到自己或其子节点',
invalidConnection: '无效的连接:{{reason}}',
nodeIdRequired: '节点 ID 不能为空',
nodeTemplateRequired: '节点模板不能为空',
sourceNodeNotFound: '连接的源节点不存在: {{nodeId}}',
targetNodeNotFound: '连接的目标节点不存在: {{nodeId}}',
selfConnection: '节点不能连接到自己',
cycleDetected: '行为树中存在循环引用'
}
};