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

Rename generated files and classes #2

Closed
cdcarson opened this issue Aug 6, 2023 · 0 comments · Fixed by #4
Closed

Rename generated files and classes #2

cdcarson opened this issue Aug 6, 2023 · 0 comments · Fixed by #4

Comments

@cdcarson
Copy link
Owner

cdcarson commented Aug 6, 2023

While writing the docs I realized that the filenames are not really friendly.

  • It's not obvious that schema-definition.d.ts is where you edit the schema, plus it kinda conflicts with generated/schema-definition.js
  • The *-db names are not adequately grouped
  • There are too many files on this level. The only file that really needs to be at the top of generated if models.d.ts. (Since it's the only one that deals with type imports.
  • Everything should be exported from index.js. There's a potential gotcha -- do we then need to have more d.ts files? Need to check that.
  • While we're at it, change the class names to be ApplicationDatabase, ModelsDatabase and TransactionDatabase, with matching filenames.

So, new structure:

  • [outputPath]
    • model-types.d.ts
    • generated
      • index.js
      • models.d.ts
      • database-classes
        • application-database.js
        • models-database.js
        • transaction-database.js
      • schema
        • schema-definition.js
        • schema-cast-map.js
      • search
        • search-indexes.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant