Skip to content

Commit

Permalink
Migrate from sprockets to propshaft
Browse files Browse the repository at this point in the history
This changeset was auto-generated by the `rails-template`:
DFE-Digital/rails-template#8
  • Loading branch information
tvararu committed May 16, 2022
1 parent d89ca05 commit f39310d
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 60 deletions.
4 changes: 2 additions & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ ruby "3.1.1"
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
gem "rails", "~> 7.0.3"

# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
gem "sprockets-rails"
# The newer and simpler asset pipeline for Rails [https://github.com/rails/propshaft]
gem "propshaft"

# Use sqlite3 as the database for Active Record
gem "sqlite3", "~> 1.4"
Expand Down
14 changes: 6 additions & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ GEM
racc (~> 1.4)
nokogiri (1.13.6-x86_64-linux)
racc (~> 1.4)
propshaft (0.6.4)
actionpack (>= 7.0.0)
activesupport (>= 7.0.0)
rack
railties (>= 7.0.0)
public_suffix (4.0.7)
puma (5.6.4)
nio4r (~> 2.0)
Expand Down Expand Up @@ -209,13 +214,6 @@ GEM
rspec-support (3.11.0)
shoulda-matchers (5.1.0)
activesupport (>= 5.2.0)
sprockets (4.0.3)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.4.2)
actionpack (>= 5.2)
activesupport (>= 5.2)
sprockets (>= 3.0.0)
sqlite3 (1.4.2)
stimulus-rails (1.0.4)
railties (>= 6.0.0)
Expand Down Expand Up @@ -251,13 +249,13 @@ DEPENDENCIES
govuk-components
govuk_design_system_formbuilder
importmap-rails
propshaft
puma (~> 5.0)
rails (~> 7.0.3)
rladr
rspec
rspec-rails
shoulda-matchers (~> 5.1)
sprockets-rails
sqlite3 (~> 1.4)
stimulus-rails
tzinfo-data
Expand Down
2 changes: 0 additions & 2 deletions app/assets/config/manifest.js

This file was deleted.

10 changes: 4 additions & 6 deletions app/assets/stylesheets/application.scss
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
@import "govuk-frontend/govuk/all";
$govuk-global-styles: true;
$govuk-new-link-styles: true;
$govuk-assets-path: "/";

.app-related-items {
@include govuk-text-colour;
border-top: 2px solid $govuk-brand-colour;
padding-top: govuk-spacing(2);
}
@import "govuk-frontend/govuk/all";
2 changes: 0 additions & 2 deletions app/javascript/application.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// import "./controllers";

import { initAll } from "govuk-frontend";

initAll();
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,7 @@ class Application < Rails::Application
config.generators.system_tests = nil

config.exceptions_app = routes

config.assets.paths << Rails.root.join('node_modules/govuk-frontend/govuk/assets')
end
end
12 changes: 0 additions & 12 deletions config/initializers/assets.rb

This file was deleted.

6 changes: 1 addition & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@
"name": "app",
"private": "true",
"dependencies": {
"@hotwired/stimulus": "^3.0.1",
"@hotwired/turbo-rails": "^7.1.1",
"govuk-frontend": "^4.0.1",
"esbuild": "^0.14.23",
"sass": "^1.49.8"
},
"scripts": {
"build:css": "sass --embed-sources --quiet-deps --load-path=node_modules ./app/assets/stylesheets/application.scss ./app/assets/builds/application.css",
"build:js": "esbuild app/javascript/*.* --bundle --outdir=app/assets/builds",
"preinstall": "mkdir -p app/assets/builds/{fonts,images}",
"postinstall": "cp -R node_modules/govuk-frontend/govuk/assets/fonts/. app/assets/builds/fonts && cp -R node_modules/govuk-frontend/govuk/assets/images/. app/assets/builds/images"
"build:js": "esbuild app/javascript/*.* --bundle --outdir=app/assets/builds"
}
}
23 changes: 0 additions & 23 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,6 @@
# yarn lockfile v1


"@hotwired/stimulus@^3.0.1":
version "3.0.1"
resolved "https://registry.yarnpkg.com/@hotwired/stimulus/-/stimulus-3.0.1.tgz#141f15645acaa3b133b7c247cad58ae252ffae85"
integrity sha512-oHsJhgY2cip+K2ED7vKUNd2P+BEswVhrCYcJ802DSsblJFv7mPFVk3cQKvm2vHgHeDVdnj7oOKrBbzp1u8D+KA==

"@hotwired/turbo-rails@^7.1.1":
version "7.1.1"
resolved "https://registry.yarnpkg.com/@hotwired/turbo-rails/-/turbo-rails-7.1.1.tgz#35c03b92b5c86f0137ed08bef843d955ec9bbe83"
integrity sha512-ZXpxUjCfkdbuXfoGrsFK80qsVzACs8xCfie9rt2jMTSN6o1olXVA0Nrk8u02yNEwSiVJm/4QSOa8cUcMj6VQjg==
dependencies:
"@hotwired/turbo" "^7.1.0"
"@rails/actioncable" "^7.0"

"@hotwired/turbo@^7.1.0":
version "7.1.0"
resolved "https://registry.yarnpkg.com/@hotwired/turbo/-/turbo-7.1.0.tgz#27e44e0e3dc5bd1d4bda0766d579cf5a14091cd7"
integrity sha512-Q8kGjqwPqER+CtpQudbH+3Zgs2X4zb6pBAlr6NsKTXadg45pAOvxI9i4QpuHbwSzR2+x87HUm+rot9F/Pe8rxA==

"@rails/actioncable@^7.0":
version "7.0.3"
resolved "https://registry.yarnpkg.com/@rails/actioncable/-/actioncable-7.0.3.tgz#71f08e958883af64f6a20489318b5e95d2c6dc5b"
integrity sha512-Iefl21FZD+ck1di6xSHMYzSzRiNJTHV4NrAzCfDfqc/wPz4xncrP8f2/fJ+2jzwKIaDn76UVMsALh7R5OzsF8Q==

anymatch@~3.1.2:
version "3.1.2"
resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.2.tgz#c0557c096af32f106198f4f4e2a383537e378716"
Expand Down

0 comments on commit f39310d

Please sign in to comment.