Set up Hotwire (importmap, Turbo, Stimulus) and fix bin/ci

The app was generated with 'rails new --skip', which skipped the
JavaScript install step, leaving bin/importmap missing and bin/ci's
importmap audit failing. Run the importmap, turbo, and stimulus install
generators to wire up Hotwire per PRD 10.1/10.2 and restore bin/ci.
This commit is contained in:
2026-06-07 21:03:41 -03:00
parent 1a1308e0fc
commit 282d2d75f5
8 changed files with 35 additions and 0 deletions

View File

@@ -0,0 +1,3 @@
// Configure your import map in config/importmap.rb. Read more: https://github.com/rails/importmap-rails
import "@hotwired/turbo-rails"
import "controllers"

View File

@@ -0,0 +1,9 @@
import { Application } from "@hotwired/stimulus"
const application = Application.start()
// Configure Stimulus development experience
application.debug = false
window.Stimulus = application
export { application }

View File

@@ -0,0 +1,7 @@
import { Controller } from "@hotwired/stimulus"
export default class extends Controller {
connect() {
this.element.textContent = "Hello World!"
}
}

View File

@@ -0,0 +1,4 @@
// Import and register all your controllers from the importmap via controllers/**/*_controller
import { application } from "controllers/application"
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
eagerLoadControllersFrom("controllers", application)