Skip to content

Commit

Permalink
feat: add schema descriptions and remove unused "sdk" option
Browse files Browse the repository at this point in the history
  • Loading branch information
stepan662 committed Apr 19, 2024
1 parent aa76508 commit 34c819d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 18 deletions.
9 changes: 6 additions & 3 deletions schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,37 @@
}
},
"path": {
"description": "Path to folder with localization files for push/pull commands.",
"type": "string"
},
"format": {
"description": "Format of the exported files.",
"type": "string"
},
"languages": {
"description": "List of languages to pull. Leave unspecified to export them all.",
"type": "array",
"items": {
"type": "string"
}
},
"states": {
"description": "List of translation states to include. Defaults all except untranslated.",
"type": "array",
"items": {
"enum": ["UNTRANSLATED", "TRANSLATED", "REVIEWED"]
}
},
"delimiter": {
"description": "Structure delimiter to use. By default, Tolgee interprets `.` as a nested structure. You can change the delimiter, or disable structure formatting by not specifying any value to the option.",
"type": ["string", "null"]
},
"namespaces": {
"description": "List of namespaces to pull. Defaults to all namespaces.",
"type": "array",
"items": {
"type": "string"
}
},
"sdk": {
"enum": ["react", "vue", "svelte"]
}
}
}
3 changes: 0 additions & 3 deletions src/commands/push.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,9 +175,6 @@ export default (config: Schema) =>
.name('push')
.description('Pushes translations to Tolgee')
.argument('[path]', 'Path to the files to push to Tolgee')
.addOption(
new Option('-p, --path [path]', 'Path to the files to push to Tolgee')
)
.addOption(
new Option(
'-f, --force-mode <mode>',
Expand Down
19 changes: 18 additions & 1 deletion src/schema.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,29 @@ export interface Schema {
* File glob patterns to include
*/
patterns?: string[];
/**
* Path to folder with localization files for push/pull commands.
*/
path?: string;
/**
* Format of the exported files.
*/
format?: string;
/**
* List of languages to pull. Leave unspecified to export them all.
*/
languages?: string[];
/**
* List of translation states to include. Defaults all except untranslated.
*/
states?: ("UNTRANSLATED" | "TRANSLATED" | "REVIEWED")[];
/**
* Structure delimiter to use. By default, Tolgee interprets `.` as a nested structure. You can change the delimiter, or disable structure formatting by not specifying any value to the option.
*/
delimiter?: string | null;
/**
* List of namespaces to pull. Defaults to all namespaces.
*/
namespaces?: string[];
sdk?: "react" | "vue" | "svelte";
[k: string]: unknown;
}
3 changes: 0 additions & 3 deletions test/__fixtures__/invalidTolgeeRcSdk/.tolgeerc

This file was deleted.

8 changes: 0 additions & 8 deletions test/unit/config.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -191,12 +191,4 @@ describe('.tolgeerc', () => {
cwd.mockReturnValue(testWd);
return expect(loadTolgeeRc()).rejects.toThrow('projectId');
});

it('rejects invalid SDK', async () => {
const testWd = fileURLToPath(
new URL('./invalidTolgeeRcSdk', FIXTURES_PATH)
);
cwd.mockReturnValue(testWd);
return expect(loadTolgeeRc()).rejects.toThrow('sdk');
});
});

0 comments on commit 34c819d

Please sign in to comment.