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

Fix create-react-admin CLI to generate valid react-admin v5 apps #10131

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

djhi
Copy link
Contributor

@djhi djhi commented Aug 6, 2024

Problem

create-react-admin tests fail on master

Solution

  • Update create-react-admin dependencies
  • Fix default template according to default vite template for react
  • Fix the tests

How To Test

In react-admin repository clone directory:

  • make build-create-react-admin install

In a directory one level above the react-admin repository clone:

  • ./node_modules/.bin/create-react-admin myadmin --data-provider ra-data-fakerest --auth-provider local-auth-provider --install npm
  • cd myadmin
  • npm run test

@djhi djhi added the RFR Ready For Review label Aug 6, 2024
Copy link
Member

@fzaninotto fzaninotto left a comment

Choose a reason for hiding this comment

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

I'm not sufre I understand how you fixed the test

"module": "ESNext",
"skipLibCheck": true,

/* Bundler mode */
Copy link
Member

Choose a reason for hiding this comment

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

this isn't valid JSON

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But it's valid tsconfig though

@@ -1,5 +1,6 @@
{
"private": true,
"type": "module",
Copy link
Member

Choose a reason for hiding this comment

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

that's a strong choice. If it forces users to use cjs instead of js, I'm -1 for it.

Copy link
Contributor Author

@djhi djhi Aug 6, 2024

Choose a reason for hiding this comment

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

This is the default for vite templates with TS/React and thanks to the TS config it just work (moduleResolution=Bundler)

@@ -4,9 +4,6 @@ import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
define: {
Copy link
Member

Choose a reason for hiding this comment

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

Why did you remove it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's unnecessary

"skipLibCheck": true,
"types": ["vitest/globals"],

/* Bundler mode */
Copy link
Member

Choose a reason for hiding this comment

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

same

@@ -5,9 +5,6 @@ import react from '@vitejs/plugin-react';
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
define: {
Copy link
Member

Choose a reason for hiding this comment

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

same

@fzaninotto fzaninotto merged commit a7340a3 into master Aug 6, 2024
14 checks passed
@fzaninotto fzaninotto deleted the update-create-react-admin branch August 6, 2024 15:40
@fzaninotto fzaninotto added this to the 5.1.2 milestone Aug 6, 2024
@fzaninotto fzaninotto changed the title Update and fix create-react-admin Fix create-react-admin CLI to generate valid react-admin v5 apps Aug 19, 2024
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.

2 participants