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