Files
esengine/packages/editor-app/src-tauri/tauri.conf.json
YHH 6702f0bfad feat(editor): 完善用户代码热更新和环境检测 (#275)
* fix: 更新 bundle-runtime 脚本使用正确的 platform-web 输出文件

原脚本引用的 runtime.browser.js 不存在,改为使用 index.mjs

* feat(editor): 完善用户代码热更新和环境检测

## 热更新改进
- 添加 hotReloadInstances() 方法,通过更新原型链实现真正的热更新
- 组件实例保留数据,仅更新方法
- ComponentRegistry 支持热更新时替换同名组件类

## 环境检测
- 启动时检测 esbuild 可用性
- 在启动页面底部显示环境状态指示器
- 添加 check_environment Rust 命令和前端 API

## esbuild 打包
- 将 esbuild 二进制文件打包到应用中
- 用户无需全局安装 esbuild
- 支持 Windows/macOS/Linux 平台

## 文件监视优化
- 添加 300ms 防抖,避免重复编译
- 修复路径分隔符混合问题

## 资源打包修复
- 修复 Tauri 资源配置,保留 engine 目录结构
- 添加 src-tauri/bin/ 和 src-tauri/engine/ 到 gitignore

* fix: 将热更新模式改为可选,修复测试失败

- ComponentRegistry 添加 hotReloadEnabled 标志,默认禁用
- 只有启用热更新模式时才会替换同名组件类
- 编辑器环境自动启用热更新模式
- reset() 方法中重置热更新标志

* test: 添加热更新模式的测试用例
2025-12-05 14:24:09 +08:00

159 lines
4.1 KiB
JSON

{
"productName": "ESEngine Editor",
"version": "1.0.13",
"identifier": "com.esengine.editor",
"build": {
"beforeDevCommand": "npm run build:watch",
"beforeBuildCommand": "npm run build",
"frontendDist": "../dist"
},
"bundle": {
"active": true,
"targets": "all",
"createUpdaterArtifacts": true,
"resources": [
"runtime/**/*",
"engine/**/*",
"bin/*"
],
"icon": [
"icons/32x32.png",
"icons/128x128.png",
"icons/128x128@2x.png",
"icons/icon.png",
"icons/icon.ico"
],
"windows": {
"certificateThumbprint": null,
"digestAlgorithm": "sha256",
"timestampUrl": "",
"webviewInstallMode": {
"type": "downloadBootstrapper"
}
},
"fileAssociations": [
{
"ext": [
"ecs"
],
"name": "ECS Scene File",
"description": "ESEngine Scene File",
"role": "Editor"
}
],
"macOS": {
"frameworks": [],
"minimumSystemVersion": "10.13",
"exceptionDomain": "",
"signingIdentity": null,
"providerShortName": null,
"entitlements": null
}
},
"app": {
"windows": [
{
"title": "ESEngine Editor",
"width": 1280,
"height": 800,
"minWidth": 800,
"minHeight": 600,
"resizable": true,
"fullscreen": false,
"decorations": false,
"transparent": false,
"center": true,
"skipTaskbar": false,
"dragDropEnabled": false
}
],
"security": {
"csp": "default-src 'self' 'unsafe-inline' 'unsafe-eval' tauri: project: asset: https: http: data: blob:; script-src 'self' 'unsafe-inline' 'unsafe-eval' tauri: project: asset: https: http: blob:; style-src 'self' 'unsafe-inline' tauri: https: http:; img-src 'self' tauri: project: asset: https: http: data: blob:; connect-src 'self' tauri: project: asset: https: http: ws: wss:",
"assetProtocol": {
"enable": true,
"scope": {
"allow": [
"**"
]
}
},
"capabilities": [
{
"identifier": "main",
"windows": [
"main"
],
"permissions": [
"core:default",
"core:window:allow-start-dragging",
"core:window:allow-minimize",
"core:window:allow-maximize",
"core:window:allow-toggle-maximize",
"core:window:allow-close",
"core:window:allow-is-maximized",
"shell:default",
"dialog:default",
"updater:default",
"updater:allow-check",
"updater:allow-download",
"updater:allow-install",
"fs:default",
"fs:allow-read-text-file",
"fs:allow-write-text-file",
"fs:allow-read-dir",
"fs:allow-exists",
"fs:allow-read",
"fs:allow-write",
"fs:allow-create",
"fs:allow-mkdir",
"fs:allow-read-file",
"fs:allow-write-file",
"fs:allow-remove",
"fs:allow-rename",
"fs:allow-copy-file"
],
"scope": {
"allow": [
"$HOME/**",
"$APPDATA/**",
"$APPLOCALDATA/**",
"$APPCACHE/**",
"$APPLOG/**",
"$DESKTOP/**",
"$DOCUMENT/**",
"$DOWNLOAD/**",
"$TEMP/**"
]
}
},
"http-capability"
]
}
},
"plugins": {
"shell": {
"open": true
},
"cli": {
"args": [
{
"name": "file",
"index": 1,
"takesValue": true
}
]
},
"fs": {
"requireLiteralLeadingDot": false
},
"updater": {
"active": true,
"endpoints": [
"https://github.com/esengine/ecs-framework/releases/latest/download/latest.json"
],
"dialog": true,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IDFDQjNFNDIxREFBODNDNkMKUldSc1BLamFJZVN6SEJIRXRWWEovVXRta08yNWFkZmtKNnZoSHFmbi9ZdGxubUMzSHJaN3J0VEcK"
}
}
}