cssbundling-rails 0.2.0 → 0.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b6117a89a0593ef2dee1518e29ab5792245610a4acd449b2f43dab754c421a56
4
- data.tar.gz: ae5a61e547d29d5fc9a44bf6a28ecbc24fde91194cdc1262417ec6d3b17810f0
3
+ metadata.gz: 2327f824df0a60b8114f3834b29a7d20b005bb2645d98083772ca1fa622b8d8c
4
+ data.tar.gz: 1bf817470b20cbe122c67a3b502ebdea182a7c526073b0059f05b6c262af5203
5
5
  SHA512:
6
- metadata.gz: cd33d2acdc38b13ee350cc703b97e9eae5bd4a4eef67edda05acde3f237b73b3a93c9012edb759b86aed22888832ad72bd17a111abf81fe97ca5f218c7e6f6e0
7
- data.tar.gz: 8649ee814fac443401fea17891629d3f1f4f1fc5fb135f27eb3a662550b4bbbb29906344fe01d08a4ffd0f3305802a79effdd4542f2b76b6155f349a8ef5b124
6
+ metadata.gz: c01ddba4ef303e6a03f59480709003950deeaad59238d7afd974009fa18914e872be4aa19ddd2ba7c976124bc06aad5f3fc6016e98672b4162feed7016e06826
7
+ data.tar.gz: cd093d2443110526f411698cbbabab0e222e3c81221f6a95139a04ef8bd0197d70de9a27aa8081ae3010e33888e1e5207c2bd693fa7a4bc1b70c432bd6af66b3
@@ -1,3 +1,3 @@
1
1
  module Cssbundling
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.4"
3
3
  end
@@ -11,4 +11,10 @@ else
11
11
  end
12
12
 
13
13
  say "Add build:css script"
14
- run %(npm set-script build:css "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules")
14
+ build_script = "sass ./app/assets/stylesheets/application.bootstrap.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
15
+
16
+ if (`npx -v`.to_f < 7.1 rescue "Missing")
17
+ say %(Add "scripts": { "build:css": "#{build_script}" to your package.json), :green
18
+ else
19
+ run %(npm set-script build:css "#{build_script}")
20
+ end
@@ -4,4 +4,10 @@ copy_file "#{__dir__}/application.bulma.scss",
4
4
  run "yarn add sass bulma"
5
5
 
6
6
  say "Add build:css script"
7
- run %(npm set-script build:css "sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules")
7
+ build_script = "sass ./app/assets/stylesheets/application.bulma.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
8
+
9
+ if (`npx -v`.to_f < 7.1 rescue "Missing")
10
+ say %(Add "scripts": { "build:css": "#{build_script}" to your package.json), :green
11
+ else
12
+ run %(npm set-script build:css "#{build_script}")
13
+ end
@@ -4,10 +4,10 @@ keep_file "app/assets/builds"
4
4
 
5
5
  if (sprockets_manifest_path = Rails.root.join("app/assets/config/manifest.js")).exist?
6
6
  append_to_file sprockets_manifest_path, %(//= link_tree ../builds\n)
7
- end
8
7
 
9
- say "Stop linking stylesheets automatically"
10
- gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css\n", ""
8
+ say "Stop linking stylesheets automatically"
9
+ gsub_file "app/assets/config/manifest.js", "//= link_directory ../stylesheets .css\n", ""
10
+ end
11
11
 
12
12
  if Rails.root.join(".gitignore").exist?
13
13
  append_to_file(".gitignore", %(\n/app/assets/builds/*\n!/app/assets/builds/.keep\n))
@@ -46,7 +46,7 @@ else
46
46
  say "Add default Procfile.dev"
47
47
  copy_file "#{__dir__}/Procfile.dev", "Procfile.dev"
48
48
 
49
- say "Ensure foreman is install"
49
+ say "Ensure foreman is installed"
50
50
  run "gem install foreman"
51
51
  end
52
52
 
@@ -1,7 +1,13 @@
1
- say "Install PostCSS w/ postcss-preset-env"
1
+ say "Install PostCSS w/ nesting and autoprefixer"
2
2
  copy_file "#{__dir__}/postcss.config.js", "postcss.config.js"
3
3
  copy_file "#{__dir__}/application.postcss.css", "app/assets/stylesheets/application.postcss.css"
4
- run "yarn add postcss postcss-cli postcss-preset-env"
4
+ run "yarn add postcss postcss-cli postcss-nesting autoprefixer"
5
5
 
6
6
  say "Add build:css script"
7
- run %(npm set-script build:css "postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css")
7
+ build_script = "postcss ./app/assets/stylesheets/application.postcss.css -o ./app/assets/builds/application.css"
8
+
9
+ if (`npx -v`.to_f < 7.1 rescue "Missing")
10
+ say %(Add "scripts": { "build:css": "#{build_script}" to your package.json), :green
11
+ else
12
+ run %(npm set-script build:css "#{build_script}")
13
+ end
@@ -1,10 +1,6 @@
1
1
  module.exports = {
2
2
  plugins: [
3
- require('postcss-preset-env')({
4
- stage: 2,
5
- features: {
6
- 'nesting-rules': true
7
- }
8
- })
3
+ require('postcss-nesting'),
4
+ require('autoprefixer'),
9
5
  ],
10
6
  }
@@ -3,4 +3,10 @@ copy_file "#{__dir__}/application.sass.scss", "app/assets/stylesheets/applicatio
3
3
  run "yarn add sass"
4
4
 
5
5
  say "Add build:css script"
6
- run %(npm set-script build:css "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules")
6
+ build_script = "sass ./app/assets/stylesheets/application.sass.scss ./app/assets/builds/application.css --no-source-map --load-path=node_modules"
7
+
8
+ if (`npx -v`.to_f < 7.1 rescue "Missing")
9
+ say %(Add "scripts": { "build:css": "#{build_script}" to your package.json), :green
10
+ else
11
+ run %(npm set-script build:css "#{build_script}")
12
+ end
@@ -4,4 +4,10 @@ copy_file "#{__dir__}/application.tailwind.css", "app/assets/stylesheets/applica
4
4
  run "yarn add tailwindcss@latest postcss@latest autoprefixer@latest"
5
5
 
6
6
  say "Add build:css script"
7
- run %(npm set-script build:css "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css")
7
+ build_script = "tailwindcss -i ./app/assets/stylesheets/application.tailwind.css -o ./app/assets/builds/application.css"
8
+
9
+ if (`npx -v`.to_f < 7.1 rescue "Missing")
10
+ say %(Add "scripts": { "build:css": "#{build_script}" to your package.json), :green
11
+ else
12
+ run %(npm set-script build:css "#{build_script}")
13
+ end
@@ -1,7 +1,9 @@
1
1
  namespace :css do
2
2
  desc "Build your CSS bundle"
3
3
  task :build do
4
- system "yarn install && yarn build:css"
4
+ unless system "yarn install && yarn build:css"
5
+ raise "cssbundling-rails: Command css:build failed, ensure yarn is installed and `yarn build:css` runs without errors"
6
+ end
5
7
  end
6
8
  end
7
9
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cssbundling-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Heinemeier Hansson
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2021-09-19 00:00:00.000000000 Z
12
+ date: 2021-09-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: railties
@@ -25,20 +25,6 @@ dependencies:
25
25
  - - ">="
26
26
  - !ruby/object:Gem::Version
27
27
  version: 6.0.0
28
- - !ruby/object:Gem::Dependency
29
- name: sprockets-rails
30
- requirement: !ruby/object:Gem::Requirement
31
- requirements:
32
- - - ">="
33
- - !ruby/object:Gem::Version
34
- version: 2.0.0
35
- type: :runtime
36
- prerelease: false
37
- version_requirements: !ruby/object:Gem::Requirement
38
- requirements:
39
- - - ">="
40
- - !ruby/object:Gem::Version
41
- version: 2.0.0
42
28
  description:
43
29
  email: david@loudthinking.com
44
30
  executables: []