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

Refactor create-react-admin and support ra-supabase #10511

Merged
merged 14 commits into from
Feb 19, 2025

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Feb 12, 2025

Problem

The interactive mode forces us to document the choices to select, which makes tutorials a bit harder to follow. The recent introduction of the --basic flag only addresses one particular case.

We also want to promote ra-supabase.

TODO

Solution

  • Make the interactive mode optional. By default, create-react-admin will create an empty react-admin app (no data provider, no auth provider, no resource, npm)

    npx create-react-admin myAdmin
    

    Users who want to use interactive mode must specify it:

    npx create-react-admin --interactive myAdmin
    

    Users who want to override one option can do so in the command line

    npx create-react-admin --dataProvider ra-data-json-server --resources posts,users myAdmin
    
  • Remove the --basic option, which is now useless

  • Add support for provider shortcuts (fakerest -> ra-data-fakerest, etc)

  • Add support for more package managers (bun and pnpm)

  • Add support for ra-supabase

How To Test

  • make build-create-react-admin install
  • Then test any combination of flags

It's difficult, even impossible for yarn, to test the detection of the package manager used to run the command:

  • bun run ./node_modules/.bin/create-react-admin should use bun as the installer (a bun lock file will be generated)
  • npm run ./node_modules/.bin/create-react-admin should use npm as the installer (a npm lock file will be generated)

Additional Checks

  • The PR targets master for a bugfix, or next for a feature

@slax57 slax57 self-requested a review February 13, 2025 10:44
Copy link
Contributor

@slax57 slax57 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also found some issues while testing

  • instructions in the generated Readme only mention npm and yarn

  • creating an app with pnpm throws errors at runtime

✘ [ERROR] Could not read from file: /home/slax57/workspaces/remove-me/node_modules/ra-ui-materialui/src

    node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected]/node_modules/react-admin/src/index.ts:4:14:
      4 │ export * from 'ra-ui-materialui';

I believe it comes from the Vite config.

  • creating an app with supabase (and npm) throws error at runtime
You cannot render a <Router> inside another <Router>. You should never have more than one in your app.

I believe duplicate comes from ra-supabase-ui-materialui

  • Installing an app with bun or pnpm still says Start the app in development mode by running yarn dev. (yarn)

@slax57 slax57 added this to the 5.6.0 milestone Feb 19, 2025
@slax57 slax57 merged commit bb92631 into next Feb 19, 2025
16 checks passed
@slax57 slax57 deleted the refactor-create-react-admin branch February 19, 2025 09:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants