fork of hey-api/openapi-ts because I need some additional things

Merge pull request #1206 from hey-api/changeset-release/main

Version Packages

authored by

Lubos and committed by
GitHub
fad7803f 4b0f2059

+342 -172
-170
.changeset/blue-bikes-approve.md
··· 1 - --- 2 - '@hey-api/openapi-ts': minor 3 - '@hey-api/docs': minor 4 - --- 5 - 6 - feat: make plugins first-class citizens 7 - 8 - This release makes plugins first-class citizens. In order to achieve that, the following breaking changes were introduced. 9 - 10 - ### Removed CLI options 11 - 12 - The `--types`, `--schemas`, and `--services` CLI options have been removed. You can list which plugins you'd like to use explicitly by passing a list of plugins as `--plugins <plugin1> <plugin2>` 13 - 14 - ### Removed `*.export` option 15 - 16 - Previously, you could explicitly disable export of certain artifacts using the `*.export` option or its shorthand variant. These were both removed. You can now disable export of specific artifacts by manually defining an array of `plugins` and excluding the unwanted plugin. 17 - 18 - ::: code-group 19 - 20 - ```js [shorthand] 21 - export default { 22 - client: '@hey-api/client-fetch', 23 - input: 'path/to/openapi.json', 24 - output: 'src/client', 25 - schemas: false, // [!code --] 26 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 27 - }; 28 - ``` 29 - 30 - ```js [*.export] 31 - export default { 32 - client: '@hey-api/client-fetch', 33 - input: 'path/to/openapi.json', 34 - output: 'src/client', 35 - schemas: { 36 - export: false, // [!code --] 37 - }, 38 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 39 - }; 40 - ``` 41 - 42 - ::: 43 - 44 - ### Renamed `schemas.name` option 45 - 46 - Each plugin definition contains a `name` field. This was conflicting with the `schemas.name` option. As a result, it has been renamed to `nameBuilder`. 47 - 48 - ```js 49 - export default { 50 - client: '@hey-api/client-fetch', 51 - input: 'path/to/openapi.json', 52 - output: 'src/client', 53 - schemas: { 54 - name: (name) => `${name}Schema`, // [!code --] 55 - }, 56 - plugins: [ 57 - // ...other plugins 58 - { 59 - nameBuilder: (name) => `${name}Schema`, // [!code ++] 60 - name: '@hey-api/schemas', 61 - }, 62 - ], 63 - }; 64 - ``` 65 - 66 - ### Removed `services.include` shorthand option 67 - 68 - Previously, you could use a string value as a shorthand for the `services.include` configuration option. You can now achieve the same result using the `include` option. 69 - 70 - ```js 71 - export default { 72 - client: '@hey-api/client-fetch', 73 - input: 'path/to/openapi.json', 74 - output: 'src/client', 75 - services: '^MySchema', // [!code --] 76 - plugins: [ 77 - // ...other plugins 78 - { 79 - include: '^MySchema', // [!code ++] 80 - name: '@hey-api/services', 81 - }, 82 - ], 83 - }; 84 - ``` 85 - 86 - ### Renamed `services.name` option 87 - 88 - Each plugin definition contains a `name` field. This was conflicting with the `services.name` option. As a result, it has been renamed to `serviceNameBuilder`. 89 - 90 - ```js 91 - export default { 92 - client: '@hey-api/client-fetch', 93 - input: 'path/to/openapi.json', 94 - output: 'src/client', 95 - services: { 96 - name: '{{name}}Service', // [!code --] 97 - }, 98 - plugins: [ 99 - // ...other plugins 100 - { 101 - serviceNameBuilder: '{{name}}Service', // [!code ++] 102 - name: '@hey-api/services', 103 - }, 104 - ], 105 - }; 106 - ``` 107 - 108 - ### Renamed `types.dates` option 109 - 110 - Previously, you could set `types.dates` to a boolean or a string value, depending on whether you wanted to transform only type strings into dates, or runtime code too. Many people found these options confusing, so they have been simplified to a boolean and extracted into a separate `@hey-api/transformers` plugin. 111 - 112 - ```js 113 - export default { 114 - client: '@hey-api/client-fetch', 115 - input: 'path/to/openapi.json', 116 - output: 'src/client', 117 - types: { 118 - dates: 'types+transform', // [!code --] 119 - }, 120 - plugins: [ 121 - // ...other plugins 122 - { 123 - dates: true, // [!code ++] 124 - name: '@hey-api/transformers', 125 - }, 126 - ], 127 - }; 128 - ``` 129 - 130 - ### Removed `types.include` shorthand option 131 - 132 - Previously, you could use a string value as a shorthand for the `types.include` configuration option. You can now achieve the same result using the `include` option. 133 - 134 - ```js 135 - export default { 136 - client: '@hey-api/client-fetch', 137 - input: 'path/to/openapi.json', 138 - output: 'src/client', 139 - types: '^MySchema', // [!code --] 140 - plugins: [ 141 - // ...other plugins 142 - { 143 - include: '^MySchema', // [!code ++] 144 - name: '@hey-api/types', 145 - }, 146 - ], 147 - }; 148 - ``` 149 - 150 - ### Renamed `types.name` option 151 - 152 - Each plugin definition contains a `name` field. This was conflicting with the `types.name` option. As a result, it has been renamed to `style`. 153 - 154 - ```js 155 - export default { 156 - client: '@hey-api/client-fetch', 157 - input: 'path/to/openapi.json', 158 - output: 'src/client', 159 - types: { 160 - name: 'PascalCase', // [!code --] 161 - }, 162 - plugins: [ 163 - // ...other plugins 164 - { 165 - name: '@hey-api/types', 166 - style: 'PascalCase', // [!code ++] 167 - }, 168 - ], 169 - }; 170 - ```
+170
docs/CHANGELOG.md
··· 1 1 # @hey-api/docs 2 2 3 + ## 0.7.0 4 + 5 + ### Minor Changes 6 + 7 + - [#1201](https://github.com/hey-api/openapi-ts/pull/1201) [`972a93a`](https://github.com/hey-api/openapi-ts/commit/972a93a91a945cc9ead73c08bb0fa9ee120433ba) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: make plugins first-class citizens 8 + 9 + This release makes plugins first-class citizens. In order to achieve that, the following breaking changes were introduced. 10 + 11 + ### Removed CLI options 12 + 13 + The `--types`, `--schemas`, and `--services` CLI options have been removed. You can list which plugins you'd like to use explicitly by passing a list of plugins as `--plugins <plugin1> <plugin2>` 14 + 15 + ### Removed `*.export` option 16 + 17 + Previously, you could explicitly disable export of certain artifacts using the `*.export` option or its shorthand variant. These were both removed. You can now disable export of specific artifacts by manually defining an array of `plugins` and excluding the unwanted plugin. 18 + 19 + ::: code-group 20 + 21 + ```js [shorthand] 22 + export default { 23 + client: '@hey-api/client-fetch', 24 + input: 'path/to/openapi.json', 25 + output: 'src/client', 26 + schemas: false, // [!code --] 27 + plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 28 + }; 29 + ``` 30 + 31 + ```js [*.export] 32 + export default { 33 + client: '@hey-api/client-fetch', 34 + input: 'path/to/openapi.json', 35 + output: 'src/client', 36 + schemas: { 37 + export: false, // [!code --] 38 + }, 39 + plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 40 + }; 41 + ``` 42 + 43 + ::: 44 + 45 + ### Renamed `schemas.name` option 46 + 47 + Each plugin definition contains a `name` field. This was conflicting with the `schemas.name` option. As a result, it has been renamed to `nameBuilder`. 48 + 49 + ```js 50 + export default { 51 + client: '@hey-api/client-fetch', 52 + input: 'path/to/openapi.json', 53 + output: 'src/client', 54 + schemas: { 55 + name: (name) => `${name}Schema`, // [!code --] 56 + }, 57 + plugins: [ 58 + // ...other plugins 59 + { 60 + nameBuilder: (name) => `${name}Schema`, // [!code ++] 61 + name: '@hey-api/schemas', 62 + }, 63 + ], 64 + }; 65 + ``` 66 + 67 + ### Removed `services.include` shorthand option 68 + 69 + Previously, you could use a string value as a shorthand for the `services.include` configuration option. You can now achieve the same result using the `include` option. 70 + 71 + ```js 72 + export default { 73 + client: '@hey-api/client-fetch', 74 + input: 'path/to/openapi.json', 75 + output: 'src/client', 76 + services: '^MySchema', // [!code --] 77 + plugins: [ 78 + // ...other plugins 79 + { 80 + include: '^MySchema', // [!code ++] 81 + name: '@hey-api/services', 82 + }, 83 + ], 84 + }; 85 + ``` 86 + 87 + ### Renamed `services.name` option 88 + 89 + Each plugin definition contains a `name` field. This was conflicting with the `services.name` option. As a result, it has been renamed to `serviceNameBuilder`. 90 + 91 + ```js 92 + export default { 93 + client: '@hey-api/client-fetch', 94 + input: 'path/to/openapi.json', 95 + output: 'src/client', 96 + services: { 97 + name: '{{name}}Service', // [!code --] 98 + }, 99 + plugins: [ 100 + // ...other plugins 101 + { 102 + serviceNameBuilder: '{{name}}Service', // [!code ++] 103 + name: '@hey-api/services', 104 + }, 105 + ], 106 + }; 107 + ``` 108 + 109 + ### Renamed `types.dates` option 110 + 111 + Previously, you could set `types.dates` to a boolean or a string value, depending on whether you wanted to transform only type strings into dates, or runtime code too. Many people found these options confusing, so they have been simplified to a boolean and extracted into a separate `@hey-api/transformers` plugin. 112 + 113 + ```js 114 + export default { 115 + client: '@hey-api/client-fetch', 116 + input: 'path/to/openapi.json', 117 + output: 'src/client', 118 + types: { 119 + dates: 'types+transform', // [!code --] 120 + }, 121 + plugins: [ 122 + // ...other plugins 123 + { 124 + dates: true, // [!code ++] 125 + name: '@hey-api/transformers', 126 + }, 127 + ], 128 + }; 129 + ``` 130 + 131 + ### Removed `types.include` shorthand option 132 + 133 + Previously, you could use a string value as a shorthand for the `types.include` configuration option. You can now achieve the same result using the `include` option. 134 + 135 + ```js 136 + export default { 137 + client: '@hey-api/client-fetch', 138 + input: 'path/to/openapi.json', 139 + output: 'src/client', 140 + types: '^MySchema', // [!code --] 141 + plugins: [ 142 + // ...other plugins 143 + { 144 + include: '^MySchema', // [!code ++] 145 + name: '@hey-api/types', 146 + }, 147 + ], 148 + }; 149 + ``` 150 + 151 + ### Renamed `types.name` option 152 + 153 + Each plugin definition contains a `name` field. This was conflicting with the `types.name` option. As a result, it has been renamed to `style`. 154 + 155 + ```js 156 + export default { 157 + client: '@hey-api/client-fetch', 158 + input: 'path/to/openapi.json', 159 + output: 'src/client', 160 + types: { 161 + name: 'PascalCase', // [!code --] 162 + }, 163 + plugins: [ 164 + // ...other plugins 165 + { 166 + name: '@hey-api/types', 167 + style: 'PascalCase', // [!code ++] 168 + }, 169 + ], 170 + }; 171 + ``` 172 + 3 173 ## 0.6.2 4 174 5 175 ### Patch Changes
+1 -1
docs/package.json
··· 1 1 { 2 2 "name": "@hey-api/docs", 3 - "version": "0.6.2", 3 + "version": "0.7.0", 4 4 "description": "Documentation for OpenaAPI TypeScript.", 5 5 "private": true, 6 6 "type": "module",
+170
packages/openapi-ts/CHANGELOG.md
··· 1 1 # @hey-api/openapi-ts 2 2 3 + ## 0.54.0 4 + 5 + ### Minor Changes 6 + 7 + - [#1201](https://github.com/hey-api/openapi-ts/pull/1201) [`972a93a`](https://github.com/hey-api/openapi-ts/commit/972a93a91a945cc9ead73c08bb0fa9ee120433ba) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: make plugins first-class citizens 8 + 9 + This release makes plugins first-class citizens. In order to achieve that, the following breaking changes were introduced. 10 + 11 + ### Removed CLI options 12 + 13 + The `--types`, `--schemas`, and `--services` CLI options have been removed. You can list which plugins you'd like to use explicitly by passing a list of plugins as `--plugins <plugin1> <plugin2>` 14 + 15 + ### Removed `*.export` option 16 + 17 + Previously, you could explicitly disable export of certain artifacts using the `*.export` option or its shorthand variant. These were both removed. You can now disable export of specific artifacts by manually defining an array of `plugins` and excluding the unwanted plugin. 18 + 19 + ::: code-group 20 + 21 + ```js [shorthand] 22 + export default { 23 + client: '@hey-api/client-fetch', 24 + input: 'path/to/openapi.json', 25 + output: 'src/client', 26 + schemas: false, // [!code --] 27 + plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 28 + }; 29 + ``` 30 + 31 + ```js [*.export] 32 + export default { 33 + client: '@hey-api/client-fetch', 34 + input: 'path/to/openapi.json', 35 + output: 'src/client', 36 + schemas: { 37 + export: false, // [!code --] 38 + }, 39 + plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 40 + }; 41 + ``` 42 + 43 + ::: 44 + 45 + ### Renamed `schemas.name` option 46 + 47 + Each plugin definition contains a `name` field. This was conflicting with the `schemas.name` option. As a result, it has been renamed to `nameBuilder`. 48 + 49 + ```js 50 + export default { 51 + client: '@hey-api/client-fetch', 52 + input: 'path/to/openapi.json', 53 + output: 'src/client', 54 + schemas: { 55 + name: (name) => `${name}Schema`, // [!code --] 56 + }, 57 + plugins: [ 58 + // ...other plugins 59 + { 60 + nameBuilder: (name) => `${name}Schema`, // [!code ++] 61 + name: '@hey-api/schemas', 62 + }, 63 + ], 64 + }; 65 + ``` 66 + 67 + ### Removed `services.include` shorthand option 68 + 69 + Previously, you could use a string value as a shorthand for the `services.include` configuration option. You can now achieve the same result using the `include` option. 70 + 71 + ```js 72 + export default { 73 + client: '@hey-api/client-fetch', 74 + input: 'path/to/openapi.json', 75 + output: 'src/client', 76 + services: '^MySchema', // [!code --] 77 + plugins: [ 78 + // ...other plugins 79 + { 80 + include: '^MySchema', // [!code ++] 81 + name: '@hey-api/services', 82 + }, 83 + ], 84 + }; 85 + ``` 86 + 87 + ### Renamed `services.name` option 88 + 89 + Each plugin definition contains a `name` field. This was conflicting with the `services.name` option. As a result, it has been renamed to `serviceNameBuilder`. 90 + 91 + ```js 92 + export default { 93 + client: '@hey-api/client-fetch', 94 + input: 'path/to/openapi.json', 95 + output: 'src/client', 96 + services: { 97 + name: '{{name}}Service', // [!code --] 98 + }, 99 + plugins: [ 100 + // ...other plugins 101 + { 102 + serviceNameBuilder: '{{name}}Service', // [!code ++] 103 + name: '@hey-api/services', 104 + }, 105 + ], 106 + }; 107 + ``` 108 + 109 + ### Renamed `types.dates` option 110 + 111 + Previously, you could set `types.dates` to a boolean or a string value, depending on whether you wanted to transform only type strings into dates, or runtime code too. Many people found these options confusing, so they have been simplified to a boolean and extracted into a separate `@hey-api/transformers` plugin. 112 + 113 + ```js 114 + export default { 115 + client: '@hey-api/client-fetch', 116 + input: 'path/to/openapi.json', 117 + output: 'src/client', 118 + types: { 119 + dates: 'types+transform', // [!code --] 120 + }, 121 + plugins: [ 122 + // ...other plugins 123 + { 124 + dates: true, // [!code ++] 125 + name: '@hey-api/transformers', 126 + }, 127 + ], 128 + }; 129 + ``` 130 + 131 + ### Removed `types.include` shorthand option 132 + 133 + Previously, you could use a string value as a shorthand for the `types.include` configuration option. You can now achieve the same result using the `include` option. 134 + 135 + ```js 136 + export default { 137 + client: '@hey-api/client-fetch', 138 + input: 'path/to/openapi.json', 139 + output: 'src/client', 140 + types: '^MySchema', // [!code --] 141 + plugins: [ 142 + // ...other plugins 143 + { 144 + include: '^MySchema', // [!code ++] 145 + name: '@hey-api/types', 146 + }, 147 + ], 148 + }; 149 + ``` 150 + 151 + ### Renamed `types.name` option 152 + 153 + Each plugin definition contains a `name` field. This was conflicting with the `types.name` option. As a result, it has been renamed to `style`. 154 + 155 + ```js 156 + export default { 157 + client: '@hey-api/client-fetch', 158 + input: 'path/to/openapi.json', 159 + output: 'src/client', 160 + types: { 161 + name: 'PascalCase', // [!code --] 162 + }, 163 + plugins: [ 164 + // ...other plugins 165 + { 166 + name: '@hey-api/types', 167 + style: 'PascalCase', // [!code ++] 168 + }, 169 + ], 170 + }; 171 + ``` 172 + 3 173 ## 0.53.12 4 174 5 175 ### Patch Changes
+1 -1
packages/openapi-ts/package.json
··· 1 1 { 2 2 "name": "@hey-api/openapi-ts", 3 - "version": "0.53.12", 3 + "version": "0.54.0", 4 4 "description": "🚀 The OpenAPI to TypeScript codegen. Generate clients, SDKs, validators, and more.", 5 5 "homepage": "https://heyapi.dev/", 6 6 "repository": {