mailer-log 0.1.20 → 0.2.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/app/views/mailer_log/spa/index.html.erb +6 -1
- data/lib/mailer_log/configuration.rb +3 -1
- data/lib/mailer_log/version.rb +1 -1
- data/lib/tasks/mailer_log.rake +23 -55
- data/public/mailer_log/.vite/manifest.json +1 -1
- data/public/mailer_log/assets/{mailer_log-CzkGXWPn.js → mailer_log-zD1d7Bvi.js} +3 -3
- data/public/mailer_log/index.html +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 26775ff2d2392f342c9abeaefb88bdfb17eb4cf7474f7b7de2e8455196ccabce
|
|
4
|
+
data.tar.gz: 83ea69d74409c16c64df60899ba17e570f141e608326d54751e5e3603f4c0311
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 1cc55ff6f8f4f6a399534f201cc528a9ac09a6921e47078cedff710e960b71a0e76e25e0579d4cc1d5167af51b59fb28af070a89cee14652960030443904df7d
|
|
7
|
+
data.tar.gz: a3a234f111a2dcd6d613f44613c15d0222cfad244c87a7664750c694f48766c2eafd544327ea35c360af9fd96f537683b92577284fd8d23c1ecfdbe4075a7215
|
|
@@ -11,11 +11,16 @@
|
|
|
11
11
|
<% end %>
|
|
12
12
|
</head>
|
|
13
13
|
<body class="bg-gray-100 min-h-screen">
|
|
14
|
+
<% header_partial = MailerLog.configuration.header_partial %>
|
|
14
15
|
<script>
|
|
15
16
|
window.MAILER_LOG_CONFIG = {
|
|
16
|
-
mountPath: '<%= request.script_name %>'
|
|
17
|
+
mountPath: '<%= request.script_name %>',
|
|
18
|
+
hideNavbar: <%= header_partial.present? %>
|
|
17
19
|
};
|
|
18
20
|
</script>
|
|
21
|
+
<% if header_partial %>
|
|
22
|
+
<%= render partial: header_partial %>
|
|
23
|
+
<% end %>
|
|
19
24
|
<div id="app"></div>
|
|
20
25
|
<% if (js = mailer_log_js_entry) %>
|
|
21
26
|
<script type="module" src="<%= request.script_name %>/<%= js %>"></script>
|
|
@@ -6,7 +6,8 @@ module MailerLog
|
|
|
6
6
|
:webhook_signing_key,
|
|
7
7
|
:capture_call_stack,
|
|
8
8
|
:call_stack_depth,
|
|
9
|
-
:per_page
|
|
9
|
+
:per_page,
|
|
10
|
+
:header_partial
|
|
10
11
|
|
|
11
12
|
attr_reader :authenticate_with_proc, :resolve_accountable_proc
|
|
12
13
|
|
|
@@ -16,6 +17,7 @@ module MailerLog
|
|
|
16
17
|
@capture_call_stack = true
|
|
17
18
|
@call_stack_depth = 20
|
|
18
19
|
@per_page = 25
|
|
20
|
+
@header_partial = nil # e.g., 'shared/admin_navbar'
|
|
19
21
|
@authenticate_with_proc = nil
|
|
20
22
|
@resolve_accountable_proc = nil
|
|
21
23
|
end
|
data/lib/mailer_log/version.rb
CHANGED
data/lib/tasks/mailer_log.rake
CHANGED
|
@@ -1,75 +1,43 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
namespace :mailer_log do
|
|
4
|
-
desc '
|
|
5
|
-
task :
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
unless frontend_dir.exist?
|
|
9
|
-
puts <<~MSG
|
|
10
|
-
ERROR: Frontend source not available.
|
|
11
|
-
|
|
12
|
-
This task is for gem development only. When using mailer-log from RubyGems,
|
|
13
|
-
the frontend is pre-built and included in public/mailer_log/.
|
|
4
|
+
desc 'Copy MailerLog assets to public/'
|
|
5
|
+
task install_assets: :environment do
|
|
6
|
+
source = MailerLog::Engine.root.join('public', 'mailer_log')
|
|
7
|
+
destination = Rails.root.join('public', 'mailer_log')
|
|
14
8
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
2. cd mailer-log/frontend
|
|
18
|
-
3. MAILER_LOG_OVERRIDES_PATH=/path/to/your/overrides npm run build
|
|
19
|
-
4. Copy public/mailer_log/ to your app
|
|
20
|
-
MSG
|
|
9
|
+
unless source.exist?
|
|
10
|
+
puts "ERROR: MailerLog assets not found at #{source}"
|
|
21
11
|
exit 1
|
|
22
12
|
end
|
|
23
13
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
puts
|
|
27
|
-
system('npm install', chdir: frontend_dir.to_s) || raise('npm install failed')
|
|
28
|
-
|
|
29
|
-
if overrides_path
|
|
30
|
-
puts "Building frontend with overrides from: #{overrides_path}"
|
|
31
|
-
else
|
|
32
|
-
puts 'Building frontend (no overrides)...'
|
|
33
|
-
puts 'Tip: Set MAILER_LOG_OVERRIDES_PATH to customize navbar and other components'
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
env = overrides_path ? { 'MAILER_LOG_OVERRIDES_PATH' => overrides_path } : {}
|
|
37
|
-
system(env, 'npm run build', chdir: frontend_dir.to_s) || raise('npm build failed')
|
|
38
|
-
|
|
39
|
-
puts 'Frontend built successfully!'
|
|
14
|
+
FileUtils.rm_rf(destination) if destination.exist?
|
|
15
|
+
FileUtils.cp_r(source, destination)
|
|
16
|
+
puts "MailerLog assets copied to #{destination}"
|
|
40
17
|
end
|
|
41
18
|
|
|
42
|
-
desc '
|
|
43
|
-
task :
|
|
19
|
+
desc 'Build MailerLog Vue.js frontend (for gem development only)'
|
|
20
|
+
task :build_frontend do
|
|
44
21
|
frontend_dir = MailerLog::Engine.root.join('frontend')
|
|
45
22
|
|
|
46
23
|
unless frontend_dir.exist?
|
|
47
|
-
puts
|
|
48
|
-
ERROR: Frontend source not available.
|
|
49
|
-
|
|
50
|
-
This task is for gem development only. When using mailer-log from RubyGems,
|
|
51
|
-
the frontend is pre-built and served automatically.
|
|
52
|
-
|
|
53
|
-
To develop the frontend with hot-reload:
|
|
54
|
-
1. Clone the gem repository: git clone https://github.com/trafficrunners/mailer-log.git
|
|
55
|
-
2. cd mailer-log/frontend
|
|
56
|
-
3. npm install
|
|
57
|
-
4. MAILER_LOG_OVERRIDES_PATH=/path/to/your/overrides npm run dev
|
|
58
|
-
MSG
|
|
24
|
+
puts 'ERROR: Frontend source not available (only in gem source, not RubyGems)'
|
|
59
25
|
exit 1
|
|
60
26
|
end
|
|
61
27
|
|
|
62
|
-
|
|
28
|
+
puts 'Installing npm dependencies...'
|
|
29
|
+
system('npm install', chdir: frontend_dir.to_s) || raise('npm install failed')
|
|
63
30
|
|
|
64
|
-
puts '
|
|
65
|
-
|
|
66
|
-
puts 'Make sure Rails is running on http://localhost:3000'
|
|
31
|
+
puts 'Building frontend...'
|
|
32
|
+
system('npm run build', chdir: frontend_dir.to_s) || raise('npm build failed')
|
|
67
33
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
34
|
+
puts 'Frontend built successfully!'
|
|
35
|
+
end
|
|
36
|
+
end
|
|
71
37
|
|
|
72
|
-
|
|
73
|
-
|
|
38
|
+
# Hook into assets:precompile to copy MailerLog assets
|
|
39
|
+
if Rake::Task.task_defined?('assets:precompile')
|
|
40
|
+
Rake::Task['assets:precompile'].enhance do
|
|
41
|
+
Rake::Task['mailer_log:install_assets'].invoke
|
|
74
42
|
end
|
|
75
43
|
end
|