Commit Graph

12 Commits

Author SHA1 Message Date
panFD
bfa434634c fix(config-editor): main entry exports methods object + load/unload (Cocos 3.8)
Root cause of 'Method does not exist / The methods of the module is undefined':
Cocos 3.8 expects handlers inside a 'methods' export (plus load/unload hooks),
not flat on module.exports. Handlers receive args directly (no event); return
value is the request reply. Verified vs official 3.8 first/messages docs.
Also: menu path + panel title switched to literal strings (i18n showed 'undefined').
2026-06-21 16:30:39 +08:00
panFD
24b5c49891 feat(config-editor): extension entry + minimal Vue panel proving end-to-end IPC
Task 12 of plan 2026-06-20-config-editor-foundation. Adds:
- src/main/index.ts: onLoad + message handlers (return value = request resolve,
  per Cocos 3.x verified IPC mechanism; fallback note left in plan)
- src/panels/default/{index,app}.ts: Editor.Panel.define host + Vue 3 minimal
  app (table switcher, key list, record JSON dump)
- static/template/default/index.html + static/style/default/index.css

Deviation from plan (necessary, flagged): esbuild.config.mjs now marks
node:fs/node:path as external for the panel entry (platform:'browser').
The plan's panel reads static template/style at runtime via Node fs, which
requires these builtins; Cocos panel runs in an Electron renderer that
provides them. Without this, esbuild errors with 'Could not resolve node:fs'.

Build verified: dist/main.js (9.5mb, typescript compiler API bundled) and
dist/panels/default.js (628kb, vue.esm-bundler bundled) both generate.
2026-06-21 09:56:02 +08:00
panFD
e3102c63ff feat(config-editor): main-process store (in-memory truth + message impls + asset-db refresh)
Task 11 of plan 2026-06-20-config-editor-foundation. Holds three TsConfigFile
instances (hero/skill/field), implements query*/validate/saveRecord/revertRecord
message handlers. saveRecord validates before persisting, rolls back on error,
and refreshes asset-db on success. HeroList read via regex.
2026-06-21 09:26:03 +08:00
panFD
6a81630f6f feat(config-editor): port buildSkillDesc to JS for panel preview 2026-06-21 09:17:50 +08:00
panFD
4a5659b7ec feat(config-editor): add validation rules (dup/required/enum/ref/overrides/herolist) with tests 2026-06-21 09:11:47 +08:00
panFD
4df88c1c90 feat(config-editor): TsConfigFile load/read/patch/add/delete/save (entry-level AST patch, .bak + syntax check)
26 IO tests green: serializer, parser (speed/enumRef/raw), TsConfigFile
round-trip (load/patch/add/delete/save preserving symbolic expressions).
2026-06-21 00:13:42 +08:00
panFD
0d28ad7a5e test(config-editor): add hero/skill fixtures mirroring real config shape 2026-06-21 00:07:00 +08:00
panFD
0a960b737c feat(config-editor): add AST parser (speed/enumRef/raw) with tests 2026-06-21 00:06:28 +08:00
panFD
7bb5f8bacc feat(config-editor): add RecordValue serializer with tests 2026-06-21 00:05:53 +08:00
panFD
c0755b3b8d feat(config-editor): add schema types and hero/skill/field table schemas 2026-06-20 23:52:27 +08:00
panFD
88c1a28c80 feat(config-editor): add RecordValue type and enum mirror 2026-06-20 23:46:54 +08:00
panFD
acb038a70a feat(config-editor): scaffold extension manifest, build, i18n 2026-06-20 23:46:15 +08:00