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

Automatic code generation for Fluent #176

Closed
brunobl opened this issue May 25, 2017 · 6 comments
Closed

Automatic code generation for Fluent #176

brunobl opened this issue May 25, 2017 · 6 comments
Assignees
Labels
enhancement New feature or request

Comments

@brunobl
Copy link

brunobl commented May 25, 2017

It would be great to enhance vapor cli to add something similar to phx.gen, ie automatic code generator for model and controller based on a quick model description.

http://www.phoenixframework.org/docs/ecto-models

At least the phx.gen.api side at first would be useful. (their documentation isn't up to date, it's now called phx.gen.api instead of phoenix.gen.api)

@tanner0101 tanner0101 added the enhancement New feature or request label May 26, 2017
@tanner0101 tanner0101 self-assigned this May 26, 2017
@brunobl
Copy link
Author

brunobl commented May 27, 2017

I think this could be done step by step as they did:
https://hexdocs.pm/phoenix/Mix.Tasks.Phoenix.Gen.Model.html

  1. Simple Model generator
    vapor gen.fluentmodel User name:string age:integer

  2. Model generator with references
    vapor gen.fluentmodel Post title user_id:references:User

  3. JSON-api generator
    vapor gen.jsonapi Post title user_id:references:User

  4. Leaf generator
    vapor gen.leafhtml User name:string age:integer

@Joannis
Copy link
Member

Joannis commented Sep 18, 2017

Obsolete thanks to Codable?

@steffendsommer
Copy link
Member

Although this might not be what you want, but we recently created this repo for sharing our sourcery templates for faster scaffolding of Vapor code: https://github.com/nodes-vapor/sourcery-templates

Sorry for the lack of documentation at this point.

@brunobl
Copy link
Author

brunobl commented Sep 23, 2017 via email

@Joannis
Copy link
Member

Joannis commented Sep 23, 2017

@brunobl most of this can be easily taken over using Swift 4's Codables. They generate boilerplate code for your database, JSON and other models.

@0xTim
Copy link
Member

0xTim commented Jan 25, 2024

Closing as a dupe of #397

@0xTim 0xTim closed this as not planned Won't fix, can't repro, duplicate, stale Jan 25, 2024
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

5 participants