-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Add a --basic
flag to the create-react-admin
package to skip interactive steps
#10481
Conversation
} else if (cli.flags.basic) { | ||
render( | ||
<App | ||
name={cli.input.length > 0 ? cli.input[0] : undefined} | ||
dataProvider="none" | ||
authProvider="none" | ||
resources={[]} | ||
install="skip" | ||
/> | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid an else if
by declaring local dataProvider
, authProvider
, resource
and skip
variables, initialize them depending on the cli.flags
and then render the App
Co-authored-by: Gildas Garcia <1122076+djhi@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After testing, I notice that the generated App.tsx
file still contains the guessers imports but they are not used anymore. You should modify generateAppFile.ts
accordingly.
I don't think that's a regression caused by this PR, plus it may be useful for beginners (and for the tutorial). |
Problem
To get a non-interactive `create-react-admin`, one must pass all options:
This is super verbose, especially in documentation.
Solution
Add a
--basic
option that replaces all the othersHow To Test
On the
xx
branch, build the cli:Create a new project with npx:
Create another one with the local version of the cli:
Compare folders:
Additional Checks
master
for a bugfix, ornext
for a feature[ ] The PR includes unit tests (if not possible, describe why)[ ] The PR includes one or several stories (if not possible, describe why)help
flag)[ ] The documentation is up to date