track_relay 1.3.0 → 1.4.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4d71fbb5a7101c3f407ba9fc7c05bf032a5718447a7cacd341647b9b794c47b2
4
- data.tar.gz: b36598739beda0519f71b98cf906159b3857234dd9510d7aff35d1f33ecd9808
3
+ metadata.gz: d7fca8b3efc2716f3ba667aecdadd66bf58f2cbbd18a76f28dd04784a521ffdf
4
+ data.tar.gz: 01103c51038bf8fbefd95e63b513223ea93407e6583f4925ed3756805209a670
5
5
  SHA512:
6
- metadata.gz: f71946bad98b203c57850991846de8e3fb95828bc825f5d9ccb2d6b5a205d6531253087a65e77c0e4eb4981f5e95129439ecf081fc719939618daeb93b611ca0
7
- data.tar.gz: 1b05f9d685e43a6c97e37f306aa6f0a970f1b7fe6ccb774a037a4a26043295d7464a22ec2d821425aad6eb9ac6e1e07461420f7fc8ce6875f3bec1919e3d95e1
6
+ metadata.gz: a36d9e2d83ea2215798bc5ed963b0e618aa29436c83ad6e0d72ee0f46472435300fcfe0ae4fb9eecc29e491c25ca258e5f7cc6b85110f17f959cd6e9af3c4cc1
7
+ data.tar.gz: 0b855b5604793c877501ee2892a1f0d374384b257391b27f5cc1f453f8064a885acb5b874b5df8de97340dab64deb4ac808c625d749ed3961f8d213db8afc68d
data/CHANGELOG.md CHANGED
@@ -7,6 +7,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [1.4.0] - 2026-07-31
11
+
12
+ ### Added
13
+ - `config.manifest_path` — hosts can relocate the generated event-schema
14
+ manifest outside the public web root (the on-disk catalog discloses
15
+ internal event names/params when served world-readable). Defaults to
16
+ `nil`, preserving the existing `public/track_relay_catalog.json`
17
+ behavior. The `track_relay:manifest` rake task, the development
18
+ catalog hot-reload regeneration, and the `assets:precompile` chaining
19
+ all honor it, since every default-path write flows through
20
+ `TrackRelay::Manifest.write!`.
21
+
10
22
  ## [1.3.0] - 2026-07-31
11
23
 
12
24
  ### Added
@@ -64,7 +64,7 @@ namespace :track_relay do
64
64
  exit(clean ? 0 : 1)
65
65
  end
66
66
 
67
- desc "Generate public/track_relay_catalog.json from the loaded catalog"
67
+ desc "Generate the catalog manifest (config.manifest_path, default public/track_relay_catalog.json)"
68
68
  task manifest: :environment do
69
69
  # Footgun guard (RISK-04): an empty manifest tells the JS client
70
70
  # "no schema, accept everything" — silently. Abort loudly so the
@@ -87,7 +87,8 @@ module TrackRelay
87
87
  :ga4_enrich_page_context,
88
88
  :track_gate,
89
89
  :signed_client_token_secret,
90
- :signed_client_token_ttl
90
+ :signed_client_token_ttl,
91
+ :manifest_path
91
92
 
92
93
  # @return [Array] registered subscriber instances, in insertion order
93
94
  attr_reader :subscribers
@@ -116,6 +117,7 @@ module TrackRelay
116
117
  @track_gate = nil
117
118
  @signed_client_token_secret = nil
118
119
  @signed_client_token_ttl = 30.days
120
+ @manifest_path = nil
119
121
  end
120
122
 
121
123
  # Append a subscriber to the registry.
@@ -74,6 +74,15 @@ module TrackRelay
74
74
  private
75
75
 
76
76
  def default_path
77
+ # `config.manifest_path` lets hosts keep the event schema out of
78
+ # the public web root; the rake task, dev reload, and
79
+ # assets:precompile chaining all resolve through here. The
80
+ # respond_to? guard keeps this file loadable standalone (the
81
+ # rake file require_relative's it without the umbrella require).
82
+ if TrackRelay.respond_to?(:config) && (configured = TrackRelay.config.manifest_path)
83
+ return configured
84
+ end
85
+
77
86
  unless defined?(Rails) && Rails.respond_to?(:root) && Rails.root
78
87
  raise ArgumentError,
79
88
  "TrackRelay::Manifest.write! requires a `path:` argument when Rails.root is unavailable"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TrackRelay
4
- VERSION = "1.3.0"
4
+ VERSION = "1.4.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: track_relay
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dchuk