-
Notifications
You must be signed in to change notification settings - Fork 10
How to update "uswds rails" gem
Joshua Drumm edited this page Apr 14, 2021
·
9 revisions
- Download the newest version of
uswds
via their GitHub: https://github.com/uswds/uswds. - Clone the forked
uswds-rails
repository to your local, if you don't already have it, from the Agile Six GitHub: https://github.com/agilesix/uswds-rails. - Branch off of the most recent version branch (
2.11.1
as of04/13/21
). - Copy the
fonts
,images
, andscss
folder contents from the newly downloadeduswds
version and replace the existing folder contents for each of these items within thevendor/assests
path. Important note: Be sure to copy the new folder contents into the correspondinguswds
folder (ex: copy thefonts
folder contents from the new version to thevendor/assets/fonts/uswds
folder of the existing version).
- Copy the new
javascripts/uswds.js
file to the existingvendor/assets/javascripts/uswds
folder.
- Copy the same
scss
folder from step 3 to the existingapp/assets/stylesheets/uswds
folder.
- Rails-ify the asset pipeline in the new
scss
files by addingasset-url
andfont-url
where required. Refer to this commit if need be: https://github.com/agilesix/uswds-rails/commit/9efc311b7673b6765bc2cf3ab36903658b479ef3. - Change, if necessary, the
$theme-image-path
value in the following files:
- Approximately line
28
ofapp/assets/stylesheets/uswds/theme/_uswds-theme-general.scss
should be"uswds"
. - Approximately line
28
ofapp/assets/stylesheets/uswds/settings/_settings-general.scss
should be"uswds" !default
. - Approximately line
28
ofvendor/assets/stylesheets/uswds/theme/_uswds-theme-general.scss
should be"uswds"
. - Approximately line
28
ofvendor/assets/stylesheets/uswds/settings/_settings-general.scss
should be"uswds" !default
.
- Change, if necessary, the
$theme-font-path
value in the following files:
- Approximately line
80
ofapp/assets/stylesheets/uswds/theme/_uswds-theme-typography.scss
should be"uswds"
. - Approximately line
80
ofapp/assets/stylesheets/uswds/settings/_settings-typography.scss
should be"uswds" !default
. - Approximately line
80
ofvendor/assets/stylesheets/uswds/theme/_uswds-theme-typography.scss
should be"uswds"
. - Approximately line
80
ofvendor/assets/stylesheets/uswds/settings/_settings-typography.scss
should be"uswds" !default
.
- Add, if necessary, the following code to lines
3-5
ofapp/assets/stylesheets/uswds/uswds.scss
:
// Relative font and image file paths
$font-path: 'uswds';
$image-path: 'uswds';
- Port over all custom javascript from previous version branches in the
agilesix/uswds-rails
repository. This will potentially be a running list of branches that have custom changes which have yet to be resolved by USWDS, along with the commit numbers that contain each change, so please add to this when any future changes are made.
As of04/13/21
:- Branch
2.8.1
: commits2e308f7bb3835f917ea556d8f5d03006688096f6
,79b82e18284a94e6a8e083b6fbf022a66df75140
, andbc5c729d132ef27ccdcf26bdf6cfac530d92ebeb
.
- Branch
- Change the
uswds
version number to match the newest version you want to use in thelib/uswds/rails/version.rb
file. - Commit these changes and push the new branch to GitHub.
- Branch off of
diffusion-marketplace
's master branch and point to the newagilesix/uswds-rails
branch you created in the previous steps by changing theref
value for theuswds-rails
gem in thegemfile
file (ex:gem 'uswds-rails', github: 'agilesix/uswds-rails', ref: 'abc1234'
. - Run
bundle install
. - Check for any potential adverse effects of upgrading the
uswds
version and make sure everything looks and works as expected. -
Important note: If you commit additional changes to the new
agilesix/uswds-rails
branch, be sure to checkout to thediffusion-marketplace
branch you created in step14
and update theref
value in thegemfile
and runbundle install
.