edgedb-js
edgedb-js copied to clipboard
Add `generate interfaces --no-namespaces` that creates a file for each module
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
Userinstead ofexample.User - better performance (if modules don't reference all other modules)
I think it would be nice to expose a way for users to create custom generators. (introspectionResult) => custom logic