valentinpalkovic/prisma-json-schema-generator

Add additional options to generate the output as .js or .ts files

Closed this issue · 2 comments

Feature Request

Add additional options to the generation config to facilitate the output as

  • .json (default)
  • .js
  • .ts
.js file

Suggested .js file structure

export jsonSchema = {

}
.ts file

Suggested .ts file structure

export default {

}

@aflatoon2874 Can you describe in which context the generated schema would be used? I would like to understand the requirements a bit better.

Some thoughts to your suggestions:

  1. The EcmaScript Module syntax is not supported very well (Node > 13.12.0). I am not sure whether we should already use it. If we would use it, would it make sense to use the .mjs extension to clearly mark the file as a module? This extension would also help babel and node to correctly deal with the file.

  2. Is it important for you to have the ability to create a file with the file ending .ts? The content of the javascript and typescript generated module would be the same.

Sorry @valentinpalkovic, I don't recollect why I had requested this feature. I think we don't need it, .json file will be enough. Let us close this request.