voidable-hotwire 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 383061c49371adb1c779cd6137079515feacc4efd7a0d0c94cfd20433899e92e
|
|
4
|
+
data.tar.gz: 5b56bb49ef638341b2528b1d884ac4c239437dcd4c024c1b39088a1bdaa76153
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7c8776a82f85f8466393d6970d6213336c919767db5ebe0b04d9edacdea5002bc610efc52e0d55b106e5b38dd43f93e5d74a2f3512ca56e7e2bdff64ba04be7e
|
|
7
|
+
data.tar.gz: 9997e86f1f8c54f8a3517d629cc7b8cc1dba0d63b5db22d0d2a7c54ed6674023f0704952b402449cda3b05e89d121ddaeb91aab3ff9f0185e332d5f05ce6ab1e
|
|
@@ -107,16 +107,25 @@ module Voidable
|
|
|
107
107
|
def add_js_import
|
|
108
108
|
js_entrypoint = "app/javascript/application.js"
|
|
109
109
|
return unless File.exist?(js_entrypoint)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
110
|
+
contents = File.read(js_entrypoint)
|
|
111
|
+
unless contents.include?("@voidable/ui")
|
|
112
|
+
prepend_to_file js_entrypoint, "import \"@voidable/ui\";\nimport \"@voidable/ui-hotwire\";\n\n"
|
|
113
|
+
end
|
|
114
|
+
if vite? && !contents.include?("voidable-layout.js")
|
|
115
|
+
css_imports = %w[./application.css]
|
|
116
|
+
case options[:layout]
|
|
117
|
+
when "switching"
|
|
118
|
+
css_imports << "./voidable-layout-topbar.css"
|
|
119
|
+
css_imports << "./voidable-layout-sidebar.css"
|
|
120
|
+
else
|
|
121
|
+
css_imports << "./voidable-layout.css"
|
|
122
|
+
end
|
|
123
|
+
css_imports << "./voidable-devise.css"
|
|
114
124
|
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
JS
|
|
125
|
+
imports = css_imports.map { |f| "import \"#{f}\";" }.join("\n")
|
|
126
|
+
imports += "\nimport \"@voidable/theme\";"
|
|
127
|
+
imports += "\nimport \"./voidable-layout.js\";"
|
|
128
|
+
append_to_file js_entrypoint, "\n#{imports}\n"
|
|
120
129
|
end
|
|
121
130
|
say "Added Voidable imports to application.js", :green
|
|
122
131
|
end
|