gt 2.14.35 → 2.14.37

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 (430) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/dist/api/collectUserEditDiffs.js +112 -155
  3. package/dist/api/collectUserEditDiffs.js.map +1 -0
  4. package/dist/api/downloadFileBatch.js +164 -241
  5. package/dist/api/downloadFileBatch.js.map +1 -0
  6. package/dist/api/saveLocalEdits.js +37 -41
  7. package/dist/api/saveLocalEdits.js.map +1 -0
  8. package/dist/bin/bin-entry.js +17 -7
  9. package/dist/bin/bin-entry.js.map +1 -0
  10. package/dist/bin/bin-main.js +43 -61
  11. package/dist/bin/bin-main.js.map +1 -0
  12. package/dist/cli/base.js +382 -497
  13. package/dist/cli/base.js.map +1 -0
  14. package/dist/cli/commands/download.js +41 -49
  15. package/dist/cli/commands/download.js.map +1 -0
  16. package/dist/cli/commands/enqueue.js +26 -25
  17. package/dist/cli/commands/enqueue.js.map +1 -0
  18. package/dist/cli/commands/setupProject.js +33 -36
  19. package/dist/cli/commands/setupProject.js.map +1 -0
  20. package/dist/cli/commands/stage.js +53 -61
  21. package/dist/cli/commands/stage.js.map +1 -0
  22. package/dist/cli/commands/translate.js +75 -112
  23. package/dist/cli/commands/translate.js.map +1 -0
  24. package/dist/cli/commands/upload.js +185 -213
  25. package/dist/cli/commands/upload.js.map +1 -0
  26. package/dist/cli/commands/utils/validation.js +39 -34
  27. package/dist/cli/commands/utils/validation.js.map +1 -0
  28. package/dist/cli/flags.js +35 -62
  29. package/dist/cli/flags.js.map +1 -0
  30. package/dist/cli/inline.js +112 -137
  31. package/dist/cli/inline.js.map +1 -0
  32. package/dist/cli/next.js +17 -12
  33. package/dist/cli/next.js.map +1 -0
  34. package/dist/cli/node.js +19 -15
  35. package/dist/cli/node.js.map +1 -0
  36. package/dist/cli/python.js +13 -8
  37. package/dist/cli/python.js.map +1 -0
  38. package/dist/cli/react.js +61 -78
  39. package/dist/cli/react.js.map +1 -0
  40. package/dist/config/defaults.js +16 -11
  41. package/dist/config/defaults.js.map +1 -0
  42. package/dist/config/generateSettings.js +167 -269
  43. package/dist/config/generateSettings.js.map +1 -0
  44. package/dist/config/optionPresets.js +78 -96
  45. package/dist/config/optionPresets.js.map +1 -0
  46. package/dist/config/resolveConfig.js +27 -32
  47. package/dist/config/resolveConfig.js.map +1 -0
  48. package/dist/config/utils.js +7 -3
  49. package/dist/config/utils.js.map +1 -0
  50. package/dist/config/validateSettings.js +19 -30
  51. package/dist/config/validateSettings.js.map +1 -0
  52. package/dist/console/colors.js +18 -13
  53. package/dist/console/colors.js.map +1 -0
  54. package/dist/console/displayTranslateSummary.js +40 -37
  55. package/dist/console/displayTranslateSummary.js.map +1 -0
  56. package/dist/console/formatting.js +8 -5
  57. package/dist/console/formatting.js.map +1 -0
  58. package/dist/console/index.d.ts +11 -9
  59. package/dist/console/index.js +53 -50
  60. package/dist/console/index.js.map +1 -0
  61. package/dist/console/inkFields.d.ts +23 -0
  62. package/dist/console/inkFields.js +87 -0
  63. package/dist/console/inkFields.js.map +1 -0
  64. package/dist/console/inkLayout.d.ts +7 -0
  65. package/dist/console/inkLayout.js +139 -0
  66. package/dist/console/inkLayout.js.map +1 -0
  67. package/dist/console/inkLocaleData.d.ts +4 -0
  68. package/dist/console/inkLocaleData.js +32 -0
  69. package/dist/console/inkLocaleData.js.map +1 -0
  70. package/dist/console/inkPrompts.d.ts +8 -0
  71. package/dist/console/inkPrompts.js +496 -0
  72. package/dist/console/inkPrompts.js.map +1 -0
  73. package/dist/console/inkSession.d.ts +3 -0
  74. package/dist/console/inkSession.js +42 -0
  75. package/dist/console/inkSession.js.map +1 -0
  76. package/dist/console/inkTerminal.d.ts +4 -0
  77. package/dist/console/inkTerminal.js +15 -0
  78. package/dist/console/inkTerminal.js.map +1 -0
  79. package/dist/console/inkTypes.d.ts +66 -0
  80. package/dist/console/inkTypes.js +1 -0
  81. package/dist/console/inkUtils.d.ts +24 -0
  82. package/dist/console/inkUtils.js +87 -0
  83. package/dist/console/inkUtils.js.map +1 -0
  84. package/dist/console/logger.js +209 -249
  85. package/dist/console/logger.js.map +1 -0
  86. package/dist/console/logging.d.ts +14 -0
  87. package/dist/console/logging.js +203 -162
  88. package/dist/console/logging.js.map +1 -0
  89. package/dist/console/promptParsing.d.ts +5 -0
  90. package/dist/console/promptParsing.js +28 -0
  91. package/dist/console/promptParsing.js.map +1 -0
  92. package/dist/console/terminalSession.d.ts +5 -0
  93. package/dist/console/terminalSession.js +38 -0
  94. package/dist/console/terminalSession.js.map +1 -0
  95. package/dist/extraction/index.js +3 -2
  96. package/dist/extraction/mapToUpdates.js +19 -18
  97. package/dist/extraction/mapToUpdates.js.map +1 -0
  98. package/dist/extraction/postProcess.js +68 -86
  99. package/dist/extraction/postProcess.js.map +1 -0
  100. package/dist/formats/files/aggregateFiles.js +223 -304
  101. package/dist/formats/files/aggregateFiles.js.map +1 -0
  102. package/dist/formats/files/collectFiles.js +53 -54
  103. package/dist/formats/files/collectFiles.js.map +1 -0
  104. package/dist/formats/files/convertToFileTranslationData.js +21 -19
  105. package/dist/formats/files/convertToFileTranslationData.js.map +1 -0
  106. package/dist/formats/files/fileMapping.js +82 -119
  107. package/dist/formats/files/fileMapping.js.map +1 -0
  108. package/dist/formats/files/preprocess/mdx.js +15 -12
  109. package/dist/formats/files/preprocess/mdx.js.map +1 -0
  110. package/dist/formats/files/preprocess/mintlify.js +15 -13
  111. package/dist/formats/files/preprocess/mintlify.js.map +1 -0
  112. package/dist/formats/files/preprocessContent.js +20 -21
  113. package/dist/formats/files/preprocessContent.js.map +1 -0
  114. package/dist/formats/files/save.js +18 -15
  115. package/dist/formats/files/save.js.map +1 -0
  116. package/dist/formats/files/supportedFiles.js +27 -22
  117. package/dist/formats/files/supportedFiles.js.map +1 -0
  118. package/dist/formats/files/transformFormat.js +93 -100
  119. package/dist/formats/files/transformFormat.js.map +1 -0
  120. package/dist/formats/json/extractJson.js +83 -110
  121. package/dist/formats/json/extractJson.js.map +1 -0
  122. package/dist/formats/json/flattenJson.js +41 -48
  123. package/dist/formats/json/flattenJson.js.map +1 -0
  124. package/dist/formats/json/jsonPath.js +20 -15
  125. package/dist/formats/json/jsonPath.js.map +1 -0
  126. package/dist/formats/json/jsonPointer.js +17 -17
  127. package/dist/formats/json/jsonPointer.js.map +1 -0
  128. package/dist/formats/json/mergeJson.js +230 -371
  129. package/dist/formats/json/mergeJson.js.map +1 -0
  130. package/dist/formats/json/parseJson.js +74 -111
  131. package/dist/formats/json/parseJson.js.map +1 -0
  132. package/dist/formats/json/transformJson.js +53 -61
  133. package/dist/formats/json/transformJson.js.map +1 -0
  134. package/dist/formats/json/utils.js +158 -187
  135. package/dist/formats/json/utils.js.map +1 -0
  136. package/dist/formats/parseKeyedMetadata.js +85 -106
  137. package/dist/formats/parseKeyedMetadata.js.map +1 -0
  138. package/dist/formats/utils.js +13 -23
  139. package/dist/formats/utils.js.map +1 -0
  140. package/dist/formats/yaml/extractYaml.js +32 -31
  141. package/dist/formats/yaml/extractYaml.js.map +1 -0
  142. package/dist/formats/yaml/mergeYaml.js +43 -60
  143. package/dist/formats/yaml/mergeYaml.js.map +1 -0
  144. package/dist/formats/yaml/parseYaml.js +34 -23
  145. package/dist/formats/yaml/parseYaml.js.map +1 -0
  146. package/dist/formats/yaml/utils.js +19 -21
  147. package/dist/formats/yaml/utils.js.map +1 -0
  148. package/dist/fs/clearLocaleDirs.js +82 -114
  149. package/dist/fs/clearLocaleDirs.js.map +1 -0
  150. package/dist/fs/config/downloadedVersions.js +174 -188
  151. package/dist/fs/config/downloadedVersions.js.map +1 -0
  152. package/dist/fs/config/loadConfig.js +12 -8
  153. package/dist/fs/config/loadConfig.js.map +1 -0
  154. package/dist/fs/config/parseFilesConfig.js +166 -227
  155. package/dist/fs/config/parseFilesConfig.js.map +1 -0
  156. package/dist/fs/config/setupConfig.js +43 -52
  157. package/dist/fs/config/setupConfig.js.map +1 -0
  158. package/dist/fs/config/updateConfig.js +44 -56
  159. package/dist/fs/config/updateConfig.js.map +1 -0
  160. package/dist/fs/config/updateVersions.js +27 -28
  161. package/dist/fs/config/updateVersions.js.map +1 -0
  162. package/dist/fs/copyFile.js +33 -37
  163. package/dist/fs/copyFile.js.map +1 -0
  164. package/dist/fs/createLoadTranslationsFile.js +32 -48
  165. package/dist/fs/createLoadTranslationsFile.js.map +1 -0
  166. package/dist/fs/determineFramework/detectPythonLibrary.js +30 -34
  167. package/dist/fs/determineFramework/detectPythonLibrary.js.map +1 -0
  168. package/dist/fs/determineFramework/index.js +46 -64
  169. package/dist/fs/determineFramework/index.js.map +1 -0
  170. package/dist/fs/determineFramework/matchPyprojectDependency.js +65 -78
  171. package/dist/fs/determineFramework/matchPyprojectDependency.js.map +1 -0
  172. package/dist/fs/determineFramework/matchRequirementsTxtDependency.js +21 -19
  173. package/dist/fs/determineFramework/matchRequirementsTxtDependency.js.map +1 -0
  174. package/dist/fs/determineFramework/matchSetupPyDependency.js +60 -81
  175. package/dist/fs/determineFramework/matchSetupPyDependency.js.map +1 -0
  176. package/dist/fs/determineFramework/resolveGtDependency.js +15 -15
  177. package/dist/fs/determineFramework/resolveGtDependency.js.map +1 -0
  178. package/dist/fs/findFilepath.js +63 -78
  179. package/dist/fs/findFilepath.js.map +1 -0
  180. package/dist/fs/loadJSON.js +18 -15
  181. package/dist/fs/loadJSON.js.map +1 -0
  182. package/dist/fs/matchFiles.js +12 -7
  183. package/dist/fs/matchFiles.js.map +1 -0
  184. package/dist/fs/saveJSON.js +10 -6
  185. package/dist/fs/saveJSON.js.map +1 -0
  186. package/dist/fs/utils.js +19 -15
  187. package/dist/fs/utils.js.map +1 -0
  188. package/dist/functions.d.ts +2 -1
  189. package/dist/functions.js +3 -6
  190. package/dist/generated/version.d.ts +1 -1
  191. package/dist/generated/version.js +6 -2
  192. package/dist/generated/version.js.map +1 -0
  193. package/dist/git/branches.js +77 -83
  194. package/dist/git/branches.js.map +1 -0
  195. package/dist/hooks/postProcess.js +97 -114
  196. package/dist/hooks/postProcess.js.map +1 -0
  197. package/dist/index.js +23 -31
  198. package/dist/index.js.map +1 -0
  199. package/dist/locadex/setupFlow.js +11 -8
  200. package/dist/locadex/setupFlow.js.map +1 -0
  201. package/dist/main.js +17 -7
  202. package/dist/main.js.map +1 -0
  203. package/dist/next/config/parseNextConfig.js +32 -51
  204. package/dist/next/config/parseNextConfig.js.map +1 -0
  205. package/dist/next/jsx/utils.js +25 -37
  206. package/dist/next/jsx/utils.js.map +1 -0
  207. package/dist/next/parse/handleInitGT.js +87 -154
  208. package/dist/next/parse/handleInitGT.js.map +1 -0
  209. package/dist/next/parse/wrapContent.js +136 -158
  210. package/dist/next/parse/wrapContent.js.map +1 -0
  211. package/dist/python/parse/createPythonInlineUpdates.js +36 -33
  212. package/dist/python/parse/createPythonInlineUpdates.js.map +1 -0
  213. package/dist/react/config/createESBuildConfig.js +115 -115
  214. package/dist/react/config/createESBuildConfig.js.map +1 -0
  215. package/dist/react/jsx/evaluateJsx.js +90 -124
  216. package/dist/react/jsx/evaluateJsx.js.map +1 -0
  217. package/dist/react/jsx/utils/buildImportMap.js +24 -28
  218. package/dist/react/jsx/utils/buildImportMap.js.map +1 -0
  219. package/dist/react/jsx/utils/constants.js +79 -87
  220. package/dist/react/jsx/utils/constants.js.map +1 -0
  221. package/dist/react/jsx/utils/extractSourceCode.js +36 -37
  222. package/dist/react/jsx/utils/extractSourceCode.js.map +1 -0
  223. package/dist/react/jsx/utils/getCalleeNameFromExpression.js +30 -30
  224. package/dist/react/jsx/utils/getCalleeNameFromExpression.js.map +1 -0
  225. package/dist/react/jsx/utils/getPathsAndAliases.js +70 -105
  226. package/dist/react/jsx/utils/getPathsAndAliases.js.map +1 -0
  227. package/dist/react/jsx/utils/isNumberLiteral.js +13 -11
  228. package/dist/react/jsx/utils/isNumberLiteral.js.map +1 -0
  229. package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.js +103 -148
  230. package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.js.map +1 -0
  231. package/dist/react/jsx/utils/jsxParsing/autoInsertion.js +305 -389
  232. package/dist/react/jsx/utils/jsxParsing/autoInsertion.js.map +1 -0
  233. package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.js +122 -193
  234. package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.js.map +1 -0
  235. package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.js +50 -64
  236. package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.js.map +1 -0
  237. package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.js +41 -68
  238. package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.js.map +1 -0
  239. package/dist/react/jsx/utils/jsxParsing/parseJsx.js +760 -1107
  240. package/dist/react/jsx/utils/jsxParsing/parseJsx.js.map +1 -0
  241. package/dist/react/jsx/utils/jsxParsing/parseTProps.js +35 -71
  242. package/dist/react/jsx/utils/jsxParsing/parseTProps.js.map +1 -0
  243. package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.js +39 -58
  244. package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.js.map +1 -0
  245. package/dist/react/jsx/utils/jsxParsing/types.js +10 -24
  246. package/dist/react/jsx/utils/jsxParsing/types.js.map +1 -0
  247. package/dist/react/jsx/utils/mapAttributeName.js +13 -13
  248. package/dist/react/jsx/utils/mapAttributeName.js.map +1 -0
  249. package/dist/react/jsx/utils/parseAst.js +142 -272
  250. package/dist/react/jsx/utils/parseAst.js.map +1 -0
  251. package/dist/react/jsx/utils/parseString.js +726 -1090
  252. package/dist/react/jsx/utils/parseString.js.map +1 -0
  253. package/dist/react/jsx/utils/parseStringFunction.js +274 -401
  254. package/dist/react/jsx/utils/parseStringFunction.js.map +1 -0
  255. package/dist/react/jsx/utils/resolveImportPath.d.ts +1 -1
  256. package/dist/react/jsx/utils/resolveImportPath.js +125 -108
  257. package/dist/react/jsx/utils/resolveImportPath.js.map +1 -0
  258. package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js +18 -24
  259. package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js.map +1 -0
  260. package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js +412 -579
  261. package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js.map +1 -0
  262. package/dist/react/jsx/utils/stringParsing/derivation/index.js +57 -67
  263. package/dist/react/jsx/utils/stringParsing/derivation/index.js.map +1 -0
  264. package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js +26 -36
  265. package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js.map +1 -0
  266. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js +29 -24
  267. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js.map +1 -0
  268. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js +34 -32
  269. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js.map +1 -0
  270. package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js +80 -117
  271. package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js.map +1 -0
  272. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js +24 -19
  273. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js.map +1 -0
  274. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js +18 -21
  275. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js.map +1 -0
  276. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js +45 -50
  277. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js.map +1 -0
  278. package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js +54 -59
  279. package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js.map +1 -0
  280. package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js +56 -69
  281. package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js.map +1 -0
  282. package/dist/react/jsx/utils/validateStringFunction.js +21 -29
  283. package/dist/react/jsx/utils/validateStringFunction.js.map +1 -0
  284. package/dist/react/jsx/wrapJsx.js +192 -375
  285. package/dist/react/jsx/wrapJsx.js.map +1 -0
  286. package/dist/react/parse/addVitePlugin/index.js +40 -34
  287. package/dist/react/parse/addVitePlugin/index.js.map +1 -0
  288. package/dist/react/parse/addVitePlugin/installCompiler.js +18 -20
  289. package/dist/react/parse/addVitePlugin/installCompiler.js.map +1 -0
  290. package/dist/react/parse/addVitePlugin/updateViteConfig.js +107 -111
  291. package/dist/react/parse/addVitePlugin/updateViteConfig.js.map +1 -0
  292. package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js +23 -26
  293. package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js.map +1 -0
  294. package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js +29 -43
  295. package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js.map +1 -0
  296. package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js +70 -104
  297. package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js.map +1 -0
  298. package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js +23 -29
  299. package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js.map +1 -0
  300. package/dist/react/parse/createDictionaryUpdates.js +121 -185
  301. package/dist/react/parse/createDictionaryUpdates.js.map +1 -0
  302. package/dist/react/parse/createInlineUpdates.js +123 -139
  303. package/dist/react/parse/createInlineUpdates.js.map +1 -0
  304. package/dist/react/parse/wrapContent.js +131 -156
  305. package/dist/react/parse/wrapContent.js.map +1 -0
  306. package/dist/react/utils/flattenDictionary.js +55 -70
  307. package/dist/react/utils/flattenDictionary.js.map +1 -0
  308. package/dist/react/utils/getEntryAndMetadata.js +14 -10
  309. package/dist/react/utils/getEntryAndMetadata.js.map +1 -0
  310. package/dist/react/utils/getVariableName.js +36 -33
  311. package/dist/react/utils/getVariableName.js.map +1 -0
  312. package/dist/setup/detectFramework.js +85 -102
  313. package/dist/setup/detectFramework.js.map +1 -0
  314. package/dist/setup/frameworkUtils.js +17 -28
  315. package/dist/setup/frameworkUtils.js.map +1 -0
  316. package/dist/setup/userInput.js +24 -31
  317. package/dist/setup/userInput.js.map +1 -0
  318. package/dist/setup/wizard.js +141 -143
  319. package/dist/setup/wizard.js.map +1 -0
  320. package/dist/state/mintlifyRefMap.js +12 -9
  321. package/dist/state/mintlifyRefMap.js.map +1 -0
  322. package/dist/state/recentDownloads.js +26 -23
  323. package/dist/state/recentDownloads.js.map +1 -0
  324. package/dist/state/translateWarnings.js +17 -8
  325. package/dist/state/translateWarnings.js.map +1 -0
  326. package/dist/translation/parse.js +77 -98
  327. package/dist/translation/parse.js.map +1 -0
  328. package/dist/translation/stage.js +28 -43
  329. package/dist/translation/stage.js.map +1 -0
  330. package/dist/translation/validate.js +68 -91
  331. package/dist/translation/validate.js.map +1 -0
  332. package/dist/types/libraries.js +93 -91
  333. package/dist/types/libraries.js.map +1 -0
  334. package/dist/types/parsing.js +19 -10
  335. package/dist/types/parsing.js.map +1 -0
  336. package/dist/utils/addExplicitAnchorIds.js +270 -389
  337. package/dist/utils/addExplicitAnchorIds.js.map +1 -0
  338. package/dist/utils/calculateTimeoutMs.js +11 -6
  339. package/dist/utils/calculateTimeoutMs.js.map +1 -0
  340. package/dist/utils/constants.js +15 -12
  341. package/dist/utils/constants.js.map +1 -0
  342. package/dist/utils/credentials.js +67 -114
  343. package/dist/utils/credentials.js.map +1 -0
  344. package/dist/utils/fetch.js +22 -20
  345. package/dist/utils/fetch.js.map +1 -0
  346. package/dist/utils/flattenJsonFiles.js +27 -34
  347. package/dist/utils/flattenJsonFiles.js.map +1 -0
  348. package/dist/utils/gitDiff.js +30 -32
  349. package/dist/utils/gitDiff.js.map +1 -0
  350. package/dist/utils/gt.js +7 -2
  351. package/dist/utils/gt.js.map +1 -0
  352. package/dist/utils/hash.js +14 -9
  353. package/dist/utils/hash.js.map +1 -0
  354. package/dist/utils/headers.js +10 -13
  355. package/dist/utils/headers.js.map +1 -0
  356. package/dist/utils/installPackage.js +70 -75
  357. package/dist/utils/installPackage.js.map +1 -0
  358. package/dist/utils/localizeRelativeAssets.js +114 -157
  359. package/dist/utils/localizeRelativeAssets.js.map +1 -0
  360. package/dist/utils/localizeStaticImports.js +229 -371
  361. package/dist/utils/localizeStaticImports.js.map +1 -0
  362. package/dist/utils/localizeStaticUrls.js +241 -424
  363. package/dist/utils/localizeStaticUrls.js.map +1 -0
  364. package/dist/utils/mintlifyTitleFallback.js +64 -72
  365. package/dist/utils/mintlifyTitleFallback.js.map +1 -0
  366. package/dist/utils/monorepoVersionCheck.js +177 -215
  367. package/dist/utils/monorepoVersionCheck.js.map +1 -0
  368. package/dist/utils/packageInfo.js +17 -16
  369. package/dist/utils/packageInfo.js.map +1 -0
  370. package/dist/utils/packageJson.js +51 -66
  371. package/dist/utils/packageJson.js.map +1 -0
  372. package/dist/utils/packageManager.js +237 -260
  373. package/dist/utils/packageManager.js.map +1 -0
  374. package/dist/utils/parse/needsCJS.js +36 -69
  375. package/dist/utils/parse/needsCJS.js.map +1 -0
  376. package/dist/utils/persistPostprocessHashes.js +30 -32
  377. package/dist/utils/persistPostprocessHashes.js.map +1 -0
  378. package/dist/utils/processAnchorIds.js +32 -54
  379. package/dist/utils/processAnchorIds.js.map +1 -0
  380. package/dist/utils/processOpenApi.js +469 -578
  381. package/dist/utils/processOpenApi.js.map +1 -0
  382. package/dist/utils/resolveMintlifyRefs.js +89 -105
  383. package/dist/utils/resolveMintlifyRefs.js.map +1 -0
  384. package/dist/utils/resolvePublish.js +46 -54
  385. package/dist/utils/resolvePublish.js.map +1 -0
  386. package/dist/utils/sanitizeFileContent.js +20 -27
  387. package/dist/utils/sanitizeFileContent.js.map +1 -0
  388. package/dist/utils/sharedStaticAssets.js +248 -366
  389. package/dist/utils/sharedStaticAssets.js.map +1 -0
  390. package/dist/utils/splitMintlifyLanguageRefs.js +208 -282
  391. package/dist/utils/splitMintlifyLanguageRefs.js.map +1 -0
  392. package/dist/utils/validateMdx.js +26 -23
  393. package/dist/utils/validateMdx.js.map +1 -0
  394. package/dist/utils/wrapPlainUrls.js +58 -70
  395. package/dist/utils/wrapPlainUrls.js.map +1 -0
  396. package/dist/workflows/download.js +92 -126
  397. package/dist/workflows/download.js.map +1 -0
  398. package/dist/workflows/enqueue.js +47 -54
  399. package/dist/workflows/enqueue.js.map +1 -0
  400. package/dist/workflows/publish.js +29 -29
  401. package/dist/workflows/publish.js.map +1 -0
  402. package/dist/workflows/setupProject.js +39 -40
  403. package/dist/workflows/setupProject.js.map +1 -0
  404. package/dist/workflows/stage.js +61 -65
  405. package/dist/workflows/stage.js.map +1 -0
  406. package/dist/workflows/steps/BranchStep.js +118 -163
  407. package/dist/workflows/steps/BranchStep.js.map +1 -0
  408. package/dist/workflows/steps/DownloadStep.js +107 -137
  409. package/dist/workflows/steps/DownloadStep.js.map +1 -0
  410. package/dist/workflows/steps/EnqueueStep.js +32 -32
  411. package/dist/workflows/steps/EnqueueStep.js.map +1 -0
  412. package/dist/workflows/steps/PollJobsStep.js +208 -292
  413. package/dist/workflows/steps/PollJobsStep.js.map +1 -0
  414. package/dist/workflows/steps/PublishStep.js +33 -38
  415. package/dist/workflows/steps/PublishStep.js.map +1 -0
  416. package/dist/workflows/steps/SetupStep.js +71 -72
  417. package/dist/workflows/steps/SetupStep.js.map +1 -0
  418. package/dist/workflows/steps/TagStep.js +39 -44
  419. package/dist/workflows/steps/TagStep.js.map +1 -0
  420. package/dist/workflows/steps/UploadSourcesStep.js +108 -140
  421. package/dist/workflows/steps/UploadSourcesStep.js.map +1 -0
  422. package/dist/workflows/steps/UploadTranslationsStep.js +61 -71
  423. package/dist/workflows/steps/UploadTranslationsStep.js.map +1 -0
  424. package/dist/workflows/steps/UserEditDiffsStep.js +32 -34
  425. package/dist/workflows/steps/UserEditDiffsStep.js.map +1 -0
  426. package/dist/workflows/steps/WorkflowStep.js +6 -2
  427. package/dist/workflows/steps/WorkflowStep.js.map +1 -0
  428. package/dist/workflows/upload.js +45 -46
  429. package/dist/workflows/upload.js.map +1 -0
  430. package/package.json +14 -7
@@ -1,61 +1,49 @@
1
- import fs from 'node:fs';
2
- import { displayUpdatedConfigFile } from '../../console/logging.js';
3
- import { logger } from '../../console/logger.js';
1
+ import { logger } from "../../console/logger.js";
2
+ import { displayUpdatedConfigFile } from "../../console/logging.js";
3
+ import fs from "node:fs";
4
+ //#region src/fs/config/updateConfig.ts
4
5
  /**
5
- * Update the config file version id, locales, and projectId (if necessary)
6
- * @param {string} configFilepath - The path to the config file.
7
- * @param {UpdateConfigOptions} options - The options to update the config file with.
8
- * @returns {Promise<void>} - A promise that resolves when the config file is updated.
9
- *
10
- * Hint: Mark a field as null to remove it from the config file.
11
- */
12
- export default async function updateConfig(configFilepath, options) {
13
- // Filter out empty string values from the config object
14
- const { projectId, _versionId, _branchId, stageTranslations } = options;
15
- const newContent = {
16
- ...(projectId && { projectId }),
17
- ...(_versionId && { _versionId }),
18
- ...(_branchId && { _branchId }),
19
- // Omit when false
20
- ...(stageTranslations && { stageTranslations }),
21
- };
22
- try {
23
- // if file exists
24
- let oldContent = {};
25
- if (fs.existsSync(configFilepath)) {
26
- const parsed = JSON.parse(await fs.promises.readFile(configFilepath, 'utf-8'));
27
- oldContent =
28
- typeof parsed === 'object' && parsed !== null
29
- ? parsed
30
- : {};
31
- }
32
- // merge old and new content
33
- const mergedContent = {
34
- ...oldContent,
35
- ...newContent,
36
- };
37
- // Apply null filter to remove values that were marked for removal
38
- const filteredContent = applyNullFilter(mergedContent, options);
39
- // write to file
40
- const jsonContent = JSON.stringify(filteredContent, null, 2);
41
- await fs.promises.writeFile(configFilepath, jsonContent, 'utf-8');
42
- // show update in console
43
- displayUpdatedConfigFile(configFilepath);
44
- }
45
- catch (error) {
46
- logger.error(`An error occurred while updating ${configFilepath}: ${error}`);
47
- }
6
+ * Update the config file version id, locales, and projectId (if necessary)
7
+ * @param {string} configFilepath - The path to the config file.
8
+ * @param {UpdateConfigOptions} options - The options to update the config file with.
9
+ * @returns {Promise<void>} - A promise that resolves when the config file is updated.
10
+ *
11
+ * Hint: Mark a field as null to remove it from the config file.
12
+ */
13
+ async function updateConfig(configFilepath, options) {
14
+ const { projectId, _versionId, _branchId, stageTranslations } = options;
15
+ const newContent = {
16
+ ...projectId && { projectId },
17
+ ..._versionId && { _versionId },
18
+ ..._branchId && { _branchId },
19
+ ...stageTranslations && { stageTranslations }
20
+ };
21
+ try {
22
+ let oldContent = {};
23
+ if (fs.existsSync(configFilepath)) {
24
+ const parsed = JSON.parse(await fs.promises.readFile(configFilepath, "utf-8"));
25
+ oldContent = typeof parsed === "object" && parsed !== null ? parsed : {};
26
+ }
27
+ const filteredContent = applyNullFilter({
28
+ ...oldContent,
29
+ ...newContent
30
+ }, options);
31
+ const jsonContent = JSON.stringify(filteredContent, null, 2);
32
+ await fs.promises.writeFile(configFilepath, jsonContent, "utf-8");
33
+ displayUpdatedConfigFile(configFilepath);
34
+ } catch (error) {
35
+ logger.error(`An error occurred while updating ${configFilepath}: ${error}`);
36
+ }
48
37
  }
49
- // --- Helper functions --- //
50
38
  /**
51
- * Remove values from object if they were marked for removal
52
- */
39
+ * Remove values from object if they were marked for removal
40
+ */
53
41
  function applyNullFilter(obj, filter) {
54
- const result = { ...obj };
55
- for (const key of Object.keys(filter)) {
56
- if (filter[key] === null) {
57
- delete result[key];
58
- }
59
- }
60
- return result;
42
+ const result = { ...obj };
43
+ for (const key of Object.keys(filter)) if (filter[key] === null) delete result[key];
44
+ return result;
61
45
  }
46
+ //#endregion
47
+ export { updateConfig as default };
48
+
49
+ //# sourceMappingURL=updateConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateConfig.js","names":[],"sources":["../../../src/fs/config/updateConfig.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { displayUpdatedConfigFile } from '../../console/logging.js';\nimport { logger } from '../../console/logger.js';\n\n/**\n * Options for updating the config file.\n *\n * Since these are all string values, we can use null to mark them for removal\n */\ntype UpdateConfigOptions = {\n projectId?: string | null;\n _versionId?: string | null;\n _branchId?: string | null;\n stageTranslations?: boolean | null;\n};\n\n/**\n * Update the config file version id, locales, and projectId (if necessary)\n * @param {string} configFilepath - The path to the config file.\n * @param {UpdateConfigOptions} options - The options to update the config file with.\n * @returns {Promise<void>} - A promise that resolves when the config file is updated.\n *\n * Hint: Mark a field as null to remove it from the config file.\n */\nexport default async function updateConfig(\n configFilepath: string,\n options: UpdateConfigOptions\n): Promise<void> {\n // Filter out empty string values from the config object\n const { projectId, _versionId, _branchId, stageTranslations } = options;\n const newContent = {\n ...(projectId && { projectId }),\n ...(_versionId && { _versionId }),\n ...(_branchId && { _branchId }),\n // Omit when false\n ...(stageTranslations && { stageTranslations }),\n };\n\n try {\n // if file exists\n let oldContent: Record<string, unknown> = {};\n if (fs.existsSync(configFilepath)) {\n const parsed = JSON.parse(\n await fs.promises.readFile(configFilepath, 'utf-8')\n );\n oldContent =\n typeof parsed === 'object' && parsed !== null\n ? (parsed as Record<string, unknown>)\n : {};\n }\n\n // merge old and new content\n const mergedContent = {\n ...oldContent,\n ...newContent,\n };\n\n // Apply null filter to remove values that were marked for removal\n const filteredContent = applyNullFilter(mergedContent, options);\n\n // write to file\n const jsonContent = JSON.stringify(filteredContent, null, 2);\n await fs.promises.writeFile(configFilepath, jsonContent, 'utf-8');\n\n // show update in console\n displayUpdatedConfigFile(configFilepath);\n } catch (error) {\n logger.error(\n `An error occurred while updating ${configFilepath}: ${error}`\n );\n }\n}\n\n// --- Helper functions --- //\n\n/**\n * Remove values from object if they were marked for removal\n */\nfunction applyNullFilter<T extends Record<string, unknown>>(\n obj: T,\n filter: Partial<Record<keyof T, null | unknown>>\n): T {\n const result = { ...obj };\n for (const key of Object.keys(filter)) {\n if (filter[key] === null) {\n delete result[key];\n }\n }\n return result;\n}\n"],"mappings":";;;;;;;;;;;;AAwBA,eAA8B,aAC5B,gBACA,SACe;CAEf,MAAM,EAAE,WAAW,YAAY,WAAW,sBAAsB;CAChE,MAAM,aAAa;EACjB,GAAI,aAAa,EAAE,WAAW;EAC9B,GAAI,cAAc,EAAE,YAAY;EAChC,GAAI,aAAa,EAAE,WAAW;EAE9B,GAAI,qBAAqB,EAAE,mBAAmB;EAC/C;AAED,KAAI;EAEF,IAAI,aAAsC,EAAE;AAC5C,MAAI,GAAG,WAAW,eAAe,EAAE;GACjC,MAAM,SAAS,KAAK,MAClB,MAAM,GAAG,SAAS,SAAS,gBAAgB,QAAQ,CACpD;AACD,gBACE,OAAO,WAAW,YAAY,WAAW,OACpC,SACD,EAAE;;EAUV,MAAM,kBAAkB,gBAAgB;GALtC,GAAG;GACH,GAAG;GAIgD,EAAE,QAAQ;EAG/D,MAAM,cAAc,KAAK,UAAU,iBAAiB,MAAM,EAAE;AAC5D,QAAM,GAAG,SAAS,UAAU,gBAAgB,aAAa,QAAQ;AAGjE,2BAAyB,eAAe;UACjC,OAAO;AACd,SAAO,MACL,oCAAoC,eAAe,IAAI,QACxD;;;;;;AASL,SAAS,gBACP,KACA,QACG;CACH,MAAM,SAAS,EAAE,GAAG,KAAK;AACzB,MAAK,MAAM,OAAO,OAAO,KAAK,OAAO,CACnC,KAAI,OAAO,SAAS,KAClB,QAAO,OAAO;AAGlB,QAAO"}
@@ -1,30 +1,29 @@
1
- import fs from 'node:fs';
2
- import { displayUpdatedVersionsFile } from '../../console/logging.js';
3
- import { logger } from '../../console/logger.js';
4
- import path from 'node:path';
5
- const STAGED_VERSIONS_FILE = 'staged-versions.json';
6
- // Update the versions.json file with the new version ids
7
- // of the translations that were sent to the API
8
- export async function updateVersions({ configDirectory, versionData, }) {
9
- const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);
10
- try {
11
- fs.mkdirSync(configDirectory, { recursive: true });
12
- fs.writeFileSync(versionFilepath, JSON.stringify(versionData, null, 2));
13
- // show update in console
14
- displayUpdatedVersionsFile(versionFilepath);
15
- }
16
- catch (error) {
17
- logger.error(`An error occurred while updating ${versionFilepath}: ${error}`);
18
- }
1
+ import { logger } from "../../console/logger.js";
2
+ import { displayUpdatedVersionsFile } from "../../console/logging.js";
3
+ import path from "node:path";
4
+ import fs from "node:fs";
5
+ //#region src/fs/config/updateVersions.ts
6
+ const STAGED_VERSIONS_FILE = "staged-versions.json";
7
+ async function updateVersions({ configDirectory, versionData }) {
8
+ const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);
9
+ try {
10
+ fs.mkdirSync(configDirectory, { recursive: true });
11
+ fs.writeFileSync(versionFilepath, JSON.stringify(versionData, null, 2));
12
+ displayUpdatedVersionsFile(versionFilepath);
13
+ } catch (error) {
14
+ logger.error(`An error occurred while updating ${versionFilepath}: ${error}`);
15
+ }
19
16
  }
20
- export async function getStagedVersions(configDirectory) {
21
- try {
22
- const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);
23
- const versionData = JSON.parse(fs.readFileSync(versionFilepath, 'utf8'));
24
- return versionData;
25
- }
26
- catch (error) {
27
- logger.error(`An error occurred while getting staged versions: ${error}`);
28
- return {};
29
- }
17
+ async function getStagedVersions(configDirectory) {
18
+ try {
19
+ const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);
20
+ return JSON.parse(fs.readFileSync(versionFilepath, "utf8"));
21
+ } catch (error) {
22
+ logger.error(`An error occurred while getting staged versions: ${error}`);
23
+ return {};
24
+ }
30
25
  }
26
+ //#endregion
27
+ export { getStagedVersions, updateVersions };
28
+
29
+ //# sourceMappingURL=updateVersions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateVersions.js","names":[],"sources":["../../../src/fs/config/updateVersions.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { displayUpdatedVersionsFile } from '../../console/logging.js';\nimport { logger } from '../../console/logger.js';\nimport path from 'node:path';\n\nconst STAGED_VERSIONS_FILE = 'staged-versions.json';\ntype StagedVersionData = Record<\n string, // fileId\n { fileName: string; versionId: string }\n>;\n// Update the versions.json file with the new version ids\n// of the translations that were sent to the API\nexport async function updateVersions({\n configDirectory,\n versionData,\n}: {\n configDirectory: string;\n versionData: StagedVersionData;\n}): Promise<void> {\n const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);\n try {\n fs.mkdirSync(configDirectory, { recursive: true });\n fs.writeFileSync(versionFilepath, JSON.stringify(versionData, null, 2));\n\n // show update in console\n displayUpdatedVersionsFile(versionFilepath);\n } catch (error) {\n logger.error(\n `An error occurred while updating ${versionFilepath}: ${error}`\n );\n }\n}\n\nexport async function getStagedVersions(\n configDirectory: string\n): Promise<StagedVersionData> {\n try {\n const versionFilepath = path.join(configDirectory, STAGED_VERSIONS_FILE);\n const versionData = JSON.parse(fs.readFileSync(versionFilepath, 'utf8'));\n return versionData;\n } catch (error) {\n logger.error(`An error occurred while getting staged versions: ${error}`);\n return {};\n }\n}\n"],"mappings":";;;;;AAKA,MAAM,uBAAuB;AAO7B,eAAsB,eAAe,EACnC,iBACA,eAIgB;CAChB,MAAM,kBAAkB,KAAK,KAAK,iBAAiB,qBAAqB;AACxE,KAAI;AACF,KAAG,UAAU,iBAAiB,EAAE,WAAW,MAAM,CAAC;AAClD,KAAG,cAAc,iBAAiB,KAAK,UAAU,aAAa,MAAM,EAAE,CAAC;AAGvE,6BAA2B,gBAAgB;UACpC,OAAO;AACd,SAAO,MACL,oCAAoC,gBAAgB,IAAI,QACzD;;;AAIL,eAAsB,kBACpB,iBAC4B;AAC5B,KAAI;EACF,MAAM,kBAAkB,KAAK,KAAK,iBAAiB,qBAAqB;AAExE,SADoB,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CACrD;UACX,OAAO;AACd,SAAO,MAAM,oDAAoD,QAAQ;AACzE,SAAO,EAAE"}
@@ -1,39 +1,35 @@
1
- import path from 'node:path';
2
- import fs from 'node:fs';
3
- import { logger } from '../console/logger.js';
1
+ import { logger } from "../console/logger.js";
2
+ import path from "node:path";
3
+ import fs from "node:fs";
4
+ //#region src/fs/copyFile.ts
4
5
  /**
5
- * Copy a file to target locale without translation
6
- *
7
- * This is a naive approach, does not allow for wild cards
8
- */
9
- export default async function copyFile(settings) {
10
- if (!settings.options?.copyFiles || settings.options.copyFiles.length === 0) {
11
- return;
12
- }
13
- // Construct a map of source paths to target paths
14
- const copyFiles = settings.options.copyFiles.reduce((paths, filePathTemplate) => {
15
- const sourcePath = path.join(process.cwd(), filePathTemplate.replace('[locale]', settings.defaultLocale));
16
- if (!fs.existsSync(sourcePath)) {
17
- logger.error(`Failed to copy files: File path does not exist: ${sourcePath}`);
18
- return paths;
19
- }
20
- paths[sourcePath] = [];
21
- for (const locale of settings.locales) {
22
- if (locale === settings.defaultLocale)
23
- continue;
24
- const targetPath = path.join(process.cwd(), filePathTemplate.replace('[locale]', locale));
25
- paths[sourcePath].push(targetPath);
26
- }
27
- return paths;
28
- }, {});
29
- // Copy each file to the target locale
30
- for (const sourcePath in copyFiles) {
31
- for (const targetPath of copyFiles[sourcePath]) {
32
- // Ensure the target directory exists
33
- const targetDir = path.dirname(targetPath);
34
- await fs.promises.mkdir(targetDir, { recursive: true });
35
- // Copy the file
36
- await fs.promises.copyFile(sourcePath, targetPath);
37
- }
38
- }
6
+ * Copy a file to target locale without translation
7
+ *
8
+ * This is a naive approach, does not allow for wild cards
9
+ */
10
+ async function copyFile(settings) {
11
+ if (!settings.options?.copyFiles || settings.options.copyFiles.length === 0) return;
12
+ const copyFiles = settings.options.copyFiles.reduce((paths, filePathTemplate) => {
13
+ const sourcePath = path.join(process.cwd(), filePathTemplate.replace("[locale]", settings.defaultLocale));
14
+ if (!fs.existsSync(sourcePath)) {
15
+ logger.error(`Failed to copy files: File path does not exist: ${sourcePath}`);
16
+ return paths;
17
+ }
18
+ paths[sourcePath] = [];
19
+ for (const locale of settings.locales) {
20
+ if (locale === settings.defaultLocale) continue;
21
+ const targetPath = path.join(process.cwd(), filePathTemplate.replace("[locale]", locale));
22
+ paths[sourcePath].push(targetPath);
23
+ }
24
+ return paths;
25
+ }, {});
26
+ for (const sourcePath in copyFiles) for (const targetPath of copyFiles[sourcePath]) {
27
+ const targetDir = path.dirname(targetPath);
28
+ await fs.promises.mkdir(targetDir, { recursive: true });
29
+ await fs.promises.copyFile(sourcePath, targetPath);
30
+ }
39
31
  }
32
+ //#endregion
33
+ export { copyFile as default };
34
+
35
+ //# sourceMappingURL=copyFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"copyFile.js","names":[],"sources":["../../src/fs/copyFile.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\nimport type { Settings } from '../types/index.js';\nimport { logger } from '../console/logger.js';\n\ntype CopyFileSettings = Pick<Settings, 'defaultLocale' | 'locales' | 'options'>;\n\n/**\n * Copy a file to target locale without translation\n *\n * This is a naive approach, does not allow for wild cards\n */\nexport default async function copyFile(settings: CopyFileSettings) {\n if (!settings.options?.copyFiles || settings.options.copyFiles.length === 0) {\n return;\n }\n\n // Construct a map of source paths to target paths\n const copyFiles = settings.options.copyFiles.reduce(\n (paths: Record<string, string[]>, filePathTemplate: string) => {\n const sourcePath = path.join(\n process.cwd(),\n filePathTemplate.replace('[locale]', settings.defaultLocale)\n );\n if (!fs.existsSync(sourcePath)) {\n logger.error(\n `Failed to copy files: File path does not exist: ${sourcePath}`\n );\n return paths;\n }\n paths[sourcePath] = [];\n for (const locale of settings.locales) {\n if (locale === settings.defaultLocale) continue;\n const targetPath = path.join(\n process.cwd(),\n filePathTemplate.replace('[locale]', locale)\n );\n paths[sourcePath].push(targetPath);\n }\n return paths;\n },\n {} as Record<string, string[]>\n );\n\n // Copy each file to the target locale\n for (const sourcePath in copyFiles) {\n for (const targetPath of copyFiles[sourcePath]) {\n // Ensure the target directory exists\n const targetDir = path.dirname(targetPath);\n await fs.promises.mkdir(targetDir, { recursive: true });\n\n // Copy the file\n await fs.promises.copyFile(sourcePath, targetPath);\n }\n }\n}\n"],"mappings":";;;;;;;;;AAYA,eAA8B,SAAS,UAA4B;AACjE,KAAI,CAAC,SAAS,SAAS,aAAa,SAAS,QAAQ,UAAU,WAAW,EACxE;CAIF,MAAM,YAAY,SAAS,QAAQ,UAAU,QAC1C,OAAiC,qBAA6B;EAC7D,MAAM,aAAa,KAAK,KACtB,QAAQ,KAAK,EACb,iBAAiB,QAAQ,YAAY,SAAS,cAAc,CAC7D;AACD,MAAI,CAAC,GAAG,WAAW,WAAW,EAAE;AAC9B,UAAO,MACL,mDAAmD,aACpD;AACD,UAAO;;AAET,QAAM,cAAc,EAAE;AACtB,OAAK,MAAM,UAAU,SAAS,SAAS;AACrC,OAAI,WAAW,SAAS,cAAe;GACvC,MAAM,aAAa,KAAK,KACtB,QAAQ,KAAK,EACb,iBAAiB,QAAQ,YAAY,OAAO,CAC7C;AACD,SAAM,YAAY,KAAK,WAAW;;AAEpC,SAAO;IAET,EAAE,CACH;AAGD,MAAK,MAAM,cAAc,UACvB,MAAK,MAAM,cAAc,UAAU,aAAa;EAE9C,MAAM,YAAY,KAAK,QAAQ,WAAW;AAC1C,QAAM,GAAG,SAAS,MAAM,WAAW,EAAE,WAAW,MAAM,CAAC;AAGvD,QAAM,GAAG,SAAS,SAAS,YAAY,WAAW"}
@@ -1,34 +1,21 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { logger } from '../console/logger.js';
4
- import chalk from 'chalk';
5
- import { DEFAULT_TRANSLATIONS_DIR } from '../utils/constants.js';
1
+ import { logger } from "../console/logger.js";
2
+ import { DEFAULT_TRANSLATIONS_DIR } from "../utils/constants.js";
3
+ import chalk from "chalk";
4
+ import path from "node:path";
5
+ import fs from "node:fs";
6
+ //#region src/fs/createLoadTranslationsFile.ts
6
7
  function toRelativeImportPath(relativePath) {
7
- const normalizedPath = relativePath.split(path.sep).join(path.posix.sep);
8
- if (!normalizedPath) {
9
- return './';
10
- }
11
- // Dynamic imports must use explicit relative specifiers; values like
12
- // "src/_gt" are otherwise treated as package names by Vite and Node.
13
- const hasExplicitRelativePrefix = normalizedPath === '..' ||
14
- normalizedPath.startsWith('../') ||
15
- normalizedPath.startsWith('./');
16
- return hasExplicitRelativePrefix
17
- ? `${normalizedPath}/`
18
- : `./${normalizedPath}/`;
8
+ const normalizedPath = relativePath.split(path.sep).join(path.posix.sep);
9
+ if (!normalizedPath) return "./";
10
+ return normalizedPath === ".." || normalizedPath.startsWith("../") || normalizedPath.startsWith("./") ? `${normalizedPath}/` : `./${normalizedPath}/`;
19
11
  }
20
- export async function createLoadTranslationsFile(appDirectory, translationsDir = DEFAULT_TRANSLATIONS_DIR, locales) {
21
- const usingSrcDirectory = fs.existsSync(path.join(appDirectory, 'src'));
22
- const loadTranslationsDir = usingSrcDirectory
23
- ? path.join(appDirectory, 'src')
24
- : appDirectory;
25
- const relativePath = path.relative(loadTranslationsDir, path.resolve(appDirectory, translationsDir));
26
- const publicPath = toRelativeImportPath(relativePath);
27
- const filePath = usingSrcDirectory
28
- ? path.join(appDirectory, 'src', 'loadTranslations.js')
29
- : path.join(appDirectory, 'loadTranslations.js');
30
- if (!fs.existsSync(filePath)) {
31
- const loadTranslationsContent = `
12
+ async function createLoadTranslationsFile(appDirectory, translationsDir = DEFAULT_TRANSLATIONS_DIR, locales) {
13
+ const usingSrcDirectory = fs.existsSync(path.join(appDirectory, "src"));
14
+ const loadTranslationsDir = usingSrcDirectory ? path.join(appDirectory, "src") : appDirectory;
15
+ const publicPath = toRelativeImportPath(path.relative(loadTranslationsDir, path.resolve(appDirectory, translationsDir)));
16
+ const filePath = usingSrcDirectory ? path.join(appDirectory, "src", "loadTranslations.js") : path.join(appDirectory, "loadTranslations.js");
17
+ if (!fs.existsSync(filePath)) {
18
+ const loadTranslationsContent = `
32
19
  export default async function loadTranslations(locale) {
33
20
  try {
34
21
  // Load translations from ${translationsDir} directory
@@ -41,23 +28,20 @@ export default async function loadTranslations(locale) {
41
28
  }
42
29
  }
43
30
  `;
44
- await fs.promises.writeFile(filePath, loadTranslationsContent);
45
- logger.info(`Created ${chalk.cyan('loadTranslations.js')} file at ${chalk.cyan(filePath)}.`);
46
- try {
47
- await fs.promises.mkdir(translationsDir, { recursive: true });
48
- // Create empty JSON files
49
- for (const locale of locales) {
50
- if (fs.existsSync(path.join(translationsDir, `${locale}.json`))) {
51
- continue;
52
- }
53
- await fs.promises.writeFile(path.join(translationsDir, `${locale}.json`), '{}');
54
- }
55
- }
56
- catch (error) {
57
- logger.error(`Failed to create translations directory: ${error}`);
58
- }
59
- }
60
- else {
61
- logger.info(`Found ${chalk.cyan('loadTranslations.js')} file at ${chalk.cyan(filePath)}. Skipping creation...`);
62
- }
31
+ await fs.promises.writeFile(filePath, loadTranslationsContent);
32
+ logger.info(`Created ${chalk.cyan("loadTranslations.js")} file at ${chalk.cyan(filePath)}.`);
33
+ try {
34
+ await fs.promises.mkdir(translationsDir, { recursive: true });
35
+ for (const locale of locales) {
36
+ if (fs.existsSync(path.join(translationsDir, `${locale}.json`))) continue;
37
+ await fs.promises.writeFile(path.join(translationsDir, `${locale}.json`), "{}");
38
+ }
39
+ } catch (error) {
40
+ logger.error(`Failed to create translations directory: ${error}`);
41
+ }
42
+ } else logger.info(`Found ${chalk.cyan("loadTranslations.js")} file at ${chalk.cyan(filePath)}. Skipping creation...`);
63
43
  }
44
+ //#endregion
45
+ export { createLoadTranslationsFile };
46
+
47
+ //# sourceMappingURL=createLoadTranslationsFile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createLoadTranslationsFile.js","names":[],"sources":["../../src/fs/createLoadTranslationsFile.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { logger } from '../console/logger.js';\nimport chalk from 'chalk';\nimport { DEFAULT_TRANSLATIONS_DIR } from '../utils/constants.js';\n\nfunction toRelativeImportPath(relativePath: string) {\n const normalizedPath = relativePath.split(path.sep).join(path.posix.sep);\n\n if (!normalizedPath) {\n return './';\n }\n\n // Dynamic imports must use explicit relative specifiers; values like\n // \"src/_gt\" are otherwise treated as package names by Vite and Node.\n const hasExplicitRelativePrefix =\n normalizedPath === '..' ||\n normalizedPath.startsWith('../') ||\n normalizedPath.startsWith('./');\n\n return hasExplicitRelativePrefix\n ? `${normalizedPath}/`\n : `./${normalizedPath}/`;\n}\n\nexport async function createLoadTranslationsFile(\n appDirectory: string,\n translationsDir: string = DEFAULT_TRANSLATIONS_DIR,\n locales: string[]\n) {\n const usingSrcDirectory = fs.existsSync(path.join(appDirectory, 'src'));\n\n const loadTranslationsDir = usingSrcDirectory\n ? path.join(appDirectory, 'src')\n : appDirectory;\n const relativePath = path.relative(\n loadTranslationsDir,\n path.resolve(appDirectory, translationsDir)\n );\n const publicPath = toRelativeImportPath(relativePath);\n\n const filePath = usingSrcDirectory\n ? path.join(appDirectory, 'src', 'loadTranslations.js')\n : path.join(appDirectory, 'loadTranslations.js');\n\n if (!fs.existsSync(filePath)) {\n const loadTranslationsContent = `\nexport default async function loadTranslations(locale) {\n try {\n // Load translations from ${translationsDir} directory\n // This matches the GT config files.gt.output path\n const t = await import(\\`${publicPath}\\${locale}.json\\`);\n return t.default;\n } catch (error) {\n console.warn(\\`Failed to load translations for locale \\${locale}:\\`, error);\n return {};\n }\n}\n`;\n await fs.promises.writeFile(filePath, loadTranslationsContent);\n logger.info(\n `Created ${chalk.cyan(\n 'loadTranslations.js'\n )} file at ${chalk.cyan(filePath)}.`\n );\n try {\n await fs.promises.mkdir(translationsDir, { recursive: true });\n // Create empty JSON files\n for (const locale of locales) {\n if (fs.existsSync(path.join(translationsDir, `${locale}.json`))) {\n continue;\n }\n await fs.promises.writeFile(\n path.join(translationsDir, `${locale}.json`),\n '{}'\n );\n }\n } catch (error) {\n logger.error(`Failed to create translations directory: ${error}`);\n }\n } else {\n logger.info(\n `Found ${chalk.cyan('loadTranslations.js')} file at ${chalk.cyan(\n filePath\n )}. Skipping creation...`\n );\n }\n}\n"],"mappings":";;;;;;AAMA,SAAS,qBAAqB,cAAsB;CAClD,MAAM,iBAAiB,aAAa,MAAM,KAAK,IAAI,CAAC,KAAK,KAAK,MAAM,IAAI;AAExE,KAAI,CAAC,eACH,QAAO;AAUT,QAJE,mBAAmB,QACnB,eAAe,WAAW,MAAM,IAChC,eAAe,WAAW,KAAK,GAG7B,GAAG,eAAe,KAClB,KAAK,eAAe;;AAG1B,eAAsB,2BACpB,cACA,kBAA0B,0BAC1B,SACA;CACA,MAAM,oBAAoB,GAAG,WAAW,KAAK,KAAK,cAAc,MAAM,CAAC;CAEvE,MAAM,sBAAsB,oBACxB,KAAK,KAAK,cAAc,MAAM,GAC9B;CAKJ,MAAM,aAAa,qBAJE,KAAK,SACxB,qBACA,KAAK,QAAQ,cAAc,gBAAgB,CAEO,CAAC;CAErD,MAAM,WAAW,oBACb,KAAK,KAAK,cAAc,OAAO,sBAAsB,GACrD,KAAK,KAAK,cAAc,sBAAsB;AAElD,KAAI,CAAC,GAAG,WAAW,SAAS,EAAE;EAC5B,MAAM,0BAA0B;;;gCAGJ,gBAAgB;;+BAEjB,WAAW;;;;;;;;AAQtC,QAAM,GAAG,SAAS,UAAU,UAAU,wBAAwB;AAC9D,SAAO,KACL,WAAW,MAAM,KACf,sBACD,CAAC,WAAW,MAAM,KAAK,SAAS,CAAC,GACnC;AACD,MAAI;AACF,SAAM,GAAG,SAAS,MAAM,iBAAiB,EAAE,WAAW,MAAM,CAAC;AAE7D,QAAK,MAAM,UAAU,SAAS;AAC5B,QAAI,GAAG,WAAW,KAAK,KAAK,iBAAiB,GAAG,OAAO,OAAO,CAAC,CAC7D;AAEF,UAAM,GAAG,SAAS,UAChB,KAAK,KAAK,iBAAiB,GAAG,OAAO,OAAO,EAC5C,KACD;;WAEI,OAAO;AACd,UAAO,MAAM,4CAA4C,QAAQ;;OAGnE,QAAO,KACL,SAAS,MAAM,KAAK,sBAAsB,CAAC,WAAW,MAAM,KAC1D,SACD,CAAC,wBACH"}
@@ -1,36 +1,32 @@
1
- import path from 'node:path';
2
- import fs from 'node:fs';
3
- import { matchPyprojectDependency } from './matchPyprojectDependency.js';
4
- import { matchRequirementsTxtDependency } from './matchRequirementsTxtDependency.js';
5
- import { matchSetupPyDependency } from './matchSetupPyDependency.js';
1
+ import { matchPyprojectDependency } from "./matchPyprojectDependency.js";
2
+ import { matchRequirementsTxtDependency } from "./matchRequirementsTxtDependency.js";
3
+ import { matchSetupPyDependency } from "./matchSetupPyDependency.js";
4
+ import path from "node:path";
5
+ import fs from "node:fs";
6
+ //#region src/fs/determineFramework/detectPythonLibrary.ts
6
7
  /**
7
- * Detect Python GT library from pyproject.toml, requirements.txt, or setup.py.
8
- * Checks files in priority order: pyproject.toml → requirements.txt → setup.py.
9
- */
10
- export function detectPythonLibrary(cwd) {
11
- // Check pyproject.toml
12
- const pyprojectPath = path.join(cwd, 'pyproject.toml');
13
- if (fs.existsSync(pyprojectPath)) {
14
- const content = fs.readFileSync(pyprojectPath, 'utf8');
15
- const result = matchPyprojectDependency(content);
16
- if (result)
17
- return result;
18
- }
19
- // Check requirements.txt
20
- const requirementsPath = path.join(cwd, 'requirements.txt');
21
- if (fs.existsSync(requirementsPath)) {
22
- const content = fs.readFileSync(requirementsPath, 'utf8');
23
- const result = matchRequirementsTxtDependency(content);
24
- if (result)
25
- return result;
26
- }
27
- // Check setup.py
28
- const setupPath = path.join(cwd, 'setup.py');
29
- if (fs.existsSync(setupPath)) {
30
- const content = fs.readFileSync(setupPath, 'utf8');
31
- const result = matchSetupPyDependency(content);
32
- if (result)
33
- return result;
34
- }
35
- return null;
8
+ * Detect Python GT library from pyproject.toml, requirements.txt, or setup.py.
9
+ * Checks files in priority order: pyproject.toml → requirements.txt → setup.py.
10
+ */
11
+ function detectPythonLibrary(cwd) {
12
+ const pyprojectPath = path.join(cwd, "pyproject.toml");
13
+ if (fs.existsSync(pyprojectPath)) {
14
+ const result = matchPyprojectDependency(fs.readFileSync(pyprojectPath, "utf8"));
15
+ if (result) return result;
16
+ }
17
+ const requirementsPath = path.join(cwd, "requirements.txt");
18
+ if (fs.existsSync(requirementsPath)) {
19
+ const result = matchRequirementsTxtDependency(fs.readFileSync(requirementsPath, "utf8"));
20
+ if (result) return result;
21
+ }
22
+ const setupPath = path.join(cwd, "setup.py");
23
+ if (fs.existsSync(setupPath)) {
24
+ const result = matchSetupPyDependency(fs.readFileSync(setupPath, "utf8"));
25
+ if (result) return result;
26
+ }
27
+ return null;
36
28
  }
29
+ //#endregion
30
+ export { detectPythonLibrary };
31
+
32
+ //# sourceMappingURL=detectPythonLibrary.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"detectPythonLibrary.js","names":[],"sources":["../../../src/fs/determineFramework/detectPythonLibrary.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\nimport { Libraries } from '../../types/libraries.js';\nimport { matchPyprojectDependency } from './matchPyprojectDependency.js';\nimport { matchRequirementsTxtDependency } from './matchRequirementsTxtDependency.js';\nimport { matchSetupPyDependency } from './matchSetupPyDependency.js';\n\n/**\n * Detect Python GT library from pyproject.toml, requirements.txt, or setup.py.\n * Checks files in priority order: pyproject.toml → requirements.txt → setup.py.\n */\nexport function detectPythonLibrary(\n cwd: string\n): typeof Libraries.GT_FLASK | typeof Libraries.GT_FASTAPI | null {\n // Check pyproject.toml\n const pyprojectPath = path.join(cwd, 'pyproject.toml');\n if (fs.existsSync(pyprojectPath)) {\n const content = fs.readFileSync(pyprojectPath, 'utf8');\n const result = matchPyprojectDependency(content);\n if (result) return result;\n }\n\n // Check requirements.txt\n const requirementsPath = path.join(cwd, 'requirements.txt');\n if (fs.existsSync(requirementsPath)) {\n const content = fs.readFileSync(requirementsPath, 'utf8');\n const result = matchRequirementsTxtDependency(content);\n if (result) return result;\n }\n\n // Check setup.py\n const setupPath = path.join(cwd, 'setup.py');\n if (fs.existsSync(setupPath)) {\n const content = fs.readFileSync(setupPath, 'utf8');\n const result = matchSetupPyDependency(content);\n if (result) return result;\n }\n\n return null;\n}\n"],"mappings":";;;;;;;;;;AAWA,SAAgB,oBACd,KACgE;CAEhE,MAAM,gBAAgB,KAAK,KAAK,KAAK,iBAAiB;AACtD,KAAI,GAAG,WAAW,cAAc,EAAE;EAEhC,MAAM,SAAS,yBADC,GAAG,aAAa,eAAe,OACA,CAAC;AAChD,MAAI,OAAQ,QAAO;;CAIrB,MAAM,mBAAmB,KAAK,KAAK,KAAK,mBAAmB;AAC3D,KAAI,GAAG,WAAW,iBAAiB,EAAE;EAEnC,MAAM,SAAS,+BADC,GAAG,aAAa,kBAAkB,OACG,CAAC;AACtD,MAAI,OAAQ,QAAO;;CAIrB,MAAM,YAAY,KAAK,KAAK,KAAK,WAAW;AAC5C,KAAI,GAAG,WAAW,UAAU,EAAE;EAE5B,MAAM,SAAS,uBADC,GAAG,aAAa,WAAW,OACE,CAAC;AAC9C,MAAI,OAAQ,QAAO;;AAGrB,QAAO"}
@@ -1,65 +1,47 @@
1
- import chalk from 'chalk';
2
- import path from 'node:path';
3
- import fs from 'node:fs';
4
- import { logger } from '../../console/logger.js';
5
- import { Libraries } from '../../types/libraries.js';
6
- import { detectPythonLibrary } from './detectPythonLibrary.js';
7
- export function determineLibrary() {
8
- let library = 'base';
9
- const additionalModules = [];
10
- try {
11
- // Get the current working directory (where the CLI is being run)
12
- const cwd = process.cwd();
13
- const packageJsonPath = path.join(cwd, 'package.json');
14
- // Check if package.json exists
15
- if (fs.existsSync(packageJsonPath)) {
16
- // Read and parse package.json
17
- const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
18
- const dependencies = {
19
- ...packageJson.dependencies,
20
- ...packageJson.devDependencies,
21
- };
22
- // Check for gt-next or gt-react in dependencies
23
- if (dependencies[Libraries.GT_NEXT]) {
24
- library = Libraries.GT_NEXT;
25
- }
26
- else if (dependencies[Libraries.GT_TANSTACK_START]) {
27
- library = Libraries.GT_TANSTACK_START;
28
- }
29
- else if (dependencies[Libraries.GT_REACT]) {
30
- library = Libraries.GT_REACT;
31
- }
32
- else if (dependencies[Libraries.GT_REACT_NATIVE]) {
33
- library = Libraries.GT_REACT_NATIVE;
34
- }
35
- else if (dependencies[Libraries.GT_NODE]) {
36
- library = Libraries.GT_NODE;
37
- }
38
- else if (dependencies['next-intl']) {
39
- library = 'next-intl';
40
- }
41
- else if (dependencies['i18next']) {
42
- library = 'i18next';
43
- }
44
- if (dependencies['i18next-icu']) {
45
- additionalModules.push('i18next-icu');
46
- }
47
- }
48
- // If no JS library found, check for Python project files
49
- if (library === 'base') {
50
- const pythonLibrary = detectPythonLibrary(cwd);
51
- if (pythonLibrary) {
52
- library = pythonLibrary;
53
- }
54
- else if (!fs.existsSync(path.join(cwd, 'package.json'))) {
55
- logger.warn(chalk.yellow('No package.json or Python project file found in the current directory. Run this command from the root of your project.'));
56
- }
57
- }
58
- // Fallback to base if neither is found
59
- return { library, additionalModules };
60
- }
61
- catch (error) {
62
- logger.error('Error determining framework: ' + String(error));
63
- return { library: 'base', additionalModules: [] };
64
- }
1
+ import { logger } from "../../console/logger.js";
2
+ import "../../types/libraries.js";
3
+ import { detectPythonLibrary } from "./detectPythonLibrary.js";
4
+ import path from "node:path";
5
+ import fs from "node:fs";
6
+ //#region src/fs/determineFramework/index.ts
7
+ function determineLibrary() {
8
+ let library = "base";
9
+ const additionalModules = [];
10
+ try {
11
+ const cwd = process.cwd();
12
+ const packageJsonPath = path.join(cwd, "package.json");
13
+ if (fs.existsSync(packageJsonPath)) {
14
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
15
+ const dependencies = {
16
+ ...packageJson.dependencies,
17
+ ...packageJson.devDependencies
18
+ };
19
+ if (dependencies["gt-next"]) library = "gt-next";
20
+ else if (dependencies["gt-tanstack-start"]) library = "gt-tanstack-start";
21
+ else if (dependencies["gt-react"]) library = "gt-react";
22
+ else if (dependencies["gt-react-native"]) library = "gt-react-native";
23
+ else if (dependencies["gt-node"]) library = "gt-node";
24
+ else if (dependencies["next-intl"]) library = "next-intl";
25
+ else if (dependencies["i18next"]) library = "i18next";
26
+ if (dependencies["i18next-icu"]) additionalModules.push("i18next-icu");
27
+ }
28
+ if (library === "base") {
29
+ const pythonLibrary = detectPythonLibrary(cwd);
30
+ if (pythonLibrary) library = pythonLibrary;
31
+ }
32
+ return {
33
+ library,
34
+ additionalModules
35
+ };
36
+ } catch (error) {
37
+ logger.error("Error determining framework: " + String(error));
38
+ return {
39
+ library: "base",
40
+ additionalModules: []
41
+ };
42
+ }
65
43
  }
44
+ //#endregion
45
+ export { determineLibrary };
46
+
47
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../src/fs/determineFramework/index.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\nimport { SupportedLibraries } from '../../types/index.js';\nimport { logger } from '../../console/logger.js';\nimport { Libraries } from '../../types/libraries.js';\nimport { detectPythonLibrary } from './detectPythonLibrary.js';\n\nexport function determineLibrary(): {\n library: SupportedLibraries;\n additionalModules: SupportedLibraries[];\n} {\n let library: SupportedLibraries = 'base';\n const additionalModules: SupportedLibraries[] = [];\n try {\n // Get the current working directory (where the CLI is being run)\n const cwd = process.cwd();\n const packageJsonPath = path.join(cwd, 'package.json');\n\n // Check if package.json exists\n if (fs.existsSync(packageJsonPath)) {\n // Read and parse package.json\n const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));\n const dependencies = {\n ...packageJson.dependencies,\n ...packageJson.devDependencies,\n };\n\n // Check for gt-next or gt-react in dependencies\n if (dependencies[Libraries.GT_NEXT]) {\n library = Libraries.GT_NEXT;\n } else if (dependencies[Libraries.GT_TANSTACK_START]) {\n library = Libraries.GT_TANSTACK_START;\n } else if (dependencies[Libraries.GT_REACT]) {\n library = Libraries.GT_REACT;\n } else if (dependencies[Libraries.GT_REACT_NATIVE]) {\n library = Libraries.GT_REACT_NATIVE;\n } else if (dependencies[Libraries.GT_NODE]) {\n library = Libraries.GT_NODE;\n } else if (dependencies['next-intl']) {\n library = 'next-intl';\n } else if (dependencies['i18next']) {\n library = 'i18next';\n }\n\n if (dependencies['i18next-icu']) {\n additionalModules.push('i18next-icu');\n }\n }\n\n // If no JS library found, check for Python project files\n if (library === 'base') {\n const pythonLibrary = detectPythonLibrary(cwd);\n if (pythonLibrary) {\n library = pythonLibrary;\n }\n }\n\n // Fallback to base if neither is found\n return { library, additionalModules };\n } catch (error) {\n logger.error('Error determining framework: ' + String(error));\n return { library: 'base', additionalModules: [] };\n }\n}\n"],"mappings":";;;;;;AAOA,SAAgB,mBAGd;CACA,IAAI,UAA8B;CAClC,MAAM,oBAA0C,EAAE;AAClD,KAAI;EAEF,MAAM,MAAM,QAAQ,KAAK;EACzB,MAAM,kBAAkB,KAAK,KAAK,KAAK,eAAe;AAGtD,MAAI,GAAG,WAAW,gBAAgB,EAAE;GAElC,MAAM,cAAc,KAAK,MAAM,GAAG,aAAa,iBAAiB,OAAO,CAAC;GACxE,MAAM,eAAe;IACnB,GAAG,YAAY;IACf,GAAG,YAAY;IAChB;AAGD,OAAI,aAAA,WACF,WAAA;YACS,aAAA,qBACT,WAAA;YACS,aAAA,YACT,WAAA;YACS,aAAA,mBACT,WAAA;YACS,aAAA,WACT,WAAA;YACS,aAAa,aACtB,WAAU;YACD,aAAa,WACtB,WAAU;AAGZ,OAAI,aAAa,eACf,mBAAkB,KAAK,cAAc;;AAKzC,MAAI,YAAY,QAAQ;GACtB,MAAM,gBAAgB,oBAAoB,IAAI;AAC9C,OAAI,cACF,WAAU;;AAKd,SAAO;GAAE;GAAS;GAAmB;UAC9B,OAAO;AACd,SAAO,MAAM,kCAAkC,OAAO,MAAM,CAAC;AAC7D,SAAO;GAAE,SAAS;GAAQ,mBAAmB,EAAE;GAAE"}