feat(config-editor): scaffold extension manifest, build, i18n
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -20,7 +20,8 @@ native
|
||||
# WebStorm
|
||||
#//////////////////////////
|
||||
.idea/
|
||||
extensions/
|
||||
extensions/*
|
||||
!extensions/pixelhero-config-editor/
|
||||
extensions/oops-plugin-framework
|
||||
# === IDE and Editor ===
|
||||
.vs/
|
||||
|
||||
3
extensions/pixelhero-config-editor/.gitignore
vendored
Normal file
3
extensions/pixelhero-config-editor/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
node_modules/
|
||||
dist/
|
||||
*.bak
|
||||
26
extensions/pixelhero-config-editor/esbuild.config.mjs
Normal file
26
extensions/pixelhero-config-editor/esbuild.config.mjs
Normal 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 });
|
||||
}
|
||||
4
extensions/pixelhero-config-editor/i18n/en.js
Normal file
4
extensions/pixelhero-config-editor/i18n/en.js
Normal file
@@ -0,0 +1,4 @@
|
||||
exports.en = {
|
||||
'pixelhero-config-editor': { description: 'Hero/Skill Config Editor', title: 'Hero/Skill Config' },
|
||||
'menu': { 'panel/英雄技能配置': 'Hero/Skill Config' },
|
||||
};
|
||||
4
extensions/pixelhero-config-editor/i18n/zh.js
Normal file
4
extensions/pixelhero-config-editor/i18n/zh.js
Normal file
@@ -0,0 +1,4 @@
|
||||
exports.zh = {
|
||||
'pixelhero-config-editor': { description: '英雄/技能配置编辑器', title: '英雄/技能配置' },
|
||||
'menu': { 'panel/英雄技能配置': '英雄技能配置' },
|
||||
};
|
||||
1312
extensions/pixelhero-config-editor/package-lock.json
generated
Normal file
1312
extensions/pixelhero-config-editor/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
48
extensions/pixelhero-config-editor/package.json
Normal file
48
extensions/pixelhero-config-editor/package.json
Normal 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"
|
||||
}
|
||||
}
|
||||
15
extensions/pixelhero-config-editor/tsconfig.json
Normal file
15
extensions/pixelhero-config-editor/tsconfig.json
Normal 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__/**/*"]
|
||||
}
|
||||
Reference in New Issue
Block a user