solidstats 1.0.0 → 2.0.0
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/CHANGELOG.md +85 -0
- data/README.md +35 -0
- data/app/assets/javascripts/solidstats/application.js +257 -0
- data/app/assets/javascripts/solidstats/dashboard.js +225 -0
- data/app/assets/javascripts/solidstats/gem_metadata.js +554 -0
- data/app/assets/stylesheets/solidstats/application.css +6 -1
- data/app/assets/stylesheets/solidstats/components/action_button.css +99 -0
- data/app/assets/stylesheets/solidstats/components/dashboard.css +151 -0
- data/app/assets/stylesheets/solidstats/components/dashboard_header.css +93 -0
- data/app/assets/stylesheets/solidstats/components/dashboard_layout.css +97 -0
- data/app/assets/stylesheets/solidstats/components/gem_metadata.css +1403 -0
- data/app/assets/stylesheets/solidstats/components/navigation.css +80 -0
- data/app/assets/stylesheets/solidstats/components/quick_navigation.css +54 -0
- data/app/assets/stylesheets/solidstats/components/security.css +332 -0
- data/app/assets/stylesheets/solidstats/components/status_badge.css +58 -0
- data/app/assets/stylesheets/solidstats/components/summary_card.css +66 -0
- data/app/assets/stylesheets/solidstats/components/tab_navigation.css +95 -0
- data/app/components/solidstats/base_component.rb +88 -0
- data/app/components/solidstats/code_quality/code_quality_section_component.html.erb +0 -0
- data/app/components/solidstats/code_quality/code_quality_section_component.rb +0 -0
- data/app/components/solidstats/code_quality/section_component.html.erb +45 -0
- data/app/components/solidstats/code_quality/section_component.rb +34 -0
- data/app/components/solidstats/dashboard_header_component.html.erb +39 -0
- data/app/components/solidstats/dashboard_header_component.rb +33 -0
- data/app/components/solidstats/previews/action_button_component_preview/button_vs_link.html.erb +6 -0
- data/app/components/solidstats/previews/action_button_component_preview/sizes.html.erb +6 -0
- data/app/components/solidstats/previews/action_button_component_preview/variants.html.erb +6 -0
- data/app/components/solidstats/previews/action_button_component_preview/with_icons.html.erb +6 -0
- data/app/components/solidstats/previews/action_button_component_preview.rb +64 -0
- data/app/components/solidstats/previews/navigation_component_preview.rb +74 -0
- data/app/components/solidstats/previews/stats_overview_component_preview.rb +100 -0
- data/app/components/solidstats/previews/status_badge_component_preview/sizes.html.erb +6 -0
- data/app/components/solidstats/previews/status_badge_component_preview/statuses.html.erb +6 -0
- data/app/components/solidstats/previews/status_badge_component_preview/with_icons.html.erb +6 -0
- data/app/components/solidstats/previews/status_badge_component_preview.rb +49 -0
- data/app/components/solidstats/previews/summary_card_component_preview/clickable.html.erb +9 -0
- data/app/components/solidstats/previews/summary_card_component_preview/dashboard_layout.html.erb +9 -0
- data/app/components/solidstats/previews/summary_card_component_preview/statuses.html.erb +6 -0
- data/app/components/solidstats/previews/summary_card_component_preview/value_formats.html.erb +6 -0
- data/app/components/solidstats/previews/summary_card_component_preview.rb +67 -0
- data/app/components/solidstats/quick_navigation_component.html.erb +8 -0
- data/app/components/solidstats/quick_navigation_component.rb +21 -0
- data/app/components/solidstats/security/gem_impact_analysis_component.html.erb +44 -0
- data/app/components/solidstats/security/gem_impact_analysis_component.rb +45 -0
- data/app/components/solidstats/security/overview_component.html.erb +21 -0
- data/app/components/solidstats/security/overview_component.rb +104 -0
- data/app/components/solidstats/security/section_component.html.erb +26 -0
- data/app/components/solidstats/security/section_component.rb +52 -0
- data/app/components/solidstats/security/timeline_component.html.erb +39 -0
- data/app/components/solidstats/security/timeline_component.rb +43 -0
- data/app/components/solidstats/tasks_section_component.html.erb +17 -0
- data/app/components/solidstats/tasks_section_component.rb +22 -0
- data/app/components/solidstats/ui/action_button_component.html.erb +6 -0
- data/app/components/solidstats/ui/action_button_component.rb +71 -0
- data/app/components/solidstats/ui/dashboard_layout_component.html.erb +19 -0
- data/app/components/solidstats/ui/dashboard_layout_component.rb +85 -0
- data/app/components/solidstats/ui/navigation_component.html.erb +34 -0
- data/app/components/solidstats/ui/navigation_component.rb +72 -0
- data/app/components/solidstats/ui/stats_overview_component.html.erb +14 -0
- data/app/components/solidstats/ui/stats_overview_component.rb +78 -0
- data/app/components/solidstats/ui/status_badge_component.html.erb +6 -0
- data/app/components/solidstats/ui/status_badge_component.rb +42 -0
- data/app/components/solidstats/ui/summary_card_component.html.erb +12 -0
- data/app/components/solidstats/ui/summary_card_component.rb +63 -0
- data/app/components/solidstats/ui/tab_navigation_component.html.erb +22 -0
- data/app/components/solidstats/ui/tab_navigation_component.rb +79 -0
- data/app/controllers/solidstats/dashboard_controller.rb +22 -0
- data/app/controllers/solidstats/gem_metadata_controller.rb +12 -0
- data/app/helpers/solidstats/application_helper.rb +42 -0
- data/app/services/solidstats/gem_metadata/fetcher_service.rb +136 -0
- data/app/services/solidstats/log_size_monitor_service.rb +94 -0
- data/app/views/layouts/solidstats/application.html.erb +2 -1
- data/app/views/solidstats/dashboard/_log_monitor.html.erb +759 -0
- data/app/views/solidstats/dashboard/index.html.erb +67 -1323
- data/app/views/solidstats/gem_metadata/_panel.html.erb +419 -0
- data/config/routes.rb +7 -0
- data/lib/generators/solidstats/feature/feature_generator.rb +170 -0
- data/lib/generators/solidstats/feature/templates/component.html.erb +84 -0
- data/lib/generators/solidstats/feature/templates/component.rb.erb +103 -0
- data/lib/generators/solidstats/feature/templates/component.scss +243 -0
- data/lib/generators/solidstats/feature/templates/component_test.rb.erb +183 -0
- data/lib/generators/solidstats/feature/templates/controller.rb.erb +44 -0
- data/lib/generators/solidstats/feature/templates/controller_test.rb.erb +111 -0
- data/lib/generators/solidstats/feature/templates/detail_view.html.erb +755 -0
- data/lib/generators/solidstats/feature/templates/preview.rb.erb +107 -0
- data/lib/generators/solidstats/feature/templates/service.rb.erb +132 -0
- data/lib/generators/solidstats/feature/templates/service_test.rb.erb +109 -0
- data/lib/generators/solidstats/install_generator.rb +109 -0
- data/lib/generators/solidstats/templates/initializer.rb +112 -0
- data/lib/solidstats/asset_compatibility.rb +238 -0
- data/lib/solidstats/asset_manifest.rb +205 -0
- data/lib/solidstats/engine.rb +114 -9
- data/lib/solidstats/version.rb +1 -1
- data/lib/solidstats.rb +299 -2
- data/lib/tasks/solidstats_install.rake +122 -2
- metadata +99 -2
data/lib/solidstats.rb
CHANGED
@@ -1,12 +1,28 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "solidstats/version"
|
2
4
|
require "solidstats/engine"
|
5
|
+
require "solidstats/asset_compatibility"
|
6
|
+
require "solidstats/asset_manifest"
|
3
7
|
|
4
8
|
module Solidstats
|
9
|
+
# Base error class for all Solidstats-specific errors
|
10
|
+
class Error < StandardError; end
|
11
|
+
|
12
|
+
# Configuration-related errors
|
13
|
+
class ConfigurationError < Error; end
|
14
|
+
|
15
|
+
# Component-related errors
|
16
|
+
class ComponentError < Error; end
|
17
|
+
|
18
|
+
# Service-related errors
|
19
|
+
class ServiceError < Error; end
|
20
|
+
|
5
21
|
class << self
|
6
22
|
# Returns the absolute path to this gem's root directory
|
7
|
-
# @return [
|
23
|
+
# @return [Pathname] Gem root path
|
8
24
|
def root
|
9
|
-
File.dirname(__dir__)
|
25
|
+
@root ||= Pathname.new(File.dirname(__dir__))
|
10
26
|
end
|
11
27
|
|
12
28
|
# Returns version string
|
@@ -14,5 +30,286 @@ module Solidstats
|
|
14
30
|
def version
|
15
31
|
VERSION
|
16
32
|
end
|
33
|
+
|
34
|
+
# Returns the gem's app directory
|
35
|
+
# @return [Pathname] App directory path
|
36
|
+
def app_path
|
37
|
+
@app_path ||= root.join("app")
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns the components directory
|
41
|
+
# @return [Pathname] Components directory path
|
42
|
+
def components_path
|
43
|
+
@components_path ||= app_path.join("components", "solidstats")
|
44
|
+
end
|
45
|
+
|
46
|
+
# Returns the services directory
|
47
|
+
# @return [Pathname] Services directory path
|
48
|
+
def services_path
|
49
|
+
@services_path ||= app_path.join("services", "solidstats")
|
50
|
+
end
|
51
|
+
|
52
|
+
# Check if ViewComponent is available and properly loaded
|
53
|
+
# @return [Boolean] True if ViewComponent is loaded and usable
|
54
|
+
def view_component_available?
|
55
|
+
defined?(ViewComponent::Base) &&
|
56
|
+
ViewComponent::Base.respond_to?(:new) &&
|
57
|
+
defined?(Rails)
|
58
|
+
end
|
59
|
+
|
60
|
+
# Safely load ViewComponent if not already loaded
|
61
|
+
# @return [Boolean] True if ViewComponent was loaded successfully
|
62
|
+
def ensure_view_component!
|
63
|
+
return true if view_component_available?
|
64
|
+
|
65
|
+
unless defined?(Rails)
|
66
|
+
logger.warn "[Solidstats] Rails not available - ViewComponent cannot be loaded"
|
67
|
+
return false
|
68
|
+
end
|
69
|
+
|
70
|
+
begin
|
71
|
+
require "view_component"
|
72
|
+
require "view_component/engine"
|
73
|
+
|
74
|
+
# Verify it loaded correctly
|
75
|
+
if view_component_available?
|
76
|
+
logger.info "[Solidstats] ViewComponent loaded successfully"
|
77
|
+
true
|
78
|
+
else
|
79
|
+
logger.error "[Solidstats] ViewComponent loaded but not properly initialized"
|
80
|
+
false
|
81
|
+
end
|
82
|
+
rescue LoadError => e
|
83
|
+
logger.warn "[Solidstats] ViewComponent not available: #{e.message}"
|
84
|
+
false
|
85
|
+
rescue StandardError => e
|
86
|
+
logger.error "[Solidstats] Failed to load ViewComponent: #{e.message}"
|
87
|
+
false
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
# Check if running in development mode
|
92
|
+
# @return [Boolean] True if in development
|
93
|
+
def development?
|
94
|
+
defined?(Rails) && Rails.env.development?
|
95
|
+
end
|
96
|
+
|
97
|
+
# Check if running in production mode
|
98
|
+
# @return [Boolean] True if in production
|
99
|
+
def production?
|
100
|
+
defined?(Rails) && Rails.env.production?
|
101
|
+
end
|
102
|
+
|
103
|
+
# Check if running in test mode
|
104
|
+
# @return [Boolean] True if in test
|
105
|
+
def test?
|
106
|
+
defined?(Rails) && Rails.env.test?
|
107
|
+
end
|
108
|
+
|
109
|
+
# Current Rails environment
|
110
|
+
# @return [String, nil] Environment name or nil if Rails not available
|
111
|
+
def environment
|
112
|
+
Rails.env if defined?(Rails)
|
113
|
+
end
|
114
|
+
|
115
|
+
# Configuration object for the gem
|
116
|
+
# @return [Configuration] Configuration instance
|
117
|
+
def configuration
|
118
|
+
@configuration ||= Configuration.new
|
119
|
+
end
|
120
|
+
|
121
|
+
# Configure the gem with a block
|
122
|
+
# @yield [Configuration] Configuration object
|
123
|
+
# @example
|
124
|
+
# Solidstats.configure do |config|
|
125
|
+
# config.cache_duration = 30.minutes
|
126
|
+
# config.enable_components = true
|
127
|
+
# end
|
128
|
+
def configure
|
129
|
+
yield(configuration) if block_given?
|
130
|
+
configuration
|
131
|
+
end
|
132
|
+
|
133
|
+
# Reset configuration to defaults
|
134
|
+
# @return [Configuration] New configuration instance
|
135
|
+
def reset_configuration!
|
136
|
+
@configuration = Configuration.new
|
137
|
+
end
|
138
|
+
|
139
|
+
# Logger instance with fallback
|
140
|
+
# @return [Logger] Logger instance
|
141
|
+
def logger
|
142
|
+
@logger ||= build_logger
|
143
|
+
end
|
144
|
+
|
145
|
+
# Set a custom logger
|
146
|
+
# @param custom_logger [Logger] Custom logger instance
|
147
|
+
def logger=(custom_logger)
|
148
|
+
@logger = custom_logger
|
149
|
+
end
|
150
|
+
|
151
|
+
# Check if Solidstats can run in current environment
|
152
|
+
# @return [Boolean] True if environment is suitable
|
153
|
+
# @raise [ConfigurationError] If environment is not suitable
|
154
|
+
def environment_suitable?
|
155
|
+
unless development?
|
156
|
+
raise ConfigurationError,
|
157
|
+
"Solidstats can only be used in development mode. Current: #{environment || 'unknown'}"
|
158
|
+
end
|
159
|
+
|
160
|
+
true
|
161
|
+
end
|
162
|
+
|
163
|
+
# Get engine instance
|
164
|
+
# @return [Solidstats::Engine] Engine instance
|
165
|
+
def engine
|
166
|
+
Engine
|
167
|
+
end
|
168
|
+
|
169
|
+
# Get asset strategy for current application
|
170
|
+
# @return [Symbol] Asset strategy (:sprockets, :webpacker, :importmap, :auto)
|
171
|
+
def asset_strategy
|
172
|
+
return configuration.assets[:strategy] if configuration.assets[:strategy] != :auto
|
173
|
+
|
174
|
+
# Auto-detect asset strategy
|
175
|
+
if defined?(Importmap) && File.exist?(Rails.root.join("config/importmap.rb"))
|
176
|
+
:importmap
|
177
|
+
elsif defined?(Webpacker) && File.exist?(Rails.root.join("config/webpacker.yml"))
|
178
|
+
:webpacker
|
179
|
+
elsif defined?(Sprockets)
|
180
|
+
:sprockets
|
181
|
+
else
|
182
|
+
:none
|
183
|
+
end
|
184
|
+
end
|
185
|
+
|
186
|
+
# Check if assets should be fingerprinted
|
187
|
+
# @return [Boolean] True if fingerprinting is enabled
|
188
|
+
def asset_fingerprinting?
|
189
|
+
configuration.assets[:fingerprint] && !Rails.env.development?
|
190
|
+
end
|
191
|
+
|
192
|
+
# Get the asset prefix for engine assets
|
193
|
+
# @return [String] Asset prefix
|
194
|
+
def asset_prefix
|
195
|
+
case asset_strategy
|
196
|
+
when :importmap, :sprockets
|
197
|
+
"solidstats"
|
198
|
+
when :webpacker
|
199
|
+
"solidstats"
|
200
|
+
else
|
201
|
+
"solidstats"
|
202
|
+
end
|
203
|
+
end
|
204
|
+
|
205
|
+
private
|
206
|
+
|
207
|
+
# Build appropriate logger based on environment
|
208
|
+
# @return [Logger] Logger instance
|
209
|
+
def build_logger
|
210
|
+
if defined?(Rails) && Rails.respond_to?(:logger) && Rails.logger
|
211
|
+
Rails.logger
|
212
|
+
else
|
213
|
+
require "logger"
|
214
|
+
Logger.new($stdout, level: Logger::INFO).tap do |log|
|
215
|
+
log.formatter = proc do |severity, datetime, progname, msg|
|
216
|
+
"[#{datetime.strftime('%Y-%m-%d %H:%M:%S')}] #{severity}: #{msg}\n"
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
# Configuration class for Solidstats gem
|
224
|
+
class Configuration
|
225
|
+
# @!attribute [rw] cache_duration
|
226
|
+
# @return [ActiveSupport::Duration] Cache duration for services
|
227
|
+
attr_accessor :cache_duration
|
228
|
+
|
229
|
+
# @!attribute [rw] enable_components
|
230
|
+
# @return [Boolean] Whether to enable ViewComponent integration
|
231
|
+
attr_accessor :enable_components
|
232
|
+
|
233
|
+
# @!attribute [rw] log_level
|
234
|
+
# @return [Symbol] Logging level
|
235
|
+
attr_accessor :log_level
|
236
|
+
|
237
|
+
# @!attribute [rw] enable_previews
|
238
|
+
# @return [Boolean] Whether to enable component previews
|
239
|
+
attr_accessor :enable_previews
|
240
|
+
|
241
|
+
# @!attribute [rw] preview_layout
|
242
|
+
# @return [String] Layout for component previews
|
243
|
+
attr_accessor :preview_layout
|
244
|
+
|
245
|
+
# @!attribute [rw] assets
|
246
|
+
# @return [Hash] Asset configuration options
|
247
|
+
attr_accessor :assets
|
248
|
+
|
249
|
+
# @!attribute [rw] css_framework
|
250
|
+
# @return [Symbol] CSS framework integration (:none, :bootstrap, :tailwind)
|
251
|
+
attr_accessor :css_framework
|
252
|
+
|
253
|
+
def initialize
|
254
|
+
set_defaults
|
255
|
+
end
|
256
|
+
|
257
|
+
# Check if components are enabled and available
|
258
|
+
# @return [Boolean] True if components can be used
|
259
|
+
def components_enabled?
|
260
|
+
@enable_components && Solidstats.view_component_available?
|
261
|
+
end
|
262
|
+
|
263
|
+
# Check if previews are enabled
|
264
|
+
# @return [Boolean] True if previews should be shown
|
265
|
+
def previews_enabled?
|
266
|
+
@enable_previews && Solidstats.development?
|
267
|
+
end
|
268
|
+
|
269
|
+
# Validate configuration
|
270
|
+
# @return [Boolean] True if configuration is valid
|
271
|
+
# @raise [ConfigurationError] If configuration is invalid
|
272
|
+
def validate!
|
273
|
+
unless cache_duration.respond_to?(:seconds)
|
274
|
+
raise ConfigurationError, "cache_duration must be a time duration"
|
275
|
+
end
|
276
|
+
|
277
|
+
unless [ :debug, :info, :warn, :error, :fatal, :unknown ].include?(@log_level)
|
278
|
+
raise ConfigurationError, "log_level must be a valid log level symbol"
|
279
|
+
end
|
280
|
+
|
281
|
+
true
|
282
|
+
end
|
283
|
+
|
284
|
+
private
|
285
|
+
|
286
|
+
def set_defaults
|
287
|
+
@cache_duration = 1.hour
|
288
|
+
@enable_components = true
|
289
|
+
@log_level = :info
|
290
|
+
@enable_previews = true
|
291
|
+
@preview_layout = "solidstats/component_preview"
|
292
|
+
@assets = {
|
293
|
+
fingerprint: true,
|
294
|
+
strategy: :auto,
|
295
|
+
precompile: true,
|
296
|
+
compile_on_demand: Rails.env.development?
|
297
|
+
}
|
298
|
+
@css_framework = :none
|
299
|
+
end
|
300
|
+
end
|
301
|
+
end
|
302
|
+
|
303
|
+
# Auto-require common dependencies if in Rails environment
|
304
|
+
if defined?(Rails) && Rails.env.development?
|
305
|
+
# Ensure ViewComponent is available
|
306
|
+
Solidstats.ensure_view_component!
|
307
|
+
|
308
|
+
# Auto-require core services that are commonly used
|
309
|
+
begin
|
310
|
+
require_relative "solidstats/gem_metadata/fetcher_service" if
|
311
|
+
File.exist?(File.join(__dir__, "solidstats/gem_metadata/fetcher_service.rb"))
|
312
|
+
rescue LoadError => e
|
313
|
+
Solidstats.logger.debug "[Solidstats] Could not auto-load services: #{e.message}"
|
17
314
|
end
|
18
315
|
end
|
@@ -1,8 +1,19 @@
|
|
1
1
|
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
2
4
|
namespace :solidstats do
|
3
|
-
desc "Install Solidstats
|
5
|
+
desc "Install Solidstats in the current Rails application"
|
4
6
|
task :install do
|
5
|
-
|
7
|
+
puts "🚀 Installing Solidstats..."
|
8
|
+
|
9
|
+
# Check Rails environment
|
10
|
+
unless Rails.env.development?
|
11
|
+
puts "⚠️ Warning: Solidstats is designed for development environments."
|
12
|
+
puts "Current environment: #{Rails.env}"
|
13
|
+
end
|
14
|
+
|
15
|
+
# Run the generator
|
16
|
+
if system("rails generate solidstats:install")
|
6
17
|
puts "\n✅ Solidstats installation completed successfully!"
|
7
18
|
puts " Start your Rails server and visit http://localhost:3000/solidstats\n\n"
|
8
19
|
else
|
@@ -10,4 +21,113 @@ namespace :solidstats do
|
|
10
21
|
puts " bundle exec rails generate solidstats:install\n\n"
|
11
22
|
end
|
12
23
|
end
|
24
|
+
|
25
|
+
desc "Validate Solidstats installation and configuration"
|
26
|
+
task validate: :environment do
|
27
|
+
puts "🔍 Validating Solidstats installation..."
|
28
|
+
|
29
|
+
begin
|
30
|
+
# Check basic configuration
|
31
|
+
Solidstats.configuration
|
32
|
+
puts "✅ Configuration loaded"
|
33
|
+
|
34
|
+
# Check ViewComponent availability
|
35
|
+
if Solidstats.view_component_available?
|
36
|
+
version = defined?(ViewComponent::VERSION) ? ViewComponent::VERSION : "unknown"
|
37
|
+
puts "✅ ViewComponent available (#{version})"
|
38
|
+
else
|
39
|
+
puts "❌ ViewComponent not available"
|
40
|
+
end
|
41
|
+
|
42
|
+
# Check asset strategy
|
43
|
+
strategy = Solidstats.asset_strategy
|
44
|
+
puts "✅ Asset strategy: #{strategy}"
|
45
|
+
|
46
|
+
# Validate asset manifest
|
47
|
+
Solidstats::AssetManifest.validate_assets!
|
48
|
+
puts "✅ All required assets present"
|
49
|
+
|
50
|
+
# Check routes
|
51
|
+
if Rails.application.routes.routes.any? { |r| r.path.spec.to_s.include?("solidstats") }
|
52
|
+
puts "✅ Routes mounted"
|
53
|
+
else
|
54
|
+
puts "⚠️ Routes not mounted - add 'mount Solidstats::Engine => \"/solidstats\"' to config/routes.rb"
|
55
|
+
end
|
56
|
+
|
57
|
+
puts "\n🎉 Solidstats validation complete!"
|
58
|
+
|
59
|
+
rescue => e
|
60
|
+
puts "❌ Validation failed: #{e.message}"
|
61
|
+
exit 1
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
desc "Show asset configuration information"
|
66
|
+
task assets: :environment do
|
67
|
+
puts "📦 Solidstats Asset Configuration"
|
68
|
+
puts "=" * 40
|
69
|
+
|
70
|
+
puts "Asset Strategy: #{Solidstats.asset_strategy}"
|
71
|
+
puts "Fingerprinting: #{Solidstats.asset_fingerprinting?}"
|
72
|
+
puts "Asset Prefix: #{Solidstats.asset_prefix}"
|
73
|
+
|
74
|
+
puts "\nPrecompiled Assets:"
|
75
|
+
Solidstats::AssetManifest.assets_for_environment.each do |asset|
|
76
|
+
puts " • #{asset}"
|
77
|
+
end
|
78
|
+
|
79
|
+
if Rails.application.config.respond_to?(:assets)
|
80
|
+
puts "\nAsset Paths:"
|
81
|
+
Rails.application.config.assets.paths.select { |p| p.include?("solidstats") }.each do |path|
|
82
|
+
puts " • #{path}"
|
83
|
+
end
|
84
|
+
end
|
85
|
+
end
|
86
|
+
|
87
|
+
desc "Test asset compilation"
|
88
|
+
task compile_assets: :environment do
|
89
|
+
puts "🔧 Testing asset compilation..."
|
90
|
+
|
91
|
+
begin
|
92
|
+
test_assets = [ "solidstats/application.css", "solidstats/application.js" ]
|
93
|
+
|
94
|
+
if Rails.application.config.respond_to?(:assets)
|
95
|
+
manifest = Rails.application.assets
|
96
|
+
|
97
|
+
# Check if we're using Propshaft (Rails 7+) or Sprockets
|
98
|
+
if manifest.respond_to?(:find_asset)
|
99
|
+
# Sprockets
|
100
|
+
test_assets.each do |asset|
|
101
|
+
if manifest.find_asset(asset)
|
102
|
+
puts "✅ #{asset} - found and compilable (Sprockets)"
|
103
|
+
else
|
104
|
+
puts "❌ #{asset} - not found (Sprockets)"
|
105
|
+
end
|
106
|
+
end
|
107
|
+
elsif manifest.respond_to?(:load_path) && manifest.load_path.respond_to?(:find)
|
108
|
+
# Propshaft
|
109
|
+
test_assets.each do |asset|
|
110
|
+
if manifest.load_path.find(asset)
|
111
|
+
puts "✅ #{asset} - found and compilable (Propshaft)"
|
112
|
+
else
|
113
|
+
puts "❌ #{asset} - not found (Propshaft)"
|
114
|
+
end
|
115
|
+
end
|
116
|
+
else
|
117
|
+
# Unknown asset pipeline
|
118
|
+
puts "⚠️ Unknown asset pipeline type: #{manifest.class}"
|
119
|
+
puts "Available methods: #{manifest.methods.grep(/find/).join(', ')}"
|
120
|
+
end
|
121
|
+
else
|
122
|
+
puts "⚠️ No asset pipeline detected"
|
123
|
+
end
|
124
|
+
|
125
|
+
puts "✅ Asset compilation test complete"
|
126
|
+
|
127
|
+
rescue => e
|
128
|
+
puts "❌ Asset compilation failed: #{e.message}"
|
129
|
+
puts "Asset pipeline class: #{Rails.application.assets.class}" if Rails.application.respond_to?(:assets)
|
130
|
+
exit 1
|
131
|
+
end
|
132
|
+
end
|
13
133
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solidstats
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- MezbahAlam
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-05-
|
11
|
+
date: 2025-05-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: view_component
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.8'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.8'
|
41
55
|
description: 'View local project health: security dashboard with vulnerability analysis,
|
42
56
|
gem impact assessment, code quality metrics, and project task tracking.'
|
43
57
|
email:
|
@@ -50,17 +64,84 @@ files:
|
|
50
64
|
- MIT-LICENSE
|
51
65
|
- README.md
|
52
66
|
- Rakefile
|
67
|
+
- app/assets/javascripts/solidstats/application.js
|
68
|
+
- app/assets/javascripts/solidstats/dashboard.js
|
69
|
+
- app/assets/javascripts/solidstats/gem_metadata.js
|
53
70
|
- app/assets/stylesheets/solidstats/application.css
|
71
|
+
- app/assets/stylesheets/solidstats/components/action_button.css
|
72
|
+
- app/assets/stylesheets/solidstats/components/dashboard.css
|
73
|
+
- app/assets/stylesheets/solidstats/components/dashboard_header.css
|
74
|
+
- app/assets/stylesheets/solidstats/components/dashboard_layout.css
|
75
|
+
- app/assets/stylesheets/solidstats/components/gem_metadata.css
|
76
|
+
- app/assets/stylesheets/solidstats/components/navigation.css
|
77
|
+
- app/assets/stylesheets/solidstats/components/quick_navigation.css
|
78
|
+
- app/assets/stylesheets/solidstats/components/security.css
|
79
|
+
- app/assets/stylesheets/solidstats/components/status_badge.css
|
80
|
+
- app/assets/stylesheets/solidstats/components/summary_card.css
|
81
|
+
- app/assets/stylesheets/solidstats/components/tab_navigation.css
|
82
|
+
- app/components/solidstats/base_component.rb
|
83
|
+
- app/components/solidstats/code_quality/code_quality_section_component.html.erb
|
84
|
+
- app/components/solidstats/code_quality/code_quality_section_component.rb
|
85
|
+
- app/components/solidstats/code_quality/section_component.html.erb
|
86
|
+
- app/components/solidstats/code_quality/section_component.rb
|
87
|
+
- app/components/solidstats/dashboard_header_component.html.erb
|
88
|
+
- app/components/solidstats/dashboard_header_component.rb
|
89
|
+
- app/components/solidstats/previews/action_button_component_preview.rb
|
90
|
+
- app/components/solidstats/previews/action_button_component_preview/button_vs_link.html.erb
|
91
|
+
- app/components/solidstats/previews/action_button_component_preview/sizes.html.erb
|
92
|
+
- app/components/solidstats/previews/action_button_component_preview/variants.html.erb
|
93
|
+
- app/components/solidstats/previews/action_button_component_preview/with_icons.html.erb
|
94
|
+
- app/components/solidstats/previews/navigation_component_preview.rb
|
95
|
+
- app/components/solidstats/previews/stats_overview_component_preview.rb
|
96
|
+
- app/components/solidstats/previews/status_badge_component_preview.rb
|
97
|
+
- app/components/solidstats/previews/status_badge_component_preview/sizes.html.erb
|
98
|
+
- app/components/solidstats/previews/status_badge_component_preview/statuses.html.erb
|
99
|
+
- app/components/solidstats/previews/status_badge_component_preview/with_icons.html.erb
|
100
|
+
- app/components/solidstats/previews/summary_card_component_preview.rb
|
101
|
+
- app/components/solidstats/previews/summary_card_component_preview/clickable.html.erb
|
102
|
+
- app/components/solidstats/previews/summary_card_component_preview/dashboard_layout.html.erb
|
103
|
+
- app/components/solidstats/previews/summary_card_component_preview/statuses.html.erb
|
104
|
+
- app/components/solidstats/previews/summary_card_component_preview/value_formats.html.erb
|
105
|
+
- app/components/solidstats/quick_navigation_component.html.erb
|
106
|
+
- app/components/solidstats/quick_navigation_component.rb
|
107
|
+
- app/components/solidstats/security/gem_impact_analysis_component.html.erb
|
108
|
+
- app/components/solidstats/security/gem_impact_analysis_component.rb
|
109
|
+
- app/components/solidstats/security/overview_component.html.erb
|
110
|
+
- app/components/solidstats/security/overview_component.rb
|
111
|
+
- app/components/solidstats/security/section_component.html.erb
|
112
|
+
- app/components/solidstats/security/section_component.rb
|
113
|
+
- app/components/solidstats/security/timeline_component.html.erb
|
114
|
+
- app/components/solidstats/security/timeline_component.rb
|
115
|
+
- app/components/solidstats/tasks_section_component.html.erb
|
116
|
+
- app/components/solidstats/tasks_section_component.rb
|
117
|
+
- app/components/solidstats/ui/action_button_component.html.erb
|
118
|
+
- app/components/solidstats/ui/action_button_component.rb
|
119
|
+
- app/components/solidstats/ui/dashboard_layout_component.html.erb
|
120
|
+
- app/components/solidstats/ui/dashboard_layout_component.rb
|
121
|
+
- app/components/solidstats/ui/navigation_component.html.erb
|
122
|
+
- app/components/solidstats/ui/navigation_component.rb
|
123
|
+
- app/components/solidstats/ui/stats_overview_component.html.erb
|
124
|
+
- app/components/solidstats/ui/stats_overview_component.rb
|
125
|
+
- app/components/solidstats/ui/status_badge_component.html.erb
|
126
|
+
- app/components/solidstats/ui/status_badge_component.rb
|
127
|
+
- app/components/solidstats/ui/summary_card_component.html.erb
|
128
|
+
- app/components/solidstats/ui/summary_card_component.rb
|
129
|
+
- app/components/solidstats/ui/tab_navigation_component.html.erb
|
130
|
+
- app/components/solidstats/ui/tab_navigation_component.rb
|
54
131
|
- app/controllers/solidstats/application_controller.rb
|
55
132
|
- app/controllers/solidstats/dashboard_controller.rb
|
133
|
+
- app/controllers/solidstats/gem_metadata_controller.rb
|
56
134
|
- app/helpers/solidstats/application_helper.rb
|
57
135
|
- app/jobs/solidstats/application_job.rb
|
58
136
|
- app/mailers/solidstats/application_mailer.rb
|
59
137
|
- app/models/solidstats/application_record.rb
|
60
138
|
- app/services/solidstats/audit_service.rb
|
61
139
|
- app/services/solidstats/data_collector_service.rb
|
140
|
+
- app/services/solidstats/gem_metadata/fetcher_service.rb
|
141
|
+
- app/services/solidstats/log_size_monitor_service.rb
|
62
142
|
- app/services/solidstats/todo_service.rb
|
63
143
|
- app/views/layouts/solidstats/application.html.erb
|
144
|
+
- app/views/solidstats/dashboard/_log_monitor.html.erb
|
64
145
|
- app/views/solidstats/dashboard/_todos.html.erb
|
65
146
|
- app/views/solidstats/dashboard/audit/_additional_styles.css
|
66
147
|
- app/views/solidstats/dashboard/audit/_audit_badge.html.erb
|
@@ -71,10 +152,26 @@ files:
|
|
71
152
|
- app/views/solidstats/dashboard/audit/_vulnerabilities_table.html.erb
|
72
153
|
- app/views/solidstats/dashboard/audit/_vulnerability_details.html.erb
|
73
154
|
- app/views/solidstats/dashboard/index.html.erb
|
155
|
+
- app/views/solidstats/gem_metadata/_panel.html.erb
|
74
156
|
- config/routes.rb
|
157
|
+
- lib/generators/solidstats/feature/feature_generator.rb
|
158
|
+
- lib/generators/solidstats/feature/templates/component.html.erb
|
159
|
+
- lib/generators/solidstats/feature/templates/component.rb.erb
|
160
|
+
- lib/generators/solidstats/feature/templates/component.scss
|
161
|
+
- lib/generators/solidstats/feature/templates/component_test.rb.erb
|
162
|
+
- lib/generators/solidstats/feature/templates/controller.rb.erb
|
163
|
+
- lib/generators/solidstats/feature/templates/controller_test.rb.erb
|
164
|
+
- lib/generators/solidstats/feature/templates/detail_view.html.erb
|
165
|
+
- lib/generators/solidstats/feature/templates/preview.rb.erb
|
166
|
+
- lib/generators/solidstats/feature/templates/service.rb.erb
|
167
|
+
- lib/generators/solidstats/feature/templates/service_test.rb.erb
|
75
168
|
- lib/generators/solidstats/install/install_generator.rb
|
76
169
|
- lib/generators/solidstats/install/templates/README
|
170
|
+
- lib/generators/solidstats/install_generator.rb
|
171
|
+
- lib/generators/solidstats/templates/initializer.rb
|
77
172
|
- lib/solidstats.rb
|
173
|
+
- lib/solidstats/asset_compatibility.rb
|
174
|
+
- lib/solidstats/asset_manifest.rb
|
78
175
|
- lib/solidstats/engine.rb
|
79
176
|
- lib/solidstats/version.rb
|
80
177
|
- lib/tasks/solidstats_install.rake
|