@eevee-ta/cli 1.0.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +175 -9
  2. package/assets/skills/eevee-integration/SKILL.md +46 -0
  3. package/assets/skills/eevee-integration/agents/openai.yaml +3 -0
  4. package/assets/skills/eevee-integration/references/intake.md +87 -0
  5. package/assets/skills/eevee-integration/references/java-springboot.md +182 -0
  6. package/assets/skills/eevee-integration/references/umijs.md +210 -0
  7. package/assets/skills/eevee-mcp/SKILL.md +74 -5
  8. package/assets/skills/eevee-mcp/reference.md +48 -3
  9. package/dist/src/bin/cli.js +23 -7
  10. package/dist/src/bin/cli.js.map +1 -1
  11. package/dist/src/commands/business-command.js +174 -2
  12. package/dist/src/commands/business-command.js.map +1 -1
  13. package/dist/src/commands/i18n-command.js +194 -0
  14. package/dist/src/commands/i18n-command.js.map +1 -0
  15. package/dist/src/commands/skill-command.js +42 -26
  16. package/dist/src/commands/skill-command.js.map +1 -1
  17. package/dist/src/lib/business-catalog.js +50 -20
  18. package/dist/src/lib/business-catalog.js.map +1 -1
  19. package/dist/src/lib/i18n-exporter.js +402 -0
  20. package/dist/src/lib/i18n-exporter.js.map +1 -0
  21. package/dist/src/lib/i18n-scanner.js +1172 -0
  22. package/dist/src/lib/i18n-scanner.js.map +1 -0
  23. package/dist/src/lib/mcp-client.js +1 -1
  24. package/dist/src/lib/mcp-client.js.map +1 -1
  25. package/dist/src/lib/skill-installer.js +19 -10
  26. package/dist/src/lib/skill-installer.js.map +1 -1
  27. package/dist/src/lib/updater.js +4 -4
  28. package/dist/src/lib/updater.js.map +1 -1
  29. package/dist/src/lib/version.js +1 -1
  30. package/dist/src/lib/version.js.map +1 -1
  31. package/install.sh +3 -3
  32. package/package.json +2 -2
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
- # @eevee/cli
1
+ # @eevee-ta/cli
2
2
 
3
- `@eevee/cli` 是 eevee MCP 服务的业务化命令行客户端和 Agent Skill 管理工具。公开命令采用稳定 `<group> <action>` 规范;也可以继续使用完整 MCP 能力(tools/resources/prompts/request/notify)。CLI 可直接给 Codex、Claude Code 或其他终端 Agent 使用,也适合人工排查 eevee 数据。
3
+ `@eevee-ta/cli` 是 eevee MCP 服务的业务化命令行客户端和 Agent Skill 管理工具。公开命令采用稳定 `<group> <action>` 规范;也可以继续使用完整 MCP 能力(tools/resources/prompts/request/notify)。CLI 可直接给 Codex、Claude Code 或其他终端 Agent 使用,也适合人工排查 eevee 数据。
4
4
 
5
5
  运行时零依赖,只需要 Node.js 16+。
6
6
 
@@ -8,12 +8,12 @@
8
8
 
9
9
  ### 一键安装(推荐)
10
10
 
11
- 后续可将仓库中的 `install.sh` 上传到 OSS 后远程执行:
11
+ 使用 OSS 一键安装:
12
12
 
13
13
  ```bash
14
- curl -fsSL https://oss.example.com/eevee/install.sh | bash
14
+ curl -fsSL http://tga-doc.oss-accelerate-overseas.aliyuncs.com/eevee-dev/install.sh | bash
15
15
  # 或
16
- wget -qO- https://oss.example.com/eevee/install.sh | bash
16
+ wget -qO- http://tga-doc.oss-accelerate-overseas.aliyuncs.com/eevee-dev/install.sh | bash
17
17
  ```
18
18
 
19
19
  安装器会:
@@ -21,14 +21,14 @@ wget -qO- https://oss.example.com/eevee/install.sh | bash
21
21
  1. 检查 `curl/wget`、`tar`、系统架构和 musl/glibc 环境;
22
22
  2. 下载并安装新 CLI 前,先检查并删除旧平台 `tant-intl-agent-cli`,避免 `eevee` 命令冲突;
23
23
  3. Node.js 缺失或低于 16 时,从 npmmirror 下载用户级 Node.js 到 `~/.eevee/node`;
24
- 4. 使用用户级 npm 全局目录 `~/.eevee/npm`,从国内 npm 镜像安装 `@eevee/cli@latest`,并将两个目录写入 shell PATH;
24
+ 4. 使用用户级 npm 全局目录 `~/.eevee/npm`,从国内 npm 镜像安装 `@eevee-ta/cli@latest`,并将两个目录写入 shell PATH;
25
25
  5. 自动探测并复制 Skill 到已安装 Agent 的全局目录。
26
26
 
27
27
  可用环境变量定制:
28
28
 
29
29
  | 变量 | 默认值 |
30
30
  |---|---|
31
- | `EEVEE_PACKAGE_NAME` | `@eevee/cli` |
31
+ | `EEVEE_PACKAGE_NAME` | `@eevee-ta/cli` |
32
32
  | `EEVEE_NODE_VERSION` | `22.21.1` |
33
33
  | `EEVEE_NODE_MIRROR` | `https://npmmirror.com/mirrors/node` |
34
34
  | `EEVEE_NPM_REGISTRY` | `https://registry.npmmirror.com` |
@@ -49,7 +49,7 @@ npm link # 同时提供 eevee 和 eevee-cli 命令
49
49
  已发布后从 npm 安装:
50
50
 
51
51
  ```bash
52
- npm install -g @eevee/cli@latest
52
+ npm install -g @eevee-ta/cli@latest
53
53
  ```
54
54
 
55
55
  npm 包的 `postinstall` 也会自动执行 Skill 迁移;如果安装时使用 `--ignore-scripts`,可手动执行 `eevee skills update --auto --global --force`。
@@ -126,6 +126,7 @@ eevee config unset --token
126
126
  | `eevee <group> <action>` | 推荐:执行 project、version、term、translation 等约 50 个业务动作 |
127
127
  | `eevee business` / `eevee -h` | 查看全部业务命令;`-h` 会列全协议命令 |
128
128
  | `eevee <group> <action> --help` | 查看该动作的 path/query/body 参数和类型 |
129
+ | `eevee i18n scan` | 本地扫描 JS/TS/JSX/Vue 与 Java Spring Boot 项目中的硬编码词条 |
129
130
  | `eevee update` | 检查、交互确认并更新到 npm latest,同时迁移 Skill |
130
131
  | `eevee config show/set/get/unset/path` | 管理服务器地址和用户 token |
131
132
  | `eevee doctor` | 校验配置、MCP 连接、tools/list 和已装 Skill |
@@ -146,6 +147,154 @@ eevee --url https://staging.example.com/mcp \
146
147
  ping
147
148
  ```
148
149
 
150
+ ## 国际化扫描与导出
151
+
152
+ ### 服务端词条导出
153
+
154
+ 按项目 `intl.json` 的 `outPaths / projectIds / tags` 配置从 EEVEE 服务端导出词条:
155
+
156
+ ```bash
157
+ eevee i18n export # 默认写 path(开发目录)
158
+ eevee i18n export --target build # 写 buildPath(线上目录)
159
+ eevee i18n export --env online # --target build 的语义别名
160
+ eevee i18n export --dry-run --json
161
+ ```
162
+
163
+ 每次只写入一个目录:`dev/offline` 使用 `path`,`build/online` 使用 `buildPath`。旧配置中以 `/` 开头的输出路径按项目根内路径处理。
164
+
165
+ 导出配置支持:
166
+
167
+ ```json
168
+ {
169
+ "format": "json",
170
+ "groupByTag": true,
171
+ "clean": true,
172
+ "localeAliases": {
173
+ "zh-CN": "zh",
174
+ "en-US": "en"
175
+ },
176
+ "outPaths": [
177
+ {
178
+ "path": "/apps/gaia/public/intl/",
179
+ "buildPath": "/apps/gaia/public/intl/",
180
+ "projectIds": [
181
+ {
182
+ "projectId": 12,
183
+ "branchIds": [21, 22],
184
+ "tags": ["gaia"]
185
+ },
186
+ {
187
+ "projectId": 1,
188
+ "branchIds": [],
189
+ "tags": ["portal", "talos", null]
190
+ }
191
+ ]
192
+ }
193
+ ]
194
+ }
195
+ ```
196
+
197
+ 规则:
198
+
199
+ - `branchIds` 是 EEVEE 版本 ID 数组,`[]` 表示全部版本。数组内按配置顺序拉取,跨版本重复 key 由后配置版本覆盖;
200
+ - `tags: []` 表示全部词条;
201
+ - `tags: [null]` 表示无标签词条,也可以和普通标签混用;
202
+ - `format` 支持 `json`、`js`、`ts`、`property`、`properties`;`js/ts` 输出 ESM `export default`;
203
+ - `groupByTag: true` 输出 `语言-标签.格式`;`false` 输出 `语言.格式`;
204
+ - `localeAliases` 只影响输出文件名,例如 `zh-CN` 配置为 `zh` 后输出 `zh-web.json`;
205
+ - `clean: true` 时仅清理输出目录中符合当前语言命名规则的旧导出文件,再写入新文件;
206
+ - 项目和标签都按配置顺序处理;不按标签分组合并时,重复 key 由后配置的项目/标签覆盖;
207
+ - token 优先级为 `--token`、`EEVEE_TOKEN`、`intl.json` 的 `token`、本机 CLI 配置;`intl.json` 适合配置基础数据读取 token,个人 token 不建议提交到仓库。
208
+
209
+ `i18n scan` 迁移自 `@tant/eslint-plugin-eevee` 的核心检查能力,但不要求目标项目安装 ESLint 插件,也不需要 Node 项目改造:
210
+
211
+ ```bash
212
+ eevee i18n scan
213
+ eevee i18n scan /path/to/project
214
+ eevee i18n scan --json
215
+ eevee i18n scan --include 'src/main/java/**/*.java' --exclude '**/generated/**'
216
+ ```
217
+
218
+ CLI 会默认依次查找:
219
+
220
+ ```text
221
+ intl.json
222
+ .eevee/i18n.json
223
+ eevee.i18n.json
224
+ ```
225
+
226
+ 旧版 ESLint 插件配置中的 `outPaths`、`includes`、`excludes`、`excludeAscii`、`tagMatchMap`、`excludePropertys`、`execludeTrack` 均继续可用,同时支持更正后的 `excludeProperties` 和 `excludeTrack`:
227
+
228
+ ```json
229
+ {
230
+ "outPaths": [{ "path": "locales/" }],
231
+ "includes": ["src/**/*.{js,jsx,ts,tsx,vue}"],
232
+ "excludes": ["**/*.test.*"],
233
+ "excludeAscii": true,
234
+ "tagMatchMap": {
235
+ "src/pages/**": ["page"]
236
+ },
237
+ "excludeProperties": ["description"],
238
+ "excludeTrack": true
239
+ }
240
+ ```
241
+
242
+ 检查规则:
243
+
244
+ - 扫描 JavaScript / TypeScript 字符串、模板字符串、JSX / Vue 文案;
245
+ - `formatMessage(...)` 内的词条会按 `zh-CN-<tag>.*` 词条文件检查「未登记」和「标签不匹配」;
246
+ - 词条文件支持 JSON、`export default {}` / `module.exports = {}` 常见形态和 Spring properties;JS 词条只做静态解析,不执行项目代码;
247
+ - 默认跳过纯 ASCII、导入导出字符串、对象属性 key、指定属性和埋点调用;
248
+ - 默认跳过测试、Mock、Fixture 和构建生成文件;
249
+ - 默认跳过模板字符串插值里的已国际化表达式;
250
+ - TSX 中 `INTL.操作` 这类成员表达式不视为 JSX 文案;
251
+ - 支持禁用注释:
252
+ - `// eevee-i18n-disable-next-line`
253
+ - `// eevee-i18n-disable`
254
+ - `// eevee-i18n-disable-file`
255
+ - 默认与旧插件一致跳过普通函数调用的直接字符串参数,需要更严格检查时可加 `--check-call-arguments`。
256
+
257
+ ### Java Spring Boot 兼容
258
+
259
+ CLI 不依赖 ESLint 解析 Java,因此可以直接在 Maven / Gradle 多模块 Spring Boot 仓库执行:
260
+
261
+ ```bash
262
+ cd /path/to/spring-boot-service
263
+ eevee i18n scan
264
+ ```
265
+
266
+ 默认包含:
267
+
268
+ ```text
269
+ **/src/main/java/**/*.java
270
+ **/src/main/resources/templates/**/*.{html,htm,jsp,jspf,tag,ftl,vm}
271
+ ```
272
+
273
+ Java 支持包括:
274
+
275
+ - 普通字符串和 Java 17 文本块;
276
+ - 跳过 Java 注释;
277
+ - 默认跳过注解中的中文说明,可用 `--check-annotations` 打开;
278
+ - 识别 `MessageSource#getMessage` 使用 message key 的常规写法;
279
+ - 支持 Thymeleaf / JSP / Freemarker / Velocity 模板文本和 UI 属性;
280
+ - 跳过 `#{...}`、`${...}`、`<spring:message>`、`<fmt:message>` 等已国际化表达式;
281
+ - 词条输出目录支持 `messages*_zh*_CN*.properties`。
282
+
283
+ 示例配置:
284
+
285
+ ```json
286
+ {
287
+ "outPaths": ["src/main/resources/messages/"],
288
+ "includes": [
289
+ "**/src/main/java/**/*.java",
290
+ "**/src/main/resources/templates/**/*.{html,jsp}"
291
+ ],
292
+ "excludes": ["**/generated/**"]
293
+ }
294
+ ```
295
+
296
+ 扫描发现问题会输出文件、行列、规则和词条;CI 中可直接使用非 0 退出码阻断流水线,`--no-fail` 可保留展示但不阻断。
297
+
149
298
  ## Business command layer
150
299
 
151
300
  Business commands 是主要接口,命名规范固定为 `<group> <action>`。它把底层 `call_api_operation` 封装成语义稳定、参数有类型的命令,不需要手工查找 `operation_id`:
@@ -158,10 +307,22 @@ eevee business
158
307
  eevee project list
159
308
  eevee project create --name Demo --locales zh-CN,en-US
160
309
  eevee project detail 12
310
+ eevee version copy 12 34 --name 'Release 1.1' --description '复制版本资产'
311
+ eevee term check-version-conflicts 12 --term-ids 56,57 --version-id 34
312
+ eevee term move-version 12 --term-ids 56,57 --version-id 34
161
313
  eevee translation set-content --id 12 --term-id 34 --locale zh-CN --content 你好
162
314
  eevee project delete 12 --yes
163
315
  ```
164
316
 
317
+ `term move-version` 会先调用冲突预检。交互终端会提示「全部忽略 / 全部覆盖 / 逐项选择」;
318
+ 非交互调用保持旧接口兼容语义,默认忽略冲突项,仅迁移无冲突词条。也可以显式指定:
319
+
320
+ ```bash
321
+ eevee term move-version 12 --term-ids 56,57 --version-id 34 --conflict-strategy overwrite
322
+ eevee term move-version 12 --term-ids 56,57 --version-id 34 \
323
+ --conflict-decisions '{"56":"ignore","57":"overwrite"}'
324
+ ```
325
+
165
326
  支持的域包括:project/version/term/translation/tag-group/tag/permission/log/profile/config/user。完整矩阵直接在 `eevee -h` 中列出。每个动作的完整 flag、位置说明、类型和必填状态用 `--help` 查看:
166
327
 
167
328
  ```bash
@@ -315,12 +476,16 @@ eevee notify notifications/cancelled '{"requestId":"<id>","reason":"user cancell
315
476
 
316
477
  ## Agent Skill 快速安装
317
478
 
318
- 仓库中已经内置 `assets/skills/eevee-mcp/SKILL.md` 和 `reference.md`。
479
+ 仓库内置两个 Agent Skill:
480
+
481
+ - `eevee-mcp`:业务数据操作与 MCP 能力。
482
+ - `eevee-integration`:把 EEVEE 词条导出和代码扫描接入 Java Spring Boot 或 UmiJS 项目;包含项目/版本 ID 询问清单、目录纳入/屏蔽策略、提交钩子和误报处理。
319
483
 
320
484
  默认自动探测已安装的 Codex、Claude Code、Cursor 和 OpenCode,并复制到对应客户端的全局目录:
321
485
 
322
486
  ```bash
323
487
  eevee skills install
488
+ eevee skills install --skill eevee-integration
324
489
  eevee skills agents # 查看探测结果
325
490
  ```
326
491
 
@@ -340,6 +505,7 @@ eevee skills install codex
340
505
  eevee skills install claudecode
341
506
  eevee skills install universal
342
507
  eevee skills install --all
508
+ eevee skills install --skill eevee-integration codex,claude
343
509
  ```
344
510
 
345
511
  复制到某个项目的 Claude/Codex 目录:
@@ -0,0 +1,46 @@
1
+ ---
2
+ name: eevee-integration
3
+ description: Integrate @eevee-ta/cli term export and i18n scanning into Java Spring Boot or UmiJS/Umi Max repositories, including intl.json, scripts, Git hooks, project/version IDs, and include/exclude scope. Not for routine eevee data operations; use eevee-mcp for those.
4
+ metadata:
5
+ short-description: Configure EEVEE CLI for Java or UmiJS repositories
6
+ ---
7
+
8
+ # EEVEE Project Integration
9
+
10
+ Use this skill when adding or changing EEVEE CLI integration in a application repository. Produce a reproducible configuration, project-specific scripts or npm scripts, documentation, and a commit-time check. Do not merely leave instructions in chat.
11
+
12
+ ## Mandatory intake
13
+
14
+ Before writing or changing configuration, inspect the repository and ask the user for decisions that cannot be inferred. In particular, ask for all of the following that are not already authoritative in the repository:
15
+
16
+ 1. EEVEE server URL and token policy.
17
+ 2. Platform project ID(s). Never guess them.
18
+ 3. Version ID list. Clarify whether all versions are wanted (`branchIds: []`) or only selected IDs.
19
+ 4. Tag policy: all terms, selected tags, or `[null]` for untagged terms; whether output must be split by tag.
20
+ 5. Output directories for development and build artifacts, output format, and language filename aliases.
21
+ 6. Source-directory policy: which directories must be scanned, which are generated/test/mock/vendor and must be excluded, and how legacy debt should be handled.
22
+ 7. Commit-gate scope: staged files only or full repository.
23
+
24
+ Use `references/intake.md` for the exact question set and decision rules. If the user supplies only some values, state the reasonable defaults you will use and ask only for decisions that materially change behavior.
25
+
26
+ ## Implementation route
27
+
28
+ 1. Inspect the existing build system, source layout, locale resources, lint scripts, and Git hooks.
29
+ 2. Read the mode-specific reference:
30
+ - Java 11 / Spring Boot / Maven or Gradle: `references/java-springboot.md`
31
+ - UmiJS / Umi Max / React front end: `references/umijs.md`
32
+ 3. Add `intl.json` at the repository root unless an existing configuration is authoritative.
33
+ 4. Add a small wrapper script or npm script rather than requiring people to remember long CLI invocations.
34
+ 5. Add a commit-time check for staged source files when the user wants commit gating.
35
+ 6. Document the configuration, commands, exclusions, suppression comments, and known legacy debt in the repository.
36
+ 7. Run dry-run export, real export where authorized, scanning, syntax/build checks, and the commit gate. Record actual commands and results.
37
+
38
+ ## Non-negotiable constraints
39
+
40
+ - Do not guess project IDs, version IDs, tags, or output paths.
41
+ - Do not commit personal tokens or machine-specific Maven settings. A basic read-only token may be committed only when the user explicitly says it is safe.
42
+ - Prefer narrow, explainable exclusions and inline suppression comments over a long file-by-file baseline.
43
+ - Do not silently overwrite locale resources. Confirm whether the EEVEE project is the source of truth and whether cleanup is enabled.
44
+ - Preserve unrelated user modifications and do not reset a dirty worktree.
45
+ - Keep full scans informational when there is known legacy debt; make the commit gate scan only staged files unless the user explicitly requires a full blocking scan.
46
+ - When a repository uploads terms to EEVEE, include source metadata: `description` (usage location), `params` for placeholders, and `source_info` (`repo`/`branch`/`path`/`line` — all four together or omitted). Refresh existing translations with `translation set-content`; `term update` ignores `--translations`.
@@ -0,0 +1,3 @@
1
+ interface:
2
+ display_name: "EEVEE Integration"
3
+ short_description: "Configure EEVEE CLI for Java or UmiJS repositories"
@@ -0,0 +1,87 @@
1
+ # EEVEE Integration Intake
2
+
3
+ Use these questions before changing `intl.json`, wrapper scripts, or hooks. The goal is to make platform metadata and repository scope explicit rather than inferred.
4
+
5
+ ## Required platform questions
6
+
7
+ Ask these unless the repository already contains authoritative answers:
8
+
9
+ ```text
10
+ 1. EEVEE MCP 地址是什么?token 是基础读取 token 还是个人 token?是否允许写入仓库?
11
+ 2. 使用哪个 EEVEE 项目 ID?多个项目需要合并导出吗?
12
+ 3. 每个项目使用哪些版本 ID?是全部版本(branchIds: [])还是指定 ID 列表?
13
+ 4. 词条按什么规则筛选?
14
+ - tags: [] 表示全部
15
+ - tags: [null] 表示无标签
16
+ - tags: ["web", null] 表示指定标签加无标签
17
+ 5. 输出是否按标签拆分?
18
+ - groupByTag: true -> zh-CN-web.json
19
+ - groupByTag: false -> zh-CN.json
20
+ 6. 输出格式是什么:json、js、ts、property、properties?
21
+ 7. 每种语言输出文件名是否需要别名?
22
+ 例:zh-CN -> zh,或 zh-CN -> messages_zh_CN
23
+ 8. 开发目录 path 和构建目录 buildPath 分别是什么?每次导出只写其中一个,默认写哪个?
24
+ ```
25
+
26
+ If the user knows the project but not IDs, offer discovery commands rather than guessing:
27
+
28
+ ```bash
29
+ eevee project list --json
30
+ eevee version list <project-id> --json
31
+ eevee tag-group list <project-id> --json
32
+ ```
33
+
34
+ `branchIds` is a required array in current CLI versions. Do not use legacy singular `branch` values.
35
+
36
+ ## Required repository-scope questions
37
+
38
+ Ask these after inspecting the repository:
39
+
40
+ ```text
41
+ 1. 哪些源码目录包含用户可见文案,必须纳入扫描?
42
+ 2. 哪些目录是生成代码、测试、Mock、Fixture、文档示例、vendor 或构建产物,应该屏蔽?
43
+ 3. 存量未国际化文案是立即全量修复、全量阻断、还是先只阻断本次变更文件?
44
+ 4. 是否存在组件内部按词条 key 翻译的列配置或动态字典,需要用注释豁免?
45
+ 5. locale 资源目录是否只允许 EEVEE 导出,还是还保存手工文件?
46
+ ```
47
+
48
+ ### Include policy
49
+
50
+ Start narrow and expand only with evidence:
51
+
52
+ - Java: usually `**/src/main/java/**/*.java`; include template resources only when the project has server-rendered templates.
53
+ - UmiJS: usually source directories such as `src/**/*.{ts,tsx,js,jsx}` or application-specific `apps/<app>/src/**`.
54
+ - Scan real source directories, not an entire repository by default.
55
+ - Always let CLI defaults exclude dependencies, build outputs, generated Umi directories, minified files, tests, mocks, and fixtures unless the user explicitly requires otherwise.
56
+
57
+ ### Exclude and suppression policy
58
+
59
+ Prefer this order:
60
+
61
+ 1. Correct the code by moving user-visible text to the project's i18n mechanism.
62
+ 2. Use an inline comment for a semantic false positive:
63
+ ```ts
64
+ title: '操作', // eevee-i18n-disable:组件内部按 key 翻译
65
+ ```
66
+ 3. Use a next-line comment for declarations or dynamic dictionary keys:
67
+ ```ts
68
+ // eevee-i18n-disable-next-line:动态拼接词条字典 key
69
+ const title = REPO_INTL[`${isEdit ? '编辑' : '新建'}表`];
70
+ ```
71
+ 4. Use file-level suppression only when the entire file is a term-key map, internal mapping, Mock, or generated equivalent:
72
+ ```java
73
+ // eevee-i18n-disable-file:本文件只维护词条 key
74
+ ```
75
+ 5. Add a directory or glob to `excludes` only for generated/test/mock/vendor content or an explicitly approved legacy-debt boundary.
76
+ 6. Do not maintain an unexplained list of hundreds of source files. If full scanning has legacy debt, keep it informational with `--no-fail` and gate only staged files.
77
+
78
+ ## Output and gate decisions
79
+
80
+ Confirm these before writing files:
81
+
82
+ - Is EEVEE the source of truth? A real export can remove keys that exist locally but are absent in the selected EEVEE project/version/tag set.
83
+ - Is `clean` enabled? Cleanup deletes old generated language-prefix files; hand-written files in the output directory need another location or a non-language prefix.
84
+ - Should the commit hook scan only staged files? This is normally preferred for repositories with legacy debt.
85
+ - Which existing build checks must accompany the EEVEE check?
86
+
87
+ Record the user's answers and the resulting defaults in project documentation before implementation.
@@ -0,0 +1,182 @@
1
+ # Java Spring Boot Integration
2
+
3
+ Use this reference for Java 11+ Spring Boot Maven or Gradle repositories.
4
+
5
+ ## Inspect first
6
+
7
+ Determine:
8
+
9
+ - Maven or Gradle multi-module layout.
10
+ - JDK version and Maven version.
11
+ - Spring MessageSource basename, normally in `application*.yml`.
12
+ - Existing resource path, such as:
13
+ ```yaml
14
+ spring:
15
+ messages:
16
+ basename: static/i18n/messages
17
+ ```
18
+ - Existing resource naming:
19
+ ```text
20
+ messages_zh_CN.properties
21
+ messages_en_US.properties
22
+ messages_ja_JP.properties
23
+ messages_ko_KR.properties
24
+ ```
25
+ - Existing wrapper scripts, Git hooks, and build validation commands.
26
+
27
+ ## `intl.json` shape
28
+
29
+ A typical all-version, no-tag Java configuration is:
30
+
31
+ ```json
32
+ {
33
+ "url": "https://eevee.example.com/mcp",
34
+ "token": "<basic-read-token-if-approved>",
35
+ "includes": ["**/src/main/java/**/*.java"],
36
+ "excludeAscii": true,
37
+ "excludeTrack": true,
38
+ "format": "properties",
39
+ "groupByTag": false,
40
+ "clean": false,
41
+ "localeAliases": {
42
+ "zh-CN": "messages_zh_CN",
43
+ "en-US": "messages_en_US",
44
+ "ja-JP": "messages_ja_JP",
45
+ "ko-KR": "messages_ko_KR"
46
+ },
47
+ "outPaths": [
48
+ {
49
+ "path": "/src/main/resources/static/i18n/",
50
+ "buildPath": "/target/classes/static/i18n/",
51
+ "projectIds": [
52
+ {
53
+ "projectId": 3,
54
+ "branchIds": []
55
+ }
56
+ ]
57
+ }
58
+ ]
59
+ }
60
+ ```
61
+
62
+ Adjust only after confirming IDs and output expectations with the user. A leading `/` in `path` or `buildPath` is repository-relative, not an absolute filesystem path.
63
+
64
+ ## Wrapper script
65
+
66
+ Prefer `scripts/eevee-i18n.sh` with actions such as:
67
+
68
+ ```bash
69
+ scripts/eevee-i18n.sh export --dry-run
70
+ scripts/eevee-i18n.sh export
71
+ scripts/eevee-i18n.sh export --target build
72
+ scripts/eevee-i18n.sh scan --no-fail
73
+ scripts/eevee-i18n.sh scan-changed
74
+ scripts/eevee-i18n.sh check
75
+ ```
76
+
77
+ `check` normally performs:
78
+
79
+ 1. `git diff --check`
80
+ 2. EEVEE export dry-run
81
+ 3. Full EEVEE scan with `--no-fail` for legacy visibility
82
+ 4. Blocking scan of staged Java files
83
+ 5. Maven `validate`
84
+
85
+ Use `EEVEE_CLI`, `MVN_CMD`, and `MAVEN_LOCAL_REPO` overrides for developer environments.
86
+
87
+ ## Commit hook
88
+
89
+ Use `.githooks/pre-commit` and configure:
90
+
91
+ ```bash
92
+ git config core.hooksPath .githooks
93
+ ```
94
+
95
+ Hook behavior:
96
+
97
+ ```bash
98
+ #!/usr/bin/env bash
99
+ set -euo pipefail
100
+ ROOT="$(git rev-parse --show-toplevel)"
101
+ "$ROOT/scripts/eevee-i18n.sh" scan-changed
102
+ ```
103
+
104
+ `scan-changed` must collect only:
105
+
106
+ ```bash
107
+ git diff --name-only --cached --diff-filter=ACMR | grep -E '\.java$'
108
+ ```
109
+
110
+ Skip cleanly when there are no staged Java files. This prevents thousands of legacy findings from blocking every commit while still checking files changed by the current work.
111
+
112
+ ## Java suppression comments
113
+
114
+ The scanner understands real Java comments, including block comments:
115
+
116
+ ```java
117
+ // eevee-i18n-disable-next-line:组件内部按 key 翻译
118
+ private String title = "操作";
119
+ ```
120
+
121
+ ```java
122
+ private String title = "操作"; // eevee-i18n-disable:内部枚举显示名
123
+ ```
124
+
125
+ ```java
126
+ // eevee-i18n-disable-file:本文件只维护后端返回类型标识
127
+ ```
128
+
129
+ Do not put the directive inside a string; it must be an actual comment.
130
+
131
+ ## Validation
132
+
133
+ Run in this order:
134
+
135
+ 1. `scripts/eevee-i18n.sh export --dry-run`
136
+ 2. Real export only after the user confirms EEVEE is the source of truth
137
+ 3. Properties consistency:
138
+ - same key set in every locale
139
+ - no duplicate keys
140
+ - expected key count
141
+ - placeholder parity where applicable
142
+ 4. `scripts/eevee-i18n.sh scan --no-fail`
143
+ 5. Positive and negative commit-hook tests:
144
+ - no staged Java file exits 0
145
+ - a staged temporary Java file with hardcoded user-visible Chinese exits non-zero
146
+ 6. Maven validation, usually:
147
+ ```bash
148
+ mvn -s settings.xml -Dmaven.repo.local="$HOME/.m2/repository" validate
149
+ ```
150
+
151
+ On a clean repository, some Maven `banCircularDependencies` configurations resolve reactor siblings from the local repository. If validate fails with missing sibling artifacts, bootstrap once with the project's known-compatible Maven version:
152
+
153
+ ```bash
154
+ mvn -s settings.xml \
155
+ -Dmaven.repo.local="$HOME/.m2/repository" \
156
+ -DskipTests install
157
+ ```
158
+
159
+ Then rerun validate. Keep machine-specific credentials and repository paths out of committed settings.
160
+
161
+ ## Documentation to leave in the repository
162
+
163
+ Record:
164
+
165
+ - EEVEE project and version policy
166
+ - whether tags are used
167
+ - output paths and format
168
+ - full command list
169
+ - commit-hook scope
170
+ - known legacy-debt count and policy
171
+ - all non-obvious directory exclusions and suppression examples
172
+
173
+
174
+ ## Term upload requirements (source metadata)
175
+
176
+ When backfilling terms extracted from Java sources or resource bundles, upload
177
+ `source_info` (`repo`/`branch`/`path`/`line`, all four together or omitted) and
178
+ `params` for message placeholders, plus `description` recording the class/usage
179
+ location. `term create --translations` sets initial translations; refreshing an
180
+ existing term's translation must go through `translation set-content` per locale
181
+ (`term update` ignores `--translations`). Keep upload scripts idempotent by
182
+ diffing against `eevee term list` before writing.