···11+---
22+'@hey-api/openapi-ts': patch
33+---
44+55+fix: add exportFromIndex option to all plugins
+1-1
docs/openapi-ts/custom-plugin.md
···9494By default, your plugin output won't be re-exported from the `index.ts` file. To enable this feature, add `exportFromIndex: true` to your `config.ts` file.
95959696::: warning
9797-Re-exporting your plugin from `index.ts` may result in broken output due to naming conflicts. Ensure your exported identifiers are unique.
9797+Re-exporting your plugin from index file may result in broken output due to naming conflicts. Ensure your exported identifiers are unique.
9898:::
9999100100## Handler
+46-3
docs/openapi-ts/output.md
···45454646:::
47474848-We recommend importing artifacts from their files to avoid ambiguity, but we leave this choice up to you.
4848+### Disable index file
4949+5050+We recommend importing artifacts from their respective files to avoid ambiguity, but we leave this choice up to you.
49515052```ts
5151-import type { Pet } from './client'; // 👎 // [!code --]
5252-import type { Pet } from './client/types.gen'; // 👍 // [!code ++]
5353+import type { Pet } from './client';
5454+// or
5555+import type { Pet } from './client/types.gen';
5656+```
5757+5858+If you're not importing artifacts from the index file, you can skip generating it altogether by setting the `output.indexFile` option to `false`.
5959+6060+```js
6161+import { defaultPlugins } from '@hey-api/openapi-ts';
6262+6363+export default {
6464+ input: 'path/to/openapi.json',
6565+ output: {
6666+ indexFile: false, // [!code ++]
6767+ path: 'src/client',
6868+ },
6969+ plugins: ['@hey-api/client-fetch'],
7070+};
7171+```
7272+7373+### Re-export more files
7474+7575+You can choose which files should be re-exported by setting the `exportFromIndex` option to `true` on any plugin. For example, here's how you would re-export [Zod](/openapi-ts/plugins/zod) plugin exports.
7676+7777+```js
7878+import { defaultPlugins } from '@hey-api/openapi-ts';
7979+8080+export default {
8181+ input: 'path/to/openapi.json',
8282+ output: 'src/client',
8383+ plugins: [
8484+ ...defaultPlugins,
8585+ '@hey-api/client-fetch',
8686+ {
8787+ exportFromIndex: true, // [!code ++]
8888+ name: 'zod',
8989+ },
9090+ ],
9191+};
5392```
9393+9494+::: warning
9595+Re-exporting additional files from index file may result in broken output due to naming conflicts.
9696+:::
54975598## Client
5699
···4343 */
4444 bundle?: boolean;
4545 /**
4646+ * Should the exports from the generated files be re-exported in the index
4747+ * barrel file?
4848+ *
4949+ * @default false
5050+ */
5151+ exportFromIndex?: boolean;
5252+ /**
4653 * Name of the generated file.
4754 *
4855 * @default 'client'
···991010export interface Config extends Plugin.Name<'@hey-api/schemas'> {
1111 /**
1212+ * Should the exports from the generated files be re-exported in the index
1313+ * barrel file?
1414+ *
1515+ * @default false
1616+ */
1717+ exportFromIndex?: boolean;
1818+ /**
1219 * Customise the schema name. By default, `{{name}}Schema` is used. `name` is a
1320 * valid JavaScript/TypeScript identifier, e.g. if your schema name is
1421 * "Foo-Bar", `name` value would be "FooBar".
···4040 */
4141 client?: PluginClientNames | boolean;
4242 /**
4343+ * Should the exports from the generated files be re-exported in the index
4444+ * barrel file?
4545+ *
4646+ * @default true
4747+ */
4848+ exportFromIndex?: boolean;
4949+ /**
4350 * @deprecated
4451 *
4552 * **This feature works only with the legacy parser**
···1414 */
1515 dates?: boolean;
1616 /**
1717+ * Should the exports from the generated files be re-exported in the index
1818+ * barrel file?
1919+ *
2020+ * @default false
2121+ */
2222+ exportFromIndex?: boolean;
2323+ /**
1724 * Name of the generated file.
1825 *
1926 * @default 'transformers'
···1818 */
1919 enumsCase?: StringCase;
2020 /**
2121+ * Should the exports from the generated files be re-exported in the index
2222+ * barrel file?
2323+ *
2424+ * @default true
2525+ */
2626+ exportFromIndex?: boolean;
2727+ /**
2128 * By default, inline enums (enums not defined as reusable components in
2229 * the input file) are generated as inlined union types. You can set
2330 * `exportInlineEnums` to `true` to treat inline enums as reusable components.
···33export interface Config
44 extends Plugin.Name<'@tanstack/angular-query-experimental'> {
55 /**
66+ * Should the exports from the generated files be re-exported in the index
77+ * barrel file?
88+ *
99+ * @default false
1010+ */
1111+ exportFromIndex?: boolean;
1212+ /**
613 * Generate {@link https://tanstack.com/query/v5/docs/framework/angular/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
714 *
815 * @default true
···2233export interface Config extends Plugin.Name<'@tanstack/react-query'> {
44 /**
55+ * Should the exports from the generated files be re-exported in the index
66+ * barrel file?
77+ *
88+ * @default false
99+ */
1010+ exportFromIndex?: boolean;
1111+ /**
512 * Generate {@link https://tanstack.com/query/v5/docs/framework/react/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
613 *
714 * @default true
···2233export interface Config extends Plugin.Name<'@tanstack/solid-query'> {
44 /**
55+ * Should the exports from the generated files be re-exported in the index
66+ * barrel file?
77+ *
88+ * @default false
99+ */
1010+ exportFromIndex?: boolean;
1111+ /**
512 * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
613 *
714 * @default true
···2233export interface Config extends Plugin.Name<'@tanstack/svelte-query'> {
44 /**
55+ * Should the exports from the generated files be re-exported in the index
66+ * barrel file?
77+ *
88+ * @default false
99+ */
1010+ exportFromIndex?: boolean;
1111+ /**
512 * Generate `createInfiniteQuery()` helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
613 *
714 * @default true
···2233export interface Config extends Plugin.Name<'@tanstack/vue-query'> {
44 /**
55+ * Should the exports from the generated files be re-exported in the index
66+ * barrel file?
77+ *
88+ * @default false
99+ */
1010+ exportFromIndex?: boolean;
1111+ /**
512 * Generate {@link https://tanstack.com/query/v5/docs/framework/vue/reference/infiniteQueryOptions `infiniteQueryOptions()`} helpers? These will be generated from GET and POST requests where a pagination parameter is detected.
613 *
714 * @default true
···2233export interface Config extends Plugin.Name<'fastify'> {
44 /**
55+ * Should the exports from the generated files be re-exported in the index
66+ * barrel file?
77+ *
88+ * @default false
99+ */
1010+ exportFromIndex?: boolean;
1111+ /**
512 * Name of the generated file.
613 *
714 * @default 'fastify'
···3344export interface Config extends Plugin.Name<'zod'> {
55 /**
66+ * Should the exports from the generated files be re-exported in the index
77+ * barrel file?
88+ *
99+ * @default false
1010+ */
1111+ exportFromIndex?: boolean;
1212+ /**
613 * Customise the Zod schema name. By default, `z{{name}}` is used,
714 * where `name` is a definition name or an operation name.
815 */