Skip to content

Commit edef49a

Browse files
committed
chore: import ordering
1 parent e5fa555 commit edef49a

7 files changed

Lines changed: 21 additions & 24 deletions

File tree

__tests__/fixtures/openai/methods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { RequestMethodCaller } from '@block65/rest-client';
2+
import type { Simplify } from 'type-fest';
13
import type {
24
ListEnginesResponse,
35
Engine,
@@ -33,8 +35,6 @@ import type {
3335
CreateModerationRequest,
3436
CreateModerationResponse,
3537
} from './models.js';
36-
import type { Simplify } from 'type-fest';
37-
import type { RequestMethodCaller } from '@block65/rest-client';
3838

3939
/**
4040
* listEngines

__tests__/fixtures/openai/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2023-03-29T04:57:23.895Z
6+
* Generated on 2023-03-29T05:05:26.967Z
77
*
88
*/
99
export type DeleteModelResponse = {

__tests__/fixtures/petstore/methods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type { FindPetsCommandQuery, Pet, NewPet } from './models.js';
2-
import type { Simplify } from 'type-fest';
31
import type { RequestMethodCaller } from '@block65/rest-client';
2+
import type { Simplify } from 'type-fest';
3+
import type { FindPetsCommandQuery, Pet, NewPet } from './models.js';
44

55
/**
66
* Returns all pets from the system that the user has access to

__tests__/fixtures/petstore/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2023-03-29T04:57:18.928Z
6+
* Generated on 2023-03-29T05:05:21.979Z
77
*
88
*/
99
export type NewPet = {

__tests__/fixtures/test1/methods.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import type { RequestMethodCaller } from '@block65/rest-client';
2+
import type { Simplify } from 'type-fest';
13
import type {
24
LongRunningOperation,
35
BillingAccountList,
@@ -19,8 +21,6 @@ import type {
1921
UpdateBillingSubscriptionRequest,
2022
UpdateBillingSubscriptionPromoCodeRequest,
2123
} from './models.js';
22-
import type { Simplify } from 'type-fest';
23-
import type { RequestMethodCaller } from '@block65/rest-client';
2424

2525
/**
2626
* getOperationCommand

__tests__/fixtures/test1/models.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* WARN: Do not edit directly.
55
*
6-
* Generated on 2023-03-29T04:57:20.985Z
6+
* Generated on 2023-03-29T05:05:24.080Z
77
*
88
*/
99
export type Uuid = string;

lib/process-document.ts

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,18 @@ export async function processOpenApiDocument(
2525
tags?: string[] | undefined,
2626
): Promise<void> {
2727
const refs = await $RefParser.default.resolve(schema);
28-
// const schema = (await $RefParser.default.dereference(
29-
// rawSchema,
30-
// )) as OpenAPIV3.Document;
28+
29+
entryFile.addImportDeclaration({
30+
namedImports: ['RequestMethodCaller'],
31+
moduleSpecifier: '@block65/rest-client',
32+
isTypeOnly: true,
33+
});
34+
35+
entryFile.addImportDeclaration({
36+
namedImports: ['Simplify'],
37+
moduleSpecifier: 'type-fest',
38+
isTypeOnly: true,
39+
});
3140

3241
const typesModuleSpecifier =
3342
`./${typesFile.getBaseNameWithoutExtension()}.js` ||
@@ -59,18 +68,6 @@ export async function processOpenApiDocument(
5968
}
6069
};
6170

62-
entryFile.addImportDeclaration({
63-
namedImports: ['Simplify'],
64-
moduleSpecifier: 'type-fest',
65-
isTypeOnly: true,
66-
});
67-
68-
entryFile.addImportDeclaration({
69-
namedImports: ['RequestMethodCaller'],
70-
moduleSpecifier: '@block65/rest-client',
71-
isTypeOnly: true,
72-
});
73-
7471
const typesAndInterfaces = new Map<
7572
string,
7673
InterfaceDeclaration | TypeAliasDeclaration

0 commit comments

Comments
 (0)