localingos 0.1.38 → 0.1.40

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "localingos",
3
- "version": "0.1.38",
3
+ "version": "0.1.40",
4
4
  "description": "CLI tool to sync translations with Localingos",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -398,7 +398,8 @@ The extraction script must also detect **orphan messages** — keys defined in \
398
398
  How it works:
399
399
  1. For each \`*${msgExt}\` file, extract the exported const name (e.g. \`HeroMessages\`) and each UPPER_SNAKE_CASE record key (e.g. \`TITLE\`)
400
400
  2. Search all \`.ts\`/\`.tsx\` source files (excluding \`*${msgExt}\`) for references like \`HeroMessages.TITLE\`
401
- 3. If a key is never referenced anywhere, it's an orphan
401
+ 3. Also resolve **import aliases** — scan for \`import { HeroMessages as m }\` patterns and check for \`m.TITLE\` as well. A message is NOT orphaned if it's referenced through any alias.
402
+ 4. If a key is never referenced anywhere (neither by its original export name nor any alias), it's an orphan
402
403
 
403
404
  Behavior:
404
405
  - **Default run** (\`npm run i18n:extract\`): report orphans with file, export name, record key, and id — grouped by file for readability. Print a message like: \`🧹 N orphan message(s) found — defined but never referenced in code\`