Skip to content

Replace rails-assets.org gems with yarn/npm packages#1254

Merged
fbacall merged 3 commits into
masterfrom
copilot/change-js-css-dependency-installation
Mar 12, 2026
Merged

Replace rails-assets.org gems with yarn/npm packages#1254
fbacall merged 3 commits into
masterfrom
copilot/change-js-css-dependency-installation

Conversation

Copilot AI commented Mar 11, 2026

Copy link
Copy Markdown
Contributor

Summary of changes

  • Remove source 'https://rails-assets.org' block and all 6 rails-assets-* gems from Gemfile/Gemfile.lock
  • Add package.json with npm equivalents; generate yarn.lock via yarn install
  • Configure Sprockets to find npm packages by adding specific node_modules/ subdirectories to config.assets.paths in config/initializers/assets.rb
  • Update two //= require names in application.js and one @import in application.scss to match actual npm dist filenames (eonasdan-bootstrap-datetimepickerbootstrap-datetimepicker, devbridge-autocompletejquery.autocomplete)
  • Add node_modules/ to .gitignore

Motivation and context

#1253

rails-assets.org is defunct — its gems cannot be installed in fresh environments, blocking deployment. This migrates those 6 frontend packages to yarn/npm while keeping the Sprockets asset pipeline intact.

The Sprockets integration works by registering specific dist subdirectories from node_modules/ as asset load paths:

# config/initializers/assets.rb
%w[
  clipboard/dist
  devbridge-autocomplete/dist
  eonasdan-bootstrap-datetimepicker/src/js
  eonasdan-bootstrap-datetimepicker/build/css
  markdown-it/dist
  moment
  select2/dist/js
  select2/dist/css
].each do |path|
  Rails.application.config.assets.paths << Rails.root.join("node_modules/#{path}")
end

Existing //= require and @import directives continue to work; only two names changed to align with how the npm packages name their dist files.

Screenshots

N/A

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree
    to license it to the TeSS codebase under the
    BSD license.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Change installation method for JS/CSS dependencies Replace rails-assets.org gems with yarn/npm packages Mar 11, 2026
Copilot AI and others added 2 commits March 11, 2026 18:08
@fbacall
fbacall force-pushed the copilot/change-js-css-dependency-installation branch from 5a0b43a to 9d40bde Compare March 11, 2026 18:19
@fbacall
fbacall marked this pull request as ready for review March 11, 2026 18:25
@fbacall
fbacall requested a review from Copilot March 11, 2026 18:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR migrates frontend dependencies away from the defunct rails-assets.org gem source to Yarn/NPM while keeping the Rails/Sprockets asset pipeline.

Changes:

  • Remove rails-assets-* gems and the rails-assets.org Gemfile source; add package.json + yarn.lock for the equivalent JS/CSS packages.
  • Configure Sprockets to load selected node_modules/ subdirectories and update JS/CSS manifests to match NPM distro filenames.
  • Update Docker/CI/docs to install Yarn dependencies and ignore node_modules/.

Reviewed changes

Copilot reviewed 10 out of 13 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
yarn.lock Adds Yarn v1 lockfile pinning JS dependency tree.
package.json Defines NPM dependencies replacing rails-assets gems.
docs/production.md Documents installing npm/yarn and running yarn install for production setup.
docs/install.md Documents npm/yarn as prerequisites and Yarn install steps.
config/initializers/assets.rb Adds node_modules subpaths to Sprockets asset load paths.
app/assets/stylesheets/application.scss Updates datetimepicker import to bootstrap-datetimepicker.
app/assets/javascripts/application.js Updates require names for datetimepicker and autocomplete packages.
Gemfile.lock Removes rails-assets source and rails-assets gem dependencies.
Gemfile Removes rails-assets.org source block and rails-assets gems.
Dockerfile Installs npm/yarn and runs yarn install during image build.
.gitignore Ignores node_modules/.
.github/workflows/test.yml Adds yarn install step before running Rails tests.
.github/workflows/deployment-checks.yml Adds yarn install step before assets:precompile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment thread .github/workflows/test.yml Outdated
Comment thread .github/workflows/deployment-checks.yml Outdated
Comment thread Dockerfile Outdated
Comment thread Dockerfile Outdated
@fbacall
fbacall merged commit 14b27a6 into master Mar 12, 2026
11 checks passed
@fbacall
fbacall deleted the copilot/change-js-css-dependency-installation branch March 12, 2026 16:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants