mirror of
https://github.com/Growstuff/growstuff.git
synced 2026-11-03 03:34:26 -05:00
- Implemented `planting_alternate_name.js` to load alternate names for crops in the planting form based on user input. - Added `tab_navigation.js` to manage tab navigation and update the URL hash accordingly. Update map rendering in member and place views - Modified `_map.html.haml` to include a custom marker icon for member maps. - Updated `index.html.haml` and `show.html.haml` to pass `places_map_data` to the map sections. Refactor asset management in Rails application - Removed Sprockets from the application configuration and adjusted asset paths. - Updated asset precompilation settings and removed deprecated asset configurations from environment files. - Added new build scripts for CSS and updated package dependencies in `package.json` for Bootstrap, Chart.js, and others. Ensure React and CSS bundles are built before running tests - Updated `react_bundle.rb` to check for the existence of both JavaScript and CSS bundles and build them if missing.
23 lines
874 B
Ruby
23 lines
874 B
Ruby
# frozen_string_literal: true
|
|
|
|
# The JavaScript and CSS bundles (app/assets/builds) are built by esbuild and
|
|
# Sass, not committed. Pages fail to render without them, so build them once if
|
|
# they are missing: a fresh checkout's specs then don't fail with 'The asset
|
|
# "application.css" was not found'. (After changing the JavaScript or CSS, run
|
|
# `yarn build` and `yarn build:css`, or keep `yarn build:watch` and
|
|
# `yarn build:css:watch` running.)
|
|
RSpec.configure do |config|
|
|
config.before(:suite) do
|
|
builds = Rails.root.join('app/assets/builds')
|
|
{
|
|
'react_islands.js' => 'build',
|
|
'application.js' => 'build',
|
|
'application.css' => 'build:css'
|
|
}.each do |bundle, script|
|
|
next if builds.join(bundle).exist?
|
|
|
|
system('yarn', script, chdir: Rails.root.to_s) || raise("yarn #{script} failed; run `yarn install` first")
|
|
end
|
|
end
|
|
end
|