develop-mental-llc / create-react-admin-amplify-app

2 stars 0 forks source link

Generator #3

Open tcodes0 opened 4 years ago

tcodes0 commented 4 years ago

I think we can get most of the generation done using a cli helper (like commander) and some nodejs code. We'd be mostly automating the process of calling the CRA and NPM manually. I think that should get us pretty fat.

App.js would be a little harder. I'm thinking we can host a sample App.js file for each use-case and just download that to user's repo. Also possible to manipulate the code directly using AST.

DCarper commented 4 years ago

Great thinking, with you on all of it. A question though,

App.js would be a little harder. I'm thinking we can host a sample App.js file for each use-case and just download that to user's repo. Also possible to manipulate the code directly using AST.

What are the use-cases you're seeing?

I had initially envisioned one standard app.js file which would be part of craaa and simply copied into place

tcodes0 commented 4 years ago

So far only one use case: The graphql api can have multiple auth modes and these mode have different code on App.js. The current App.js is based off of gregoire's demo and I'm taking it a little further to make sure it's all working together.

here: https://github.com/develop-mental-llc/create-react-admin-amplify-app/blob/a6cbd16942b3fb7335b0ff44dfcd544a8ee83604/demo/src/App.tsx#L20

Amplify supports four auth mode I think, gregoire's library supports cognito by default but during amplify setup user is given all four choices

DCarper commented 4 years ago

Hmmmm ya... And auth is one thing that definitely benefits from automated defaults.

Can we abstract the auth and inject it through a consistent interface/application in app.js

DCarper commented 4 years ago

Also, at this point for minimum viable/delightful product I'm personally okay with it just supporting incognito... Open to other perspectives though