gt 2.14.35 → 2.14.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +16 -1
- package/dist/api/collectUserEditDiffs.js +112 -155
- package/dist/api/collectUserEditDiffs.js.map +1 -0
- package/dist/api/downloadFileBatch.js +164 -241
- package/dist/api/downloadFileBatch.js.map +1 -0
- package/dist/api/saveLocalEdits.js +37 -41
- package/dist/api/saveLocalEdits.js.map +1 -0
- package/dist/bin/bin-entry.js +17 -7
- package/dist/bin/bin-entry.js.map +1 -0
- package/dist/bin/bin-main.js +43 -61
- package/dist/bin/bin-main.js.map +1 -0
- package/dist/cli/base.js +382 -497
- package/dist/cli/base.js.map +1 -0
- package/dist/cli/commands/download.js +41 -49
- package/dist/cli/commands/download.js.map +1 -0
- package/dist/cli/commands/enqueue.js +26 -25
- package/dist/cli/commands/enqueue.js.map +1 -0
- package/dist/cli/commands/setupProject.js +33 -36
- package/dist/cli/commands/setupProject.js.map +1 -0
- package/dist/cli/commands/stage.js +53 -61
- package/dist/cli/commands/stage.js.map +1 -0
- package/dist/cli/commands/translate.js +75 -112
- package/dist/cli/commands/translate.js.map +1 -0
- package/dist/cli/commands/upload.js +185 -213
- package/dist/cli/commands/upload.js.map +1 -0
- package/dist/cli/commands/utils/validation.js +39 -34
- package/dist/cli/commands/utils/validation.js.map +1 -0
- package/dist/cli/flags.js +35 -62
- package/dist/cli/flags.js.map +1 -0
- package/dist/cli/inline.js +112 -137
- package/dist/cli/inline.js.map +1 -0
- package/dist/cli/next.js +17 -12
- package/dist/cli/next.js.map +1 -0
- package/dist/cli/node.js +19 -15
- package/dist/cli/node.js.map +1 -0
- package/dist/cli/python.js +13 -8
- package/dist/cli/python.js.map +1 -0
- package/dist/cli/react.js +61 -78
- package/dist/cli/react.js.map +1 -0
- package/dist/config/defaults.js +16 -11
- package/dist/config/defaults.js.map +1 -0
- package/dist/config/generateSettings.js +167 -269
- package/dist/config/generateSettings.js.map +1 -0
- package/dist/config/optionPresets.js +78 -96
- package/dist/config/optionPresets.js.map +1 -0
- package/dist/config/resolveConfig.js +27 -32
- package/dist/config/resolveConfig.js.map +1 -0
- package/dist/config/utils.js +7 -3
- package/dist/config/utils.js.map +1 -0
- package/dist/config/validateSettings.js +19 -30
- package/dist/config/validateSettings.js.map +1 -0
- package/dist/console/colors.js +18 -13
- package/dist/console/colors.js.map +1 -0
- package/dist/console/displayTranslateSummary.js +40 -37
- package/dist/console/displayTranslateSummary.js.map +1 -0
- package/dist/console/formatting.js +8 -5
- package/dist/console/formatting.js.map +1 -0
- package/dist/console/index.d.ts +11 -9
- package/dist/console/index.js +53 -50
- package/dist/console/index.js.map +1 -0
- package/dist/console/inkFields.d.ts +23 -0
- package/dist/console/inkFields.js +87 -0
- package/dist/console/inkFields.js.map +1 -0
- package/dist/console/inkLayout.d.ts +7 -0
- package/dist/console/inkLayout.js +139 -0
- package/dist/console/inkLayout.js.map +1 -0
- package/dist/console/inkLocaleData.d.ts +4 -0
- package/dist/console/inkLocaleData.js +32 -0
- package/dist/console/inkLocaleData.js.map +1 -0
- package/dist/console/inkPrompts.d.ts +8 -0
- package/dist/console/inkPrompts.js +496 -0
- package/dist/console/inkPrompts.js.map +1 -0
- package/dist/console/inkSession.d.ts +3 -0
- package/dist/console/inkSession.js +42 -0
- package/dist/console/inkSession.js.map +1 -0
- package/dist/console/inkTerminal.d.ts +4 -0
- package/dist/console/inkTerminal.js +15 -0
- package/dist/console/inkTerminal.js.map +1 -0
- package/dist/console/inkTypes.d.ts +66 -0
- package/dist/console/inkTypes.js +1 -0
- package/dist/console/inkUtils.d.ts +24 -0
- package/dist/console/inkUtils.js +87 -0
- package/dist/console/inkUtils.js.map +1 -0
- package/dist/console/logger.js +209 -249
- package/dist/console/logger.js.map +1 -0
- package/dist/console/logging.d.ts +14 -0
- package/dist/console/logging.js +203 -162
- package/dist/console/logging.js.map +1 -0
- package/dist/console/promptParsing.d.ts +5 -0
- package/dist/console/promptParsing.js +28 -0
- package/dist/console/promptParsing.js.map +1 -0
- package/dist/console/terminalSession.d.ts +5 -0
- package/dist/console/terminalSession.js +38 -0
- package/dist/console/terminalSession.js.map +1 -0
- package/dist/extraction/index.js +3 -2
- package/dist/extraction/mapToUpdates.js +19 -18
- package/dist/extraction/mapToUpdates.js.map +1 -0
- package/dist/extraction/postProcess.js +68 -86
- package/dist/extraction/postProcess.js.map +1 -0
- package/dist/formats/files/aggregateFiles.js +223 -304
- package/dist/formats/files/aggregateFiles.js.map +1 -0
- package/dist/formats/files/collectFiles.js +53 -54
- package/dist/formats/files/collectFiles.js.map +1 -0
- package/dist/formats/files/convertToFileTranslationData.js +21 -19
- package/dist/formats/files/convertToFileTranslationData.js.map +1 -0
- package/dist/formats/files/fileMapping.js +82 -119
- package/dist/formats/files/fileMapping.js.map +1 -0
- package/dist/formats/files/preprocess/mdx.js +15 -12
- package/dist/formats/files/preprocess/mdx.js.map +1 -0
- package/dist/formats/files/preprocess/mintlify.js +15 -13
- package/dist/formats/files/preprocess/mintlify.js.map +1 -0
- package/dist/formats/files/preprocessContent.js +20 -21
- package/dist/formats/files/preprocessContent.js.map +1 -0
- package/dist/formats/files/save.js +18 -15
- package/dist/formats/files/save.js.map +1 -0
- package/dist/formats/files/supportedFiles.js +27 -22
- package/dist/formats/files/supportedFiles.js.map +1 -0
- package/dist/formats/files/transformFormat.js +93 -100
- package/dist/formats/files/transformFormat.js.map +1 -0
- package/dist/formats/json/extractJson.js +83 -110
- package/dist/formats/json/extractJson.js.map +1 -0
- package/dist/formats/json/flattenJson.js +41 -48
- package/dist/formats/json/flattenJson.js.map +1 -0
- package/dist/formats/json/jsonPath.js +20 -15
- package/dist/formats/json/jsonPath.js.map +1 -0
- package/dist/formats/json/jsonPointer.js +17 -17
- package/dist/formats/json/jsonPointer.js.map +1 -0
- package/dist/formats/json/mergeJson.js +230 -371
- package/dist/formats/json/mergeJson.js.map +1 -0
- package/dist/formats/json/parseJson.js +74 -111
- package/dist/formats/json/parseJson.js.map +1 -0
- package/dist/formats/json/transformJson.js +53 -61
- package/dist/formats/json/transformJson.js.map +1 -0
- package/dist/formats/json/utils.js +158 -187
- package/dist/formats/json/utils.js.map +1 -0
- package/dist/formats/parseKeyedMetadata.js +85 -106
- package/dist/formats/parseKeyedMetadata.js.map +1 -0
- package/dist/formats/utils.js +13 -23
- package/dist/formats/utils.js.map +1 -0
- package/dist/formats/yaml/extractYaml.js +32 -31
- package/dist/formats/yaml/extractYaml.js.map +1 -0
- package/dist/formats/yaml/mergeYaml.js +43 -60
- package/dist/formats/yaml/mergeYaml.js.map +1 -0
- package/dist/formats/yaml/parseYaml.js +34 -23
- package/dist/formats/yaml/parseYaml.js.map +1 -0
- package/dist/formats/yaml/utils.js +19 -21
- package/dist/formats/yaml/utils.js.map +1 -0
- package/dist/fs/clearLocaleDirs.js +82 -114
- package/dist/fs/clearLocaleDirs.js.map +1 -0
- package/dist/fs/config/downloadedVersions.js +174 -188
- package/dist/fs/config/downloadedVersions.js.map +1 -0
- package/dist/fs/config/loadConfig.js +12 -8
- package/dist/fs/config/loadConfig.js.map +1 -0
- package/dist/fs/config/parseFilesConfig.js +166 -227
- package/dist/fs/config/parseFilesConfig.js.map +1 -0
- package/dist/fs/config/setupConfig.js +43 -52
- package/dist/fs/config/setupConfig.js.map +1 -0
- package/dist/fs/config/updateConfig.js +44 -56
- package/dist/fs/config/updateConfig.js.map +1 -0
- package/dist/fs/config/updateVersions.js +27 -28
- package/dist/fs/config/updateVersions.js.map +1 -0
- package/dist/fs/copyFile.js +33 -37
- package/dist/fs/copyFile.js.map +1 -0
- package/dist/fs/createLoadTranslationsFile.js +32 -48
- package/dist/fs/createLoadTranslationsFile.js.map +1 -0
- package/dist/fs/determineFramework/detectPythonLibrary.js +30 -34
- package/dist/fs/determineFramework/detectPythonLibrary.js.map +1 -0
- package/dist/fs/determineFramework/index.js +46 -64
- package/dist/fs/determineFramework/index.js.map +1 -0
- package/dist/fs/determineFramework/matchPyprojectDependency.js +65 -78
- package/dist/fs/determineFramework/matchPyprojectDependency.js.map +1 -0
- package/dist/fs/determineFramework/matchRequirementsTxtDependency.js +21 -19
- package/dist/fs/determineFramework/matchRequirementsTxtDependency.js.map +1 -0
- package/dist/fs/determineFramework/matchSetupPyDependency.js +60 -81
- package/dist/fs/determineFramework/matchSetupPyDependency.js.map +1 -0
- package/dist/fs/determineFramework/resolveGtDependency.js +15 -15
- package/dist/fs/determineFramework/resolveGtDependency.js.map +1 -0
- package/dist/fs/findFilepath.js +63 -78
- package/dist/fs/findFilepath.js.map +1 -0
- package/dist/fs/loadJSON.js +18 -15
- package/dist/fs/loadJSON.js.map +1 -0
- package/dist/fs/matchFiles.js +12 -7
- package/dist/fs/matchFiles.js.map +1 -0
- package/dist/fs/saveJSON.js +10 -6
- package/dist/fs/saveJSON.js.map +1 -0
- package/dist/fs/utils.js +19 -15
- package/dist/fs/utils.js.map +1 -0
- package/dist/functions.d.ts +2 -1
- package/dist/functions.js +3 -6
- package/dist/generated/version.d.ts +1 -1
- package/dist/generated/version.js +6 -2
- package/dist/generated/version.js.map +1 -0
- package/dist/git/branches.js +77 -83
- package/dist/git/branches.js.map +1 -0
- package/dist/hooks/postProcess.js +97 -114
- package/dist/hooks/postProcess.js.map +1 -0
- package/dist/index.js +23 -31
- package/dist/index.js.map +1 -0
- package/dist/locadex/setupFlow.js +11 -8
- package/dist/locadex/setupFlow.js.map +1 -0
- package/dist/main.js +17 -7
- package/dist/main.js.map +1 -0
- package/dist/next/config/parseNextConfig.js +32 -51
- package/dist/next/config/parseNextConfig.js.map +1 -0
- package/dist/next/jsx/utils.js +25 -37
- package/dist/next/jsx/utils.js.map +1 -0
- package/dist/next/parse/handleInitGT.js +87 -154
- package/dist/next/parse/handleInitGT.js.map +1 -0
- package/dist/next/parse/wrapContent.js +136 -158
- package/dist/next/parse/wrapContent.js.map +1 -0
- package/dist/python/parse/createPythonInlineUpdates.js +36 -33
- package/dist/python/parse/createPythonInlineUpdates.js.map +1 -0
- package/dist/react/config/createESBuildConfig.js +115 -115
- package/dist/react/config/createESBuildConfig.js.map +1 -0
- package/dist/react/jsx/evaluateJsx.js +90 -124
- package/dist/react/jsx/evaluateJsx.js.map +1 -0
- package/dist/react/jsx/utils/buildImportMap.js +24 -28
- package/dist/react/jsx/utils/buildImportMap.js.map +1 -0
- package/dist/react/jsx/utils/constants.js +79 -87
- package/dist/react/jsx/utils/constants.js.map +1 -0
- package/dist/react/jsx/utils/extractSourceCode.js +36 -37
- package/dist/react/jsx/utils/extractSourceCode.js.map +1 -0
- package/dist/react/jsx/utils/getCalleeNameFromExpression.js +30 -30
- package/dist/react/jsx/utils/getCalleeNameFromExpression.js.map +1 -0
- package/dist/react/jsx/utils/getPathsAndAliases.js +70 -105
- package/dist/react/jsx/utils/getPathsAndAliases.js.map +1 -0
- package/dist/react/jsx/utils/isNumberLiteral.js +13 -11
- package/dist/react/jsx/utils/isNumberLiteral.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.js +103 -148
- package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/autoInsertion.js +305 -389
- package/dist/react/jsx/utils/jsxParsing/autoInsertion.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.js +122 -193
- package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.js +50 -64
- package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.js +41 -68
- package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/parseJsx.js +760 -1107
- package/dist/react/jsx/utils/jsxParsing/parseJsx.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/parseTProps.js +35 -71
- package/dist/react/jsx/utils/jsxParsing/parseTProps.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.js +39 -58
- package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.js.map +1 -0
- package/dist/react/jsx/utils/jsxParsing/types.js +10 -24
- package/dist/react/jsx/utils/jsxParsing/types.js.map +1 -0
- package/dist/react/jsx/utils/mapAttributeName.js +13 -13
- package/dist/react/jsx/utils/mapAttributeName.js.map +1 -0
- package/dist/react/jsx/utils/parseAst.js +142 -272
- package/dist/react/jsx/utils/parseAst.js.map +1 -0
- package/dist/react/jsx/utils/parseString.js +726 -1090
- package/dist/react/jsx/utils/parseString.js.map +1 -0
- package/dist/react/jsx/utils/parseStringFunction.js +274 -401
- package/dist/react/jsx/utils/parseStringFunction.js.map +1 -0
- package/dist/react/jsx/utils/resolveImportPath.js +104 -108
- package/dist/react/jsx/utils/resolveImportPath.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js +18 -24
- package/dist/react/jsx/utils/stringParsing/derivation/containsDeriveCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js +412 -579
- package/dist/react/jsx/utils/stringParsing/derivation/handleDerivation.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/derivation/index.js +57 -67
- package/dist/react/jsx/utils/stringParsing/derivation/index.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js +26 -36
- package/dist/react/jsx/utils/stringParsing/derivation/isDeriveCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js +29 -24
- package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/handleTaggedTemplateTranslationCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js +34 -32
- package/dist/react/jsx/utils/stringParsing/processTaggedTemplateCall/index.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js +80 -117
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js +24 -19
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleDeriveTranslationCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js +18 -21
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js +45 -50
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js +54 -59
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js.map +1 -0
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js +56 -69
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js.map +1 -0
- package/dist/react/jsx/utils/validateStringFunction.js +21 -29
- package/dist/react/jsx/utils/validateStringFunction.js.map +1 -0
- package/dist/react/jsx/wrapJsx.js +192 -375
- package/dist/react/jsx/wrapJsx.js.map +1 -0
- package/dist/react/parse/addVitePlugin/index.js +40 -34
- package/dist/react/parse/addVitePlugin/index.js.map +1 -0
- package/dist/react/parse/addVitePlugin/installCompiler.js +18 -20
- package/dist/react/parse/addVitePlugin/installCompiler.js.map +1 -0
- package/dist/react/parse/addVitePlugin/updateViteConfig.js +107 -111
- package/dist/react/parse/addVitePlugin/updateViteConfig.js.map +1 -0
- package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js +23 -26
- package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js.map +1 -0
- package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js +29 -43
- package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js.map +1 -0
- package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js +70 -104
- package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js.map +1 -0
- package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js +23 -29
- package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js.map +1 -0
- package/dist/react/parse/createDictionaryUpdates.js +121 -185
- package/dist/react/parse/createDictionaryUpdates.js.map +1 -0
- package/dist/react/parse/createInlineUpdates.js +123 -139
- package/dist/react/parse/createInlineUpdates.js.map +1 -0
- package/dist/react/parse/wrapContent.js +131 -156
- package/dist/react/parse/wrapContent.js.map +1 -0
- package/dist/react/utils/flattenDictionary.js +55 -70
- package/dist/react/utils/flattenDictionary.js.map +1 -0
- package/dist/react/utils/getEntryAndMetadata.js +14 -10
- package/dist/react/utils/getEntryAndMetadata.js.map +1 -0
- package/dist/react/utils/getVariableName.js +36 -33
- package/dist/react/utils/getVariableName.js.map +1 -0
- package/dist/setup/detectFramework.js +85 -102
- package/dist/setup/detectFramework.js.map +1 -0
- package/dist/setup/frameworkUtils.js +17 -28
- package/dist/setup/frameworkUtils.js.map +1 -0
- package/dist/setup/userInput.js +24 -31
- package/dist/setup/userInput.js.map +1 -0
- package/dist/setup/wizard.js +141 -143
- package/dist/setup/wizard.js.map +1 -0
- package/dist/state/mintlifyRefMap.js +12 -9
- package/dist/state/mintlifyRefMap.js.map +1 -0
- package/dist/state/recentDownloads.js +26 -23
- package/dist/state/recentDownloads.js.map +1 -0
- package/dist/state/translateWarnings.js +17 -8
- package/dist/state/translateWarnings.js.map +1 -0
- package/dist/translation/parse.js +77 -98
- package/dist/translation/parse.js.map +1 -0
- package/dist/translation/stage.js +28 -43
- package/dist/translation/stage.js.map +1 -0
- package/dist/translation/validate.js +68 -91
- package/dist/translation/validate.js.map +1 -0
- package/dist/types/libraries.js +93 -91
- package/dist/types/libraries.js.map +1 -0
- package/dist/types/parsing.js +19 -10
- package/dist/types/parsing.js.map +1 -0
- package/dist/utils/addExplicitAnchorIds.js +270 -389
- package/dist/utils/addExplicitAnchorIds.js.map +1 -0
- package/dist/utils/calculateTimeoutMs.js +11 -6
- package/dist/utils/calculateTimeoutMs.js.map +1 -0
- package/dist/utils/constants.js +15 -12
- package/dist/utils/constants.js.map +1 -0
- package/dist/utils/credentials.js +67 -114
- package/dist/utils/credentials.js.map +1 -0
- package/dist/utils/fetch.js +22 -20
- package/dist/utils/fetch.js.map +1 -0
- package/dist/utils/flattenJsonFiles.js +27 -34
- package/dist/utils/flattenJsonFiles.js.map +1 -0
- package/dist/utils/gitDiff.js +30 -32
- package/dist/utils/gitDiff.js.map +1 -0
- package/dist/utils/gt.js +7 -2
- package/dist/utils/gt.js.map +1 -0
- package/dist/utils/hash.js +14 -9
- package/dist/utils/hash.js.map +1 -0
- package/dist/utils/headers.js +10 -13
- package/dist/utils/headers.js.map +1 -0
- package/dist/utils/installPackage.js +70 -75
- package/dist/utils/installPackage.js.map +1 -0
- package/dist/utils/localizeRelativeAssets.js +114 -157
- package/dist/utils/localizeRelativeAssets.js.map +1 -0
- package/dist/utils/localizeStaticImports.js +229 -371
- package/dist/utils/localizeStaticImports.js.map +1 -0
- package/dist/utils/localizeStaticUrls.js +241 -424
- package/dist/utils/localizeStaticUrls.js.map +1 -0
- package/dist/utils/mintlifyTitleFallback.js +64 -72
- package/dist/utils/mintlifyTitleFallback.js.map +1 -0
- package/dist/utils/monorepoVersionCheck.js +177 -215
- package/dist/utils/monorepoVersionCheck.js.map +1 -0
- package/dist/utils/packageInfo.js +17 -16
- package/dist/utils/packageInfo.js.map +1 -0
- package/dist/utils/packageJson.js +51 -66
- package/dist/utils/packageJson.js.map +1 -0
- package/dist/utils/packageManager.js +237 -260
- package/dist/utils/packageManager.js.map +1 -0
- package/dist/utils/parse/needsCJS.js +36 -69
- package/dist/utils/parse/needsCJS.js.map +1 -0
- package/dist/utils/persistPostprocessHashes.js +30 -32
- package/dist/utils/persistPostprocessHashes.js.map +1 -0
- package/dist/utils/processAnchorIds.js +32 -54
- package/dist/utils/processAnchorIds.js.map +1 -0
- package/dist/utils/processOpenApi.js +469 -578
- package/dist/utils/processOpenApi.js.map +1 -0
- package/dist/utils/resolveMintlifyRefs.js +89 -105
- package/dist/utils/resolveMintlifyRefs.js.map +1 -0
- package/dist/utils/resolvePublish.js +46 -54
- package/dist/utils/resolvePublish.js.map +1 -0
- package/dist/utils/sanitizeFileContent.js +20 -27
- package/dist/utils/sanitizeFileContent.js.map +1 -0
- package/dist/utils/sharedStaticAssets.js +248 -366
- package/dist/utils/sharedStaticAssets.js.map +1 -0
- package/dist/utils/splitMintlifyLanguageRefs.js +208 -282
- package/dist/utils/splitMintlifyLanguageRefs.js.map +1 -0
- package/dist/utils/validateMdx.js +26 -23
- package/dist/utils/validateMdx.js.map +1 -0
- package/dist/utils/wrapPlainUrls.js +58 -70
- package/dist/utils/wrapPlainUrls.js.map +1 -0
- package/dist/workflows/download.js +92 -126
- package/dist/workflows/download.js.map +1 -0
- package/dist/workflows/enqueue.js +47 -54
- package/dist/workflows/enqueue.js.map +1 -0
- package/dist/workflows/publish.js +29 -29
- package/dist/workflows/publish.js.map +1 -0
- package/dist/workflows/setupProject.js +39 -40
- package/dist/workflows/setupProject.js.map +1 -0
- package/dist/workflows/stage.js +61 -65
- package/dist/workflows/stage.js.map +1 -0
- package/dist/workflows/steps/BranchStep.js +118 -163
- package/dist/workflows/steps/BranchStep.js.map +1 -0
- package/dist/workflows/steps/DownloadStep.js +107 -137
- package/dist/workflows/steps/DownloadStep.js.map +1 -0
- package/dist/workflows/steps/EnqueueStep.js +32 -32
- package/dist/workflows/steps/EnqueueStep.js.map +1 -0
- package/dist/workflows/steps/PollJobsStep.js +208 -292
- package/dist/workflows/steps/PollJobsStep.js.map +1 -0
- package/dist/workflows/steps/PublishStep.js +33 -38
- package/dist/workflows/steps/PublishStep.js.map +1 -0
- package/dist/workflows/steps/SetupStep.js +71 -72
- package/dist/workflows/steps/SetupStep.js.map +1 -0
- package/dist/workflows/steps/TagStep.js +39 -44
- package/dist/workflows/steps/TagStep.js.map +1 -0
- package/dist/workflows/steps/UploadSourcesStep.js +108 -140
- package/dist/workflows/steps/UploadSourcesStep.js.map +1 -0
- package/dist/workflows/steps/UploadTranslationsStep.js +61 -71
- package/dist/workflows/steps/UploadTranslationsStep.js.map +1 -0
- package/dist/workflows/steps/UserEditDiffsStep.js +32 -34
- package/dist/workflows/steps/UserEditDiffsStep.js.map +1 -0
- package/dist/workflows/steps/WorkflowStep.js +6 -2
- package/dist/workflows/steps/WorkflowStep.js.map +1 -0
- package/dist/workflows/upload.js +45 -46
- package/dist/workflows/upload.js.map +1 -0
- package/package.json +14 -7
package/dist/fs/matchFiles.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
|
-
import fg from
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import fg from "fast-glob";
|
|
2
|
+
//#region src/fs/matchFiles.ts
|
|
3
|
+
function matchFiles(cwd, patterns) {
|
|
4
|
+
return fg.sync(patterns, {
|
|
5
|
+
cwd,
|
|
6
|
+
absolute: true,
|
|
7
|
+
onlyFiles: true
|
|
8
|
+
});
|
|
8
9
|
}
|
|
10
|
+
//#endregion
|
|
11
|
+
export { matchFiles };
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=matchFiles.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"matchFiles.js","names":[],"sources":["../../src/fs/matchFiles.ts"],"sourcesContent":["import fg from 'fast-glob';\n\nexport function matchFiles(cwd: string, patterns: string[]): string[] {\n return fg.sync(patterns, {\n cwd,\n absolute: true,\n onlyFiles: true,\n });\n}\n"],"mappings":";;AAEA,SAAgB,WAAW,KAAa,UAA8B;AACpE,QAAO,GAAG,KAAK,UAAU;EACvB;EACA,UAAU;EACV,WAAW;EACZ,CAAC"}
|
package/dist/fs/saveJSON.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import path from
|
|
2
|
-
import fs from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import fs from "node:fs";
|
|
3
|
+
//#region src/fs/saveJSON.ts
|
|
4
|
+
async function saveJSON(filepath, data) {
|
|
5
|
+
await fs.promises.mkdir(path.dirname(filepath), { recursive: true });
|
|
6
|
+
await fs.promises.writeFile(filepath, JSON.stringify(data, null, 2));
|
|
7
7
|
}
|
|
8
|
+
//#endregion
|
|
9
|
+
export { saveJSON };
|
|
10
|
+
|
|
11
|
+
//# sourceMappingURL=saveJSON.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"saveJSON.js","names":[],"sources":["../../src/fs/saveJSON.ts"],"sourcesContent":["import path from 'node:path';\nimport fs from 'node:fs';\n\nexport async function saveJSON(\n filepath: string,\n data: Record<string, unknown>\n) {\n // Ensure directory exists\n await fs.promises.mkdir(path.dirname(filepath), { recursive: true });\n\n await fs.promises.writeFile(filepath, JSON.stringify(data, null, 2));\n}\n"],"mappings":";;;AAGA,eAAsB,SACpB,UACA,MACA;AAEA,OAAM,GAAG,SAAS,MAAM,KAAK,QAAQ,SAAS,EAAE,EAAE,WAAW,MAAM,CAAC;AAEpE,OAAM,GAAG,SAAS,UAAU,UAAU,KAAK,UAAU,MAAM,MAAM,EAAE,CAAC"}
|
package/dist/fs/utils.js
CHANGED
|
@@ -1,16 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
1
|
+
//#region src/fs/utils.ts
|
|
2
|
+
function resolveProjectId() {
|
|
3
|
+
return [
|
|
4
|
+
process.env.GT_PROJECT_ID,
|
|
5
|
+
process.env.NEXT_PUBLIC_GT_PROJECT_ID,
|
|
6
|
+
process.env.VITE_GT_PROJECT_ID,
|
|
7
|
+
process.env.REACT_APP_GT_PROJECT_ID,
|
|
8
|
+
process.env.REDWOOD_ENV_GT_PROJECT_ID,
|
|
9
|
+
process.env.GATSBY_GT_PROJECT_ID,
|
|
10
|
+
process.env.EXPO_PUBLIC_GT_PROJECT_ID,
|
|
11
|
+
process.env.RAZZLE_GT_PROJECT_ID,
|
|
12
|
+
process.env.UMI_GT_PROJECT_ID,
|
|
13
|
+
process.env.BLITZ_PUBLIC_GT_PROJECT_ID,
|
|
14
|
+
process.env.PUBLIC_GT_PROJECT_ID
|
|
15
|
+
].find((projectId) => projectId !== void 0);
|
|
16
16
|
}
|
|
17
|
+
//#endregion
|
|
18
|
+
export { resolveProjectId };
|
|
19
|
+
|
|
20
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","names":[],"sources":["../../src/fs/utils.ts"],"sourcesContent":["export function resolveProjectId(): string | undefined {\n const CANDIDATES = [\n process.env.GT_PROJECT_ID, // any server side, Remix\n process.env.NEXT_PUBLIC_GT_PROJECT_ID, // Next.js\n process.env.VITE_GT_PROJECT_ID, // Vite\n process.env.REACT_APP_GT_PROJECT_ID, // Create React App\n process.env.REDWOOD_ENV_GT_PROJECT_ID, // RedwoodJS\n process.env.GATSBY_GT_PROJECT_ID, // Gatsby\n process.env.EXPO_PUBLIC_GT_PROJECT_ID, // Expo (React Native)\n process.env.RAZZLE_GT_PROJECT_ID, // Razzle\n process.env.UMI_GT_PROJECT_ID, // UmiJS\n process.env.BLITZ_PUBLIC_GT_PROJECT_ID, // Blitz.js\n process.env.PUBLIC_GT_PROJECT_ID, // WMR, Qwik (general \"public\" convention)\n ];\n return CANDIDATES.find((projectId) => projectId !== undefined);\n}\n"],"mappings":";AAAA,SAAgB,mBAAuC;AAcrD,QAAO;EAZL,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EACZ,QAAQ,IAAI;EAEG,CAAC,MAAM,cAAc,cAAc,KAAA,EAAU"}
|
package/dist/functions.d.ts
CHANGED
|
@@ -4,4 +4,5 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export { getValidateJson } from './translation/validate.js';
|
|
6
6
|
export type { ValidationResult, ValidationMessage, ValidationLevel, } from './translation/validate.js';
|
|
7
|
-
export { Libraries,
|
|
7
|
+
export { Libraries, GT_LIBRARIES, INLINE_LIBRARIES, REACT_LIBRARIES, GT_LIBRARIES_UPSTREAM, } from './types/libraries.js';
|
|
8
|
+
export type { GTLibrary, InlineLibrary, ReactLibrary, } from './types/libraries.js';
|
package/dist/functions.js
CHANGED
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
*/
|
|
5
|
-
export { getValidateJson } from './translation/validate.js';
|
|
6
|
-
export { Libraries, GT_LIBRARIES, INLINE_LIBRARIES, REACT_LIBRARIES, GT_LIBRARIES_UPSTREAM, } from './types/libraries.js';
|
|
1
|
+
import { GT_LIBRARIES, GT_LIBRARIES_UPSTREAM, INLINE_LIBRARIES, Libraries, REACT_LIBRARIES } from "./types/libraries.js";
|
|
2
|
+
import { getValidateJson } from "./translation/validate.js";
|
|
3
|
+
export { GT_LIBRARIES, GT_LIBRARIES_UPSTREAM, INLINE_LIBRARIES, Libraries, REACT_LIBRARIES, getValidateJson };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const PACKAGE_VERSION = "2.14.
|
|
1
|
+
export declare const PACKAGE_VERSION = "2.14.36";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.js","names":[],"sources":["../../src/generated/version.ts"],"sourcesContent":["// This file is auto-generated. Do not edit manually.\nexport const PACKAGE_VERSION = '2.14.36';\n"],"mappings":";AACA,MAAa,kBAAkB"}
|
package/dist/git/branches.js
CHANGED
|
@@ -1,88 +1,82 @@
|
|
|
1
|
-
import { execFile } from
|
|
2
|
-
import { promisify } from
|
|
1
|
+
import { execFile } from "child_process";
|
|
2
|
+
import { promisify } from "util";
|
|
3
|
+
//#region src/git/branches.ts
|
|
3
4
|
const execAsync = promisify(execFile);
|
|
4
5
|
const MAX_BRANCHES = 5;
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
6
|
+
async function getCurrentBranch(remoteName) {
|
|
7
|
+
try {
|
|
8
|
+
const { stdout } = await execAsync("git", [
|
|
9
|
+
"rev-parse",
|
|
10
|
+
"--abbrev-ref",
|
|
11
|
+
"HEAD"
|
|
12
|
+
], {
|
|
13
|
+
encoding: "utf8",
|
|
14
|
+
windowsHide: true
|
|
15
|
+
});
|
|
16
|
+
const currentBranchName = stdout.trim();
|
|
17
|
+
const { stdout: defaultBranchRef } = await execAsync("git", ["symbolic-ref", `refs/remotes/${remoteName}/HEAD`], {
|
|
18
|
+
encoding: "utf8",
|
|
19
|
+
windowsHide: true
|
|
20
|
+
});
|
|
21
|
+
const defaultBranchName = defaultBranchRef.trim().replace(`refs/remotes/${remoteName}/`, "");
|
|
22
|
+
return {
|
|
23
|
+
currentBranchName,
|
|
24
|
+
defaultBranch: currentBranchName === defaultBranchName,
|
|
25
|
+
defaultBranchName
|
|
26
|
+
};
|
|
27
|
+
} catch {
|
|
28
|
+
return null;
|
|
29
|
+
}
|
|
23
30
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
branches.push(branchMatch[1]);
|
|
50
|
-
}
|
|
51
|
-
else if (prMatch && prMatch[1]) {
|
|
52
|
-
branches.push(prMatch[1]);
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
return branches.slice(0, MAX_BRANCHES);
|
|
56
|
-
}
|
|
57
|
-
catch {
|
|
58
|
-
// If log fails or no merges found, return empty array
|
|
59
|
-
return [];
|
|
60
|
-
}
|
|
31
|
+
async function getIncomingBranches(_remoteName) {
|
|
32
|
+
try {
|
|
33
|
+
const { stdout } = await execAsync("git", [
|
|
34
|
+
"log",
|
|
35
|
+
"--merges",
|
|
36
|
+
"--first-parent",
|
|
37
|
+
"--pretty=format:%s",
|
|
38
|
+
`-${MAX_BRANCHES}`
|
|
39
|
+
], {
|
|
40
|
+
encoding: "utf8",
|
|
41
|
+
windowsHide: true
|
|
42
|
+
});
|
|
43
|
+
if (!stdout.trim()) return [];
|
|
44
|
+
const branches = [];
|
|
45
|
+
const lines = stdout.trim().split("\n");
|
|
46
|
+
for (const line of lines) {
|
|
47
|
+
const branchMatch = line.match(/Merge branch '([^']+)'/);
|
|
48
|
+
const prMatch = line.match(/Merge pull request #\d+ from [^/]+\/(.+)/);
|
|
49
|
+
if (branchMatch && branchMatch[1]) branches.push(branchMatch[1]);
|
|
50
|
+
else if (prMatch && prMatch[1]) branches.push(prMatch[1]);
|
|
51
|
+
}
|
|
52
|
+
return branches.slice(0, MAX_BRANCHES);
|
|
53
|
+
} catch {
|
|
54
|
+
return [];
|
|
55
|
+
}
|
|
61
56
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
return [];
|
|
87
|
-
}
|
|
57
|
+
async function getCheckedOutBranches(remoteName) {
|
|
58
|
+
try {
|
|
59
|
+
const currentBranchResult = await getCurrentBranch(remoteName);
|
|
60
|
+
if (!currentBranchResult) return [];
|
|
61
|
+
if (currentBranchResult.defaultBranch) return [];
|
|
62
|
+
try {
|
|
63
|
+
await execAsync("git", [
|
|
64
|
+
"merge-base",
|
|
65
|
+
currentBranchResult.defaultBranchName,
|
|
66
|
+
"HEAD"
|
|
67
|
+
], {
|
|
68
|
+
encoding: "utf8",
|
|
69
|
+
windowsHide: true
|
|
70
|
+
});
|
|
71
|
+
return [currentBranchResult.defaultBranchName];
|
|
72
|
+
} catch {
|
|
73
|
+
return [];
|
|
74
|
+
}
|
|
75
|
+
} catch {
|
|
76
|
+
return [];
|
|
77
|
+
}
|
|
88
78
|
}
|
|
79
|
+
//#endregion
|
|
80
|
+
export { getCheckedOutBranches, getCurrentBranch, getIncomingBranches };
|
|
81
|
+
|
|
82
|
+
//# sourceMappingURL=branches.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"branches.js","names":[],"sources":["../../src/git/branches.ts"],"sourcesContent":["import { execFile } from 'child_process';\nimport { promisify } from 'util';\n\nconst execAsync = promisify(execFile);\nconst MAX_BRANCHES = 5;\n\nexport async function getCurrentBranch(remoteName: string): Promise<{\n currentBranchName: string;\n defaultBranch: boolean;\n defaultBranchName: string;\n} | null> {\n try {\n const { stdout } = await execAsync(\n 'git',\n ['rev-parse', '--abbrev-ref', 'HEAD'],\n {\n encoding: 'utf8',\n windowsHide: true,\n }\n );\n const currentBranchName = stdout.trim();\n\n // Get the default branch (usually main or master)\n const { stdout: defaultBranchRef } = await execAsync(\n 'git',\n ['symbolic-ref', `refs/remotes/${remoteName}/HEAD`],\n { encoding: 'utf8', windowsHide: true }\n );\n const defaultBranchName = defaultBranchRef\n .trim()\n .replace(`refs/remotes/${remoteName}/`, '');\n const defaultBranch = currentBranchName === defaultBranchName;\n\n return { currentBranchName, defaultBranch, defaultBranchName };\n } catch {\n return null;\n }\n}\n\nexport async function getIncomingBranches(\n _remoteName: string\n): Promise<string[]> {\n try {\n // Get merge commits into the current branch\n const { stdout } = await execAsync(\n 'git',\n [\n 'log',\n '--merges',\n '--first-parent',\n '--pretty=format:%s',\n `-${MAX_BRANCHES}`,\n ],\n {\n encoding: 'utf8',\n windowsHide: true,\n }\n );\n\n if (!stdout.trim()) {\n return [];\n }\n\n const branches: string[] = [];\n const lines = stdout.trim().split('\\n');\n\n for (const line of lines) {\n // Parse merge commit messages:\n // - \"Merge branch 'feature-name'\" or \"Merge branch 'feature-name' into main\"\n // - \"Merge pull request #123 from user/branch-name\"\n const branchMatch = line.match(/Merge branch '([^']+)'/);\n const prMatch = line.match(/Merge pull request #\\d+ from [^/]+\\/(.+)/);\n\n if (branchMatch && branchMatch[1]) {\n branches.push(branchMatch[1]);\n } else if (prMatch && prMatch[1]) {\n branches.push(prMatch[1]);\n }\n }\n\n return branches.slice(0, MAX_BRANCHES);\n } catch {\n // If log fails or no merges found, return empty array\n return [];\n }\n}\n\nexport async function getCheckedOutBranches(\n remoteName: string\n): Promise<string[]> {\n try {\n // Get current branch\n const currentBranchResult = await getCurrentBranch(remoteName);\n if (!currentBranchResult) {\n return [];\n }\n\n // If we're already on the default branch, return empty\n if (currentBranchResult.defaultBranch) {\n return [];\n }\n\n // Check if there's a merge-base (common ancestor) between default branch and current\n // This means the branch was at some point checked out from the default branch\n try {\n await execAsync(\n 'git',\n ['merge-base', currentBranchResult.defaultBranchName, 'HEAD'],\n { encoding: 'utf8', windowsHide: true }\n );\n // If merge-base exists, the branch shares history with default branch\n return [currentBranchResult.defaultBranchName];\n } catch {\n // No common ancestor found\n return [];\n }\n } catch {\n return [];\n }\n}\n"],"mappings":";;;AAGA,MAAM,YAAY,UAAU,SAAS;AACrC,MAAM,eAAe;AAErB,eAAsB,iBAAiB,YAI7B;AACR,KAAI;EACF,MAAM,EAAE,WAAW,MAAM,UACvB,OACA;GAAC;GAAa;GAAgB;GAAO,EACrC;GACE,UAAU;GACV,aAAa;GACd,CACF;EACD,MAAM,oBAAoB,OAAO,MAAM;EAGvC,MAAM,EAAE,QAAQ,qBAAqB,MAAM,UACzC,OACA,CAAC,gBAAgB,gBAAgB,WAAW,OAAO,EACnD;GAAE,UAAU;GAAQ,aAAa;GAAM,CACxC;EACD,MAAM,oBAAoB,iBACvB,MAAM,CACN,QAAQ,gBAAgB,WAAW,IAAI,GAAG;AAG7C,SAAO;GAAE;GAAmB,eAFN,sBAAsB;GAED;GAAmB;SACxD;AACN,SAAO;;;AAIX,eAAsB,oBACpB,aACmB;AACnB,KAAI;EAEF,MAAM,EAAE,WAAW,MAAM,UACvB,OACA;GACE;GACA;GACA;GACA;GACA,IAAI;GACL,EACD;GACE,UAAU;GACV,aAAa;GACd,CACF;AAED,MAAI,CAAC,OAAO,MAAM,CAChB,QAAO,EAAE;EAGX,MAAM,WAAqB,EAAE;EAC7B,MAAM,QAAQ,OAAO,MAAM,CAAC,MAAM,KAAK;AAEvC,OAAK,MAAM,QAAQ,OAAO;GAIxB,MAAM,cAAc,KAAK,MAAM,yBAAyB;GACxD,MAAM,UAAU,KAAK,MAAM,2CAA2C;AAEtE,OAAI,eAAe,YAAY,GAC7B,UAAS,KAAK,YAAY,GAAG;YACpB,WAAW,QAAQ,GAC5B,UAAS,KAAK,QAAQ,GAAG;;AAI7B,SAAO,SAAS,MAAM,GAAG,aAAa;SAChC;AAEN,SAAO,EAAE;;;AAIb,eAAsB,sBACpB,YACmB;AACnB,KAAI;EAEF,MAAM,sBAAsB,MAAM,iBAAiB,WAAW;AAC9D,MAAI,CAAC,oBACH,QAAO,EAAE;AAIX,MAAI,oBAAoB,cACtB,QAAO,EAAE;AAKX,MAAI;AACF,SAAM,UACJ,OACA;IAAC;IAAc,oBAAoB;IAAmB;IAAO,EAC7D;IAAE,UAAU;IAAQ,aAAa;IAAM,CACxC;AAED,UAAO,CAAC,oBAAoB,kBAAkB;UACxC;AAEN,UAAO,EAAE;;SAEL;AACN,SAAO,EAAE"}
|
|
@@ -1,116 +1,99 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
child.on('error', () => {
|
|
29
|
-
resolve(null);
|
|
30
|
-
});
|
|
31
|
-
child.on('close', (code) => {
|
|
32
|
-
if (code === 0) {
|
|
33
|
-
resolve('biome');
|
|
34
|
-
}
|
|
35
|
-
else {
|
|
36
|
-
resolve(null);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
});
|
|
40
|
-
}
|
|
41
|
-
catch {
|
|
42
|
-
// Biome is optional.
|
|
43
|
-
}
|
|
44
|
-
return null;
|
|
1
|
+
import { logger } from "../console/logger.js";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
import fs from "node:fs";
|
|
4
|
+
import { spawn } from "node:child_process";
|
|
5
|
+
//#region src/hooks/postProcess.ts
|
|
6
|
+
async function detectFormatter() {
|
|
7
|
+
try {
|
|
8
|
+
await import("prettier");
|
|
9
|
+
return "prettier";
|
|
10
|
+
} catch {}
|
|
11
|
+
try {
|
|
12
|
+
await import("eslint");
|
|
13
|
+
return "eslint";
|
|
14
|
+
} catch {}
|
|
15
|
+
try {
|
|
16
|
+
return await new Promise((resolve) => {
|
|
17
|
+
const child = spawn("npx", ["@biomejs/biome", "--version"], { stdio: "ignore" });
|
|
18
|
+
child.on("error", () => {
|
|
19
|
+
resolve(null);
|
|
20
|
+
});
|
|
21
|
+
child.on("close", (code) => {
|
|
22
|
+
if (code === 0) resolve("biome");
|
|
23
|
+
else resolve(null);
|
|
24
|
+
});
|
|
25
|
+
});
|
|
26
|
+
} catch {}
|
|
27
|
+
return null;
|
|
45
28
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
}
|
|
113
|
-
catch (e) {
|
|
114
|
-
logger.warn(chalk.yellow('Unable to run code formatter: ' + String(e)));
|
|
115
|
-
}
|
|
29
|
+
async function formatFiles(filesUpdated, formatter) {
|
|
30
|
+
if (filesUpdated.length === 0) return;
|
|
31
|
+
try {
|
|
32
|
+
const detectedFormatter = formatter || await detectFormatter();
|
|
33
|
+
if (!detectedFormatter) {
|
|
34
|
+
logger.warn(chalk.yellow("No supported formatter detected"));
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (detectedFormatter === "prettier") {
|
|
38
|
+
logger.message(chalk.dim("Cleaning up with prettier..."));
|
|
39
|
+
const prettier = await import("prettier");
|
|
40
|
+
for (const file of filesUpdated) {
|
|
41
|
+
const config = await prettier.resolveConfig(file);
|
|
42
|
+
const content = await fs.promises.readFile(file, "utf-8");
|
|
43
|
+
const formatted = await prettier.format(content, {
|
|
44
|
+
...config,
|
|
45
|
+
filepath: file
|
|
46
|
+
});
|
|
47
|
+
await fs.promises.writeFile(file, formatted);
|
|
48
|
+
}
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
if (detectedFormatter === "biome") {
|
|
52
|
+
logger.message(chalk.dim("Cleaning up with biome..."));
|
|
53
|
+
try {
|
|
54
|
+
await new Promise((resolve) => {
|
|
55
|
+
const child = spawn("npx", [
|
|
56
|
+
"@biomejs/biome",
|
|
57
|
+
"format",
|
|
58
|
+
"--write",
|
|
59
|
+
...filesUpdated.map((file) => file)
|
|
60
|
+
], { stdio: [
|
|
61
|
+
"ignore",
|
|
62
|
+
"inherit",
|
|
63
|
+
"inherit"
|
|
64
|
+
] });
|
|
65
|
+
child.on("error", (error) => {
|
|
66
|
+
logger.warn(chalk.yellow("Biome formatting failed: " + error.message));
|
|
67
|
+
resolve();
|
|
68
|
+
});
|
|
69
|
+
child.on("close", (code) => {
|
|
70
|
+
if (code !== 0) logger.warn(chalk.yellow(`Biome formatting failed with exit code ${code}`));
|
|
71
|
+
resolve();
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
} catch (error) {
|
|
75
|
+
logger.warn(chalk.yellow("Biome formatting failed: " + String(error)));
|
|
76
|
+
}
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (detectedFormatter === "eslint") {
|
|
80
|
+
logger.message(chalk.dim("Cleaning up with eslint..."));
|
|
81
|
+
const { ESLint } = await import("eslint");
|
|
82
|
+
const eslint = new ESLint({
|
|
83
|
+
fix: true,
|
|
84
|
+
overrideConfigFile: void 0
|
|
85
|
+
});
|
|
86
|
+
for (const file of filesUpdated) {
|
|
87
|
+
const results = await eslint.lintFiles([file]);
|
|
88
|
+
await ESLint.outputFixes(results);
|
|
89
|
+
}
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
} catch (e) {
|
|
93
|
+
logger.warn(chalk.yellow("Unable to run code formatter: " + String(e)));
|
|
94
|
+
}
|
|
116
95
|
}
|
|
96
|
+
//#endregion
|
|
97
|
+
export { detectFormatter, formatFiles };
|
|
98
|
+
|
|
99
|
+
//# sourceMappingURL=postProcess.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postProcess.js","names":[],"sources":["../../src/hooks/postProcess.ts"],"sourcesContent":["import fs from 'node:fs';\nimport { spawn } from 'node:child_process';\nimport chalk from 'chalk';\nimport { logger } from '../console/logger.js';\n\ntype Formatter = 'prettier' | 'biome' | 'eslint';\n\nexport async function detectFormatter(): Promise<Formatter | null> {\n // Try Prettier\n try {\n await import('prettier');\n return 'prettier';\n } catch {\n // Prettier is optional.\n }\n\n // Try ESLint\n try {\n await import('eslint');\n return 'eslint';\n } catch {\n // ESLint is optional.\n }\n\n // Try Biome\n try {\n return await new Promise<Formatter | null>((resolve) => {\n const child = spawn('npx', ['@biomejs/biome', '--version'], {\n stdio: 'ignore',\n });\n\n child.on('error', () => {\n resolve(null);\n });\n\n child.on('close', (code: number) => {\n if (code === 0) {\n resolve('biome');\n } else {\n resolve(null);\n }\n });\n });\n } catch {\n // Biome is optional.\n }\n\n return null;\n}\n\nexport async function formatFiles(\n filesUpdated: string[],\n formatter?: Formatter\n): Promise<void> {\n if (filesUpdated.length === 0) return;\n\n try {\n const detectedFormatter = formatter || (await detectFormatter());\n\n if (!detectedFormatter) {\n logger.warn(chalk.yellow('No supported formatter detected'));\n return;\n }\n\n if (detectedFormatter === 'prettier') {\n logger.message(chalk.dim('Cleaning up with prettier...'));\n const prettier = await import('prettier');\n for (const file of filesUpdated) {\n const config = await prettier.resolveConfig(file);\n const content = await fs.promises.readFile(file, 'utf-8');\n const formatted = await prettier.format(content, {\n ...config,\n filepath: file,\n });\n await fs.promises.writeFile(file, formatted);\n }\n return;\n }\n\n if (detectedFormatter === 'biome') {\n logger.message(chalk.dim('Cleaning up with biome...'));\n try {\n await new Promise<void>((resolve) => {\n const args = [\n '@biomejs/biome',\n 'format',\n '--write',\n ...filesUpdated.map((file) => file),\n ];\n\n const child = spawn('npx', args, {\n stdio: ['ignore', 'inherit', 'inherit'],\n });\n\n child.on('error', (error: Error) => {\n logger.warn(\n chalk.yellow('Biome formatting failed: ' + error.message)\n );\n resolve();\n });\n\n child.on('close', (code: number) => {\n if (code !== 0) {\n logger.warn(\n chalk.yellow(`Biome formatting failed with exit code ${code}`)\n );\n }\n resolve();\n });\n });\n } catch (error) {\n logger.warn(chalk.yellow('Biome formatting failed: ' + String(error)));\n }\n return;\n }\n\n if (detectedFormatter === 'eslint') {\n logger.message(chalk.dim('Cleaning up with eslint...'));\n const { ESLint } = await import('eslint');\n const eslint = new ESLint({\n fix: true,\n overrideConfigFile: undefined, // Will use project's .eslintrc\n });\n for (const file of filesUpdated) {\n const results = await eslint.lintFiles([file]);\n await ESLint.outputFixes(results);\n }\n return;\n }\n } catch (e) {\n logger.warn(chalk.yellow('Unable to run code formatter: ' + String(e)));\n }\n}\n"],"mappings":";;;;;AAOA,eAAsB,kBAA6C;AAEjE,KAAI;AACF,QAAM,OAAO;AACb,SAAO;SACD;AAKR,KAAI;AACF,QAAM,OAAO;AACb,SAAO;SACD;AAKR,KAAI;AACF,SAAO,MAAM,IAAI,SAA2B,YAAY;GACtD,MAAM,QAAQ,MAAM,OAAO,CAAC,kBAAkB,YAAY,EAAE,EAC1D,OAAO,UACR,CAAC;AAEF,SAAM,GAAG,eAAe;AACtB,YAAQ,KAAK;KACb;AAEF,SAAM,GAAG,UAAU,SAAiB;AAClC,QAAI,SAAS,EACX,SAAQ,QAAQ;QAEhB,SAAQ,KAAK;KAEf;IACF;SACI;AAIR,QAAO;;AAGT,eAAsB,YACpB,cACA,WACe;AACf,KAAI,aAAa,WAAW,EAAG;AAE/B,KAAI;EACF,MAAM,oBAAoB,aAAc,MAAM,iBAAiB;AAE/D,MAAI,CAAC,mBAAmB;AACtB,UAAO,KAAK,MAAM,OAAO,kCAAkC,CAAC;AAC5D;;AAGF,MAAI,sBAAsB,YAAY;AACpC,UAAO,QAAQ,MAAM,IAAI,+BAA+B,CAAC;GACzD,MAAM,WAAW,MAAM,OAAO;AAC9B,QAAK,MAAM,QAAQ,cAAc;IAC/B,MAAM,SAAS,MAAM,SAAS,cAAc,KAAK;IACjD,MAAM,UAAU,MAAM,GAAG,SAAS,SAAS,MAAM,QAAQ;IACzD,MAAM,YAAY,MAAM,SAAS,OAAO,SAAS;KAC/C,GAAG;KACH,UAAU;KACX,CAAC;AACF,UAAM,GAAG,SAAS,UAAU,MAAM,UAAU;;AAE9C;;AAGF,MAAI,sBAAsB,SAAS;AACjC,UAAO,QAAQ,MAAM,IAAI,4BAA4B,CAAC;AACtD,OAAI;AACF,UAAM,IAAI,SAAe,YAAY;KAQnC,MAAM,QAAQ,MAAM,OAAO;MANzB;MACA;MACA;MACA,GAAG,aAAa,KAAK,SAAS,KAAK;MAGN,EAAE,EAC/B,OAAO;MAAC;MAAU;MAAW;MAAU,EACxC,CAAC;AAEF,WAAM,GAAG,UAAU,UAAiB;AAClC,aAAO,KACL,MAAM,OAAO,8BAA8B,MAAM,QAAQ,CAC1D;AACD,eAAS;OACT;AAEF,WAAM,GAAG,UAAU,SAAiB;AAClC,UAAI,SAAS,EACX,QAAO,KACL,MAAM,OAAO,0CAA0C,OAAO,CAC/D;AAEH,eAAS;OACT;MACF;YACK,OAAO;AACd,WAAO,KAAK,MAAM,OAAO,8BAA8B,OAAO,MAAM,CAAC,CAAC;;AAExE;;AAGF,MAAI,sBAAsB,UAAU;AAClC,UAAO,QAAQ,MAAM,IAAI,6BAA6B,CAAC;GACvD,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,MAAM,SAAS,IAAI,OAAO;IACxB,KAAK;IACL,oBAAoB,KAAA;IACrB,CAAC;AACF,QAAK,MAAM,QAAQ,cAAc;IAC/B,MAAM,UAAU,MAAM,OAAO,UAAU,CAAC,KAAK,CAAC;AAC9C,UAAM,OAAO,YAAY,QAAQ;;AAEnC;;UAEK,GAAG;AACV,SAAO,KAAK,MAAM,OAAO,mCAAmC,OAAO,EAAE,CAAC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,32 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
else if (library === Libraries.GT_NODE) {
|
|
21
|
-
cli = new NodeCLI(program, library, additionalModules);
|
|
22
|
-
}
|
|
23
|
-
else if (isPythonLibrary(library)) {
|
|
24
|
-
cli = new PythonCLI(program, library, additionalModules);
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
cli = new BaseCLI(program, library, additionalModules);
|
|
28
|
-
}
|
|
29
|
-
cli.init();
|
|
30
|
-
cli.execute();
|
|
1
|
+
import { isPythonLibrary } from "./types/libraries.js";
|
|
2
|
+
import { determineLibrary } from "./fs/determineFramework/index.js";
|
|
3
|
+
import { BaseCLI } from "./cli/base.js";
|
|
4
|
+
import { ReactCLI } from "./cli/react.js";
|
|
5
|
+
import { NextCLI } from "./cli/next.js";
|
|
6
|
+
import { PythonCLI } from "./cli/python.js";
|
|
7
|
+
import { NodeCLI } from "./cli/node.js";
|
|
8
|
+
//#region src/index.ts
|
|
9
|
+
function main(program) {
|
|
10
|
+
program.name("gt");
|
|
11
|
+
const { library, additionalModules } = determineLibrary();
|
|
12
|
+
let cli;
|
|
13
|
+
if (library === "gt-next") cli = new NextCLI(program, library, additionalModules);
|
|
14
|
+
else if (library === "gt-react" || library === "gt-react-native" || library === "gt-tanstack-start") cli = new ReactCLI(program, library, additionalModules);
|
|
15
|
+
else if (library === "gt-node") cli = new NodeCLI(program, library, additionalModules);
|
|
16
|
+
else if (isPythonLibrary(library)) cli = new PythonCLI(program, library, additionalModules);
|
|
17
|
+
else cli = new BaseCLI(program, library, additionalModules);
|
|
18
|
+
cli.init();
|
|
19
|
+
cli.execute();
|
|
31
20
|
}
|
|
32
|
-
|
|
21
|
+
//#endregion
|
|
22
|
+
export { BaseCLI, main };
|
|
23
|
+
|
|
24
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["import { BaseCLI } from './cli/base.js';\nimport { NextCLI } from './cli/next.js';\nimport { ReactCLI } from './cli/react.js';\nimport { PythonCLI } from './cli/python.js';\nimport { determineLibrary } from './fs/determineFramework/index.js';\nimport { Command } from 'commander';\nimport { NodeCLI } from './cli/node.js';\nimport { Libraries, isPythonLibrary } from './types/libraries.js';\n\nexport function main(program: Command) {\n program.name('gt');\n\n const { library, additionalModules } = determineLibrary();\n let cli: BaseCLI;\n if (library === Libraries.GT_NEXT) {\n cli = new NextCLI(program, library, additionalModules);\n } else if (\n library === Libraries.GT_REACT ||\n library === Libraries.GT_REACT_NATIVE ||\n library === Libraries.GT_TANSTACK_START\n ) {\n cli = new ReactCLI(program, library, additionalModules);\n } else if (library === Libraries.GT_NODE) {\n cli = new NodeCLI(program, library, additionalModules);\n } else if (isPythonLibrary(library)) {\n cli = new PythonCLI(program, library, additionalModules);\n } else {\n cli = new BaseCLI(program, library, additionalModules);\n }\n cli.init();\n cli.execute();\n}\n\nexport { BaseCLI };\n"],"mappings":";;;;;;;;AASA,SAAgB,KAAK,SAAkB;AACrC,SAAQ,KAAK,KAAK;CAElB,MAAM,EAAE,SAAS,sBAAsB,kBAAkB;CACzD,IAAI;AACJ,KAAI,YAAA,UACF,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAEtD,YAAA,cACA,YAAA,qBACA,YAAA,oBAEA,OAAM,IAAI,SAAS,SAAS,SAAS,kBAAkB;UAC9C,YAAA,UACT,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;UAC7C,gBAAgB,QAAQ,CACjC,OAAM,IAAI,UAAU,SAAS,SAAS,kBAAkB;KAExD,OAAM,IAAI,QAAQ,SAAS,SAAS,kBAAkB;AAExD,KAAI,MAAM;AACV,KAAI,SAAS"}
|
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import { logger } from
|
|
2
|
-
import chalk from
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
logger.message(`${chalk.dim(`If the browser window didn't open automatically, open the following link:`)}\n\n${chalk.cyan(urlToOpen)}`);
|
|
1
|
+
import { logger } from "../console/logger.js";
|
|
2
|
+
import chalk from "chalk";
|
|
3
|
+
//#region src/locadex/setupFlow.ts
|
|
4
|
+
async function setupLocadex(settings) {
|
|
5
|
+
const urlToOpen = `${settings.dashboardUrl}/api/integrations/github/start?returnTo=%2Fproject%2Flocadex`;
|
|
6
|
+
await import("open").then((open) => open.default(urlToOpen, { wait: false }));
|
|
7
|
+
logger.message(`${chalk.dim(`If the browser window didn't open automatically, open the following link:`)}\n\n${chalk.cyan(urlToOpen)}`);
|
|
9
8
|
}
|
|
9
|
+
//#endregion
|
|
10
|
+
export { setupLocadex };
|
|
11
|
+
|
|
12
|
+
//# sourceMappingURL=setupFlow.js.map
|