deadfire 0.5.0 → 0.6.0

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: b92ff55d4eb765b9042dad38b321944bacf5334db4d2cfe17aabc8fa6c6fcbf3
4
- data.tar.gz: 956b776ba58413cc70e70fe8b98a8392ea7091994127070852323c84ca7b2dcf
3
+ metadata.gz: bf5ff2b972555ed94df49077860d3a5097400ada7b48aa753cfea0297eef953d
4
+ data.tar.gz: ae2b3e72441a00b32658cb8998b92f71ae33f5197cefa973cff7d4a688bb2b12
5
5
  SHA512:
6
- metadata.gz: 6172c9434d1aeaafe2ff0a45e257ddc022214f5f81895cf3d763327d26e087e5ce50cd0b585a1a3c47cb193f8048c4a14c59ef4d4ca508988a62b6e229ba7409
7
- data.tar.gz: eb267997efa8f7a953d9bb7fc385147aefff84684db57f7caa45c21f34cf89776af42c0ba9694e6887b30f894dc50bdb75ab8c98a61ff4343c772f170cfb995c
6
+ metadata.gz: 998ae91967f0cea560a426d521bd1882e764e4168aab5c12af464a8b9d40d3d7849320c88a636f4755df98c009c55a7cabc7e79c04f615b1a8fe37ec71a5e45b
7
+ data.tar.gz: 53e6a195fa84207d70e0cf4d23d258cae2c82c52d5e614f48c925b75b398d3d9630a0e90e19290efe0dcc7952ec56495ff35efec5d2ea7d51f2cd2dcabb9baef
data/README.md CHANGED
@@ -81,7 +81,7 @@ Re-use the styles using @apply:
81
81
 
82
82
  ### Fault tolerant
83
83
 
84
- When Deadfire encounters an error, such as a missing mixin or other issues, it does not immediately raise an error that would halt the execution. Instead, it continues processing the CSS code and collects the encountered errors. These errors are then reported through the ErrorReporter class, allowing you to handle or display them as needed.
84
+ When Deadfire encounters an error, such as a missing mixin or other issues, it does not raise an error that would halt the execution. Instead, it continues processing the CSS code and collects the encountered errors. These errors are then reported through the ErrorReporter class, allowing you to handle or display them as needed.
85
85
 
86
86
  By adopting this fault-tolerant approach, Deadfire aims to provide more flexibility and resilience when dealing with CSS code that may contain errors or inconsistencies. It allows you to gather information about the encountered issues and take appropriate actions based on the reported errors.
87
87
 
@@ -101,15 +101,35 @@ Or install it yourself as:
101
101
 
102
102
  `> gem install deadfire`
103
103
 
104
- ## Deadfire + Ruby on Rails
104
+ ## Ruby on Rails
105
105
 
106
- Propshaft is the new asset pipeline for Rails, to use Deadfire as a preprocessor add the deadfire gem to your Gemfile.
106
+ Deadfire aims to work alongside the new asset pipeline, Propshaft.
107
+
108
+ With the gem included in your app's Gemfile, by default all your css files will be pre-processed.
109
+
110
+ For more control over the files you want to pre-process;
111
+
112
+ `Deadfire.configuration.root_path` - change the root path where files are processed e.g. tailwind is bundled into `app/assets/builds/tailwind.css`
113
+ which means the root_path will need updating, whereas the default deadfire root_path is `app/assetss/stylesheets`.
114
+
115
+ ```ruby
116
+ # config/initializers/assets.rb
117
+ Deadfire.configuration.root_path = Rails.root.join("app/assets").to_s
118
+ ```
119
+
120
+ `Deadfire.configuration.preprocess` - configure exactly which files you want to pre-process, which caches all the utility classes declared
121
+ so they are available using `@apply` in your stylesheets.
107
122
 
108
123
  ```ruby
109
- gem "deadfire"
124
+ # config/initializers/assets.rb
125
+ Deadfire.configuration.preprocess("builds/tailwind.css")
110
126
  ```
111
127
 
112
- That's all, your css file should now be run through Deadfire.
128
+ To preprocess a file for a specific path like admin e.g. /admin/users, use the path keyword;
129
+
130
+ ```ruby
131
+ Deadfire.configuration.preprocess("builds/tailwind.css", path: "admin")
132
+ ```
113
133
 
114
134
  ## Development
115
135
 
data/changelog.md CHANGED
@@ -1,5 +1,8 @@
1
1
  ## Changelog
2
- ### 0.6.0 (current)
2
+ ### 0.7.0 (current)
3
+
4
+ ### 0.6.0 (15 Jan 2025)
5
+ - Drop config.deadfire.* instead the Deadfire.configuration is preferred for configuring deadfire.
3
6
 
4
7
  ### 0.5.0 (12 Dec 2024)
5
8
  - Drop ruby 2.7
@@ -4,35 +4,32 @@ require "propshaft"
4
4
 
5
5
  module Deadfire
6
6
  class Railties < ::Rails::Railtie
7
- config.deadfire = ActiveSupport::OrderedOptions.new
8
- config.deadfire.root_path = nil
9
- config.deadfire.excluded_files = []
10
-
11
7
  initializer :deadfire do |app|
12
8
  Deadfire.configure do |deadfire_config|
13
- deadfire_config.root_path = config.deadfire.root_path || app.root.join("app", "assets", "stylesheets")
14
- deadfire_config.excluded_files = config.deadfire.excluded_files
9
+ deadfire_config.root_path = Rails.root.join("app/assets/stylesheets").to_s unless deadfire_config.root_path.present?
10
+
11
+ deadfire_config.excluded_files = []
15
12
  deadfire_config.compressed = config.assets.compressed
16
13
  deadfire_config.logger = config.assets.logger || Rails.logger
17
14
  end
18
- end
19
15
 
20
- class DeadfireCompiler < ::Propshaft::Compiler
21
- def compile(logical_path, input)
22
- path = logical_path.path.to_s
16
+ class DeadfireCompiler < ::Propshaft::Compiler
17
+ def compile(logical_path, input)
18
+ path = logical_path.path.to_s
23
19
 
24
- return input if Deadfire.config.excluded_files.include?(path)
20
+ return input if Deadfire.config.excluded_files.include?(path)
25
21
 
26
- # by default, all files in the will be preprocessed
27
- if Deadfire.config.asset_registry.settings.empty?
28
- all_files = Dir.glob("#{Deadfire.config.root_path}/**/*.css")
29
- Deadfire.config.preprocess(*all_files)
30
- end
22
+ # by default, all files in the will be preprocessed
23
+ if Deadfire.config.asset_registry.settings.empty?
24
+ all_files = Dir.glob("#{Deadfire.config.root_path}/**/*.css")
25
+ Deadfire.config.preprocess(*all_files)
26
+ end
31
27
 
32
- Deadfire.parse(input, filename: logical_path.logical_path.to_s)
28
+ Deadfire.parse(input, filename: logical_path.logical_path.to_s)
29
+ end
33
30
  end
31
+
32
+ config.assets.compilers << ["text/css", DeadfireCompiler]
34
33
  end
35
-
36
- config.assets.compilers << ["text/css", DeadfireCompiler]
37
34
  end
38
35
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Deadfire
4
- VERSION = "0.5.0"
4
+ VERSION = "0.6.0"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deadfire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Haroon Ahmed
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-12-17 00:00:00.000000000 Z
11
+ date: 2025-01-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: actionpack
@@ -66,7 +66,7 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: 0.9.0
69
- description:
69
+ description:
70
70
  email:
71
71
  - haroon.ahmed25@gmail.com
72
72
  executables: []
@@ -128,7 +128,7 @@ metadata:
128
128
  homepage_uri: https://github.com/hahmed/deadfire
129
129
  source_code_uri: https://github.com/hahmed/deadfire
130
130
  changelog_uri: https://github.com/hahmed/deadfire/changelog.md
131
- post_install_message:
131
+ post_install_message:
132
132
  rdoc_options: []
133
133
  require_paths:
134
134
  - lib
@@ -143,8 +143,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
143
143
  - !ruby/object:Gem::Version
144
144
  version: '0'
145
145
  requirements: []
146
- rubygems_version: 3.5.9
147
- signing_key:
146
+ rubygems_version: 3.0.3.1
147
+ signing_key:
148
148
  specification_version: 4
149
149
  summary: Deadfire - lightweight css preprocessor
150
150
  test_files: []