feat(config-editor): scaffold extension manifest, build, i18n

This commit is contained in:
panFD
2026-06-20 23:46:15 +08:00
parent 315a1a6af9
commit acb038a70a
8 changed files with 1414 additions and 1 deletions

View File

@@ -0,0 +1,3 @@
node_modules/
dist/
*.bak

View File

@@ -0,0 +1,26 @@
import { build, context } from 'esbuild';
import { readFileSync } from 'fs';
import { join } from 'path';
const watch = process.argv.includes('--watch');
const common = {
bundle: true,
sourcemap: false,
logLevel: 'info',
alias: { 'vue': 'vue/dist/vue.esm-bundler.js' },
};
const entries = [
{ entryPoints: ['src/main/index.ts'], outfile: 'dist/main.js', platform: 'node', format: 'cjs', external: [] },
{ entryPoints: ['src/panels/default/index.ts'], outfile: 'dist/panels/default.js', platform: 'browser', format: 'iife', external: [] },
];
if (watch) {
for (const e of entries) {
const ctx = await context({ ...common, ...e });
await ctx.watch();
}
} else {
for (const e of entries) await build({ ...common, ...e });
}

View File

@@ -0,0 +1,4 @@
exports.en = {
'pixelhero-config-editor': { description: 'Hero/Skill Config Editor', title: 'Hero/Skill Config' },
'menu': { 'panel/英雄技能配置': 'Hero/Skill Config' },
};

View File

@@ -0,0 +1,4 @@
exports.zh = {
'pixelhero-config-editor': { description: '英雄/技能配置编辑器', title: '英雄/技能配置' },
'menu': { 'panel/英雄技能配置': '英雄技能配置' },
};

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,48 @@
{
"package_version": 2,
"name": "pixelhero-config-editor",
"version": "0.1.0",
"description": "i18n:pixelhero-config-editor.description",
"main": "./dist/main.js",
"author": "pixelhero",
"editor": ">=3.8.0",
"scripts": {
"build": "node esbuild.config.mjs",
"watch": "node esbuild.config.mjs --watch",
"test": "tsx --test __tests__/*.test.ts"
},
"panels": {
"default": {
"title": "i18n:pixelhero-config-editor.title",
"type": "dockable",
"main": "./dist/panels/default.js",
"size": { "width": 960, "height": 640, "min-width": 640, "min-height": 480 }
}
},
"contributions": {
"menu": [
{ "path": "i18n:menu.panel/英雄技能配置", "message": "open-panel" }
],
"messages": {
"open-panel": { "methods": ["open-panel"] },
"query-schema": { "methods": ["query-schema"] },
"query-enums": { "methods": ["query-enums"] },
"query-keys": { "methods": ["query-keys"] },
"query-record": { "methods": ["query-record"] },
"query-preview-desc": { "methods": ["query-preview-desc"] },
"validate": { "methods": ["validate"] },
"save-record": { "methods": ["save-record"] },
"revert-record": { "methods": ["revert-record"] }
}
},
"dependencies": {
"typescript": "^5.4.0",
"vue": "^3.4.0"
},
"devDependencies": {
"@types/node": "^20.0.0",
"esbuild": "^0.20.0",
"fs-extra": "^11.0.0",
"tsx": "^4.7.0"
}
}

View File

@@ -0,0 +1,15 @@
{
"compilerOptions": {
"target": "ES2020",
"module": "CommonJS",
"moduleResolution": "node",
"strict": true,
"esModuleInterop": true,
"skipLibCheck": true,
"resolveJsonModule": true,
"experimentalDecorators": true,
"types": ["node"],
"lib": ["ES2020", "DOM"]
},
"include": ["src/**/*", "__tests__/**/*"]
}