bridgetown-image-pipeline 0.1.0 → 0.1.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: 4b506abefc78cfff32c2485ca39d6cd789486ffde30b52060e9aee52a2333510
4
- data.tar.gz: 5bf51dd415078908778245b62003e4e36417519bb134e174e470bb77573f2f8c
3
+ metadata.gz: 2ad90fe01d5bc5d5ca76f72ae24e0cabca9af803516ca4b69570d5e6a95b601c
4
+ data.tar.gz: 16552338a9cf2653629ca8647f0e416c352c3446510306647d92b6ba5c4730c4
5
5
  SHA512:
6
- metadata.gz: 8bd6e9145bf27b2ca0156ee67ce008bae9b3648d458baf7ec46adcbbddd34cc2e777c7436fee2a8882f8c90bb77954574e12149a937cd4d00290d5a7ab9001e3
7
- data.tar.gz: 3d2cc00f6657d78ebf7c5777d6d28b8e1e46e116a500e991373c324d140c1c55f4b4ea9e28bfbace1d8d2f5b9c23249b4aa0e02e96633b4a2a1f1cbe08385f21
6
+ metadata.gz: 72d44062cfacc1ab027bd78b2f735fc4ce8f77240cc62c14b1aed8fefb9fe9d175fa476ab47553039858975fb2ce28805496401d1d5f84fd64eabc65d727456d
7
+ data.tar.gz: 6493826ccaa572137ca1e704ffbcdd78599f978f10f562d23f6670304d1663c9ee88edffa602a987e8cfec300d9da2e8373ea8e3d36c7040452db688eedb7971
data/CHANGELOG.md CHANGED
@@ -6,6 +6,22 @@ project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [0.1.1] - 2026-05-19
10
+
11
+ ### Fixed
12
+
13
+ - Processor no longer emits a duplicate fallback variant when the source
14
+ image's format already matches one of the configured `formats`. With
15
+ `formats: [:webp]` and a `.webp` source, each width was generating two
16
+ identical variants and the rendered `<picture>` `<source srcset>` had
17
+ double entries per width (#9).
18
+
19
+ ### Internal
20
+
21
+ - Added `.bridgetown-cache/` to `.gitignore` so it stops showing up in
22
+ plugin-repo working trees when the plugin is exercised from a host
23
+ site checkout.
24
+
9
25
  ## [0.1.0] - 2026-05-15
10
26
 
11
27
  Initial release. Extracted from
data/RELEASING.md ADDED
@@ -0,0 +1,95 @@
1
+ # Releasing
2
+
3
+ How to cut a new release of `bridgetown-image-pipeline`. Two paths: **manual** (`rake release` from your machine) and **automated** (push a tag, GitHub Actions publishes via Trusted Publishing).
4
+
5
+ ## Pre-flight checks
6
+
7
+ Run these before bumping the version:
8
+
9
+ ```sh
10
+ bundle exec rake test # all green
11
+ bundle exec rake rubocop # clean
12
+ bundle exec rake build # gem builds without warnings
13
+ ```
14
+
15
+ Optional sanity: unpack the built gem and confirm no stray files shipped.
16
+
17
+ ```sh
18
+ gem unpack pkg/bridgetown-image-pipeline-X.Y.Z.gem -t /tmp/unpacked
19
+ ls /tmp/unpacked/bridgetown-image-pipeline-X.Y.Z
20
+ ```
21
+
22
+ Make sure `.bridgetown-cache/`, fixtures, and test files are not included.
23
+
24
+ ## Version + changelog
25
+
26
+ 1. Bump the constant in [lib/bridgetown/image_pipeline/version.rb](lib/bridgetown/image_pipeline/version.rb).
27
+ 2. Add a dated section to [CHANGELOG.md](CHANGELOG.md) describing the changes since the last release.
28
+ 3. Commit both changes together:
29
+
30
+ ```sh
31
+ git commit -am "Release vX.Y.Z"
32
+ ```
33
+
34
+ ## Path A — manual release (current default)
35
+
36
+ `bundler/gem_tasks` (loaded in [Rakefile](Rakefile)) provides `rake release`. It will:
37
+
38
+ - Build the gem into `pkg/`
39
+ - Create a `vX.Y.Z` git tag
40
+ - Push the commit and tag to `origin`
41
+ - Push the `.gem` to rubygems.org using credentials in `~/.gem/credentials`
42
+
43
+ ```sh
44
+ bundle exec rake release
45
+ ```
46
+
47
+ Requires `gem signin` to have been run once on this machine. Credentials live at `~/.gem/credentials` (chmod 600).
48
+
49
+ ## Path B — automated release via GitHub Actions
50
+
51
+ [.github/workflows/release.yml](.github/workflows/release.yml) publishes on any `v*` tag push using rubygems.org Trusted Publishing (OIDC, no stored API key).
52
+
53
+ **One-time setup** (already done? skip):
54
+
55
+ 1. **rubygems.org** → gem page → Trusted Publishers → add:
56
+ - Repository: `beflagrant/bridgetown-image-pipeline`
57
+ - Workflow filename: `release.yml`
58
+ - Environment: `rubygems`
59
+ 2. **GitHub** → repo Settings → Environments → create `rubygems`. Optionally restrict to tags matching `v*`.
60
+ 3. The gem must already exist on rubygems.org (Trusted Publishing won't create a new gem). First release must be a manual `rake release` or `gem push`.
61
+
62
+ **Release flow once set up:**
63
+
64
+ ```sh
65
+ # bump version.rb and CHANGELOG.md
66
+ git commit -am "Release vX.Y.Z"
67
+ git tag vX.Y.Z
68
+ git push origin main --tags
69
+ ```
70
+
71
+ The workflow runs tests, then `rubygems/release-gem@v1` builds and pushes. Watch the Actions tab.
72
+
73
+ > `rubygems/release-gem@v1` expects the gemspec version to match the tag — drift fails loud. That's a feature.
74
+
75
+ ## After publishing
76
+
77
+ - Confirm the version appears on https://rubygems.org/gems/bridgetown-image-pipeline.
78
+ - Smoke test in a clean dir: `gem install bridgetown-image-pipeline -v X.Y.Z` then `ruby -rbridgetown/image_pipeline -e 'puts Bridgetown::ImagePipeline::VERSION'`.
79
+ - Close any milestones / linked issues.
80
+
81
+ ## Yanking a broken release
82
+
83
+ If a release is broken, yank within minutes of publishing rather than letting installs spread:
84
+
85
+ ```sh
86
+ gem yank bridgetown-image-pipeline -v X.Y.Z
87
+ ```
88
+
89
+ Yanked versions can't be re-pushed under the same number. Bump to `X.Y.Z+1` and release a fix. Note the yank in CHANGELOG.md.
90
+
91
+ ## Notes
92
+
93
+ - `rake release` and the Action both rely on the gemspec's `files` glob — keep it tight so test fixtures and cache dirs stay out of the published gem.
94
+ - Trusted Publishing supersedes the older `RUBYGEMS_API_KEY` secret pattern. Do not add that secret if it isn't already there.
95
+ - Pre-release versions (`X.Y.Z.pre1`, `X.Y.Z.rc1`) work the same — tag them `vX.Y.Z.pre1` for the Action to fire.
@@ -17,6 +17,7 @@ module Bridgetown
17
17
  source_height = image.height
18
18
  original_ext = File.extname(source_path).downcase.delete(".")
19
19
  original_ext = "jpg" if original_ext == "jpeg"
20
+ original_fmt = original_ext.to_sym
20
21
 
21
22
  variants = []
22
23
 
@@ -27,7 +28,14 @@ module Bridgetown
27
28
  variants << build_variant(source_path, basename, target_width, fmt)
28
29
  end
29
30
 
30
- variants << build_variant(source_path, basename, target_width, original_ext.to_sym)
31
+ # Generate a fallback variant in the source's own format so the
32
+ # <img src> always has something to point at, but skip it when
33
+ # the configured formats already cover the source format —
34
+ # otherwise variants ends up with duplicates (e.g. webp source
35
+ # with formats=[:webp] would emit each width twice).
36
+ next if @config.formats.include?(original_fmt)
37
+
38
+ variants << build_variant(source_path, basename, target_width, original_fmt)
31
39
  end
32
40
 
33
41
  {
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Bridgetown
4
4
  module ImagePipeline
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.1"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-image-pipeline
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jim Remsik
@@ -86,6 +86,7 @@ files:
86
86
  - CHANGELOG.md
87
87
  - LICENSE.txt
88
88
  - README.md
89
+ - RELEASING.md
89
90
  - Rakefile
90
91
  - docs/INTERNALS.md
91
92
  - docs/adr/0001-bg-image-delivery-via-image-set.md
@@ -127,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 4.0.6
131
+ rubygems_version: 3.6.9
131
132
  specification_version: 4
132
133
  summary: Build-time AVIF/WebP image derivatives and helpers for Bridgetown.
133
134
  test_files: []