Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple output directories #1578

Open
adamghowiba opened this issue Jan 16, 2025 · 1 comment
Open

Multiple output directories #1578

adamghowiba opened this issue Jan 16, 2025 · 1 comment
Labels
feature 🚀 New feature or request RSVP 👍👎 Explicit request for reactions to gauge interest in resolving this issue

Comments

@adamghowiba
Copy link

adamghowiba commented Jan 16, 2025

Description

Love the work you guys are doing!

We use NX monorepo for all our codebases. We have an apps folder and packages folder. In the packages folder we have folder for each techology to avoid importing from invalid packages. e.g

packages

api
client (Where generated react-query functions should live)
shared (Shared packages, where types would be)

React apps, cannot import from api and Express API's cannot import from client.

We've been using the new react-query plugin from hey-api, and we have a comon use case where generated types need to be in one place, and the generated react-query functions need tobe in another.

Is this curently possible without duplication?

Rough Idea

Maybe something like this would be great.

import { defaultPlugins, defineConfig } from '@hey-api/openapi-ts';

export default defineConfig({
  client: '@hey-api/client-fetch',
  input: 'http://localhost:5010/docs-json',
  output: 'libs/client/edgar-react-query/src/lib/client',
  plugins: [
    ...defaultPlugins,
    {
      name: '@hey-api/typescript',
      output: 'libs/shared/edgar-api/src',
    },
    {
      name: '@tanstack/react-query',
      output: 'libs/client/edgar-react-query/src',
      typesLocation: 'libs/shared/edgar-api/src',
    },
  ],
});

Thanks again!

@adamghowiba adamghowiba added the feature 🚀 New feature or request label Jan 16, 2025
@mrlubos
Copy link
Member

mrlubos commented Jan 16, 2025

Hi @adamghowiba, not possible yet, but could be! I'll put a vote on this issue to see how common this requirement is

@mrlubos mrlubos added the RSVP 👍👎 Explicit request for reactions to gauge interest in resolving this issue label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature 🚀 New feature or request RSVP 👍👎 Explicit request for reactions to gauge interest in resolving this issue
Projects
None yet
Development

No branches or pull requests

2 participants