From 937584ef935fab3f8e35d410580bbbc5a5aedafd Mon Sep 17 00:00:00 2001 From: Andres Garcia Date: Wed, 14 Aug 2024 21:16:10 +0200 Subject: [PATCH 1/3] Remove sass-rails gem and use cssbundling and dartsass instead --- Gemfile | 4 +- Gemfile.lock | 27 ++--- Procfile.dev | 1 + app/assets/config/manifest.js | 1 - app/assets/stylesheets/application.css | 13 --- app/assets/stylesheets/application.scss | 1 + bin/dev | 7 +- package.json | 14 +-- yarn.lock | 129 +++++++++++++++++++++++- 9 files changed, 150 insertions(+), 47 deletions(-) delete mode 100644 app/assets/stylesheets/application.css create mode 100644 app/assets/stylesheets/application.scss diff --git a/Gemfile b/Gemfile index 8ee6cc9a..becbc6a9 100644 --- a/Gemfile +++ b/Gemfile @@ -11,6 +11,7 @@ gem 'activeadmin', '~> 3.2' gem 'active_storage_base64', '~> 3.0.0' gem 'aws-sdk-s3', '~> 1.157', require: false gem 'bootsnap', '~> 1.18' +gem 'cssbundling-rails', '~> 1.4', '>= 1.4.1' gem 'delayed_job_active_record', '~> 4.1' gem 'devise', '~> 4.9' gem 'devise_token_auth', '~> 1.2', '>= 1.2.3' @@ -30,9 +31,8 @@ gem 'pundit', '~> 2.3' gem 'rack-cors', '~> 2.0' gem 'rswag-api', '~> 2.13.0' gem 'rswag-ui', '~> 2.13.0' -gem 'sass-rails', '~> 6.0.0' gem 'sendgrid', '~> 1.2.4' -gem 'sprockets', '~> 4.2.1' +gem 'sprockets-rails', '~> 3.5', '>= 3.5.2' gem 'strong_migrations', '~> 2.0' gem 'yaaf', '~> 3.0' # Use Redis adapter to run Action Cable in production diff --git a/Gemfile.lock b/Gemfile.lock index c44b8a17..3573f246 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -159,6 +159,8 @@ GEM bigdecimal rexml crass (1.0.6) + cssbundling-rails (1.4.1) + railties (>= 6.0.0) csv (3.3.0) date (3.3.4) debug_inspector (1.2.0) @@ -352,8 +354,6 @@ GEM racc (~> 1.4) nokogiri (1.16.7-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.7-x86_64-linux) - racc (~> 1.4) octokit (9.1.0) faraday (>= 1, < 3) sawyer (~> 0.9) @@ -535,16 +535,6 @@ GEM sanitize (6.1.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) - sass-rails (6.0.0) - sassc-rails (~> 2.1, >= 2.1.1) - sassc (2.4.0) - ffi (~> 1.9) - sassc-rails (2.1.2) - railties (>= 4.0.0) - sassc (>= 2.0) - sprockets (> 3.0) - sprockets-rails - tilt sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) @@ -568,9 +558,9 @@ GEM sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.2) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) stringio (3.1.1) strong_migrations (2.0.0) @@ -579,7 +569,6 @@ GEM terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) thor (1.3.1) - tilt (2.3.0) timeout (0.4.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) @@ -605,8 +594,8 @@ GEM PLATFORMS arm64-darwin-22 + arm64-darwin-23 ruby - x86_64-linux DEPENDENCIES active_storage_base64 (~> 3.0.0) @@ -618,6 +607,7 @@ DEPENDENCIES bootsnap (~> 1.18) brakeman (~> 6.1) capybara (~> 3.40) + cssbundling-rails (~> 1.4, >= 1.4.1) delayed_job_active_record (~> 4.1) devise (~> 4.9) devise_token_auth (~> 1.2, >= 1.2.3) @@ -665,12 +655,11 @@ DEPENDENCIES rubocop-rake (~> 0.6.0) rubocop-rspec (~> 3.0) rubocop-rspec_rails (~> 2.30.0) - sass-rails (~> 6.0.0) selenium-webdriver (~> 4.23.0) sendgrid (~> 1.2.4) shoulda-matchers (~> 6.3) simplecov (~> 0.22.0) - sprockets (~> 4.2.1) + sprockets-rails (~> 3.5, >= 3.5.2) strong_migrations (~> 2.0) tzinfo-data webmock (~> 3.23) diff --git a/Procfile.dev b/Procfile.dev index d1226527..c1842a7c 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1,3 @@ web: ./bin/rails server -p 3000 -b 0.0.0.0 js: yarn build --watch +css: yarn build:css --watch diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js index 338a0e82..9a99757a 100644 --- a/app/assets/config/manifest.js +++ b/app/assets/config/manifest.js @@ -1,3 +1,2 @@ //= link_tree ../images -//= link_directory ../stylesheets .css //= link_tree ../builds diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css deleted file mode 100644 index 5740a0bd..00000000 --- a/app/assets/stylesheets/application.css +++ /dev/null @@ -1,13 +0,0 @@ -/* - * This is a manifest file that'll be compiled into application.css, which will include all the files - * listed below. - * - * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, - * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. - * - * You're free to add application-wide styles to this file and they'll appear at the top of the - * compiled file, but it's generally better to create a new file per style scope. - * - *= require_self - *= require_tree ./application - */ diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss new file mode 100644 index 00000000..88d24c96 --- /dev/null +++ b/app/assets/stylesheets/application.scss @@ -0,0 +1 @@ +// Entry point for your Sass build diff --git a/bin/dev b/bin/dev index 74ade166..d80a02db 100755 --- a/bin/dev +++ b/bin/dev @@ -1,8 +1,11 @@ #!/usr/bin/env sh -if ! gem list foreman -i --silent; then +if gem list --no-installed --exact --silent foreman; then echo "Installing foreman..." gem install foreman fi -exec foreman start -f Procfile.dev "$@" +# Default to port 3000 if not specified +export PORT="${PORT:-3000}" + +exec foreman start -f Procfile.dev --env /dev/null "$@" diff --git a/package.json b/package.json index a99b7e47..edeeadbc 100644 --- a/package.json +++ b/package.json @@ -1,9 +1,9 @@ { "name": "rails_api_base", "private": "true", - "engines" : { - "node" : "20.10.0", - "yarn" : "1.22" + "engines": { + "node": "20.10.0", + "yarn": "1.22" }, "dependencies": { "@activeadmin/activeadmin": "3.2.3", @@ -11,10 +11,12 @@ "arctic_admin": "4.3.1", "esbuild": "0.23.0", "jquery": "3.7.1", - "jquery-ui": "1.14.0", - "jquery-ujs": "1.2.3" + "jquery-ui": "1.13.3", + "jquery-ujs": "1.2.3", + "sass": "^1.77.8" }, "scripts": { - "build": "node esbuild.config.mjs" + "build": "node esbuild.config.mjs", + "build:css": "sass ./app/assets/stylesheets:./app/assets/builds --no-source-map --load-path=node_modules" } } diff --git a/yarn.lock b/yarn.lock index fdcb9dcf..fbd77616 100644 --- a/yarn.lock +++ b/yarn.lock @@ -136,11 +136,46 @@ resolved "https://registry.yarnpkg.com/@fortawesome/fontawesome-free/-/fontawesome-free-6.6.0.tgz#0e984f0f2344ee513c185d87d77defac4c0c8224" integrity sha512-60G28ke/sXdtS9KZCpZSHHkCbdsOGEhIUGlwq6yhY74UpTiToIh8np7A8yphhM4BWsvNFtIvLpi4co+h9Mr9Ow== +anymatch@~3.1.2: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + arctic_admin@4.3.1: version "4.3.1" resolved "https://registry.yarnpkg.com/arctic_admin/-/arctic_admin-4.3.1.tgz#276fb2fcfb4eca219e350e427e36d330a597833e" integrity sha512-2z5HHVobZZCWgJiWelG/RG4pnbo+iXTAOCEcAC6TBSI4LI7u8h1ugBkYgg9IF15jFh7Z8j2c1Qw7gxrCH0wgkQ== +binary-extensions@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.3.0.tgz#f6e14a97858d327252200242d4ccfe522c445522" + integrity sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw== + +braces@~3.0.2: + version "3.0.3" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789" + integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA== + dependencies: + fill-range "^7.1.1" + +"chokidar@>=3.0.0 <4.0.0": + version "3.6.0" + resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.6.0.tgz#197c6cc669ef2a8dc5e7b4d97ee4e092c3eb0d5b" + integrity sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw== + dependencies: + anymatch "~3.1.2" + braces "~3.0.2" + glob-parent "~5.1.2" + is-binary-path "~2.1.0" + is-glob "~4.0.1" + normalize-path "~3.0.0" + readdirp "~3.6.0" + optionalDependencies: + fsevents "~2.3.2" + esbuild@0.23.0: version "0.23.0" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.23.0.tgz#de06002d48424d9fdb7eb52dbe8e95927f852599" @@ -171,10 +206,58 @@ esbuild@0.23.0: "@esbuild/win32-ia32" "0.23.0" "@esbuild/win32-x64" "0.23.0" -jquery-ui@1.14.0, jquery-ui@^1.13.3: - version "1.14.0" - resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.0.tgz#b75d417826f0bab38125f907356d2e3313a9c6d5" - integrity sha512-mPfYKBoRCf0MzaT2cyW5i3IuZ7PfTITaasO5OFLAQxrHuI+ZxruPa+4/K1OMNT8oElLWGtIxc9aRbyw20BKr8g== +fill-range@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292" + integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg== + dependencies: + to-regex-range "^5.0.1" + +fsevents@~2.3.2: + version "2.3.3" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6" + integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw== + +glob-parent@~5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +immutable@^4.0.0: + version "4.3.7" + resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.7.tgz#c70145fc90d89fb02021e65c84eb0226e4e5a381" + integrity sha512-1hqclzwYwjRDFLjcFxOM5AYkkG0rpFPpr1RLPMEuGczoS7YA8gLhy8SWXYRAA/XwfEHpfo3cw5JGioS32fnMRw== + +is-binary-path@~2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09" + integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw== + dependencies: + binary-extensions "^2.0.0" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-glob@^4.0.1, is-glob@~4.0.1: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +jquery-ui@1.13.3, jquery-ui@^1.13.3: + version "1.13.3" + resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.3.tgz#d9f5292b2857fa1f2fdbbe8f2e66081664eb9bc5" + integrity sha512-D2YJfswSJRh/B8M/zCowDpNFfwsDmtfnMPwjJTyvl+CBqzpYwQ+gFYIbUUlzijy/Qvoy30H1YhoSui4MNYpRwA== dependencies: jquery ">=1.12.0 <5.0.0" @@ -187,3 +270,41 @@ jquery@3.7.1, "jquery@>=1.12.0 <5.0.0", jquery@^3.4.1: version "3.7.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== + +normalize-path@^3.0.0, normalize-path@~3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +picomatch@^2.0.4, picomatch@^2.2.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +readdirp@~3.6.0: + version "3.6.0" + resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.6.0.tgz#74a370bd857116e245b29cc97340cd431a02a6c7" + integrity sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA== + dependencies: + picomatch "^2.2.1" + +sass@^1.77.8: + version "1.77.8" + resolved "https://registry.yarnpkg.com/sass/-/sass-1.77.8.tgz#9f18b449ea401759ef7ec1752a16373e296b52bd" + integrity sha512-4UHg6prsrycW20fqLGPShtEvo/WyHRVRHwOP4DzkUrObWoWI05QBSfzU71TVB7PFaL104TwNaHpjlWXAZbQiNQ== + dependencies: + chokidar ">=3.0.0 <4.0.0" + immutable "^4.0.0" + source-map-js ">=0.6.2 <2.0.0" + +"source-map-js@>=0.6.2 <2.0.0": + version "1.2.0" + resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.2.0.tgz#16b809c162517b5b8c3e7dcd315a2a5c2612b2af" + integrity sha512-itJW8lvSA0TXEphiRoawsCksnlf8SyvmFzIhltqAHluXd88pkCd+cXJVHTDwdCr0IzwptSm035IHQktUu1QUMg== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" From 25a3a1d2a7dfae9771837776884397436339ceb8 Mon Sep 17 00:00:00 2001 From: Andres Garcia Date: Wed, 14 Aug 2024 22:50:33 +0200 Subject: [PATCH 2/3] Keep jquery-ui latest version --- package.json | 2 +- yarn.lock | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index edeeadbc..b3530ab3 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ "arctic_admin": "4.3.1", "esbuild": "0.23.0", "jquery": "3.7.1", - "jquery-ui": "1.13.3", + "jquery-ui": "1.14.0", "jquery-ujs": "1.2.3", "sass": "^1.77.8" }, diff --git a/yarn.lock b/yarn.lock index fbd77616..8a518659 100644 --- a/yarn.lock +++ b/yarn.lock @@ -254,19 +254,26 @@ is-number@^7.0.0: resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== -jquery-ui@1.13.3, jquery-ui@^1.13.3: +jquery-ui@1.14.0: + version "1.14.0" + resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.14.0.tgz#b75d417826f0bab38125f907356d2e3313a9c6d5" + integrity sha512-mPfYKBoRCf0MzaT2cyW5i3IuZ7PfTITaasO5OFLAQxrHuI+ZxruPa+4/K1OMNT8oElLWGtIxc9aRbyw20BKr8g== + dependencies: + jquery ">=1.12.0 <5.0.0" + +jquery-ui@^1.13.3: version "1.13.3" resolved "https://registry.yarnpkg.com/jquery-ui/-/jquery-ui-1.13.3.tgz#d9f5292b2857fa1f2fdbbe8f2e66081664eb9bc5" integrity sha512-D2YJfswSJRh/B8M/zCowDpNFfwsDmtfnMPwjJTyvl+CBqzpYwQ+gFYIbUUlzijy/Qvoy30H1YhoSui4MNYpRwA== dependencies: - jquery ">=1.12.0 <5.0.0" + jquery ">=1.8.0 <4.0.0" jquery-ujs@1.2.3, jquery-ujs@^1.2.2: version "1.2.3" resolved "https://registry.yarnpkg.com/jquery-ujs/-/jquery-ujs-1.2.3.tgz#dcac6026ab7268e5ee41faf9d31c997cd4ddd603" integrity sha512-59wvfx5vcCTHMeQT1/OwFiAj+UffLIwjRIoXdpO7Z7BCFGepzq9T9oLVeoItjTqjoXfUrHJvV7QU6pUR+UzOoA== -jquery@3.7.1, "jquery@>=1.12.0 <5.0.0", jquery@^3.4.1: +jquery@3.7.1, "jquery@>=1.12.0 <5.0.0", "jquery@>=1.8.0 <4.0.0", jquery@^3.4.1: version "3.7.1" resolved "https://registry.yarnpkg.com/jquery/-/jquery-3.7.1.tgz#083ef98927c9a6a74d05a6af02806566d16274de" integrity sha512-m4avr8yL8kmFN8psrbFFFmB/If14iN5o9nw/NgnnM+kybDJpRsAynV2BsfpTYrTRysYUdADVD7CkUUizgkpLfg== From 97cae0ecc728a7924223262f35c8c0fc4f981ddc Mon Sep 17 00:00:00 2001 From: Andres Garcia Date: Thu, 15 Aug 2024 17:14:20 +0200 Subject: [PATCH 3/3] Fixes --- Gemfile.lock | 1 + Procfile.dev | 2 +- app/assets/stylesheets/application.scss | 1 - app/views/layouts/application.html.erb | 2 -- bin/fullstack.rb | 6 +++++- package.json | 3 ++- 6 files changed, 9 insertions(+), 6 deletions(-) delete mode 100644 app/assets/stylesheets/application.scss diff --git a/Gemfile.lock b/Gemfile.lock index 3573f246..a970e8e9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -596,6 +596,7 @@ PLATFORMS arm64-darwin-22 arm64-darwin-23 ruby + x86_64-linux DEPENDENCIES active_storage_base64 (~> 3.0.0) diff --git a/Procfile.dev b/Procfile.dev index c1842a7c..8a9e145d 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,3 +1,3 @@ web: ./bin/rails server -p 3000 -b 0.0.0.0 -js: yarn build --watch +js: yarn build:js --watch css: yarn build:css --watch diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss deleted file mode 100644 index 88d24c96..00000000 --- a/app/assets/stylesheets/application.scss +++ /dev/null @@ -1 +0,0 @@ -// Entry point for your Sass build diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index fb3bf6d5..1245d545 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -5,8 +5,6 @@ <%= csrf_meta_tags %> <%= csp_meta_tag %> - - <%= stylesheet_link_tag "application" %> diff --git a/bin/fullstack.rb b/bin/fullstack.rb index f7969841..7e178524 100755 --- a/bin/fullstack.rb +++ b/bin/fullstack.rb @@ -1,6 +1,5 @@ # Add gems insert_into_file 'Gemfile', after: "# Gems\n" do <<-EOF -gem 'cssbundling-rails', '~> 1.3' gem 'stimulus-rails', '~> 1.3' gem 'turbo-rails', '2.0.0.pre.beta.2' gem 'view_component', '~> 3.7' @@ -22,6 +21,11 @@ # Run CSS generator rails_command 'css:install:tailwind' +# Add Sass build for Active Admin styles +insert_into_file 'package.json', after: "application.css --minify" do + ' && sass ./app/assets/stylesheets/active_admin.scss:./app/assets/builds/active_admin.css --no-source-map --load-path=node_modules' +end + # Update application layout gsub_file 'app/views/layouts/application.html.erb', " <%= stylesheet_link_tag \"application\" %>\n", '' insert_into_file 'app/views/layouts/application.html.erb', before: /^ <\/head>$/ do <<-EOF diff --git a/package.json b/package.json index b3530ab3..de477fe7 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,8 @@ "sass": "^1.77.8" }, "scripts": { - "build": "node esbuild.config.mjs", + "build": "yarn build:js && yarn build:css", + "build:js": "node esbuild.config.mjs", "build:css": "sass ./app/assets/stylesheets:./app/assets/builds --no-source-map --load-path=node_modules" } }