m9sh 0.2.5 → 0.2.6
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 +4 -4
- data/lib/m9sh/cli.rb +4 -3
- data/lib/m9sh/setup.rb +57 -126
- data/lib/m9sh/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 713b1bc8189ceef415cd47de7913c446532f80e5b1829ba6f8eddaed9880d694
|
4
|
+
data.tar.gz: 0017bef99ea8058bb0e512fcc4dec31605bce16a114bb7677bb33f8d5b8e5cc0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c786785e431d5bdedd42630491de9c75052c31b5772bff05f2bce422097f5528b390bb44e325a4546c5627db51879ce785d356e27386c812c83a823309cbac43
|
7
|
+
data.tar.gz: d39c9c20cf68d450ec68734058bbd8596de20b299aa451030a7040fe81f27c898d4df6ffdb284abe43c454562974fcd58069328da07c7bfce4bd9f1d03f925b0
|
data/lib/m9sh/cli.rb
CHANGED
@@ -51,10 +51,11 @@ module M9sh
|
|
51
51
|
puts " Component path: #{config.components_path}"
|
52
52
|
puts " JavaScript path: #{config.javascript_path}"
|
53
53
|
puts "\nNext steps:"
|
54
|
-
puts " 1. Run 'npm install' to install Tailwind CSS"
|
54
|
+
puts " 1. Run 'npm install' to install Tailwind CSS v4"
|
55
55
|
puts " 2. Run 'npm run build:css' to build your CSS"
|
56
|
-
puts " 3.
|
57
|
-
puts " 4. Run 'bin/m9sh
|
56
|
+
puts " 3. Add <%= stylesheet_link_tag \"application\", \"data-turbo-track\": \"reload\" %> to your layout"
|
57
|
+
puts " 4. Run 'bin/m9sh list' to see available components"
|
58
|
+
puts " 5. Run 'bin/m9sh add button' to add a component"
|
58
59
|
end
|
59
60
|
|
60
61
|
desc "add COMPONENT", "Add a component (with dependencies)"
|
data/lib/m9sh/setup.rb
CHANGED
@@ -12,7 +12,6 @@ module M9sh
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def run
|
15
|
-
setup_tailwind_config
|
16
15
|
setup_css_file
|
17
16
|
setup_package_json
|
18
17
|
setup_stimulus_registration
|
@@ -21,18 +20,6 @@ module M9sh
|
|
21
20
|
|
22
21
|
private
|
23
22
|
|
24
|
-
def setup_tailwind_config
|
25
|
-
config_path = File.join(@root_path, "tailwind.config.js")
|
26
|
-
|
27
|
-
if File.exist?(config_path)
|
28
|
-
puts " ⏭️ tailwind.config.js already exists, skipping..."
|
29
|
-
return
|
30
|
-
end
|
31
|
-
|
32
|
-
File.write(config_path, tailwind_config_template)
|
33
|
-
puts " ✅ Created tailwind.config.js"
|
34
|
-
end
|
35
|
-
|
36
23
|
def setup_css_file
|
37
24
|
css_dir = File.join(@root_path, "app", "assets", "stylesheets")
|
38
25
|
FileUtils.mkdir_p(css_dir)
|
@@ -63,8 +50,9 @@ module M9sh
|
|
63
50
|
end
|
64
51
|
|
65
52
|
package_data["scripts"]["build:css"] = "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
|
53
|
+
package_data["scripts"]["build:css:watch"] = "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --watch"
|
66
54
|
package_data["devDependencies"] ||= {}
|
67
|
-
package_data["devDependencies"]["tailwindcss"] ||= "^
|
55
|
+
package_data["devDependencies"]["@tailwindcss/cli"] ||= "^4.0.0-beta.3"
|
68
56
|
|
69
57
|
File.write(package_path, JSON.pretty_generate(package_data))
|
70
58
|
puts " ✅ Updated package.json with build:css script"
|
@@ -112,124 +100,66 @@ module M9sh
|
|
112
100
|
|
113
101
|
# Templates
|
114
102
|
|
115
|
-
def tailwind_config_template
|
116
|
-
<<~JS
|
117
|
-
/** @type {import('tailwindcss').Config} */
|
118
|
-
module.exports = {
|
119
|
-
content: [
|
120
|
-
'./app/views/**/*.html.erb',
|
121
|
-
'./app/helpers/**/*.rb',
|
122
|
-
'./app/components/**/*.{rb,erb}',
|
123
|
-
'./app/javascript/**/*.js'
|
124
|
-
],
|
125
|
-
theme: {
|
126
|
-
extend: {
|
127
|
-
colors: {
|
128
|
-
border: "hsl(var(--border))",
|
129
|
-
input: "hsl(var(--input))",
|
130
|
-
ring: "hsl(var(--ring))",
|
131
|
-
background: "hsl(var(--background))",
|
132
|
-
foreground: "hsl(var(--foreground))",
|
133
|
-
primary: {
|
134
|
-
DEFAULT: "hsl(var(--primary))",
|
135
|
-
foreground: "hsl(var(--primary-foreground))",
|
136
|
-
},
|
137
|
-
secondary: {
|
138
|
-
DEFAULT: "hsl(var(--secondary))",
|
139
|
-
foreground: "hsl(var(--secondary-foreground))",
|
140
|
-
},
|
141
|
-
destructive: {
|
142
|
-
DEFAULT: "hsl(var(--destructive))",
|
143
|
-
foreground: "hsl(var(--destructive-foreground))",
|
144
|
-
},
|
145
|
-
muted: {
|
146
|
-
DEFAULT: "hsl(var(--muted))",
|
147
|
-
foreground: "hsl(var(--muted-foreground))",
|
148
|
-
},
|
149
|
-
accent: {
|
150
|
-
DEFAULT: "hsl(var(--accent))",
|
151
|
-
foreground: "hsl(var(--accent-foreground))",
|
152
|
-
},
|
153
|
-
popover: {
|
154
|
-
DEFAULT: "hsl(var(--popover))",
|
155
|
-
foreground: "hsl(var(--popover-foreground))",
|
156
|
-
},
|
157
|
-
card: {
|
158
|
-
DEFAULT: "hsl(var(--card))",
|
159
|
-
foreground: "hsl(var(--card-foreground))",
|
160
|
-
},
|
161
|
-
},
|
162
|
-
borderRadius: {
|
163
|
-
lg: "var(--radius)",
|
164
|
-
md: "calc(var(--radius) - 2px)",
|
165
|
-
sm: "calc(var(--radius) - 4px)",
|
166
|
-
},
|
167
|
-
},
|
168
|
-
},
|
169
|
-
plugins: [],
|
170
|
-
}
|
171
|
-
JS
|
172
|
-
end
|
173
|
-
|
174
103
|
def css_template
|
175
104
|
<<~CSS
|
176
|
-
@import "tailwindcss
|
177
|
-
|
178
|
-
@
|
179
|
-
|
180
|
-
|
181
|
-
:
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
--radius: 0.5rem;
|
202
|
-
}
|
203
|
-
|
204
|
-
.dark {
|
205
|
-
--background: 222.2 84% 4.9%;
|
206
|
-
--foreground: 210 40% 98%;
|
207
|
-
--card: 222.2 84% 4.9%;
|
208
|
-
--card-foreground: 210 40% 98%;
|
209
|
-
--popover: 222.2 84% 4.9%;
|
210
|
-
--popover-foreground: 210 40% 98%;
|
211
|
-
--primary: 210 40% 98%;
|
212
|
-
--primary-foreground: 222.2 47.4% 11.2%;
|
213
|
-
--secondary: 217.2 32.6% 17.5%;
|
214
|
-
--secondary-foreground: 210 40% 98%;
|
215
|
-
--muted: 217.2 32.6% 17.5%;
|
216
|
-
--muted-foreground: 215 20.2% 65.1%;
|
217
|
-
--accent: 217.2 32.6% 17.5%;
|
218
|
-
--accent-foreground: 210 40% 98%;
|
219
|
-
--destructive: 0 62.8% 30.6%;
|
220
|
-
--destructive-foreground: 210 40% 98%;
|
221
|
-
--border: 217.2 32.6% 17.5%;
|
222
|
-
--input: 217.2 32.6% 17.5%;
|
223
|
-
--ring: 212.7 26.8% 83.9%;
|
224
|
-
}
|
105
|
+
@import "tailwindcss";
|
106
|
+
|
107
|
+
@theme {
|
108
|
+
--color-background: 0 0% 100%;
|
109
|
+
--color-foreground: 222.2 84% 4.9%;
|
110
|
+
--color-card: 0 0% 100%;
|
111
|
+
--color-card-foreground: 222.2 84% 4.9%;
|
112
|
+
--color-popover: 0 0% 100%;
|
113
|
+
--color-popover-foreground: 222.2 84% 4.9%;
|
114
|
+
--color-primary: 222.2 47.4% 11.2%;
|
115
|
+
--color-primary-foreground: 210 40% 98%;
|
116
|
+
--color-secondary: 210 40% 96.1%;
|
117
|
+
--color-secondary-foreground: 222.2 47.4% 11.2%;
|
118
|
+
--color-muted: 210 40% 96.1%;
|
119
|
+
--color-muted-foreground: 215.4 16.3% 46.9%;
|
120
|
+
--color-accent: 210 40% 96.1%;
|
121
|
+
--color-accent-foreground: 222.2 47.4% 11.2%;
|
122
|
+
--color-destructive: 0 84.2% 60.2%;
|
123
|
+
--color-destructive-foreground: 210 40% 98%;
|
124
|
+
--color-border: 214.3 31.8% 91.4%;
|
125
|
+
--color-input: 214.3 31.8% 91.4%;
|
126
|
+
--color-ring: 222.2 84% 4.9%;
|
127
|
+
--radius-sm: calc(0.5rem - 4px);
|
128
|
+
--radius-md: calc(0.5rem - 2px);
|
129
|
+
--radius-lg: 0.5rem;
|
225
130
|
}
|
226
131
|
|
227
132
|
@layer base {
|
228
133
|
* {
|
229
|
-
|
134
|
+
border-color: hsl(var(--color-border));
|
230
135
|
}
|
231
136
|
body {
|
232
|
-
|
137
|
+
background-color: hsl(var(--color-background));
|
138
|
+
color: hsl(var(--color-foreground));
|
139
|
+
}
|
140
|
+
}
|
141
|
+
|
142
|
+
@media (prefers-color-scheme: dark) {
|
143
|
+
@theme {
|
144
|
+
--color-background: 222.2 84% 4.9%;
|
145
|
+
--color-foreground: 210 40% 98%;
|
146
|
+
--color-card: 222.2 84% 4.9%;
|
147
|
+
--color-card-foreground: 210 40% 98%;
|
148
|
+
--color-popover: 222.2 84% 4.9%;
|
149
|
+
--color-popover-foreground: 210 40% 98%;
|
150
|
+
--color-primary: 210 40% 98%;
|
151
|
+
--color-primary-foreground: 222.2 47.4% 11.2%;
|
152
|
+
--color-secondary: 217.2 32.6% 17.5%;
|
153
|
+
--color-secondary-foreground: 210 40% 98%;
|
154
|
+
--color-muted: 217.2 32.6% 17.5%;
|
155
|
+
--color-muted-foreground: 215 20.2% 65.1%;
|
156
|
+
--color-accent: 217.2 32.6% 17.5%;
|
157
|
+
--color-accent-foreground: 210 40% 98%;
|
158
|
+
--color-destructive: 0 62.8% 30.6%;
|
159
|
+
--color-destructive-foreground: 210 40% 98%;
|
160
|
+
--color-border: 217.2 32.6% 17.5%;
|
161
|
+
--color-input: 217.2 32.6% 17.5%;
|
162
|
+
--color-ring: 212.7 26.8% 83.9%;
|
233
163
|
}
|
234
164
|
}
|
235
165
|
CSS
|
@@ -240,10 +170,11 @@ module M9sh
|
|
240
170
|
name: "app",
|
241
171
|
private: true,
|
242
172
|
scripts: {
|
243
|
-
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify"
|
173
|
+
"build:css": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --minify",
|
174
|
+
"build:css:watch": "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css --watch"
|
244
175
|
},
|
245
176
|
devDependencies: {
|
246
|
-
tailwindcss: "^
|
177
|
+
"@tailwindcss/cli": "^4.0.0-beta.3"
|
247
178
|
}
|
248
179
|
})
|
249
180
|
end
|
data/lib/m9sh/version.rb
CHANGED