biscuit-rails 0.2.0 → 0.2.1

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: a99734c304d99da013a29fd797e8d8d9461bdea8811bb87997bddc4a0b1cd100
4
- data.tar.gz: b93c476239e0e9ee02f5466596b1de11dc3f24fcb3794c7b99497a66073efaf4
3
+ metadata.gz: 1eacb49f37fb2acc7796bd6574367af55d9428d4b3d83c69420a12f6c2856359
4
+ data.tar.gz: 22d3e98312498def4e3c0420448b1698a0fa123891dfe5e32237e90494760115
5
5
  SHA512:
6
- metadata.gz: 695482883b254ce859513919089eaa30f80947d792f9755cba738db35aff1bfde4bf6472cdbde5860b4e300acf05dda113ba595f26a422f2d6d60ef1833975d1
7
- data.tar.gz: 197a2f37232f33b7b179fef7418497eaed80a3630016175e75709315e01778b273fdc0fa8347371b07c84884b0d78b0e696b9d6f0093eb930f779d8bc4ed0c6b
6
+ metadata.gz: 88015405e5c6ef0cc3cdbd927008e59fa0717660c645aca958ce88bb7ebef09dc994f23a316c0b68eb129765b72847bb52cd7fef7c8e96f1b8d4e12658faea50
7
+ data.tar.gz: 57993714ad02872a2e6b84b489db819a52ce6f9c6fb427fd9a08434ac2e9494e400810ba48e416e908a5640859b193f361d8a17a3476be4fff6d0e6584eef9c5
data/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.2.1] - 2026-04-02
9
+
10
+ ### Fixed
11
+
12
+ - `biscuit-install` skill: add Sprockets manifest step — when not using Propshaft,
13
+ `biscuit/biscuit.css` and `biscuit/biscuit_controller.js` must be linked in
14
+ `app/assets/config/manifest.js` or they 404 in test and production
15
+ - `biscuit-install` skill: fix integration test POST syntax — `body:` is not a valid
16
+ Rails integration test keyword; replaced with `params: { ... }.to_json` and explicit
17
+ `Content-Type`/`Accept` headers
18
+ - `biscuit-install` skill: explain why the Stimulus controller must be registered
19
+ manually (`eagerLoadControllersFrom` only discovers controllers in
20
+ `app/javascript/controllers/`, not gem-provided ones)
21
+
22
+ ---
23
+
8
24
  ## [0.2.0] - 2026-03-31
9
25
 
10
26
  ### Added
@@ -1,3 +1,3 @@
1
1
  module Biscuit
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
@@ -100,6 +100,8 @@ application.register("biscuit", BiscuitController)
100
100
 
101
101
  Ensure `application` is already imported at the top of that file (it will be in the standard Rails 8 scaffold).
102
102
 
103
+ The explicit import is required because Rails' `eagerLoadControllersFrom` only auto-discovers controllers under `app/javascript/controllers/` — it cannot find controllers provided by gems, so they must always be registered manually.
104
+
103
105
  ### If using esbuild / jsbundling
104
106
 
105
107
  The same import and register lines apply, but inform the user that `@hotwired/stimulus` must be marked as external in their esbuild config so it is not bundled twice:
@@ -126,6 +128,15 @@ If the app uses `reload_on_consent: true` (from Step 4), use:
126
128
  <%= biscuit_banner(reload_on_consent: true) %>
127
129
  ```
128
130
 
131
+ ### Sprockets manifest (if not using Propshaft)
132
+
133
+ If the app uses Sprockets (no `propshaft` in Gemfile), check whether `app/assets/config/manifest.js` exists. If it does, append these two lines if they are not already present — otherwise the stylesheet and JS file will 404 in test and production:
134
+
135
+ ```js
136
+ //= link biscuit/biscuit.css
137
+ //= link biscuit/biscuit_controller.js
138
+ ```
139
+
129
140
  ---
130
141
 
131
142
  ## Step 7 — Cookie and tracking script audit
@@ -209,20 +220,18 @@ class BiscuitConsentTest < ActionDispatch::IntegrationTest
209
220
  end
210
221
 
211
222
  test "accept all sets consent cookie" do
212
- post "/biscuit/consent", params: {},
213
- headers: { "Content-Type" => "application/json" },
214
- as: :json,
215
- body: { categories: { analytics: true, marketing: true } }.to_json
223
+ post "/biscuit/consent",
224
+ params: { categories: { analytics: true, marketing: true } }.to_json,
225
+ headers: { "Content-Type" => "application/json", "Accept" => "application/json" }
216
226
  assert_response :success
217
227
  assert Biscuit::Consent.new(cookies).given?
218
228
  assert Biscuit::Consent.new(cookies).allowed?(:analytics)
219
229
  end
220
230
 
221
231
  test "reject all sets non-required categories to false" do
222
- post "/biscuit/consent", params: {},
223
- headers: { "Content-Type" => "application/json" },
224
- as: :json,
225
- body: { categories: { analytics: false, marketing: false } }.to_json
232
+ post "/biscuit/consent",
233
+ params: { categories: { analytics: false, marketing: false } }.to_json,
234
+ headers: { "Content-Type" => "application/json", "Accept" => "application/json" }
226
235
  assert_response :success
227
236
  assert Biscuit::Consent.new(cookies).given?
228
237
  assert_equal false, Biscuit::Consent.new(cookies).allowed?(:analytics)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: biscuit-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gareth James
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-03-31 00:00:00.000000000 Z
10
+ date: 2026-04-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: rails