From c727896b10f94beab394174d566e5a1f43f6172f Mon Sep 17 00:00:00 2001 From: Andy Callaghan Date: Wed, 16 Mar 2022 11:38:42 +0000 Subject: [PATCH 1/6] Change sass cli params to permit multiple inputs The sass cli allows for multiple sources & outputs - using the source:destination syntax makes this more obvious if a user wanted to bundle multiple sources at once --- lib/install/bootstrap/install.rb | 2 +- lib/install/bulma/install.rb | 2 +- lib/install/sass/install.rb | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/install/bootstrap/install.rb b/lib/install/bootstrap/install.rb index ab16124..cfab96a 100644 --- a/lib/install/bootstrap/install.rb +++ b/lib/install/bootstrap/install.rb @@ -17,7 +17,7 @@ end say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.bootstrap.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red diff --git a/lib/install/bulma/install.rb b/lib/install/bulma/install.rb index ff4980d..d70fa1b 100644 --- a/lib/install/bulma/install.rb +++ b/lib/install/bulma/install.rb @@ -4,7 +4,7 @@ run "yarn add sass bulma" say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.bulma.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red diff --git a/lib/install/sass/install.rb b/lib/install/sass/install.rb index 5d8f295..dbef54d 100644 --- a/lib/install/sass/install.rb +++ b/lib/install/sass/install.rb @@ -3,7 +3,7 @@ run "yarn add sass" say "Add build:css script" -build_script = "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules" +build_script = "sass ./app/assets/stylesheets/application.sass.scss:./app/assets/builds/application.css --no-source-map --load-path=node_modules" if (`npx -v`.to_f < 7.1 rescue "Missing") say %(Add "scripts": { "build:css": "#{build_script}" } to your package.json), :red From b451c6003abf6fcd12a4fb28056e5710b3befc1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Glauco=20Cust=C3=B3dio?= Date: Wed, 30 Mar 2022 11:43:40 +0100 Subject: [PATCH 2/6] Use bundle add instead (#85) As per https://github.com/rubygems/rubygems/pull/5337, we can simplify the steps of adding a gem. --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 848d3ce..e4c7e6a 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,8 @@ You can configure your bundler options in the `build:css` script in `package.jso You must already have node and yarn installed on your system. You will also need npx version 7.1.0 or later. Then: -1. Add `cssbundling-rails` to your Gemfile with `gem 'cssbundling-rails'` -2. Run `./bin/bundle install` -3. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]` +1. Run `./bin/bundle add cssbundling-rails` +2. Run `./bin/rails css:install:[tailwind|bootstrap|bulma|postcss|sass]` Or, in Rails 7+, you can preconfigure your new application to use a specific bundler with `rails new myapp --css [tailwind|bootstrap|bulma|postcss|sass]`. From f4977d5514f097c3bc9884685e42e926a032e3a5 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sat, 30 Apr 2022 12:34:17 +0200 Subject: [PATCH 3/6] Why do I get `application.css not in asset pipeline` in production? --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index e4c7e6a..ff12ef5 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,10 @@ If you want to use `@import` statements as part of your Tailwind application.js Some CSS packages use new CSS features that are not supported by the default SassC rails integration that previous versions of Rails used. If you hit such an incompatibility, it'll likely be in the form of a `SassC::SyntaxError` when running `assets:precompile`. The fix is to `bundle remove sass-rails` (or `sassc-rails`, if you were using that). +### Why do I get `application.css not in asset pipeline` in production? + +A common issue is that your repository does not contain the output directory used by the build commands. You must have `app/assets/builds` available. Add the directory with a `.gitkeep` file, and you'll ensure it's available in production. + ## License CSS Bundling for Rails is released under the [MIT License](https://opensource.org/licenses/MIT). From f264e3ff23e9850228bfddf245d76167ebfd25c7 Mon Sep 17 00:00:00 2001 From: Jon Frisby Date: Sun, 1 May 2022 23:06:18 -0700 Subject: [PATCH 4/6] Fix for foreman existence test in rbenv installs. (#91) --- lib/install/dev | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/install/dev b/lib/install/dev index a1104a5..c1cb98b 100755 --- a/lib/install/dev +++ b/lib/install/dev @@ -1,6 +1,6 @@ #!/usr/bin/env bash -if ! command -v foreman &> /dev/null +if ! foreman version &> /dev/null then echo "Installing foreman..." gem install foreman From 835f3058c034f58700b11d34392e59f994f7e37d Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 19 Jun 2022 12:06:27 +0200 Subject: [PATCH 5/6] Bump nokogiri --- Gemfile.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 466ed6b..bb1a5e2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -96,11 +96,11 @@ GEM mini_mime (1.0.3) minitest (5.14.4) nio4r (2.5.7) - nokogiri (1.11.7-arm64-darwin) + nokogiri (1.13.6-arm64-darwin) racc (~> 1.4) - nokogiri (1.11.7-x86_64-darwin) + nokogiri (1.13.6-x86_64-darwin) racc (~> 1.4) - nokogiri (1.11.7-x86_64-linux) + nokogiri (1.13.6-x86_64-linux) racc (~> 1.4) public_suffix (4.0.6) racc (1.5.2) From 6b91d5069064458df7d0d9a54eeeb16f78e57500 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 19 Jun 2022 12:06:40 +0200 Subject: [PATCH 6/6] Bump version for 1.1.1 --- Gemfile.lock | 2 +- lib/cssbundling/version.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index bb1a5e2..170cafb 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,7 +1,7 @@ PATH remote: . specs: - cssbundling-rails (1.1.0) + cssbundling-rails (1.1.1) railties (>= 6.0.0) GEM diff --git a/lib/cssbundling/version.rb b/lib/cssbundling/version.rb index efdd2ff..15fda7f 100644 --- a/lib/cssbundling/version.rb +++ b/lib/cssbundling/version.rb @@ -1,3 +1,3 @@ module Cssbundling - VERSION = "1.1.0" + VERSION = "1.1.1" end