• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

uclibs / application_portfolio / 28031038343

23 Jun 2026 01:48PM UTC coverage: 73.909% (+0.4%) from 73.552%
28031038343

push

circleci

web-flow
WIP Libappo1 115 add jsbundling rails and (#439)

* Add jsbundling-rails and esbuild scaffold (LIBAPPO1-101).

Introduce app/javascript entry point and yarn build output to
app/assets/builds/application.js; Sprockets still serves legacy JS until #12.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Harden esbuild scaffold after code review (LIBAPPO1-101).

Start Rails UJS in the entry point, use javascript:build in specs so CI
installs deps, strip stale build artifacts before the suite, and add yarn
install to GitHub Actions.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix rspec noise and JavaScript build spec under mixed Node versions.

Run yarn build without javascript:install in specs, silence Dart Sass
deprecation output during dartsass:build, and document nvm use before tests.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Make javascript:build reliable and harden scaffold for deploy/CI.

Prepend nvm Node from .nvmrc before yarn tasks, test via javascript:build
rake task, skip auto-build on production/test until #12, and drop node_modules
from the Sprockets path while the legacy bundle is still served.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Polish jsbundling scaffold after branch review.

Route Procfile.dev and bin/setup through bin/yarn with shared nvm PATH
prep, document Sass deprecation silencing as follow-up debt, and clarify
README/bin/dev and SKIP_JS_BUILD comments.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Tighten jsbundling scaffold after another branch review.

DRY esbuild artifact cleanup, guard rake task enhancement, fail bin/setup
when yarn install fails, and align README with bin/yarn conventions.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Fix deploy precompile by setting SKIP_JS_BUILD before rake loads.

jsbundling-rails checks SKIP_JS_BUILD when tasks load, before initializers
run. Move the flag to config/application.rb so Capistrano assets:precompile
skips javascript:build on Node 16... (continued)

22 of 24 new or added lines in 2 files covered. (91.67%)

898 of 1215 relevant lines covered (73.91%)

17.85 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

88.89
/lib/javascript_build_env.rb
1
# frozen_string_literal: true
2

3
require 'pathname'
2✔
4

5
# jsbundling-rails and bin/yarn shell out to yarn; prepend the Node version from
6
# .nvmrc when nvm is installed so builds work even if an older node or yarn
7
# binary appears earlier on PATH.
8
module JavascriptBuildEnv
2✔
9
  module_function
2✔
10

11
  def apply!(root = default_root)
2✔
12
    node_bin = nvm_node_bin(root)
6✔
13
    return unless node_bin
6✔
14

NEW
15
    ENV['PATH'] = "#{node_bin}:#{ENV['PATH']}"
×
16
  end
17

18
  def nvm_node_bin(root = default_root)
2✔
19
    nvmrc = root.join('.nvmrc')
6✔
20
    return unless nvmrc.exist?
6✔
21

22
    version = nvmrc.read.strip.delete_prefix('v')
6✔
23
    nvm_dir = ENV.fetch('NVM_DIR') { File.expand_path('~/.nvm') }
6✔
24
    node_bin = File.join(nvm_dir, 'versions', 'node', "v#{version}", 'bin')
6✔
25

26
    node_bin if File.directory?(node_bin)
6✔
27
  end
28

29
  def default_root
2✔
30
    if defined?(Rails) && Rails.application&.initialized?
6✔
31
      Rails.root
6✔
32
    else
NEW
33
      Pathname.new(File.expand_path('..', __dir__))
×
34
    end
35
  end
36
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc