avo 2.14.3.pre.3.jsbundling → 2.14.3.pre.6.nosprockets
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of avo might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/stylesheets/{avo.css → avo.base.css} +0 -0
- data/app/components/avo/base_component.rb +2 -3
- data/app/components/avo/index/resource_table_component.rb +1 -1
- data/app/components/avo/resource_component.rb +3 -2
- data/app/components/avo/sidebar_component.html.erb +1 -1
- data/app/components/avo/views/resource_edit_component.rb +0 -2
- data/app/controllers/avo/debug_controller.rb +3 -5
- data/app/controllers/avo/team_users_controller.rb +4 -0
- data/app/helpers/avo/application_helper.rb +8 -2
- data/app/views/avo/debug/index.html.erb +13 -10
- data/app/views/avo/sidebar/_license_warnings.html.erb +1 -1
- data/app/views/layouts/avo/application.html.erb +3 -3
- data/lib/avo/app.rb +2 -2
- data/lib/avo/base_resource.rb +5 -1
- data/lib/avo/concerns/fetches_things.rb +13 -2
- data/lib/avo/configuration.rb +2 -0
- data/lib/avo/licensing/h_q.rb +23 -1
- data/lib/avo/licensing/license_manager.rb +1 -1
- data/lib/avo/svg_finder.rb +8 -5
- data/lib/avo/version.rb +1 -1
- data/lib/generators/avo/base_generator.rb +5 -1
- data/lib/generators/avo/tailwindcss/install_generator.rb +54 -0
- data/lib/generators/avo/templates/initializer/avo.tt +10 -7
- data/lib/generators/avo/templates/tailwindcss/Procfile.dev +2 -0
- data/lib/generators/avo/templates/tailwindcss/avo.tailwind.css +13 -0
- data/lib/tasks/avo_tasks.rake +8 -8
- data/lib/tasks/tailwindcss_rails.rake +24 -0
- data/public/avo-assets/{avo.css → avo.base.css} +0 -0
- metadata +9 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565538415a5ed1733da872c8903dc0cddf6a24558cca9e040a6f7b768ad82f7f
|
4
|
+
data.tar.gz: 3dfc9368da855f08dda7d1fcb21c2f3c69a733e5897cd171cc1a06907086e1c1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 969484a4ccd27ef10c6d4ca5436ea3fc06cc21d49cc94400d80a6b589e103fe4aa34b64aea03536f0f1a3b120b067fe7f9c8db74606c52e6aa116e938bbd4d39
|
7
|
+
data.tar.gz: ceaf6c589699126528d1408f50f3321da8ac33d7a313de9881b797d882a6d01dbf3c77cce57d788102516f5d343f857044d51f9c8846023c944cd27ad3b0a357
|
data/Gemfile.lock
CHANGED
File without changes
|
@@ -9,10 +9,9 @@ class Avo::BaseComponent < ViewComponent::Base
|
|
9
9
|
|
10
10
|
private
|
11
11
|
|
12
|
-
#
|
12
|
+
# Use the @parent_resource to fetch the field using the @reflection name.
|
13
13
|
def field
|
14
|
-
|
15
|
-
fields.find { |f| f.id == @reflection.name }
|
14
|
+
@parent_resource.get_field_definitions.find { |f| f.id == @reflection.name }
|
16
15
|
rescue
|
17
16
|
nil
|
18
17
|
end
|
@@ -4,6 +4,7 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
4
4
|
attr_reader :has_many_panels
|
5
5
|
attr_reader :has_as_belongs_to_many_panels
|
6
6
|
attr_reader :resource_tools
|
7
|
+
attr_reader :resource
|
7
8
|
attr_reader :view
|
8
9
|
|
9
10
|
def can_create?
|
@@ -19,7 +20,7 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
19
20
|
end
|
20
21
|
|
21
22
|
def can_detach?
|
22
|
-
authorize_association_for(
|
23
|
+
authorize_association_for(:detach)
|
23
24
|
end
|
24
25
|
|
25
26
|
def detach_path
|
@@ -53,7 +54,7 @@ class Avo::ResourceComponent < Avo::BaseComponent
|
|
53
54
|
|
54
55
|
if @reflection.present?
|
55
56
|
# Fetch the appropiate resource
|
56
|
-
reflection_resource =
|
57
|
+
reflection_resource = field.resource
|
57
58
|
# Fetch the model
|
58
59
|
# Hydrate the resource with the model if we have one
|
59
60
|
reflection_resource.hydrate(model: @parent_model) if @parent_model.present?
|
@@ -57,7 +57,7 @@
|
|
57
57
|
<%= render partial: "/avo/partials/sidebar_extra" %>
|
58
58
|
</div>
|
59
59
|
</div>
|
60
|
-
<%= helpers.render_license_warnings %>
|
60
|
+
<%= helpers.render_license_warnings unless Rails.env.production? %>
|
61
61
|
<%= render Avo::SidebarProfileComponent.new user: helpers._current_user %>
|
62
62
|
</div>
|
63
63
|
</div>
|
@@ -13,12 +13,10 @@ module Avo
|
|
13
13
|
|
14
14
|
if license.valid?
|
15
15
|
flash[:notice] = "avohq.io responded: \"#{license.id.humanize} license is valid\"."
|
16
|
+
elsif license.response['reason'].present?
|
17
|
+
flash[:error] = "avohq.io responded: \"#{license.response['reason']}\"."
|
16
18
|
else
|
17
|
-
|
18
|
-
flash[:error] = "avohq.io responded: \"#{license.response['reason']}\"."
|
19
|
-
else
|
20
|
-
flash[:error] = license.response['error']
|
21
|
-
end
|
19
|
+
flash[:error] = license.response['error']
|
22
20
|
end
|
23
21
|
|
24
22
|
redirect_back fallback_location: avo.avo_private_debug_index_path
|
@@ -70,8 +70,14 @@ module Avo
|
|
70
70
|
|
71
71
|
file_name = "#{file_name}.svg" unless file_name.end_with? ".svg"
|
72
72
|
|
73
|
-
|
74
|
-
|
73
|
+
if defined?(Webpacker)
|
74
|
+
with_asset_finder(Webpacker::WebpackAssetFinder) do
|
75
|
+
inline_svg file_name, **args
|
76
|
+
end
|
77
|
+
else
|
78
|
+
with_asset_finder(::Avo::SvgFinder) do
|
79
|
+
inline_svg file_name, **args
|
80
|
+
end
|
75
81
|
end
|
76
82
|
end
|
77
83
|
|
@@ -20,7 +20,20 @@
|
|
20
20
|
<% c.bare_content do %>
|
21
21
|
<div class="grid gap-4 sm:grid-cols-3">
|
22
22
|
<div class="relative flex flex-col bg-white rounded shadow-panel p-4 space-y-4 h-full col-span-1">
|
23
|
+
<div class="flex justify-between w-full">
|
23
24
|
<div class="font-semibold">License info</div>
|
25
|
+
<div class="flex justify-self-end">
|
26
|
+
<%= a_button style: :outline,
|
27
|
+
color: :blue,
|
28
|
+
url: "#{root_path}avo_private/debug/refresh_license",
|
29
|
+
method: :post,
|
30
|
+
loading: true,
|
31
|
+
size: :xs,
|
32
|
+
icon: 'heroicons/outline/refresh' do %>
|
33
|
+
Refresh license
|
34
|
+
<% end %>
|
35
|
+
</div>
|
36
|
+
</div>
|
24
37
|
<div class="flex flex-col flex-1">
|
25
38
|
<div>
|
26
39
|
<div class="text-xl font-semibold"><%= license.name %></div>
|
@@ -54,16 +67,6 @@
|
|
54
67
|
</dl>
|
55
68
|
</div>
|
56
69
|
</div>
|
57
|
-
<div class="flex justify-end mt-4">
|
58
|
-
<%= a_button style: :outline,
|
59
|
-
color: :blue,
|
60
|
-
url: "#{root_path}avo_private/debug/refresh_license",
|
61
|
-
method: :post,
|
62
|
-
loading: true,
|
63
|
-
icon: 'heroicons/outline/refresh' do %>
|
64
|
-
Refresh license
|
65
|
-
<% end %>
|
66
|
-
</div>
|
67
70
|
</div>
|
68
71
|
</div>
|
69
72
|
<div class="relative bg-white rounded shadow-panel p-4 space-y-4 col-span-2">
|
@@ -2,5 +2,5 @@
|
|
2
2
|
<%= render_license_warning title: 'Trial Mode', message: 'You are experiencing paid features that need to be licensed before deploying this site. Enjoy!' %>
|
3
3
|
<% end %>
|
4
4
|
<% if license[:error].present? && !(Avo.configuration.display_license_request_timeout_error === false && license[:error] === "Request timeout.") %>
|
5
|
-
<%= render_license_warning title: 'Avo HQ Error', message: "#{license[:error]}
|
5
|
+
<%= render_license_warning title: 'Avo HQ Error', message: "#{license[:error]} Checking back every 5 minutes." %>
|
6
6
|
<% end %>
|
@@ -6,17 +6,17 @@
|
|
6
6
|
<%= csrf_meta_tags %>
|
7
7
|
<%= csp_meta_tag %>
|
8
8
|
<%= render partial: 'avo/partials/javascript' %>
|
9
|
-
<%= render partial: 'avo/partials/head' %>
|
10
9
|
<% if Avo::PACKED %>
|
11
10
|
<%= javascript_include_tag "/avo-assets/avo.base", "data-turbo-track": "reload", defer: true %>
|
12
|
-
<%= stylesheet_link_tag "/avo-assets/avo", "data-turbo-track": "reload", defer: true %>
|
11
|
+
<%= stylesheet_link_tag "/avo-assets/avo.base", "data-turbo-track": "reload", defer: true %>
|
13
12
|
<% else %>
|
14
13
|
<%= javascript_include_tag "avo.base", "data-turbo-track": "reload", defer: true %>
|
15
|
-
<%= stylesheet_link_tag "avo", "data-turbo-track": "reload", defer: true %>
|
14
|
+
<%= stylesheet_link_tag "avo.base", "data-turbo-track": "reload", defer: true %>
|
16
15
|
<% if Rails.env.development? %>
|
17
16
|
<%= javascript_include_tag "hotwire-livereload", defer: true %>
|
18
17
|
<% end %>
|
19
18
|
<% end %>
|
19
|
+
<%= render partial: 'avo/partials/head' %>
|
20
20
|
</head>
|
21
21
|
<body class="bg-application os-mac">
|
22
22
|
<div class="relative flex flex-1 w-full min-h-full" data-controller="sidebar" data-sidebar-open-value="<%= @sidebar_open %>">
|
data/lib/avo/app.rb
CHANGED
@@ -161,12 +161,12 @@ module Avo
|
|
161
161
|
|
162
162
|
hq = Avo::Licensing::HQ.new(request)
|
163
163
|
|
164
|
-
payload[:thread_count] = get_thread_count
|
165
|
-
payload[:hq_payload] = hq&.payload
|
166
164
|
payload[:license_id] = Avo::App&.license&.id
|
167
165
|
payload[:license_valid] = Avo::App&.license&.valid?
|
168
166
|
payload[:license_payload] = Avo::App&.license&.payload
|
169
167
|
payload[:license_response] = Avo::App&.license&.response
|
168
|
+
payload[:hq_payload] = hq&.payload
|
169
|
+
payload[:thread_count] = get_thread_count
|
170
170
|
payload[:license_abilities] = Avo::App&.license&.abilities
|
171
171
|
payload[:cache_store] = self.cache_store&.class&.to_s
|
172
172
|
payload[:avo_metadata] = hq&.avo_metadata
|
data/lib/avo/base_resource.rb
CHANGED
@@ -20,7 +20,6 @@ module Avo
|
|
20
20
|
delegate :context, to: ::Avo::App
|
21
21
|
|
22
22
|
attr_accessor :view
|
23
|
-
attr_accessor :model
|
24
23
|
attr_accessor :reflection
|
25
24
|
attr_accessor :user
|
26
25
|
attr_accessor :params
|
@@ -111,6 +110,11 @@ module Avo
|
|
111
110
|
end
|
112
111
|
end
|
113
112
|
|
113
|
+
def record
|
114
|
+
@model
|
115
|
+
end
|
116
|
+
alias :model :record
|
117
|
+
|
114
118
|
def hydrate(model: nil, view: nil, user: nil, params: nil)
|
115
119
|
@view = view if view.present?
|
116
120
|
@user = user if user.present?
|
@@ -51,10 +51,15 @@ module Avo
|
|
51
51
|
#
|
52
52
|
# get_resource_by_name('User') => UserResource
|
53
53
|
# get_resource_by_name(User) => UserResource
|
54
|
-
def get_resource_by_model_name(
|
54
|
+
def get_resource_by_model_name(klass)
|
55
|
+
# Fetch the mappings imposed by the user.
|
56
|
+
# If they are present, use those ones.
|
57
|
+
mapping = get_mapping_for_model klass
|
58
|
+
return get_resource(mapping) if mapping.present?
|
59
|
+
|
55
60
|
valid_resources
|
56
61
|
.find do |resource|
|
57
|
-
resource.model_class.model_name.name ==
|
62
|
+
resource.model_class.model_name.name == klass.to_s
|
58
63
|
end
|
59
64
|
end
|
60
65
|
|
@@ -128,6 +133,12 @@ module Avo
|
|
128
133
|
|
129
134
|
get_sidebar_partials
|
130
135
|
end
|
136
|
+
|
137
|
+
private
|
138
|
+
|
139
|
+
def get_mapping_for_model(klass)
|
140
|
+
(Avo.configuration.model_resource_mapping || {}).stringify_keys.transform_values(&:to_s)[klass.to_s]
|
141
|
+
end
|
131
142
|
end
|
132
143
|
end
|
133
144
|
end
|
data/lib/avo/configuration.rb
CHANGED
@@ -34,6 +34,7 @@ module Avo
|
|
34
34
|
attr_accessor :buttons_on_form_footers
|
35
35
|
attr_accessor :main_menu
|
36
36
|
attr_accessor :profile_menu
|
37
|
+
attr_accessor :model_resource_mapping
|
37
38
|
attr_accessor :tabs_style
|
38
39
|
|
39
40
|
def initialize
|
@@ -79,6 +80,7 @@ module Avo
|
|
79
80
|
@buttons_on_form_footers = false
|
80
81
|
@main_menu = nil
|
81
82
|
@profile_menu = nil
|
83
|
+
@model_resource_mapping = {}
|
82
84
|
@tabs_style = :tabs
|
83
85
|
end
|
84
86
|
|
data/lib/avo/licensing/h_q.rb
CHANGED
@@ -153,6 +153,8 @@ module Avo
|
|
153
153
|
end
|
154
154
|
|
155
155
|
def cache_response(response: nil, time: CACHE_TIME)
|
156
|
+
response = normalize_response response
|
157
|
+
|
156
158
|
response.merge!(
|
157
159
|
expiry: time,
|
158
160
|
fetched_at: Time.now,
|
@@ -164,6 +166,21 @@ module Avo
|
|
164
166
|
response
|
165
167
|
end
|
166
168
|
|
169
|
+
def normalize_response(response)
|
170
|
+
if response.is_a? Hash
|
171
|
+
response
|
172
|
+
else
|
173
|
+
{
|
174
|
+
normalized_response: JSON.stringify(response)
|
175
|
+
}
|
176
|
+
end
|
177
|
+
response.merge({})
|
178
|
+
rescue
|
179
|
+
{
|
180
|
+
normalized_response: "rescued"
|
181
|
+
}
|
182
|
+
end
|
183
|
+
|
167
184
|
def perform_request
|
168
185
|
::Rails.logger.debug "[Avo] Performing request to avohq.io API to check license availability." if Rails.env.development?
|
169
186
|
|
@@ -199,7 +216,12 @@ module Avo
|
|
199
216
|
end
|
200
217
|
|
201
218
|
def cache_and_return_error(error, exception_message = "")
|
202
|
-
cache_response response: {
|
219
|
+
cache_response response: {
|
220
|
+
id: Avo.configuration.license,
|
221
|
+
valid: true,
|
222
|
+
error: error,
|
223
|
+
exception_message: exception_message
|
224
|
+
}.stringify_keys, time: 5.minutes.to_i
|
203
225
|
end
|
204
226
|
|
205
227
|
def has_cached_response
|
data/lib/avo/svg_finder.rb
CHANGED
@@ -22,18 +22,22 @@ class Avo::SvgFinder
|
|
22
22
|
Avo::Engine.root.join(@filename).to_s,
|
23
23
|
]
|
24
24
|
|
25
|
-
|
25
|
+
paths.find do |path|
|
26
26
|
File.exist? path
|
27
27
|
end
|
28
|
-
|
29
|
-
path
|
30
28
|
end
|
31
29
|
|
32
30
|
def default_strategy
|
33
|
-
|
31
|
+
# If the app uses Propshaft, grab it from there
|
32
|
+
if defined?(Propshaft)
|
33
|
+
asset_path = ::Rails.application.assets.load_path.find(@filename)
|
34
|
+
asset_path&.path
|
35
|
+
elsif ::Rails.application.config.assets.compile
|
36
|
+
# Grab the asset from the compiled asset manifest
|
34
37
|
asset = ::Rails.application.assets[@filename]
|
35
38
|
Pathname.new(asset.filename) if asset.present?
|
36
39
|
else
|
40
|
+
# Grab the asset from the manifest
|
37
41
|
manifest = ::Rails.application.assets_manifest
|
38
42
|
asset_path = manifest.assets[@filename]
|
39
43
|
unless asset_path.nil?
|
@@ -42,4 +46,3 @@ class Avo::SvgFinder
|
|
42
46
|
end
|
43
47
|
end
|
44
48
|
end
|
45
|
-
|
data/lib/avo/version.rb
CHANGED
@@ -0,0 +1,54 @@
|
|
1
|
+
require_relative "../base_generator"
|
2
|
+
|
3
|
+
module Generators
|
4
|
+
module Avo
|
5
|
+
module Tailwindcss
|
6
|
+
class InstallGenerator < BaseGenerator
|
7
|
+
source_root File.expand_path("../templates", __dir__)
|
8
|
+
|
9
|
+
namespace "avo:tailwindcss:install"
|
10
|
+
desc "Add Tailwindcss to your Avo project."
|
11
|
+
|
12
|
+
def create_files
|
13
|
+
unless tailwindcss_installed?
|
14
|
+
system "./bin/bundle add tailwindcss-rails"
|
15
|
+
system "./bin/rails tailwindcss:install"
|
16
|
+
end
|
17
|
+
|
18
|
+
unless Rails.root.join("app", "assets", "stylesheets", "avo.tailwind.css").exist?
|
19
|
+
say "Add default app/assets/stylesheets/avo.tailwind.css"
|
20
|
+
copy_file template_path("avo.tailwind.css"), "app/assets/stylesheets/avo.tailwind.css"
|
21
|
+
end
|
22
|
+
|
23
|
+
if Rails.root.join("Procfile.dev").exist?
|
24
|
+
append_to_file "Procfile.dev", "css: bin/rails avo:tailwindcss:watch\n"
|
25
|
+
else
|
26
|
+
say "Add default Procfile.dev"
|
27
|
+
copy_file template_path("Procfile.dev"), "Procfile.dev"
|
28
|
+
|
29
|
+
say "Ensure foreman is installed"
|
30
|
+
run "gem install foreman"
|
31
|
+
end
|
32
|
+
|
33
|
+
append_to_file "Procfile.dev", "avo_css: bin/rails tailwindcss:watch\n"
|
34
|
+
|
35
|
+
say "Ejecting the _head.html.erb partial"
|
36
|
+
Rails::Generators.invoke("avo:eject", [":head", "--no-avo-version"], {destination_root: Rails.root})
|
37
|
+
|
38
|
+
say "Adding the CSS asset to the partial"
|
39
|
+
prepend_to_file Rails.root.join("app", "views", "avo", "partials", "_head.html.erb"), "<%= stylesheet_link_tag \"avo.tailwind.css\", media: \"all\" %>"
|
40
|
+
end
|
41
|
+
|
42
|
+
no_tasks do
|
43
|
+
def template_path(filename)
|
44
|
+
Pathname.new(__dir__).join("..", "templates", "tailwindcss", filename).to_s
|
45
|
+
end
|
46
|
+
|
47
|
+
def tailwindcss_installed?
|
48
|
+
Rails.root.join("config", "tailwind.config.js").exist? || Rails.root.join("tailwind.config.js").exist?
|
49
|
+
end
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
end
|
@@ -34,19 +34,23 @@ Avo.configure do |config|
|
|
34
34
|
## == Localization ==
|
35
35
|
# config.locale = 'en-US'
|
36
36
|
|
37
|
+
## == Resource options ==
|
38
|
+
# config.resource_controls = :right
|
39
|
+
# config.model_resource_mapping = {}
|
40
|
+
# config.default_view_type = :table
|
41
|
+
# config.per_page = 24
|
42
|
+
# config.per_page_steps = [12, 24, 48, 72]
|
43
|
+
# config.via_per_page = 8
|
44
|
+
# config.id_links_to_resource = false
|
45
|
+
# config.cache_resources_on_index_view = true
|
46
|
+
|
37
47
|
## == Customization ==
|
38
48
|
# config.app_name = 'Avocadelicious'
|
39
49
|
# config.timezone = 'UTC'
|
40
50
|
# config.currency = 'USD'
|
41
|
-
# config.per_page = 24
|
42
|
-
# config.per_page_steps = [12, 24, 48, 72]
|
43
|
-
# config.via_per_page = 8
|
44
|
-
# config.default_view_type = :table
|
45
51
|
# config.hide_layout_when_printing = false
|
46
|
-
# config.id_links_to_resource = false
|
47
52
|
# config.full_width_container = false
|
48
53
|
# config.full_width_index_view = false
|
49
|
-
# config.cache_resources_on_index_view = true
|
50
54
|
# config.search_debounce = 300
|
51
55
|
# config.view_component_path = "app/components"
|
52
56
|
# config.display_license_request_timeout_error = true
|
@@ -54,7 +58,6 @@ Avo.configure do |config|
|
|
54
58
|
# config.resource_controls = :right
|
55
59
|
# config.tabs_style = :tabs # can be :tabs or :pills
|
56
60
|
|
57
|
-
|
58
61
|
## == Breadcrumbs ==
|
59
62
|
# config.display_breadcrumbs = true
|
60
63
|
# config.set_initial_breadcrumbs do
|
data/lib/tasks/avo_tasks.rake
CHANGED
@@ -3,9 +3,9 @@
|
|
3
3
|
# # Task goes here
|
4
4
|
# end
|
5
5
|
|
6
|
-
desc
|
7
|
-
task
|
8
|
-
spec = get_gem_spec
|
6
|
+
desc "Installs Avo assets and bundles them for when you want to use the GitHub repo in your app"
|
7
|
+
task "avo:build-assets" do
|
8
|
+
spec = get_gem_spec "avo"
|
9
9
|
# Uncomment to enable only when the source is github.com
|
10
10
|
# enabled = spec.source.to_s.include?('https://github.com/avo-hq/avo')
|
11
11
|
enabled = true
|
@@ -15,8 +15,8 @@ task 'avo:build-assets' do
|
|
15
15
|
path = spec.full_gem_path
|
16
16
|
|
17
17
|
Dir.chdir(path) do
|
18
|
-
system
|
19
|
-
system
|
18
|
+
system "yarn"
|
19
|
+
system "yarn prod:build"
|
20
20
|
end
|
21
21
|
|
22
22
|
puts "Done"
|
@@ -28,10 +28,10 @@ end
|
|
28
28
|
# From
|
29
29
|
# https://stackoverflow.com/questions/9322078/programmatically-determine-gems-path-using-bundler
|
30
30
|
def get_gem_spec(name)
|
31
|
-
spec = Bundler.load.specs.find{|s| s.name == name }
|
31
|
+
spec = Bundler.load.specs.find { |s| s.name == name }
|
32
32
|
raise GemNotFound, "Could not find gem '#{name}' in the current bundle." unless spec
|
33
|
-
if spec.name ==
|
34
|
-
return File.expand_path(
|
33
|
+
if spec.name == "bundler"
|
34
|
+
return File.expand_path("../../../", __FILE__)
|
35
35
|
end
|
36
36
|
|
37
37
|
spec
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Use the user provided asset or use the default
|
2
|
+
ASSET_FILE = ARGV[0] || "app/assets/builds/avo.tailwind.css"
|
3
|
+
# Se the tailwindcss-rails package name
|
4
|
+
TAILWINDCSS_RAILS = "tailwindcss-rails"
|
5
|
+
|
6
|
+
# Check if tailwindcss-rails is being used
|
7
|
+
if Gem.loaded_specs.key? TAILWINDCSS_RAILS
|
8
|
+
# Get the path
|
9
|
+
GEM_PATH = Gem.loaded_specs[TAILWINDCSS_RAILS].full_gem_path
|
10
|
+
# Compose the compile command
|
11
|
+
AVO_TAILWIND_COMPILE_COMMAND = "#{RbConfig.ruby} #{Pathname.new(GEM_PATH)}/exe/tailwindcss -i '#{Rails.root.join("app/assets/stylesheets/avo.css")}' -o '#{Rails.root.join(ASSET_FILE)}' -c '#{Rails.root.join("config/tailwind.config.js")}' --minify"
|
12
|
+
|
13
|
+
namespace "avo:tailwindcss" do
|
14
|
+
desc "Build your Tailwind CSS"
|
15
|
+
task :build do
|
16
|
+
system(AVO_TAILWIND_COMPILE_COMMAND, exception: true)
|
17
|
+
end
|
18
|
+
|
19
|
+
desc "Watch and build your Tailwind CSS on file changes"
|
20
|
+
task :watch do
|
21
|
+
system "#{AVO_TAILWIND_COMPILE_COMMAND} -w"
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: avo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.14.3.pre.
|
4
|
+
version: 2.14.3.pre.6.nosprockets
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adrian Marin
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2022-
|
12
|
+
date: 2022-09-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
@@ -263,7 +263,7 @@ files:
|
|
263
263
|
- README.md
|
264
264
|
- Rakefile
|
265
265
|
- app/assets/config/avo_manifest.js
|
266
|
-
- app/assets/stylesheets/avo.css
|
266
|
+
- app/assets/stylesheets/avo.base.css
|
267
267
|
- app/assets/stylesheets/css/active-storage.css
|
268
268
|
- app/assets/stylesheets/css/breadcrumbs.css
|
269
269
|
- app/assets/stylesheets/css/buttons.css
|
@@ -1642,6 +1642,7 @@ files:
|
|
1642
1642
|
- app/controllers/avo/reorder_controller.rb
|
1643
1643
|
- app/controllers/avo/resources_controller.rb
|
1644
1644
|
- app/controllers/avo/search_controller.rb
|
1645
|
+
- app/controllers/avo/team_users_controller.rb
|
1645
1646
|
- app/helpers/avo/actions_helper.rb
|
1646
1647
|
- app/helpers/avo/application_helper.rb
|
1647
1648
|
- app/helpers/avo/attachments_helper.rb
|
@@ -1892,6 +1893,7 @@ files:
|
|
1892
1893
|
- lib/generators/avo/named_base_generator.rb
|
1893
1894
|
- lib/generators/avo/resource_generator.rb
|
1894
1895
|
- lib/generators/avo/resource_tool_generator.rb
|
1896
|
+
- lib/generators/avo/tailwindcss/install_generator.rb
|
1895
1897
|
- lib/generators/avo/templates/action.tt
|
1896
1898
|
- lib/generators/avo/templates/cards/chartkick_card.tt
|
1897
1899
|
- lib/generators/avo/templates/cards/chartkick_card_sample.tt
|
@@ -1924,15 +1926,18 @@ files:
|
|
1924
1926
|
- lib/generators/avo/templates/resource_tools/partial.tt
|
1925
1927
|
- lib/generators/avo/templates/resource_tools/resource_tool.tt
|
1926
1928
|
- lib/generators/avo/templates/standalone_action.tt
|
1929
|
+
- lib/generators/avo/templates/tailwindcss/Procfile.dev
|
1930
|
+
- lib/generators/avo/templates/tailwindcss/avo.tailwind.css
|
1927
1931
|
- lib/generators/avo/templates/tool/controller.tt
|
1928
1932
|
- lib/generators/avo/templates/tool/sidebar_item.tt
|
1929
1933
|
- lib/generators/avo/templates/tool/view.tt
|
1930
1934
|
- lib/generators/avo/tool_generator.rb
|
1931
1935
|
- lib/generators/avo/version_generator.rb
|
1932
1936
|
- lib/tasks/avo_tasks.rake
|
1937
|
+
- lib/tasks/tailwindcss_rails.rake
|
1938
|
+
- public/avo-assets/avo.base.css
|
1933
1939
|
- public/avo-assets/avo.base.js
|
1934
1940
|
- public/avo-assets/avo.base.js.map
|
1935
|
-
- public/avo-assets/avo.css
|
1936
1941
|
- public/avo-assets/fonts/inter-v7-latin-500.eot
|
1937
1942
|
- public/avo-assets/fonts/inter-v7-latin-500.svg
|
1938
1943
|
- public/avo-assets/fonts/inter-v7-latin-500.ttf
|