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

Add generate interfaces --no-namespaces that creates a file for each module #748

Open
ssendev opened this issue Oct 12, 2023 · 1 comment

Comments

@ssendev
Copy link

ssendev commented Oct 12, 2023

Add a mode to generate interfaces that produces a modulename.ts file instead of a namespace for each EdgeDB module

before:

import { Movie, example } from 'interfaces.ts'

type Watched = {
  movie: Movie,
  person: example.User
}

after:

import { Movie } from 'interfaces/default.ts'
// could also keep the name. or always generate both
// and have an identical to today `interfaces.ts` that reexports the esmodules
import { User } from 'interfaces/example.ts'

type Watched = {
  movie: Movie,
  person: User
}

why?

  • i like to write User instead of example.User
  • better performance (if modules don't reference all other modules)
@haikyuu
Copy link

haikyuu commented Oct 13, 2023

I think it would be nice to expose a way for users to create custom generators. (introspectionResult) => custom logic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants