Skip to content

Commit

Permalink
Merge branch 'main' into chore/unify-spec-parsing-1
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanshatford authored Mar 27, 2024
2 parents bf9627b + b202265 commit f0979d2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 8 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# @hey-api/openapi-ts

## 0.29.2

### Patch Changes

- Fix export types as type only when using useLegacyEnums ([#160](https://github.com/hey-api/openapi-ts/pull/160))

## 0.29.1

### Patch Changes

- Properly export enums when using useLegacyEnums ([#158](https://github.com/hey-api/openapi-ts/pull/158))

## 0.29.0

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hey-api/openapi-ts",
"version": "0.29.0",
"version": "0.29.2",
"type": "module",
"description": "Turn your OpenAPI specification into a beautiful TypeScript client",
"homepage": "https://github.com/hey-api/openapi-ts/",
Expand Down
4 changes: 4 additions & 0 deletions src/utils/write/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ const exportsModels = (config: Config, client: Client) => {
const enumExportsString = enumExports.map(name => enumName(name)).join(', ');
result = [...result, `export { ${enumExportsString} } from '${path + model.name}';`];
}
if (config.useLegacyEnums && model.enum.length) {
result = [`export { ${importedModel} } from '${path + model.name}';`];
}

return result.join('\n');
});
return output.join('\n');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ export type { DictionaryWithDictionary } from './DictionaryWithDictionary';
export type { DictionaryWithProperties } from './DictionaryWithProperties';
export type { DictionaryWithReference } from './DictionaryWithReference';
export type { DictionaryWithString } from './DictionaryWithString';
export type { Enum1 } from './Enum1';
export { Enum1 } from './Enum1';
export type { EnumFromDescription } from './EnumFromDescription';
export type { EnumWithExtensions } from './EnumWithExtensions';
export type { EnumWithNumbers } from './EnumWithNumbers';
export type { EnumWithReplacedCharacters } from './EnumWithReplacedCharacters';
export type { EnumWithStrings } from './EnumWithStrings';
export { EnumWithExtensions } from './EnumWithExtensions';
export { EnumWithNumbers } from './EnumWithNumbers';
export { EnumWithReplacedCharacters } from './EnumWithReplacedCharacters';
export { EnumWithStrings } from './EnumWithStrings';
export type { File } from './File';
export type { FreeFormObjectWithAdditionalPropertiesEqEmptyObject } from './FreeFormObjectWithAdditionalPropertiesEqEmptyObject';
export type { FreeFormObjectWithAdditionalPropertiesEqTrue } from './FreeFormObjectWithAdditionalPropertiesEqTrue';
Expand All @@ -66,8 +66,8 @@ export type { ModelWithEnumWithHyphen } from './ModelWithEnumWithHyphen';
export type { ModelWithInteger } from './ModelWithInteger';
export type { ModelWithNestedArrayEnums } from './ModelWithNestedArrayEnums';
export type { ModelWithNestedArrayEnumsData } from './ModelWithNestedArrayEnumsData';
export type { ModelWithNestedArrayEnumsDataBar } from './ModelWithNestedArrayEnumsDataBar';
export type { ModelWithNestedArrayEnumsDataFoo } from './ModelWithNestedArrayEnumsDataFoo';
export { ModelWithNestedArrayEnumsDataBar } from './ModelWithNestedArrayEnumsDataBar';
export { ModelWithNestedArrayEnumsDataFoo } from './ModelWithNestedArrayEnumsDataFoo';
export type { ModelWithNestedCompositionEnums } from './ModelWithNestedCompositionEnums';
export type { ModelWithNestedEnums } from './ModelWithNestedEnums';
export type { ModelWithNestedProperties } from './ModelWithNestedProperties';
Expand Down

0 comments on commit f0979d2

Please sign in to comment.