feat(modules): 添加module.json配置

This commit is contained in:
yhh
2025-12-03 16:20:48 +08:00
parent e1d494b415
commit 37ab494e4a
26 changed files with 2356 additions and 147 deletions

View File

@@ -0,0 +1,43 @@
{
"id": "blueprint",
"name": "@esengine/blueprint",
"displayName": "Blueprint",
"description": "Visual scripting system | 可视化脚本系统",
"version": "1.0.0",
"category": "AI",
"icon": "Workflow",
"tags": [
"visual",
"scripting",
"blueprint",
"nodes"
],
"isCore": false,
"defaultEnabled": false,
"isEngineModule": true,
"canContainContent": true,
"platforms": [
"web",
"desktop"
],
"dependencies": [
"core"
],
"exports": {
"components": [
"BlueprintComponent"
],
"systems": [
"BlueprintSystem"
],
"other": [
"Blueprint",
"BlueprintNode",
"BlueprintGraph"
]
},
"editorPackage": "@esengine/blueprint-editor",
"requiresWasm": false,
"outputPath": "dist/index.js",
"pluginExport": "BlueprintPlugin"
}

View File

@@ -31,6 +31,7 @@
"license": "MIT",
"devDependencies": {
"@esengine/ecs-framework": "workspace:*",
"@esengine/engine-core": "workspace:*",
"@esengine/build-config": "workspace:*",
"@types/node": "^20.19.17",
"rimraf": "^5.0.0",

View File

@@ -0,0 +1,60 @@
/**
* Blueprint Plugin for ES Engine.
* ES引擎的蓝图插件。
*
* Provides visual scripting runtime support.
* 提供可视化脚本运行时支持。
*/
import type { IPlugin, ModuleManifest, IRuntimeModule } from '@esengine/engine-core';
/**
* Blueprint Runtime Module.
* 蓝图运行时模块。
*
* Note: Blueprint uses a custom system (IBlueprintSystem) instead of EntitySystem,
* so createSystems is not implemented here. Blueprint systems should be created
* manually using createBlueprintSystem(scene).
*/
class BlueprintRuntimeModule implements IRuntimeModule {
async onInitialize(): Promise<void> {
// Blueprint system initialization
// Blueprint uses IBlueprintSystem which is different from EntitySystem
}
onDestroy(): void {
// Cleanup
}
}
/**
* Plugin manifest for Blueprint.
* 蓝图的插件清单。
*/
const manifest: ModuleManifest = {
id: 'blueprint',
name: '@esengine/blueprint',
displayName: 'Blueprint',
version: '1.0.0',
description: '可视化脚本系统',
category: 'AI',
icon: 'Workflow',
isCore: false,
defaultEnabled: false,
isEngineModule: true,
dependencies: ['core'],
exports: {
components: ['BlueprintComponent'],
systems: ['BlueprintSystem']
},
requiresWasm: false
};
/**
* Blueprint Plugin.
* 蓝图插件。
*/
export const BlueprintPlugin: IPlugin = {
manifest,
runtimeModule: new BlueprintRuntimeModule()
};

View File

@@ -29,3 +29,6 @@ export {
triggerCustomBlueprintEvent
} from './runtime/BlueprintSystem';
export { createEmptyBlueprint, validateBlueprintAsset } from './types/blueprint';
// Plugin
export { BlueprintPlugin } from './BlueprintPlugin';