Skip to content

Commit 92f83bc

Browse files
Update asset manifest and importmap configuration
- Replace application.js with new path for leva/application.js - Adjust asset manifest to link JavaScript files from ../../javascript/leva - Update importmap to pin controllers from the new leva/controllers directory - Clean up unnecessary links and ensure proper file structure 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <[email protected]>
1 parent cb5cf4d commit 92f83bc

File tree

4 files changed

+7
-14
lines changed

4 files changed

+7
-14
lines changed

app/assets/config/leva_manifest.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
11
//= link_directory ../stylesheets/leva .css
2-
//= link_directory ../builds/leva .css
3-
//= link application.js
4-
//= link_tree ../../javascript/controllers .js
5-
//= link_tree ../../../vendor/javascript .js
2+
//= link_directory ../../javascript/leva .js
3+
//= link_tree ../../javascript/leva/controllers .js

app/javascript/application.js

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/javascript/controllers/index.js

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
1-
// Import and register all your controllers from the importmap
2-
3-
import { application } from "controllers/application"
1+
import { application } from "controllers/application";
42

53
// Eager load all controllers defined in the import map under controllers/**/*_controller
6-
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
7-
eagerLoadControllersFrom("controllers", application)
4+
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading";
5+
eagerLoadControllersFrom("controllers", application);

config/importmap.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
# Pin npm packages by running ./bin/importmap
2+
pin "application", to: "leva/application.js", preload: true
23

3-
pin "application", preload: true
44
pin "@hotwired/stimulus", to: "stimulus.min.js"
55
pin "@hotwired/stimulus-loading", to: "stimulus-loading.js"
66

77
# Pin controllers using the engine pattern
8-
pin_all_from Leva::Engine.root.join("app/javascript/controllers"), under: "controllers", to: "controllers"
8+
pin_all_from Leva::Engine.root.join("app/javascript/leva/controllers"), under: "controllers", to: "leva/controllers"
99

1010
# Pin marked for markdown parsing
1111
pin "marked", to: "https://cdn.jsdelivr.net/npm/[email protected]/+esm"

0 commit comments

Comments
 (0)