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

Configure Feed

Select the types of activity you want to include in your feed.

ci: release

+279 -252
-5
.changeset/selfish-seas-add.md
··· 1 - --- 2 - "@hey-api/codegen-core": patch 3 - --- 4 - 5 - **planner**: fix duplicate import when same symbol is imported as both type and value
+9 -3
packages/codegen-core/CHANGELOG.md
··· 1 1 # @hey-api/codegen-core 2 2 3 + ## 0.6.1 4 + 5 + ### Patch Changes 6 + 7 + - **planner**: fix duplicate import when same symbol is imported as both type and value ([#3291](https://github.com/hey-api/openapi-ts/pull/3291)) ([`3c08e38`](https://github.com/hey-api/openapi-ts/commit/3c08e38b4daa5c1f4829bdfb7f088d73b0e0f1f1)) by [@copilot-swe-agent](https://github.com/apps/copilot-swe-agent) 8 + 3 9 ## 0.6.0 4 10 5 11 ### Minor Changes ··· 13 19 CommonJS entry points (`require()`, `module.exports`) are no longer supported. If you are in a CJS environment, you can still load the package dynamically using `import()` like: 14 20 15 21 ```js 16 - const { Project } = await import('@hey-api/codegen-core'); 22 + const { Project } = await import("@hey-api/codegen-core"); 17 23 ``` 18 24 19 25 If you have previously written: 20 26 21 27 ```js 22 - const { Project } = require('@hey-api/codegen-core'); 28 + const { Project } = require("@hey-api/codegen-core"); 23 29 ``` 24 30 25 31 Migrate by updating your static imports: 26 32 27 33 ```js 28 - import { Project } from '@hey-api/codegen-core'; 34 + import { Project } from "@hey-api/codegen-core"; 29 35 ``` 30 36 31 37 If your environment cannot use ESM, pin to a previous version.
+1 -1
packages/codegen-core/package.json
··· 1 1 { 2 2 "name": "@hey-api/codegen-core", 3 - "version": "0.6.0", 3 + "version": "0.6.1", 4 4 "description": "🧱 TypeScript framework for generating files.", 5 5 "keywords": [ 6 6 "codegen",
+9
packages/openapi-python/CHANGELOG.md
··· 1 1 # @hey-api/openapi-python 2 2 3 + ## 0.0.4 4 + 5 + ### Patch Changes 6 + 7 + ### Updated Dependencies: 8 + 9 + - @hey-api/codegen-core@0.6.1 10 + - @hey-api/shared@0.1.1 11 + 3 12 ## 0.0.3 4 13 5 14 ### Patch Changes
+1 -1
packages/openapi-python/package.json
··· 1 1 { 2 2 "name": "@hey-api/openapi-python", 3 - "version": "0.0.3", 3 + "version": "0.0.4", 4 4 "private": true, 5 5 "description": "🐍 OpenAPI to Python codegen.", 6 6 "keywords": [
+249 -240
packages/openapi-ts/CHANGELOG.md
··· 1 1 # @hey-api/openapi-ts 2 2 3 + ## 0.91.1 4 + 5 + ### Patch Changes 6 + 7 + ### Updated Dependencies: 8 + 9 + - @hey-api/codegen-core@0.6.1 10 + - @hey-api/shared@0.1.1 11 + 3 12 ## 0.91.0 4 13 5 14 ### Minor Changes ··· 13 22 CommonJS entry points (`require()`, `module.exports`) are no longer supported. If you are in a CJS environment, you can still load the package dynamically using `import()` like: 14 23 15 24 ```js 16 - const { defineConfig } = await import('@hey-api/openapi-ts'); 25 + const { defineConfig } = await import("@hey-api/openapi-ts"); 17 26 ``` 18 27 19 28 If you have previously written: 20 29 21 30 ```js 22 - const { defineConfig } = require('@hey-api/openapi-ts'); 31 + const { defineConfig } = require("@hey-api/openapi-ts"); 23 32 ``` 24 33 25 34 Migrate by updating your static imports: 26 35 27 36 ```js 28 - import { defineConfig } from '@hey-api/openapi-ts'; 37 + import { defineConfig } from "@hey-api/openapi-ts"; 29 38 ``` 30 39 31 40 If your environment cannot use ESM, pin to a previous version. ··· 253 262 254 263 ```js 255 264 export default { 256 - input: 'hey-api/backend', // sign up at app.heyapi.dev 265 + input: "hey-api/backend", // sign up at app.heyapi.dev 257 266 output: { 258 - path: 'src/client', 267 + path: "src/client", 259 268 preferExportAll: true, 260 269 }, 261 270 }; ··· 277 286 278 287 ```js 279 288 export default { 280 - input: 'hey-api/backend', // sign up at app.heyapi.dev 289 + input: "hey-api/backend", // sign up at app.heyapi.dev 281 290 output: { 282 291 nameConflictResolver({ attempt, baseName }) { 283 292 return attempt === 0 ? baseName : `${baseName}_N${attempt + 1}`; 284 293 }, 285 - path: 'src/client', 294 + path: "src/client", 286 295 }, 287 296 }; 288 297 ``` ··· 527 536 528 537 ```js 529 538 export default { 530 - input: 'hey-api/backend', // sign up at app.heyapi.dev 539 + input: "hey-api/backend", // sign up at app.heyapi.dev 531 540 output: { 532 541 format: null, 533 542 lint: null, 534 - path: 'src/client', 543 + path: "src/client", 535 544 tsConfigPath: null, 536 545 }, 537 546 }; ··· 660 669 661 670 ```js 662 671 export default { 663 - input: 'hey-api/backend', // sign up at app.heyapi.dev 672 + input: "hey-api/backend", // sign up at app.heyapi.dev 664 673 output: { 665 - fileName: '{{name}}', 666 - path: 'src/client', 674 + fileName: "{{name}}", 675 + path: "src/client", 667 676 }, 668 677 }; 669 678 ``` ··· 672 681 673 682 ```js 674 683 export default { 675 - input: 'hey-api/backend', // sign up at app.heyapi.dev 684 + input: "hey-api/backend", // sign up at app.heyapi.dev 676 685 output: { 677 686 fileName: { 678 - suffix: '.gen', 687 + suffix: ".gen", 679 688 }, 680 - path: 'src/client', 689 + path: "src/client", 681 690 }, 682 691 }; 683 692 ``` ··· 782 791 783 792 ```js 784 793 export default { 785 - input: 'hey-api/backend', // sign up at app.heyapi.dev 786 - output: 'src/client', 794 + input: "hey-api/backend", // sign up at app.heyapi.dev 795 + output: "src/client", 787 796 parser: { 788 797 hooks: { 789 798 operations: { 790 - isQuery: (op) => (op.method === 'post' ? true : undefined), 799 + isQuery: (op) => (op.method === "post" ? true : undefined), 791 800 }, 792 801 }, 793 802 }, ··· 974 983 975 984 ```js 976 985 export default { 977 - input: 'hey-api/backend', // sign up at app.heyapi.dev 978 - output: 'src/client', 986 + input: "hey-api/backend", // sign up at app.heyapi.dev 987 + output: "src/client", 979 988 plugins: [ 980 989 // ...other plugins 981 990 { 982 - name: 'zod', 991 + name: "zod", 983 992 compatibilityVersion: 3, 984 993 }, 985 994 ], ··· 988 997 989 998 ```js 990 999 export default { 991 - input: 'hey-api/backend', // sign up at app.heyapi.dev 992 - output: 'src/client', 1000 + input: "hey-api/backend", // sign up at app.heyapi.dev 1001 + output: "src/client", 993 1002 plugins: [ 994 1003 // ...other plugins 995 1004 { 996 - name: 'zod', 997 - compatibilityVersion: 'mini', 1005 + name: "zod", 1006 + compatibilityVersion: "mini", 998 1007 }, 999 1008 ], 1000 1009 }; ··· 1119 1128 1120 1129 ```js 1121 1130 export default { 1122 - input: 'hey-api/backend', // sign up at app.heyapi.dev 1123 - output: 'src/client', 1131 + input: "hey-api/backend", // sign up at app.heyapi.dev 1132 + output: "src/client", 1124 1133 plugins: [ 1125 1134 // ...other plugins 1126 1135 { 1127 - name: '@hey-api/sdk', 1136 + name: "@hey-api/sdk", 1128 1137 validator: { 1129 1138 request: false, 1130 1139 response: true, ··· 1154 1163 v.object({ 1155 1164 foo: v.optional(v.string()), 1156 1165 bar: v.optional(v.union([v.number(), v.null()])), 1157 - }), 1166 + }) 1158 1167 ), 1159 1168 headers: v.optional(v.never()), 1160 1169 path: v.object({ ··· 1183 1192 This method replaces the `.subscribe()` method. Additionally, `.forEach()` is executed immediately, which means we don't need the `before` and `after` events – simply move your code before and after the `.forEach()` block. 1184 1193 1185 1194 ```ts 1186 - plugin.forEach('operation', 'schema', (event) => { 1195 + plugin.forEach("operation", "schema", (event) => { 1187 1196 // do something with event 1188 1197 }); 1189 1198 ``` ··· 1296 1305 1297 1306 ```js 1298 1307 export default { 1299 - input: 'hey-api/backend', // sign up at app.heyapi.dev 1300 - output: 'src/client', 1308 + input: "hey-api/backend", // sign up at app.heyapi.dev 1309 + output: "src/client", 1301 1310 plugins: [ 1302 1311 // ...other plugins 1303 1312 { 1304 - classStructure: 'off', 1305 - name: '@hey-api/sdk', 1313 + classStructure: "off", 1314 + name: "@hey-api/sdk", 1306 1315 }, 1307 1316 ], 1308 1317 }; ··· 1483 1492 1484 1493 ```js 1485 1494 export default { 1486 - input: 'hey-api/backend', // sign up at app.heyapi.dev 1495 + input: "hey-api/backend", // sign up at app.heyapi.dev 1487 1496 output: { 1488 - path: 'src/client', 1489 - tsConfigPath: 'off', 1497 + path: "src/client", 1498 + tsConfigPath: "off", 1490 1499 }, 1491 1500 }; 1492 1501 ``` ··· 1575 1584 1576 1585 ```js 1577 1586 export default { 1578 - input: 'hey-api/backend', // sign up at app.heyapi.dev 1579 - output: 'src/client', 1587 + input: "hey-api/backend", // sign up at app.heyapi.dev 1588 + output: "src/client", 1580 1589 plugins: [ 1581 1590 // ...other plugins 1582 1591 { 1583 - name: '@hey-api/typescript', 1584 - readOnlyWriteOnlyBehavior: 'off', // [!code ++] 1592 + name: "@hey-api/typescript", 1593 + readOnlyWriteOnlyBehavior: "off", // [!code ++] 1585 1594 }, 1586 1595 ], 1587 1596 }; ··· 1713 1722 1714 1723 ```js 1715 1724 export default { 1716 - input: 'path/to/openapi.json', 1717 - output: 'src/client', 1725 + input: "path/to/openapi.json", 1726 + output: "src/client", 1718 1727 plugins: [ 1719 1728 { 1720 1729 baseUrl: false, // [!code ++] 1721 - name: '@hey-api/client-fetch', 1730 + name: "@hey-api/client-fetch", 1722 1731 }, 1723 1732 ], 1724 1733 }; ··· 1765 1774 1766 1775 ```js 1767 1776 export default { 1768 - client: '@hey-api/client-fetch', // [!code --] 1769 - input: 'path/to/openapi.json', 1770 - output: 'src/client', 1771 - plugins: ['@hey-api/client-fetch'], // [!code ++] 1777 + client: "@hey-api/client-fetch", // [!code --] 1778 + input: "path/to/openapi.json", 1779 + output: "src/client", 1780 + plugins: ["@hey-api/client-fetch"], // [!code ++] 1772 1781 }; 1773 1782 ``` 1774 1783 ··· 1782 1791 1783 1792 ```js 1784 1793 export default { 1785 - input: 'path/to/openapi.json', 1786 - output: 'src/client', 1794 + input: "path/to/openapi.json", 1795 + output: "src/client", 1787 1796 plugins: [ 1788 1797 { 1789 - name: '@hey-api/client-fetch', 1798 + name: "@hey-api/client-fetch", 1790 1799 throwOnError: true, // [!code ++] 1791 1800 }, 1792 1801 { 1793 - name: '@hey-api/sdk', 1802 + name: "@hey-api/sdk", 1794 1803 throwOnError: true, // [!code --] 1795 1804 }, 1796 1805 ], ··· 1804 1813 The internal `client` instance previously located in `sdk.gen.ts` is now defined in `client.gen.ts`. If you're importing it in your code, update the import module. 1805 1814 1806 1815 ```js 1807 - import { client } from 'client/sdk.gen'; // [!code --] 1808 - import { client } from 'client/client.gen'; // [!code ++] 1816 + import { client } from "client/sdk.gen"; // [!code --] 1817 + import { client } from "client/client.gen"; // [!code ++] 1809 1818 ``` 1810 1819 1811 1820 - [#1626](https://github.com/hey-api/openapi-ts/pull/1626) [`8eba19d`](https://github.com/hey-api/openapi-ts/commit/8eba19d4092fc0903572ab9fdadf0b4c26928ba2) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: throw if inferred plugin not found ··· 1890 1899 1891 1900 ```js 1892 1901 export default { 1893 - client: '@hey-api/client-fetch', 1894 - input: 'path/to/openapi.json', 1895 - output: 'src/client', 1902 + client: "@hey-api/client-fetch", 1903 + input: "path/to/openapi.json", 1904 + output: "src/client", 1896 1905 watch: true, 1897 1906 }; 1898 1907 ``` ··· 1948 1957 When generating SDKs, you now have to specify `transformer` in order to modify response data. By default, adding `@hey-api/transformers` to your plugins will only produce additional output. To preserve the previous functionality, set `sdk.transformer` to `true`. 1949 1958 1950 1959 ```js 1951 - import { defaultPlugins } from '@hey-api/openapi-ts'; 1960 + import { defaultPlugins } from "@hey-api/openapi-ts"; 1952 1961 1953 1962 export default { 1954 - client: '@hey-api/client-fetch', 1955 - input: 'path/to/openapi.json', 1956 - output: 'src/client', 1963 + client: "@hey-api/client-fetch", 1964 + input: "path/to/openapi.json", 1965 + output: "src/client", 1957 1966 plugins: [ 1958 1967 ...defaultPlugins, 1959 1968 { 1960 1969 dates: true, 1961 - name: '@hey-api/transformers', 1970 + name: "@hey-api/transformers", 1962 1971 }, 1963 1972 { 1964 - name: '@hey-api/sdk', 1973 + name: "@hey-api/sdk", 1965 1974 transformer: true, // [!code ++] 1966 1975 }, 1967 1976 ], ··· 2006 2015 2007 2016 ```js 2008 2017 export default { 2009 - client: '@hey-api/client-fetch', 2018 + client: "@hey-api/client-fetch", 2010 2019 debug: true, // [!code --] 2011 - input: 'path/to/openapi.json', 2020 + input: "path/to/openapi.json", 2012 2021 logs: { 2013 - level: 'debug', // [!code ++] 2022 + level: "debug", // [!code ++] 2014 2023 }, 2015 - output: 'src/client', 2024 + output: "src/client", 2016 2025 }; 2017 2026 ``` 2018 2027 ··· 2023 2032 `@hey-api/schemas` has been removed from the default plugins. To continue using it, add it to your plugins array. 2024 2033 2025 2034 ```js 2026 - import { defaultPlugins } from '@hey-api/openapi-ts'; 2035 + import { defaultPlugins } from "@hey-api/openapi-ts"; 2027 2036 2028 2037 export default { 2029 - client: '@hey-api/client-fetch', 2038 + client: "@hey-api/client-fetch", 2030 2039 experimentalParser: true, 2031 - input: 'path/to/openapi.json', 2032 - output: 'src/client', 2040 + input: "path/to/openapi.json", 2041 + output: "src/client", 2033 2042 plugins: [ 2034 2043 ...defaultPlugins, 2035 - '@hey-api/schemas', // [!code ++] 2044 + "@hey-api/schemas", // [!code ++] 2036 2045 ], 2037 2046 }; 2038 2047 ``` ··· 2063 2072 2064 2073 ```js 2065 2074 export default { 2066 - client: '@hey-api/client-fetch', 2075 + client: "@hey-api/client-fetch", 2067 2076 experimentalParser: true, 2068 - input: 'path/to/openapi.json', 2069 - output: 'src/client', 2077 + input: "path/to/openapi.json", 2078 + output: "src/client", 2070 2079 plugins: [ 2071 2080 // ...other plugins 2072 2081 { 2073 - identifierCase: 'preserve', // [!code ++] 2074 - name: '@hey-api/typescript', 2082 + identifierCase: "preserve", // [!code ++] 2083 + name: "@hey-api/typescript", 2075 2084 }, 2076 2085 ], 2077 2086 }; ··· 2084 2093 `index.ts` will no longer re-export `schemas.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `schemas.gen.ts` directly. 2085 2094 2086 2095 ```js 2087 - import { mySchema } from 'client'; // [!code --] 2088 - import { mySchema } from 'client/schemas.gen'; // [!code ++] 2096 + import { mySchema } from "client"; // [!code --] 2097 + import { mySchema } from "client/schemas.gen"; // [!code ++] 2089 2098 ``` 2090 2099 2091 2100 ### Removed `transformers.gen.ts` re-export ··· 2093 2102 `index.ts` will no longer re-export `transformers.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `transformers.gen.ts` directly. 2094 2103 2095 2104 ```js 2096 - import { myTransformer } from 'client'; // [!code --] 2097 - import { myTransformer } from 'client/transformers.gen'; // [!code ++] 2105 + import { myTransformer } from "client"; // [!code --] 2106 + import { myTransformer } from "client/transformers.gen"; // [!code ++] 2098 2107 ``` 2099 2108 2100 2109 - [#1360](https://github.com/hey-api/openapi-ts/pull/1360) [`5f6ddd7`](https://github.com/hey-api/openapi-ts/commit/5f6ddd796f0ce77bcca55fd13981f2a8481aecd3) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: add output.clean option ··· 2105 2114 2106 2115 ```js 2107 2116 export default { 2108 - client: '@hey-api/client-fetch', 2109 - input: 'path/to/openapi.json', 2117 + client: "@hey-api/client-fetch", 2118 + input: "path/to/openapi.json", 2110 2119 output: { 2111 2120 clean: false, // [!code ++] 2112 - path: 'src/client', 2121 + path: "src/client", 2113 2122 }, 2114 2123 }; 2115 2124 ``` ··· 2155 2164 To align with the updated name, the `@hey-api/sdk` plugin will generate an `sdk.gen.ts` file. This will result in a breaking change if you're importing from `services.gen.ts`. Please update your imports to reflect this change. 2156 2165 2157 2166 ```js 2158 - import { client } from 'client/services.gen'; // [!code --] 2159 - import { client } from 'client/sdk.gen'; // [!code ++] 2167 + import { client } from "client/services.gen"; // [!code --] 2168 + import { client } from "client/sdk.gen"; // [!code ++] 2160 2169 ``` 2161 2170 2162 2171 ### Renamed `@hey-api/types` plugin ··· 2173 2182 2174 2183 ```js 2175 2184 export default { 2176 - client: '@hey-api/client-fetch', 2185 + client: "@hey-api/client-fetch", 2177 2186 experimentalParser: true, 2178 - input: 'path/to/openapi.json', 2179 - output: 'src/client', 2187 + input: "path/to/openapi.json", 2188 + output: "src/client", 2180 2189 plugins: [ 2181 2190 // ...other plugins 2182 2191 { 2183 2192 exportInlineEnums: true, // [!code ++] 2184 - name: '@hey-api/typescript', 2193 + name: "@hey-api/typescript", 2185 2194 }, 2186 2195 ], 2187 2196 }; ··· 2279 2288 2280 2289 ```js 2281 2290 export default { 2282 - client: '@hey-api/client-fetch', 2283 - input: 'path/to/openapi.json', 2284 - output: 'src/client', 2291 + client: "@hey-api/client-fetch", 2292 + input: "path/to/openapi.json", 2293 + output: "src/client", 2285 2294 experimentalParser: true, 2286 2295 }; 2287 2296 ``` ··· 2308 2317 2309 2318 ```js 2310 2319 export default { 2311 - client: '@hey-api/client-fetch', 2312 - input: 'path/to/openapi.json', 2313 - output: 'src/client', 2320 + client: "@hey-api/client-fetch", 2321 + input: "path/to/openapi.json", 2322 + output: "src/client", 2314 2323 experimentalParser: true, 2315 2324 }; 2316 2325 ``` ··· 2359 2368 2360 2369 ```js [shorthand] 2361 2370 export default { 2362 - client: '@hey-api/client-fetch', 2363 - input: 'path/to/openapi.json', 2364 - output: 'src/client', 2371 + client: "@hey-api/client-fetch", 2372 + input: "path/to/openapi.json", 2373 + output: "src/client", 2365 2374 schemas: false, // [!code --] 2366 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 2375 + plugins: ["@hey-api/types", "@hey-api/services"], // [!code ++] 2367 2376 }; 2368 2377 ``` 2369 2378 2370 2379 ```js [*.export] 2371 2380 export default { 2372 - client: '@hey-api/client-fetch', 2373 - input: 'path/to/openapi.json', 2374 - output: 'src/client', 2381 + client: "@hey-api/client-fetch", 2382 + input: "path/to/openapi.json", 2383 + output: "src/client", 2375 2384 schemas: { 2376 2385 export: false, // [!code --] 2377 2386 }, 2378 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 2387 + plugins: ["@hey-api/types", "@hey-api/services"], // [!code ++] 2379 2388 }; 2380 2389 ``` 2381 2390 ··· 2387 2396 2388 2397 ```js 2389 2398 export default { 2390 - client: '@hey-api/client-fetch', 2391 - input: 'path/to/openapi.json', 2392 - output: 'src/client', 2399 + client: "@hey-api/client-fetch", 2400 + input: "path/to/openapi.json", 2401 + output: "src/client", 2393 2402 schemas: { 2394 2403 name: (name) => `${name}Schema`, // [!code --] 2395 2404 }, ··· 2397 2406 // ...other plugins 2398 2407 { 2399 2408 nameBuilder: (name) => `${name}Schema`, // [!code ++] 2400 - name: '@hey-api/schemas', 2409 + name: "@hey-api/schemas", 2401 2410 }, 2402 2411 ], 2403 2412 }; ··· 2409 2418 2410 2419 ```js 2411 2420 export default { 2412 - client: '@hey-api/client-fetch', 2413 - input: 'path/to/openapi.json', 2414 - output: 'src/client', 2415 - services: '^MySchema', // [!code --] 2421 + client: "@hey-api/client-fetch", 2422 + input: "path/to/openapi.json", 2423 + output: "src/client", 2424 + services: "^MySchema", // [!code --] 2416 2425 plugins: [ 2417 2426 // ...other plugins 2418 2427 { 2419 - include: '^MySchema', // [!code ++] 2420 - name: '@hey-api/services', 2428 + include: "^MySchema", // [!code ++] 2429 + name: "@hey-api/services", 2421 2430 }, 2422 2431 ], 2423 2432 }; ··· 2429 2438 2430 2439 ```js 2431 2440 export default { 2432 - client: '@hey-api/client-fetch', 2433 - input: 'path/to/openapi.json', 2434 - output: 'src/client', 2441 + client: "@hey-api/client-fetch", 2442 + input: "path/to/openapi.json", 2443 + output: "src/client", 2435 2444 services: { 2436 - name: '{{name}}Service', // [!code --] 2445 + name: "{{name}}Service", // [!code --] 2437 2446 }, 2438 2447 plugins: [ 2439 2448 // ...other plugins 2440 2449 { 2441 - serviceNameBuilder: '{{name}}Service', // [!code ++] 2442 - name: '@hey-api/services', 2450 + serviceNameBuilder: "{{name}}Service", // [!code ++] 2451 + name: "@hey-api/services", 2443 2452 }, 2444 2453 ], 2445 2454 }; ··· 2451 2460 2452 2461 ```js 2453 2462 export default { 2454 - client: '@hey-api/client-fetch', 2455 - input: 'path/to/openapi.json', 2456 - output: 'src/client', 2463 + client: "@hey-api/client-fetch", 2464 + input: "path/to/openapi.json", 2465 + output: "src/client", 2457 2466 types: { 2458 - dates: 'types+transform', // [!code --] 2467 + dates: "types+transform", // [!code --] 2459 2468 }, 2460 2469 plugins: [ 2461 2470 // ...other plugins 2462 2471 { 2463 2472 dates: true, // [!code ++] 2464 - name: '@hey-api/transformers', 2473 + name: "@hey-api/transformers", 2465 2474 }, 2466 2475 ], 2467 2476 }; ··· 2473 2482 2474 2483 ```js 2475 2484 export default { 2476 - client: '@hey-api/client-fetch', 2477 - input: 'path/to/openapi.json', 2478 - output: 'src/client', 2479 - types: '^MySchema', // [!code --] 2485 + client: "@hey-api/client-fetch", 2486 + input: "path/to/openapi.json", 2487 + output: "src/client", 2488 + types: "^MySchema", // [!code --] 2480 2489 plugins: [ 2481 2490 // ...other plugins 2482 2491 { 2483 - include: '^MySchema', // [!code ++] 2484 - name: '@hey-api/types', 2492 + include: "^MySchema", // [!code ++] 2493 + name: "@hey-api/types", 2485 2494 }, 2486 2495 ], 2487 2496 }; ··· 2493 2502 2494 2503 ```js 2495 2504 export default { 2496 - client: '@hey-api/client-fetch', 2497 - input: 'path/to/openapi.json', 2498 - output: 'src/client', 2505 + client: "@hey-api/client-fetch", 2506 + input: "path/to/openapi.json", 2507 + output: "src/client", 2499 2508 types: { 2500 - name: 'PascalCase', // [!code --] 2509 + name: "PascalCase", // [!code --] 2501 2510 }, 2502 2511 plugins: [ 2503 2512 // ...other plugins 2504 2513 { 2505 - name: '@hey-api/types', 2506 - style: 'PascalCase', // [!code ++] 2514 + name: "@hey-api/types", 2515 + style: "PascalCase", // [!code ++] 2507 2516 }, 2508 2517 ], 2509 2518 }; ··· 3784 3793 3785 3794 ```js 3786 3795 export default { 3787 - input: 'hey-api/backend', // sign up at app.heyapi.dev 3796 + input: "hey-api/backend", // sign up at app.heyapi.dev 3788 3797 output: { 3789 - path: 'src/client', 3790 - tsConfigPath: 'off', 3798 + path: "src/client", 3799 + tsConfigPath: "off", 3791 3800 }, 3792 3801 }; 3793 3802 ``` ··· 3876 3885 3877 3886 ```js 3878 3887 export default { 3879 - input: 'hey-api/backend', // sign up at app.heyapi.dev 3880 - output: 'src/client', 3888 + input: "hey-api/backend", // sign up at app.heyapi.dev 3889 + output: "src/client", 3881 3890 plugins: [ 3882 3891 // ...other plugins 3883 3892 { 3884 - name: '@hey-api/typescript', 3885 - readOnlyWriteOnlyBehavior: 'off', // [!code ++] 3893 + name: "@hey-api/typescript", 3894 + readOnlyWriteOnlyBehavior: "off", // [!code ++] 3886 3895 }, 3887 3896 ], 3888 3897 }; ··· 4014 4023 4015 4024 ```js 4016 4025 export default { 4017 - input: 'path/to/openapi.json', 4018 - output: 'src/client', 4026 + input: "path/to/openapi.json", 4027 + output: "src/client", 4019 4028 plugins: [ 4020 4029 { 4021 4030 baseUrl: false, // [!code ++] 4022 - name: '@hey-api/client-fetch', 4031 + name: "@hey-api/client-fetch", 4023 4032 }, 4024 4033 ], 4025 4034 }; ··· 4066 4075 4067 4076 ```js 4068 4077 export default { 4069 - client: '@hey-api/client-fetch', // [!code --] 4070 - input: 'path/to/openapi.json', 4071 - output: 'src/client', 4072 - plugins: ['@hey-api/client-fetch'], // [!code ++] 4078 + client: "@hey-api/client-fetch", // [!code --] 4079 + input: "path/to/openapi.json", 4080 + output: "src/client", 4081 + plugins: ["@hey-api/client-fetch"], // [!code ++] 4073 4082 }; 4074 4083 ``` 4075 4084 ··· 4083 4092 4084 4093 ```js 4085 4094 export default { 4086 - input: 'path/to/openapi.json', 4087 - output: 'src/client', 4095 + input: "path/to/openapi.json", 4096 + output: "src/client", 4088 4097 plugins: [ 4089 4098 { 4090 - name: '@hey-api/client-fetch', 4099 + name: "@hey-api/client-fetch", 4091 4100 throwOnError: true, // [!code ++] 4092 4101 }, 4093 4102 { 4094 - name: '@hey-api/sdk', 4103 + name: "@hey-api/sdk", 4095 4104 throwOnError: true, // [!code --] 4096 4105 }, 4097 4106 ], ··· 4105 4114 The internal `client` instance previously located in `sdk.gen.ts` is now defined in `client.gen.ts`. If you're importing it in your code, update the import module. 4106 4115 4107 4116 ```js 4108 - import { client } from 'client/sdk.gen'; // [!code --] 4109 - import { client } from 'client/client.gen'; // [!code ++] 4117 + import { client } from "client/sdk.gen"; // [!code --] 4118 + import { client } from "client/client.gen"; // [!code ++] 4110 4119 ``` 4111 4120 4112 4121 - [#1626](https://github.com/hey-api/openapi-ts/pull/1626) [`8eba19d`](https://github.com/hey-api/openapi-ts/commit/8eba19d4092fc0903572ab9fdadf0b4c26928ba2) Thanks [@mrlubos](https://github.com/mrlubos)! - fix: throw if inferred plugin not found ··· 4191 4200 4192 4201 ```js 4193 4202 export default { 4194 - client: '@hey-api/client-fetch', 4195 - input: 'path/to/openapi.json', 4196 - output: 'src/client', 4203 + client: "@hey-api/client-fetch", 4204 + input: "path/to/openapi.json", 4205 + output: "src/client", 4197 4206 watch: true, 4198 4207 }; 4199 4208 ``` ··· 4249 4258 When generating SDKs, you now have to specify `transformer` in order to modify response data. By default, adding `@hey-api/transformers` to your plugins will only produce additional output. To preserve the previous functionality, set `sdk.transformer` to `true`. 4250 4259 4251 4260 ```js 4252 - import { defaultPlugins } from '@hey-api/openapi-ts'; 4261 + import { defaultPlugins } from "@hey-api/openapi-ts"; 4253 4262 4254 4263 export default { 4255 - client: '@hey-api/client-fetch', 4256 - input: 'path/to/openapi.json', 4257 - output: 'src/client', 4264 + client: "@hey-api/client-fetch", 4265 + input: "path/to/openapi.json", 4266 + output: "src/client", 4258 4267 plugins: [ 4259 4268 ...defaultPlugins, 4260 4269 { 4261 4270 dates: true, 4262 - name: '@hey-api/transformers', 4271 + name: "@hey-api/transformers", 4263 4272 }, 4264 4273 { 4265 - name: '@hey-api/sdk', 4274 + name: "@hey-api/sdk", 4266 4275 transformer: true, // [!code ++] 4267 4276 }, 4268 4277 ], ··· 4307 4316 4308 4317 ```js 4309 4318 export default { 4310 - client: '@hey-api/client-fetch', 4319 + client: "@hey-api/client-fetch", 4311 4320 debug: true, // [!code --] 4312 - input: 'path/to/openapi.json', 4321 + input: "path/to/openapi.json", 4313 4322 logs: { 4314 - level: 'debug', // [!code ++] 4323 + level: "debug", // [!code ++] 4315 4324 }, 4316 - output: 'src/client', 4325 + output: "src/client", 4317 4326 }; 4318 4327 ``` 4319 4328 ··· 4324 4333 `@hey-api/schemas` has been removed from the default plugins. To continue using it, add it to your plugins array. 4325 4334 4326 4335 ```js 4327 - import { defaultPlugins } from '@hey-api/openapi-ts'; 4336 + import { defaultPlugins } from "@hey-api/openapi-ts"; 4328 4337 4329 4338 export default { 4330 - client: '@hey-api/client-fetch', 4339 + client: "@hey-api/client-fetch", 4331 4340 experimentalParser: true, 4332 - input: 'path/to/openapi.json', 4333 - output: 'src/client', 4341 + input: "path/to/openapi.json", 4342 + output: "src/client", 4334 4343 plugins: [ 4335 4344 ...defaultPlugins, 4336 - '@hey-api/schemas', // [!code ++] 4345 + "@hey-api/schemas", // [!code ++] 4337 4346 ], 4338 4347 }; 4339 4348 ``` ··· 4364 4373 4365 4374 ```js 4366 4375 export default { 4367 - client: '@hey-api/client-fetch', 4376 + client: "@hey-api/client-fetch", 4368 4377 experimentalParser: true, 4369 - input: 'path/to/openapi.json', 4370 - output: 'src/client', 4378 + input: "path/to/openapi.json", 4379 + output: "src/client", 4371 4380 plugins: [ 4372 4381 // ...other plugins 4373 4382 { 4374 - identifierCase: 'preserve', // [!code ++] 4375 - name: '@hey-api/typescript', 4383 + identifierCase: "preserve", // [!code ++] 4384 + name: "@hey-api/typescript", 4376 4385 }, 4377 4386 ], 4378 4387 }; ··· 4385 4394 `index.ts` will no longer re-export `schemas.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `schemas.gen.ts` directly. 4386 4395 4387 4396 ```js 4388 - import { mySchema } from 'client'; // [!code --] 4389 - import { mySchema } from 'client/schemas.gen'; // [!code ++] 4397 + import { mySchema } from "client"; // [!code --] 4398 + import { mySchema } from "client/schemas.gen"; // [!code ++] 4390 4399 ``` 4391 4400 4392 4401 ### Removed `transformers.gen.ts` re-export ··· 4394 4403 `index.ts` will no longer re-export `transformers.gen.ts` to reduce the chance of producing broken output. Please update your code to import from `transformers.gen.ts` directly. 4395 4404 4396 4405 ```js 4397 - import { myTransformer } from 'client'; // [!code --] 4398 - import { myTransformer } from 'client/transformers.gen'; // [!code ++] 4406 + import { myTransformer } from "client"; // [!code --] 4407 + import { myTransformer } from "client/transformers.gen"; // [!code ++] 4399 4408 ``` 4400 4409 4401 4410 - [#1360](https://github.com/hey-api/openapi-ts/pull/1360) [`5f6ddd7`](https://github.com/hey-api/openapi-ts/commit/5f6ddd796f0ce77bcca55fd13981f2a8481aecd3) Thanks [@mrlubos](https://github.com/mrlubos)! - feat: add output.clean option ··· 4406 4415 4407 4416 ```js 4408 4417 export default { 4409 - client: '@hey-api/client-fetch', 4410 - input: 'path/to/openapi.json', 4418 + client: "@hey-api/client-fetch", 4419 + input: "path/to/openapi.json", 4411 4420 output: { 4412 4421 clean: false, // [!code ++] 4413 - path: 'src/client', 4422 + path: "src/client", 4414 4423 }, 4415 4424 }; 4416 4425 ``` ··· 4456 4465 To align with the updated name, the `@hey-api/sdk` plugin will generate an `sdk.gen.ts` file. This will result in a breaking change if you're importing from `services.gen.ts`. Please update your imports to reflect this change. 4457 4466 4458 4467 ```js 4459 - import { client } from 'client/services.gen'; // [!code --] 4460 - import { client } from 'client/sdk.gen'; // [!code ++] 4468 + import { client } from "client/services.gen"; // [!code --] 4469 + import { client } from "client/sdk.gen"; // [!code ++] 4461 4470 ``` 4462 4471 4463 4472 ### Renamed `@hey-api/types` plugin ··· 4474 4483 4475 4484 ```js 4476 4485 export default { 4477 - client: '@hey-api/client-fetch', 4486 + client: "@hey-api/client-fetch", 4478 4487 experimentalParser: true, 4479 - input: 'path/to/openapi.json', 4480 - output: 'src/client', 4488 + input: "path/to/openapi.json", 4489 + output: "src/client", 4481 4490 plugins: [ 4482 4491 // ...other plugins 4483 4492 { 4484 4493 exportInlineEnums: true, // [!code ++] 4485 - name: '@hey-api/typescript', 4494 + name: "@hey-api/typescript", 4486 4495 }, 4487 4496 ], 4488 4497 }; ··· 4580 4589 4581 4590 ```js 4582 4591 export default { 4583 - client: '@hey-api/client-fetch', 4584 - input: 'path/to/openapi.json', 4585 - output: 'src/client', 4592 + client: "@hey-api/client-fetch", 4593 + input: "path/to/openapi.json", 4594 + output: "src/client", 4586 4595 experimentalParser: true, 4587 4596 }; 4588 4597 ``` ··· 4609 4618 4610 4619 ```js 4611 4620 export default { 4612 - client: '@hey-api/client-fetch', 4613 - input: 'path/to/openapi.json', 4614 - output: 'src/client', 4621 + client: "@hey-api/client-fetch", 4622 + input: "path/to/openapi.json", 4623 + output: "src/client", 4615 4624 experimentalParser: true, 4616 4625 }; 4617 4626 ``` ··· 4660 4669 4661 4670 ```js [shorthand] 4662 4671 export default { 4663 - client: '@hey-api/client-fetch', 4664 - input: 'path/to/openapi.json', 4665 - output: 'src/client', 4672 + client: "@hey-api/client-fetch", 4673 + input: "path/to/openapi.json", 4674 + output: "src/client", 4666 4675 schemas: false, // [!code --] 4667 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 4676 + plugins: ["@hey-api/types", "@hey-api/services"], // [!code ++] 4668 4677 }; 4669 4678 ``` 4670 4679 4671 4680 ```js [*.export] 4672 4681 export default { 4673 - client: '@hey-api/client-fetch', 4674 - input: 'path/to/openapi.json', 4675 - output: 'src/client', 4682 + client: "@hey-api/client-fetch", 4683 + input: "path/to/openapi.json", 4684 + output: "src/client", 4676 4685 schemas: { 4677 4686 export: false, // [!code --] 4678 4687 }, 4679 - plugins: ['@hey-api/types', '@hey-api/services'], // [!code ++] 4688 + plugins: ["@hey-api/types", "@hey-api/services"], // [!code ++] 4680 4689 }; 4681 4690 ``` 4682 4691 ··· 4688 4697 4689 4698 ```js 4690 4699 export default { 4691 - client: '@hey-api/client-fetch', 4692 - input: 'path/to/openapi.json', 4693 - output: 'src/client', 4700 + client: "@hey-api/client-fetch", 4701 + input: "path/to/openapi.json", 4702 + output: "src/client", 4694 4703 schemas: { 4695 4704 name: (name) => `${name}Schema`, // [!code --] 4696 4705 }, ··· 4698 4707 // ...other plugins 4699 4708 { 4700 4709 nameBuilder: (name) => `${name}Schema`, // [!code ++] 4701 - name: '@hey-api/schemas', 4710 + name: "@hey-api/schemas", 4702 4711 }, 4703 4712 ], 4704 4713 }; ··· 4710 4719 4711 4720 ```js 4712 4721 export default { 4713 - client: '@hey-api/client-fetch', 4714 - input: 'path/to/openapi.json', 4715 - output: 'src/client', 4716 - services: '^MySchema', // [!code --] 4722 + client: "@hey-api/client-fetch", 4723 + input: "path/to/openapi.json", 4724 + output: "src/client", 4725 + services: "^MySchema", // [!code --] 4717 4726 plugins: [ 4718 4727 // ...other plugins 4719 4728 { 4720 - include: '^MySchema', // [!code ++] 4721 - name: '@hey-api/services', 4729 + include: "^MySchema", // [!code ++] 4730 + name: "@hey-api/services", 4722 4731 }, 4723 4732 ], 4724 4733 }; ··· 4730 4739 4731 4740 ```js 4732 4741 export default { 4733 - client: '@hey-api/client-fetch', 4734 - input: 'path/to/openapi.json', 4735 - output: 'src/client', 4742 + client: "@hey-api/client-fetch", 4743 + input: "path/to/openapi.json", 4744 + output: "src/client", 4736 4745 services: { 4737 - name: '{{name}}Service', // [!code --] 4746 + name: "{{name}}Service", // [!code --] 4738 4747 }, 4739 4748 plugins: [ 4740 4749 // ...other plugins 4741 4750 { 4742 - serviceNameBuilder: '{{name}}Service', // [!code ++] 4743 - name: '@hey-api/services', 4751 + serviceNameBuilder: "{{name}}Service", // [!code ++] 4752 + name: "@hey-api/services", 4744 4753 }, 4745 4754 ], 4746 4755 }; ··· 4752 4761 4753 4762 ```js 4754 4763 export default { 4755 - client: '@hey-api/client-fetch', 4756 - input: 'path/to/openapi.json', 4757 - output: 'src/client', 4764 + client: "@hey-api/client-fetch", 4765 + input: "path/to/openapi.json", 4766 + output: "src/client", 4758 4767 types: { 4759 - dates: 'types+transform', // [!code --] 4768 + dates: "types+transform", // [!code --] 4760 4769 }, 4761 4770 plugins: [ 4762 4771 // ...other plugins 4763 4772 { 4764 4773 dates: true, // [!code ++] 4765 - name: '@hey-api/transformers', 4774 + name: "@hey-api/transformers", 4766 4775 }, 4767 4776 ], 4768 4777 }; ··· 4774 4783 4775 4784 ```js 4776 4785 export default { 4777 - client: '@hey-api/client-fetch', 4778 - input: 'path/to/openapi.json', 4779 - output: 'src/client', 4780 - types: '^MySchema', // [!code --] 4786 + client: "@hey-api/client-fetch", 4787 + input: "path/to/openapi.json", 4788 + output: "src/client", 4789 + types: "^MySchema", // [!code --] 4781 4790 plugins: [ 4782 4791 // ...other plugins 4783 4792 { 4784 - include: '^MySchema', // [!code ++] 4785 - name: '@hey-api/types', 4793 + include: "^MySchema", // [!code ++] 4794 + name: "@hey-api/types", 4786 4795 }, 4787 4796 ], 4788 4797 }; ··· 4794 4803 4795 4804 ```js 4796 4805 export default { 4797 - client: '@hey-api/client-fetch', 4798 - input: 'path/to/openapi.json', 4799 - output: 'src/client', 4806 + client: "@hey-api/client-fetch", 4807 + input: "path/to/openapi.json", 4808 + output: "src/client", 4800 4809 types: { 4801 - name: 'PascalCase', // [!code --] 4810 + name: "PascalCase", // [!code --] 4802 4811 }, 4803 4812 plugins: [ 4804 4813 // ...other plugins 4805 4814 { 4806 - name: '@hey-api/types', 4807 - style: 'PascalCase', // [!code ++] 4815 + name: "@hey-api/types", 4816 + style: "PascalCase", // [!code ++] 4808 4817 }, 4809 4818 ], 4810 4819 };
+1 -1
packages/openapi-ts/package.json
··· 1 1 { 2 2 "name": "@hey-api/openapi-ts", 3 - "version": "0.91.0", 3 + "version": "0.91.1", 4 4 "description": "🌀 OpenAPI to TypeScript codegen. Production-ready SDKs, Zod schemas, TanStack Query hooks, and 20+ plugins. Used by Vercel, OpenCode, and PayPal.", 5 5 "keywords": [ 6 6 "angular",
+8
packages/shared/CHANGELOG.md
··· 1 1 # @hey-api/shared 2 2 3 + ## 0.1.1 4 + 5 + ### Patch Changes 6 + 7 + ### Updated Dependencies: 8 + 9 + - @hey-api/codegen-core@0.6.1 10 + 3 11 ## 0.1.0 4 12 5 13 ### Minor Changes
+1 -1
packages/shared/package.json
··· 1 1 { 2 2 "name": "@hey-api/shared", 3 - "version": "0.1.0", 3 + "version": "0.1.1", 4 4 "description": "Temporary home for cross-package utilities. Contents will migrate to proper packages as architecture stabilizes.", 5 5 "homepage": "https://heyapi.dev/", 6 6 "bugs": {