gtx-cli 2.1.12 → 2.1.14
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 +15 -0
- package/dist/api/sendFiles.js +1 -0
- package/dist/cli/flags.js +2 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/utils/addExplicitAnchorIds.js +2 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.1.14
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#623](https://github.com/generaltranslation/gt/pull/623) [`288d2c6`](https://github.com/generaltranslation/gt/commit/288d2c657ff46eb5f4a5cdbc76ecc3f9be85228f) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - feat: add --force flag for overwriting cached translations
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`288d2c6`](https://github.com/generaltranslation/gt/commit/288d2c657ff46eb5f4a5cdbc76ecc3f9be85228f)]:
|
|
10
|
+
- generaltranslation@7.4.2
|
|
11
|
+
|
|
12
|
+
## 2.1.13
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [#620](https://github.com/generaltranslation/gt/pull/620) [`1404b8f`](https://github.com/generaltranslation/gt/commit/1404b8feda21acdfba42483d496c61816babd327) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Display warning on MDX header mismatch instead of failure
|
|
17
|
+
|
|
3
18
|
## 2.1.12
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/dist/api/sendFiles.js
CHANGED
|
@@ -29,6 +29,7 @@ export async function sendFiles(files, options, settings) {
|
|
|
29
29
|
targetLocales: settings.locales,
|
|
30
30
|
version: settings.version, // not set ATM
|
|
31
31
|
modelProvider: settings.modelProvider,
|
|
32
|
+
force: options?.force,
|
|
32
33
|
});
|
|
33
34
|
// Handle version ID response (for async processing)
|
|
34
35
|
const { data, message, locales, translations } = responseData;
|
package/dist/cli/flags.js
CHANGED
|
@@ -23,7 +23,8 @@ export function attachTranslateFlags(command) {
|
|
|
23
23
|
.option('--experimental-localize-static-urls', 'Triggering this will run a script after the cli tool that localizes all urls in content files. Currently only supported for md and mdx files.', false)
|
|
24
24
|
.option('--experimental-hide-default-locale', 'When localizing static locales, hide the default locale from the path', false)
|
|
25
25
|
.option('--experimental-flatten-json-files', 'Triggering this will flatten the json files into a single file. This is useful for projects that have a lot of json files.', false)
|
|
26
|
-
.option('--experimental-localize-static-imports', 'Triggering this will run a script after the cli tool that localizes all static imports in content files. Currently only supported for md and mdx files.', false)
|
|
26
|
+
.option('--experimental-localize-static-imports', 'Triggering this will run a script after the cli tool that localizes all static imports in content files. Currently only supported for md and mdx files.', false)
|
|
27
|
+
.option('--force', 'Force a retranslation, invalidating all existing cached translations if they exist.', false);
|
|
27
28
|
return command;
|
|
28
29
|
}
|
|
29
30
|
export function attachAdditionalReactTranslateFlags(command) {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -16,6 +16,7 @@ export type Options = {
|
|
|
16
16
|
suppressWarnings: boolean;
|
|
17
17
|
dryRun: boolean;
|
|
18
18
|
timeout: number;
|
|
19
|
+
force?: boolean;
|
|
19
20
|
stageTranslations?: boolean;
|
|
20
21
|
experimentalLocalizeStaticUrls?: boolean;
|
|
21
22
|
experimentalHideDefaultLocale?: boolean;
|
|
@@ -38,6 +39,7 @@ export type TranslateFlags = {
|
|
|
38
39
|
dryRun: boolean;
|
|
39
40
|
stageTranslations?: boolean;
|
|
40
41
|
publish?: boolean;
|
|
42
|
+
force?: boolean;
|
|
41
43
|
experimentalLocalizeStaticUrls?: boolean;
|
|
42
44
|
experimentalHideDefaultLocale?: boolean;
|
|
43
45
|
experimentalFlattenJsonFiles?: boolean;
|
|
@@ -4,7 +4,7 @@ import remarkMdx from 'remark-mdx';
|
|
|
4
4
|
import remarkFrontmatter from 'remark-frontmatter';
|
|
5
5
|
import remarkStringify from 'remark-stringify';
|
|
6
6
|
import { visit } from 'unist-util-visit';
|
|
7
|
-
import {
|
|
7
|
+
import { logWarning } from '../console/logging.js';
|
|
8
8
|
/**
|
|
9
9
|
* Generates a slug from heading text
|
|
10
10
|
*/
|
|
@@ -89,7 +89,7 @@ export function addExplicitAnchorIds(translatedContent, sourceHeadingMap, settin
|
|
|
89
89
|
const translatedFile = translatedPath
|
|
90
90
|
? `translated file: ${translatedPath}`
|
|
91
91
|
: 'translated file';
|
|
92
|
-
|
|
92
|
+
logWarning(`Header count mismatch detected! ${sourceFile} has ${sourceHeadingMap.length} headers but ${translatedFile} has ${translatedHeadings.length} headers. ` +
|
|
93
93
|
`This likely means your source file was edited after translation was requested, causing a mismatch between ` +
|
|
94
94
|
`the number of headers in your source file vs the translated file. Please re-translate this file to resolve the issue.`);
|
|
95
95
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.14",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/main.js",
|
|
6
6
|
"files": [
|
|
@@ -87,7 +87,7 @@
|
|
|
87
87
|
"esbuild": "^0.25.4",
|
|
88
88
|
"fast-glob": "^3.3.3",
|
|
89
89
|
"form-data": "^4.0.4",
|
|
90
|
-
"generaltranslation": "^7.4.
|
|
90
|
+
"generaltranslation": "^7.4.2",
|
|
91
91
|
"json-pointer": "^0.6.2",
|
|
92
92
|
"jsonpath-plus": "^10.3.0",
|
|
93
93
|
"jsonpointer": "^5.0.1",
|