Skip to content

Commit 495684c

Browse files
committed
feat(parser): move transforms to a separate pass
1 parent b2ff2f0 commit 495684c

File tree

263 files changed

+24254
-8316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+24254
-8316
lines changed

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@ coverage
2222
test/generated
2323
test/e2e/generated
2424

25+
# debug files
26+
debug
27+
openapi-ts-debug-*
2528
# error files
29+
logs
2630
openapi-ts-error-*
2731

2832
# But DO NOT ignore generated snapshots!

packages/openapi-ts-tests/test/2.0.x.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ describe(`OpenAPI ${version}`, () => {
263263
},
264264
{
265265
config: createConfig({
266-
input: 'read-write-only.yaml',
267-
output: 'read-write-only',
266+
input: 'transforms-read-write.yaml',
267+
output: 'transforms-read-write',
268268
plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
269269
}),
270270
description: 'handles read-only and write-only types',

packages/openapi-ts-tests/test/3.0.x.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,8 +522,8 @@ describe(`OpenAPI ${version}`, () => {
522522
},
523523
{
524524
config: createConfig({
525-
input: 'read-write-only.yaml',
526-
output: 'read-write-only',
525+
input: 'transforms-read-write.yaml',
526+
output: 'transforms-read-write',
527527
plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
528528
}),
529529
description: 'handles read-only and write-only types',

packages/openapi-ts-tests/test/3.1.x.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -602,8 +602,8 @@ describe(`OpenAPI ${version}`, () => {
602602
},
603603
{
604604
config: createConfig({
605-
input: 'read-write-only.yaml',
606-
output: 'read-write-only',
605+
input: 'transforms-read-write.yaml',
606+
output: 'transforms-read-write',
607607
plugins: ['@hey-api/client-fetch', '@hey-api/typescript'],
608608
}),
609609
description: 'handles read-only and write-only types',

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/default/types.gen.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ export type ModelWithReference = {
271271
prop?: ModelWithProperties;
272272
};
273273

274-
/**
275-
* This is a model with one property containing a reference
276-
*/
277-
export type ModelWithReferenceWritable = {
278-
prop?: ModelWithPropertiesWritable;
279-
};
280-
281274
/**
282275
* This is a model with one property containing an array
283276
*/
@@ -320,20 +313,6 @@ export type ModelWithProperties = {
320313
readonly '@namespace.integer'?: number;
321314
};
322315

323-
/**
324-
* This is a model with one nested property
325-
*/
326-
export type ModelWithPropertiesWritable = {
327-
required: string;
328-
string?: string;
329-
number?: number;
330-
boolean?: boolean;
331-
reference?: ModelWithString;
332-
'property with space'?: string;
333-
default?: string;
334-
try?: string;
335-
};
336-
337316
/**
338317
* This is a model with one nested property
339318
*/
@@ -405,19 +384,6 @@ export type ModelWithPattern = {
405384
patternWithBacktick?: string;
406385
};
407386

408-
/**
409-
* This is a model that contains a some patterns
410-
*/
411-
export type ModelWithPatternWritable = {
412-
key: string;
413-
name: string;
414-
id?: string;
415-
text?: string;
416-
patternWithSingleQuotes?: string;
417-
patternWithNewline?: string;
418-
patternWithBacktick?: string;
419-
};
420-
421387
export type ParameterActivityParams = {
422388
description?: string;
423389
graduate_id?: number;

packages/openapi-ts-tests/test/__snapshots__/2.0.x/plugins/@hey-api/sdk/throwOnError/types.gen.ts

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -271,13 +271,6 @@ export type ModelWithReference = {
271271
prop?: ModelWithProperties;
272272
};
273273

274-
/**
275-
* This is a model with one property containing a reference
276-
*/
277-
export type ModelWithReferenceWritable = {
278-
prop?: ModelWithPropertiesWritable;
279-
};
280-
281274
/**
282275
* This is a model with one property containing an array
283276
*/
@@ -320,20 +313,6 @@ export type ModelWithProperties = {
320313
readonly '@namespace.integer'?: number;
321314
};
322315

323-
/**
324-
* This is a model with one nested property
325-
*/
326-
export type ModelWithPropertiesWritable = {
327-
required: string;
328-
string?: string;
329-
number?: number;
330-
boolean?: boolean;
331-
reference?: ModelWithString;
332-
'property with space'?: string;
333-
default?: string;
334-
try?: string;
335-
};
336-
337316
/**
338317
* This is a model with one nested property
339318
*/
@@ -405,19 +384,6 @@ export type ModelWithPattern = {
405384
patternWithBacktick?: string;
406385
};
407386

408-
/**
409-
* This is a model that contains a some patterns
410-
*/
411-
export type ModelWithPatternWritable = {
412-
key: string;
413-
name: string;
414-
id?: string;
415-
text?: string;
416-
patternWithSingleQuotes?: string;
417-
patternWithNewline?: string;
418-
patternWithBacktick?: string;
419-
};
420-
421387
export type ParameterActivityParams = {
422388
description?: string;
423389
graduate_id?: number;

0 commit comments

Comments
 (0)