frozen_rails 0.0.6 → 0.0.8
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/frozen_rails/version.rb +1 -1
- data/lib/generators/frozen/templates/ui/application.html.erb +6 -1
- data/lib/generators/frozen/templates/ui/lib/generators/component/component_generator.rb +6 -5
- data/lib/generators/frozen/templates/ui/lookbook/component_preview.html.erb +21 -0
- data/lib/generators/frozen/ui_generator.rb +6 -1
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b5bb2f03024a8d7fe0378a3bc7bf968947e1a1f93972d0531da354a5971e182d
|
|
4
|
+
data.tar.gz: 6178832be002fb37d3dffb32d3209142facc34cbaf8a0c97bbd8a5bcbbca416f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 7874f3f9d5634b77f00e4873df2688ecd75f3964e31e73b6a01677418375583aa119bfdce42ab402baaf3cf6e2a15754d29cb088bd541d68245c692d5b28f3f4
|
|
7
|
+
data.tar.gz: c4e2fb6e64e819eb4665fcb09527dbc149c721f6720eda96e5957f98c127809cae5f977de7d92b62b1e0b9d1b4a4e39bad561c8d5c9fbf35b45207e2af0cef35
|
data/lib/frozen_rails/version.rb
CHANGED
|
@@ -17,7 +17,12 @@
|
|
|
17
17
|
<link rel="icon" href="/icon.png" type="image/png">
|
|
18
18
|
<link rel="icon" href="/icon.svg" type="image/svg+xml">
|
|
19
19
|
<link rel="apple-touch-icon" href="/icon.png">
|
|
20
|
-
|
|
20
|
+
<%# Use propshaft in development and precompiled_assets in production. Very brittle. %>
|
|
21
|
+
<% if Rails.env.development? %>
|
|
22
|
+
<%= stylesheet_link_tag :app %>
|
|
23
|
+
<% else %>
|
|
24
|
+
<%= stylesheet_link_tag "application" %>
|
|
25
|
+
<% end %>
|
|
21
26
|
<%= javascript_include_tag "application", type: "module", defer: true %>
|
|
22
27
|
</head>
|
|
23
28
|
|
|
@@ -29,11 +29,12 @@ class ComponentGenerator < Rails::Generators::NamedBase
|
|
|
29
29
|
template "jasmine_spec.js.tt", File.join("test/components", class_path, "#{file_name}_component_spec.js")
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
end
|
|
32
|
+
# Needs to only apply to files with a git diff. Otherwise, very annoying.
|
|
33
|
+
# def fix_module_nesting_via_rubocop_because_it_was_impossible_to_get_module_namespacing_to_work_as_expected
|
|
34
|
+
# in_root do
|
|
35
|
+
# system("bash", "-c", 'bin/rubocop --only Style/ClassAndModuleChildren,Layout/IndentationWidth,Layout/CommentIndentation --autocorrect-all --force-exclusion --config <(echo "Style/ClassAndModuleChildren: { EnforcedStyle: nested }")')
|
|
36
|
+
# end
|
|
37
|
+
# end
|
|
37
38
|
|
|
38
39
|
private
|
|
39
40
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html style="background-color: <%= params.dig(:lookbook, :display, :bg_color) || "white" %>">
|
|
3
|
+
<head>
|
|
4
|
+
<title>Component Preview</title>
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
|
|
7
|
+
<%# Use propshaft in development and precompiled_assets in production. Very brittle. %>
|
|
8
|
+
<% if Rails.env.development? %>
|
|
9
|
+
<%= stylesheet_link_tag :app, media: 'all' %>
|
|
10
|
+
<% else %>
|
|
11
|
+
<%= stylesheet_link_tag "application", media: 'all' %>
|
|
12
|
+
<% end %>
|
|
13
|
+
<%= javascript_include_tag 'application' %>
|
|
14
|
+
</head>
|
|
15
|
+
|
|
16
|
+
<body style="padding: 20px">
|
|
17
|
+
<div style="margin-left: auto; margin-right: auto; max-width: <%= params.dig(:lookbook, :display, :max_width) || "100%" %>">
|
|
18
|
+
<%= yield %>
|
|
19
|
+
</div>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
|
@@ -130,12 +130,16 @@ YAML4
|
|
|
130
130
|
config.view_component.generate.preview = true
|
|
131
131
|
config.view_component.generate.preview_path = "test/components"
|
|
132
132
|
config.view_component.generate.locale = true
|
|
133
|
+
config.view_component.previews.default_layout = "component_preview"
|
|
133
134
|
config.asset_path = "/assets"
|
|
135
|
+
# Use propshaft in development and precompiled_assets in production. Very brittle.
|
|
136
|
+
config.assets.paths << Rails.root.join("app/assets") if Rails.env.development?
|
|
134
137
|
RUBY
|
|
135
138
|
end
|
|
136
139
|
|
|
137
140
|
def setup_lookbook
|
|
138
141
|
copy_file "lookbook/lookbook_helper.rb", "app/helpers/lookbook_helper.rb"
|
|
142
|
+
copy_file "lookbook/component_preview.html.erb", "app/views/layouts/component_preview.html.erb"
|
|
139
143
|
|
|
140
144
|
config = <<~RUBY
|
|
141
145
|
# frozen:ui
|
|
@@ -168,7 +172,8 @@ YAML4
|
|
|
168
172
|
|
|
169
173
|
def copy_demo_component
|
|
170
174
|
copy_directory "demo_component", "app/components"
|
|
171
|
-
|
|
175
|
+
empty_directory "test/components"
|
|
176
|
+
copy_directory "demo_component_test", "test/components"
|
|
172
177
|
end
|
|
173
178
|
end
|
|
174
179
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: frozen_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.0.
|
|
4
|
+
version: 0.0.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Klaus Weidinger
|
|
@@ -135,6 +135,7 @@ files:
|
|
|
135
135
|
- lib/generators/frozen/templates/ui/lib/templates/view_component/frozen_extensions/unpoly_compiler.js.tt
|
|
136
136
|
- lib/generators/frozen/templates/ui/lib/templates/view_component/frozen_extensions/view_spec.rb.tt
|
|
137
137
|
- lib/generators/frozen/templates/ui/lib/templates/view_component/preview/component_preview.rb.tt
|
|
138
|
+
- lib/generators/frozen/templates/ui/lookbook/component_preview.html.erb
|
|
138
139
|
- lib/generators/frozen/templates/ui/lookbook/lookbook_helper.rb
|
|
139
140
|
- lib/generators/frozen/ui_generator.rb
|
|
140
141
|
homepage: https://github.com/dunkelziffer/frozen_rails
|