getta 1.0.26 → 1.0.27
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/README.md +1 -1
- package/dist/cjs/cli/command.cjs +1 -1
- package/dist/cjs/cli/command.cjs.map +1 -1
- package/dist/esm/cli/command.mjs +1 -1
- package/dist/esm/cli/command.mjs.map +1 -1
- package/dist/production.analysis.txt +8 -8
- package/dist/types/cjs/cli/command.d.cts +1 -1
- package/dist/types/cjs/cli/command.d.cts.map +1 -1
- package/dist/types/esm/cli/command.d.ts +1 -1
- package/dist/types/esm/cli/command.d.ts.map +1 -1
- package/dist/types/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/cli/command.test.ts +2 -2
- package/src/cli/command.ts +1 -1
- package/src/cli/handler.test.ts +1 -1
- package/src/cli.test.ts +2 -2
package/package.json
CHANGED
package/src/cli/command.test.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { describe, expect, it } from '@jest/globals';
|
|
|
2
2
|
import yargs, { type Argv } from 'yargs';
|
|
3
3
|
import * as generateOpenApiCommand from './command.ts';
|
|
4
4
|
|
|
5
|
-
describe('generate-
|
|
5
|
+
describe('generate-client command', () => {
|
|
6
6
|
it('When help is requested, then it displays the command usage and options', async () => {
|
|
7
7
|
// Arrange
|
|
8
8
|
// @ts-expect-error not important in test
|
|
@@ -18,7 +18,7 @@ describe('generate-openapi command', () => {
|
|
|
18
18
|
|
|
19
19
|
// Assert
|
|
20
20
|
expect(help).toMatchInlineSnapshot(`
|
|
21
|
-
"getta generate-
|
|
21
|
+
"getta generate-client <schema> [output]
|
|
22
22
|
|
|
23
23
|
Generate a typed Getta client from an OpenAPI 3.x document.
|
|
24
24
|
|
package/src/cli/command.ts
CHANGED
|
@@ -26,6 +26,6 @@ export const builder: CommandBuilder<object, GenerateOpenApiArguments> = yargs =
|
|
|
26
26
|
return true;
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
export const command = 'generate-
|
|
29
|
+
export const command = 'generate-client <schema> [output]';
|
|
30
30
|
export const describe = 'Generate a typed Getta client from an OpenAPI 3.x document.';
|
|
31
31
|
export { handler } from './handler.ts';
|
package/src/cli/handler.test.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { tmpdir } from 'node:os';
|
|
|
4
4
|
import { join } from 'node:path';
|
|
5
5
|
import { handler } from './handler.ts';
|
|
6
6
|
|
|
7
|
-
describe('generate-
|
|
7
|
+
describe('generate-client handler', () => {
|
|
8
8
|
let directory: string | undefined;
|
|
9
9
|
let originalWorkingDirectory: string | undefined;
|
|
10
10
|
|
package/src/cli.test.ts
CHANGED
|
@@ -26,14 +26,14 @@ describe('runGettaCli', () => {
|
|
|
26
26
|
}
|
|
27
27
|
});
|
|
28
28
|
|
|
29
|
-
it('When invoked with generate-
|
|
29
|
+
it('When invoked with generate-client arguments, then it runs the command and writes the client', async () => {
|
|
30
30
|
// Arrange
|
|
31
31
|
directory = await mkdtemp(join(tmpdir(), 'getta-cli-'));
|
|
32
32
|
originalWorkingDirectory = process.cwd();
|
|
33
33
|
originalArguments = process.argv;
|
|
34
34
|
process.chdir(directory);
|
|
35
35
|
await writeFile('spec.json', JSON.stringify({ openapi: '3.0.0', paths: {} }));
|
|
36
|
-
process.argv = ['node', 'getta', 'generate-
|
|
36
|
+
process.argv = ['node', 'getta', 'generate-client', 'spec.json', 'generated.ts'];
|
|
37
37
|
|
|
38
38
|
// Act
|
|
39
39
|
await runGettaCli();
|