panda-core 0.10.1 → 0.10.2
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: f1ca00630306c920fd7c8b7a5c8703532d44c6f24e1960b5a070f5083ee9d467
|
|
4
|
+
data.tar.gz: aaebba3e769ccba28420bb69680d461558b6371e88977c38846e8180d045acce
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9b4235040de9088b17e648d1085c3740129dd62a0d319ff4548d32e979bf425caf1b3fe80a4491898fef8a42d61517cb5fe2d3c55f1f949f707f8708e8eabf27
|
|
7
|
+
data.tar.gz: c4afb07c75306e2e6a2a689f3fc24c89bc62c274b71f6d5d8490d6874f5776afd318fc4dbb74bcca4f67e74ab1555d4bbb72d5704daa640eb4e6b58167ba9231
|
|
@@ -303,13 +303,34 @@ module Panda
|
|
|
303
303
|
return @app.call(env) if relative_path.empty?
|
|
304
304
|
|
|
305
305
|
# Try to find the file in registered modules
|
|
306
|
+
if ENV["RSPEC_DEBUG"]
|
|
307
|
+
puts "[JavaScriptMiddleware] Looking for: #{path} (relative: #{relative_path})"
|
|
308
|
+
end
|
|
309
|
+
|
|
306
310
|
file_path = find_javascript_file(relative_path)
|
|
307
311
|
|
|
308
312
|
if file_path && File.file?(file_path)
|
|
309
|
-
puts "[JavaScriptMiddleware] Serving: #{path} from #{file_path}" if ENV["RSPEC_DEBUG"]
|
|
313
|
+
puts "[JavaScriptMiddleware] ✅ Serving: #{path} from #{file_path}" if ENV["RSPEC_DEBUG"]
|
|
310
314
|
serve_file(file_path, env)
|
|
311
315
|
else
|
|
312
|
-
|
|
316
|
+
if ENV["RSPEC_DEBUG"]
|
|
317
|
+
puts "[JavaScriptMiddleware] ❌ Not found: #{path}"
|
|
318
|
+
puts "[JavaScriptMiddleware] Searched relative path: #{relative_path}"
|
|
319
|
+
puts "[JavaScriptMiddleware] Checked locations:"
|
|
320
|
+
ModuleRegistry.modules.each do |gem_name, info|
|
|
321
|
+
if ModuleRegistry.send(:engine_available?, info[:engine])
|
|
322
|
+
root = ModuleRegistry.send(:engine_root, info[:engine])
|
|
323
|
+
if root
|
|
324
|
+
puts "[JavaScriptMiddleware] - #{root.join("app/javascript/panda", relative_path)}"
|
|
325
|
+
puts "[JavaScriptMiddleware] - #{root.join("public/panda", relative_path)}"
|
|
326
|
+
end
|
|
327
|
+
end
|
|
328
|
+
end
|
|
329
|
+
if defined?(Rails.root)
|
|
330
|
+
puts "[JavaScriptMiddleware] - #{Rails.root.join("app/javascript/panda", relative_path)}"
|
|
331
|
+
puts "[JavaScriptMiddleware] - #{Rails.root.join("public/panda", relative_path)}"
|
|
332
|
+
end
|
|
333
|
+
end
|
|
313
334
|
@app.call(env)
|
|
314
335
|
end
|
|
315
336
|
rescue => e
|
|
@@ -329,9 +350,24 @@ module Panda
|
|
|
329
350
|
root = ModuleRegistry.send(:engine_root, info[:engine])
|
|
330
351
|
next unless root
|
|
331
352
|
|
|
332
|
-
# Check in app/javascript/panda/
|
|
353
|
+
# Check in app/javascript/panda/ (primary location)
|
|
333
354
|
candidate = root.join("app/javascript/panda", relative_path)
|
|
334
355
|
return candidate.to_s if candidate.exist? && candidate.file?
|
|
356
|
+
|
|
357
|
+
# Fallback to public/panda/ (for CI environments where assets are copied)
|
|
358
|
+
public_candidate = root.join("public/panda", relative_path)
|
|
359
|
+
return public_candidate.to_s if public_candidate.exist? && public_candidate.file?
|
|
360
|
+
end
|
|
361
|
+
|
|
362
|
+
# Also check Rails.root if available (for dummy apps in CI)
|
|
363
|
+
if defined?(Rails.root)
|
|
364
|
+
# Check app/javascript/panda/ in Rails.root
|
|
365
|
+
rails_candidate = Rails.root.join("app/javascript/panda", relative_path)
|
|
366
|
+
return rails_candidate.to_s if rails_candidate.exist? && rails_candidate.file?
|
|
367
|
+
|
|
368
|
+
# Fallback to public/panda/ in Rails.root
|
|
369
|
+
rails_public_candidate = Rails.root.join("public/panda", relative_path)
|
|
370
|
+
return rails_public_candidate.to_s if rails_public_candidate.exist? && rails_public_candidate.file?
|
|
335
371
|
end
|
|
336
372
|
|
|
337
373
|
nil
|
|
@@ -36,13 +36,24 @@ Capybara.register_server :puma_ci do |app, port, host|
|
|
|
36
36
|
min_threads = Integer(ENV.fetch("PUMA_MIN_THREADS", "2"))
|
|
37
37
|
max_threads = Integer(ENV.fetch("PUMA_MAX_THREADS", "2"))
|
|
38
38
|
|
|
39
|
+
# Wrap the app to catch startup errors
|
|
40
|
+
wrapped_app = proc do |env|
|
|
41
|
+
app.call(env)
|
|
42
|
+
rescue => e
|
|
43
|
+
puts "[CI ERROR] Rails middleware error during request:"
|
|
44
|
+
puts "[CI ERROR] #{e.class}: #{e.message}"
|
|
45
|
+
puts "[CI ERROR] Backtrace:"
|
|
46
|
+
puts e.backtrace.first(10).join("\n")
|
|
47
|
+
raise e
|
|
48
|
+
end
|
|
49
|
+
|
|
39
50
|
options = {
|
|
40
51
|
Host: host,
|
|
41
52
|
Port: port,
|
|
42
53
|
Threads: "#{min_threads}:#{max_threads}",
|
|
43
54
|
Workers: 0,
|
|
44
|
-
Silent:
|
|
45
|
-
Verbose:
|
|
55
|
+
Silent: false, # Always verbose in CI to catch startup errors
|
|
56
|
+
Verbose: true,
|
|
46
57
|
PreloadApp: false
|
|
47
58
|
}
|
|
48
59
|
|
|
@@ -53,11 +64,11 @@ Capybara.register_server :puma_ci do |app, port, host|
|
|
|
53
64
|
# Puma <= 6.x signature:
|
|
54
65
|
# run(app, options_hash)
|
|
55
66
|
puts "[CI Config] Using Puma <= 6 API (arity 2)"
|
|
56
|
-
Rack::Handler::Puma.run(
|
|
67
|
+
Rack::Handler::Puma.run(wrapped_app, options)
|
|
57
68
|
else
|
|
58
69
|
# Puma >= 7.x signature:
|
|
59
70
|
# run(app, **options)
|
|
60
71
|
puts "[CI Config] Using Puma >= 7 API (keyword args)"
|
|
61
|
-
Rack::Handler::Puma.run(
|
|
72
|
+
Rack::Handler::Puma.run(wrapped_app, **options)
|
|
62
73
|
end
|
|
63
74
|
end
|
data/lib/panda/core/version.rb
CHANGED