seagull-js / seagull-cli

The best way to start, develop and deploy Seagull Apps.
https://seagull-js.github.io/seagull-cli/
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Enhance: "seagull add model" #12

Closed Anonyfox closed 6 years ago

Anonyfox commented 7 years ago

Document and implement a proper CLI syntax for model generation. Ideally something like:

seagull add model Todo text:string done:boolean

Which should result in the generated file (including default values):

import { field, Model } from '@seagull-js/seagull'

export default class Todo extends Model {
  @field done: boolean = false
  @field text: string = ''
}

Bonus: it must not be possible to scaffold reserved properties via CLI. This means, deny if the user wants to generate id, createdAt, ... .

Anonyfox commented 6 years ago

automatic field generation implemented with all-new code generator