@intlayer/chokidar 5.4.2 → 5.5.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 (139) hide show
  1. package/dist/cjs/checkDictionaryChanges.cjs +10 -8
  2. package/dist/cjs/checkDictionaryChanges.cjs.map +1 -1
  3. package/dist/cjs/chokidar/watcher.cjs +26 -27
  4. package/dist/cjs/chokidar/watcher.cjs.map +1 -1
  5. package/dist/cjs/cleanOutputDir.cjs +7 -9
  6. package/dist/cjs/cleanOutputDir.cjs.map +1 -1
  7. package/dist/cjs/fetchDistantDictionaries.cjs +8 -6
  8. package/dist/cjs/fetchDistantDictionaries.cjs.map +1 -1
  9. package/dist/cjs/filterDictionaryLocales.cjs +58 -0
  10. package/dist/cjs/filterDictionaryLocales.cjs.map +1 -0
  11. package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs +51 -0
  12. package/dist/cjs/getBuiltUnmergedDictionariesPath.cjs.map +1 -0
  13. package/dist/cjs/getContentDeclarationFileTemplate/cjsTemplate.md +9 -0
  14. package/dist/cjs/getContentDeclarationFileTemplate/esmTemplate.md +9 -0
  15. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs +62 -0
  16. package/dist/cjs/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.cjs.map +1 -0
  17. package/dist/cjs/getContentDeclarationFileTemplate/tsTemplate.md +8 -0
  18. package/dist/cjs/index.cjs +21 -6
  19. package/dist/cjs/index.cjs.map +1 -1
  20. package/dist/cjs/listGitFiles.cjs +100 -0
  21. package/dist/cjs/listGitFiles.cjs.map +1 -0
  22. package/dist/cjs/loadDictionaries/loadDictionaries.cjs +4 -25
  23. package/dist/cjs/loadDictionaries/loadDictionaries.cjs.map +1 -1
  24. package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs +7 -1
  25. package/dist/cjs/loadDictionaries/loadDistantDictionaries.cjs.map +1 -1
  26. package/dist/cjs/mergeDictionaries.cjs +44 -23
  27. package/dist/cjs/mergeDictionaries.cjs.map +1 -1
  28. package/dist/cjs/prepareIntlayer.cjs +6 -5
  29. package/dist/cjs/prepareIntlayer.cjs.map +1 -1
  30. package/dist/cjs/processPerLocaleDictionary.cjs +49 -0
  31. package/dist/cjs/processPerLocaleDictionary.cjs.map +1 -0
  32. package/dist/cjs/reduceDictionaryContent/applyMask.cjs +50 -0
  33. package/dist/cjs/reduceDictionaryContent/applyMask.cjs.map +1 -0
  34. package/dist/cjs/reduceDictionaryContent/buildMask.cjs +49 -0
  35. package/dist/cjs/reduceDictionaryContent/buildMask.cjs.map +1 -0
  36. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs +35 -0
  37. package/dist/cjs/reduceDictionaryContent/reduceDictionaryContent.cjs.map +1 -0
  38. package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs +4 -4
  39. package/dist/cjs/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.cjs.map +1 -1
  40. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs +56 -8
  41. package/dist/cjs/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.cjs.map +1 -1
  42. package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs +4 -4
  43. package/dist/cjs/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.cjs.map +1 -1
  44. package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs +21 -1
  45. package/dist/cjs/transpiler/dictionary_to_main/createDictionaryEntryPoint.cjs.map +1 -1
  46. package/dist/cjs/writeContentDeclaration/formatCode.cjs +73 -0
  47. package/dist/cjs/writeContentDeclaration/formatCode.cjs.map +1 -0
  48. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs +36 -37
  49. package/dist/cjs/writeContentDeclaration/writeContentDeclaration.cjs.map +1 -1
  50. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs +379 -0
  51. package/dist/cjs/writeContentDeclaration/writeJSFile.cjs.map +1 -0
  52. package/dist/esm/checkDictionaryChanges.mjs +10 -5
  53. package/dist/esm/checkDictionaryChanges.mjs.map +1 -1
  54. package/dist/esm/chokidar/watcher.mjs +18 -19
  55. package/dist/esm/chokidar/watcher.mjs.map +1 -1
  56. package/dist/esm/cleanOutputDir.mjs +7 -9
  57. package/dist/esm/cleanOutputDir.mjs.map +1 -1
  58. package/dist/esm/fetchDistantDictionaries.mjs +8 -6
  59. package/dist/esm/fetchDistantDictionaries.mjs.map +1 -1
  60. package/dist/esm/filterDictionaryLocales.mjs +37 -0
  61. package/dist/esm/filterDictionaryLocales.mjs.map +1 -0
  62. package/dist/esm/getBuiltUnmergedDictionariesPath.mjs +17 -0
  63. package/dist/esm/getBuiltUnmergedDictionariesPath.mjs.map +1 -0
  64. package/dist/esm/getContentDeclarationFileTemplate/cjsTemplate.md +9 -0
  65. package/dist/esm/getContentDeclarationFileTemplate/esmTemplate.md +9 -0
  66. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs +37 -0
  67. package/dist/esm/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.mjs.map +1 -0
  68. package/dist/esm/getContentDeclarationFileTemplate/tsTemplate.md +8 -0
  69. package/dist/esm/index.mjs +21 -9
  70. package/dist/esm/index.mjs.map +1 -1
  71. package/dist/esm/listGitFiles.mjs +66 -0
  72. package/dist/esm/listGitFiles.mjs.map +1 -0
  73. package/dist/esm/loadDictionaries/loadDictionaries.mjs +7 -14
  74. package/dist/esm/loadDictionaries/loadDictionaries.mjs.map +1 -1
  75. package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs +7 -1
  76. package/dist/esm/loadDictionaries/loadDistantDictionaries.mjs.map +1 -1
  77. package/dist/esm/mergeDictionaries.mjs +43 -22
  78. package/dist/esm/mergeDictionaries.mjs.map +1 -1
  79. package/dist/esm/prepareIntlayer.mjs +5 -4
  80. package/dist/esm/prepareIntlayer.mjs.map +1 -1
  81. package/dist/esm/processPerLocaleDictionary.mjs +25 -0
  82. package/dist/esm/processPerLocaleDictionary.mjs.map +1 -0
  83. package/dist/esm/reduceDictionaryContent/applyMask.mjs +26 -0
  84. package/dist/esm/reduceDictionaryContent/applyMask.mjs.map +1 -0
  85. package/dist/esm/reduceDictionaryContent/buildMask.mjs +24 -0
  86. package/dist/esm/reduceDictionaryContent/buildMask.mjs.map +1 -0
  87. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs +11 -0
  88. package/dist/esm/reduceDictionaryContent/reduceDictionaryContent.mjs.map +1 -0
  89. package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs +4 -4
  90. package/dist/esm/transpiler/declaration_file_to_dictionary/i18next_dictionary/writeDictionary.mjs.map +1 -1
  91. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs +54 -8
  92. package/dist/esm/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.mjs.map +1 -1
  93. package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs +4 -4
  94. package/dist/esm/transpiler/declaration_file_to_dictionary/reactIntl_dictionary/writeDictionary.mjs.map +1 -1
  95. package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs +21 -1
  96. package/dist/esm/transpiler/dictionary_to_main/createDictionaryEntryPoint.mjs.map +1 -1
  97. package/dist/esm/writeContentDeclaration/formatCode.mjs +39 -0
  98. package/dist/esm/writeContentDeclaration/formatCode.mjs.map +1 -0
  99. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs +35 -36
  100. package/dist/esm/writeContentDeclaration/writeContentDeclaration.mjs.map +1 -1
  101. package/dist/esm/writeContentDeclaration/writeJSFile.mjs +347 -0
  102. package/dist/esm/writeContentDeclaration/writeJSFile.mjs.map +1 -0
  103. package/dist/types/checkDictionaryChanges.d.ts.map +1 -1
  104. package/dist/types/chokidar/watcher.d.ts +2 -1
  105. package/dist/types/chokidar/watcher.d.ts.map +1 -1
  106. package/dist/types/cleanOutputDir.d.ts.map +1 -1
  107. package/dist/types/fetchDistantDictionaries.d.ts.map +1 -1
  108. package/dist/types/filterDictionaryLocales.d.ts +4 -0
  109. package/dist/types/filterDictionaryLocales.d.ts.map +1 -0
  110. package/dist/types/getBuiltUnmergedDictionariesPath.d.ts +5 -0
  111. package/dist/types/getBuiltUnmergedDictionariesPath.d.ts.map +1 -0
  112. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts +2 -0
  113. package/dist/types/getContentDeclarationFileTemplate/getContentDeclarationFileTemplate.d.ts.map +1 -0
  114. package/dist/types/index.d.ts +12 -7
  115. package/dist/types/index.d.ts.map +1 -1
  116. package/dist/types/listGitFiles.d.ts +9 -0
  117. package/dist/types/listGitFiles.d.ts.map +1 -0
  118. package/dist/types/loadDictionaries/loadDictionaries.d.ts.map +1 -1
  119. package/dist/types/loadDictionaries/loadDistantDictionaries.d.ts.map +1 -1
  120. package/dist/types/mergeDictionaries.d.ts +2 -4
  121. package/dist/types/mergeDictionaries.d.ts.map +1 -1
  122. package/dist/types/prepareIntlayer.d.ts.map +1 -1
  123. package/dist/types/processPerLocaleDictionary.d.ts +32 -0
  124. package/dist/types/processPerLocaleDictionary.d.ts.map +1 -0
  125. package/dist/types/reduceDictionaryContent/applyMask.d.ts +3 -0
  126. package/dist/types/reduceDictionaryContent/applyMask.d.ts.map +1 -0
  127. package/dist/types/reduceDictionaryContent/buildMask.d.ts +5 -0
  128. package/dist/types/reduceDictionaryContent/buildMask.d.ts.map +1 -0
  129. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts +3 -0
  130. package/dist/types/reduceDictionaryContent/reduceDictionaryContent.d.ts.map +1 -0
  131. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts +38 -0
  132. package/dist/types/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.d.ts.map +1 -1
  133. package/dist/types/transpiler/dictionary_to_main/createDictionaryEntryPoint.d.ts.map +1 -1
  134. package/dist/types/writeContentDeclaration/formatCode.d.ts +2 -0
  135. package/dist/types/writeContentDeclaration/formatCode.d.ts.map +1 -0
  136. package/dist/types/writeContentDeclaration/writeContentDeclaration.d.ts.map +1 -1
  137. package/dist/types/writeContentDeclaration/writeJSFile.d.ts +9 -0
  138. package/dist/types/writeContentDeclaration/writeJSFile.d.ts.map +1 -0
  139. package/package.json +21 -13
@@ -1,3 +1,41 @@
1
1
  import type { Dictionary } from '@intlayer/core';
2
+ /**
3
+ * Write the unmerged dictionaries to the unmergedDictionariesDir
4
+ * @param dictionaries - The dictionaries to write
5
+ * @param configuration - The configuration
6
+ * @returns The grouped dictionaries
7
+ *
8
+ * @example
9
+ * ```ts
10
+ * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
11
+ * console.log(unmergedDictionaries);
12
+ *
13
+ * // .intlayer/unmerged_dictionaries/home.json
14
+ * // {
15
+ * // [
16
+ * // { key: 'home', content: { ... } },
17
+ * // { key: 'home', content: { ... } },
18
+ * // ],
19
+ * // }
20
+ * ```
21
+ */
22
+ export declare const writeUnmergedDictionaries: (dictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<Record<string, Dictionary[]>>;
23
+ /**
24
+ * Write the final dictionaries to the dictionariesDir
25
+ * @param groupedDictionaries - The grouped dictionaries
26
+ * @param configuration - The configuration
27
+ * @returns The final dictionaries
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const unmergedDictionaries = await writeUnmergedDictionaries(dictionaries);
32
+ * const finalDictionaries = await writeFinalDictionaries(unmergedDictionaries);
33
+ * console.log(finalDictionaries);
34
+ *
35
+ * // .intlayer/dictionaries/home.json
36
+ * // { key: 'home', content: { ... } },
37
+ * ```
38
+ */
39
+ export declare const writeFinalDictionaries: (groupedDictionaries: Record<string, Dictionary[]>, configuration?: import("@intlayer/config").IntlayerConfig) => Promise<string[]>;
2
40
  export declare const writeDictionary: (dictionaries: Dictionary[], configuration?: import("@intlayer/config").IntlayerConfig) => Promise<string[]>;
3
41
  //# sourceMappingURL=writeDictionary.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAEjD,eAAO,MAAM,eAAe,GAC1B,cAAc,UAAU,EAAE,EAC1B,yDAAkC,sBAwBnC,CAAC"}
1
+ {"version":3,"file":"writeDictionary.d.ts","sourceRoot":"","sources":["../../../../../src/transpiler/declaration_file_to_dictionary/intlayer_dictionary/writeDictionary.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAsBjD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,yBAAyB,GACpC,cAAc,UAAU,EAAE,EAC1B,yDAAkC,KACjC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,CAyBtC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,sBAAsB,GACjC,qBAAqB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,EACjD,yDAAkC,sBA6BnC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,cAAc,UAAU,EAAE,EAC1B,yDAAkC,sBAanC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AA+CA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,SAyBnC,CAAC"}
1
+ {"version":3,"file":"createDictionaryEntryPoint.d.ts","sourceRoot":"","sources":["../../../../src/transpiler/dictionary_to_main/createDictionaryEntryPoint.ts"],"names":[],"mappings":"AAgDA;;GAEG;AACH,eAAO,MAAM,0BAA0B,GACrC,yDAAkC,SAgDnC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const formatCode: (filePath: string, code: string) => Promise<any>;
2
+ //# sourceMappingURL=formatCode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"formatCode.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/formatCode.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,UAAU,GAAU,UAAU,MAAM,EAAE,MAAM,MAAM,iBA0C9D,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAG9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAGjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAI3D,eAAO,MAAM,uBAAuB,GAClC,YAAY,UAAU,EACtB,SAAQ,cAA8B,EACtC,sBAAsB,MAAM,KAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAyFpD,CAAC"}
1
+ {"version":3,"file":"writeContentDeclaration.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeContentDeclaration.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAOjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAsB3D,eAAO,MAAM,uBAAuB,GAClC,YAAY,UAAU,EACtB,SAAQ,cAA8B,EACtC,sBAAsB,MAAM,KAC3B,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CA0DpD,CAAC"}
@@ -0,0 +1,9 @@
1
+ import { Dictionary } from '@intlayer/core';
2
+ /**
3
+ * Updates a JavaScript/TypeScript file based on the provided JSON instructions.
4
+ * It targets a specific dictionary object within the file (identified by its 'key' property)
5
+ * and updates its 'content' entries. Currently, it focuses on modifying arguments
6
+ * of 't' (translation) function calls.
7
+ */
8
+ export declare const writeJSFile: (filePath: string, dictionary: Dictionary) => Promise<void>;
9
+ //# sourceMappingURL=writeJSFile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"writeJSFile.d.ts","sourceRoot":"","sources":["../../../src/writeContentDeclaration/writeJSFile.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,UAAU,EAIX,MAAM,gBAAgB,CAAC;AAOxB;;;;;GAKG;AACH,eAAO,MAAM,WAAW,GACtB,UAAU,MAAM,EAChB,YAAY,UAAU,KACrB,OAAO,CAAC,IAAI,CA6fd,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intlayer/chokidar",
3
- "version": "5.4.2",
3
+ "version": "5.5.0",
4
4
  "private": false,
5
5
  "description": "Uses chokidar to scan and build Intlayer declaration files into dictionaries based on Intlayer configuration.",
6
6
  "keywords": [
@@ -57,20 +57,28 @@
57
57
  "./package.json"
58
58
  ],
59
59
  "dependencies": {
60
+ "@babel/generator": "^7.27.1",
61
+ "@babel/parser": "^7.27.2",
62
+ "@babel/traverse": "^7.27.1",
63
+ "@babel/types": "^7.27.1",
60
64
  "chokidar": "^3.6.0",
61
65
  "crypto-js": "^4.2.0",
62
66
  "deep-equal": "^2.2.3",
63
67
  "deepmerge": "^4.3.1",
64
68
  "fast-glob": "^3.3.3",
65
69
  "p-limit": "^3.1.0",
66
- "@intlayer/api": "5.4.2",
67
- "@intlayer/core": "5.4.2",
68
- "@intlayer/config": "5.4.2",
69
- "intlayer": "5.4.2",
70
- "@intlayer/dictionaries-entry": "5.4.2"
70
+ "simple-git": "^3.27.0",
71
+ "@intlayer/api": "5.5.0",
72
+ "@intlayer/dictionaries-entry": "5.5.0",
73
+ "@intlayer/core": "5.5.0",
74
+ "intlayer": "5.5.0",
75
+ "@intlayer/config": "5.5.0",
76
+ "@intlayer/unmerged-dictionaries-entry": "5.5.0"
71
77
  },
72
78
  "devDependencies": {
73
79
  "@changesets/cli": "2.28.1",
80
+ "@types/babel__generator": "^7.27.0",
81
+ "@types/babel__traverse": "^7.20.7",
74
82
  "@types/crypto-js": "^4.2.2",
75
83
  "@types/deep-equal": "^1.0.4",
76
84
  "@types/node": "^22.13.10",
@@ -82,19 +90,19 @@
82
90
  "tsc-alias": "^1.8.11",
83
91
  "tsup": "^8.4.0",
84
92
  "typescript": "^5.8.2",
85
- "@utils/ts-config": "1.0.4",
86
- "@intlayer/backend": "5.4.2",
87
- "@utils/ts-config-types": "1.0.4",
88
93
  "@utils/eslint-config": "1.0.4",
94
+ "@utils/ts-config-types": "1.0.4",
95
+ "@utils/ts-config": "1.0.4",
96
+ "@intlayer/backend": "5.5.0",
89
97
  "@utils/tsup-config": "1.0.4"
90
98
  },
91
99
  "peerDependencies": {
92
100
  "fast-glob": "^3.3.3",
93
101
  "react": ">=16.0.0",
94
- "@intlayer/api": "5.4.2",
95
- "@intlayer/core": "5.4.2",
96
- "intlayer": "5.4.2",
97
- "@intlayer/config": "5.4.2"
102
+ "@intlayer/api": "5.5.0",
103
+ "@intlayer/config": "5.5.0",
104
+ "@intlayer/core": "5.5.0",
105
+ "intlayer": "5.5.0"
98
106
  },
99
107
  "engines": {
100
108
  "node": ">=14.18"