gt 2.10.7 → 2.10.8

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,11 @@
1
1
  # gtx-cli
2
2
 
3
+ ## 2.10.8
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1123](https://github.com/generaltranslation/gt/pull/1123) [`3f6242c`](https://github.com/generaltranslation/gt/commit/3f6242cd5775ff894fecffe4c8279059eebf008a) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Move includeSourceCodeContext flag into files.gt
8
+
3
9
  ## 2.10.7
4
10
 
5
11
  ### Patch Changes
@@ -20,6 +20,7 @@ export declare function resolveFiles(files: FilesOptions, locale: string, locale
20
20
  resolvedPaths: ResolvedFiles;
21
21
  placeholderPaths: ResolvedFiles;
22
22
  transformPaths: TransformFiles;
23
+ includeSourceCodeContext?: boolean;
23
24
  };
24
25
  export declare function expandGlobPatterns(cwd: string, includePatterns: string[], excludePatterns: string[], locale: string, locales: string[], transformPatterns?: TransformOption | string | TransformOption[], compositePatterns?: string[]): {
25
26
  resolvedPaths: string[];
@@ -58,6 +58,7 @@ export function resolveFiles(files, locale, locales, cwd, compositePatterns) {
58
58
  resolvedPaths: result,
59
59
  placeholderPaths: placeholderResult,
60
60
  transformPaths: transformPaths,
61
+ includeSourceCodeContext: files.gt?.includeSourceCodeContext,
61
62
  };
62
63
  }
63
64
  // Helper function to expand glob patterns
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "2.10.7";
1
+ export declare const PACKAGE_VERSION = "2.10.8";
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
- export const PACKAGE_VERSION = '2.10.7';
2
+ export const PACKAGE_VERSION = '2.10.8';
@@ -15,7 +15,7 @@ export async function aggregateInlineTranslations(options, settings, library) {
15
15
  ]);
16
16
  }
17
17
  // ---- CREATING UPDATES ---- //
18
- const { updates, errors, warnings } = await createUpdates(options, settings.src, options.dictionary, library, false, settings.parsingOptions, settings.options?.includeSourceCodeContext ?? false);
18
+ const { updates, errors, warnings } = await createUpdates(options, settings.src, options.dictionary, library, false, settings.parsingOptions, settings.files?.includeSourceCodeContext ?? false);
19
19
  if (warnings.length > 0) {
20
20
  logger.warn(chalk.yellow(`CLI tool encountered ${warnings.length} warnings while scanning for translatable content.\n` +
21
21
  warnings
@@ -10,7 +10,7 @@ import { Libraries } from '../types/libraries.js';
10
10
  */
11
11
  async function runValidation(settings, pkg, files) {
12
12
  if (files && files.length > 0) {
13
- return createInlineUpdates(pkg, true, files, settings.parsingOptions, settings.options?.includeSourceCodeContext ?? false);
13
+ return createInlineUpdates(pkg, true, files, settings.parsingOptions, settings.files?.includeSourceCodeContext ?? false);
14
14
  }
15
15
  // Full project validation
16
16
  // Use local variable to avoid mutating caller's settings object
@@ -23,7 +23,7 @@ async function runValidation(settings, pkg, files) {
23
23
  './dictionary.ts',
24
24
  './src/dictionary.ts',
25
25
  ]);
26
- return createUpdates(settings, settings.src, dictionary, pkg, true, settings.parsingOptions, settings.options?.includeSourceCodeContext ?? false);
26
+ return createUpdates(settings, settings.src, dictionary, pkg, true, settings.parsingOptions, settings.files?.includeSourceCodeContext ?? false);
27
27
  }
28
28
  /**
29
29
  * Parse file path from error/warning string in withLocation format: "filepath (line:col): message"
@@ -142,6 +142,7 @@ export type FilesOptions = {
142
142
  } & {
143
143
  gt?: {
144
144
  output: string;
145
+ includeSourceCodeContext?: boolean;
145
146
  };
146
147
  };
147
148
  export type Settings = {
@@ -158,6 +159,7 @@ export type Settings = {
158
159
  resolvedPaths: ResolvedFiles;
159
160
  placeholderPaths: ResolvedFiles;
160
161
  transformPaths: TransformFiles;
162
+ includeSourceCodeContext?: boolean;
161
163
  };
162
164
  stageTranslations: boolean;
163
165
  publish: boolean;
@@ -212,7 +214,6 @@ export type AdditionalOptions = {
212
214
  replace: string;
213
215
  }>;
214
216
  experimentalCanonicalLocaleKeys?: boolean;
215
- includeSourceCodeContext?: boolean;
216
217
  };
217
218
  export type SharedStaticAssetsConfig = {
218
219
  include: string | string[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gt",
3
- "version": "2.10.7",
3
+ "version": "2.10.8",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "files": [