gtx-cli 2.6.31 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -1261
- package/README.md +12 -3
- package/dist/bin/bin-entry.js +2 -1
- package/dist/config/generateSettings.d.ts +1 -9
- package/dist/config/generateSettings.js +1 -214
- package/dist/config/resolveConfig.d.ts +1 -4
- package/dist/config/resolveConfig.js +1 -33
- package/dist/fs/config/setupConfig.d.ts +1 -17
- package/dist/fs/config/setupConfig.js +1 -50
- package/dist/fs/matchFiles.d.ts +1 -1
- package/dist/fs/matchFiles.js +1 -8
- package/dist/functions.d.ts +1 -7
- package/dist/functions.js +1 -6
- package/dist/index.d.ts +1 -4
- package/dist/index.js +1 -27
- package/dist/main.js +2 -2
- package/dist/next/parse/handleInitGT.d.ts +1 -7
- package/dist/next/parse/handleInitGT.js +1 -157
- package/dist/next/parse/wrapContent.d.ts +1 -12
- package/dist/next/parse/wrapContent.js +1 -164
- package/dist/react/parse/wrapContent.d.ts +1 -12
- package/dist/react/parse/wrapContent.js +1 -162
- package/dist/types/index.d.ts +1 -243
- package/dist/types/index.js +1 -1
- package/dist/utils/installPackage.d.ts +1 -3
- package/dist/utils/installPackage.js +1 -77
- package/dist/utils/packageInfo.d.ts +1 -3
- package/dist/utils/packageInfo.js +1 -17
- package/dist/utils/packageJson.d.ts +1 -6
- package/dist/utils/packageJson.js +1 -68
- package/dist/utils/packageManager.d.ts +1 -28
- package/dist/utils/packageManager.js +1 -269
- package/package.json +11 -97
- package/dist/api/collectUserEditDiffs.d.ts +0 -9
- package/dist/api/collectUserEditDiffs.js +0 -159
- package/dist/api/downloadFileBatch.d.ts +0 -23
- package/dist/api/downloadFileBatch.js +0 -190
- package/dist/api/saveLocalEdits.d.ts +0 -6
- package/dist/api/saveLocalEdits.js +0 -38
- package/dist/cli/base.d.ts +0 -59
- package/dist/cli/base.js +0 -529
- package/dist/cli/commands/download.d.ts +0 -8
- package/dist/cli/commands/download.js +0 -51
- package/dist/cli/commands/enqueue.d.ts +0 -9
- package/dist/cli/commands/enqueue.js +0 -27
- package/dist/cli/commands/setupProject.d.ts +0 -7
- package/dist/cli/commands/setupProject.js +0 -37
- package/dist/cli/commands/stage.d.ts +0 -9
- package/dist/cli/commands/stage.js +0 -59
- package/dist/cli/commands/translate.d.ts +0 -7
- package/dist/cli/commands/translate.js +0 -70
- package/dist/cli/commands/upload.d.ts +0 -13
- package/dist/cli/commands/upload.js +0 -142
- package/dist/cli/commands/utils/validation.d.ts +0 -13
- package/dist/cli/commands/utils/validation.js +0 -38
- package/dist/cli/flags.d.ts +0 -15
- package/dist/cli/flags.js +0 -70
- package/dist/cli/inline.d.ts +0 -17
- package/dist/cli/inline.js +0 -135
- package/dist/cli/next.d.ts +0 -10
- package/dist/cli/next.js +0 -12
- package/dist/cli/node.d.ts +0 -10
- package/dist/cli/node.js +0 -9
- package/dist/cli/react.d.ts +0 -12
- package/dist/cli/react.js +0 -72
- package/dist/config/optionPresets.d.ts +0 -3
- package/dist/config/optionPresets.js +0 -65
- package/dist/config/utils.d.ts +0 -2
- package/dist/config/utils.js +0 -4
- package/dist/config/validateSettings.d.ts +0 -3
- package/dist/config/validateSettings.js +0 -32
- package/dist/console/colors.d.ts +0 -6
- package/dist/console/colors.js +0 -19
- package/dist/console/displayTranslateSummary.d.ts +0 -1
- package/dist/console/displayTranslateSummary.js +0 -42
- package/dist/console/formatting.d.ts +0 -1
- package/dist/console/formatting.js +0 -7
- package/dist/console/index.d.ts +0 -34
- package/dist/console/index.js +0 -46
- package/dist/console/logger.d.ts +0 -35
- package/dist/console/logger.js +0 -250
- package/dist/console/logging.d.ts +0 -52
- package/dist/console/logging.js +0 -175
- package/dist/formats/files/aggregateFiles.d.ts +0 -4
- package/dist/formats/files/aggregateFiles.js +0 -156
- package/dist/formats/files/collectFiles.d.ts +0 -6
- package/dist/formats/files/collectFiles.js +0 -49
- package/dist/formats/files/convertToFileTranslationData.d.ts +0 -15
- package/dist/formats/files/convertToFileTranslationData.js +0 -21
- package/dist/formats/files/fileMapping.d.ts +0 -11
- package/dist/formats/files/fileMapping.js +0 -115
- package/dist/formats/files/preprocess/mdx.d.ts +0 -6
- package/dist/formats/files/preprocess/mdx.js +0 -14
- package/dist/formats/files/preprocess/mintlify.d.ts +0 -5
- package/dist/formats/files/preprocess/mintlify.js +0 -15
- package/dist/formats/files/preprocessContent.d.ts +0 -8
- package/dist/formats/files/preprocessContent.js +0 -23
- package/dist/formats/files/save.d.ts +0 -5
- package/dist/formats/files/save.js +0 -17
- package/dist/formats/files/supportedFiles.d.ts +0 -11
- package/dist/formats/files/supportedFiles.js +0 -20
- package/dist/formats/json/extractJson.d.ts +0 -15
- package/dist/formats/json/extractJson.js +0 -101
- package/dist/formats/json/flattenJson.d.ts +0 -14
- package/dist/formats/json/flattenJson.js +0 -64
- package/dist/formats/json/mergeJson.d.ts +0 -13
- package/dist/formats/json/mergeJson.js +0 -367
- package/dist/formats/json/parseJson.d.ts +0 -2
- package/dist/formats/json/parseJson.js +0 -109
- package/dist/formats/json/utils.d.ts +0 -47
- package/dist/formats/json/utils.js +0 -150
- package/dist/formats/utils.d.ts +0 -2
- package/dist/formats/utils.js +0 -24
- package/dist/formats/yaml/mergeYaml.d.ts +0 -5
- package/dist/formats/yaml/mergeYaml.js +0 -61
- package/dist/formats/yaml/parseYaml.d.ts +0 -5
- package/dist/formats/yaml/parseYaml.js +0 -24
- package/dist/formats/yaml/utils.d.ts +0 -2
- package/dist/formats/yaml/utils.js +0 -23
- package/dist/fs/clearLocaleDirs.d.ts +0 -8
- package/dist/fs/clearLocaleDirs.js +0 -126
- package/dist/fs/config/downloadedVersions.d.ts +0 -21
- package/dist/fs/config/downloadedVersions.js +0 -50
- package/dist/fs/config/loadConfig.d.ts +0 -1
- package/dist/fs/config/loadConfig.js +0 -9
- package/dist/fs/config/parseFilesConfig.d.ts +0 -27
- package/dist/fs/config/parseFilesConfig.js +0 -150
- package/dist/fs/config/updateConfig.d.ts +0 -21
- package/dist/fs/config/updateConfig.js +0 -57
- package/dist/fs/config/updateVersions.d.ts +0 -11
- package/dist/fs/config/updateVersions.js +0 -30
- package/dist/fs/copyFile.d.ts +0 -7
- package/dist/fs/copyFile.js +0 -39
- package/dist/fs/createLoadTranslationsFile.d.ts +0 -1
- package/dist/fs/createLoadTranslationsFile.js +0 -49
- package/dist/fs/determineFramework.d.ts +0 -5
- package/dist/fs/determineFramework.js +0 -53
- package/dist/fs/findFilepath.d.ts +0 -36
- package/dist/fs/findFilepath.js +0 -90
- package/dist/fs/index.d.ts +0 -1
- package/dist/fs/index.js +0 -1
- package/dist/fs/loadJSON.d.ts +0 -6
- package/dist/fs/loadJSON.js +0 -17
- package/dist/fs/saveJSON.d.ts +0 -1
- package/dist/fs/saveJSON.js +0 -7
- package/dist/fs/utils.d.ts +0 -1
- package/dist/fs/utils.js +0 -16
- package/dist/generated/version.d.ts +0 -1
- package/dist/generated/version.js +0 -2
- package/dist/git/branches.d.ts +0 -7
- package/dist/git/branches.js +0 -88
- package/dist/hooks/postProcess.d.ts +0 -4
- package/dist/hooks/postProcess.js +0 -110
- package/dist/locadex/setupFlow.d.ts +0 -2
- package/dist/locadex/setupFlow.js +0 -9
- package/dist/next/config/parseNextConfig.d.ts +0 -10
- package/dist/next/config/parseNextConfig.js +0 -53
- package/dist/next/jsx/utils.d.ts +0 -7
- package/dist/next/jsx/utils.js +0 -42
- package/dist/react/config/createESBuildConfig.d.ts +0 -2
- package/dist/react/config/createESBuildConfig.js +0 -119
- package/dist/react/jsx/evaluateJsx.d.ts +0 -24
- package/dist/react/jsx/evaluateJsx.js +0 -123
- package/dist/react/jsx/utils/buildImportMap.d.ts +0 -9
- package/dist/react/jsx/utils/buildImportMap.js +0 -30
- package/dist/react/jsx/utils/constants.d.ts +0 -15
- package/dist/react/jsx/utils/constants.js +0 -49
- package/dist/react/jsx/utils/getCalleeNameFromExpression.d.ts +0 -9
- package/dist/react/jsx/utils/getCalleeNameFromExpression.js +0 -32
- package/dist/react/jsx/utils/getPathsAndAliases.d.ts +0 -21
- package/dist/react/jsx/utils/getPathsAndAliases.js +0 -91
- package/dist/react/jsx/utils/isNumberLiteral.d.ts +0 -7
- package/dist/react/jsx/utils/isNumberLiteral.js +0 -13
- package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.d.ts +0 -9
- package/dist/react/jsx/utils/jsxParsing/addGTIdentifierToSyntaxTree.js +0 -138
- package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.d.ts +0 -6
- package/dist/react/jsx/utils/jsxParsing/handleChildrenWhitespace.js +0 -197
- package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.d.ts +0 -13
- package/dist/react/jsx/utils/jsxParsing/multiplication/findMultiplicationNode.js +0 -42
- package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.d.ts +0 -5
- package/dist/react/jsx/utils/jsxParsing/multiplication/multiplyJsxTree.js +0 -69
- package/dist/react/jsx/utils/jsxParsing/parseJsx.d.ts +0 -33
- package/dist/react/jsx/utils/jsxParsing/parseJsx.js +0 -918
- package/dist/react/jsx/utils/jsxParsing/parseTProps.d.ts +0 -8
- package/dist/react/jsx/utils/jsxParsing/parseTProps.js +0 -65
- package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.d.ts +0 -2
- package/dist/react/jsx/utils/jsxParsing/removeNullChildrenFields.js +0 -61
- package/dist/react/jsx/utils/jsxParsing/types.d.ts +0 -48
- package/dist/react/jsx/utils/jsxParsing/types.js +0 -34
- package/dist/react/jsx/utils/mapAttributeName.d.ts +0 -11
- package/dist/react/jsx/utils/mapAttributeName.js +0 -12
- package/dist/react/jsx/utils/parseAst.d.ts +0 -31
- package/dist/react/jsx/utils/parseAst.js +0 -278
- package/dist/react/jsx/utils/parseDeclareStatic.d.ts +0 -15
- package/dist/react/jsx/utils/parseDeclareStatic.js +0 -540
- package/dist/react/jsx/utils/parseString.d.ts +0 -25
- package/dist/react/jsx/utils/parseString.js +0 -540
- package/dist/react/jsx/utils/parseStringFunction.d.ts +0 -30
- package/dist/react/jsx/utils/parseStringFunction.js +0 -348
- package/dist/react/jsx/utils/resolveImportPath.d.ts +0 -11
- package/dist/react/jsx/utils/resolveImportPath.js +0 -111
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.d.ts +0 -29
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/extractStringEntryMetadata.js +0 -86
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.d.ts +0 -14
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleInvalidTranslationCall.js +0 -24
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.d.ts +0 -19
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleLiteralTranslationCall.js +0 -31
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleStaticTranslationCall.d.ts +0 -22
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/handleStaticTranslationCall.js +0 -51
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.d.ts +0 -18
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/index.js +0 -39
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.d.ts +0 -24
- package/dist/react/jsx/utils/stringParsing/processTranslationCall/routeTranslationCall.js +0 -68
- package/dist/react/jsx/utils/stringParsing/types.d.ts +0 -41
- package/dist/react/jsx/utils/stringParsing/types.js +0 -1
- package/dist/react/jsx/utils/types.d.ts +0 -14
- package/dist/react/jsx/utils/types.js +0 -1
- package/dist/react/jsx/utils/validateStringFunction.d.ts +0 -7
- package/dist/react/jsx/utils/validateStringFunction.js +0 -31
- package/dist/react/jsx/wrapJsx.d.ts +0 -51
- package/dist/react/jsx/wrapJsx.js +0 -387
- package/dist/react/parse/addVitePlugin/index.d.ts +0 -22
- package/dist/react/parse/addVitePlugin/index.js +0 -41
- package/dist/react/parse/addVitePlugin/installCompiler.d.ts +0 -8
- package/dist/react/parse/addVitePlugin/installCompiler.js +0 -22
- package/dist/react/parse/addVitePlugin/updateViteConfig.d.ts +0 -19
- package/dist/react/parse/addVitePlugin/updateViteConfig.js +0 -120
- package/dist/react/parse/addVitePlugin/utils/addCompilerImport.d.ts +0 -9
- package/dist/react/parse/addVitePlugin/utils/addCompilerImport.js +0 -34
- package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.d.ts +0 -11
- package/dist/react/parse/addVitePlugin/utils/addPluginInvocation.js +0 -48
- package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.d.ts +0 -15
- package/dist/react/parse/addVitePlugin/utils/checkCompilerImport.js +0 -113
- package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.d.ts +0 -12
- package/dist/react/parse/addVitePlugin/utils/checkPluginInvocation.js +0 -32
- package/dist/react/parse/createDictionaryUpdates.d.ts +0 -3
- package/dist/react/parse/createDictionaryUpdates.js +0 -187
- package/dist/react/parse/createInlineUpdates.d.ts +0 -13
- package/dist/react/parse/createInlineUpdates.js +0 -161
- package/dist/react/utils/flattenDictionary.d.ts +0 -20
- package/dist/react/utils/flattenDictionary.js +0 -75
- package/dist/react/utils/getEntryAndMetadata.d.ts +0 -5
- package/dist/react/utils/getEntryAndMetadata.js +0 -11
- package/dist/react/utils/getVariableName.d.ts +0 -25
- package/dist/react/utils/getVariableName.js +0 -37
- package/dist/setup/agentInstructions.d.ts +0 -24
- package/dist/setup/agentInstructions.js +0 -138
- package/dist/setup/detectFramework.d.ts +0 -31
- package/dist/setup/detectFramework.js +0 -106
- package/dist/setup/frameworkUtils.d.ts +0 -3
- package/dist/setup/frameworkUtils.js +0 -30
- package/dist/setup/instructions/base.md +0 -29
- package/dist/setup/instructions/gt-next.md +0 -107
- package/dist/setup/instructions/gt-react.md +0 -98
- package/dist/setup/userInput.d.ts +0 -4
- package/dist/setup/userInput.js +0 -32
- package/dist/setup/wizard.d.ts +0 -3
- package/dist/setup/wizard.js +0 -147
- package/dist/state/recentDownloads.d.ts +0 -12
- package/dist/state/recentDownloads.js +0 -18
- package/dist/state/translateWarnings.d.ts +0 -10
- package/dist/state/translateWarnings.js +0 -13
- package/dist/translation/parse.d.ts +0 -17
- package/dist/translation/parse.js +0 -77
- package/dist/translation/stage.d.ts +0 -3
- package/dist/translation/stage.js +0 -44
- package/dist/translation/validate.d.ts +0 -14
- package/dist/translation/validate.js +0 -100
- package/dist/types/branch.d.ts +0 -14
- package/dist/types/branch.js +0 -1
- package/dist/types/data/json.d.ts +0 -6
- package/dist/types/data/json.js +0 -1
- package/dist/types/data.d.ts +0 -37
- package/dist/types/data.js +0 -1
- package/dist/types/files.d.ts +0 -8
- package/dist/types/files.js +0 -1
- package/dist/types/libraries.d.ts +0 -31
- package/dist/types/libraries.js +0 -72
- package/dist/types/parsing.d.ts +0 -3
- package/dist/types/parsing.js +0 -1
- package/dist/utils/addExplicitAnchorIds.d.ts +0 -24
- package/dist/utils/addExplicitAnchorIds.js +0 -416
- package/dist/utils/constants.d.ts +0 -5
- package/dist/utils/constants.js +0 -6
- package/dist/utils/credentials.d.ts +0 -12
- package/dist/utils/credentials.js +0 -120
- package/dist/utils/flattenJsonFiles.d.ts +0 -2
- package/dist/utils/flattenJsonFiles.js +0 -36
- package/dist/utils/gitDiff.d.ts +0 -8
- package/dist/utils/gitDiff.js +0 -34
- package/dist/utils/gt.d.ts +0 -2
- package/dist/utils/gt.js +0 -2
- package/dist/utils/hash.d.ts +0 -6
- package/dist/utils/hash.js +0 -11
- package/dist/utils/headers.d.ts +0 -1
- package/dist/utils/headers.js +0 -14
- package/dist/utils/localizeRelativeAssets.d.ts +0 -8
- package/dist/utils/localizeRelativeAssets.js +0 -166
- package/dist/utils/localizeStaticImports.d.ts +0 -15
- package/dist/utils/localizeStaticImports.js +0 -397
- package/dist/utils/localizeStaticUrls.d.ts +0 -19
- package/dist/utils/localizeStaticUrls.js +0 -450
- package/dist/utils/mintlifyTitleFallback.d.ts +0 -6
- package/dist/utils/mintlifyTitleFallback.js +0 -80
- package/dist/utils/parse/needsCJS.d.ts +0 -20
- package/dist/utils/parse/needsCJS.js +0 -72
- package/dist/utils/persistPostprocessHashes.d.ts +0 -12
- package/dist/utils/persistPostprocessHashes.js +0 -39
- package/dist/utils/processAnchorIds.d.ts +0 -6
- package/dist/utils/processAnchorIds.js +0 -56
- package/dist/utils/processOpenApi.d.ts +0 -8
- package/dist/utils/processOpenApi.js +0 -651
- package/dist/utils/sanitizeFileContent.d.ts +0 -6
- package/dist/utils/sanitizeFileContent.js +0 -29
- package/dist/utils/sharedStaticAssets.d.ts +0 -9
- package/dist/utils/sharedStaticAssets.js +0 -384
- package/dist/utils/validateMdx.d.ts +0 -10
- package/dist/utils/validateMdx.js +0 -25
- package/dist/utils/wrapPlainUrls.d.ts +0 -8
- package/dist/utils/wrapPlainUrls.js +0 -72
- package/dist/workflows/download.d.ts +0 -32
- package/dist/workflows/download.js +0 -131
- package/dist/workflows/enqueue.d.ts +0 -17
- package/dist/workflows/enqueue.js +0 -59
- package/dist/workflows/setupProject.d.ts +0 -13
- package/dist/workflows/setupProject.js +0 -48
- package/dist/workflows/stage.d.ts +0 -18
- package/dist/workflows/stage.js +0 -59
- package/dist/workflows/steps/BranchStep.d.ts +0 -13
- package/dist/workflows/steps/BranchStep.js +0 -161
- package/dist/workflows/steps/DownloadStep.d.ts +0 -19
- package/dist/workflows/steps/DownloadStep.js +0 -131
- package/dist/workflows/steps/EnqueueStep.d.ts +0 -15
- package/dist/workflows/steps/EnqueueStep.js +0 -33
- package/dist/workflows/steps/PollJobsStep.d.ts +0 -31
- package/dist/workflows/steps/PollJobsStep.js +0 -288
- package/dist/workflows/steps/SetupStep.d.ts +0 -16
- package/dist/workflows/steps/SetupStep.js +0 -72
- package/dist/workflows/steps/UploadSourcesStep.d.ts +0 -27
- package/dist/workflows/steps/UploadSourcesStep.js +0 -131
- package/dist/workflows/steps/UploadTranslationsStep.d.ts +0 -22
- package/dist/workflows/steps/UploadTranslationsStep.js +0 -71
- package/dist/workflows/steps/UserEditDiffsStep.d.ts +0 -11
- package/dist/workflows/steps/UserEditDiffsStep.js +0 -30
- package/dist/workflows/steps/WorkflowStep.d.ts +0 -4
- package/dist/workflows/steps/WorkflowStep.js +0 -2
- package/dist/workflows/upload.d.ts +0 -15
- package/dist/workflows/upload.js +0 -47
|
@@ -1,17 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export async function getPackageInfo(packageName) {
|
|
3
|
-
try {
|
|
4
|
-
const output = execSync(`npm list -g ${packageName}`, {
|
|
5
|
-
encoding: 'utf8',
|
|
6
|
-
stdio: 'pipe',
|
|
7
|
-
});
|
|
8
|
-
const match = output.match(new RegExp(`${packageName}@([\\d\\.\\w-]+)`));
|
|
9
|
-
if (match && match[1]) {
|
|
10
|
-
return { version: match[1] };
|
|
11
|
-
}
|
|
12
|
-
return undefined;
|
|
13
|
-
}
|
|
14
|
-
catch (error) {
|
|
15
|
-
return undefined;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
1
|
+
export * from 'gt/utils/packageInfo';
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
export declare function getPackageJson(cwd?: string): Promise<Record<string, any> | null>;
|
|
3
|
-
export declare function getCLIVersion(): string;
|
|
4
|
-
export declare function updatePackageJson(packageJson: Record<string, any>, cwd?: string): Promise<void>;
|
|
5
|
-
export declare function isPackageInstalled(packageName: string, packageJson: Record<string, any>, asDevDependency?: boolean, checkBoth?: boolean): boolean;
|
|
6
|
-
export declare function getPackageVersion(packageName: string, packageJson: Record<string, any>): string | undefined;
|
|
1
|
+
export * from 'gt/utils/packageJson';
|
|
@@ -1,68 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import chalk from 'chalk';
|
|
3
|
-
import path from 'node:path';
|
|
4
|
-
import fs from 'node:fs';
|
|
5
|
-
import { exitSync } from '../console/logging.js';
|
|
6
|
-
import { PACKAGE_VERSION } from '../generated/version.js';
|
|
7
|
-
// search for package.json such that we can run init in non-js projects
|
|
8
|
-
export async function searchForPackageJson(cwd = process.cwd()) {
|
|
9
|
-
// Get the current working directory (where the CLI is being run)
|
|
10
|
-
const packageJsonPath = path.join(cwd, 'package.json');
|
|
11
|
-
// Check if package.json exists
|
|
12
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
13
|
-
return null;
|
|
14
|
-
}
|
|
15
|
-
try {
|
|
16
|
-
return JSON.parse(await fs.promises.readFile(packageJsonPath, 'utf8'));
|
|
17
|
-
}
|
|
18
|
-
catch (error) {
|
|
19
|
-
return null;
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
export async function getPackageJson(cwd = process.cwd()) {
|
|
23
|
-
const packageJsonPath = path.join(cwd, 'package.json');
|
|
24
|
-
// Check if package.json exists
|
|
25
|
-
if (!fs.existsSync(packageJsonPath)) {
|
|
26
|
-
return null;
|
|
27
|
-
}
|
|
28
|
-
try {
|
|
29
|
-
return JSON.parse(await fs.promises.readFile(packageJsonPath, 'utf8'));
|
|
30
|
-
}
|
|
31
|
-
catch (error) {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export function getCLIVersion() {
|
|
36
|
-
return PACKAGE_VERSION;
|
|
37
|
-
}
|
|
38
|
-
export async function updatePackageJson(packageJson, cwd = process.cwd()) {
|
|
39
|
-
try {
|
|
40
|
-
await fs.promises.writeFile(path.join(cwd, 'package.json'), JSON.stringify(packageJson, null, 2));
|
|
41
|
-
}
|
|
42
|
-
catch (error) {
|
|
43
|
-
logger.error(chalk.red('Error updating package.json: ' + String(error)));
|
|
44
|
-
exitSync(1);
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
// check if a package is installed in the package.json file
|
|
48
|
-
export function isPackageInstalled(packageName, packageJson, asDevDependency = false, checkBoth = false) {
|
|
49
|
-
const dependencies = checkBoth
|
|
50
|
-
? {
|
|
51
|
-
...packageJson.devDependencies,
|
|
52
|
-
...packageJson.dependencies,
|
|
53
|
-
}
|
|
54
|
-
: asDevDependency
|
|
55
|
-
? packageJson.devDependencies
|
|
56
|
-
: packageJson.dependencies;
|
|
57
|
-
if (!dependencies) {
|
|
58
|
-
return false;
|
|
59
|
-
}
|
|
60
|
-
return dependencies[packageName] !== undefined;
|
|
61
|
-
}
|
|
62
|
-
export function getPackageVersion(packageName, packageJson) {
|
|
63
|
-
const dependencies = {
|
|
64
|
-
...packageJson.dependencies,
|
|
65
|
-
...packageJson.devDependencies,
|
|
66
|
-
};
|
|
67
|
-
return dependencies[packageName] ?? undefined;
|
|
68
|
-
}
|
|
1
|
+
export * from 'gt/utils/packageJson';
|
|
@@ -1,28 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
id: string;
|
|
3
|
-
name: string;
|
|
4
|
-
label: string;
|
|
5
|
-
installCommand: string;
|
|
6
|
-
installAllCommand: string;
|
|
7
|
-
buildCommand: string;
|
|
8
|
-
runScriptCommand: string;
|
|
9
|
-
flags: string;
|
|
10
|
-
forceInstallFlag: string;
|
|
11
|
-
devDependencyFlag: string;
|
|
12
|
-
registry?: string;
|
|
13
|
-
detect: (cwd: string) => boolean;
|
|
14
|
-
addOverride: (pkgName: string, pkgVersion: string) => Promise<void>;
|
|
15
|
-
}
|
|
16
|
-
export declare class NoPackageManagerError extends Error {
|
|
17
|
-
constructor(message: string);
|
|
18
|
-
}
|
|
19
|
-
export declare const BUN: PackageManager;
|
|
20
|
-
export declare const DENO: PackageManager;
|
|
21
|
-
export declare const YARN_V1: PackageManager;
|
|
22
|
-
/** YARN V2/3/4 */
|
|
23
|
-
export declare const YARN_V2: PackageManager;
|
|
24
|
-
export declare const PNPM: PackageManager;
|
|
25
|
-
export declare const NPM: PackageManager;
|
|
26
|
-
export declare const packageManagers: PackageManager[];
|
|
27
|
-
export declare function _detectPackageManger(cwd: string): PackageManager | null;
|
|
28
|
-
export declare function getPackageManager(cwd?: string, specifiedPackageManager?: string, errorIfNotFound?: boolean): Promise<PackageManager>;
|
|
1
|
+
export * from 'gt/utils/packageManager';
|
|
@@ -1,269 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import * as fs from 'fs';
|
|
3
|
-
import * as path from 'path';
|
|
4
|
-
import { getPackageJson, updatePackageJson } from './packageJson.js';
|
|
5
|
-
import { promptSelect } from '../console/logging.js';
|
|
6
|
-
export class NoPackageManagerError extends Error {
|
|
7
|
-
constructor(message) {
|
|
8
|
-
super(message);
|
|
9
|
-
this.name = 'NoPackageManagerError';
|
|
10
|
-
}
|
|
11
|
-
}
|
|
12
|
-
export const BUN = {
|
|
13
|
-
id: 'bun',
|
|
14
|
-
name: 'bun',
|
|
15
|
-
label: 'Bun',
|
|
16
|
-
installCommand: 'add',
|
|
17
|
-
installAllCommand: 'bun install',
|
|
18
|
-
buildCommand: 'bun run build',
|
|
19
|
-
runScriptCommand: 'bun run',
|
|
20
|
-
flags: '',
|
|
21
|
-
forceInstallFlag: '--force',
|
|
22
|
-
devDependencyFlag: '--dev',
|
|
23
|
-
detect: (cwd) => ['bun.lockb', 'bun.lock'].some((lockFile) => {
|
|
24
|
-
try {
|
|
25
|
-
return fs.existsSync(path.join(cwd, lockFile));
|
|
26
|
-
}
|
|
27
|
-
catch (e) {
|
|
28
|
-
return false;
|
|
29
|
-
}
|
|
30
|
-
}),
|
|
31
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
32
|
-
const packageDotJson = await getPackageJson();
|
|
33
|
-
if (!packageDotJson) {
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
const overrides = packageDotJson.overrides || {};
|
|
37
|
-
await updatePackageJson({
|
|
38
|
-
...packageDotJson,
|
|
39
|
-
overrides: {
|
|
40
|
-
...overrides,
|
|
41
|
-
[pkgName]: pkgVersion,
|
|
42
|
-
},
|
|
43
|
-
});
|
|
44
|
-
},
|
|
45
|
-
};
|
|
46
|
-
export const DENO = {
|
|
47
|
-
id: 'deno',
|
|
48
|
-
name: 'deno',
|
|
49
|
-
label: 'Deno',
|
|
50
|
-
installCommand: 'install',
|
|
51
|
-
installAllCommand: 'deno install',
|
|
52
|
-
buildCommand: 'deno task build',
|
|
53
|
-
runScriptCommand: 'deno task',
|
|
54
|
-
flags: '',
|
|
55
|
-
forceInstallFlag: '--force',
|
|
56
|
-
devDependencyFlag: '--dev',
|
|
57
|
-
registry: 'npm',
|
|
58
|
-
detect: (cwd) => {
|
|
59
|
-
try {
|
|
60
|
-
return fs.existsSync(path.join(cwd, 'deno.lock'));
|
|
61
|
-
}
|
|
62
|
-
catch (e) {
|
|
63
|
-
return false;
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
67
|
-
const packageDotJson = await getPackageJson();
|
|
68
|
-
if (!packageDotJson) {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
const overrides = packageDotJson.overrides || {};
|
|
72
|
-
await updatePackageJson({
|
|
73
|
-
...packageDotJson,
|
|
74
|
-
overrides: {
|
|
75
|
-
...overrides,
|
|
76
|
-
[pkgName]: pkgVersion,
|
|
77
|
-
},
|
|
78
|
-
});
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
export const YARN_V1 = {
|
|
82
|
-
id: 'yarn_v1',
|
|
83
|
-
name: 'yarn',
|
|
84
|
-
label: 'Yarn V1',
|
|
85
|
-
installCommand: 'add',
|
|
86
|
-
installAllCommand: 'yarn install',
|
|
87
|
-
buildCommand: 'yarn build',
|
|
88
|
-
runScriptCommand: 'yarn',
|
|
89
|
-
flags: '--ignore-workspace-root-check',
|
|
90
|
-
forceInstallFlag: '--force',
|
|
91
|
-
devDependencyFlag: '--dev',
|
|
92
|
-
detect: (cwd) => {
|
|
93
|
-
try {
|
|
94
|
-
return fs
|
|
95
|
-
.readFileSync(path.join(cwd, 'yarn.lock'), 'utf-8')
|
|
96
|
-
.slice(0, 500)
|
|
97
|
-
.includes('yarn lockfile v1');
|
|
98
|
-
}
|
|
99
|
-
catch (e) {
|
|
100
|
-
return false;
|
|
101
|
-
}
|
|
102
|
-
},
|
|
103
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
104
|
-
const packageDotJson = await getPackageJson();
|
|
105
|
-
if (!packageDotJson) {
|
|
106
|
-
return;
|
|
107
|
-
}
|
|
108
|
-
const resolutions = packageDotJson.resolutions || {};
|
|
109
|
-
await updatePackageJson({
|
|
110
|
-
...packageDotJson,
|
|
111
|
-
resolutions: {
|
|
112
|
-
...resolutions,
|
|
113
|
-
[pkgName]: pkgVersion,
|
|
114
|
-
},
|
|
115
|
-
});
|
|
116
|
-
},
|
|
117
|
-
};
|
|
118
|
-
/** YARN V2/3/4 */
|
|
119
|
-
export const YARN_V2 = {
|
|
120
|
-
id: 'yarn_v2',
|
|
121
|
-
name: 'yarn',
|
|
122
|
-
label: 'Yarn V2/3/4',
|
|
123
|
-
installCommand: 'add',
|
|
124
|
-
installAllCommand: 'yarn install',
|
|
125
|
-
buildCommand: 'yarn build',
|
|
126
|
-
runScriptCommand: 'yarn',
|
|
127
|
-
flags: '',
|
|
128
|
-
forceInstallFlag: '--force',
|
|
129
|
-
devDependencyFlag: '--dev',
|
|
130
|
-
detect: (cwd) => {
|
|
131
|
-
try {
|
|
132
|
-
return fs
|
|
133
|
-
.readFileSync(path.join(cwd, 'yarn.lock'), 'utf-8')
|
|
134
|
-
.slice(0, 500)
|
|
135
|
-
.includes('__metadata');
|
|
136
|
-
}
|
|
137
|
-
catch (e) {
|
|
138
|
-
return false;
|
|
139
|
-
}
|
|
140
|
-
},
|
|
141
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
142
|
-
const packageDotJson = await getPackageJson();
|
|
143
|
-
if (!packageDotJson) {
|
|
144
|
-
return;
|
|
145
|
-
}
|
|
146
|
-
const resolutions = packageDotJson.resolutions || {};
|
|
147
|
-
await updatePackageJson({
|
|
148
|
-
...packageDotJson,
|
|
149
|
-
resolutions: {
|
|
150
|
-
...resolutions,
|
|
151
|
-
[pkgName]: pkgVersion,
|
|
152
|
-
},
|
|
153
|
-
});
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
export const PNPM = {
|
|
157
|
-
id: 'pnpm',
|
|
158
|
-
name: 'pnpm',
|
|
159
|
-
label: 'PNPM',
|
|
160
|
-
installCommand: 'add',
|
|
161
|
-
installAllCommand: 'pnpm install',
|
|
162
|
-
buildCommand: 'pnpm build',
|
|
163
|
-
runScriptCommand: 'pnpm',
|
|
164
|
-
flags: '--ignore-workspace-root-check',
|
|
165
|
-
forceInstallFlag: '--force',
|
|
166
|
-
devDependencyFlag: '--save-dev',
|
|
167
|
-
detect: (cwd) => {
|
|
168
|
-
try {
|
|
169
|
-
return fs.existsSync(path.join(cwd, 'pnpm-lock.yaml'));
|
|
170
|
-
}
|
|
171
|
-
catch (e) {
|
|
172
|
-
return false;
|
|
173
|
-
}
|
|
174
|
-
},
|
|
175
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
176
|
-
const packageDotJson = await getPackageJson();
|
|
177
|
-
if (!packageDotJson) {
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
const pnpm = packageDotJson.pnpm || {};
|
|
181
|
-
const overrides = pnpm.overrides || {};
|
|
182
|
-
await updatePackageJson({
|
|
183
|
-
...packageDotJson,
|
|
184
|
-
pnpm: {
|
|
185
|
-
...pnpm,
|
|
186
|
-
overrides: {
|
|
187
|
-
...overrides,
|
|
188
|
-
[pkgName]: pkgVersion,
|
|
189
|
-
},
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
},
|
|
193
|
-
};
|
|
194
|
-
export const NPM = {
|
|
195
|
-
id: 'npm',
|
|
196
|
-
name: 'npm',
|
|
197
|
-
label: 'NPM',
|
|
198
|
-
installCommand: 'install',
|
|
199
|
-
installAllCommand: 'npm ci',
|
|
200
|
-
buildCommand: 'npm run build',
|
|
201
|
-
runScriptCommand: 'npm run',
|
|
202
|
-
flags: '',
|
|
203
|
-
forceInstallFlag: '--force',
|
|
204
|
-
devDependencyFlag: '--save-dev',
|
|
205
|
-
detect: (cwd) => {
|
|
206
|
-
try {
|
|
207
|
-
return fs.existsSync(path.join(cwd, 'package-lock.json'));
|
|
208
|
-
}
|
|
209
|
-
catch (e) {
|
|
210
|
-
return false;
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
addOverride: async (pkgName, pkgVersion) => {
|
|
214
|
-
const packageDotJson = await getPackageJson();
|
|
215
|
-
if (!packageDotJson) {
|
|
216
|
-
return;
|
|
217
|
-
}
|
|
218
|
-
const overrides = packageDotJson.overrides || {};
|
|
219
|
-
await updatePackageJson({
|
|
220
|
-
...packageDotJson,
|
|
221
|
-
overrides: {
|
|
222
|
-
...overrides,
|
|
223
|
-
[pkgName]: pkgVersion,
|
|
224
|
-
},
|
|
225
|
-
});
|
|
226
|
-
},
|
|
227
|
-
};
|
|
228
|
-
export const packageManagers = [NPM, YARN_V1, YARN_V2, PNPM, BUN, DENO];
|
|
229
|
-
export function _detectPackageManger(cwd) {
|
|
230
|
-
const foundPackageMangers = packageManagers.filter((packageManager) => packageManager.detect(cwd));
|
|
231
|
-
// Only consider a package manager detected if we found exactly one.
|
|
232
|
-
// If we find more than one, we should not make any assumptions.
|
|
233
|
-
if (foundPackageMangers.length === 1) {
|
|
234
|
-
return foundPackageMangers[0];
|
|
235
|
-
}
|
|
236
|
-
return null;
|
|
237
|
-
}
|
|
238
|
-
// Get the package manager for the current project
|
|
239
|
-
// Uses a global cache to avoid prompting the user multiple times
|
|
240
|
-
export async function getPackageManager(cwd = process.cwd(), specifiedPackageManager, errorIfNotFound = false) {
|
|
241
|
-
const globalWizard = global;
|
|
242
|
-
if (globalWizard._gt_wizard_cached_package_manager) {
|
|
243
|
-
return globalWizard._gt_wizard_cached_package_manager;
|
|
244
|
-
}
|
|
245
|
-
if (specifiedPackageManager) {
|
|
246
|
-
const packageManager = packageManagers.find((packageManager) => packageManager.id === specifiedPackageManager);
|
|
247
|
-
if (packageManager) {
|
|
248
|
-
globalWizard._gt_wizard_cached_package_manager = packageManager;
|
|
249
|
-
return packageManager;
|
|
250
|
-
}
|
|
251
|
-
}
|
|
252
|
-
const detectedPackageManager = _detectPackageManger(cwd);
|
|
253
|
-
if (detectedPackageManager) {
|
|
254
|
-
globalWizard._gt_wizard_cached_package_manager = detectedPackageManager;
|
|
255
|
-
return detectedPackageManager;
|
|
256
|
-
}
|
|
257
|
-
if (errorIfNotFound) {
|
|
258
|
-
throw new NoPackageManagerError('No package manager found');
|
|
259
|
-
}
|
|
260
|
-
const selectedPackageManager = await promptSelect({
|
|
261
|
-
message: 'Please select your package manager.',
|
|
262
|
-
options: packageManagers.map((packageManager) => ({
|
|
263
|
-
value: packageManager,
|
|
264
|
-
label: packageManager.label,
|
|
265
|
-
})),
|
|
266
|
-
});
|
|
267
|
-
globalWizard._gt_wizard_cached_package_manager = selectedPackageManager;
|
|
268
|
-
return selectedPackageManager;
|
|
269
|
-
}
|
|
1
|
+
export * from 'gt/utils/packageManager';
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
|
+
"description": "CLI tool for AI-powered i18n (wrapper for gt)",
|
|
4
5
|
"main": "dist/index.js",
|
|
5
6
|
"bin": "dist/main.js",
|
|
6
7
|
"files": [
|
|
@@ -14,49 +15,9 @@
|
|
|
14
15
|
"import": "./dist/index.js",
|
|
15
16
|
"types": "./dist/index.d.ts"
|
|
16
17
|
},
|
|
17
|
-
"./types": {
|
|
18
|
-
"import": "./dist/types.js",
|
|
19
|
-
"types": "./dist/types.d.ts"
|
|
20
|
-
},
|
|
21
|
-
"./functions": {
|
|
22
|
-
"import": "./dist/functions.js",
|
|
23
|
-
"types": "./dist/functions.d.ts"
|
|
24
|
-
},
|
|
25
|
-
"./updates/*": {
|
|
26
|
-
"import": "./dist/updates/*.js",
|
|
27
|
-
"types": "./dist/updates/*.d.ts"
|
|
28
|
-
},
|
|
29
|
-
"./jsx/*": {
|
|
30
|
-
"import": "./dist/jsx/*.js",
|
|
31
|
-
"types": "./dist/jsx/*.d.ts"
|
|
32
|
-
},
|
|
33
|
-
"./fs/*": {
|
|
34
|
-
"import": "./dist/fs/*.js",
|
|
35
|
-
"types": "./dist/fs/*.d.ts"
|
|
36
|
-
},
|
|
37
|
-
"./console/*": {
|
|
38
|
-
"import": "./dist/console/*.js",
|
|
39
|
-
"types": "./dist/console/*.d.ts"
|
|
40
|
-
},
|
|
41
|
-
"./config/*": {
|
|
42
|
-
"import": "./dist/config/*.js",
|
|
43
|
-
"types": "./dist/config/*.d.ts"
|
|
44
|
-
},
|
|
45
|
-
"./api/*": {
|
|
46
|
-
"import": "./dist/api/*.js",
|
|
47
|
-
"types": "./dist/api/*.d.ts"
|
|
48
|
-
},
|
|
49
|
-
"./setup/*": {
|
|
50
|
-
"import": "./dist/setup/*.js",
|
|
51
|
-
"types": "./dist/setup/*.d.ts"
|
|
52
|
-
},
|
|
53
18
|
"./*": {
|
|
54
19
|
"import": "./dist/*.js",
|
|
55
20
|
"types": "./dist/*.d.ts"
|
|
56
|
-
},
|
|
57
|
-
"./utils/*": {
|
|
58
|
-
"import": "./dist/utils/*.js",
|
|
59
|
-
"types": "./dist/utils/*.d.ts"
|
|
60
21
|
}
|
|
61
22
|
},
|
|
62
23
|
"repository": {
|
|
@@ -77,67 +38,20 @@
|
|
|
77
38
|
"url": "https://github.com/generaltranslation/gt/issues"
|
|
78
39
|
},
|
|
79
40
|
"homepage": "https://generaltranslation.com/",
|
|
80
|
-
"description": "CLI tool for AI-powered i18n",
|
|
81
41
|
"dependencies": {
|
|
82
|
-
"@babel/generator": "^7.25.7",
|
|
83
|
-
"@babel/parser": "^7.25.7",
|
|
84
|
-
"@babel/plugin-transform-react-jsx": "^7.25.9",
|
|
85
|
-
"@babel/traverse": "^7.25.7",
|
|
86
|
-
"@clack/prompts": "1.0.0-alpha.6",
|
|
87
|
-
"@formatjs/icu-messageformat-parser": "^2.11.4",
|
|
88
|
-
"chalk": "^5.4.1",
|
|
89
42
|
"commander": "^12.1.0",
|
|
90
43
|
"dotenv": "^16.4.5",
|
|
91
|
-
"
|
|
92
|
-
"esbuild": "^0.27.2",
|
|
93
|
-
"fast-glob": "^3.3.3",
|
|
94
|
-
"fast-json-stable-stringify": "^2.1.0",
|
|
95
|
-
"html-entities": "^2.6.0",
|
|
96
|
-
"json-pointer": "^0.6.2",
|
|
97
|
-
"jsonpath-plus": "^10.3.0",
|
|
98
|
-
"jsonpointer": "^5.0.1",
|
|
99
|
-
"mdast-util-find-and-replace": "^3.0.2",
|
|
100
|
-
"micromatch": "^4.0.8",
|
|
101
|
-
"open": "^10.1.1",
|
|
102
|
-
"pino": "^10.1.0",
|
|
103
|
-
"remark-frontmatter": "^5.0.0",
|
|
104
|
-
"remark-mdx": "^3.1.0",
|
|
105
|
-
"remark-parse": "^11.0.0",
|
|
106
|
-
"remark-stringify": "^11.0.0",
|
|
107
|
-
"resolve": "^1.22.10",
|
|
108
|
-
"tsconfig-paths": "^4.2.0",
|
|
109
|
-
"unified": "^11.0.5",
|
|
110
|
-
"unist-util-visit": "^5.0.0",
|
|
111
|
-
"yaml": "^2.8.0",
|
|
112
|
-
"generaltranslation": "8.1.13",
|
|
113
|
-
"gt-remark": "1.0.5"
|
|
44
|
+
"gt": "2.7.0"
|
|
114
45
|
},
|
|
115
46
|
"devDependencies": {
|
|
116
|
-
"
|
|
117
|
-
"
|
|
118
|
-
"@types/babel__generator": "^7.27.0",
|
|
119
|
-
"@types/babel__traverse": "^7.20.6",
|
|
120
|
-
"@types/figlet": "^1.7.0",
|
|
121
|
-
"@types/mdast": "^4.0.0",
|
|
122
|
-
"@types/micromatch": "^4.0.9",
|
|
123
|
-
"@types/mock-require": "^2.0.3",
|
|
124
|
-
"@types/node": "^22.5.1",
|
|
125
|
-
"@types/react": "^18.3.4",
|
|
126
|
-
"@types/resolve": "^1.20.2",
|
|
127
|
-
"eslint": "^9.20.0",
|
|
128
|
-
"esm": "^3.2.25",
|
|
129
|
-
"mdast-util-mdx-jsx": "^3.2.0",
|
|
130
|
-
"mdast-util-mdxjs-esm": "^2.0.1",
|
|
131
|
-
"prettier": "^3.4.2",
|
|
132
|
-
"ts-node": "^10.9.2",
|
|
133
|
-
"tslib": "^2.8.1",
|
|
134
|
-
"typescript": "^5.5.4"
|
|
47
|
+
"typescript": "^5.5.4",
|
|
48
|
+
"vitest": "^2.0.0"
|
|
135
49
|
},
|
|
136
50
|
"scripts": {
|
|
137
|
-
"build": "
|
|
51
|
+
"build": "tsc",
|
|
138
52
|
"build:clean": "sh ../../scripts/clean.sh && pnpm bin:restore && rm -rf binaries && pnpm run build",
|
|
139
53
|
"build:release": "pnpm run build:clean",
|
|
140
|
-
"build:bin": "
|
|
54
|
+
"build:bin": "tsc && sh scripts/build-exe.sh all",
|
|
141
55
|
"build:bin:clean": "sh ../../scripts/clean.sh && rm -rf binaries && pnpm run build:bin",
|
|
142
56
|
"build:bin:release": "pnpm run build:bin:clean && pnpm run build:bin",
|
|
143
57
|
"build:bin:darwin-x64": "sh scripts/build-exe.sh darwin-x64",
|
|
@@ -145,8 +59,8 @@
|
|
|
145
59
|
"build:bin:linux-x64": "sh scripts/build-exe.sh linux-x64",
|
|
146
60
|
"build:bin:linux-arm64": "sh scripts/build-exe.sh linux-arm64",
|
|
147
61
|
"build:bin:windows-x64": "sh scripts/build-exe.sh windows-x64",
|
|
148
|
-
"lint": "eslint \"src/**/*.{js,ts}\"
|
|
149
|
-
"lint:fix": "eslint \"src/**/*.{js,ts}\"
|
|
62
|
+
"lint": "eslint \"src/**/*.{js,ts}\"",
|
|
63
|
+
"lint:fix": "eslint \"src/**/*.{js,ts}\" --fix",
|
|
150
64
|
"test": "vitest run --config=./vitest.config.ts",
|
|
151
65
|
"test:watch": "vitest --config=./vitest.config.ts",
|
|
152
66
|
"release": "pnpm run release:normal && pnpm run release:bin",
|
|
@@ -155,7 +69,7 @@
|
|
|
155
69
|
"release:alpha": "pnpm run build:clean && pnpm publish --tag alpha",
|
|
156
70
|
"release:beta": "pnpm run build:clean && pnpm publish --tag beta",
|
|
157
71
|
"release:latest": "pnpm run build:clean && pnpm publish --tag latest",
|
|
158
|
-
"bin:
|
|
159
|
-
"bin:
|
|
72
|
+
"bin:prep": "node scripts/prepare-binary-release.js",
|
|
73
|
+
"bin:restore": "node scripts/restore-package-json.js"
|
|
160
74
|
}
|
|
161
75
|
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { Settings } from '../types/index.js';
|
|
2
|
-
import { FileReference } from 'generaltranslation/types';
|
|
3
|
-
/**
|
|
4
|
-
* Collects local user edits by diffing the latest downloaded server translation version
|
|
5
|
-
* against the current local translation file, and submits the diffs upstream.
|
|
6
|
-
*
|
|
7
|
-
* Must run before enqueueing new translations so rules are available to the generator.
|
|
8
|
-
*/
|
|
9
|
-
export declare function collectAndSendUserEditDiffs(files: FileReference[], settings: Settings): Promise<void>;
|