gtx-cli 2.6.21 → 2.6.22

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.6.22
4
+
5
+ ### Patch Changes
6
+
7
+ - [#1029](https://github.com/generaltranslation/gt/pull/1029) [`c3dcd6f`](https://github.com/generaltranslation/gt/commit/c3dcd6f9390e8516c6c0c1eee373e587b38c4772) Thanks [@ErnestM1234](https://github.com/ErnestM1234)! - fix: compatability interface issue with types
8
+
3
9
  ## 2.6.21
4
10
 
5
11
  ### Patch Changes
@@ -4,3 +4,4 @@
4
4
  */
5
5
  export { getValidateJson } from './translation/validate.js';
6
6
  export type { ValidationResult, ValidationMessage, ValidationLevel, } from './translation/validate.js';
7
+ export { Libraries, GTLibrary, InlineLibrary, ReactLibrary, GT_LIBRARIES, INLINE_LIBRARIES, REACT_LIBRARIES, GT_LIBRARIES_UPSTREAM, } from './types/libraries.js';
package/dist/functions.js CHANGED
@@ -3,3 +3,4 @@
3
3
  * Import from 'gtx-cli/functions' to access these APIs.
4
4
  */
5
5
  export { getValidateJson } from './translation/validate.js';
6
+ export { Libraries, GT_LIBRARIES, INLINE_LIBRARIES, REACT_LIBRARIES, GT_LIBRARIES_UPSTREAM, } from './types/libraries.js';
@@ -1 +1 @@
1
- export declare const PACKAGE_VERSION = "2.6.21";
1
+ export declare const PACKAGE_VERSION = "2.6.22";
@@ -1,2 +1,2 @@
1
1
  // This file is auto-generated. Do not edit manually.
2
- export const PACKAGE_VERSION = '2.6.21';
2
+ export const PACKAGE_VERSION = '2.6.22';
@@ -7,6 +7,6 @@ import { Libraries } from '../../types/libraries.js';
7
7
  * @param options - The options object
8
8
  * @returns An object containing the updates and errors
9
9
  */
10
- export declare function wrapContentNext(options: WrapOptions, pkg: typeof Libraries.GT_NEXT, errors: string[], warnings: string[]): Promise<{
10
+ export declare function wrapContentNext(options: WrapOptions, pkg: `${typeof Libraries.GT_NEXT}`, errors: string[], warnings: string[]): Promise<{
11
11
  filesUpdated: string[];
12
12
  }>;
@@ -7,6 +7,6 @@ import { Libraries } from '../../types/libraries.js';
7
7
  * @param options - The options object
8
8
  * @returns An object containing the updates and errors
9
9
  */
10
- export declare function wrapContentReact(options: WrapOptions, pkg: typeof Libraries.GT_REACT, framework: SupportedFrameworks, errors: string[], warnings: string[]): Promise<{
10
+ export declare function wrapContentReact(options: WrapOptions, pkg: `${typeof Libraries.GT_REACT}`, framework: SupportedFrameworks, errors: string[], warnings: string[]): Promise<{
11
11
  filesUpdated: string[];
12
12
  }>;
@@ -1,5 +1,5 @@
1
- import { Framework, Options, Settings } from '../types/index.js';
2
- import { InlineLibrary } from '../types/libraries.js';
1
+ import { Options, Settings } from '../types/index.js';
2
+ import { InlineLibrary, Libraries } from '../types/libraries.js';
3
3
  export type ValidationLevel = 'error' | 'warning';
4
4
  export type ValidationMessage = {
5
5
  level: ValidationLevel;
@@ -10,5 +10,5 @@ export type ValidationResult = Record<string, ValidationMessage[]>;
10
10
  * Programmatic API for validation - returns structured results instead of logging/exiting.
11
11
  * Equivalent to running `gtx-cli validate` but returns data.
12
12
  */
13
- export declare function getValidateJson(settings: Options & Settings, pkg: Framework, files?: string[]): Promise<ValidationResult>;
13
+ export declare function getValidateJson(settings: Options & Settings, pkg: `${typeof Libraries.GT_REACT}` | `${typeof Libraries.GT_NEXT}` | `${typeof Libraries.GT_REACT_NATIVE}`, files?: string[]): Promise<ValidationResult>;
14
14
  export declare function validateProject(settings: Options & Settings, pkg: InlineLibrary, files?: string[]): Promise<void>;
@@ -4,6 +4,7 @@ import findFilepath from '../fs/findFilepath.js';
4
4
  import { logger } from '../console/logger.js';
5
5
  import { createUpdates } from './parse.js';
6
6
  import { createInlineUpdates } from '../react/parse/createInlineUpdates.js';
7
+ import { Libraries } from '../types/libraries.js';
7
8
  /**
8
9
  * Shared validation logic - returns raw results from createUpdates/createInlineUpdates
9
10
  */
@@ -49,8 +50,15 @@ function parseFileFromMessage(msg) {
49
50
  * Programmatic API for validation - returns structured results instead of logging/exiting.
50
51
  * Equivalent to running `gtx-cli validate` but returns data.
51
52
  */
52
- export async function getValidateJson(settings, pkg, files) {
53
- const { errors, warnings } = await runValidation(settings, pkg, files);
53
+ export async function getValidateJson(settings,
54
+ // TODO: fix compatability more generally so do not have to do this
55
+ pkg, files) {
56
+ const validatedPkg = pkg === Libraries.GT_NEXT
57
+ ? Libraries.GT_NEXT
58
+ : pkg === Libraries.GT_REACT_NATIVE
59
+ ? Libraries.GT_REACT_NATIVE
60
+ : Libraries.GT_REACT;
61
+ const { errors, warnings } = await runValidation(settings, validatedPkg, files);
54
62
  const result = {};
55
63
  const addMessage = (file, level, message) => {
56
64
  if (!result[file]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gtx-cli",
3
- "version": "2.6.21",
3
+ "version": "2.6.22",
4
4
  "main": "dist/index.js",
5
5
  "bin": "dist/main.js",
6
6
  "files": [