-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Conversation
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.
I'm not sufre I understand how you fixed the test
"module": "ESNext", | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ |
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.
this isn't valid JSON
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.
But it's valid tsconfig though
@@ -1,5 +1,6 @@ | |||
{ | |||
"private": true, | |||
"type": "module", |
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.
that's a strong choice. If it forces users to use cjs instead of js, I'm -1 for it.
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.
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: { |
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.
Why did you remove it?
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.
Because it's unnecessary
"skipLibCheck": true, | ||
"types": ["vitest/globals"], | ||
|
||
/* Bundler mode */ |
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.
same
@@ -5,9 +5,6 @@ import react from '@vitejs/plugin-react'; | |||
// https://vitejs.dev/config/ | |||
export default defineConfig({ | |||
plugins: [react()], | |||
define: { |
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.
same
create-react-admin
CLI to generate valid react-admin v5 apps
Problem
create-react-admin
tests fail onmaster
Solution
create-react-admin
dependenciesHow 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