gt 2.26.10 → 3.0.0-samsara.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (315) hide show
  1. package/CHANGELOG.md +41 -0
  2. package/dist/api/collectUserEditDiffs.d.ts +8 -3
  3. package/dist/api/downloadFileBatch.d.ts +20 -15
  4. package/dist/api/saveLocalEdits.d.ts +7 -2
  5. package/dist/auth/callbackPage.d.ts +13 -9
  6. package/dist/auth/credentialStore.d.ts +16 -14
  7. package/dist/auth/errors.d.ts +10 -6
  8. package/dist/auth/interactiveLogin.d.ts +7 -2
  9. package/dist/auth/loopback.d.ts +34 -31
  10. package/dist/auth/oauth.d.ts +33 -31
  11. package/dist/bin/bin-entry.d.ts +1 -1
  12. package/dist/bin/bin-main.d.ts +1 -2
  13. package/dist/cli/base.d.ts +107 -103
  14. package/dist/cli/base.js +3 -2
  15. package/dist/cli/base.js.map +1 -1
  16. package/dist/cli/commands/api.d.ts +19 -15
  17. package/dist/cli/commands/download.d.ts +7 -3
  18. package/dist/cli/commands/enqueue.d.ts +8 -3
  19. package/dist/cli/commands/setupProject.d.ts +11 -6
  20. package/dist/cli/commands/stage.d.ts +16 -11
  21. package/dist/cli/commands/translate.d.ts +12 -8
  22. package/dist/cli/commands/upload.d.ts +8 -3
  23. package/dist/cli/commands/utils/validation.d.ts +13 -6
  24. package/dist/cli/flags.d.ts +10 -5
  25. package/dist/cli/inline.d.ts +22 -17
  26. package/dist/cli/inline.js +2 -1
  27. package/dist/cli/inline.js.map +1 -1
  28. package/dist/cli/next.d.ts +14 -9
  29. package/dist/cli/node.d.ts +11 -6
  30. package/dist/cli/python.d.ts +11 -6
  31. package/dist/cli/react.d.ts +16 -11
  32. package/dist/cli/svelte.d.ts +20 -0
  33. package/dist/cli/svelte.js +40 -0
  34. package/dist/cli/svelte.js.map +1 -0
  35. package/dist/cli/vue.d.ts +20 -15
  36. package/dist/config/defaults.d.ts +8 -3
  37. package/dist/config/generateSettings.d.ts +34 -30
  38. package/dist/config/optionPresets.d.ts +8 -3
  39. package/dist/config/resolveConfig.d.ts +7 -3
  40. package/dist/config/utils.d.ts +7 -2
  41. package/dist/config/validateSettings.d.ts +9 -4
  42. package/dist/console/colors.d.ts +10 -6
  43. package/dist/console/displayTranslateSummary.d.ts +5 -1
  44. package/dist/console/formatting.d.ts +5 -1
  45. package/dist/console/index.d.ts +54 -50
  46. package/dist/console/localeOptions.d.ts +12 -8
  47. package/dist/console/logger.d.ts +64 -60
  48. package/dist/console/logging.d.ts +90 -60
  49. package/dist/console/promptParsing.d.ts +11 -6
  50. package/dist/extraction/mapToUpdates.d.ts +8 -3
  51. package/dist/extraction/postProcess.d.ts +9 -4
  52. package/dist/formats/files/aggregateFiles.d.ts +11 -6
  53. package/dist/formats/files/androidLocale.d.ts +5 -1
  54. package/dist/formats/files/collectFiles.d.ts +14 -9
  55. package/dist/formats/files/collectFonts.d.ts +11 -6
  56. package/dist/formats/files/convertToFileTranslationData.d.ts +8 -3
  57. package/dist/formats/files/detectLottieExpressions.d.ts +5 -1
  58. package/dist/formats/files/fileMapping.d.ts +8 -3
  59. package/dist/formats/files/localeContent.d.ts +8 -3
  60. package/dist/formats/files/localePath.d.ts +7 -2
  61. package/dist/formats/files/postprocess/keepUntranslatedPagePaths.d.ts +7 -2
  62. package/dist/formats/files/postprocess/keepUntranslatedPagePaths.js +4 -2
  63. package/dist/formats/files/postprocess/keepUntranslatedPagePaths.js.map +1 -1
  64. package/dist/formats/files/postprocess/localizeMintlifyRedirects.d.ts +10 -6
  65. package/dist/formats/files/postprocess/localizeMintlifyRedirects.js +3 -2
  66. package/dist/formats/files/postprocess/localizeMintlifyRedirects.js.map +1 -1
  67. package/dist/formats/files/postprocess/mintlify.d.ts +7 -2
  68. package/dist/formats/files/preprocess/mdx.d.ts +7 -2
  69. package/dist/formats/files/preprocess/mintlify.d.ts +7 -2
  70. package/dist/formats/files/preprocessContent.d.ts +8 -3
  71. package/dist/formats/files/save.d.ts +7 -2
  72. package/dist/formats/files/supportedFiles.d.ts +25 -21
  73. package/dist/formats/files/transformFormat.d.ts +52 -47
  74. package/dist/formats/json/extractJson.d.ts +7 -2
  75. package/dist/formats/json/flattenJson.d.ts +8 -3
  76. package/dist/formats/json/jsonPath.d.ts +12 -7
  77. package/dist/formats/json/jsonPointer.d.ts +9 -4
  78. package/dist/formats/json/mergeJson.d.ts +13 -8
  79. package/dist/formats/json/parseJson.d.ts +7 -2
  80. package/dist/formats/json/transformJson.d.ts +9 -4
  81. package/dist/formats/json/utils.d.ts +27 -23
  82. package/dist/formats/parseKeyedMetadata.d.ts +16 -11
  83. package/dist/formats/utils.d.ts +8 -3
  84. package/dist/formats/xcstrings/mergeXcstrings.d.ts +5 -1
  85. package/dist/formats/xcstrings/parseXcstrings.d.ts +16 -12
  86. package/dist/formats/yaml/extractYaml.d.ts +7 -2
  87. package/dist/formats/yaml/mergeYaml.d.ts +9 -4
  88. package/dist/formats/yaml/parseYaml.d.ts +9 -4
  89. package/dist/formats/yaml/utils.d.ts +7 -2
  90. package/dist/fs/clearLocaleDirs.d.ts +5 -1
  91. package/dist/fs/config/downloadedVersions.d.ts +51 -46
  92. package/dist/fs/config/downloadedVersions.js +3 -2
  93. package/dist/fs/config/downloadedVersions.js.map +1 -1
  94. package/dist/fs/config/loadConfig.d.ts +6 -2
  95. package/dist/fs/config/parseFilesConfig.d.ts +15 -10
  96. package/dist/fs/config/setupConfig.d.ts +22 -20
  97. package/dist/fs/config/updateConfig.d.ts +10 -7
  98. package/dist/fs/config/updateConfig.js +6 -4
  99. package/dist/fs/config/updateConfig.js.map +1 -1
  100. package/dist/fs/config/updateVersions.d.ts +13 -7
  101. package/dist/fs/config/updateVersions.js +2 -1
  102. package/dist/fs/config/updateVersions.js.map +1 -1
  103. package/dist/fs/copyFile.d.ts +7 -3
  104. package/dist/fs/createLoadTranslationsFile.d.ts +18 -8
  105. package/dist/fs/determineFramework/detectPythonLibrary.d.ts +7 -2
  106. package/dist/fs/determineFramework/index.d.ts +11 -7
  107. package/dist/fs/determineFramework/index.js +1 -0
  108. package/dist/fs/determineFramework/index.js.map +1 -1
  109. package/dist/fs/determineFramework/matchPyprojectDependency.d.ts +7 -2
  110. package/dist/fs/determineFramework/matchRequirementsTxtDependency.d.ts +7 -2
  111. package/dist/fs/determineFramework/matchSetupPyDependency.d.ts +7 -2
  112. package/dist/fs/determineFramework/resolveGtDependency.d.ts +7 -2
  113. package/dist/fs/fileContent.d.ts +14 -9
  114. package/dist/fs/findFilepath.d.ts +12 -8
  115. package/dist/fs/index.d.ts +1 -1
  116. package/dist/fs/loadJSON.d.ts +5 -1
  117. package/dist/fs/matchFiles.d.ts +5 -1
  118. package/dist/fs/saveJSON.d.ts +5 -1
  119. package/dist/fs/saveJSON.js +2 -1
  120. package/dist/fs/saveJSON.js.map +1 -1
  121. package/dist/fs/stringifyJson.d.ts +11 -0
  122. package/dist/fs/stringifyJson.js +15 -0
  123. package/dist/fs/stringifyJson.js.map +1 -0
  124. package/dist/fs/utils.d.ts +5 -1
  125. package/dist/functions.d.ts +3 -8
  126. package/dist/generated/version.d.ts +5 -1
  127. package/dist/generated/version.js +1 -1
  128. package/dist/generated/version.js.map +1 -1
  129. package/dist/git/branches.d.ts +10 -6
  130. package/dist/git/mergeDrivers.d.ts +13 -9
  131. package/dist/git/setupMergeDrivers.d.ts +28 -23
  132. package/dist/hooks/postProcess.d.ts +7 -3
  133. package/dist/index.d.ts +8 -4
  134. package/dist/index.js +2 -0
  135. package/dist/index.js.map +1 -1
  136. package/dist/locadex/setupFlow.d.ts +10 -3
  137. package/dist/locadex/setupFlow.js +1 -1
  138. package/dist/locadex/setupFlow.js.map +1 -1
  139. package/dist/main.d.ts +1 -2
  140. package/dist/next/jsx/utils.d.ts +12 -7
  141. package/dist/next/parse/handleInitGT.d.ts +9 -5
  142. package/dist/next/parse/wrapContent.d.ts +9 -4
  143. package/dist/python/parse/createPythonInlineUpdates.d.ts +10 -5
  144. package/dist/react/config/createESBuildConfig.d.ts +10 -6
  145. package/dist/react/jsx/evaluateJsx.d.ts +20 -15
  146. package/dist/react/jsx/utils/buildImportMap.d.ts +7 -2
  147. package/dist/react/jsx/utils/constants.d.ts +37 -33
  148. package/dist/react/jsx/utils/extractSourceCode.d.ts +9 -5
  149. package/dist/react/jsx/utils/getCalleeNameFromExpression.d.ts +9 -4
  150. package/dist/react/jsx/utils/getPathsAndAliases.d.ts +20 -15
  151. package/dist/react/jsx/utils/isNumberLiteral.d.ts +7 -2
  152. package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.d.ts +8 -3
  153. package/dist/react/jsx/utils/jsxParsing/autoInsertion.d.ts +9 -13
  154. package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.d.ts +11 -6
  155. package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.d.ts +11 -6
  156. package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.d.ts +7 -2
  157. package/dist/react/jsx/utils/jsxParsing/parseJsx.d.ts +34 -24
  158. package/dist/react/jsx/utils/jsxParsing/parseTProps.d.ts +19 -9
  159. package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.d.ts +7 -2
  160. package/dist/react/jsx/utils/jsxParsing/types.d.ts +27 -28
  161. package/dist/react/jsx/utils/mapAttributeName.d.ts +5 -2
  162. package/dist/react/jsx/utils/parseAst.d.ts +32 -27
  163. package/dist/react/jsx/utils/parseString.d.ts +11 -6
  164. package/dist/react/jsx/utils/parseStringFunction.d.ts +10 -5
  165. package/dist/react/jsx/utils/resolveImportPath.d.ts +7 -2
  166. package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.d.ts +7 -2
  167. package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.d.ts +29 -15
  168. package/dist/react/jsx/utils/stringParsing/derivation/index.d.ts +27 -14
  169. package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.d.ts +13 -5
  170. package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.d.ts +8 -3
  171. package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.d.ts +36 -26
  172. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.d.ts +15 -6
  173. package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.d.ts +22 -11
  174. package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.d.ts +8 -4
  175. package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.d.ts +25 -13
  176. package/dist/react/jsx/utils/stringParsing/types.d.ts +53 -48
  177. package/dist/react/jsx/utils/types.d.ts +10 -7
  178. package/dist/react/jsx/utils/validateStringFunction.d.ts +8 -3
  179. package/dist/react/jsx/wrapJsx.d.ts +31 -26
  180. package/dist/react/parse/addVitePlugin/index.d.ts +26 -16
  181. package/dist/react/parse/addVitePlugin/installCompiler.d.ts +10 -4
  182. package/dist/react/parse/addVitePlugin/updateViteConfig.d.ts +23 -12
  183. package/dist/react/parse/addVitePlugin/utils/addCompilerImport.d.ts +13 -5
  184. package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.d.ts +15 -6
  185. package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.d.ts +12 -7
  186. package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.d.ts +15 -6
  187. package/dist/react/parse/createDictionaryUpdates.d.ts +8 -3
  188. package/dist/react/parse/createInlineUpdates.d.ts +13 -9
  189. package/dist/react/parse/wrapContent.d.ts +9 -4
  190. package/dist/react/utils/flattenDictionary.d.ts +8 -3
  191. package/dist/react/utils/getEntryAndMetadata.d.ts +9 -4
  192. package/dist/react/utils/getVariableName.d.ts +16 -11
  193. package/dist/setup/buildTools/index.d.ts +41 -45
  194. package/dist/setup/buildTools/reactRouter/index.d.ts +7 -2
  195. package/dist/setup/buildTools/reactRouter/root.d.ts +22 -11
  196. package/dist/setup/buildTools/reactRouter/source.d.ts +11 -6
  197. package/dist/setup/buildTools/shared/document.d.ts +31 -17
  198. package/dist/setup/buildTools/shared/edits.d.ts +20 -15
  199. package/dist/setup/buildTools/shared/initializeGT.d.ts +23 -9
  200. package/dist/setup/buildTools/shared/jsx.d.ts +9 -4
  201. package/dist/setup/buildTools/shared/loader.d.ts +9 -4
  202. package/dist/setup/buildTools/shared/source.d.ts +32 -19
  203. package/dist/setup/buildTools/shared/source.js +24 -1
  204. package/dist/setup/buildTools/shared/source.js.map +1 -1
  205. package/dist/setup/buildTools/tanstackStart/index.d.ts +7 -2
  206. package/dist/setup/buildTools/tanstackStart/index.js +137 -88
  207. package/dist/setup/buildTools/tanstackStart/index.js.map +1 -1
  208. package/dist/setup/buildTools/tanstackStart/root.d.ts +21 -22
  209. package/dist/setup/buildTools/tanstackStart/root.js +155 -103
  210. package/dist/setup/buildTools/tanstackStart/root.js.map +1 -1
  211. package/dist/setup/buildTools/tanstackStart/router.d.ts +15 -7
  212. package/dist/setup/buildTools/tanstackStart/router.js +86 -23
  213. package/dist/setup/buildTools/tanstackStart/router.js.map +1 -1
  214. package/dist/setup/buildTools/tanstackStart/source.d.ts +18 -5
  215. package/dist/setup/buildTools/tanstackStart/source.js +34 -5
  216. package/dist/setup/buildTools/tanstackStart/source.js.map +1 -1
  217. package/dist/setup/buildTools/tanstackStart/viteConfig.d.ts +28 -0
  218. package/dist/setup/buildTools/tanstackStart/viteConfig.js +189 -0
  219. package/dist/setup/buildTools/tanstackStart/viteConfig.js.map +1 -0
  220. package/dist/setup/buildTools/vite.d.ts +8 -3
  221. package/dist/setup/detectFramework.d.ts +10 -5
  222. package/dist/setup/developmentCredentials.d.ts +24 -19
  223. package/dist/setup/frameworkUtils.d.ts +8 -3
  224. package/dist/setup/onboarding.d.ts +109 -99
  225. package/dist/setup/setupTarget.d.ts +5 -1
  226. package/dist/setup/setupViteSPA.d.ts +60 -30
  227. package/dist/setup/setupViteSPA.js +19 -9
  228. package/dist/setup/setupViteSPA.js.map +1 -1
  229. package/dist/setup/userInput.d.ts +14 -9
  230. package/dist/setup/wizard.d.ts +16 -12
  231. package/dist/state/mintlifyRefMap.d.ts +9 -4
  232. package/dist/state/orphanedFileNames.d.ts +7 -3
  233. package/dist/state/recentDownloads.d.ts +19 -14
  234. package/dist/state/translateWarnings.d.ts +13 -9
  235. package/dist/translation/extractInline.d.ts +9 -5
  236. package/dist/translation/extractInline.js +8 -0
  237. package/dist/translation/extractInline.js.map +1 -1
  238. package/dist/translation/parse.d.ts +12 -7
  239. package/dist/translation/reviewSetupWarning.d.ts +8 -3
  240. package/dist/translation/stage.d.ts +8 -3
  241. package/dist/translation/validate.d.ts +14 -9
  242. package/dist/types/branch.d.ts +17 -13
  243. package/dist/types/data/json.d.ts +8 -4
  244. package/dist/types/data.d.ts +33 -31
  245. package/dist/types/files.d.ts +12 -9
  246. package/dist/types/index.d.ts +278 -282
  247. package/dist/types/libraries.d.ts +30 -25
  248. package/dist/types/libraries.js +7 -1
  249. package/dist/types/libraries.js.map +1 -1
  250. package/dist/types/parsing.d.ts +26 -23
  251. package/dist/utils/addExplicitAnchorIds.d.ts +30 -26
  252. package/dist/utils/api.d.ts +265 -258
  253. package/dist/utils/apiBaseUrl.d.ts +5 -1
  254. package/dist/utils/batchProcess.d.ts +6 -2
  255. package/dist/utils/calculateTimeoutMs.d.ts +5 -1
  256. package/dist/utils/constants.d.ts +15 -11
  257. package/dist/utils/credentials.d.ts +22 -18
  258. package/dist/utils/flattenJsonFiles.d.ts +7 -2
  259. package/dist/utils/flattenJsonFiles.js +4 -2
  260. package/dist/utils/flattenJsonFiles.js.map +1 -1
  261. package/dist/utils/gitDiff.d.ts +5 -1
  262. package/dist/utils/hash.d.ts +6 -2
  263. package/dist/utils/installPackage.d.ts +8 -3
  264. package/dist/utils/loadEnv.d.ts +6 -2
  265. package/dist/utils/localizeMintlifyFrontmatterUrls.d.ts +10 -5
  266. package/dist/utils/localizeRelativeAssets.d.ts +11 -7
  267. package/dist/utils/localizeStaticImports.d.ts +8 -3
  268. package/dist/utils/localizeStaticUrls.d.ts +14 -9
  269. package/dist/utils/mdxAnchorSyntax.d.ts +18 -12
  270. package/dist/utils/mintlifyTitleFallback.d.ts +7 -4
  271. package/dist/utils/monorepoVersionCheck.d.ts +7 -2
  272. package/dist/utils/packageInfo.d.ts +6 -2
  273. package/dist/utils/packageJson.d.ts +10 -6
  274. package/dist/utils/packageJson.js +4 -1
  275. package/dist/utils/packageJson.js.map +1 -1
  276. package/dist/utils/packageManager.d.ts +29 -25
  277. package/dist/utils/parse/needsCJS.d.ts +24 -13
  278. package/dist/utils/persistPostprocessHashes.d.ts +8 -3
  279. package/dist/utils/processAnchorIds.d.ts +7 -2
  280. package/dist/utils/processOpenApi.d.ts +7 -2
  281. package/dist/utils/processOpenApi.js +2 -1
  282. package/dist/utils/processOpenApi.js.map +1 -1
  283. package/dist/utils/reactPackageCompatibility.d.ts +6 -2
  284. package/dist/utils/resolveMintlifyRefs.d.ts +17 -13
  285. package/dist/utils/resolvePublish.d.ts +10 -5
  286. package/dist/utils/sanitizeFileContent.d.ts +5 -1
  287. package/dist/utils/sharedStaticAssets.d.ts +8 -3
  288. package/dist/utils/splitMintlifyLanguageRefs.d.ts +7 -2
  289. package/dist/utils/splitMintlifyLanguageRefs.js +10 -3
  290. package/dist/utils/splitMintlifyLanguageRefs.js.map +1 -1
  291. package/dist/utils/validateMdx.d.ts +7 -3
  292. package/dist/utils/wrapPlainUrls.d.ts +5 -1
  293. package/dist/workflows/download.d.ts +37 -22
  294. package/dist/workflows/enqueue.d.ts +18 -8
  295. package/dist/workflows/publish.d.ts +10 -5
  296. package/dist/workflows/setupProject.d.ts +11 -6
  297. package/dist/workflows/stage.d.ts +21 -11
  298. package/dist/workflows/steps/BranchStep.d.ts +15 -11
  299. package/dist/workflows/steps/DownloadStep.d.ts +26 -17
  300. package/dist/workflows/steps/EnqueueStep.d.ts +15 -12
  301. package/dist/workflows/steps/PollJobsStep.d.ts +38 -27
  302. package/dist/workflows/steps/PublishStep.d.ts +12 -7
  303. package/dist/workflows/steps/SetupStep.d.ts +15 -11
  304. package/dist/workflows/steps/TagStep.d.ts +15 -11
  305. package/dist/workflows/steps/UploadSourcesStep.d.ts +27 -21
  306. package/dist/workflows/steps/UploadTranslationsStep.d.ts +29 -23
  307. package/dist/workflows/steps/UserEditDiffsStep.d.ts +12 -7
  308. package/dist/workflows/upload.d.ts +18 -10
  309. package/dist/workflows/utils/filterFilesForEnqueue.d.ts +20 -11
  310. package/dist/workflows/utils/queryCompletedTranslations.d.ts +10 -5
  311. package/dist/workflows/utils/syncFonts.d.ts +7 -2
  312. package/package.json +55 -43
  313. package/dist/setup/buildTools/tanstackStart/middleware.d.ts +0 -9
  314. package/dist/setup/buildTools/tanstackStart/middleware.js +0 -60
  315. package/dist/setup/buildTools/tanstackStart/middleware.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,33 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 3.0.0-samsara.0
4
+
5
+ ### Major Changes
6
+
7
+ - bb107a8: Replace wildcard `exports` with an explicit list. Undocumented deep imports such as `gt/console/logging`, available through gt 2.x, are no longer importable.
8
+
9
+ ### Minor Changes
10
+
11
+ - 469b2e2: feat: detect gt-svelte projects and extract `<T>` and string calls from `.svelte` files
12
+ - 00227d1: `gt init` sets up TanStack Start apps with the `gtTanstackStart()` Vite plugin and `setupRouterGTIntegration({ router })` instead of editing `src/start.ts`, adding a root route loader and `<GTProvider>`, and generating a `loadTranslations` file. It sets the root route's `<html lang>` to `useLocale()`. In SPA mode, it asks you to move UI out of the root route so the prerendered shell stays blank until the visitor's translations load. The new setup requires gt-tanstack-start 12; with an older version installed, `gt init` leaves the app's source unchanged and asks you to upgrade.
13
+
14
+ ### Patch Changes
15
+
16
+ - bb107a8: Fix published type declarations that failed to resolve, or resolved to CommonJS types, under `moduleResolution` `node16` or `nodenext`.
17
+ - de29049: Keep the trailing newline of JSON files the CLI rewrites in place, such as `redirects.json`, `docs.json`, `gt.config.json`, and `package.json`, and end JSON files the CLI generates, such as `gt-lock.json`, with a newline
18
+ - e6dac30: `gt init --locadex` now returns you to the dashboard after you connect GitHub, instead of a page that doesn't exist.
19
+ - Updated dependencies [da7af80]
20
+ - Updated dependencies [bb107a8]
21
+ - Updated dependencies [bb107a8]
22
+ - Updated dependencies [002f579]
23
+ - Updated dependencies [8673283]
24
+ - generaltranslation@10.0.0-samsara.0
25
+ - @generaltranslation/format@1.0.0-samsara.1
26
+ - @generaltranslation/python-extractor@0.2.64-samsara.0
27
+ - @generaltranslation/vue-extractor@0.1.23-samsara.0
28
+ - @generaltranslation/svelte-extractor@0.1.0-samsara.0
29
+ - @generaltranslation/supported-locales@2.1.45-samsara.0
30
+
3
31
  ## 2.26.10
4
32
 
5
33
  ### Patch Changes
@@ -34,6 +62,19 @@
34
62
 
35
63
  - [#2514](https://github.com/generaltranslation/gt/pull/2514) [`e2aee57`](https://github.com/generaltranslation/gt/commit/e2aee57260df269e77b7082ae2b428c2ec9076bb) Thanks [@chenxin-yan](https://github.com/chenxin-yan)! - `gt upload` now uploads translations to the resolved branch (for example, `--branch <name>`) instead of the project's default branch.
36
64
 
65
+ ## 2.26.7-samsara.0
66
+
67
+ ### Patch Changes
68
+
69
+ - Updated dependencies [0604209]
70
+ - @generaltranslation/icu@0.1.3-samsara.0
71
+ - gt-remark@1.0.13-samsara.0
72
+ - generaltranslation@9.5.8-samsara.0
73
+ - @generaltranslation/format@0.1.10-samsara.0
74
+ - @generaltranslation/python-extractor@0.2.63-samsara.0
75
+ - @generaltranslation/supported-locales@2.1.44-samsara.0
76
+ - @generaltranslation/vue-extractor@0.1.22-samsara.0
77
+
37
78
  ## 2.26.6
38
79
 
39
80
  ### Patch Changes
@@ -1,5 +1,7 @@
1
- import { Settings } from '../types/index.js';
2
- import { FileReference } from 'generaltranslation/types';
1
+ import { Settings } from "../types/index.js";
2
+ import { FileReference } from "generaltranslation/types";
3
+
4
+ //#region src/api/collectUserEditDiffs.d.ts
3
5
  /**
4
6
  * Collects local user edits by diffing the latest downloaded server translation version
5
7
  * against the current local translation file, and submits the diffs upstream.
@@ -8,4 +10,7 @@ import { FileReference } from 'generaltranslation/types';
8
10
  *
9
11
  * Must run before enqueueing new translations so rules are available to the generator.
10
12
  */
11
- export declare function collectAndSendUserEditDiffs(files: FileReference[], settings: Settings): Promise<boolean>;
13
+ declare function collectAndSendUserEditDiffs(files: FileReference[], settings: Settings): Promise<boolean>;
14
+ //#endregion
15
+ export { collectAndSendUserEditDiffs };
16
+ //# sourceMappingURL=collectUserEditDiffs.d.ts.map
@@ -1,18 +1,20 @@
1
- import { Settings } from '../types/index.js';
2
- import type { FileStatusTracker } from '../workflows/steps/PollJobsStep.js';
3
- import { type InlineLibrary } from '../types/libraries.js';
4
- export type BatchedFiles = {
5
- branchId: string;
6
- fileId: string;
7
- versionId: string;
8
- locale: string;
9
- outputPath: string;
10
- inputPath: string;
1
+ import { InlineLibrary } from "../types/libraries.js";
2
+ import { Settings } from "../types/index.js";
3
+ import { FileStatusTracker } from "../workflows/steps/PollJobsStep.js";
4
+
5
+ //#region src/api/downloadFileBatch.d.ts
6
+ type BatchedFiles = {
7
+ branchId: string;
8
+ fileId: string;
9
+ versionId: string;
10
+ locale: string;
11
+ outputPath: string;
12
+ inputPath: string;
11
13
  }[];
12
- export type DownloadFileBatchResult = {
13
- successful: BatchedFiles;
14
- failed: BatchedFiles;
15
- skipped: BatchedFiles;
14
+ type DownloadFileBatchResult = {
15
+ successful: BatchedFiles;
16
+ failed: BatchedFiles;
17
+ skipped: BatchedFiles;
16
18
  };
17
19
  /**
18
20
  * Downloads multiple translation files in a single batch request
@@ -23,4 +25,7 @@ export type DownloadFileBatchResult = {
23
25
  * @param inlineLibrary - Inline runtime used to label the shared GTJSON file
24
26
  * @returns Object containing successful and failed file IDs
25
27
  */
26
- export declare function downloadFileBatch(fileTracker: FileStatusTracker, files: BatchedFiles, options: Settings, forceDownload?: boolean, inlineLibrary?: InlineLibrary): Promise<DownloadFileBatchResult>;
28
+ declare function downloadFileBatch(fileTracker: FileStatusTracker, files: BatchedFiles, options: Settings, forceDownload?: boolean, inlineLibrary?: InlineLibrary): Promise<DownloadFileBatchResult>;
29
+ //#endregion
30
+ export { BatchedFiles, DownloadFileBatchResult, downloadFileBatch };
31
+ //# sourceMappingURL=downloadFileBatch.d.ts.map
@@ -1,6 +1,11 @@
1
- import { Settings } from '../types/index.js';
1
+ import { Settings } from "../types/index.js";
2
+
3
+ //#region src/api/saveLocalEdits.d.ts
2
4
  /**
3
5
  * Uploads current source files to obtain file references, then collects and sends
4
6
  * diffs for all locales based on last downloaded versions. Does not enqueue translations.
5
7
  */
6
- export declare function saveLocalEdits(settings: Settings): Promise<void>;
8
+ declare function saveLocalEdits(settings: Settings): Promise<void>;
9
+ //#endregion
10
+ export { saveLocalEdits };
11
+ //# sourceMappingURL=saveLocalEdits.d.ts.map
@@ -1,15 +1,19 @@
1
+ //#region src/auth/callbackPage.d.ts
1
2
  /** What the page says: a signed-in account, or why the login did not finish. */
2
- export type CallbackPageView = {
3
- ok: true;
4
- account?: string;
3
+ type CallbackPageView = {
4
+ ok: true;
5
+ account?: string;
5
6
  } | {
6
- ok: false;
7
- reason: 'denied' | 'failed';
7
+ ok: false;
8
+ reason: 'denied' | 'failed';
8
9
  };
9
10
  /** The part of a success view the login flow can add after the exchange. */
10
- export type CallbackPageDetails = {
11
- account?: string;
11
+ type CallbackPageDetails = {
12
+ account?: string;
12
13
  };
13
14
  /** The policy the loopback server sends with the page. */
14
- export declare const CALLBACK_PAGE_CSP: string;
15
- export declare function renderCallbackPage(view: CallbackPageView): string;
15
+ declare const CALLBACK_PAGE_CSP: string;
16
+ declare function renderCallbackPage(view: CallbackPageView): string;
17
+ //#endregion
18
+ export { CALLBACK_PAGE_CSP, CallbackPageDetails, CallbackPageView, renderCallbackPage };
19
+ //# sourceMappingURL=callbackPage.d.ts.map
@@ -1,15 +1,17 @@
1
- export type OAuthTokens = {
2
- accessToken: string;
3
- expiresAt: number;
4
- refreshToken: string;
5
- /** API resource (origin href) the tokens were issued for. */
6
- resource: string;
7
- scope: string;
8
- tokenType: string;
9
- /** Subject from a validated, signature-checked ID token. */
10
- subject: string;
1
+ //#region src/auth/credentialStore.d.ts
2
+ type OAuthTokens = {
3
+ accessToken: string;
4
+ expiresAt: number;
5
+ refreshToken: string; /** API resource (origin href) the tokens were issued for. */
6
+ resource: string;
7
+ scope: string;
8
+ tokenType: string; /** Subject from a validated, signature-checked ID token. */
9
+ subject: string;
11
10
  };
12
- export declare function getCredentialsPath(): string;
13
- export declare function readOAuthTokens(authBaseUrl: string): Promise<OAuthTokens | undefined>;
14
- export declare function writeOAuthTokens(tokens: OAuthTokens, authBaseUrl: string): Promise<void>;
15
- export declare function deleteOAuthTokens(authBaseUrl: string): Promise<void>;
11
+ declare function getCredentialsPath(): string;
12
+ declare function readOAuthTokens(authBaseUrl: string): Promise<OAuthTokens | undefined>;
13
+ declare function writeOAuthTokens(tokens: OAuthTokens, authBaseUrl: string): Promise<void>;
14
+ declare function deleteOAuthTokens(authBaseUrl: string): Promise<void>;
15
+ //#endregion
16
+ export { OAuthTokens, deleteOAuthTokens, getCredentialsPath, readOAuthTokens, writeOAuthTokens };
17
+ //# sourceMappingURL=credentialStore.d.ts.map
@@ -1,8 +1,12 @@
1
- export type UserAuthErrorCode = 'login_required' | 'obsolete_credentials' | 'resource_mismatch' | 'oauth';
1
+ //#region src/auth/errors.d.ts
2
+ type UserAuthErrorCode = 'login_required' | 'obsolete_credentials' | 'resource_mismatch' | 'oauth';
2
3
  /** `message` is a complete `gt Error:` diagnostic; commands print it as-is. */
3
- export declare class UserAuthError extends Error {
4
- readonly code: UserAuthErrorCode;
5
- constructor(code: UserAuthErrorCode, whatHappened: string, fix?: string, details?: string);
4
+ declare class UserAuthError extends Error {
5
+ readonly code: UserAuthErrorCode;
6
+ constructor(code: UserAuthErrorCode, whatHappened: string, fix?: string, details?: string);
6
7
  }
7
- export declare function loginRequiredError(): UserAuthError;
8
- export declare function createUserAuthError(whatHappened: string, error: unknown): string;
8
+ declare function loginRequiredError(): UserAuthError;
9
+ declare function createUserAuthError(whatHappened: string, error: unknown): string;
10
+ //#endregion
11
+ export { UserAuthError, UserAuthErrorCode, createUserAuthError, loginRequiredError };
12
+ //# sourceMappingURL=errors.d.ts.map
@@ -1,2 +1,7 @@
1
- import { type DeviceCode } from './oauth.js';
2
- export declare function loginInteractively(baseUrl: string | undefined, useBrowser?: boolean, onDeviceCode?: (deviceCode: DeviceCode) => void): Promise<void>;
1
+ import { DeviceCode } from "./oauth.js";
2
+
3
+ //#region src/auth/interactiveLogin.d.ts
4
+ declare function loginInteractively(baseUrl: string | undefined, useBrowser?: boolean, onDeviceCode?: (deviceCode: DeviceCode) => void): Promise<void>;
5
+ //#endregion
6
+ export { loginInteractively };
7
+ //# sourceMappingURL=interactiveLogin.d.ts.map
@@ -1,43 +1,46 @@
1
- import { type CallbackPageDetails } from './callbackPage.js';
2
- export declare const LOOPBACK_CALLBACK_PATH = "/callback";
1
+ import { CallbackPageDetails } from "./callbackPage.js";
2
+
3
+ //#region src/auth/loopback.d.ts
4
+ declare const LOOPBACK_CALLBACK_PATH = "/callback";
3
5
  /**
4
6
  * How long a settled callback's page stays available to a browser that
5
7
  * repeats the navigation after the exchange (a first request it aborted, a
6
8
  * refresh), while the process is still running.
7
9
  */
8
- export declare const CALLBACK_REPEAT_WINDOW_MS = 10000;
10
+ declare const CALLBACK_REPEAT_WINDOW_MS = 10000;
9
11
  /**
10
12
  * How long the process stays open for the browser's repeat when the first
11
13
  * request was abandoned before its page was sent, so the page the browser
12
14
  * never received can still reach it.
13
15
  */
14
- export declare const CALLBACK_RETRY_HOLD_MS = 5000;
15
- export type CallbackWaitOptions<T> = {
16
- /** What the page says about a success, such as the signed-in account. */
17
- describe?: (result: T) => CallbackPageDetails;
18
- /**
19
- * Whether a failed exchange was the user's own denial; the page reads the
20
- * exchange's error, so it agrees with the terminal. Without it every
21
- * failure is shown as failed.
22
- */
23
- failure?: (error: unknown) => 'denied' | 'failed';
16
+ declare const CALLBACK_RETRY_HOLD_MS = 5000;
17
+ type CallbackWaitOptions<T> = {
18
+ /** What the page says about a success, such as the signed-in account. */describe?: (result: T) => CallbackPageDetails;
19
+ /**
20
+ * Whether a failed exchange was the user's own denial; the page reads the
21
+ * exchange's error, so it agrees with the terminal. Without it every
22
+ * failure is shown as failed.
23
+ */
24
+ failure?: (error: unknown) => 'denied' | 'failed';
24
25
  };
25
- export type LoopbackServer = {
26
- /** Loopback redirect URI bound to an ephemeral port, e.g. http://127.0.0.1:53211/callback */
27
- redirectUri: string;
28
- /**
29
- * Shows the result page only after the callback has been validated and
30
- * saved. `describe` adds what the page says about a success, such as the
31
- * signed-in account, and `failure` says whether a failure was a denial.
32
- */
33
- waitForCallback: <T>(onCallback: (url: URL) => Promise<T>, timeoutMs?: number, options?: CallbackWaitOptions<T>) => Promise<T>;
34
- /**
35
- * Stops the server. Once a callback has settled, repeats of that callback
36
- * are still answered for CALLBACK_REPEAT_WINDOW_MS while the process runs;
37
- * the listener holds the process open only for CALLBACK_RETRY_HOLD_MS, and
38
- * only when the first page was never sent. A command that exits on its own
39
- * (a failed `gt login` exits at once) ends the window early.
40
- */
41
- close: () => void;
26
+ type LoopbackServer = {
27
+ /** Loopback redirect URI bound to an ephemeral port, e.g. http://127.0.0.1:53211/callback */redirectUri: string;
28
+ /**
29
+ * Shows the result page only after the callback has been validated and
30
+ * saved. `describe` adds what the page says about a success, such as the
31
+ * signed-in account, and `failure` says whether a failure was a denial.
32
+ */
33
+ waitForCallback: <T>(onCallback: (url: URL) => Promise<T>, timeoutMs?: number, options?: CallbackWaitOptions<T>) => Promise<T>;
34
+ /**
35
+ * Stops the server. Once a callback has settled, repeats of that callback
36
+ * are still answered for CALLBACK_REPEAT_WINDOW_MS while the process runs;
37
+ * the listener holds the process open only for CALLBACK_RETRY_HOLD_MS, and
38
+ * only when the first page was never sent. A command that exits on its own
39
+ * (a failed `gt login` exits at once) ends the window early.
40
+ */
41
+ close: () => void;
42
42
  };
43
- export declare function startLoopbackServer(): Promise<LoopbackServer>;
43
+ declare function startLoopbackServer(): Promise<LoopbackServer>;
44
+ //#endregion
45
+ export { CALLBACK_REPEAT_WINDOW_MS, CALLBACK_RETRY_HOLD_MS, CallbackWaitOptions, LOOPBACK_CALLBACK_PATH, LoopbackServer, startLoopbackServer };
46
+ //# sourceMappingURL=loopback.d.ts.map
@@ -1,41 +1,43 @@
1
- import type { UserTokenProvider } from 'generaltranslation/api';
2
- import type { OAuthTokens } from './credentialStore.js';
3
- export type DeviceCode = {
4
- userCode: string;
5
- verificationUri: string;
6
- verificationUriComplete?: string;
1
+ import { OAuthTokens } from "./credentialStore.js";
2
+ import { UserTokenProvider } from "generaltranslation/api";
3
+
4
+ //#region src/auth/oauth.d.ts
5
+ type DeviceCode = {
6
+ userCode: string;
7
+ verificationUri: string;
8
+ verificationUriComplete?: string;
7
9
  };
8
- export type UserInfo = {
9
- email?: string;
10
- name?: string;
11
- sub: string;
10
+ type UserInfo = {
11
+ email?: string;
12
+ name?: string;
13
+ sub: string;
12
14
  };
13
15
  type OAuthRequestOptions = {
14
- authBaseUrl?: string;
15
- fetch?: typeof fetch;
16
+ authBaseUrl?: string;
17
+ fetch?: typeof fetch;
16
18
  };
17
- export type UserTokenProviderOptions = OAuthRequestOptions & {
18
- /** API the requests go to; must match the resource the login was issued for. */
19
- baseUrl: string;
19
+ type UserTokenProviderOptions = OAuthRequestOptions & {
20
+ /** API the requests go to; must match the resource the login was issued for. */baseUrl: string;
20
21
  };
21
- export type LoginOptions = OAuthRequestOptions & {
22
- /** API the token is issued for; GT_API_URL overrides it, and the public API is the default. */
23
- baseUrl?: string;
24
- noBrowser?: boolean;
25
- onDeviceCode?: (deviceCode: DeviceCode) => void;
26
- signal?: AbortSignal;
27
- onAuthorizationUrl?: (url: string) => void;
28
- openBrowser?: (url: string) => Promise<unknown>;
29
- timeoutMs?: number;
22
+ type LoginOptions = OAuthRequestOptions & {
23
+ /** API the token is issued for; GT_API_URL overrides it, and the public API is the default. */baseUrl?: string;
24
+ noBrowser?: boolean;
25
+ onDeviceCode?: (deviceCode: DeviceCode) => void;
26
+ signal?: AbortSignal;
27
+ onAuthorizationUrl?: (url: string) => void;
28
+ openBrowser?: (url: string) => Promise<unknown>;
29
+ timeoutMs?: number;
30
30
  };
31
31
  /** How long the callback page waits to learn the account's name. */
32
- export declare const ACCOUNT_LOOKUP_TIMEOUT_MS = 3000;
32
+ declare const ACCOUNT_LOOKUP_TIMEOUT_MS = 3000;
33
33
  /** Browser S256/loopback, or device login for SSH, --no-browser and bind failure. */
34
- export declare function login(options?: LoginOptions): Promise<OAuthTokens>;
34
+ declare function login(options?: LoginOptions): Promise<OAuthTokens>;
35
35
  /** Whether a stored login exists for this API; does not refresh or contact the server. */
36
- export declare function hasLogin(options: UserTokenProviderOptions): Promise<boolean>;
36
+ declare function hasLogin(options: UserTokenProviderOptions): Promise<boolean>;
37
37
  /** Construction is deliberately free of auth/storage/discovery I/O. */
38
- export declare function createUserTokenProvider(options: UserTokenProviderOptions): UserTokenProvider;
39
- export declare function logout(options?: OAuthRequestOptions): Promise<void>;
40
- export declare function whoAmI(options?: OAuthRequestOptions): Promise<UserInfo>;
41
- export {};
38
+ declare function createUserTokenProvider(options: UserTokenProviderOptions): UserTokenProvider;
39
+ declare function logout(options?: OAuthRequestOptions): Promise<void>;
40
+ declare function whoAmI(options?: OAuthRequestOptions): Promise<UserInfo>;
41
+ //#endregion
42
+ export { ACCOUNT_LOOKUP_TIMEOUT_MS, DeviceCode, LoginOptions, UserInfo, UserTokenProviderOptions, createUserTokenProvider, hasLogin, login, logout, whoAmI };
43
+ //# sourceMappingURL=oauth.d.ts.map
@@ -1 +1 @@
1
- export {};
1
+ export { };
@@ -1,2 +1 @@
1
- #!/usr/bin/env node
2
- export {};
1
+ export { };
@@ -1,110 +1,114 @@
1
- import { Command } from 'commander';
2
- import { Settings, SupportedFrameworks, SupportedLibraries, TranslateFlags } from '../types/index.js';
3
- import { type ReactSetupPlan } from '../setup/wizard.js';
4
- import { type ConfigureOptions, type InitOptions, type OnboardingSession } from '../setup/onboarding.js';
5
- export type UploadOptions = {
6
- config?: string;
7
- apiKey?: string;
8
- projectId?: string;
9
- defaultLocale?: string;
1
+ import { Settings, SupportedFrameworks, SupportedLibraries, TranslateFlags } from "../types/index.js";
2
+ import { ConfigureOptions, InitOptions, OnboardingSession } from "../setup/onboarding.js";
3
+ import { ReactSetupPlan } from "../setup/wizard.js";
4
+ import { Command } from "commander";
5
+
6
+ //#region src/cli/base.d.ts
7
+ type UploadOptions = {
8
+ config?: string;
9
+ apiKey?: string;
10
+ projectId?: string;
11
+ defaultLocale?: string;
10
12
  };
11
- export type GitSetupOptions = {
12
- config?: string;
13
- dryRun?: boolean;
14
- omitConfigIds?: boolean;
15
- driverCommand?: string;
13
+ type GitSetupOptions = {
14
+ config?: string;
15
+ dryRun?: boolean;
16
+ omitConfigIds?: boolean;
17
+ driverCommand?: string;
16
18
  };
17
19
  type LocalTranslationGuidanceOptions = {
18
- generatedLoader: boolean;
19
- runtimeSetup: InlineRuntimeSetup;
20
- translationsDir: string;
20
+ generatedLoader: boolean;
21
+ runtimeSetup: InlineRuntimeSetup;
22
+ translationsDir: string;
21
23
  };
22
24
  type InlineRuntimeSetup = {
23
- hasOtherInlineRuntime: boolean;
24
- hasVueRuntime: boolean;
25
- ranReactSetup: boolean;
25
+ hasOtherInlineRuntime: boolean;
26
+ hasVueRuntime: boolean;
27
+ ranReactSetup: boolean;
26
28
  };
27
- export declare class BaseCLI {
28
- protected library: SupportedLibraries;
29
- protected additionalModules: SupportedLibraries[];
30
- protected program: Command;
31
- constructor(program: Command, library: SupportedLibraries, additionalModules?: SupportedLibraries[]);
32
- init(): void;
33
- execute(): void;
34
- protected setupSetupProjectCommand(): void;
35
- protected setupStageCommand(): void;
36
- /**
37
- * Enqueues translations for a given set of files
38
- * @param initOptions - The options for the command
39
- * @returns The results of the command
40
- */
41
- protected setupEnqueueCommand(): void;
42
- /**
43
- * Downloads translations that were originally staged
44
- * @param initOptions - The options for the command
45
- * @returns The results of the command
46
- */
47
- protected setupDownloadCommand(): void;
48
- protected setupTranslateCommand(): void;
49
- protected setupSendDiffsCommand(): void;
50
- protected setupApiCommand(): void;
51
- protected setupProjectCommands(): void;
52
- protected setupApiKeyCommands(): void;
53
- protected setupGitCommand(): void;
54
- protected resolveGitSetupOmitConfigIds(options: GitSetupOptions, settings: Settings): Promise<boolean>;
55
- protected handleSetupProject(initOptions: TranslateFlags): Promise<void>;
56
- protected handleStage(initOptions: TranslateFlags): Promise<void>;
57
- /**
58
- * Enqueues translations for a given set of files
59
- * @param initOptions - The options for the command
60
- * @returns The results of the command
61
- */
62
- protected handleEnqueue(initOptions: TranslateFlags): Promise<void>;
63
- /**
64
- * Downloads translations that were originally staged
65
- * @param initOptions - The options for the command
66
- * @returns The results of the command
67
- */
68
- protected handleDownload(initOptions: TranslateFlags): Promise<void>;
69
- protected handleTranslate(initOptions: TranslateFlags): Promise<void>;
70
- /**
71
- * Postprocesses the translations downloaded in this run and reports the
72
- * summary. Shared by translate and download so both write the same output.
73
- * @param settings - The settings for the command
74
- */
75
- protected finalizeDownloadedTranslations(settings: Settings): Promise<void>;
76
- protected setupUploadCommand(): void;
77
- protected setupUserAuthCommands(): void;
78
- protected setupInitCommand(): void;
79
- protected handleInitWizard(options: InitOptions): Promise<void>;
80
- protected setupConfigureCommand(): void;
81
- protected handleConfigureCommand(options: ConfigureOptions, command?: string): Promise<void>;
82
- protected handleUploadCommand(settings: Settings & UploadOptions): Promise<void>;
83
- /** Describes installed runtimes without changing historical package lookup. */
84
- protected getInlineRuntimeSetup(packageJson: Record<string, unknown>, ranReactSetup?: boolean): InlineRuntimeSetup;
85
- /** Returns whether any inline runtime is installed for setup. */
86
- protected isInlineRuntimeInstalled(packageJson: Record<string, unknown>): boolean;
87
- /** Returns whether every installed runtime can consume CDN translations. */
88
- protected supportsCDNStorage(runtimeSetup: InlineRuntimeSetup): boolean;
89
- /** Returns whether setup should generate a local runtime loader. */
90
- protected shouldGenerateLocalTranslationLoader(buildToolOwnsLoader: boolean, runtimeSetup: InlineRuntimeSetup): boolean;
91
- /** Returns framework guidance after selecting local translation storage. */
92
- protected getLocalTranslationGuidance({ generatedLoader, runtimeSetup, translationsDir, }: LocalTranslationGuidanceOptions): string | undefined;
93
- /**
94
- * Resolves every configuration answer and validates the resulting config,
95
- * checks the project and signs in before the first change, then applies
96
- * the React setup, gt.config.json, installs and development credentials.
97
- */
98
- protected handleInitCommand(session: OnboardingSession, options: ConfigureOptions, setup: {
99
- /** Chosen once by the entry point from the detected framework. */
100
- configFilepath: string;
101
- /** Resolved framework; drives storage, env names and build-tool setup. */
102
- framework?: SupportedFrameworks;
103
- /** Write the framework even when no build-tool setup saves it. */
104
- saveFramework?: boolean;
105
- reactSetup?: ReactSetupPlan;
106
- /** Init without the React setup never changes application source. */
107
- keepAppSource?: boolean;
108
- }): Promise<void>;
29
+ declare class BaseCLI {
30
+ protected library: SupportedLibraries;
31
+ protected additionalModules: SupportedLibraries[];
32
+ protected program: Command;
33
+ constructor(program: Command, library: SupportedLibraries, additionalModules?: SupportedLibraries[]);
34
+ init(): void;
35
+ execute(): void;
36
+ protected setupSetupProjectCommand(): void;
37
+ protected setupStageCommand(): void;
38
+ /**
39
+ * Enqueues translations for a given set of files
40
+ * @param initOptions - The options for the command
41
+ * @returns The results of the command
42
+ */
43
+ protected setupEnqueueCommand(): void;
44
+ /**
45
+ * Downloads translations that were originally staged
46
+ * @param initOptions - The options for the command
47
+ * @returns The results of the command
48
+ */
49
+ protected setupDownloadCommand(): void;
50
+ protected setupTranslateCommand(): void;
51
+ protected setupSendDiffsCommand(): void;
52
+ protected setupApiCommand(): void;
53
+ protected setupProjectCommands(): void;
54
+ protected setupApiKeyCommands(): void;
55
+ protected setupGitCommand(): void;
56
+ protected resolveGitSetupOmitConfigIds(options: GitSetupOptions, settings: Settings): Promise<boolean>;
57
+ protected handleSetupProject(initOptions: TranslateFlags): Promise<void>;
58
+ protected handleStage(initOptions: TranslateFlags): Promise<void>;
59
+ /**
60
+ * Enqueues translations for a given set of files
61
+ * @param initOptions - The options for the command
62
+ * @returns The results of the command
63
+ */
64
+ protected handleEnqueue(initOptions: TranslateFlags): Promise<void>;
65
+ /**
66
+ * Downloads translations that were originally staged
67
+ * @param initOptions - The options for the command
68
+ * @returns The results of the command
69
+ */
70
+ protected handleDownload(initOptions: TranslateFlags): Promise<void>;
71
+ protected handleTranslate(initOptions: TranslateFlags): Promise<void>;
72
+ /**
73
+ * Postprocesses the translations downloaded in this run and reports the
74
+ * summary. Shared by translate and download so both write the same output.
75
+ * @param settings - The settings for the command
76
+ */
77
+ protected finalizeDownloadedTranslations(settings: Settings): Promise<void>;
78
+ protected setupUploadCommand(): void;
79
+ protected setupUserAuthCommands(): void;
80
+ protected setupInitCommand(): void;
81
+ protected handleInitWizard(options: InitOptions): Promise<void>;
82
+ protected setupConfigureCommand(): void;
83
+ protected handleConfigureCommand(options: ConfigureOptions, command?: string): Promise<void>;
84
+ protected handleUploadCommand(settings: Settings & UploadOptions): Promise<void>;
85
+ /** Describes installed runtimes without changing historical package lookup. */
86
+ protected getInlineRuntimeSetup(packageJson: Record<string, unknown>, ranReactSetup?: boolean): InlineRuntimeSetup;
87
+ /** Returns whether any inline runtime is installed for setup. */
88
+ protected isInlineRuntimeInstalled(packageJson: Record<string, unknown>): boolean;
89
+ /** Returns whether every installed runtime can consume CDN translations. */
90
+ protected supportsCDNStorage(runtimeSetup: InlineRuntimeSetup): boolean;
91
+ /** Returns whether setup should generate a local runtime loader. */
92
+ protected shouldGenerateLocalTranslationLoader(buildToolOwnsLoader: boolean, runtimeSetup: InlineRuntimeSetup): boolean;
93
+ /** Returns framework guidance after selecting local translation storage. */
94
+ protected getLocalTranslationGuidance({
95
+ generatedLoader,
96
+ runtimeSetup,
97
+ translationsDir
98
+ }: LocalTranslationGuidanceOptions): string | undefined;
99
+ /**
100
+ * Resolves every configuration answer and validates the resulting config,
101
+ * checks the project and signs in before the first change, then applies
102
+ * the React setup, gt.config.json, installs and development credentials.
103
+ */
104
+ protected handleInitCommand(session: OnboardingSession, options: ConfigureOptions, setup: {
105
+ /** Chosen once by the entry point from the detected framework. */configFilepath: string; /** Resolved framework; drives storage, env names and build-tool setup. */
106
+ framework?: SupportedFrameworks; /** Write the framework even when no build-tool setup saves it. */
107
+ saveFramework?: boolean;
108
+ reactSetup?: ReactSetupPlan; /** Init without the React setup never changes application source. */
109
+ keepAppSource?: boolean;
110
+ }): Promise<void>;
109
111
  }
110
- export {};
112
+ //#endregion
113
+ export { BaseCLI, GitSetupOptions, UploadOptions };
114
+ //# sourceMappingURL=base.d.ts.map
package/dist/cli/base.js CHANGED
@@ -715,9 +715,10 @@ See https://www.npmjs.com/package/gt-vue`);
715
715
  translationsDir
716
716
  });
717
717
  if (guidance) logger.message(guidance);
718
- } else if (storage === "cdn" && buildTool && !reactSetup && configuredTranslationsDir !== void 0) {
718
+ } else if (storage === "cdn" && buildTool && !reactSetup) {
719
719
  const action = await buildTool.getCDNStorageAction?.(buildToolContext);
720
- if (action !== null) reportManualAction(action ?? {
720
+ if (action) reportManualAction(action);
721
+ else if (action === void 0 && configuredTranslationsDir !== void 0) reportManualAction({
721
722
  whatHappened: `Translations now load from the CDN, but ${buildTool.initializer} may still receive the local loader for ${configuredTranslationsDir}`,
722
723
  fix: `Remove the loadTranslations option and its import from the ${buildTool.initializer}() call so translations load from the CDN`
723
724
  });