gtx-cli 2.5.19 → 2.5.21
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,18 @@
|
|
|
1
1
|
# gtx-cli
|
|
2
2
|
|
|
3
|
+
## 2.5.21
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#868](https://github.com/generaltranslation/gt/pull/868) [`34499ce`](https://github.com/generaltranslation/gt/commit/34499ce8407d4b96dea1b4db7a92225e8118fc56) Thanks [@fernando-aviles](https://github.com/fernando-aviles)! - Removing `"openapi"` top level config, adding as option under `"options.mintlify.openapi"`. Also adding a `jsonSchema` preset for `openapi`.
|
|
8
|
+
|
|
9
|
+
## 2.5.20
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies [[`997a5df`](https://github.com/generaltranslation/gt/commit/997a5df6ac355b49a77e768935f9017af689de21)]:
|
|
14
|
+
- generaltranslation@8.0.6
|
|
15
|
+
|
|
3
16
|
## 2.5.19
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
|
@@ -132,23 +132,6 @@ export async function generateSettings(flags, cwd = process.cwd()) {
|
|
|
132
132
|
};
|
|
133
133
|
// Add additional options if provided
|
|
134
134
|
if (mergedOptions.options) {
|
|
135
|
-
// Auto-add jsonSchema include paths for configured OpenAPI specs (Mintlify)
|
|
136
|
-
if (mergedOptions.openapi?.framework === 'mintlify' &&
|
|
137
|
-
Array.isArray(mergedOptions.openapi.files) &&
|
|
138
|
-
mergedOptions.openapi.files.length) {
|
|
139
|
-
const translateFields = mergedOptions.openapi.translateFields?.length &&
|
|
140
|
-
mergedOptions.openapi.translateFields.length > 0
|
|
141
|
-
? mergedOptions.openapi.translateFields
|
|
142
|
-
: ['$..summary', '$..description'];
|
|
143
|
-
mergedOptions.options.jsonSchema = mergedOptions.options.jsonSchema || {};
|
|
144
|
-
for (const specFile of mergedOptions.openapi.files) {
|
|
145
|
-
if (!mergedOptions.options.jsonSchema[specFile]) {
|
|
146
|
-
mergedOptions.options.jsonSchema[specFile] = {
|
|
147
|
-
include: translateFields,
|
|
148
|
-
};
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
135
|
if (mergedOptions.options.jsonSchema) {
|
|
153
136
|
for (const fileGlob of Object.keys(mergedOptions.options.jsonSchema)) {
|
|
154
137
|
const jsonSchema = mergedOptions.options.jsonSchema[fileGlob];
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import { JsonSchema, YamlSchema } from '../types/index.js';
|
|
2
|
-
export declare function generatePreset(preset:
|
|
2
|
+
export declare function generatePreset(preset: JsonSchema['preset'], type: 'json'): JsonSchema;
|
|
3
|
+
export declare function generatePreset(preset: YamlSchema['preset'], type: 'yaml'): YamlSchema;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -31,10 +31,12 @@ export type Options = {
|
|
|
31
31
|
}>;
|
|
32
32
|
};
|
|
33
33
|
export type OpenApiConfig = {
|
|
34
|
-
framework: 'mintlify';
|
|
35
34
|
files: string[];
|
|
36
35
|
translateFields?: string[];
|
|
37
36
|
};
|
|
37
|
+
export type MintlifyOptions = {
|
|
38
|
+
openapi?: OpenApiConfig;
|
|
39
|
+
};
|
|
38
40
|
export type TranslateFlags = {
|
|
39
41
|
config?: string;
|
|
40
42
|
apiKey?: string;
|
|
@@ -149,7 +151,6 @@ export type Settings = {
|
|
|
149
151
|
parsingOptions: ParsingConfigOptions;
|
|
150
152
|
branchOptions: BranchOptions;
|
|
151
153
|
sharedStaticAssets?: SharedStaticAssetsConfig;
|
|
152
|
-
openapi?: OpenApiConfig;
|
|
153
154
|
};
|
|
154
155
|
export type BranchOptions = {
|
|
155
156
|
currentBranch?: string;
|
|
@@ -164,6 +165,7 @@ export type AdditionalOptions = {
|
|
|
164
165
|
yamlSchema?: {
|
|
165
166
|
[fileGlob: string]: YamlSchema;
|
|
166
167
|
};
|
|
168
|
+
mintlify?: MintlifyOptions;
|
|
167
169
|
docsUrlPattern?: string;
|
|
168
170
|
docsImportPattern?: string;
|
|
169
171
|
excludeStaticUrls?: string[];
|
|
@@ -189,7 +191,7 @@ export type SharedStaticAssetsConfig = {
|
|
|
189
191
|
publicPath?: string;
|
|
190
192
|
};
|
|
191
193
|
export type JsonSchema = {
|
|
192
|
-
preset?: 'mintlify';
|
|
194
|
+
preset?: 'mintlify' | 'openapi';
|
|
193
195
|
include?: string[];
|
|
194
196
|
composite?: {
|
|
195
197
|
[sourceObjectPath: string]: SourceObjectOptions;
|
|
@@ -23,14 +23,13 @@ const HTTP_METHODS = new Set([
|
|
|
23
23
|
* - Warns on missing/ambiguous references but keeps behavior deterministic.
|
|
24
24
|
*/
|
|
25
25
|
export default async function processOpenApi(settings, includeFiles) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (!settings.openapi.files?.length)
|
|
26
|
+
const openapiConfig = settings.options?.mintlify?.openapi;
|
|
27
|
+
if (!openapiConfig || !openapiConfig.files?.length)
|
|
29
28
|
return;
|
|
30
29
|
if (!settings.files)
|
|
31
30
|
return;
|
|
32
31
|
const configDir = path.dirname(settings.config);
|
|
33
|
-
const specAnalyses = buildSpecAnalyses(
|
|
32
|
+
const specAnalyses = buildSpecAnalyses(openapiConfig.files, configDir);
|
|
34
33
|
if (!specAnalyses.length)
|
|
35
34
|
return;
|
|
36
35
|
const warnings = new Set();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gtx-cli",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.21",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"bin": "dist/main.js",
|
|
6
6
|
"files": [
|
|
@@ -104,7 +104,7 @@
|
|
|
104
104
|
"unified": "^11.0.5",
|
|
105
105
|
"unist-util-visit": "^5.0.0",
|
|
106
106
|
"yaml": "^2.8.0",
|
|
107
|
-
"generaltranslation": "8.0.
|
|
107
|
+
"generaltranslation": "8.0.6"
|
|
108
108
|
},
|
|
109
109
|
"devDependencies": {
|
|
110
110
|
"@babel/types": "^7.28.4",
|