gtx-cli 2.1.11 → 2.1.13

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 2.1.13
4
+
5
+ ### Patch Changes
6
+
7
+ - [#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
8
+
9
+ ## 2.1.12
10
+
11
+ ### Patch Changes
12
+
13
+ - [#618](https://github.com/generaltranslation/gt/pull/618) [`195b65f`](https://github.com/generaltranslation/gt/commit/195b65fcbdebc027156ba04409b48f3ad175e20f) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - fix: src sepcification
14
+
3
15
  ## 2.1.11
4
16
 
5
17
  ### Patch Changes
@@ -8,7 +8,7 @@ import { Updates, TranslateFlags } from '../types/index.js';
8
8
  * @param pkg - The package name
9
9
  * @returns An object containing the updates and errors
10
10
  */
11
- export declare function createUpdates(options: TranslateFlags, sourceDictionary: string | undefined, pkg: 'gt-react' | 'gt-next', validate: boolean): Promise<{
11
+ export declare function createUpdates(options: TranslateFlags, src: string[] | undefined, sourceDictionary: string | undefined, pkg: 'gt-react' | 'gt-next', validate: boolean): Promise<{
12
12
  updates: Updates;
13
13
  errors: string[];
14
14
  warnings: string[];
@@ -14,7 +14,7 @@ import chalk from 'chalk';
14
14
  * @param pkg - The package name
15
15
  * @returns An object containing the updates and errors
16
16
  */
17
- export async function createUpdates(options, sourceDictionary, pkg, validate) {
17
+ export async function createUpdates(options, src, sourceDictionary, pkg, validate) {
18
18
  let updates = [];
19
19
  let errors = [];
20
20
  let warnings = [];
@@ -48,7 +48,7 @@ export async function createUpdates(options, sourceDictionary, pkg, validate) {
48
48
  }
49
49
  }
50
50
  // Scan through project for <T> tags
51
- const { updates: newUpdates, errors: newErrors, warnings: newWarnings, } = await createInlineUpdates(pkg, validate, options.src);
51
+ const { updates: newUpdates, errors: newErrors, warnings: newWarnings, } = await createInlineUpdates(pkg, validate, src);
52
52
  errors = [...errors, ...newErrors];
53
53
  warnings = [...warnings, ...newWarnings];
54
54
  updates = [...updates, ...newUpdates];
@@ -15,7 +15,7 @@ export async function aggregateReactTranslations(options, settings, library) {
15
15
  ]);
16
16
  }
17
17
  // ---- CREATING UPDATES ---- //
18
- const { updates, errors, warnings } = await createUpdates(options, options.dictionary, library, false);
18
+ const { updates, errors, warnings } = await createUpdates(options, settings.src, options.dictionary, library, false);
19
19
  if (warnings.length > 0) {
20
20
  logWarning(chalk.yellow(`CLI tool encountered ${warnings.length} warnings while scanning for translatable content.\n` +
21
21
  warnings
@@ -27,7 +27,7 @@ export async function validateProject(settings, pkg, files) {
27
27
  './src/dictionary.ts',
28
28
  ]);
29
29
  }
30
- const { updates, errors, warnings } = await createUpdates(settings, settings.dictionary, pkg, true);
30
+ const { updates, errors, warnings } = await createUpdates(settings, settings.src, settings.dictionary, pkg, true);
31
31
  if (warnings.length > 0) {
32
32
  logWarning(chalk.yellow(`CLI tool encountered ${warnings.length} warnings while scanning for translatable content.`) +
33
33
  '\n' +
@@ -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 { logErrorAndExit } from '../console/logging.js';
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
- logErrorAndExit(`Header count mismatch detected! ${sourceFile} has ${sourceHeadingMap.length} headers but ${translatedFile} has ${translatedHeadings.length} headers. ` +
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.11",
3
+ "version": "2.1.13",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "files": [