mirror of
https://gitee.com/dgflash/oops-plugin-framework.git
synced 2026-05-19 06:31:54 +08:00
废弃工具中与版本不匹配的工具,后续使用VSCode插件集成所有工具
This commit is contained in:
@@ -24,7 +24,7 @@ export class CCBusiness<T extends CCEntity> {
|
||||
this._event.destroy();
|
||||
this._event = null;
|
||||
}
|
||||
|
||||
|
||||
// 清空实体引用,避免循环引用导致的内存泄漏
|
||||
this.ent = null!;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
* 批量添加单例子实体
|
||||
* @param clss 单例子实体类数组
|
||||
*/
|
||||
addChildSingletons<T extends CCEntity>(...clss: EntityCtor<T>[]) {
|
||||
addChildSingletons<T extends CCEntity>(...clss: EntityCtor<T>[]): void {
|
||||
for (const ctor of clss) {
|
||||
this.addChildSingleton<T>(ctor);
|
||||
}
|
||||
@@ -66,7 +66,7 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
* 移除单例子实体
|
||||
* @param cls 单例子实体类
|
||||
*/
|
||||
removeChildSingleton<T extends CCEntity>(cls: EntityCtor<T>) {
|
||||
removeChildSingleton<T extends CCEntity>(cls: EntityCtor<T>): void {
|
||||
if (!this.singletons) return;
|
||||
|
||||
const entity = this.singletons.get(cls);
|
||||
@@ -135,7 +135,8 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
|
||||
if (params == null) {
|
||||
params = { preload: true };
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
params.preload = true;
|
||||
}
|
||||
|
||||
@@ -175,16 +176,19 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
comp.onClose = () => {
|
||||
try {
|
||||
this.remove(ctor);
|
||||
} catch (error) {
|
||||
}
|
||||
catch (error) {
|
||||
console.error(`移除界面组件失败: ${key}`, error);
|
||||
}
|
||||
};
|
||||
oops.gui.remove(key);
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
// 没有 LayerUIElement,直接移除
|
||||
this.remove(ctor);
|
||||
}
|
||||
} else {
|
||||
}
|
||||
else {
|
||||
this.remove(ctor);
|
||||
}
|
||||
}
|
||||
@@ -198,9 +202,9 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
* 批量添加业务逻辑组件
|
||||
* @param clss 业务逻辑组件类数组
|
||||
*/
|
||||
addBusinesss<T extends CCBusiness<CCEntity>>(...clss: BusinessCtor<T>[]) {
|
||||
addBusinesss(...clss: BusinessCtor[]) {
|
||||
for (const ctor of clss) {
|
||||
this.addBusiness<T>(ctor);
|
||||
this.addBusiness(ctor);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -237,7 +241,7 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
* 移除业务逻辑组件
|
||||
* @param cls 业务逻辑组件类
|
||||
*/
|
||||
removeBusiness<T extends CCBusiness<CCEntity>>(cls: BusinessCtor<T>) {
|
||||
removeBusiness<T extends CCBusiness<CCEntity>>(cls: BusinessCtor<T>): void {
|
||||
if (this.businesss) {
|
||||
const business = this.businesss.get(cls);
|
||||
if (business) {
|
||||
@@ -251,7 +255,7 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
destroy(): void {
|
||||
// 1. 先销毁所有子实体,避免内存泄漏
|
||||
if (this.singletons) {
|
||||
this.singletons.forEach(entity => {
|
||||
this.singletons.forEach((entity) => {
|
||||
if (entity && typeof entity.destroy === 'function') {
|
||||
entity.destroy();
|
||||
}
|
||||
@@ -262,7 +266,7 @@ export abstract class CCEntity extends ecs.Entity {
|
||||
|
||||
// 2. 再销毁所有业务组件
|
||||
if (this.businesss) {
|
||||
this.businesss.forEach(business => business.destroy());
|
||||
this.businesss.forEach((business) => business.destroy());
|
||||
this.businesss.clear();
|
||||
this.businesss = null!;
|
||||
}
|
||||
|
||||
8
dist/asset-directory.js
vendored
8
dist/asset-directory.js
vendored
@@ -1,6 +1,9 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.close = exports.ready = exports.update = exports.template = exports.$ = void 0;
|
||||
exports.template = exports.$ = void 0;
|
||||
exports.update = update;
|
||||
exports.ready = ready;
|
||||
exports.close = close;
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
exports.$ = {
|
||||
@@ -38,8 +41,5 @@ function update(assetList, metaList) {
|
||||
this.$.section.hidden = false;
|
||||
}
|
||||
}
|
||||
exports.update = update;
|
||||
function ready() { }
|
||||
exports.ready = ready;
|
||||
function close() { }
|
||||
exports.close = close;
|
||||
|
||||
47
dist/assets-menu.js
vendored
47
dist/assets-menu.js
vendored
@@ -1,6 +1,6 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.onAssetMenu = void 0;
|
||||
exports.onAssetMenu = onAssetMenu;
|
||||
const tinypng_1 = require("./tinypng");
|
||||
/** 资源栏右键菜单 */
|
||||
function onAssetMenu(assetInfo) {
|
||||
@@ -8,50 +8,6 @@ function onAssetMenu(assetInfo) {
|
||||
{
|
||||
label: 'i18n:oops-framework.name',
|
||||
submenu: [
|
||||
{
|
||||
label: `i18n:oops-framework.script`,
|
||||
submenu: [
|
||||
{
|
||||
label: `i18n:oops-framework.createGameComponent`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "GameComponent");
|
||||
},
|
||||
},
|
||||
{
|
||||
type: `separator`,
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createModule`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Module");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createModel`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Model");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createBll`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Bll");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createView`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "View");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createViewMvvm`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "ViewMvvm");
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.tools_asset_menu`,
|
||||
submenu: [
|
||||
@@ -67,5 +23,4 @@ function onAssetMenu(assetInfo) {
|
||||
},
|
||||
];
|
||||
}
|
||||
exports.onAssetMenu = onAssetMenu;
|
||||
;
|
||||
|
||||
118
dist/common/version.js
vendored
118
dist/common/version.js
vendored
@@ -1,40 +1,85 @@
|
||||
"use strict";
|
||||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
var desc = Object.getOwnPropertyDescriptor(m, k);
|
||||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
||||
desc = { enumerable: true, get: function() { return m[k]; } };
|
||||
}
|
||||
Object.defineProperty(o, k2, desc);
|
||||
}) : (function(o, m, k, k2) {
|
||||
if (k2 === undefined) k2 = k;
|
||||
o[k2] = m[k];
|
||||
}));
|
||||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
||||
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
||||
}) : function(o, v) {
|
||||
o["default"] = v;
|
||||
});
|
||||
var __importStar = (this && this.__importStar) || (function () {
|
||||
var ownKeys = function(o) {
|
||||
ownKeys = Object.getOwnPropertyNames || function (o) {
|
||||
var ar = [];
|
||||
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
||||
return ar;
|
||||
};
|
||||
return ownKeys(o);
|
||||
};
|
||||
return function (mod) {
|
||||
if (mod && mod.__esModule) return mod;
|
||||
var result = {};
|
||||
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
||||
__setModuleDefault(result, mod);
|
||||
return result;
|
||||
};
|
||||
})();
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.reload = exports.statistics = exports.checkUpdate = void 0;
|
||||
exports.checkUpdate = checkUpdate;
|
||||
exports.statistics = statistics;
|
||||
exports.reload = reload;
|
||||
const package_util_1 = require("./package-util");
|
||||
const axios = require('axios');
|
||||
const https = __importStar(require("https"));
|
||||
/**
|
||||
* 检查更新
|
||||
* @param {boolean} logWhatever 无论有无更新都打印提示
|
||||
*/
|
||||
function checkUpdate() {
|
||||
const packageJsonUrl = `${package_util_1.PackageUtil.repository}/raw/master/package.json`;
|
||||
axios.get(packageJsonUrl)
|
||||
.then(async (response) => {
|
||||
const json = response.data;
|
||||
if (json && json.version) {
|
||||
const remoteVersion = json.version;
|
||||
// 本地版本号
|
||||
const localVersion = getLocalVersion();
|
||||
// 对比版本号
|
||||
const result = compareVersion(localVersion, remoteVersion);
|
||||
if (result < 0) {
|
||||
console.log('【Oops Framework】发现新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
console.log('【Oops Framework】最新版本:', remoteVersion);
|
||||
console.log('【Oops Framework】关闭 Cocos Creator 运行 update-oops-plugin-hot-update 可自动更新');
|
||||
https.get(packageJsonUrl, (res) => {
|
||||
let data = '';
|
||||
// 接收数据块
|
||||
res.on('data', (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
// 数据接收完成
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const json = JSON.parse(data);
|
||||
if (json && json.version) {
|
||||
const remoteVersion = json.version;
|
||||
// 本地版本号
|
||||
const localVersion = getLocalVersion();
|
||||
// 对比版本号
|
||||
const result = compareVersion(localVersion, remoteVersion);
|
||||
if (result < 0) {
|
||||
console.log('【Oops Framework】发现新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
console.log('【Oops Framework】最新版本:', remoteVersion);
|
||||
console.log('【Oops Framework】关闭 Cocos Creator 运行 update-oops-plugin-hot-update 可自动更新');
|
||||
}
|
||||
else {
|
||||
console.log('【Oops Framework】当前 Oops Framework 为最新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
console.log('【Oops Framework】当前 Oops Framework 为最新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
catch (e) {
|
||||
console.error("【Oops Framework】解析版本信息失败");
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
});
|
||||
}).on('error', () => {
|
||||
console.error("【Oops Framework】请检查你的网络是否正常,框架版本验证失败");
|
||||
});
|
||||
}
|
||||
exports.checkUpdate = checkUpdate;
|
||||
async function statistics() {
|
||||
// 获取本地 IP 地址
|
||||
const os = require('os');
|
||||
@@ -51,22 +96,39 @@ async function statistics() {
|
||||
};
|
||||
const si = require('systeminformation');
|
||||
const system = await si.system();
|
||||
const axios = require('axios');
|
||||
const api = `http://43.142.65.105:8866/ptl/Register`;
|
||||
const http = require('http');
|
||||
const params = {
|
||||
username: system.uuid,
|
||||
ip: getLocalIp()
|
||||
};
|
||||
axios.post(api, params).then((response) => { }).catch(() => { });
|
||||
const postData = JSON.stringify(params);
|
||||
const options = {
|
||||
hostname: '43.142.65.105',
|
||||
port: 8866,
|
||||
path: '/ptl/Register',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(postData)
|
||||
}
|
||||
};
|
||||
const req = http.request(options, (res) => {
|
||||
// 静默处理响应
|
||||
res.on('data', () => { });
|
||||
res.on('end', () => { });
|
||||
});
|
||||
req.on('error', () => {
|
||||
// 静默处理错误
|
||||
});
|
||||
req.write(postData);
|
||||
req.end();
|
||||
}
|
||||
exports.statistics = statistics;
|
||||
async function reload() {
|
||||
const path = await Editor.Package.getPath(package_util_1.PackageUtil.name);
|
||||
await Editor.Package.unregister(path);
|
||||
await Editor.Package.register(path);
|
||||
await Editor.Package.enable(path);
|
||||
}
|
||||
exports.reload = reload;
|
||||
/**
|
||||
* 获取本地版本号
|
||||
* @returns {string}
|
||||
|
||||
121
dist/create-script.js
vendored
121
dist/create-script.js
vendored
@@ -1,121 +0,0 @@
|
||||
"use strict";
|
||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.createScript = exports.createScriptBll = exports.createScriptModule = exports.createView = void 0;
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = __importDefault(require("path"));
|
||||
/** 写入文件 */
|
||||
function createView(directoryPath, fileName, content, moduleName, isEcsComp = true) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// 创建脚本
|
||||
let className = fileName + "View";
|
||||
let scriptUrl = "";
|
||||
if (isEcsComp) {
|
||||
scriptUrl = path_1.default.join(directoryPath, fileName) + "ViewComp.ts";
|
||||
}
|
||||
else {
|
||||
scriptUrl = path_1.default.join(directoryPath, fileName) + "View.ts";
|
||||
}
|
||||
if (!(0, fs_1.existsSync)(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, className);
|
||||
content = content.replace(/<%ModuleName%>/g, moduleName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
// 创建预制
|
||||
let prefabUrl = path_1.default.join(directoryPath, fileName) + ".prefab";
|
||||
if (!(0, fs_1.existsSync)(prefabUrl)) {
|
||||
if (isEcsComp)
|
||||
className = className + "Comp";
|
||||
await Editor.Message.request('scene', 'execute-scene-script', {
|
||||
name: "oops-framework",
|
||||
method: 'createPrefab',
|
||||
args: [fileName, className, prefabUrl]
|
||||
});
|
||||
}
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
// 打开预制
|
||||
Editor.Message.request('asset-db', 'open-asset', prefabUrl);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
exports.createView = createView;
|
||||
function createScriptModule(directoryPath, fileName, content) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
// 创建目录
|
||||
let pathName = fileName.toLowerCase();
|
||||
let pathModule = path_1.default.join(directoryPath, pathName);
|
||||
if (!(0, fs_1.existsSync)(pathModule)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', pathModule, null);
|
||||
}
|
||||
let subPathView = path_1.default.join(pathModule, "view");
|
||||
if (!(0, fs_1.existsSync)(subPathView)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathView, null);
|
||||
}
|
||||
let subPathBll = path_1.default.join(pathModule, "bll");
|
||||
if (!(0, fs_1.existsSync)(subPathBll)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathBll, null);
|
||||
}
|
||||
let subPathModel = path_1.default.join(pathModule, "model");
|
||||
if (!(0, fs_1.existsSync)(subPathModel)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathModel, null);
|
||||
}
|
||||
// 创建脚本
|
||||
let scriptUrl = path_1.default.join(pathModule, fileName) + ".ts";
|
||||
if (!(0, fs_1.existsSync)(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
exports.createScriptModule = createScriptModule;
|
||||
/** 创建脚本 */
|
||||
function createScriptBll(directoryPath, fileName, content, moduleName) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let scriptUrl = path_1.default.join(directoryPath, fileName) + ".ts";
|
||||
// 创建脚本
|
||||
if (!(0, fs_1.existsSync)(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
content = content.replace(/<%ModuleName%>/g, moduleName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
exports.createScriptBll = createScriptBll;
|
||||
/** 创建业务层脚本 */
|
||||
function createScript(directoryPath, fileName, content, isEcsComp = true) {
|
||||
return new Promise(async (resolve, reject) => {
|
||||
let scriptUrl = "";
|
||||
if (isEcsComp) {
|
||||
scriptUrl = path_1.default.join(directoryPath, fileName) + "Comp.ts";
|
||||
}
|
||||
else {
|
||||
scriptUrl = path_1.default.join(directoryPath, fileName) + ".ts";
|
||||
}
|
||||
// 创建脚本
|
||||
if (!(0, fs_1.existsSync)(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
exports.createScript = createScript;
|
||||
117
dist/default/index.js
vendored
117
dist/default/index.js
vendored
@@ -1,117 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const fs_extra_1 = require("fs-extra");
|
||||
const path_1 = require("path");
|
||||
const vue_1 = require("vue");
|
||||
const create_script_1 = require("../create-script");
|
||||
const GameComponent_1 = require("../template/GameComponent");
|
||||
const Module_1 = require("../template/Module");
|
||||
const ModuleBll_1 = require("../template/ModuleBll");
|
||||
const ModuleModel_1 = require("../template/ModuleModel");
|
||||
const ModuleView_1 = require("../template/ModuleView");
|
||||
const ModuleViewVM_1 = require("../template/ModuleViewVM");
|
||||
const panelDataMap = new WeakMap();
|
||||
module.exports = Editor.Panel.define({
|
||||
listeners: {
|
||||
show() { console.log('show'); },
|
||||
hide() { console.log('hide'); },
|
||||
},
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../static/template/default/index.html'), 'utf-8'),
|
||||
style: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../static/style/default/index.css'), 'utf-8'),
|
||||
$: {
|
||||
app: '#app',
|
||||
},
|
||||
ready() {
|
||||
var args = arguments;
|
||||
let filename = "Default";
|
||||
let path = args[0];
|
||||
let type = args[1];
|
||||
let title = "???";
|
||||
let showModule = false;
|
||||
let moduleName = "ModuleName";
|
||||
switch (type) {
|
||||
case "GameComponent":
|
||||
title = `i18n:oops-framework.createGameComponent`;
|
||||
break;
|
||||
case "Module":
|
||||
title = `i18n:oops-framework.createModule`;
|
||||
break;
|
||||
case "Model":
|
||||
title = `i18n:oops-framework.createModel`;
|
||||
break;
|
||||
case "Bll":
|
||||
title = `i18n:oops-framework.createBll`;
|
||||
showModule = true;
|
||||
break;
|
||||
case "View":
|
||||
title = `i18n:oops-framework.createView`;
|
||||
showModule = true;
|
||||
break;
|
||||
case "ViewMvvm":
|
||||
title = `i18n:oops-framework.createViewMvvm`;
|
||||
showModule = true;
|
||||
break;
|
||||
}
|
||||
// 创建框架配置界面
|
||||
if (this.$.app) {
|
||||
const app = (0, vue_1.createApp)({});
|
||||
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('ui-');
|
||||
app.component('MyConfig', {
|
||||
template: (0, fs_extra_1.readFileSync)((0, path_1.join)(__dirname, '../../static/template/vue/set_file_name.html'), 'utf-8'),
|
||||
data() {
|
||||
return {
|
||||
title: title,
|
||||
filename: filename,
|
||||
showModule: showModule
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 记录输入的文件名
|
||||
onInputName(event) {
|
||||
filename = event.target.value;
|
||||
},
|
||||
onModuleName(event) {
|
||||
moduleName = event.target.value;
|
||||
},
|
||||
// 创建文件
|
||||
async onConfirm() {
|
||||
if (filename.trim().length == 0) {
|
||||
await Editor.Dialog.info('请输入文件名');
|
||||
return;
|
||||
}
|
||||
switch (type) {
|
||||
case "GameComponent":
|
||||
await (0, create_script_1.createView)(path, filename, GameComponent_1.TemplateGameComponent, null, false);
|
||||
break;
|
||||
case "Module":
|
||||
await (0, create_script_1.createScriptModule)(path, filename, Module_1.TemplateModule);
|
||||
break;
|
||||
case "Model":
|
||||
await (0, create_script_1.createScript)(path, filename, ModuleModel_1.TemplateModel);
|
||||
break;
|
||||
case "Bll":
|
||||
await (0, create_script_1.createScriptBll)(path, filename, ModuleBll_1.TemplateBll, moduleName);
|
||||
break;
|
||||
case "View":
|
||||
await (0, create_script_1.createView)(path, filename, ModuleView_1.TemplateView, moduleName);
|
||||
break;
|
||||
case "ViewMvvm":
|
||||
await (0, create_script_1.createView)(path, filename, ModuleViewVM_1.TemplateViewMvvm, moduleName);
|
||||
break;
|
||||
}
|
||||
close();
|
||||
}
|
||||
},
|
||||
});
|
||||
app.mount(this.$.app);
|
||||
panelDataMap.set(this, app);
|
||||
}
|
||||
},
|
||||
beforeClose() { },
|
||||
close() {
|
||||
const app = panelDataMap.get(this);
|
||||
if (app) {
|
||||
app.unmount();
|
||||
}
|
||||
},
|
||||
});
|
||||
49
dist/inspector/asset-directory.js
vendored
49
dist/inspector/asset-directory.js
vendored
@@ -1,49 +0,0 @@
|
||||
'use strict';
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.close = exports.ready = exports.update = exports.template = exports.$ = void 0;
|
||||
const fs_1 = require("fs");
|
||||
const path_1 = require("path");
|
||||
exports.$ = {
|
||||
'code': '#code',
|
||||
'section': '#section',
|
||||
};
|
||||
exports.template = `
|
||||
<ui-section id="section" header="文件夹说明" expand>
|
||||
<ui-code id="code"></ui-code>
|
||||
</ui-section>
|
||||
`;
|
||||
function update(assetList, metaList) {
|
||||
this.assetList = assetList;
|
||||
this.metaList = metaList;
|
||||
if (assetList.length === 0) {
|
||||
this.$.code.innerHTML = '';
|
||||
}
|
||||
else {
|
||||
this.$.code.innerHTML = assetList
|
||||
.filter((asset) => {
|
||||
const mdFile = (0, path_1.join)(asset.file, `.${asset.name}.md`);
|
||||
return (0, fs_1.existsSync)(mdFile);
|
||||
})
|
||||
.map((asset) => {
|
||||
const mdFile = (0, path_1.join)(asset.file, `.${asset.name}.md`);
|
||||
const mdStr = (0, fs_1.readFileSync)(mdFile, 'utf-8');
|
||||
return assetList.length > 1 ? `${asset.url}:\n ${mdStr}` : mdStr;
|
||||
})
|
||||
.join('\n') || '';
|
||||
}
|
||||
if (this.$.code.innerHTML === '') {
|
||||
this.$.section.hidden = true;
|
||||
}
|
||||
else {
|
||||
this.$.section.hidden = false;
|
||||
}
|
||||
}
|
||||
exports.update = update;
|
||||
function ready() {
|
||||
// TODO something
|
||||
}
|
||||
exports.ready = ready;
|
||||
function close() {
|
||||
// TODO something
|
||||
}
|
||||
exports.close = close;
|
||||
120
dist/main.js
vendored
120
dist/main.js
vendored
@@ -1,60 +1,60 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.methods = exports.config = exports.unload = exports.load = void 0;
|
||||
const electron_1 = require("electron");
|
||||
const version_1 = require("./common/version");
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
function load() {
|
||||
(0, version_1.checkUpdate)();
|
||||
(0, version_1.statistics)();
|
||||
}
|
||||
exports.load = load;
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
function unload() { }
|
||||
exports.unload = unload;
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
exports.methods = {
|
||||
/** 打开框架文档 */
|
||||
document() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework/wikis/pages');
|
||||
},
|
||||
/** 打开框架API文档 */
|
||||
documentApi() {
|
||||
electron_1.shell.openExternal('https://oops-1255342636.cos.ap-shanghai.myqcloud.com/doc/oops-framework/index.html');
|
||||
},
|
||||
/** 打开框架更新日志 */
|
||||
log() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework/wikis/pages?sort_id=12101082&doc_id=2873565');
|
||||
},
|
||||
update() {
|
||||
(0, version_1.checkUpdate)();
|
||||
},
|
||||
/** 打开解决方案列表 */
|
||||
solution() {
|
||||
electron_1.shell.openExternal('https://store.cocos.com/app/search?name=oops');
|
||||
},
|
||||
/** 打开教程项目 */
|
||||
tutorial() {
|
||||
electron_1.shell.openExternal('https://store.cocos.com/app/detail/6647');
|
||||
},
|
||||
/** 点亮 Gitee 星星 */
|
||||
gitee() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework');
|
||||
},
|
||||
/** 点亮 Github 星星 */
|
||||
github() {
|
||||
electron_1.shell.openExternal('https://github.com/dgflash/oops-framework');
|
||||
},
|
||||
animator_editor() {
|
||||
electron_1.shell.openExternal('https://oops-1255342636.cos.ap-shanghai.myqcloud.com/tools/animator-editor/index.html');
|
||||
}
|
||||
};
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.methods = exports.config = void 0;
|
||||
exports.load = load;
|
||||
exports.unload = unload;
|
||||
const electron_1 = require("electron");
|
||||
const version_1 = require("./common/version");
|
||||
/**
|
||||
* @en Hooks triggered after extension loading is complete
|
||||
* @zh 扩展加载完成后触发的钩子
|
||||
*/
|
||||
function load() {
|
||||
(0, version_1.checkUpdate)();
|
||||
(0, version_1.statistics)();
|
||||
}
|
||||
/**
|
||||
* @en Hooks triggered after extension uninstallation is complete
|
||||
* @zh 扩展卸载完成后触发的钩子
|
||||
*/
|
||||
function unload() { }
|
||||
/**
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
exports.methods = {
|
||||
/** 打开框架文档 */
|
||||
document() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework/wikis/pages');
|
||||
},
|
||||
/** 打开框架API文档 */
|
||||
documentApi() {
|
||||
electron_1.shell.openExternal('https://oops-1255342636.cos.ap-shanghai.myqcloud.com/doc/oops-framework/index.html');
|
||||
},
|
||||
/** 打开框架更新日志 */
|
||||
log() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework/wikis/pages?sort_id=12101082&doc_id=2873565');
|
||||
},
|
||||
update() {
|
||||
(0, version_1.checkUpdate)();
|
||||
},
|
||||
/** 打开解决方案列表 */
|
||||
solution() {
|
||||
electron_1.shell.openExternal('https://store.cocos.com/app/search?name=oops');
|
||||
},
|
||||
/** 打开教程项目 */
|
||||
tutorial() {
|
||||
electron_1.shell.openExternal('https://store.cocos.com/app/detail/6647');
|
||||
},
|
||||
/** 点亮 Gitee 星星 */
|
||||
gitee() {
|
||||
electron_1.shell.openExternal('https://gitee.com/dgflash/oops-framework');
|
||||
},
|
||||
/** 点亮 Github 星星 */
|
||||
github() {
|
||||
electron_1.shell.openExternal('https://github.com/dgflash/oops-framework');
|
||||
},
|
||||
animator_editor() {
|
||||
electron_1.shell.openExternal('https://oops-1255342636.cos.ap-shanghai.myqcloud.com/tools/animator-editor/index.html');
|
||||
}
|
||||
};
|
||||
|
||||
36
dist/scene.js
vendored
36
dist/scene.js
vendored
@@ -1,36 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.methods = exports.unload = exports.load = void 0;
|
||||
function load() { }
|
||||
exports.load = load;
|
||||
function unload() { }
|
||||
exports.unload = unload;
|
||||
// 在其他扩展脚本中,我们可以使用如下代码调用 rotateCamera 函数
|
||||
// const options: ExecuteSceneScriptMethodOptions = {
|
||||
// name: scene.ts 所在的扩展包名, 如: App,
|
||||
// method: scene.ts 中定义的方法, 如: createPrefab,
|
||||
// args: 参数,可选, 只传递json
|
||||
// };
|
||||
// const result = await Editor.Message.request('scene', 'execute-scene-script', options);
|
||||
exports.methods = {
|
||||
/** 创建视图层制 */
|
||||
async createPrefab(fileName, className, prefabUrl) {
|
||||
const { Node, js, Layers, UITransform } = require('cc');
|
||||
const node = new Node(fileName);
|
||||
node.layer = Layers.Enum.UI_2D;
|
||||
node.addComponent(UITransform);
|
||||
while (true) {
|
||||
const result = js.getClassByName(className);
|
||||
if (result)
|
||||
break;
|
||||
await new Promise((next) => {
|
||||
setTimeout(next, 100);
|
||||
});
|
||||
}
|
||||
const com = node.addComponent(className);
|
||||
com.resetInEditor && com.resetInEditor();
|
||||
const info = cce.Prefab.generatePrefabDataFromNode(node);
|
||||
node.destroy();
|
||||
return Editor.Message.request('asset-db', 'create-asset', prefabUrl, info.prefabData || info);
|
||||
}
|
||||
};
|
||||
15
dist/template/GameComponent.js
vendored
15
dist/template/GameComponent.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateGameComponent = void 0;
|
||||
exports.TemplateGameComponent = `import { _decorator } from 'cc';
|
||||
import { GameComponent } from "db://oops-framework/module/common/GameComponent";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 显示对象控制 */
|
||||
@ccclass('<%Name%>')
|
||||
export class <%Name%> extends GameComponent {
|
||||
protected start() {
|
||||
|
||||
}
|
||||
}`;
|
||||
23
dist/template/Module.js
vendored
23
dist/template/Module.js
vendored
@@ -1,23 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateModule = void 0;
|
||||
exports.TemplateModule = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCEntity } from 'db://oops-framework/module/common/CCEntity';
|
||||
|
||||
/** <%Name%> 模块 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%> extends CCEntity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// <%Name%>Model!: <%Name%>ModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// <%Name%>Bll!: <%Name%>BllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// <%Name%>View!: <%Name%>ViewComp;
|
||||
|
||||
/** 初始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents();
|
||||
}
|
||||
}`;
|
||||
27
dist/template/ModuleBll.js
vendored
27
dist/template/ModuleBll.js
vendored
@@ -1,27 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateBll = void 0;
|
||||
exports.TemplateBll = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** 业务输入参数 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务逻辑处理对象 */
|
||||
@ecs.register('<%ModuleName%>')
|
||||
export class <%Name%>System extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(<%Name%>Comp);
|
||||
}
|
||||
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
// 注:自定义业务逻辑
|
||||
|
||||
e.remove(<%Name%>Comp);
|
||||
}
|
||||
}`;
|
||||
15
dist/template/ModuleModel.js
vendored
15
dist/template/ModuleModel.js
vendored
@@ -1,15 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateModel = void 0;
|
||||
exports.TemplateModel = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** 数据层对象 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
id: number = -1;
|
||||
|
||||
/** 数据层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
this.id = -1;
|
||||
}
|
||||
}`;
|
||||
19
dist/template/ModuleView.js
vendored
19
dist/template/ModuleView.js
vendored
@@ -1,19 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateView = void 0;
|
||||
exports.TemplateView = `import { _decorator } from "cc";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCView } from "db://oops-framework/module/common/CCView";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
export class <%Name%>Comp extends CCView<<%ModuleName%>> {
|
||||
|
||||
|
||||
reset() {
|
||||
|
||||
}
|
||||
}`;
|
||||
22
dist/template/ModuleViewVM.js
vendored
22
dist/template/ModuleViewVM.js
vendored
@@ -1,22 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.TemplateViewMvvm = void 0;
|
||||
exports.TemplateViewMvvm = `import { _decorator } from "cc";
|
||||
import { gui } from "db://oops-framework/core/gui/Gui";
|
||||
import { LayerType } from "db://oops-framework/core/gui/layer/LayerEnum";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCViewVM } from "db://oops-framework/module/common/CCViewVM";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 - 支持 MVVM 框架的数据绑定 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
@gui.register('<%Name%>', { layer: LayerType.UI, prefab: "界面预制路径" })
|
||||
export class <%Name%>Comp extends CCViewVM<<%ModuleName%>> {
|
||||
data: any = {};
|
||||
|
||||
reset() {
|
||||
|
||||
}
|
||||
}`;
|
||||
3
dist/tinypng.js
vendored
3
dist/tinypng.js
vendored
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.compress = void 0;
|
||||
exports.compress = compress;
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const https_1 = __importDefault(require("https"));
|
||||
const path_1 = __importDefault(require("path"));
|
||||
@@ -59,7 +59,6 @@ function compress(filePath) {
|
||||
});
|
||||
}
|
||||
}
|
||||
exports.compress = compress;
|
||||
function getRandomIP() {
|
||||
return Array.from(Array(4)).map(() => Math.floor(255 * Math.random())).join('.');
|
||||
}
|
||||
|
||||
152
dist/version.js
vendored
152
dist/version.js
vendored
@@ -1,152 +0,0 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.check = exports.checkUpdate = void 0;
|
||||
const PACKAGE_JSON = require('../package.json');
|
||||
/**
|
||||
* 检查更新
|
||||
* @param {boolean} logWhatever 无论有无更新都打印提示
|
||||
*/
|
||||
async function checkUpdate(logWhatever) {
|
||||
// 编辑器本次启动是否已经检查过了
|
||||
// if (!logWhatever && (Editor[PACKAGE_NAME] && Editor[PACKAGE_NAME].hasCheckUpdate)) {
|
||||
// return;
|
||||
// }
|
||||
// Editor[PACKAGE_NAME] = { hasCheckUpdate: true };
|
||||
// 是否有新版本
|
||||
const hasNewVersion = await check();
|
||||
// 打印到控制台
|
||||
// const { print, translate } = EditorMainUtil;
|
||||
const localVersion = getLocalVersion();
|
||||
if (hasNewVersion) {
|
||||
const remoteVersion = await getRemoteVersion();
|
||||
// print('info', translate('hasNewVersion'));
|
||||
// print('info', `${translate('localVersion')}${localVersion}`);
|
||||
// print('info', `${translate('latestVersion')}${remoteVersion}`);
|
||||
// print('info', translate('releases'));
|
||||
// print('info', translate('cocosStore'));
|
||||
}
|
||||
else if (logWhatever) {
|
||||
// print('info', translate('currentLatest'));
|
||||
// print('info', `${translate('localVersion')}${localVersion}`);
|
||||
}
|
||||
}
|
||||
exports.checkUpdate = checkUpdate;
|
||||
/**
|
||||
* 检查远端是否有新版本
|
||||
* @returns {Promise<boolean>}
|
||||
*/
|
||||
async function check() {
|
||||
// 远端版本号
|
||||
const remoteVersion = await getRemoteVersion();
|
||||
if (!remoteVersion) {
|
||||
return false;
|
||||
}
|
||||
// 本地版本号
|
||||
const localVersion = getLocalVersion();
|
||||
// 对比版本号
|
||||
const result = compareVersion(localVersion, remoteVersion);
|
||||
return (result < 0);
|
||||
}
|
||||
exports.check = check;
|
||||
/**
|
||||
* 获取远端版本号
|
||||
* @returns {Promise<string>}
|
||||
*/
|
||||
async function getRemoteVersion() {
|
||||
const json = await getRemotePackageJson();
|
||||
if (json && json.version) {
|
||||
return json.version;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
/**
|
||||
* 获取远端的 package.json
|
||||
* @returns {Promise<object>}
|
||||
*/
|
||||
async function getRemotePackageJson() {
|
||||
const packageJsonUrl = `${repository()}/raw/master/package.json`;
|
||||
// 发起网络请求
|
||||
const response = await fetch(packageJsonUrl, {
|
||||
method: 'GET',
|
||||
cache: 'no-cache',
|
||||
mode: 'no-cors',
|
||||
});
|
||||
// 请求结果
|
||||
if (response.status !== 200) {
|
||||
return null;
|
||||
}
|
||||
// 读取 json
|
||||
const json = response.json();
|
||||
return json;
|
||||
}
|
||||
/**
|
||||
* 获取本地版本号
|
||||
* @returns {string}
|
||||
*/
|
||||
function getLocalVersion() {
|
||||
return repository();
|
||||
}
|
||||
/**
|
||||
* 包名
|
||||
* @type {string}
|
||||
*/
|
||||
function name() {
|
||||
return PACKAGE_JSON.name;
|
||||
}
|
||||
/**
|
||||
* 版本
|
||||
* @type {string}
|
||||
*/
|
||||
function version() {
|
||||
return PACKAGE_JSON.version;
|
||||
}
|
||||
/**
|
||||
* 仓库地址
|
||||
* @type {string}
|
||||
*/
|
||||
function repository() {
|
||||
return PACKAGE_JSON.repository;
|
||||
}
|
||||
/**
|
||||
* 拆分版本号
|
||||
* @param {string | number} version 版本号文本
|
||||
* @returns {number[]}
|
||||
* @example
|
||||
* splitVersionString('1.2.0'); // [1, 2, 0]
|
||||
*/
|
||||
function splitVersionString(version) {
|
||||
if (typeof version === 'number') {
|
||||
return [version];
|
||||
}
|
||||
if (typeof version === 'string') {
|
||||
return (version.replace(/-/g, '.').split('.').map(v => (parseInt(v) || 0)));
|
||||
}
|
||||
return [0];
|
||||
}
|
||||
/**
|
||||
* 对比版本号
|
||||
* @param {string | number} a 版本 a
|
||||
* @param {string | number} b 版本 b
|
||||
* @returns {-1 | 0 | 1}
|
||||
* @example
|
||||
* compareVersion('1.0.0', '1.0.1'); // -1
|
||||
* compareVersion('1.1.0', '1.1.0'); // 0
|
||||
* compareVersion('1.2.1', '1.2.0'); // 1
|
||||
* compareVersion('1.2.0.1', '1.2.0'); // 1
|
||||
*/
|
||||
function compareVersion(a, b) {
|
||||
const acs = splitVersionString(a), bcs = splitVersionString(b);
|
||||
const count = Math.max(acs.length, bcs.length);
|
||||
for (let i = 0; i < count; i++) {
|
||||
const ac = acs[i], bc = bcs[i];
|
||||
// 前者缺少分量或前者小于后者
|
||||
if (ac == undefined || ac < bc) {
|
||||
return -1;
|
||||
}
|
||||
// 后者缺少分量或前者大于后者
|
||||
if (bc == undefined || ac > bc) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
579
package-lock.json
generated
579
package-lock.json
generated
@@ -1,579 +0,0 @@
|
||||
{
|
||||
"name": "oops-framework",
|
||||
"version": "2.0.0.20241118",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "oops-framework",
|
||||
"version": "2.0.0.20241118",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"axios": "^1.7.7",
|
||||
"fs-extra": "^10.0.0",
|
||||
"systeminformation": "^5.23.5",
|
||||
"vue": "^3.1.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cocos/creator-types": "^3.8.2",
|
||||
"@types/fs-extra": "^9.0.5",
|
||||
"@types/node": "^20.16.12",
|
||||
"typedoc": "^0.23.24",
|
||||
"typescript": "^4.8.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-string-parser": {
|
||||
"version": "7.25.7",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/helper-string-parser/-/helper-string-parser-7.25.7.tgz",
|
||||
"integrity": "sha512-CbkjYdsJNHFk8uqpEkpCvRs3YRp9tY6FmFY7wLMSYuGYkrdUi7r2lc4/wqsvlHoMznX3WJ9IP8giGPq68T/Y6g==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/helper-validator-identifier": {
|
||||
"version": "7.25.7",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/helper-validator-identifier/-/helper-validator-identifier-7.25.7.tgz",
|
||||
"integrity": "sha512-AM6TzwYqGChO45oiuPqwL2t20/HdMC1rTPAesnBCgPCSF1x3oN9MVUwQV2iyz4xqWrctwK5RNC8LV22kaQCNYg==",
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/parser": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/parser/-/parser-7.25.8.tgz",
|
||||
"integrity": "sha512-HcttkxzdPucv3nNFmfOOMfFf64KgdJVqm1KaCm25dPGMLElo9nsLvXeJECQg8UzPuBGLyTSA0ZzqCtDSzKTEoQ==",
|
||||
"dependencies": {
|
||||
"@babel/types": "^7.25.8"
|
||||
},
|
||||
"bin": {
|
||||
"parser": "bin/babel-parser.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@babel/types": {
|
||||
"version": "7.25.8",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@babel/types/-/types-7.25.8.tgz",
|
||||
"integrity": "sha512-JWtuCu8VQsMladxVz/P4HzHUGCAwpuqacmowgXFs5XjxIgKuNjnLokQzuVjlTvIzODaDmpjT3oxcC48vyk9EWg==",
|
||||
"dependencies": {
|
||||
"@babel/helper-string-parser": "^7.25.7",
|
||||
"@babel/helper-validator-identifier": "^7.25.7",
|
||||
"to-fast-properties": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.9.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@cocos/creator-types": {
|
||||
"version": "3.8.4",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@cocos/creator-types/-/creator-types-3.8.4.tgz",
|
||||
"integrity": "sha512-z+8qx726Zl/8rUUpbLjVAiNPn4XweRACEaY1vHeR3EHIcSQ9wtFlIFd2SZX5rOE8lt1S95nxv8OeLYXfbN4/2Q==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/@jridgewell/sourcemap-codec": {
|
||||
"version": "1.5.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.5.0.tgz",
|
||||
"integrity": "sha512-gv3ZRaISU3fjPAgNsriBRqGWQL6quFx04YMPW/zD8XMLsU32mhCCbfbO6KZFLjvYpCZ8zyDEgqsgf+PwPaM7GQ=="
|
||||
},
|
||||
"node_modules/@types/fs-extra": {
|
||||
"version": "9.0.13",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@types/fs-extra/-/fs-extra-9.0.13.tgz",
|
||||
"integrity": "sha512-nEnwB++1u5lVDM2UI4c1+5R+FYaKfaAzS4OococimjVm3nQw3TuzH5UNsocrcTBbhnerblyHj4A49qXbIiZdpA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"@types/node": "*"
|
||||
}
|
||||
},
|
||||
"node_modules/@types/node": {
|
||||
"version": "20.16.13",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@types/node/-/node-20.16.13.tgz",
|
||||
"integrity": "sha512-GjQ7im10B0labo8ZGXDGROUl9k0BNyDgzfGpb4g/cl+4yYDWVKcozANF4FGr4/p0O/rAkQClM6Wiwkije++1Tg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-core": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-core/-/compiler-core-3.5.12.tgz",
|
||||
"integrity": "sha512-ISyBTRMmMYagUxhcpyEH0hpXRd/KqDU4ymofPgl2XAkY9ZhQ+h0ovEZJIiPop13UmR/54oA2cgMDjgroRelaEw==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.25.3",
|
||||
"@vue/shared": "3.5.12",
|
||||
"entities": "^4.5.0",
|
||||
"estree-walker": "^2.0.2",
|
||||
"source-map-js": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-dom": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-dom/-/compiler-dom-3.5.12.tgz",
|
||||
"integrity": "sha512-9G6PbJ03uwxLHKQ3P42cMTi85lDRvGLB2rSGOiQqtXELat6uI4n8cNz9yjfVHRPIu+MsK6TE418Giruvgptckg==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-core": "3.5.12",
|
||||
"@vue/shared": "3.5.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-sfc": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-sfc/-/compiler-sfc-3.5.12.tgz",
|
||||
"integrity": "sha512-2k973OGo2JuAa5+ZlekuQJtitI5CgLMOwgl94BzMCsKZCX/xiqzJYzapl4opFogKHqwJk34vfsaKpfEhd1k5nw==",
|
||||
"dependencies": {
|
||||
"@babel/parser": "^7.25.3",
|
||||
"@vue/compiler-core": "3.5.12",
|
||||
"@vue/compiler-dom": "3.5.12",
|
||||
"@vue/compiler-ssr": "3.5.12",
|
||||
"@vue/shared": "3.5.12",
|
||||
"estree-walker": "^2.0.2",
|
||||
"magic-string": "^0.30.11",
|
||||
"postcss": "^8.4.47",
|
||||
"source-map-js": "^1.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/compiler-ssr": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/compiler-ssr/-/compiler-ssr-3.5.12.tgz",
|
||||
"integrity": "sha512-eLwc7v6bfGBSM7wZOGPmRavSWzNFF6+PdRhE+VFJhNCgHiF8AM7ccoqcv5kBXA2eWUfigD7byekvf/JsOfKvPA==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.12",
|
||||
"@vue/shared": "3.5.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/reactivity": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/reactivity/-/reactivity-3.5.12.tgz",
|
||||
"integrity": "sha512-UzaN3Da7xnJXdz4Okb/BGbAaomRHc3RdoWqTzlvd9+WBR5m3J39J1fGcHes7U3za0ruYn/iYy/a1euhMEHvTAg==",
|
||||
"dependencies": {
|
||||
"@vue/shared": "3.5.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-core": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/runtime-core/-/runtime-core-3.5.12.tgz",
|
||||
"integrity": "sha512-hrMUYV6tpocr3TL3Ad8DqxOdpDe4zuQY4HPY3X/VRh+L2myQO8MFXPAMarIOSGNu0bFAjh1yBkMPXZBqCk62Uw==",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.12",
|
||||
"@vue/shared": "3.5.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/runtime-dom": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/runtime-dom/-/runtime-dom-3.5.12.tgz",
|
||||
"integrity": "sha512-q8VFxR9A2MRfBr6/55Q3umyoN7ya836FzRXajPB6/Vvuv0zOPL+qltd9rIMzG/DbRLAIlREmnLsplEF/kotXKA==",
|
||||
"dependencies": {
|
||||
"@vue/reactivity": "3.5.12",
|
||||
"@vue/runtime-core": "3.5.12",
|
||||
"@vue/shared": "3.5.12",
|
||||
"csstype": "^3.1.3"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/server-renderer": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/server-renderer/-/server-renderer-3.5.12.tgz",
|
||||
"integrity": "sha512-I3QoeDDeEPZm8yR28JtY+rk880Oqmj43hreIBVTicisFTx/Dl7JpG72g/X7YF8hnQD3IFhkky5i2bPonwrTVPg==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-ssr": "3.5.12",
|
||||
"@vue/shared": "3.5.12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"vue": "3.5.12"
|
||||
}
|
||||
},
|
||||
"node_modules/@vue/shared": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/@vue/shared/-/shared-3.5.12.tgz",
|
||||
"integrity": "sha512-L2RPSAwUFbgZH20etwrXyVyCBu9OxRSi8T/38QsvnkJyvq2LufW2lDCOzm7t/U9C1mkhJGWYfCuFBCmIuNivrg=="
|
||||
},
|
||||
"node_modules/ansi-sequence-parser": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/ansi-sequence-parser/-/ansi-sequence-parser-1.1.1.tgz",
|
||||
"integrity": "sha512-vJXt3yiaUL4UU546s3rPXlsry/RnM730G1+HkpKE012AN0sx1eOrxSu95oKDIonskeLTijMgqWZ3uDEe3NFvyg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/asynckit": {
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/asynckit/-/asynckit-0.4.0.tgz",
|
||||
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "1.7.7",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/axios/-/axios-1.7.7.tgz",
|
||||
"integrity": "sha512-S4kL7XrjgBmvdGut0sN3yJxqYzrDOnivkBiN0OFs6hLiUam3UPvswUo0kqGyhqUZGEOytHyumEdXsAkgCOUf3Q==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.15.6",
|
||||
"form-data": "^4.0.0",
|
||||
"proxy-from-env": "^1.1.0"
|
||||
}
|
||||
},
|
||||
"node_modules/balanced-match": {
|
||||
"version": "1.0.2",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/balanced-match/-/balanced-match-1.0.2.tgz",
|
||||
"integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/brace-expansion": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/brace-expansion/-/brace-expansion-2.0.1.tgz",
|
||||
"integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"balanced-match": "^1.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/combined-stream": {
|
||||
"version": "1.0.8",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/combined-stream/-/combined-stream-1.0.8.tgz",
|
||||
"integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
|
||||
"dependencies": {
|
||||
"delayed-stream": "~1.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.8"
|
||||
}
|
||||
},
|
||||
"node_modules/csstype": {
|
||||
"version": "3.1.3",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/csstype/-/csstype-3.1.3.tgz",
|
||||
"integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw=="
|
||||
},
|
||||
"node_modules/delayed-stream": {
|
||||
"version": "1.0.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/delayed-stream/-/delayed-stream-1.0.0.tgz",
|
||||
"integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
|
||||
"engines": {
|
||||
"node": ">=0.4.0"
|
||||
}
|
||||
},
|
||||
"node_modules/entities": {
|
||||
"version": "4.5.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/entities/-/entities-4.5.0.tgz",
|
||||
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
|
||||
"engines": {
|
||||
"node": ">=0.12"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/fb55/entities?sponsor=1"
|
||||
}
|
||||
},
|
||||
"node_modules/estree-walker": {
|
||||
"version": "2.0.2",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/estree-walker/-/estree-walker-2.0.2.tgz",
|
||||
"integrity": "sha512-Rfkk/Mp/DL7JVje3u18FxFujQlTNR2q6QfMSMB7AvCBx91NGj/ba3kCfza0f6dVDbw7YlRf/nDrn7pQrCCyQ/w=="
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.15.9",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/follow-redirects/-/follow-redirects-1.15.9.tgz",
|
||||
"integrity": "sha512-gew4GsXizNgdoRyqmyfMHyAmXsZDk6mHkSxZFCzW9gwlbtOW44CDtYavM+y+72qD/Vq2l550kMF52DT8fOLJqQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "individual",
|
||||
"url": "https://github.com/sponsors/RubenVerborgh"
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=4.0"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"debug": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
},
|
||||
"node_modules/form-data": {
|
||||
"version": "4.0.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/form-data/-/form-data-4.0.1.tgz",
|
||||
"integrity": "sha512-tzN8e4TX8+kkxGPK8D5u0FNmjPUjw3lwC9lSLxxoB/+GtsJG91CO8bSWy73APlgAZzZbXEYZJuxjkHH2w+Ezhw==",
|
||||
"dependencies": {
|
||||
"asynckit": "^0.4.0",
|
||||
"combined-stream": "^1.0.8",
|
||||
"mime-types": "^2.1.12"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/fs-extra": {
|
||||
"version": "10.1.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/fs-extra/-/fs-extra-10.1.0.tgz",
|
||||
"integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==",
|
||||
"dependencies": {
|
||||
"graceful-fs": "^4.2.0",
|
||||
"jsonfile": "^6.0.1",
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=12"
|
||||
}
|
||||
},
|
||||
"node_modules/graceful-fs": {
|
||||
"version": "4.2.11",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/graceful-fs/-/graceful-fs-4.2.11.tgz",
|
||||
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
|
||||
},
|
||||
"node_modules/jsonc-parser": {
|
||||
"version": "3.3.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/jsonc-parser/-/jsonc-parser-3.3.1.tgz",
|
||||
"integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/jsonfile": {
|
||||
"version": "6.1.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/jsonfile/-/jsonfile-6.1.0.tgz",
|
||||
"integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==",
|
||||
"dependencies": {
|
||||
"universalify": "^2.0.0"
|
||||
},
|
||||
"optionalDependencies": {
|
||||
"graceful-fs": "^4.1.6"
|
||||
}
|
||||
},
|
||||
"node_modules/lunr": {
|
||||
"version": "2.3.9",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/lunr/-/lunr-2.3.9.tgz",
|
||||
"integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/magic-string": {
|
||||
"version": "0.30.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/magic-string/-/magic-string-0.30.12.tgz",
|
||||
"integrity": "sha512-Ea8I3sQMVXr8JhN4z+H/d8zwo+tYDgHE9+5G4Wnrwhs0gaK9fXTKx0Tw5Xwsd/bCPTTZNRAdpyzvoeORe9LYpw==",
|
||||
"dependencies": {
|
||||
"@jridgewell/sourcemap-codec": "^1.5.0"
|
||||
}
|
||||
},
|
||||
"node_modules/marked": {
|
||||
"version": "4.3.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/marked/-/marked-4.3.0.tgz",
|
||||
"integrity": "sha512-PRsaiG84bK+AMvxziE/lCFss8juXjNaWzVbN5tXAm4XjeaS9NAHhop+PjQxz2A9h8Q4M/xGmzP8vqNwy6JeK0A==",
|
||||
"dev": true,
|
||||
"bin": {
|
||||
"marked": "bin/marked.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 12"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-db": {
|
||||
"version": "1.52.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/mime-db/-/mime-db-1.52.0.tgz",
|
||||
"integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/mime-types": {
|
||||
"version": "2.1.35",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/mime-types/-/mime-types-2.1.35.tgz",
|
||||
"integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
|
||||
"dependencies": {
|
||||
"mime-db": "1.52.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 0.6"
|
||||
}
|
||||
},
|
||||
"node_modules/minimatch": {
|
||||
"version": "7.4.6",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/minimatch/-/minimatch-7.4.6.tgz",
|
||||
"integrity": "sha512-sBz8G/YjVniEz6lKPNpKxXwazJe4c19fEfV2GDMX6AjFz+MX9uDWIZW8XreVhkFW3fkIdTv/gxWr/Kks5FFAVw==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"brace-expansion": "^2.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/isaacs"
|
||||
}
|
||||
},
|
||||
"node_modules/nanoid": {
|
||||
"version": "3.3.7",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/nanoid/-/nanoid-3.3.7.tgz",
|
||||
"integrity": "sha512-eSRppjcPIatRIMC1U6UngP8XFcz8MQWGQdt1MTBQ7NaAmvXDfvNxbvWV3x2y6CdEUciCSsDHDQZbhYaB8QEo2g==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"bin": {
|
||||
"nanoid": "bin/nanoid.cjs"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1"
|
||||
}
|
||||
},
|
||||
"node_modules/picocolors": {
|
||||
"version": "1.1.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/picocolors/-/picocolors-1.1.1.tgz",
|
||||
"integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA=="
|
||||
},
|
||||
"node_modules/postcss": {
|
||||
"version": "8.4.47",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/postcss/-/postcss-8.4.47.tgz",
|
||||
"integrity": "sha512-56rxCq7G/XfB4EkXq9Egn5GCqugWvDFjafDOThIdMBsI15iqPqR5r15TfSr1YPYeEI19YeaXMCbY6u88Y76GLQ==",
|
||||
"funding": [
|
||||
{
|
||||
"type": "opencollective",
|
||||
"url": "https://opencollective.com/postcss/"
|
||||
},
|
||||
{
|
||||
"type": "tidelift",
|
||||
"url": "https://tidelift.com/funding/github/npm/postcss"
|
||||
},
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/ai"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"nanoid": "^3.3.7",
|
||||
"picocolors": "^1.1.0",
|
||||
"source-map-js": "^1.2.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/proxy-from-env": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
|
||||
"integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg=="
|
||||
},
|
||||
"node_modules/shiki": {
|
||||
"version": "0.14.7",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/shiki/-/shiki-0.14.7.tgz",
|
||||
"integrity": "sha512-dNPAPrxSc87ua2sKJ3H5dQ/6ZaY8RNnaAqK+t0eG7p0Soi2ydiqbGOTaZCqaYvA/uZYfS1LJnemt3Q+mSfcPCg==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"ansi-sequence-parser": "^1.1.0",
|
||||
"jsonc-parser": "^3.2.0",
|
||||
"vscode-oniguruma": "^1.7.0",
|
||||
"vscode-textmate": "^8.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/source-map-js": {
|
||||
"version": "1.2.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/source-map-js/-/source-map-js-1.2.1.tgz",
|
||||
"integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/systeminformation": {
|
||||
"version": "5.23.5",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/systeminformation/-/systeminformation-5.23.5.tgz",
|
||||
"integrity": "sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==",
|
||||
"os": [
|
||||
"darwin",
|
||||
"linux",
|
||||
"win32",
|
||||
"freebsd",
|
||||
"openbsd",
|
||||
"netbsd",
|
||||
"sunos",
|
||||
"android"
|
||||
],
|
||||
"bin": {
|
||||
"systeminformation": "lib/cli.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.0.0"
|
||||
},
|
||||
"funding": {
|
||||
"type": "Buy me a coffee",
|
||||
"url": "https://www.buymeacoffee.com/systeminfo"
|
||||
}
|
||||
},
|
||||
"node_modules/to-fast-properties": {
|
||||
"version": "2.0.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
|
||||
"integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=",
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
}
|
||||
},
|
||||
"node_modules/typedoc": {
|
||||
"version": "0.23.28",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/typedoc/-/typedoc-0.23.28.tgz",
|
||||
"integrity": "sha512-9x1+hZWTHEQcGoP7qFmlo4unUoVJLB0H/8vfO/7wqTnZxg4kPuji9y3uRzEu0ZKez63OJAUmiGhUrtukC6Uj3w==",
|
||||
"dev": true,
|
||||
"dependencies": {
|
||||
"lunr": "^2.3.9",
|
||||
"marked": "^4.2.12",
|
||||
"minimatch": "^7.1.3",
|
||||
"shiki": "^0.14.1"
|
||||
},
|
||||
"bin": {
|
||||
"typedoc": "bin/typedoc"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 14.14"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x"
|
||||
}
|
||||
},
|
||||
"node_modules/typescript": {
|
||||
"version": "4.9.5",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/typescript/-/typescript-4.9.5.tgz",
|
||||
"integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==",
|
||||
"devOptional": true,
|
||||
"bin": {
|
||||
"tsc": "bin/tsc",
|
||||
"tsserver": "bin/tsserver"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/undici-types": {
|
||||
"version": "6.19.8",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/undici-types/-/undici-types-6.19.8.tgz",
|
||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/universalify": {
|
||||
"version": "2.0.1",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/universalify/-/universalify-2.0.1.tgz",
|
||||
"integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==",
|
||||
"engines": {
|
||||
"node": ">= 10.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/vscode-oniguruma": {
|
||||
"version": "1.7.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/vscode-oniguruma/-/vscode-oniguruma-1.7.0.tgz",
|
||||
"integrity": "sha512-L9WMGRfrjOhgHSdOYgCt/yRMsXzLDJSL7BPrOZt73gU0iWO4mpqzqQzOz5srxqTvMBaR0XZTSrVWo4j55Rc6cA==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/vscode-textmate": {
|
||||
"version": "8.0.0",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/vscode-textmate/-/vscode-textmate-8.0.0.tgz",
|
||||
"integrity": "sha512-AFbieoL7a5LMqcnOF04ji+rpXadgOXnZsxQr//r83kLPr7biP7am3g9zbaZIaBGwBRWeSvoMD4mgPdX3e4NWBg==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/vue": {
|
||||
"version": "3.5.12",
|
||||
"resolved": "https://mirrors.cloud.tencent.com/npm/vue/-/vue-3.5.12.tgz",
|
||||
"integrity": "sha512-CLVZtXtn2ItBIi/zHZ0Sg1Xkb7+PU32bJJ8Bmy7ts3jxXTcbfsEfBivFYYWz1Hur+lalqGAh65Coin0r+HRUfg==",
|
||||
"dependencies": {
|
||||
"@vue/compiler-dom": "3.5.12",
|
||||
"@vue/compiler-sfc": "3.5.12",
|
||||
"@vue/runtime-dom": "3.5.12",
|
||||
"@vue/server-renderer": "3.5.12",
|
||||
"@vue/shared": "3.5.12"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"typescript": "*"
|
||||
},
|
||||
"peerDependenciesMeta": {
|
||||
"typescript": {
|
||||
"optional": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
22
package.json
22
package.json
@@ -14,19 +14,6 @@
|
||||
"doc": "npx typedoc",
|
||||
"update-report": "node tools/generate_update_report.js"
|
||||
},
|
||||
"panels": {
|
||||
"set_file_name": {
|
||||
"title": "i18n:oops-framework.panel_create_file",
|
||||
"type": "dockable",
|
||||
"main": "dist/default",
|
||||
"size": {
|
||||
"min-width": 450,
|
||||
"min-height": 300,
|
||||
"width": 450,
|
||||
"height": 300
|
||||
}
|
||||
}
|
||||
},
|
||||
"contributions": {
|
||||
"inspector": {
|
||||
"section": {
|
||||
@@ -35,9 +22,6 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
"scene": {
|
||||
"script": "./dist/scene.js"
|
||||
},
|
||||
"asset-db": {
|
||||
"mount": {
|
||||
"path": "./assets",
|
||||
@@ -150,14 +134,10 @@
|
||||
}
|
||||
},
|
||||
"dependencies": {
|
||||
"axios": "^1.7.7",
|
||||
"fs-extra": "^10.0.0",
|
||||
"systeminformation": "^5.23.5",
|
||||
"vue": "^3.1.4"
|
||||
"systeminformation": "^5.23.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@cocos/creator-types": "^3.8.2",
|
||||
"@types/fs-extra": "^9.0.5",
|
||||
"@types/node": "^20.16.12",
|
||||
"typedoc": "^0.23.24",
|
||||
"typescript": "^4.8.2"
|
||||
|
||||
@@ -7,50 +7,6 @@ export function onAssetMenu(assetInfo: AssetInfo) {
|
||||
{
|
||||
label: 'i18n:oops-framework.name',
|
||||
submenu: [
|
||||
{
|
||||
label: `i18n:oops-framework.script`,
|
||||
submenu: [
|
||||
{
|
||||
label: `i18n:oops-framework.createGameComponent`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "GameComponent");
|
||||
},
|
||||
},
|
||||
{
|
||||
type: `separator`,
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createModule`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Module");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createModel`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Model");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createBll`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "Bll");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createView`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "View");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.createViewMvvm`,
|
||||
click() {
|
||||
Editor.Panel.open("oops-framework.set_file_name", assetInfo.file, "ViewMvvm");
|
||||
},
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
label: `i18n:oops-framework.tools_asset_menu`,
|
||||
submenu: [
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { PackageUtil } from "./package-util";
|
||||
const axios = require('axios');
|
||||
import * as https from 'https';
|
||||
|
||||
/**
|
||||
* 检查更新
|
||||
@@ -7,32 +7,46 @@ const axios = require('axios');
|
||||
*/
|
||||
export function checkUpdate() {
|
||||
const packageJsonUrl = `${PackageUtil.repository}/raw/master/package.json`;
|
||||
axios.get(packageJsonUrl)
|
||||
.then(async (response: any) => {
|
||||
const json = response.data;
|
||||
|
||||
https.get(packageJsonUrl, (res) => {
|
||||
let data = '';
|
||||
|
||||
if (json && json.version) {
|
||||
const remoteVersion = json.version;
|
||||
// 本地版本号
|
||||
const localVersion = getLocalVersion();
|
||||
// 对比版本号
|
||||
const result = compareVersion(localVersion, remoteVersion);
|
||||
// 接收数据块
|
||||
res.on('data', (chunk) => {
|
||||
data += chunk;
|
||||
});
|
||||
|
||||
if (result < 0) {
|
||||
console.log('【Oops Framework】发现新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
console.log('【Oops Framework】最新版本:', remoteVersion);
|
||||
console.log('【Oops Framework】关闭 Cocos Creator 运行 update-oops-plugin-hot-update 可自动更新');
|
||||
}
|
||||
else {
|
||||
console.log('【Oops Framework】当前 Oops Framework 为最新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
// 数据接收完成
|
||||
res.on('end', () => {
|
||||
try {
|
||||
const json = JSON.parse(data);
|
||||
|
||||
if (json && json.version) {
|
||||
const remoteVersion = json.version;
|
||||
// 本地版本号
|
||||
const localVersion = getLocalVersion();
|
||||
// 对比版本号
|
||||
const result = compareVersion(localVersion, remoteVersion);
|
||||
|
||||
if (result < 0) {
|
||||
console.log('【Oops Framework】发现新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
console.log('【Oops Framework】最新版本:', remoteVersion);
|
||||
console.log('【Oops Framework】关闭 Cocos Creator 运行 update-oops-plugin-hot-update 可自动更新');
|
||||
}
|
||||
else {
|
||||
console.log('【Oops Framework】当前 Oops Framework 为最新版本');
|
||||
console.log('【Oops Framework】本地版本:', localVersion);
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
console.error("【Oops Framework】请检查你的网络是否正常,框架版本验证失败");
|
||||
catch (e) {
|
||||
console.error("【Oops Framework】解析版本信息失败");
|
||||
}
|
||||
});
|
||||
}).on('error', () => {
|
||||
console.error("【Oops Framework】请检查你的网络是否正常,框架版本验证失败");
|
||||
});
|
||||
}
|
||||
|
||||
export async function statistics() {
|
||||
@@ -52,13 +66,38 @@ export async function statistics() {
|
||||
|
||||
const si = require('systeminformation');
|
||||
const system = await si.system();
|
||||
const axios = require('axios');
|
||||
const api = `http://43.142.65.105:8866/ptl/Register`;
|
||||
const http = require('http');
|
||||
|
||||
const params = {
|
||||
username: system.uuid,
|
||||
ip: getLocalIp()
|
||||
};
|
||||
axios.post(api, params).then((response: any) => { }).catch(() => { });
|
||||
|
||||
const postData = JSON.stringify(params);
|
||||
|
||||
const options = {
|
||||
hostname: '43.142.65.105',
|
||||
port: 8866,
|
||||
path: '/ptl/Register',
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Content-Length': Buffer.byteLength(postData)
|
||||
}
|
||||
};
|
||||
|
||||
const req = http.request(options, (res: any) => {
|
||||
// 静默处理响应
|
||||
res.on('data', () => { });
|
||||
res.on('end', () => { });
|
||||
});
|
||||
|
||||
req.on('error', () => {
|
||||
// 静默处理错误
|
||||
});
|
||||
|
||||
req.write(postData);
|
||||
req.end();
|
||||
}
|
||||
|
||||
export async function reload() {
|
||||
|
||||
@@ -1,136 +0,0 @@
|
||||
import { existsSync } from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
/** 写入文件 */
|
||||
export function createView(directoryPath: string, fileName: string, content: string, moduleName: string, isEcsComp: boolean = true): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
// 创建脚本
|
||||
let className = fileName + "View";
|
||||
let scriptUrl = "";
|
||||
if (isEcsComp) {
|
||||
scriptUrl = path.join(directoryPath, fileName) + "ViewComp.ts";
|
||||
}
|
||||
else {
|
||||
scriptUrl = path.join(directoryPath, fileName) + "View.ts";
|
||||
}
|
||||
|
||||
if (!existsSync(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, className);
|
||||
content = content.replace(/<%ModuleName%>/g, moduleName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
|
||||
// 创建预制
|
||||
let prefabUrl = path.join(directoryPath, fileName) + ".prefab";
|
||||
if (!existsSync(prefabUrl)) {
|
||||
if (isEcsComp) className = className + "Comp";
|
||||
await Editor.Message.request('scene', 'execute-scene-script', {
|
||||
name: "oops-framework",
|
||||
method: 'createPrefab',
|
||||
args: [fileName, className, prefabUrl]
|
||||
});
|
||||
}
|
||||
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
|
||||
// 打开预制
|
||||
Editor.Message.request('asset-db', 'open-asset', prefabUrl);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
export function createScriptModule(directoryPath: string, fileName: string, content: string): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
// 创建目录
|
||||
let pathName = fileName.toLowerCase();
|
||||
let pathModule = path.join(directoryPath, pathName);
|
||||
if (!existsSync(pathModule)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', pathModule, null);
|
||||
}
|
||||
|
||||
let subPathView = path.join(pathModule, "view");
|
||||
if (!existsSync(subPathView)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathView, null);
|
||||
}
|
||||
|
||||
let subPathBll = path.join(pathModule, "bll");
|
||||
if (!existsSync(subPathBll)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathBll, null);
|
||||
}
|
||||
|
||||
let subPathModel = path.join(pathModule, "model");
|
||||
if (!existsSync(subPathModel)) {
|
||||
await Editor.Message.request('asset-db', 'create-asset', subPathModel, null);
|
||||
}
|
||||
|
||||
// 创建脚本
|
||||
let scriptUrl = path.join(pathModule, fileName) + ".ts";
|
||||
if (!existsSync(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建脚本 */
|
||||
export function createScriptBll(directoryPath: string, fileName: string, content: string, moduleName: string): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
let scriptUrl = path.join(directoryPath, fileName) + ".ts";
|
||||
|
||||
// 创建脚本
|
||||
if (!existsSync(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
content = content.replace(/<%ModuleName%>/g, moduleName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
|
||||
/** 创建业务层脚本 */
|
||||
export function createScript(directoryPath: string, fileName: string, content: string, isEcsComp: boolean = true): Promise<void> {
|
||||
return new Promise<void>(async (resolve, reject) => {
|
||||
let scriptUrl = "";
|
||||
if (isEcsComp) {
|
||||
scriptUrl = path.join(directoryPath, fileName) + "Comp.ts";
|
||||
}
|
||||
else {
|
||||
scriptUrl = path.join(directoryPath, fileName) + ".ts";
|
||||
}
|
||||
|
||||
// 创建脚本
|
||||
if (!existsSync(scriptUrl)) {
|
||||
content = content.replace(/<%Name%>/g, fileName);
|
||||
await Editor.Message.request('asset-db', 'create-asset', scriptUrl, content);
|
||||
}
|
||||
|
||||
// 闪烁提示新创建的脚本文件
|
||||
Editor.Message.send('assets', 'twinkle', scriptUrl);
|
||||
|
||||
// 打开脚本
|
||||
Editor.Message.request('asset-db', 'open-asset', scriptUrl);
|
||||
|
||||
resolve();
|
||||
});
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
import { readFileSync } from 'fs-extra';
|
||||
import { join } from 'path';
|
||||
import { App, createApp } from 'vue';
|
||||
import { createScript, createScriptBll, createScriptModule, createView } from '../create-script';
|
||||
import { TemplateGameComponent } from '../template/GameComponent';
|
||||
import { TemplateModule } from '../template/Module';
|
||||
import { TemplateBll } from '../template/ModuleBll';
|
||||
import { TemplateModel } from '../template/ModuleModel';
|
||||
import { TemplateView } from '../template/ModuleView';
|
||||
import { TemplateViewMvvm } from '../template/ModuleViewVM';
|
||||
|
||||
const panelDataMap = new WeakMap<any, App>();
|
||||
|
||||
module.exports = Editor.Panel.define({
|
||||
listeners: {
|
||||
show() { console.log('show'); },
|
||||
hide() { console.log('hide'); },
|
||||
},
|
||||
template: readFileSync(join(__dirname, '../../static/template/default/index.html'), 'utf-8'),
|
||||
style: readFileSync(join(__dirname, '../../static/style/default/index.css'), 'utf-8'),
|
||||
$: {
|
||||
app: '#app',
|
||||
},
|
||||
ready() {
|
||||
var args = arguments as any;
|
||||
let filename = "Default";
|
||||
let path = args[0];
|
||||
let type = args[1];
|
||||
let title = "???";
|
||||
let showModule = false;
|
||||
let moduleName = "ModuleName";
|
||||
|
||||
switch (type) {
|
||||
case "GameComponent":
|
||||
title = `i18n:oops-framework.createGameComponent`;
|
||||
break;
|
||||
case "Module":
|
||||
title = `i18n:oops-framework.createModule`;
|
||||
break;
|
||||
case "Model":
|
||||
title = `i18n:oops-framework.createModel`;
|
||||
break;
|
||||
case "Bll":
|
||||
title = `i18n:oops-framework.createBll`;
|
||||
showModule = true;
|
||||
break;
|
||||
case "View":
|
||||
title = `i18n:oops-framework.createView`;
|
||||
showModule = true;
|
||||
break;
|
||||
case "ViewMvvm":
|
||||
title = `i18n:oops-framework.createViewMvvm`;
|
||||
showModule = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// 创建框架配置界面
|
||||
if (this.$.app) {
|
||||
const app = createApp({});
|
||||
app.config.compilerOptions.isCustomElement = (tag) => tag.startsWith('ui-');
|
||||
app.component('MyConfig', {
|
||||
template: readFileSync(join(__dirname, '../../static/template/vue/set_file_name.html'), 'utf-8'),
|
||||
data() {
|
||||
return {
|
||||
title: title,
|
||||
filename: filename,
|
||||
showModule: showModule
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
// 记录输入的文件名
|
||||
onInputName(event: any) {
|
||||
filename = event.target.value;
|
||||
},
|
||||
onModuleName(event: any) {
|
||||
moduleName = event.target.value;
|
||||
},
|
||||
// 创建文件
|
||||
async onConfirm() {
|
||||
if (filename.trim().length == 0) {
|
||||
await Editor.Dialog.info('请输入文件名');
|
||||
return;
|
||||
}
|
||||
|
||||
switch (type) {
|
||||
case "GameComponent":
|
||||
await createView(path, filename, TemplateGameComponent, null!, false);
|
||||
break;
|
||||
case "Module":
|
||||
await createScriptModule(path, filename, TemplateModule);
|
||||
break;
|
||||
case "Model":
|
||||
await createScript(path, filename, TemplateModel);
|
||||
break;
|
||||
case "Bll":
|
||||
await createScriptBll(path, filename, TemplateBll, moduleName);
|
||||
break;
|
||||
case "View":
|
||||
await createView(path, filename, TemplateView, moduleName);
|
||||
break;
|
||||
case "ViewMvvm":
|
||||
await createView(path, filename, TemplateViewMvvm, moduleName);
|
||||
break;
|
||||
}
|
||||
close();
|
||||
}
|
||||
},
|
||||
});
|
||||
app.mount(this.$.app);
|
||||
panelDataMap.set(this, app);
|
||||
}
|
||||
},
|
||||
beforeClose() { },
|
||||
close() {
|
||||
const app = panelDataMap.get(this);
|
||||
if (app) {
|
||||
app.unmount();
|
||||
}
|
||||
},
|
||||
});
|
||||
@@ -19,7 +19,7 @@ export function unload() { }
|
||||
export var config: any;
|
||||
|
||||
/**
|
||||
* @en
|
||||
* @en
|
||||
* @zh 为扩展的主进程的注册方法
|
||||
*/
|
||||
export const methods: { [key: string]: (...any: any) => any } = {
|
||||
|
||||
37
src/scene.ts
37
src/scene.ts
@@ -1,37 +0,0 @@
|
||||
export function load() { }
|
||||
|
||||
export function unload() { }
|
||||
|
||||
// 在其他扩展脚本中,我们可以使用如下代码调用 rotateCamera 函数
|
||||
// const options: ExecuteSceneScriptMethodOptions = {
|
||||
// name: scene.ts 所在的扩展包名, 如: App,
|
||||
// method: scene.ts 中定义的方法, 如: createPrefab,
|
||||
// args: 参数,可选, 只传递json
|
||||
// };
|
||||
// const result = await Editor.Message.request('scene', 'execute-scene-script', options);
|
||||
export const methods = {
|
||||
/** 创建视图层制 */
|
||||
async createPrefab(fileName: string, className: string, prefabUrl: string) {
|
||||
const { Node, js, Layers, UITransform } = require('cc');
|
||||
const node = new Node(fileName);
|
||||
node.layer = Layers.Enum.UI_2D;
|
||||
node.addComponent(UITransform);
|
||||
|
||||
while (true) {
|
||||
const result = js.getClassByName(className);
|
||||
if (result) break;
|
||||
|
||||
await new Promise((next) => {
|
||||
setTimeout(next, 100);
|
||||
});
|
||||
}
|
||||
|
||||
const com = node.addComponent(className);
|
||||
com.resetInEditor && com.resetInEditor();
|
||||
|
||||
const info = cce.Prefab.generatePrefabDataFromNode(node) as any;
|
||||
node.destroy();
|
||||
|
||||
return Editor.Message.request('asset-db', 'create-asset', prefabUrl, info.prefabData || info);
|
||||
}
|
||||
};
|
||||
@@ -1,12 +0,0 @@
|
||||
export const TemplateGameComponent = `import { _decorator } from 'cc';
|
||||
import { GameComponent } from "db://oops-framework/module/common/GameComponent";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 显示对象控制 */
|
||||
@ccclass('<%Name%>')
|
||||
export class <%Name%> extends GameComponent {
|
||||
protected start() {
|
||||
|
||||
}
|
||||
}`;
|
||||
@@ -1,20 +0,0 @@
|
||||
export const TemplateModule = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCEntity } from 'db://oops-framework/module/common/CCEntity';
|
||||
|
||||
/** <%Name%> 模块 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%> extends CCEntity {
|
||||
/** ---------- 数据层 ---------- */
|
||||
// <%Name%>Model!: <%Name%>ModelComp;
|
||||
|
||||
/** ---------- 业务层 ---------- */
|
||||
// <%Name%>Bll!: <%Name%>BllComp;
|
||||
|
||||
/** ---------- 视图层 ---------- */
|
||||
// <%Name%>View!: <%Name%>ViewComp;
|
||||
|
||||
/** 初始添加的数据层组件 */
|
||||
protected init() {
|
||||
// this.addComponents();
|
||||
}
|
||||
}`;
|
||||
@@ -1,24 +0,0 @@
|
||||
export const TemplateBll = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** 业务输入参数 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
/** 业务层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
/** 业务逻辑处理对象 */
|
||||
@ecs.register('<%ModuleName%>')
|
||||
export class <%Name%>System extends ecs.ComblockSystem implements ecs.IEntityEnterSystem {
|
||||
filter(): ecs.IMatcher {
|
||||
return ecs.allOf(<%Name%>Comp);
|
||||
}
|
||||
|
||||
entityEnter(e: ecs.Entity): void {
|
||||
// 注:自定义业务逻辑
|
||||
|
||||
e.remove(<%Name%>Comp);
|
||||
}
|
||||
}`;
|
||||
@@ -1,12 +0,0 @@
|
||||
export const TemplateModel = `import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
|
||||
/** 数据层对象 */
|
||||
@ecs.register('<%Name%>')
|
||||
export class <%Name%>Comp extends ecs.Comp {
|
||||
id: number = -1;
|
||||
|
||||
/** 数据层组件移除时,重置所有数据为默认值 */
|
||||
reset() {
|
||||
this.id = -1;
|
||||
}
|
||||
}`;
|
||||
@@ -1,16 +0,0 @@
|
||||
export const TemplateView = `import { _decorator } from "cc";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCView } from "db://oops-framework/module/common/CCView";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
export class <%Name%>Comp extends CCView<<%ModuleName%>> {
|
||||
|
||||
|
||||
reset() {
|
||||
|
||||
}
|
||||
}`;
|
||||
@@ -1,19 +0,0 @@
|
||||
export const TemplateViewMvvm = `import { _decorator } from "cc";
|
||||
import { gui } from "db://oops-framework/core/gui/Gui";
|
||||
import { LayerType } from "db://oops-framework/core/gui/layer/LayerEnum";
|
||||
import { ecs } from "db://oops-framework/libs/ecs/ECS";
|
||||
import { CCViewVM } from "db://oops-framework/module/common/CCViewVM";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
/** 视图层对象 - 支持 MVVM 框架的数据绑定 */
|
||||
@ccclass('<%Name%>Comp')
|
||||
@ecs.register('<%Name%>', false)
|
||||
@gui.register('<%Name%>', { layer: LayerType.UI, prefab: "界面预制路径" })
|
||||
export class <%Name%>Comp extends CCViewVM<<%ModuleName%>> {
|
||||
data: any = {};
|
||||
|
||||
reset() {
|
||||
|
||||
}
|
||||
}`
|
||||
@@ -1,5 +0,0 @@
|
||||
<div>
|
||||
<div id="app">
|
||||
<my-config></my-config>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1,18 +0,0 @@
|
||||
<div id="r">
|
||||
<div class="f">
|
||||
<b><ui-label slot="label" :value="title"></ui-label></b><br>
|
||||
<div slot="content" class="c">
|
||||
<ui-label slot="label" style="width: 70px;">文件名:</ui-label>
|
||||
<ui-input autofocus @input="onInputName" :value="filename"></ui-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="f" v-if="showModule">
|
||||
<div slot="content" class="c">
|
||||
<ui-label slot="label" style="width: 70px;">模块名:</ui-label> <ui-input autofocus
|
||||
@input="onModuleName"></ui-input>
|
||||
</div>
|
||||
</div>
|
||||
<div class="b">
|
||||
<ui-button @confirm="onConfirm">确认</ui-button>
|
||||
</div>
|
||||
</div>
|
||||
@@ -3,9 +3,10 @@
|
||||
"target": "ES2017",
|
||||
"module": "CommonJS",
|
||||
"outDir": "./dist",
|
||||
"rootDir": "./",
|
||||
"rootDir": "./src",
|
||||
"strict": true,
|
||||
"strictNullChecks": false,
|
||||
"noImplicitAny": false,
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
@@ -15,7 +16,9 @@
|
||||
"isolatedModules": true,
|
||||
"baseUrl": "./",
|
||||
"paths": {
|
||||
"db://oops-framework/*": ["./assets/*"]
|
||||
"db://oops-framework/*": [
|
||||
"./assets/*"
|
||||
]
|
||||
},
|
||||
"types": [
|
||||
"../../temp/declarations/cc.custom-macro",
|
||||
@@ -25,7 +28,7 @@
|
||||
]
|
||||
},
|
||||
"include": [
|
||||
"assets/**/*",
|
||||
"@types/**/*",
|
||||
"src/**/*"
|
||||
],
|
||||
"exclude": [
|
||||
|
||||
1
tsconfig.tsbuildinfo
Normal file
1
tsconfig.tsbuildinfo
Normal file
@@ -0,0 +1 @@
|
||||
{"root":["./@types/editor.d.ts","./@types/electron.d.ts","./@types/extension.d.ts","./@types/index.d.ts","./@types/message.d.ts","./@types/packages/asset-db/@types/message.d.ts","./@types/packages/asset-db/@types/public.d.ts","./@types/packages/builder/@types/index.d.ts","./@types/packages/builder/@types/protect/asset-manager.d.ts","./@types/packages/builder/@types/protect/build-plugin.d.ts","./@types/packages/builder/@types/protect/build-result.d.ts","./@types/packages/builder/@types/protect/global.d.ts","./@types/packages/builder/@types/protect/import-map.d.ts","./@types/packages/builder/@types/protect/index.d.ts","./@types/packages/builder/@types/protect/options.d.ts","./@types/packages/builder/@types/public/build-plugin.d.ts","./@types/packages/builder/@types/public/build-result.d.ts","./@types/packages/builder/@types/public/global.d.ts","./@types/packages/builder/@types/public/index.d.ts","./@types/packages/builder/@types/public/message.d.ts","./@types/packages/builder/@types/public/options.d.ts","./@types/packages/builder/@types/public/texture-compress.d.ts","./@types/packages/console/@types/pritate.d.ts","./@types/packages/engine/@types/message.d.ts","./@types/packages/localization-editor/@types/globals.d.ts","./@types/packages/localization-editor/@types/index.d.ts","./@types/packages/localization-editor/@types/po.d.ts","./@types/packages/localization-editor/@types/gettext-parser/index.d.ts","./@types/packages/localization-editor/@types/intl/index.d.ts","./@types/packages/localization-editor/@types/runtime/l10n.d.ts","./@types/packages/localization-editor/@types/runtime/components/icu-component.d.ts","./@types/packages/localization-editor/@types/runtime/components/l10n-component.d.ts","./@types/packages/localization-editor/@types/runtime/components/l10n-label.d.ts","./@types/packages/localization-editor/@types/runtime/core/asset-manager-initer.d.ts","./@types/packages/localization-editor/@types/runtime/core/auto-config-intl-manager.d.ts","./@types/packages/localization-editor/@types/runtime/core/icu-options.d.ts","./@types/packages/localization-editor/@types/runtime/core/icu-type.d.ts","./@types/packages/localization-editor/@types/runtime/core/l10n-listen-event.d.ts","./@types/packages/localization-editor/@types/runtime/core/l10n-manager.d.ts","./@types/packages/localization-editor/@types/runtime/core/l10n-options.d.ts","./@types/packages/localization-editor/@types/runtime/core/localization-global.d.ts","./@types/packages/localization-editor/@types/runtime/core/resource-data-manager.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.datetimeformat.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.displaynames.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.listformat.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.locale.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.numberformat.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.pluralrules.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.relativetimeformat.d.ts","./@types/packages/localization-editor/@types/runtime/polyfills/intl.getcanonicallocales.d.ts","./@types/packages/preview/@types/index.d.ts","./@types/packages/preview/@types/protect/index.d.ts","./@types/packages/programming/@types/message.d.ts","./@types/packages/scene/@types/message.d.ts","./@types/packages/scene/@types/public.d.ts","./@types/packages/server/@types/package.d.ts","./@types/packages/shortcuts/@types/shortcut.d.ts","./src/asset-directory.ts","./src/assets-menu.ts","./src/main.ts","./src/tinypng.ts","./src/common/package-util.ts","./src/common/version.ts"],"version":"5.9.3"}
|
||||
Reference in New Issue
Block a user