diff --git a/assets/app.js b/assets/app.js new file mode 100644 index 0000000..06118dd --- /dev/null +++ b/assets/app.js @@ -0,0 +1,2 @@ +import './bootstrap.js'; +import './styles/app.css'; diff --git a/assets/bootstrap.js b/assets/bootstrap.js new file mode 100644 index 0000000..08eb8cd --- /dev/null +++ b/assets/bootstrap.js @@ -0,0 +1,6 @@ +import { startStimulusApp } from '@symfony/stimulus-bundle'; +import { registerReactControllerComponents } from '@symfony/ux-react'; + +const app = startStimulusApp(); + +registerReactControllerComponents(require.context('./react/controllers', true, /\.(j|t)sx?$/)); diff --git a/assets/controllers.json b/assets/controllers.json index 29ea244..5a294cf 100644 --- a/assets/controllers.json +++ b/assets/controllers.json @@ -9,6 +9,12 @@ "enabled": false, "fetch": "eager" } + }, + "@symfony/ux-react": { + "react": { + "enabled": true, + "fetch": "eager" + } } }, "entrypoints": [] diff --git a/assets/stimulus_bootstrap.js b/assets/stimulus_bootstrap.js deleted file mode 100644 index d4e50c9..0000000 --- a/assets/stimulus_bootstrap.js +++ /dev/null @@ -1,5 +0,0 @@ -import { startStimulusApp } from '@symfony/stimulus-bundle'; - -const app = startStimulusApp(); -// register any custom, 3rd party controllers here -// app.register('some_controller_name', SomeImportedController); diff --git a/assets/styles/app.css b/assets/styles/app.css new file mode 100644 index 0000000..e69de29 diff --git a/package.json b/package.json new file mode 100644 index 0000000..66cdccd --- /dev/null +++ b/package.json @@ -0,0 +1,21 @@ +{ + "name": "ltbxd-actorle", + "private": true, + "scripts": { + "dev": "vite", + "build": "vite build" + }, + "dependencies": { + "@floating-ui/react": "^0.27", + "@hotwired/stimulus": "^3.2", + "@hotwired/turbo": "^7.3", + "@symfony/stimulus-bundle": "file:vendor/symfony/stimulus-bundle/assets", + "@symfony/ux-react": "file:vendor/symfony/ux-react/assets", + "react": "^19.0", + "react-dom": "^19.0" + }, + "devDependencies": { + "@vitejs/plugin-react": "^4.3", + "vite": "^6.0" + } +} diff --git a/vite.config.js b/vite.config.js new file mode 100644 index 0000000..e056bb2 --- /dev/null +++ b/vite.config.js @@ -0,0 +1,23 @@ +import { defineConfig } from 'vite'; +import react from '@vitejs/plugin-react'; +import symfonyPlugin from 'vite-plugin-symfony'; + +export default defineConfig({ + plugins: [ + react(), + symfonyPlugin(), + ], + build: { + rollupOptions: { + input: { + app: './assets/app.js', + }, + }, + }, + server: { + host: '0.0.0.0', + port: 5173, + strictPort: true, + origin: 'http://localhost:5173', + }, +});