Comfy-Org / Comfy-Org/ComfyUI_frontend
i18n: diff-i18n.ts sweeps .source-manifest.json into the custom-node delta
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 699
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 490
Description
## Problem
`scripts/diff-i18n.ts` walks `src/locales` with `getAllJsonFiles`, which returns every
`*.json` under that tree:
```ts
function getAllJsonFiles(dir: string): string[] {
const items = readdirSync(dir, { withFileTypes: true })
...
} else if (item.name.endsWith('.json')) {
files.push(path)
}
}
```
Since https://github.com/Comfy-Org/ComfyUI_frontend/pull/15062 that tree contains
`src/locales/.source-manifest.json`. `readdirSync` returns dotfiles, and the name ends in
`.json`, so the manifest is now captured by `capture` and diffed by `diff` alongside the
locale files.
## Current impact: latent, not live
`findAdditions` only emits keys present in `updated` and absent from `base`. The manifest's
shape is stable (`files`, `knownViolations`, `version`) and the custom-node run does not
add top-level keys to it, so no diff file is written today and nothing leaks.
It becomes live if any of these change:
- the manifest gains a key during a custom-node run (a new entry file, a new field),
- `findAdditions` is ever extended to report modifications, or
- the manifest schema grows — #15230 already removes `knownViolations`, and #15236
reworks planning.
The failure mode is that our translation provenance file gets copied into
`ComfyUI/custom_nodes//locales/` and opened as a PR against a third-party
repository, which is both confusing and a small information leak.
## Fix
Exclude non-locale files explicitly rather than relying on the manifest's shape:
```ts
const localeFiles = files.filter((f) => !basename(f).startsWith('.'))
```
or restrict the walk to the known locale directories.
## Ordering note
This only matters once `i18n-update-custom-nodes.yaml` is re-enabled — it is currently
`disabled_manually` with zero runs ever. Worth fixing before that flip, not after.
Contributor guide
Assessment
This issue has not been assessed yet.