Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 125 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,132 @@
# Created by https://www.toptal.com/developers/gitignore/api/ruby,macos,linux,windows
# Edit at https://www.toptal.com/developers/gitignore?templates=ruby,macos,linux,windows

### Linux ###
*~

# temporary files which can be created if a process still has a handle open of a deleted file
.fuse_hidden*

# KDE directory preferences
.directory

# Linux trash folder which might appear on any partition or disk
.Trash-*

# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### Ruby ###
*.gem
*.rbc
/.config
/coverage/
/InstalledFiles
/pkg/
/spec/reports/
/spec/examples.txt
/test/tmp/
/test/version_tmp/
/tmp/

# Used by dotenv library to load environment variables.
# .env

# Ignore Byebug command history file.
.byebug_history

## Documentation cache and generated files:
/.yardoc/
/_yardoc/
/doc/
/rdoc/

## Environment normalization:
/.bundle/
/vendor/bundle
/lib/bundler/man/

## Ignore bundler config:
.bundle/

## Ignore all logfiles and tempfiles.
log/*.log
pkg/

## Ignore tempfiles created by testing frameworks.
test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
*.gem

# for a library or gem, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# Gemfile.lock
# .ruby-version
# .ruby-gemset

# unless supporting rvm < 1.11.0 or doing something fancy, ignore this:
.rvmrc

# Used by RuboCop. Remote config files pulled in from inherit_from directive.
# .rubocop-https?--*

### Windows ###
# Windows thumbnail cache files
Thumbs.db
Thumbs.db:encryptable
ehthumbs.db
ehthumbs_vista.db

# Dump file
*.stackdump

# Folder config file
[Dd]esktop.ini

# Recycle Bin used on file shares
$RECYCLE.BIN/

# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp

# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/ruby,macos,linux,windows
38 changes: 38 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,44 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.4.0] - 2025-12-30

### Added

- Adds a `help` target in the Makefile to list available commands
- Introduced Propshaft asset pipeline support (Rails 8+) alongside existing
Sprockets compatibility
- Refactored Engine initialiser to automatically register framework gem asset
paths (govuk_template, govuk_elements_rails, bootstrap-sass,
font-awesome-rails, govuk_frontend_toolkit)
- Added development environment logging for asset path registration in debug
mode
- Added `make compile` target to clobber and precompile gem assets; also run via
make assets for consistent builds
- Includes code guards to ensure asset pipeline configuration only runs when
assets pipeline is available

### Changed

- Replaced `sass-rails` with `dartsass-rails` as primary SCSS compiler
dependency
- Refactored SCSS entrypoint (`lr_common_styles.scss`) to contain only internal
Common Styles imports; host applications are now responsible for importing
framework dependencies
- Updated `app/assets/config/manifest.js` to remove incorrect stylesheet
directory link and duplicate build references
- Test dummy app configuration also now guards asset configuration with
`respond_to?(:assets)` check for compatibility with Propshaft/Sprockets
- Gem initialiser configuration now conditional on asset pipeline presence,
enabling seamless operation in both Sprockets and Propshaft environments

### Fixed

- Clarified asset dependency structure through updated documentation in SCSS
entrypoint
- Removed misleading configuration directives that conflicted with host
application asset compilation

## [2.3.1] - 2025-10

### Changed
Expand Down
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ group :development, :test do
gem 'rubocop'
gem 'rubocop-ast'
gem 'rubocop-rails'
gem 'sprockets-rails' # Required for test dummy app
end

group :development do
Expand Down
64 changes: 53 additions & 11 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
PATH
remote: .
specs:
lr_common_styles (2.3.1)
lr_common_styles (2.4.0.beta)
bootstrap-sass (~> 3.4.1)
dartsass-rails (~> 0.5.1)
font-awesome-rails (~> 4.7.0)
govuk_elements_rails (= 3.0.2)
govuk_frontend_toolkit (~> 9.0)
Expand All @@ -13,7 +14,6 @@ PATH
modernizr-rails (~> 2.7)
modulejs-rails (~> 2.2.0)
rails (~> 8.0)
sass-rails (~> 6.0)

GEM
remote: https://rubygems.org/
Expand Down Expand Up @@ -107,6 +107,9 @@ GEM
concurrent-ruby (1.3.5)
connection_pool (2.5.4)
crass (1.0.6)
dartsass-rails (0.5.1)
railties (>= 6.0.0)
sass-embedded (~> 1.63)
date (3.5.0)
diff-lcs (1.6.2)
drb (2.2.3)
Expand All @@ -127,6 +130,33 @@ GEM
railties (>= 3.2, < 9.0)
globalid (1.3.0)
activesupport (>= 6.1)
google-protobuf (4.33.2)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-aarch64-linux-gnu)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-aarch64-linux-musl)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-arm64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-x86-linux-gnu)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-x86-linux-musl)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-x86_64-darwin)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-x86_64-linux-gnu)
bigdecimal
rake (>= 13)
google-protobuf (4.33.2-x86_64-linux-musl)
bigdecimal
rake (>= 13)
govuk_elements_rails (3.0.2)
govuk_frontend_toolkit (>= 5.2.0)
rails (>= 4.1.0)
Expand Down Expand Up @@ -318,19 +348,30 @@ GEM
rubyzip (2.4.1)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-embedded (1.97.1)
google-protobuf (~> 4.31)
rake (>= 13)
sass-embedded (1.97.1-aarch64-linux-gnu)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-aarch64-linux-musl)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-arm-linux-gnueabihf)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-arm-linux-musleabihf)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-arm64-darwin)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-x86_64-darwin)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-x86_64-linux-gnu)
google-protobuf (~> 4.31)
sass-embedded (1.97.1-x86_64-linux-musl)
google-protobuf (~> 4.31)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
sprockets (> 3.0)
sprockets-rails
tilt
securerandom (0.4.1)
solargraph (0.57.0)
backport (~> 1.2)
Expand Down Expand Up @@ -412,6 +453,7 @@ DEPENDENCIES
rubocop-rails
ruby-lsp
solargraph
sprockets-rails

BUNDLED WITH
2.7.1
2.7.2
48 changes: 33 additions & 15 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,42 +21,60 @@ ${GEM}: ${SPEC} ./lib/${NAME}/version.rb

all: publish

assets: auth
@echo "Installing all packages ..."
@bundle install
assets: auth bundle compile ## Compile assets for gem distribution
@echo assets completed.

auth: ${AUTH} ## Set up authentication for GitHub Packages
@echo "Authentication set up for GitHub Packages."

auth: ${AUTH}
build: gem ## Alias for the gem target
@echo "Built ${GEM}."

build: gem
bundle: ## Install Ruby gems via Bundler
@echo "Installing Ruby gems via Bundler..."
@bundle install

checks: lint test
checks: lint test ## Run all checks: linting and tests
@echo "All checks passed."

clean:
clean: ## Clean up gem files
@echo "Cleaning up ${GEM} files..."
@rm -rf ${GEM}

gem: ${GEM}
@echo ${GEM}
compile: ## Compile assets for gem distribution
@echo "Removing old compiled assets and compiling ..."
@rake assets:clobber assets:precompile

gem: ${GEM} ## Build the gem package
@gem build ${SPEC}

help: ## Display this message
@echo "Available make targets:"
@grep -hE '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "%-20s %s\n", $$1, $$2}'
@echo ""
@echo "Environment variables (optional: all variables have defaults):"
@make vars

lint: assets
lint: assets ## Run linting checks
@echo "Running rubocop..."
@bundle exec rubocop

publish: ${AUTH} ${GEM}
publish: ${AUTH} ${GEM} ## Publish the gem to GitHub Packages
@echo Publishing package ${NAME}:${VERSION} to ${OWNER} ...
@gem push --key github --host ${GPR} ${GEM}
@echo Done.

realclean: clean
realclean: clean ## Remove all generated files including authentication
@rm -rf ${AUTH}

tags:
tags: ## Show version tags
@echo version=${VERSION}

test: assets
test: assets ## Run tests in the dummy application
@echo "Running tests..."
@rake test

vars:
vars: ## Show important variables
@echo "GEM" = ${GEM}
@echo "GPR" = ${GPR}
@echo "NAME = ${NAME}"
Expand Down
1 change: 0 additions & 1 deletion app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
//= link_tree ../images
//= link_directory ../javascripts/lr_common_styles .js
//= link_directory ../stylesheets/lr_common_styles .css
Loading