root-systems / create-dogstack-app

create a new dogstack app and scaffold files + folders
5 stars 2 forks source link

scaffold CRUD pages when creating apps / topics / types #7

Open iainkirkpatrick opened 6 years ago

iainkirkpatrick commented 6 years ago

instead of blank components / containers, instead create CRUD functionality per topic when scaffolding as this will be more generally useful for our real apps.

this might involve multiple components per topic, or maybe not - depends on the UX we decide.

iainkirkpatrick commented 6 years ago

maybe still have a CLI arg or something to generate blank components / containers if desired when using createTopic or createType?

danalexilewis commented 6 years ago

@iainkirkpatrik —blank as a flag?

danalexilewis commented 6 years ago

@iainkirkpatrick Are you thinking of basing the crud pages on a data structure representing a table or the return from a getter?

It would be cool to do both :)

Also are you thinking of using typescript interfaces, yaml, json schema or something else for documenting the data shape?

iainkirkpatrick commented 6 years ago

@agentlewis the return from a getter makes sense to me (if i'm interpreting you correctly) - i'm imagining though, at least as a first pass, that generating CRUD pages for a topic is based on a super simple default table - just 'id' and 'name'. i.e. the generator creates a migration for a table with those columns, a getter for state, and the pages associated with CRUD (list view, single item view). once those have been generated, the user can always go and edit the migration and the getter.

and then as a second pass perhaps there is some flag / prompt to allow passing a schema definition to generate the table off of - and yeah, haven't thought too much about what format that could be - perhaps json schema?