gt 2.14.35 → 2.14.36

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 (429) hide show
  1. package/CHANGELOG.md +16 -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.js +104 -108
  256. package/dist/react/jsx/utils/resolveImportPath.js.map +1 -0
  257. package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js +18 -24
  258. package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js.map +1 -0
  259. package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js +412 -579
  260. package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js.map +1 -0
  261. package/dist/react/jsx/utils/stringParsing/derivation/index.js +57 -67
  262. package/dist/react/jsx/utils/stringParsing/derivation/index.js.map +1 -0
  263. package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js +26 -36
  264. package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js.map +1 -0
  265. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js +29 -24
  266. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js.map +1 -0
  267. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js +34 -32
  268. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js.map +1 -0
  269. package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js +80 -117
  270. package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js.map +1 -0
  271. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js +24 -19
  272. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js.map +1 -0
  273. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js +18 -21
  274. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js.map +1 -0
  275. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js +45 -50
  276. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js.map +1 -0
  277. package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js +54 -59
  278. package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js.map +1 -0
  279. package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js +56 -69
  280. package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js.map +1 -0
  281. package/dist/react/jsx/utils/validateStringFunction.js +21 -29
  282. package/dist/react/jsx/utils/validateStringFunction.js.map +1 -0
  283. package/dist/react/jsx/wrapJsx.js +192 -375
  284. package/dist/react/jsx/wrapJsx.js.map +1 -0
  285. package/dist/react/parse/addVitePlugin/index.js +40 -34
  286. package/dist/react/parse/addVitePlugin/index.js.map +1 -0
  287. package/dist/react/parse/addVitePlugin/installCompiler.js +18 -20
  288. package/dist/react/parse/addVitePlugin/installCompiler.js.map +1 -0
  289. package/dist/react/parse/addVitePlugin/updateViteConfig.js +107 -111
  290. package/dist/react/parse/addVitePlugin/updateViteConfig.js.map +1 -0
  291. package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js +23 -26
  292. package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js.map +1 -0
  293. package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js +29 -43
  294. package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js.map +1 -0
  295. package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js +70 -104
  296. package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js.map +1 -0
  297. package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js +23 -29
  298. package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js.map +1 -0
  299. package/dist/react/parse/createDictionaryUpdates.js +121 -185
  300. package/dist/react/parse/createDictionaryUpdates.js.map +1 -0
  301. package/dist/react/parse/createInlineUpdates.js +123 -139
  302. package/dist/react/parse/createInlineUpdates.js.map +1 -0
  303. package/dist/react/parse/wrapContent.js +131 -156
  304. package/dist/react/parse/wrapContent.js.map +1 -0
  305. package/dist/react/utils/flattenDictionary.js +55 -70
  306. package/dist/react/utils/flattenDictionary.js.map +1 -0
  307. package/dist/react/utils/getEntryAndMetadata.js +14 -10
  308. package/dist/react/utils/getEntryAndMetadata.js.map +1 -0
  309. package/dist/react/utils/getVariableName.js +36 -33
  310. package/dist/react/utils/getVariableName.js.map +1 -0
  311. package/dist/setup/detectFramework.js +85 -102
  312. package/dist/setup/detectFramework.js.map +1 -0
  313. package/dist/setup/frameworkUtils.js +17 -28
  314. package/dist/setup/frameworkUtils.js.map +1 -0
  315. package/dist/setup/userInput.js +24 -31
  316. package/dist/setup/userInput.js.map +1 -0
  317. package/dist/setup/wizard.js +141 -143
  318. package/dist/setup/wizard.js.map +1 -0
  319. package/dist/state/mintlifyRefMap.js +12 -9
  320. package/dist/state/mintlifyRefMap.js.map +1 -0
  321. package/dist/state/recentDownloads.js +26 -23
  322. package/dist/state/recentDownloads.js.map +1 -0
  323. package/dist/state/translateWarnings.js +17 -8
  324. package/dist/state/translateWarnings.js.map +1 -0
  325. package/dist/translation/parse.js +77 -98
  326. package/dist/translation/parse.js.map +1 -0
  327. package/dist/translation/stage.js +28 -43
  328. package/dist/translation/stage.js.map +1 -0
  329. package/dist/translation/validate.js +68 -91
  330. package/dist/translation/validate.js.map +1 -0
  331. package/dist/types/libraries.js +93 -91
  332. package/dist/types/libraries.js.map +1 -0
  333. package/dist/types/parsing.js +19 -10
  334. package/dist/types/parsing.js.map +1 -0
  335. package/dist/utils/addExplicitAnchorIds.js +270 -389
  336. package/dist/utils/addExplicitAnchorIds.js.map +1 -0
  337. package/dist/utils/calculateTimeoutMs.js +11 -6
  338. package/dist/utils/calculateTimeoutMs.js.map +1 -0
  339. package/dist/utils/constants.js +15 -12
  340. package/dist/utils/constants.js.map +1 -0
  341. package/dist/utils/credentials.js +67 -114
  342. package/dist/utils/credentials.js.map +1 -0
  343. package/dist/utils/fetch.js +22 -20
  344. package/dist/utils/fetch.js.map +1 -0
  345. package/dist/utils/flattenJsonFiles.js +27 -34
  346. package/dist/utils/flattenJsonFiles.js.map +1 -0
  347. package/dist/utils/gitDiff.js +30 -32
  348. package/dist/utils/gitDiff.js.map +1 -0
  349. package/dist/utils/gt.js +7 -2
  350. package/dist/utils/gt.js.map +1 -0
  351. package/dist/utils/hash.js +14 -9
  352. package/dist/utils/hash.js.map +1 -0
  353. package/dist/utils/headers.js +10 -13
  354. package/dist/utils/headers.js.map +1 -0
  355. package/dist/utils/installPackage.js +70 -75
  356. package/dist/utils/installPackage.js.map +1 -0
  357. package/dist/utils/localizeRelativeAssets.js +114 -157
  358. package/dist/utils/localizeRelativeAssets.js.map +1 -0
  359. package/dist/utils/localizeStaticImports.js +229 -371
  360. package/dist/utils/localizeStaticImports.js.map +1 -0
  361. package/dist/utils/localizeStaticUrls.js +241 -424
  362. package/dist/utils/localizeStaticUrls.js.map +1 -0
  363. package/dist/utils/mintlifyTitleFallback.js +64 -72
  364. package/dist/utils/mintlifyTitleFallback.js.map +1 -0
  365. package/dist/utils/monorepoVersionCheck.js +177 -215
  366. package/dist/utils/monorepoVersionCheck.js.map +1 -0
  367. package/dist/utils/packageInfo.js +17 -16
  368. package/dist/utils/packageInfo.js.map +1 -0
  369. package/dist/utils/packageJson.js +51 -66
  370. package/dist/utils/packageJson.js.map +1 -0
  371. package/dist/utils/packageManager.js +237 -260
  372. package/dist/utils/packageManager.js.map +1 -0
  373. package/dist/utils/parse/needsCJS.js +36 -69
  374. package/dist/utils/parse/needsCJS.js.map +1 -0
  375. package/dist/utils/persistPostprocessHashes.js +30 -32
  376. package/dist/utils/persistPostprocessHashes.js.map +1 -0
  377. package/dist/utils/processAnchorIds.js +32 -54
  378. package/dist/utils/processAnchorIds.js.map +1 -0
  379. package/dist/utils/processOpenApi.js +469 -578
  380. package/dist/utils/processOpenApi.js.map +1 -0
  381. package/dist/utils/resolveMintlifyRefs.js +89 -105
  382. package/dist/utils/resolveMintlifyRefs.js.map +1 -0
  383. package/dist/utils/resolvePublish.js +46 -54
  384. package/dist/utils/resolvePublish.js.map +1 -0
  385. package/dist/utils/sanitizeFileContent.js +20 -27
  386. package/dist/utils/sanitizeFileContent.js.map +1 -0
  387. package/dist/utils/sharedStaticAssets.js +248 -366
  388. package/dist/utils/sharedStaticAssets.js.map +1 -0
  389. package/dist/utils/splitMintlifyLanguageRefs.js +208 -282
  390. package/dist/utils/splitMintlifyLanguageRefs.js.map +1 -0
  391. package/dist/utils/validateMdx.js +26 -23
  392. package/dist/utils/validateMdx.js.map +1 -0
  393. package/dist/utils/wrapPlainUrls.js +58 -70
  394. package/dist/utils/wrapPlainUrls.js.map +1 -0
  395. package/dist/workflows/download.js +92 -126
  396. package/dist/workflows/download.js.map +1 -0
  397. package/dist/workflows/enqueue.js +47 -54
  398. package/dist/workflows/enqueue.js.map +1 -0
  399. package/dist/workflows/publish.js +29 -29
  400. package/dist/workflows/publish.js.map +1 -0
  401. package/dist/workflows/setupProject.js +39 -40
  402. package/dist/workflows/setupProject.js.map +1 -0
  403. package/dist/workflows/stage.js +61 -65
  404. package/dist/workflows/stage.js.map +1 -0
  405. package/dist/workflows/steps/BranchStep.js +118 -163
  406. package/dist/workflows/steps/BranchStep.js.map +1 -0
  407. package/dist/workflows/steps/DownloadStep.js +107 -137
  408. package/dist/workflows/steps/DownloadStep.js.map +1 -0
  409. package/dist/workflows/steps/EnqueueStep.js +32 -32
  410. package/dist/workflows/steps/EnqueueStep.js.map +1 -0
  411. package/dist/workflows/steps/PollJobsStep.js +208 -292
  412. package/dist/workflows/steps/PollJobsStep.js.map +1 -0
  413. package/dist/workflows/steps/PublishStep.js +33 -38
  414. package/dist/workflows/steps/PublishStep.js.map +1 -0
  415. package/dist/workflows/steps/SetupStep.js +71 -72
  416. package/dist/workflows/steps/SetupStep.js.map +1 -0
  417. package/dist/workflows/steps/TagStep.js +39 -44
  418. package/dist/workflows/steps/TagStep.js.map +1 -0
  419. package/dist/workflows/steps/UploadSourcesStep.js +108 -140
  420. package/dist/workflows/steps/UploadSourcesStep.js.map +1 -0
  421. package/dist/workflows/steps/UploadTranslationsStep.js +61 -71
  422. package/dist/workflows/steps/UploadTranslationsStep.js.map +1 -0
  423. package/dist/workflows/steps/UserEditDiffsStep.js +32 -34
  424. package/dist/workflows/steps/UserEditDiffsStep.js.map +1 -0
  425. package/dist/workflows/steps/WorkflowStep.js +6 -2
  426. package/dist/workflows/steps/WorkflowStep.js.map +1 -0
  427. package/dist/workflows/upload.js +45 -46
  428. package/dist/workflows/upload.js.map +1 -0
  429. package/package.json +14 -7
@@ -1,122 +1,85 @@
1
- import * as t from '@babel/types';
2
- import { isStaticExpression } from '../../../evaluateJsx.js';
3
- import { warnInvalidMaxCharsSync } from '../../../../../console/index.js';
4
- import { warnInvalidFormatSync } from '../../../../../console/index.js';
5
- import { warnNonStaticExpressionSync } from '../../../../../console/index.js';
6
- import { GT_ATTRIBUTES_WITH_SUGAR } from '../../constants.js';
7
- import { containsDeriveCall } from '../derivation/containsDeriveCall.js';
8
- import generateModule from '@babel/generator';
9
- import { mapAttributeName } from '../../mapAttributeName.js';
10
- import pathModule from 'node:path';
11
- import { isNumberLiteral } from '../../isNumberLiteral.js';
12
- import { extractSourceCode } from '../../extractSourceCode.js';
13
- import { SURROUNDING_LINE_COUNT } from '../../../../../utils/constants.js';
14
- // Handle CommonJS/ESM interop
1
+ import "../../../../../utils/constants.js";
2
+ import { isStaticExpression } from "../../../evaluateJsx.js";
3
+ import { GT_ATTRIBUTES_WITH_SUGAR } from "../../constants.js";
4
+ import { warnInvalidFormatSync, warnInvalidMaxCharsSync, warnNonStaticExpressionSync } from "../../../../../console/index.js";
5
+ import { mapAttributeName } from "../../mapAttributeName.js";
6
+ import { isNumberLiteral } from "../../isNumberLiteral.js";
7
+ import { containsDeriveCall } from "../derivation/containsDeriveCall.js";
8
+ import { extractSourceCode } from "../../extractSourceCode.js";
9
+ import path from "node:path";
10
+ import * as t from "@babel/types";
11
+ import generateModule from "@babel/generator";
12
+ //#region src/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.ts
15
13
  const generate = generateModule.default || generateModule;
16
14
  /**
17
- * Extracts inline metadata from a string entry
18
- * @param metadata - The metadata record to inject the data into
19
- * @param entry - The string entry to extract the metadata from
20
- * @param output - The output to use
21
- * @param config - The configuration to use
22
- * @returns The inline metadata
23
- *
24
- * @note - this function does not automatically append the index to the id, this must be done manually in the caller.
25
- *
26
- */
27
- export function extractStringEntryMetadata({ options, output, config, nodeLoc, surroundingLineCount = SURROUNDING_LINE_COUNT, }) {
28
- // extract filepath for entry
29
- const relativeFilepath = pathModule.relative(process.cwd(), config.file);
30
- // extract inline metadata
31
- const inlineMetadata = extractInlineMetadata({
32
- options,
33
- output,
34
- config,
35
- });
36
- // extract surrounding lines from source file
37
- let sourceCode;
38
- if (config.includeSourceCodeContext &&
39
- nodeLoc?.start?.line &&
40
- nodeLoc?.end?.line) {
41
- const entry = extractSourceCode(config.file, nodeLoc.start.line, nodeLoc.end.line, surroundingLineCount);
42
- if (entry && relativeFilepath) {
43
- sourceCode = { [relativeFilepath]: [entry] };
44
- }
45
- }
46
- return {
47
- ...inlineMetadata,
48
- filePaths: relativeFilepath ? [relativeFilepath] : undefined,
49
- ...(sourceCode && { sourceCode }),
50
- };
15
+ * Extracts inline metadata from a string entry
16
+ * @param metadata - The metadata record to inject the data into
17
+ * @param entry - The string entry to extract the metadata from
18
+ * @param output - The output to use
19
+ * @param config - The configuration to use
20
+ * @returns The inline metadata
21
+ *
22
+ * @note - this function does not automatically append the index to the id, this must be done manually in the caller.
23
+ *
24
+ */
25
+ function extractStringEntryMetadata({ options, output, config, nodeLoc, surroundingLineCount = 5 }) {
26
+ const relativeFilepath = path.relative(process.cwd(), config.file);
27
+ const inlineMetadata = extractInlineMetadata({
28
+ options,
29
+ output,
30
+ config
31
+ });
32
+ let sourceCode;
33
+ if (config.includeSourceCodeContext && nodeLoc?.start?.line && nodeLoc?.end?.line) {
34
+ const entry = extractSourceCode(config.file, nodeLoc.start.line, nodeLoc.end.line, surroundingLineCount);
35
+ if (entry && relativeFilepath) sourceCode = { [relativeFilepath]: [entry] };
36
+ }
37
+ return {
38
+ ...inlineMetadata,
39
+ filePaths: relativeFilepath ? [relativeFilepath] : void 0,
40
+ ...sourceCode && { sourceCode }
41
+ };
51
42
  }
52
- // ----- Helper Functions ----- //
53
43
  /**
54
- * Extracts inline metadata specified e.g. gt('Hello', { $context: 'greeting' })
55
- * @param options - The options to extract the metadata from
56
- * @param output - The output to use
57
- * @param config - The configuration to use
58
- * @param index - The index of the string entry
59
- * @returns The inline metadata
60
- */
61
- function extractInlineMetadata({ options, output, config, }) {
62
- const metadata = {};
63
- let contextDeriveExpr;
64
- if (options && options.type === 'ObjectExpression') {
65
- options.properties.forEach((prop) => {
66
- if (prop.type === 'ObjectProperty' && prop.key.type === 'Identifier') {
67
- const attribute = prop.key.name;
68
- if (GT_ATTRIBUTES_WITH_SUGAR.includes(attribute) &&
69
- t.isExpression(prop.value)) {
70
- const result = isStaticExpression(prop.value);
71
- if (!result.isStatic) {
72
- const mappedKey = mapAttributeName(attribute);
73
- if (mappedKey === 'context' && containsDeriveCall(prop.value)) {
74
- contextDeriveExpr = prop.value;
75
- }
76
- else {
77
- output.errors.push(warnNonStaticExpressionSync(config.file, attribute, generate(prop.value).code, `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
78
- }
79
- }
80
- if (result.isStatic &&
81
- result.value != null &&
82
- !config.ignoreInlineMetadata) {
83
- const mappedKey = mapAttributeName(attribute);
84
- if (mappedKey === 'maxChars') {
85
- // Handle maxChars attribute
86
- if ((typeof result.value === 'string' &&
87
- (isNaN(Number(result.value)) ||
88
- !isNumberLiteral(prop.value))) ||
89
- !Number.isInteger(Number(result.value))) {
90
- output.errors.push(warnInvalidMaxCharsSync(config.file, generate(prop).code, `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
91
- }
92
- else if (typeof result.value === 'string') {
93
- // Add the maxChars value to the metadata
94
- metadata[mappedKey] = Math.abs(Number(result.value));
95
- }
96
- }
97
- else if (mappedKey === 'format') {
98
- // Handle format attribute - validate allowed values
99
- const validFormats = ['ICU', 'STRING', 'I18NEXT'];
100
- if (typeof result.value === 'string' &&
101
- validFormats.includes(result.value)) {
102
- metadata[mappedKey] = result.value;
103
- }
104
- else {
105
- output.warnings.add(warnInvalidFormatSync(config.file, String(result.value), `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
106
- }
107
- }
108
- else {
109
- // Add the $context or $id or other attributes value to the metadata
110
- // TODO: why are we including everything? arent we only interested in relevant inline metadata?
111
- metadata[mappedKey] = result.value;
112
- }
113
- }
114
- }
115
- }
116
- });
117
- }
118
- return {
119
- ...metadata,
120
- ...(contextDeriveExpr && { contextDeriveExpr }),
121
- };
44
+ * Extracts inline metadata specified e.g. gt('Hello', { $context: 'greeting' })
45
+ * @param options - The options to extract the metadata from
46
+ * @param output - The output to use
47
+ * @param config - The configuration to use
48
+ * @param index - The index of the string entry
49
+ * @returns The inline metadata
50
+ */
51
+ function extractInlineMetadata({ options, output, config }) {
52
+ const metadata = {};
53
+ let contextDeriveExpr;
54
+ if (options && options.type === "ObjectExpression") options.properties.forEach((prop) => {
55
+ if (prop.type === "ObjectProperty" && prop.key.type === "Identifier") {
56
+ const attribute = prop.key.name;
57
+ if (GT_ATTRIBUTES_WITH_SUGAR.includes(attribute) && t.isExpression(prop.value)) {
58
+ const result = isStaticExpression(prop.value);
59
+ if (!result.isStatic) if (mapAttributeName(attribute) === "context" && containsDeriveCall(prop.value)) contextDeriveExpr = prop.value;
60
+ else output.errors.push(warnNonStaticExpressionSync(config.file, attribute, generate(prop.value).code, `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
61
+ if (result.isStatic && result.value != null && !config.ignoreInlineMetadata) {
62
+ const mappedKey = mapAttributeName(attribute);
63
+ if (mappedKey === "maxChars") {
64
+ if (typeof result.value === "string" && (isNaN(Number(result.value)) || !isNumberLiteral(prop.value)) || !Number.isInteger(Number(result.value))) output.errors.push(warnInvalidMaxCharsSync(config.file, generate(prop).code, `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
65
+ else if (typeof result.value === "string") metadata[mappedKey] = Math.abs(Number(result.value));
66
+ } else if (mappedKey === "format") if (typeof result.value === "string" && [
67
+ "ICU",
68
+ "STRING",
69
+ "I18NEXT"
70
+ ].includes(result.value)) metadata[mappedKey] = result.value;
71
+ else output.warnings.add(warnInvalidFormatSync(config.file, String(result.value), `${prop.loc?.start?.line}:${prop.loc?.start?.column}`));
72
+ else metadata[mappedKey] = result.value;
73
+ }
74
+ }
75
+ }
76
+ });
77
+ return {
78
+ ...metadata,
79
+ ...contextDeriveExpr && { contextDeriveExpr }
80
+ };
122
81
  }
82
+ //#endregion
83
+ export { extractStringEntryMetadata };
84
+
85
+ //# sourceMappingURL=extractStringEntryMetadata.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extractStringEntryMetadata.js","names":["pathModule"],"sources":["../../../../../../src/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.ts"],"sourcesContent":["import * as t from '@babel/types';\nimport { ParsingConfig } from '../types.js';\nimport { ParsingOutput } from '../types.js';\nimport { isStaticExpression } from '../../../evaluateJsx.js';\nimport { warnInvalidMaxCharsSync } from '../../../../../console/index.js';\nimport { warnInvalidFormatSync } from '../../../../../console/index.js';\nimport { warnNonStaticExpressionSync } from '../../../../../console/index.js';\nimport { GT_ATTRIBUTES_WITH_SUGAR } from '../../constants.js';\nimport { containsDeriveCall } from '../derivation/containsDeriveCall.js';\nimport generateModule from '@babel/generator';\nimport { mapAttributeName } from '../../mapAttributeName.js';\nimport pathModule from 'node:path';\nimport { isNumberLiteral } from '../../isNumberLiteral.js';\nimport { extractSourceCode } from '../../extractSourceCode.js';\nimport type { SourceCode } from '../../extractSourceCode.js';\nimport { SURROUNDING_LINE_COUNT } from '../../../../../utils/constants.js';\n\n// Handle CommonJS/ESM interop\nconst generate = generateModule.default || generateModule;\n\n/**\n * Metadata record type\n */\nexport type InlineMetadata = {\n maxChars?: number;\n context?: string;\n id?: string;\n hash?: string;\n format?: string;\n filePaths?: string[];\n sourceCode?: Record<string, SourceCode[]>;\n contextDeriveExpr?: t.Expression;\n};\n\n/**\n * Extracts inline metadata from a string entry\n * @param metadata - The metadata record to inject the data into\n * @param entry - The string entry to extract the metadata from\n * @param output - The output to use\n * @param config - The configuration to use\n * @returns The inline metadata\n *\n * @note - this function does not automatically append the index to the id, this must be done manually in the caller.\n *\n */\nexport function extractStringEntryMetadata({\n options,\n output,\n config,\n nodeLoc,\n surroundingLineCount = SURROUNDING_LINE_COUNT,\n}: {\n options?: t.CallExpression['arguments'][number];\n output: ParsingOutput;\n config: ParsingConfig;\n nodeLoc?: {\n start?: { line: number } | null;\n end?: { line: number } | null;\n } | null;\n surroundingLineCount?: number;\n}): InlineMetadata {\n // extract filepath for entry\n const relativeFilepath = pathModule.relative(process.cwd(), config.file);\n\n // extract inline metadata\n const inlineMetadata = extractInlineMetadata({\n options,\n output,\n config,\n });\n\n // extract surrounding lines from source file\n let sourceCode: Record<string, SourceCode[]> | undefined;\n if (\n config.includeSourceCodeContext &&\n nodeLoc?.start?.line &&\n nodeLoc?.end?.line\n ) {\n const entry = extractSourceCode(\n config.file,\n nodeLoc.start.line,\n nodeLoc.end.line,\n surroundingLineCount\n );\n if (entry && relativeFilepath) {\n sourceCode = { [relativeFilepath]: [entry] };\n }\n }\n\n return {\n ...inlineMetadata,\n filePaths: relativeFilepath ? [relativeFilepath] : undefined,\n ...(sourceCode && { sourceCode }),\n };\n}\n\n// ----- Helper Functions ----- //\n\n/**\n * Extracts inline metadata specified e.g. gt('Hello', { $context: 'greeting' })\n * @param options - The options to extract the metadata from\n * @param output - The output to use\n * @param config - The configuration to use\n * @param index - The index of the string entry\n * @returns The inline metadata\n */\nfunction extractInlineMetadata({\n options,\n output,\n config,\n}: {\n options?: t.CallExpression['arguments'][number];\n output: ParsingOutput;\n config: ParsingConfig;\n}): InlineMetadata {\n const metadata: Record<string, string | number | string[]> = {};\n let contextDeriveExpr: t.Expression | undefined;\n if (options && options.type === 'ObjectExpression') {\n options.properties.forEach((prop) => {\n if (prop.type === 'ObjectProperty' && prop.key.type === 'Identifier') {\n const attribute = prop.key.name;\n if (\n GT_ATTRIBUTES_WITH_SUGAR.includes(\n attribute as (typeof GT_ATTRIBUTES_WITH_SUGAR)[number]\n ) &&\n t.isExpression(prop.value)\n ) {\n const result = isStaticExpression(prop.value);\n if (!result.isStatic) {\n const mappedKey = mapAttributeName(attribute);\n if (mappedKey === 'context' && containsDeriveCall(prop.value)) {\n contextDeriveExpr = prop.value;\n } else {\n output.errors.push(\n warnNonStaticExpressionSync(\n config.file,\n attribute,\n generate(prop.value).code,\n `${prop.loc?.start?.line}:${prop.loc?.start?.column}`\n )\n );\n }\n }\n if (\n result.isStatic &&\n result.value != null &&\n !config.ignoreInlineMetadata\n ) {\n const mappedKey = mapAttributeName(attribute);\n if (mappedKey === 'maxChars') {\n // Handle maxChars attribute\n if (\n (typeof result.value === 'string' &&\n (isNaN(Number(result.value)) ||\n !isNumberLiteral(prop.value))) ||\n !Number.isInteger(Number(result.value))\n ) {\n output.errors.push(\n warnInvalidMaxCharsSync(\n config.file,\n generate(prop).code,\n `${prop.loc?.start?.line}:${prop.loc?.start?.column}`\n )\n );\n } else if (typeof result.value === 'string') {\n // Add the maxChars value to the metadata\n metadata[mappedKey] = Math.abs(Number(result.value));\n }\n } else if (mappedKey === 'format') {\n // Handle format attribute - validate allowed values\n const validFormats = ['ICU', 'STRING', 'I18NEXT'];\n if (\n typeof result.value === 'string' &&\n validFormats.includes(result.value)\n ) {\n metadata[mappedKey] = result.value;\n } else {\n output.warnings.add(\n warnInvalidFormatSync(\n config.file,\n String(result.value),\n `${prop.loc?.start?.line}:${prop.loc?.start?.column}`\n )\n );\n }\n } else {\n // Add the $context or $id or other attributes value to the metadata\n // TODO: why are we including everything? arent we only interested in relevant inline metadata?\n metadata[mappedKey] = result.value;\n }\n }\n }\n }\n });\n }\n\n return {\n ...metadata,\n ...(contextDeriveExpr && { contextDeriveExpr }),\n };\n}\n"],"mappings":";;;;;;;;;;;;AAkBA,MAAM,WAAW,eAAe,WAAW;;;;;;;;;;;;AA2B3C,SAAgB,2BAA2B,EACzC,SACA,QACA,QACA,SACA,uBAAA,KAUiB;CAEjB,MAAM,mBAAmBA,KAAW,SAAS,QAAQ,KAAK,EAAE,OAAO,KAAK;CAGxE,MAAM,iBAAiB,sBAAsB;EAC3C;EACA;EACA;EACD,CAAC;CAGF,IAAI;AACJ,KACE,OAAO,4BACP,SAAS,OAAO,QAChB,SAAS,KAAK,MACd;EACA,MAAM,QAAQ,kBACZ,OAAO,MACP,QAAQ,MAAM,MACd,QAAQ,IAAI,MACZ,qBACD;AACD,MAAI,SAAS,iBACX,cAAa,GAAG,mBAAmB,CAAC,MAAM,EAAE;;AAIhD,QAAO;EACL,GAAG;EACH,WAAW,mBAAmB,CAAC,iBAAiB,GAAG,KAAA;EACnD,GAAI,cAAc,EAAE,YAAY;EACjC;;;;;;;;;;AAaH,SAAS,sBAAsB,EAC7B,SACA,QACA,UAKiB;CACjB,MAAM,WAAuD,EAAE;CAC/D,IAAI;AACJ,KAAI,WAAW,QAAQ,SAAS,mBAC9B,SAAQ,WAAW,SAAS,SAAS;AACnC,MAAI,KAAK,SAAS,oBAAoB,KAAK,IAAI,SAAS,cAAc;GACpE,MAAM,YAAY,KAAK,IAAI;AAC3B,OACE,yBAAyB,SACvB,UACD,IACD,EAAE,aAAa,KAAK,MAAM,EAC1B;IACA,MAAM,SAAS,mBAAmB,KAAK,MAAM;AAC7C,QAAI,CAAC,OAAO,SAEV,KADkB,iBAAiB,UACtB,KAAK,aAAa,mBAAmB,KAAK,MAAM,CAC3D,qBAAoB,KAAK;QAEzB,QAAO,OAAO,KACZ,4BACE,OAAO,MACP,WACA,SAAS,KAAK,MAAM,CAAC,MACrB,GAAG,KAAK,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK,OAAO,SAC9C,CACF;AAGL,QACE,OAAO,YACP,OAAO,SAAS,QAChB,CAAC,OAAO,sBACR;KACA,MAAM,YAAY,iBAAiB,UAAU;AAC7C,SAAI,cAAc;UAGb,OAAO,OAAO,UAAU,aACtB,MAAM,OAAO,OAAO,MAAM,CAAC,IAC1B,CAAC,gBAAgB,KAAK,MAAM,KAChC,CAAC,OAAO,UAAU,OAAO,OAAO,MAAM,CAAC,CAEvC,QAAO,OAAO,KACZ,wBACE,OAAO,MACP,SAAS,KAAK,CAAC,MACf,GAAG,KAAK,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK,OAAO,SAC9C,CACF;eACQ,OAAO,OAAO,UAAU,SAEjC,UAAS,aAAa,KAAK,IAAI,OAAO,OAAO,MAAM,CAAC;gBAE7C,cAAc,SAGvB,KACE,OAAO,OAAO,UAAU,YACxB;MAHoB;MAAO;MAAU;MAGzB,CAAC,SAAS,OAAO,MAAM,CAEnC,UAAS,aAAa,OAAO;SAE7B,QAAO,SAAS,IACd,sBACE,OAAO,MACP,OAAO,OAAO,MAAM,EACpB,GAAG,KAAK,KAAK,OAAO,KAAK,GAAG,KAAK,KAAK,OAAO,SAC9C,CACF;SAKH,UAAS,aAAa,OAAO;;;;GAKrC;AAGJ,QAAO;EACL,GAAG;EACH,GAAI,qBAAqB,EAAE,mBAAmB;EAC/C"}
@@ -1,21 +1,26 @@
1
- import { deriveExpression } from '../derivation/index.js';
1
+ import { deriveExpression } from "../derivation/index.js";
2
+ //#region src/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.ts
2
3
  /**
3
- * For the processTranslationCall function, this function handles the case where a string with derive is used.
4
- * @param arg - The argument to parse
5
- * @param metadata - The metadata to use
6
- * @param tPath - The path to the argument
7
- * @param config - The configuration to use
8
- * @param output - The output to use
9
- * @param index - Current index in array of strings being extracted
10
- */
11
- export function handleDeriveTranslationCall({ arg, metadata, tPath, config, output, index, contextVariants, }) {
12
- deriveExpression({
13
- tPath,
14
- expr: arg,
15
- metadata,
16
- config,
17
- output,
18
- index,
19
- contextVariants,
20
- });
4
+ * For the processTranslationCall function, this function handles the case where a string with derive is used.
5
+ * @param arg - The argument to parse
6
+ * @param metadata - The metadata to use
7
+ * @param tPath - The path to the argument
8
+ * @param config - The configuration to use
9
+ * @param output - The output to use
10
+ * @param index - Current index in array of strings being extracted
11
+ */
12
+ function handleDeriveTranslationCall({ arg, metadata, tPath, config, output, index, contextVariants }) {
13
+ deriveExpression({
14
+ tPath,
15
+ expr: arg,
16
+ metadata,
17
+ config,
18
+ output,
19
+ index,
20
+ contextVariants
21
+ });
21
22
  }
23
+ //#endregion
24
+ export { handleDeriveTranslationCall };
25
+
26
+ //# sourceMappingURL=handleDeriveTranslationCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleDeriveTranslationCall.js","names":[],"sources":["../../../../../../src/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.ts"],"sourcesContent":["import { NodePath } from '@babel/traverse';\nimport * as t from '@babel/types';\nimport { ParsingConfig } from '../types.js';\nimport { ParsingOutput } from '../types.js';\nimport { deriveExpression } from '../derivation/index.js';\nimport { InlineMetadata } from './extractStringEntryMetadata.js';\n\n/**\n * For the processTranslationCall function, this function handles the case where a string with derive is used.\n * @param arg - The argument to parse\n * @param metadata - The metadata to use\n * @param tPath - The path to the argument\n * @param config - The configuration to use\n * @param output - The output to use\n * @param index - Current index in array of strings being extracted\n */\nexport function handleDeriveTranslationCall({\n arg,\n metadata,\n tPath,\n config,\n output,\n index,\n contextVariants,\n}: {\n arg: t.Expression;\n metadata: InlineMetadata;\n tPath: NodePath;\n config: ParsingConfig;\n output: ParsingOutput;\n index?: number;\n contextVariants?: string[];\n}): void {\n deriveExpression({\n tPath,\n expr: arg,\n metadata,\n config,\n output,\n index,\n contextVariants,\n });\n}\n"],"mappings":";;;;;;;;;;;AAgBA,SAAgB,4BAA4B,EAC1C,KACA,UACA,OACA,QACA,QACA,OACA,mBASO;AACP,kBAAiB;EACf;EACA,MAAM;EACN;EACA;EACA;EACA;EACA;EACD,CAAC"}
@@ -1,24 +1,21 @@
1
- import * as t from '@babel/types';
2
- import { warnNonStringSync, warnTemplateLiteralSync, } from '../../../../../console/index.js';
3
- import generateModule from '@babel/generator';
4
- // Handle CommonJS/ESM interop
1
+ import { warnNonStringSync, warnTemplateLiteralSync } from "../../../../../console/index.js";
2
+ import * as t from "@babel/types";
3
+ import generateModule from "@babel/generator";
4
+ //#region src/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.ts
5
5
  const generate = generateModule.default || generateModule;
6
6
  /**
7
- * For the processTranslationCall function, this function handles the case where a other translation call is used.
8
- * Error is pushed if the other translation call is used.
9
- * @param arg - The argument to parse
10
- * @param config - The configuration to use
11
- * @param output - The output to use
12
- */
13
- export function handleInvalidTranslationCall({ arg, config, output, }) {
14
- if (config.ignoreDynamicContent)
15
- return;
16
- if (t.isTemplateLiteral(arg)) {
17
- // Specific error for template literals
18
- output.errors.push(warnTemplateLiteralSync(config.file, generate(arg).code, `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
19
- }
20
- else {
21
- // Generic error
22
- output.errors.push(warnNonStringSync(config.file, generate(arg).code, `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
23
- }
7
+ * For the processTranslationCall function, this function handles the case where a other translation call is used.
8
+ * Error is pushed if the other translation call is used.
9
+ * @param arg - The argument to parse
10
+ * @param config - The configuration to use
11
+ * @param output - The output to use
12
+ */
13
+ function handleInvalidTranslationCall({ arg, config, output }) {
14
+ if (config.ignoreDynamicContent) return;
15
+ if (t.isTemplateLiteral(arg)) output.errors.push(warnTemplateLiteralSync(config.file, generate(arg).code, `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
16
+ else output.errors.push(warnNonStringSync(config.file, generate(arg).code, `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
24
17
  }
18
+ //#endregion
19
+ export { handleInvalidTranslationCall };
20
+
21
+ //# sourceMappingURL=handleInvalidTranslationCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleInvalidTranslationCall.js","names":[],"sources":["../../../../../../src/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.ts"],"sourcesContent":["import * as t from '@babel/types';\nimport { ParsingConfig, ParsingOutput } from '../types.js';\nimport {\n warnNonStringSync,\n warnTemplateLiteralSync,\n} from '../../../../../console/index.js';\nimport generateModule from '@babel/generator';\n\n// Handle CommonJS/ESM interop\nconst generate = generateModule.default || generateModule;\n\n/**\n * For the processTranslationCall function, this function handles the case where a other translation call is used.\n * Error is pushed if the other translation call is used.\n * @param arg - The argument to parse\n * @param config - The configuration to use\n * @param output - The output to use\n */\nexport function handleInvalidTranslationCall({\n arg,\n config,\n output,\n}: {\n arg: t.ArgumentPlaceholder | t.SpreadElement | t.Expression;\n config: ParsingConfig;\n output: ParsingOutput;\n}): void {\n if (config.ignoreDynamicContent) return;\n\n if (t.isTemplateLiteral(arg)) {\n // Specific error for template literals\n output.errors.push(\n warnTemplateLiteralSync(\n config.file,\n generate(arg).code,\n `${arg.loc?.start?.line}:${arg.loc?.start?.column}`\n )\n );\n } else {\n // Generic error\n output.errors.push(\n warnNonStringSync(\n config.file,\n generate(arg).code,\n `${arg.loc?.start?.line}:${arg.loc?.start?.column}`\n )\n );\n }\n}\n"],"mappings":";;;;AASA,MAAM,WAAW,eAAe,WAAW;;;;;;;;AAS3C,SAAgB,6BAA6B,EAC3C,KACA,QACA,UAKO;AACP,KAAI,OAAO,qBAAsB;AAEjC,KAAI,EAAE,kBAAkB,IAAI,CAE1B,QAAO,OAAO,KACZ,wBACE,OAAO,MACP,SAAS,IAAI,CAAC,MACd,GAAG,IAAI,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK,OAAO,SAC5C,CACF;KAGD,QAAO,OAAO,KACZ,kBACE,OAAO,MACP,SAAS,IAAI,CAAC,MACd,GAAG,IAAI,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK,OAAO,SAC5C,CACF"}
@@ -1,52 +1,47 @@
1
- import { isValidIcu } from '../../../evaluateJsx.js';
2
- import { warnInvalidIcuSync } from '../../../../../console/index.js';
3
- import { randomUUID } from 'node:crypto';
1
+ import { isValidIcu } from "../../../evaluateJsx.js";
2
+ import { warnInvalidIcuSync } from "../../../../../console/index.js";
3
+ import { randomUUID } from "node:crypto";
4
+ //#region src/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.ts
4
5
  /**
5
- * For the processTranslationCall function, this function handles the case where a string literal or template literal is used.
6
- * @param arg - The argument to parse
7
- * @param metadata - The metadata to use
8
- * @param config - The configuration to use
9
- * @param output - The output to use
10
- * @param index - The index of the argument
11
- * @param contextVariants - Optional derive context variants for cross-product
12
- */
13
- export function handleLiteralTranslationCall({ arg, metadata, config, output, index, contextVariants, }) {
14
- // ignore dynamic content flag is triggered, check strings are valid ICU
15
- const source = arg.type === 'StringLiteral' ? arg.value : arg.quasis[0].value.raw;
16
- // Validate is ICU skip for non-ICU formats
17
- if (!config.ignoreInvalidIcu &&
18
- (!metadata.format || metadata.format === 'ICU')) {
19
- const { isValid, error } = isValidIcu(source);
20
- if (!isValid) {
21
- output.warnings.add(warnInvalidIcuSync(config.file, source, error ?? 'Unknown error', `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
22
- return;
23
- }
24
- }
25
- if (contextVariants) {
26
- const staticId = `derive-temp-id-${randomUUID()}`;
27
- for (const context of contextVariants) {
28
- output.updates.push({
29
- dataFormat: (metadata.format || 'ICU'),
30
- source,
31
- metadata: {
32
- ...metadata,
33
- context,
34
- ...(metadata.id &&
35
- index != null && { id: `${metadata.id}.${index}` }),
36
- staticId,
37
- },
38
- });
39
- }
40
- }
41
- else {
42
- output.updates.push({
43
- dataFormat: (metadata.format || 'ICU'),
44
- source,
45
- metadata: {
46
- ...metadata,
47
- // Add the index if an id and index is provided (for handling when registering an array of strings)
48
- ...(metadata.id && index != null && { id: `${metadata.id}.${index}` }),
49
- },
50
- });
51
- }
6
+ * For the processTranslationCall function, this function handles the case where a string literal or template literal is used.
7
+ * @param arg - The argument to parse
8
+ * @param metadata - The metadata to use
9
+ * @param config - The configuration to use
10
+ * @param output - The output to use
11
+ * @param index - The index of the argument
12
+ * @param contextVariants - Optional derive context variants for cross-product
13
+ */
14
+ function handleLiteralTranslationCall({ arg, metadata, config, output, index, contextVariants }) {
15
+ const source = arg.type === "StringLiteral" ? arg.value : arg.quasis[0].value.raw;
16
+ if (!config.ignoreInvalidIcu && (!metadata.format || metadata.format === "ICU")) {
17
+ const { isValid, error } = isValidIcu(source);
18
+ if (!isValid) {
19
+ output.warnings.add(warnInvalidIcuSync(config.file, source, error ?? "Unknown error", `${arg.loc?.start?.line}:${arg.loc?.start?.column}`));
20
+ return;
21
+ }
22
+ }
23
+ if (contextVariants) {
24
+ const staticId = `derive-temp-id-${randomUUID()}`;
25
+ for (const context of contextVariants) output.updates.push({
26
+ dataFormat: metadata.format || "ICU",
27
+ source,
28
+ metadata: {
29
+ ...metadata,
30
+ context,
31
+ ...metadata.id && index != null && { id: `${metadata.id}.${index}` },
32
+ staticId
33
+ }
34
+ });
35
+ } else output.updates.push({
36
+ dataFormat: metadata.format || "ICU",
37
+ source,
38
+ metadata: {
39
+ ...metadata,
40
+ ...metadata.id && index != null && { id: `${metadata.id}.${index}` }
41
+ }
42
+ });
52
43
  }
44
+ //#endregion
45
+ export { handleLiteralTranslationCall };
46
+
47
+ //# sourceMappingURL=handleLiteralTranslationCall.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleLiteralTranslationCall.js","names":[],"sources":["../../../../../../src/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.ts"],"sourcesContent":["import * as t from '@babel/types';\nimport type { DataFormat } from '@generaltranslation/format/types';\nimport { ParsingConfig } from '../types.js';\nimport { ParsingOutput } from '../types.js';\nimport { isValidIcu } from '../../../evaluateJsx.js';\nimport { warnInvalidIcuSync } from '../../../../../console/index.js';\nimport { InlineMetadata } from './extractStringEntryMetadata.js';\nimport { randomUUID } from 'node:crypto';\n\n/**\n * For the processTranslationCall function, this function handles the case where a string literal or template literal is used.\n * @param arg - The argument to parse\n * @param metadata - The metadata to use\n * @param config - The configuration to use\n * @param output - The output to use\n * @param index - The index of the argument\n * @param contextVariants - Optional derive context variants for cross-product\n */\nexport function handleLiteralTranslationCall({\n arg,\n metadata,\n config,\n output,\n index,\n contextVariants,\n}: {\n arg: t.StringLiteral | t.TemplateLiteral;\n metadata: InlineMetadata;\n config: ParsingConfig;\n output: ParsingOutput;\n index?: number;\n contextVariants?: string[];\n}): void {\n // ignore dynamic content flag is triggered, check strings are valid ICU\n const source =\n arg.type === 'StringLiteral' ? arg.value : arg.quasis[0].value.raw;\n\n // Validate is ICU — skip for non-ICU formats\n if (\n !config.ignoreInvalidIcu &&\n (!metadata.format || metadata.format === 'ICU')\n ) {\n const { isValid, error } = isValidIcu(source);\n if (!isValid) {\n output.warnings.add(\n warnInvalidIcuSync(\n config.file,\n source,\n error ?? 'Unknown error',\n `${arg.loc?.start?.line}:${arg.loc?.start?.column}`\n )\n );\n return;\n }\n }\n\n if (contextVariants) {\n const staticId = `derive-temp-id-${randomUUID()}`;\n for (const context of contextVariants) {\n output.updates.push({\n dataFormat: (metadata.format || 'ICU') as DataFormat,\n source,\n metadata: {\n ...metadata,\n context,\n ...(metadata.id &&\n index != null && { id: `${metadata.id}.${index}` }),\n staticId,\n },\n });\n }\n } else {\n output.updates.push({\n dataFormat: (metadata.format || 'ICU') as DataFormat,\n source,\n metadata: {\n ...metadata,\n // Add the index if an id and index is provided (for handling when registering an array of strings)\n ...(metadata.id && index != null && { id: `${metadata.id}.${index}` }),\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkBA,SAAgB,6BAA6B,EAC3C,KACA,UACA,QACA,QACA,OACA,mBAQO;CAEP,MAAM,SACJ,IAAI,SAAS,kBAAkB,IAAI,QAAQ,IAAI,OAAO,GAAG,MAAM;AAGjE,KACE,CAAC,OAAO,qBACP,CAAC,SAAS,UAAU,SAAS,WAAW,QACzC;EACA,MAAM,EAAE,SAAS,UAAU,WAAW,OAAO;AAC7C,MAAI,CAAC,SAAS;AACZ,UAAO,SAAS,IACd,mBACE,OAAO,MACP,QACA,SAAS,iBACT,GAAG,IAAI,KAAK,OAAO,KAAK,GAAG,IAAI,KAAK,OAAO,SAC5C,CACF;AACD;;;AAIJ,KAAI,iBAAiB;EACnB,MAAM,WAAW,kBAAkB,YAAY;AAC/C,OAAK,MAAM,WAAW,gBACpB,QAAO,QAAQ,KAAK;GAClB,YAAa,SAAS,UAAU;GAChC;GACA,UAAU;IACR,GAAG;IACH;IACA,GAAI,SAAS,MACX,SAAS,QAAQ,EAAE,IAAI,GAAG,SAAS,GAAG,GAAG,SAAS;IACpD;IACD;GACF,CAAC;OAGJ,QAAO,QAAQ,KAAK;EAClB,YAAa,SAAS,UAAU;EAChC;EACA,UAAU;GACR,GAAG;GAEH,GAAI,SAAS,MAAM,SAAS,QAAQ,EAAE,IAAI,GAAG,SAAS,GAAG,GAAG,SAAS;GACtE;EACF,CAAC"}
@@ -1,61 +1,56 @@
1
- import { routeTranslationCall } from './routeTranslationCall.js';
2
- import { extractStringEntryMetadata } from './extractStringEntryMetadata.js';
3
- import { SURROUNDING_LINE_COUNT } from '../../../../../utils/constants.js';
4
- import { handleDerivation } from '../derivation/handleDerivation.js';
5
- import { nodeToStrings } from '../../parseString.js';
1
+ import "../../../../../utils/constants.js";
2
+ import { nodeToStrings } from "../../parseString.js";
3
+ import { handleDerivation } from "../derivation/handleDerivation.js";
4
+ import { routeTranslationCall } from "./routeTranslationCall.js";
5
+ import { extractStringEntryMetadata } from "./extractStringEntryMetadata.js";
6
+ //#region src/react/jsx/utils/stringParsing/processTranslationCall/index.ts
6
7
  /**
7
- * Processes a single translation function call (e.g., t('hello world', { id: 'greeting' })).
8
- * Extracts the translatable string content and metadata, then adds it to the updates array.
9
- *
10
- * Handles:
11
- * - String literals: t('hello')
12
- * - Template literals without expressions: t(`hello`)
13
- * - Metadata extraction from options object
14
- * - Error reporting for non-derivable expressions and template literals with expressions
15
- *
16
- * @param tPath - The path to the translation call
17
- * @param config - The configuration to use
18
- * @param output - The output to use
19
- */
20
- export function processTranslationCall(tPath, config, output) {
21
- if (tPath.parent.type !== 'CallExpression' ||
22
- tPath.parent.arguments.length === 0) {
23
- return;
24
- }
25
- // Get arg and options
26
- const arg = tPath.parent.arguments[0];
27
- const options = tPath.parent.arguments.at(1);
28
- // get metadata and id from options
29
- const metadata = extractStringEntryMetadata({
30
- options,
31
- output,
32
- config,
33
- nodeLoc: tPath.parent.loc,
34
- surroundingLineCount: SURROUNDING_LINE_COUNT,
35
- });
36
- // Resolve derive context variants if present
37
- let contextVariants;
38
- if (metadata.contextDeriveExpr) {
39
- const contextNode = handleDerivation({
40
- expr: metadata.contextDeriveExpr,
41
- tPath,
42
- file: config.file,
43
- parsingOptions: config.parsingOptions,
44
- errors: output.errors,
45
- warnings: output.warnings,
46
- });
47
- if (contextNode) {
48
- contextVariants = nodeToStrings(contextNode);
49
- }
50
- delete metadata.contextDeriveExpr;
51
- }
52
- // Route tx call to appropriate handler
53
- routeTranslationCall({
54
- tPath,
55
- config,
56
- output,
57
- arg,
58
- metadata,
59
- contextVariants,
60
- });
8
+ * Processes a single translation function call (e.g., t('hello world', { id: 'greeting' })).
9
+ * Extracts the translatable string content and metadata, then adds it to the updates array.
10
+ *
11
+ * Handles:
12
+ * - String literals: t('hello')
13
+ * - Template literals without expressions: t(`hello`)
14
+ * - Metadata extraction from options object
15
+ * - Error reporting for non-derivable expressions and template literals with expressions
16
+ *
17
+ * @param tPath - The path to the translation call
18
+ * @param config - The configuration to use
19
+ * @param output - The output to use
20
+ */
21
+ function processTranslationCall(tPath, config, output) {
22
+ if (tPath.parent.type !== "CallExpression" || tPath.parent.arguments.length === 0) return;
23
+ const arg = tPath.parent.arguments[0];
24
+ const metadata = extractStringEntryMetadata({
25
+ options: tPath.parent.arguments.at(1),
26
+ output,
27
+ config,
28
+ nodeLoc: tPath.parent.loc,
29
+ surroundingLineCount: 5
30
+ });
31
+ let contextVariants;
32
+ if (metadata.contextDeriveExpr) {
33
+ const contextNode = handleDerivation({
34
+ expr: metadata.contextDeriveExpr,
35
+ tPath,
36
+ file: config.file,
37
+ parsingOptions: config.parsingOptions,
38
+ errors: output.errors,
39
+ warnings: output.warnings
40
+ });
41
+ if (contextNode) contextVariants = nodeToStrings(contextNode);
42
+ delete metadata.contextDeriveExpr;
43
+ }
44
+ routeTranslationCall({
45
+ tPath,
46
+ config,
47
+ output,
48
+ arg,
49
+ metadata,
50
+ contextVariants
51
+ });
61
52
  }
53
+ //#endregion
54
+ export { processTranslationCall };
55
+
56
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../../../../../src/react/jsx/utils/stringParsing/processTranslationCall/index.ts"],"sourcesContent":["import { NodePath } from '@babel/traverse';\nimport { ParsingConfig } from '../types.js';\nimport { ParsingOutput } from '../types.js';\nimport { routeTranslationCall } from './routeTranslationCall.js';\nimport { extractStringEntryMetadata } from './extractStringEntryMetadata.js';\nimport { SURROUNDING_LINE_COUNT } from '../../../../../utils/constants.js';\nimport { handleDerivation } from '../derivation/handleDerivation.js';\nimport { nodeToStrings } from '../../parseString.js';\n\n/**\n * Processes a single translation function call (e.g., t('hello world', { id: 'greeting' })).\n * Extracts the translatable string content and metadata, then adds it to the updates array.\n *\n * Handles:\n * - String literals: t('hello')\n * - Template literals without expressions: t(`hello`)\n * - Metadata extraction from options object\n * - Error reporting for non-derivable expressions and template literals with expressions\n *\n * @param tPath - The path to the translation call\n * @param config - The configuration to use\n * @param output - The output to use\n */\nexport function processTranslationCall(\n tPath: NodePath,\n config: ParsingConfig,\n output: ParsingOutput\n): void {\n if (\n tPath.parent.type !== 'CallExpression' ||\n tPath.parent.arguments.length === 0\n ) {\n return;\n }\n\n // Get arg and options\n const arg = tPath.parent.arguments[0];\n const options = tPath.parent.arguments.at(1);\n\n // get metadata and id from options\n const metadata = extractStringEntryMetadata({\n options,\n output,\n config,\n nodeLoc: tPath.parent.loc,\n surroundingLineCount: SURROUNDING_LINE_COUNT,\n });\n\n // Resolve derive context variants if present\n let contextVariants: string[] | undefined;\n if (metadata.contextDeriveExpr) {\n const contextNode = handleDerivation({\n expr: metadata.contextDeriveExpr,\n tPath,\n file: config.file,\n parsingOptions: config.parsingOptions,\n errors: output.errors,\n warnings: output.warnings,\n });\n if (contextNode) {\n contextVariants = nodeToStrings(contextNode);\n }\n delete metadata.contextDeriveExpr;\n }\n\n // Route tx call to appropriate handler\n routeTranslationCall({\n tPath,\n config,\n output,\n arg,\n metadata,\n contextVariants,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAuBA,SAAgB,uBACd,OACA,QACA,QACM;AACN,KACE,MAAM,OAAO,SAAS,oBACtB,MAAM,OAAO,UAAU,WAAW,EAElC;CAIF,MAAM,MAAM,MAAM,OAAO,UAAU;CAInC,MAAM,WAAW,2BAA2B;EAC1C,SAJc,MAAM,OAAO,UAAU,GAAG,EAIjC;EACP;EACA;EACA,SAAS,MAAM,OAAO;EACtB,sBAAA;EACD,CAAC;CAGF,IAAI;AACJ,KAAI,SAAS,mBAAmB;EAC9B,MAAM,cAAc,iBAAiB;GACnC,MAAM,SAAS;GACf;GACA,MAAM,OAAO;GACb,gBAAgB,OAAO;GACvB,QAAQ,OAAO;GACf,UAAU,OAAO;GAClB,CAAC;AACF,MAAI,YACF,mBAAkB,cAAc,YAAY;AAE9C,SAAO,SAAS;;AAIlB,sBAAqB;EACnB;EACA;EACA;EACA;EACA;EACA;EACD,CAAC"}