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
@@ -0,0 +1 @@
1
+ {"version":3,"file":"setupFlow.js","names":[],"sources":["../../src/locadex/setupFlow.ts"],"sourcesContent":["import { Settings } from '../types/index.js';\nimport { logger } from '../console/logger.js';\nimport chalk from 'chalk';\n\nexport async function setupLocadex(settings: Settings): Promise<void> {\n const urlToOpen = `${settings.dashboardUrl}/api/integrations/github/start?returnTo=%2Fproject%2Flocadex`;\n await import('open').then((open) =>\n open.default(urlToOpen, {\n wait: false,\n })\n );\n\n logger.message(\n `${chalk.dim(\n `If the browser window didn't open automatically, open the following link:`\n )}\\n\\n${chalk.cyan(urlToOpen)}`\n );\n}\n"],"mappings":";;;AAIA,eAAsB,aAAa,UAAmC;CACpE,MAAM,YAAY,GAAG,SAAS,aAAa;AAC3C,OAAM,OAAO,QAAQ,MAAM,SACzB,KAAK,QAAQ,WAAW,EACtB,MAAM,OACP,CAAC,CACH;AAED,QAAO,QACL,GAAG,MAAM,IACP,4EACD,CAAC,MAAM,MAAM,KAAK,UAAU,GAC9B"}
package/dist/main.js CHANGED
@@ -1,10 +1,20 @@
1
1
  #!/usr/bin/env node
2
- // Non-binary router - directly runs main.ts
3
- import { main } from './index.js';
4
- import dotenv from 'dotenv';
5
- import { program } from 'commander';
6
- dotenv.config({ path: '.env' });
7
- dotenv.config({ path: '.env.local', override: true });
8
- dotenv.config({ path: '.env.production', override: true });
2
+ import { main } from "./index.js";
3
+ import dotenv from "dotenv";
4
+ import { program } from "commander";
5
+ //#region src/main.ts
6
+ dotenv.config({ path: ".env" });
7
+ dotenv.config({
8
+ path: ".env.local",
9
+ override: true
10
+ });
11
+ dotenv.config({
12
+ path: ".env.production",
13
+ override: true
14
+ });
9
15
  main(program);
10
16
  program.parse();
17
+ //#endregion
18
+ export {};
19
+
20
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","names":[],"sources":["../src/main.ts"],"sourcesContent":["#!/usr/bin/env node\n\n// Non-binary router - directly runs main.ts\nimport { main } from './index.js';\nimport dotenv from 'dotenv';\nimport { program } from 'commander';\n\ndotenv.config({ path: '.env' });\ndotenv.config({ path: '.env.local', override: true });\ndotenv.config({ path: '.env.production', override: true });\n\nmain(program);\nprogram.parse();\n"],"mappings":";;;;;AAOA,OAAO,OAAO,EAAE,MAAM,QAAQ,CAAC;AAC/B,OAAO,OAAO;CAAE,MAAM;CAAc,UAAU;CAAM,CAAC;AACrD,OAAO,OAAO;CAAE,MAAM;CAAmB,UAAU;CAAM,CAAC;AAE1D,KAAK,QAAQ;AACb,QAAQ,OAAO"}
@@ -1,53 +1,34 @@
1
- import fs from 'node:fs';
2
- import path from 'node:path';
3
- import { gt } from '../../utils/gt.js';
1
+ import { gt } from "../../utils/gt.js";
2
+ import path from "node:path";
3
+ import fs from "node:fs";
4
+ //#region src/next/config/parseNextConfig.ts
4
5
  /**
5
- * Extracts projectId, defaultLocale, and locales from a next.config.js file.
6
- * @param {string} filePath - The path to the next.config.js file.
7
- * @returns {object|null} - An object containing the extracted values or null if none found or incorrect types.
8
- */
9
- export async function parseNextConfig(filePath) {
10
- // Resolve the absolute path
11
- const absoluteFilePath = path.resolve(filePath);
12
- // Check if the file exists
13
- if (!fs.existsSync(absoluteFilePath)) {
14
- return {};
15
- }
16
- // Read the file content
17
- const fileContent = await fs.promises.readFile(absoluteFilePath, 'utf8');
18
- // Regular expressions to extract the values
19
- const defaultLocaleRegex = /defaultLocale:\s*['"]([^'"]+)['"]/;
20
- const projectIdRegex = /projectId:\s*['"]([^'"]+)['"]/;
21
- const localesRegex = /locales:\s*\[([^\]]+)\]/;
22
- // Extract the values
23
- const defaultLocaleMatch = fileContent.match(defaultLocaleRegex);
24
- const projectIdMatch = fileContent.match(projectIdRegex);
25
- const localesMatch = fileContent.match(localesRegex);
26
- const defaultLocale = defaultLocaleMatch && typeof defaultLocaleMatch[1] === 'string'
27
- ? defaultLocaleMatch[1]
28
- : undefined;
29
- const projectId = projectIdMatch && typeof projectIdMatch[1] === 'string'
30
- ? projectIdMatch[1]
31
- : undefined;
32
- const locales = localesMatch
33
- ? localesMatch[1]
34
- .split(',')
35
- .map((locale) => locale.trim().replace(/['"]/g, ''))
36
- .filter((locale) => typeof locale === 'string')
37
- : undefined;
38
- // Ensure approvedLocales is an array of strings
39
- const validLocales = locales && locales.every((locale) => gt.isValidLocale(locale))
40
- ? locales
41
- : undefined;
42
- // Return the extracted values if they pass type checks or return null
43
- if (defaultLocale || projectId || validLocales) {
44
- return {
45
- ...(defaultLocale && { defaultLocale }),
46
- ...(projectId && { projectId }),
47
- ...(validLocales && { locales: validLocales }),
48
- };
49
- }
50
- else {
51
- return {};
52
- }
6
+ * Extracts projectId, defaultLocale, and locales from a next.config.js file.
7
+ * @param {string} filePath - The path to the next.config.js file.
8
+ * @returns {object|null} - An object containing the extracted values or null if none found or incorrect types.
9
+ */
10
+ async function parseNextConfig(filePath) {
11
+ const absoluteFilePath = path.resolve(filePath);
12
+ if (!fs.existsSync(absoluteFilePath)) return {};
13
+ const fileContent = await fs.promises.readFile(absoluteFilePath, "utf8");
14
+ const defaultLocaleRegex = /defaultLocale:\s*['"]([^'"]+)['"]/;
15
+ const projectIdRegex = /projectId:\s*['"]([^'"]+)['"]/;
16
+ const localesRegex = /locales:\s*\[([^\]]+)\]/;
17
+ const defaultLocaleMatch = fileContent.match(defaultLocaleRegex);
18
+ const projectIdMatch = fileContent.match(projectIdRegex);
19
+ const localesMatch = fileContent.match(localesRegex);
20
+ const defaultLocale = defaultLocaleMatch && typeof defaultLocaleMatch[1] === "string" ? defaultLocaleMatch[1] : void 0;
21
+ const projectId = projectIdMatch && typeof projectIdMatch[1] === "string" ? projectIdMatch[1] : void 0;
22
+ const locales = localesMatch ? localesMatch[1].split(",").map((locale) => locale.trim().replace(/['"]/g, "")).filter((locale) => typeof locale === "string") : void 0;
23
+ const validLocales = locales && locales.every((locale) => gt.isValidLocale(locale)) ? locales : void 0;
24
+ if (defaultLocale || projectId || validLocales) return {
25
+ ...defaultLocale && { defaultLocale },
26
+ ...projectId && { projectId },
27
+ ...validLocales && { locales: validLocales }
28
+ };
29
+ else return {};
53
30
  }
31
+ //#endregion
32
+ export { parseNextConfig };
33
+
34
+ //# sourceMappingURL=parseNextConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parseNextConfig.js","names":[],"sources":["../../../src/next/config/parseNextConfig.ts"],"sourcesContent":["import fs from 'node:fs';\nimport path from 'node:path';\nimport { gt } from '../../utils/gt.js';\n\n/**\n * Extracts projectId, defaultLocale, and locales from a next.config.js file.\n * @param {string} filePath - The path to the next.config.js file.\n * @returns {object|null} - An object containing the extracted values or null if none found or incorrect types.\n */\nexport async function parseNextConfig(filePath: string): Promise<{\n projectId?: string;\n defaultLocale?: string;\n locales?: string[];\n}> {\n // Resolve the absolute path\n const absoluteFilePath = path.resolve(filePath);\n\n // Check if the file exists\n if (!fs.existsSync(absoluteFilePath)) {\n return {};\n }\n\n // Read the file content\n const fileContent = await fs.promises.readFile(absoluteFilePath, 'utf8');\n\n // Regular expressions to extract the values\n const defaultLocaleRegex = /defaultLocale:\\s*['\"]([^'\"]+)['\"]/;\n const projectIdRegex = /projectId:\\s*['\"]([^'\"]+)['\"]/;\n const localesRegex = /locales:\\s*\\[([^\\]]+)\\]/;\n\n // Extract the values\n const defaultLocaleMatch = fileContent.match(defaultLocaleRegex);\n const projectIdMatch = fileContent.match(projectIdRegex);\n const localesMatch = fileContent.match(localesRegex);\n\n const defaultLocale =\n defaultLocaleMatch && typeof defaultLocaleMatch[1] === 'string'\n ? defaultLocaleMatch[1]\n : undefined;\n const projectId =\n projectIdMatch && typeof projectIdMatch[1] === 'string'\n ? projectIdMatch[1]\n : undefined;\n const locales = localesMatch\n ? localesMatch[1]\n .split(',')\n .map((locale) => locale.trim().replace(/['\"]/g, ''))\n .filter((locale) => typeof locale === 'string')\n : undefined;\n\n // Ensure approvedLocales is an array of strings\n const validLocales =\n locales && locales.every((locale) => gt.isValidLocale(locale))\n ? locales\n : undefined;\n\n // Return the extracted values if they pass type checks or return null\n if (defaultLocale || projectId || validLocales) {\n return {\n ...(defaultLocale && { defaultLocale }),\n ...(projectId && { projectId }),\n ...(validLocales && { locales: validLocales }),\n };\n } else {\n return {};\n }\n}\n"],"mappings":";;;;;;;;;AASA,eAAsB,gBAAgB,UAInC;CAED,MAAM,mBAAmB,KAAK,QAAQ,SAAS;AAG/C,KAAI,CAAC,GAAG,WAAW,iBAAiB,CAClC,QAAO,EAAE;CAIX,MAAM,cAAc,MAAM,GAAG,SAAS,SAAS,kBAAkB,OAAO;CAGxE,MAAM,qBAAqB;CAC3B,MAAM,iBAAiB;CACvB,MAAM,eAAe;CAGrB,MAAM,qBAAqB,YAAY,MAAM,mBAAmB;CAChE,MAAM,iBAAiB,YAAY,MAAM,eAAe;CACxD,MAAM,eAAe,YAAY,MAAM,aAAa;CAEpD,MAAM,gBACJ,sBAAsB,OAAO,mBAAmB,OAAO,WACnD,mBAAmB,KACnB,KAAA;CACN,MAAM,YACJ,kBAAkB,OAAO,eAAe,OAAO,WAC3C,eAAe,KACf,KAAA;CACN,MAAM,UAAU,eACZ,aAAa,GACV,MAAM,IAAI,CACV,KAAK,WAAW,OAAO,MAAM,CAAC,QAAQ,SAAS,GAAG,CAAC,CACnD,QAAQ,WAAW,OAAO,WAAW,SAAS,GACjD,KAAA;CAGJ,MAAM,eACJ,WAAW,QAAQ,OAAO,WAAW,GAAG,cAAc,OAAO,CAAC,GAC1D,UACA,KAAA;AAGN,KAAI,iBAAiB,aAAa,aAChC,QAAO;EACL,GAAI,iBAAiB,EAAE,eAAe;EACtC,GAAI,aAAa,EAAE,WAAW;EAC9B,GAAI,gBAAgB,EAAE,SAAS,cAAc;EAC9C;KAED,QAAO,EAAE"}
@@ -1,42 +1,30 @@
1
- import * as t from '@babel/types';
2
- // Helper function to check if is the <html> fragment
3
- export function isHtmlElement(element) {
4
- return (t.isJSXIdentifier(element.name) &&
5
- element.name.name.toLowerCase() === 'html');
1
+ import * as t from "@babel/types";
2
+ //#region src/next/jsx/utils.ts
3
+ function isHtmlElement(element) {
4
+ return t.isJSXIdentifier(element.name) && element.name.name.toLowerCase() === "html";
6
5
  }
7
- // Helper function to check if is the <body> fragment
8
- export function isBodyElement(element) {
9
- return (t.isJSXIdentifier(element.name) &&
10
- element.name.name.toLowerCase() === 'body');
6
+ function isBodyElement(element) {
7
+ return t.isJSXIdentifier(element.name) && element.name.name.toLowerCase() === "body";
11
8
  }
12
- // Helper function to check if the <body> element has a <GTProvider> child
13
- export function hasGTProviderChild(element) {
14
- return element.children.some((child) => t.isJSXElement(child) &&
15
- t.isJSXIdentifier(child.openingElement.name) &&
16
- child.openingElement.name.name === 'GTProvider');
9
+ function hasGTProviderChild(element) {
10
+ return element.children.some((child) => t.isJSXElement(child) && t.isJSXIdentifier(child.openingElement.name) && child.openingElement.name.name === "GTProvider");
17
11
  }
18
- export function addDynamicLangAttribute(element) {
19
- // Remove existing lang attribute if present
20
- const langAttrIndex = element.attributes.findIndex((attr) => t.isJSXAttribute(attr) &&
21
- t.isJSXIdentifier(attr.name) &&
22
- attr.name.name === 'lang');
23
- if (langAttrIndex !== -1) {
24
- element.attributes.splice(langAttrIndex, 1);
25
- }
26
- // Add lang={await getLocale()} attribute
27
- element.attributes.push(t.jsxAttribute(t.jsxIdentifier('lang'), t.jsxExpressionContainer(t.awaitExpression(t.callExpression(t.identifier('getLocale'), [])))));
12
+ function addDynamicLangAttribute(element) {
13
+ const langAttrIndex = element.attributes.findIndex((attr) => t.isJSXAttribute(attr) && t.isJSXIdentifier(attr.name) && attr.name.name === "lang");
14
+ if (langAttrIndex !== -1) element.attributes.splice(langAttrIndex, 1);
15
+ element.attributes.push(t.jsxAttribute(t.jsxIdentifier("lang"), t.jsxExpressionContainer(t.awaitExpression(t.callExpression(t.identifier("getLocale"), [])))));
28
16
  }
29
- export function makeParentFunctionAsync(path) {
30
- const functionParent = path.getFunctionParent();
31
- if (!functionParent)
32
- return false;
33
- const node = functionParent.node;
34
- if ((t.isFunctionDeclaration(node) ||
35
- t.isFunctionExpression(node) ||
36
- t.isArrowFunctionExpression(node)) &&
37
- !node.async) {
38
- node.async = true;
39
- return true;
40
- }
41
- return false;
17
+ function makeParentFunctionAsync(path) {
18
+ const functionParent = path.getFunctionParent();
19
+ if (!functionParent) return false;
20
+ const node = functionParent.node;
21
+ if ((t.isFunctionDeclaration(node) || t.isFunctionExpression(node) || t.isArrowFunctionExpression(node)) && !node.async) {
22
+ node.async = true;
23
+ return true;
24
+ }
25
+ return false;
42
26
  }
27
+ //#endregion
28
+ export { addDynamicLangAttribute, hasGTProviderChild, isBodyElement, isHtmlElement, makeParentFunctionAsync };
29
+
30
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","names":[],"sources":["../../../src/next/jsx/utils.ts"],"sourcesContent":["import * as t from '@babel/types';\nimport { NodePath } from '@babel/traverse';\n\n// Helper function to check if is the <html> fragment\nexport function isHtmlElement(element: t.JSXOpeningElement): boolean {\n return (\n t.isJSXIdentifier(element.name) &&\n element.name.name.toLowerCase() === 'html'\n );\n}\n\n// Helper function to check if is the <body> fragment\nexport function isBodyElement(element: t.JSXOpeningElement): boolean {\n return (\n t.isJSXIdentifier(element.name) &&\n element.name.name.toLowerCase() === 'body'\n );\n}\n\n// Helper function to check if the <body> element has a <GTProvider> child\nexport function hasGTProviderChild(element: t.JSXElement): boolean {\n return element.children.some(\n (child) =>\n t.isJSXElement(child) &&\n t.isJSXIdentifier(child.openingElement.name) &&\n child.openingElement.name.name === 'GTProvider'\n );\n}\n\nexport function addDynamicLangAttribute(element: t.JSXOpeningElement): void {\n // Remove existing lang attribute if present\n const langAttrIndex = element.attributes.findIndex(\n (attr) =>\n t.isJSXAttribute(attr) &&\n t.isJSXIdentifier(attr.name) &&\n attr.name.name === 'lang'\n );\n\n if (langAttrIndex !== -1) {\n element.attributes.splice(langAttrIndex, 1);\n }\n\n // Add lang={await getLocale()} attribute\n element.attributes.push(\n t.jsxAttribute(\n t.jsxIdentifier('lang'),\n t.jsxExpressionContainer(\n t.awaitExpression(t.callExpression(t.identifier('getLocale'), []))\n )\n )\n );\n}\n\nexport function makeParentFunctionAsync(path: NodePath): boolean {\n const functionParent = path.getFunctionParent();\n if (!functionParent) return false;\n\n const node = functionParent.node;\n if (\n (t.isFunctionDeclaration(node) ||\n t.isFunctionExpression(node) ||\n t.isArrowFunctionExpression(node)) &&\n !node.async\n ) {\n node.async = true;\n return true;\n }\n return false;\n}\n"],"mappings":";;AAIA,SAAgB,cAAc,SAAuC;AACnE,QACE,EAAE,gBAAgB,QAAQ,KAAK,IAC/B,QAAQ,KAAK,KAAK,aAAa,KAAK;;AAKxC,SAAgB,cAAc,SAAuC;AACnE,QACE,EAAE,gBAAgB,QAAQ,KAAK,IAC/B,QAAQ,KAAK,KAAK,aAAa,KAAK;;AAKxC,SAAgB,mBAAmB,SAAgC;AACjE,QAAO,QAAQ,SAAS,MACrB,UACC,EAAE,aAAa,MAAM,IACrB,EAAE,gBAAgB,MAAM,eAAe,KAAK,IAC5C,MAAM,eAAe,KAAK,SAAS,aACtC;;AAGH,SAAgB,wBAAwB,SAAoC;CAE1E,MAAM,gBAAgB,QAAQ,WAAW,WACtC,SACC,EAAE,eAAe,KAAK,IACtB,EAAE,gBAAgB,KAAK,KAAK,IAC5B,KAAK,KAAK,SAAS,OACtB;AAED,KAAI,kBAAkB,GACpB,SAAQ,WAAW,OAAO,eAAe,EAAE;AAI7C,SAAQ,WAAW,KACjB,EAAE,aACA,EAAE,cAAc,OAAO,EACvB,EAAE,uBACA,EAAE,gBAAgB,EAAE,eAAe,EAAE,WAAW,YAAY,EAAE,EAAE,CAAC,CAAC,CACnE,CACF,CACF;;AAGH,SAAgB,wBAAwB,MAAyB;CAC/D,MAAM,iBAAiB,KAAK,mBAAmB;AAC/C,KAAI,CAAC,eAAgB,QAAO;CAE5B,MAAM,OAAO,eAAe;AAC5B,MACG,EAAE,sBAAsB,KAAK,IAC5B,EAAE,qBAAqB,KAAK,IAC5B,EAAE,0BAA0B,KAAK,KACnC,CAAC,KAAK,OACN;AACA,OAAK,QAAQ;AACb,SAAO;;AAET,QAAO"}
@@ -1,157 +1,90 @@
1
- import fs from 'node:fs';
2
- import { parse } from '@babel/parser';
3
- import generateModule from '@babel/generator';
4
- import traverseModule from '@babel/traverse';
5
- // Handle CommonJS/ESM interop
1
+ import { logger } from "../../console/logger.js";
2
+ import { needsCJS } from "../../utils/parse/needsCJS.js";
3
+ import fs from "node:fs";
4
+ import * as t from "@babel/types";
5
+ import { parse } from "@babel/parser";
6
+ import generateModule from "@babel/generator";
7
+ import traverseModule from "@babel/traverse";
8
+ //#region src/next/parse/handleInitGT.ts
6
9
  const traverse = traverseModule.default || traverseModule;
7
10
  const generate = generateModule.default || generateModule;
8
- import * as t from '@babel/types';
9
- import { logger } from '../../console/logger.js';
10
- import { needsCJS } from '../../utils/parse/needsCJS.js';
11
- export async function handleInitGT(filepath, errors, warnings, filesUpdated, packageJson, tsconfigJson) {
12
- const code = await fs.promises.readFile(filepath, 'utf8');
13
- let ast;
14
- try {
15
- ast = parse(code, {
16
- sourceType: 'module',
17
- plugins: ['jsx', 'typescript'],
18
- tokens: true,
19
- createParenthesizedExpressions: true,
20
- });
21
- // Get cjs or esm
22
- const cjsEnabled = needsCJS({
23
- ast,
24
- warnings,
25
- filepath,
26
- packageJson,
27
- tsconfigJson,
28
- });
29
- // Check if withGTConfig or initGT is already imported/required
30
- let hasGTConfig = false;
31
- let hasInitGT = false;
32
- traverse(ast, {
33
- ImportDeclaration(path) {
34
- if (path.node.source.value === 'gt-next/config') {
35
- path.node.specifiers.forEach((spec) => {
36
- if (t.isImportSpecifier(spec)) {
37
- if (spec.local.name === 'withGTConfig')
38
- hasGTConfig = true;
39
- if (spec.local.name === 'initGT')
40
- hasInitGT = true;
41
- }
42
- });
43
- }
44
- },
45
- VariableDeclaration(path) {
46
- path.node.declarations.forEach((dec) => {
47
- if (t.isVariableDeclarator(dec)) {
48
- // Handle destructuring: const { withGTConfig } = require('gt-next/config')
49
- if (t.isCallExpression(dec.init) &&
50
- t.isIdentifier(dec.init.callee, { name: 'require' }) &&
51
- t.isStringLiteral(dec.init.arguments[0], {
52
- value: 'gt-next/config',
53
- })) {
54
- // Handle simple assignment: const withGTConfig = require(...)
55
- if (t.isIdentifier(dec.id, { name: 'withGTConfig' }))
56
- hasGTConfig = true;
57
- if (t.isIdentifier(dec.id, { name: 'initGT' }))
58
- hasInitGT = true;
59
- // Handle destructuring: const { withGTConfig } = require(...)
60
- if (t.isObjectPattern(dec.id)) {
61
- dec.id.properties.forEach((prop) => {
62
- if (t.isObjectProperty(prop) &&
63
- t.isIdentifier(prop.key) &&
64
- t.isIdentifier(prop.value)) {
65
- if (prop.key.name === 'withGTConfig')
66
- hasGTConfig = true;
67
- if (prop.key.name === 'initGT')
68
- hasInitGT = true;
69
- }
70
- });
71
- }
72
- }
73
- // Handle member access: const withGTConfig = require('gt-next/config').withGTConfig
74
- else if (t.isMemberExpression(dec.init) &&
75
- t.isCallExpression(dec.init.object) &&
76
- t.isIdentifier(dec.init.object.callee, { name: 'require' }) &&
77
- t.isStringLiteral(dec.init.object.arguments[0], {
78
- value: 'gt-next/config',
79
- })) {
80
- if (t.isIdentifier(dec.id, { name: 'withGTConfig' }) &&
81
- t.isIdentifier(dec.init.property, { name: 'withGTConfig' })) {
82
- hasGTConfig = true;
83
- }
84
- if (t.isIdentifier(dec.id, { name: 'initGT' }) &&
85
- t.isIdentifier(dec.init.property, { name: 'initGT' })) {
86
- hasInitGT = true;
87
- }
88
- }
89
- }
90
- });
91
- },
92
- });
93
- // Return early if either withGTConfig or initGT is already present
94
- if (hasGTConfig || hasInitGT) {
95
- return;
96
- }
97
- ast.program.body.unshift(cjsEnabled
98
- ? t.variableDeclaration('const', [
99
- t.variableDeclarator(t.identifier('withGTConfig'), t.memberExpression(t.callExpression(t.identifier('require'), [
100
- t.stringLiteral('gt-next/config'),
101
- ]), t.identifier('withGTConfig'))),
102
- ])
103
- : t.importDeclaration([
104
- t.importSpecifier(t.identifier('withGTConfig'), t.identifier('withGTConfig')),
105
- ], t.stringLiteral('gt-next/config')));
106
- // Find and transform the default export
107
- traverse(ast, {
108
- ExportDefaultDeclaration(path) {
109
- const oldExport = path.node.declaration;
110
- let exportExpression;
111
- if (t.isFunctionDeclaration(oldExport)) {
112
- exportExpression = t.functionExpression(oldExport.id, oldExport.params, oldExport.body, oldExport.generator, oldExport.async);
113
- }
114
- else if (t.isClassDeclaration(oldExport)) {
115
- exportExpression = t.classExpression(oldExport.id, oldExport.superClass, oldExport.body, oldExport.decorators);
116
- }
117
- else if (t.isTSDeclareFunction(oldExport)) {
118
- // For TypeScript declare functions, create an empty function expression
119
- // since declare functions don't have a runtime implementation
120
- warnings.push(`Found TypeScript declare function in ${filepath}. Converting to empty function.`);
121
- exportExpression = t.functionExpression(oldExport.id, oldExport.params, t.blockStatement([]), false, false);
122
- }
123
- else {
124
- exportExpression = oldExport;
125
- }
126
- // Validate that we have a valid Next.js config export
127
- if (!t.isObjectExpression(exportExpression) &&
128
- !t.isFunctionExpression(exportExpression) &&
129
- !t.isArrowFunctionExpression(exportExpression)) {
130
- warnings.push(`Unexpected export type in ${filepath}. Next.js config should export an object or a function returning an object.`);
131
- }
132
- path.node.declaration = t.callExpression(t.identifier('withGTConfig'), [
133
- exportExpression,
134
- t.objectExpression([]),
135
- ]);
136
- },
137
- });
138
- // Generate the modified code
139
- const output = generate(ast, {
140
- retainLines: true,
141
- retainFunctionParens: true,
142
- comments: true,
143
- compact: 'auto',
144
- }, code);
145
- // Post-process the output to fix import spacing
146
- let processedCode = output.code;
147
- // Add newline after the comment only
148
- processedCode = processedCode.replace(/((?:import\s*{\s*withGTConfig\s*}\s*from|const\s*{\s*withGTConfig\s*}\s*=\s*require)\s*['"]gt-next\/config['"];?)/, '$1\n');
149
- // Write the modified code back to the file
150
- await fs.promises.writeFile(filepath, processedCode);
151
- filesUpdated.push(filepath);
152
- }
153
- catch (error) {
154
- logger.error(`Error parsing file ${filepath}: ${error}`);
155
- errors.push(`Failed to parse ${filepath}: ${error}`);
156
- }
11
+ async function handleInitGT(filepath, errors, warnings, filesUpdated, packageJson, tsconfigJson) {
12
+ const code = await fs.promises.readFile(filepath, "utf8");
13
+ let ast;
14
+ try {
15
+ ast = parse(code, {
16
+ sourceType: "module",
17
+ plugins: ["jsx", "typescript"],
18
+ tokens: true,
19
+ createParenthesizedExpressions: true
20
+ });
21
+ const cjsEnabled = needsCJS({
22
+ ast,
23
+ warnings,
24
+ filepath,
25
+ packageJson,
26
+ tsconfigJson
27
+ });
28
+ let hasGTConfig = false;
29
+ let hasInitGT = false;
30
+ traverse(ast, {
31
+ ImportDeclaration(path) {
32
+ if (path.node.source.value === "gt-next/config") path.node.specifiers.forEach((spec) => {
33
+ if (t.isImportSpecifier(spec)) {
34
+ if (spec.local.name === "withGTConfig") hasGTConfig = true;
35
+ if (spec.local.name === "initGT") hasInitGT = true;
36
+ }
37
+ });
38
+ },
39
+ VariableDeclaration(path) {
40
+ path.node.declarations.forEach((dec) => {
41
+ if (t.isVariableDeclarator(dec)) {
42
+ if (t.isCallExpression(dec.init) && t.isIdentifier(dec.init.callee, { name: "require" }) && t.isStringLiteral(dec.init.arguments[0], { value: "gt-next/config" })) {
43
+ if (t.isIdentifier(dec.id, { name: "withGTConfig" })) hasGTConfig = true;
44
+ if (t.isIdentifier(dec.id, { name: "initGT" })) hasInitGT = true;
45
+ if (t.isObjectPattern(dec.id)) dec.id.properties.forEach((prop) => {
46
+ if (t.isObjectProperty(prop) && t.isIdentifier(prop.key) && t.isIdentifier(prop.value)) {
47
+ if (prop.key.name === "withGTConfig") hasGTConfig = true;
48
+ if (prop.key.name === "initGT") hasInitGT = true;
49
+ }
50
+ });
51
+ } else if (t.isMemberExpression(dec.init) && t.isCallExpression(dec.init.object) && t.isIdentifier(dec.init.object.callee, { name: "require" }) && t.isStringLiteral(dec.init.object.arguments[0], { value: "gt-next/config" })) {
52
+ if (t.isIdentifier(dec.id, { name: "withGTConfig" }) && t.isIdentifier(dec.init.property, { name: "withGTConfig" })) hasGTConfig = true;
53
+ if (t.isIdentifier(dec.id, { name: "initGT" }) && t.isIdentifier(dec.init.property, { name: "initGT" })) hasInitGT = true;
54
+ }
55
+ }
56
+ });
57
+ }
58
+ });
59
+ if (hasGTConfig || hasInitGT) return;
60
+ ast.program.body.unshift(cjsEnabled ? t.variableDeclaration("const", [t.variableDeclarator(t.identifier("withGTConfig"), t.memberExpression(t.callExpression(t.identifier("require"), [t.stringLiteral("gt-next/config")]), t.identifier("withGTConfig")))]) : t.importDeclaration([t.importSpecifier(t.identifier("withGTConfig"), t.identifier("withGTConfig"))], t.stringLiteral("gt-next/config")));
61
+ traverse(ast, { ExportDefaultDeclaration(path) {
62
+ const oldExport = path.node.declaration;
63
+ let exportExpression;
64
+ if (t.isFunctionDeclaration(oldExport)) exportExpression = t.functionExpression(oldExport.id, oldExport.params, oldExport.body, oldExport.generator, oldExport.async);
65
+ else if (t.isClassDeclaration(oldExport)) exportExpression = t.classExpression(oldExport.id, oldExport.superClass, oldExport.body, oldExport.decorators);
66
+ else if (t.isTSDeclareFunction(oldExport)) {
67
+ warnings.push(`Found TypeScript declare function in ${filepath}. Converting to empty function.`);
68
+ exportExpression = t.functionExpression(oldExport.id, oldExport.params, t.blockStatement([]), false, false);
69
+ } else exportExpression = oldExport;
70
+ if (!t.isObjectExpression(exportExpression) && !t.isFunctionExpression(exportExpression) && !t.isArrowFunctionExpression(exportExpression)) warnings.push(`Unexpected export type in ${filepath}. Next.js config should export an object or a function returning an object.`);
71
+ path.node.declaration = t.callExpression(t.identifier("withGTConfig"), [exportExpression, t.objectExpression([])]);
72
+ } });
73
+ let processedCode = generate(ast, {
74
+ retainLines: true,
75
+ retainFunctionParens: true,
76
+ comments: true,
77
+ compact: "auto"
78
+ }, code).code;
79
+ processedCode = processedCode.replace(/((?:import\s*{\s*withGTConfig\s*}\s*from|const\s*{\s*withGTConfig\s*}\s*=\s*require)\s*['"]gt-next\/config['"];?)/, "$1\n");
80
+ await fs.promises.writeFile(filepath, processedCode);
81
+ filesUpdated.push(filepath);
82
+ } catch (error) {
83
+ logger.error(`Error parsing file ${filepath}: ${error}`);
84
+ errors.push(`Failed to parse ${filepath}: ${error}`);
85
+ }
157
86
  }
87
+ //#endregion
88
+ export { handleInitGT };
89
+
90
+ //# sourceMappingURL=handleInitGT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handleInitGT.js","names":[],"sources":["../../../src/next/parse/handleInitGT.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { parse } from '@babel/parser';\nimport generateModule from '@babel/generator';\nimport traverseModule from '@babel/traverse';\n\n// Handle CommonJS/ESM interop\nconst traverse = traverseModule.default || traverseModule;\nconst generate = generateModule.default || generateModule;\n\nimport * as t from '@babel/types';\nimport { logger } from '../../console/logger.js';\nimport { needsCJS } from '../../utils/parse/needsCJS.js';\n\nexport async function handleInitGT(\n filepath: string,\n errors: string[],\n warnings: string[],\n filesUpdated: string[],\n packageJson?: { type?: string },\n tsconfigJson?: { compilerOptions?: { module?: string } }\n) {\n const code = await fs.promises.readFile(filepath, 'utf8');\n\n let ast;\n try {\n ast = parse(code, {\n sourceType: 'module',\n plugins: ['jsx', 'typescript'],\n tokens: true,\n createParenthesizedExpressions: true,\n });\n\n // Get cjs or esm\n const cjsEnabled = needsCJS({\n ast,\n warnings,\n filepath,\n packageJson,\n tsconfigJson,\n });\n\n // Check if withGTConfig or initGT is already imported/required\n let hasGTConfig = false;\n let hasInitGT = false;\n traverse(ast, {\n ImportDeclaration(path) {\n if (path.node.source.value === 'gt-next/config') {\n path.node.specifiers.forEach((spec) => {\n if (t.isImportSpecifier(spec)) {\n if (spec.local.name === 'withGTConfig') hasGTConfig = true;\n if (spec.local.name === 'initGT') hasInitGT = true;\n }\n });\n }\n },\n VariableDeclaration(path) {\n path.node.declarations.forEach((dec) => {\n if (t.isVariableDeclarator(dec)) {\n // Handle destructuring: const { withGTConfig } = require('gt-next/config')\n if (\n t.isCallExpression(dec.init) &&\n t.isIdentifier(dec.init.callee, { name: 'require' }) &&\n t.isStringLiteral(dec.init.arguments[0], {\n value: 'gt-next/config',\n })\n ) {\n // Handle simple assignment: const withGTConfig = require(...)\n if (t.isIdentifier(dec.id, { name: 'withGTConfig' }))\n hasGTConfig = true;\n if (t.isIdentifier(dec.id, { name: 'initGT' })) hasInitGT = true;\n\n // Handle destructuring: const { withGTConfig } = require(...)\n if (t.isObjectPattern(dec.id)) {\n dec.id.properties.forEach((prop) => {\n if (\n t.isObjectProperty(prop) &&\n t.isIdentifier(prop.key) &&\n t.isIdentifier(prop.value)\n ) {\n if (prop.key.name === 'withGTConfig') hasGTConfig = true;\n if (prop.key.name === 'initGT') hasInitGT = true;\n }\n });\n }\n }\n // Handle member access: const withGTConfig = require('gt-next/config').withGTConfig\n else if (\n t.isMemberExpression(dec.init) &&\n t.isCallExpression(dec.init.object) &&\n t.isIdentifier(dec.init.object.callee, { name: 'require' }) &&\n t.isStringLiteral(dec.init.object.arguments[0], {\n value: 'gt-next/config',\n })\n ) {\n if (\n t.isIdentifier(dec.id, { name: 'withGTConfig' }) &&\n t.isIdentifier(dec.init.property, { name: 'withGTConfig' })\n ) {\n hasGTConfig = true;\n }\n if (\n t.isIdentifier(dec.id, { name: 'initGT' }) &&\n t.isIdentifier(dec.init.property, { name: 'initGT' })\n ) {\n hasInitGT = true;\n }\n }\n }\n });\n },\n });\n\n // Return early if either withGTConfig or initGT is already present\n if (hasGTConfig || hasInitGT) {\n return;\n }\n\n ast.program.body.unshift(\n cjsEnabled\n ? t.variableDeclaration('const', [\n t.variableDeclarator(\n t.identifier('withGTConfig'),\n t.memberExpression(\n t.callExpression(t.identifier('require'), [\n t.stringLiteral('gt-next/config'),\n ]),\n t.identifier('withGTConfig')\n )\n ),\n ])\n : t.importDeclaration(\n [\n t.importSpecifier(\n t.identifier('withGTConfig'),\n t.identifier('withGTConfig')\n ),\n ],\n t.stringLiteral('gt-next/config')\n )\n );\n\n // Find and transform the default export\n traverse(ast, {\n ExportDefaultDeclaration(path) {\n const oldExport = path.node.declaration;\n\n let exportExpression;\n if (t.isFunctionDeclaration(oldExport)) {\n exportExpression = t.functionExpression(\n oldExport.id,\n oldExport.params,\n oldExport.body,\n oldExport.generator,\n oldExport.async\n );\n } else if (t.isClassDeclaration(oldExport)) {\n exportExpression = t.classExpression(\n oldExport.id,\n oldExport.superClass,\n oldExport.body,\n oldExport.decorators\n );\n } else if (t.isTSDeclareFunction(oldExport)) {\n // For TypeScript declare functions, create an empty function expression\n // since declare functions don't have a runtime implementation\n warnings.push(\n `Found TypeScript declare function in ${filepath}. Converting to empty function.`\n );\n exportExpression = t.functionExpression(\n oldExport.id,\n oldExport.params,\n t.blockStatement([]),\n false,\n false\n );\n } else {\n exportExpression = oldExport;\n }\n\n // Validate that we have a valid Next.js config export\n if (\n !t.isObjectExpression(exportExpression) &&\n !t.isFunctionExpression(exportExpression) &&\n !t.isArrowFunctionExpression(exportExpression)\n ) {\n warnings.push(\n `Unexpected export type in ${filepath}. Next.js config should export an object or a function returning an object.`\n );\n }\n\n path.node.declaration = t.callExpression(t.identifier('withGTConfig'), [\n exportExpression,\n t.objectExpression([]),\n ]);\n },\n });\n\n // Generate the modified code\n const output = generate(\n ast,\n {\n retainLines: true,\n retainFunctionParens: true,\n comments: true,\n compact: 'auto',\n },\n code\n );\n\n // Post-process the output to fix import spacing\n let processedCode = output.code;\n // Add newline after the comment only\n processedCode = processedCode.replace(\n /((?:import\\s*{\\s*withGTConfig\\s*}\\s*from|const\\s*{\\s*withGTConfig\\s*}\\s*=\\s*require)\\s*['\"]gt-next\\/config['\"];?)/,\n '$1\\n'\n );\n\n // Write the modified code back to the file\n await fs.promises.writeFile(filepath, processedCode);\n filesUpdated.push(filepath);\n } catch (error) {\n logger.error(`Error parsing file ${filepath}: ${error}`);\n errors.push(`Failed to parse ${filepath}: ${error}`);\n }\n}\n"],"mappings":"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"}