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 +4 -4
- data/README.md +25 -5
- data/changelog.md +4 -1
- data/lib/deadfire/railtie.rb +16 -19
- data/lib/deadfire/version.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf5ff2b972555ed94df49077860d3a5097400ada7b48aa753cfea0297eef953d
|
4
|
+
data.tar.gz: ae2b3e72441a00b32658cb8998b92f71ae33f5197cefa973cff7d4a688bb2b12
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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
|
-
##
|
104
|
+
## Ruby on Rails
|
105
105
|
|
106
|
-
|
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
|
-
|
124
|
+
# config/initializers/assets.rb
|
125
|
+
Deadfire.configuration.preprocess("builds/tailwind.css")
|
110
126
|
```
|
111
127
|
|
112
|
-
|
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
data/lib/deadfire/railtie.rb
CHANGED
@@ -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 =
|
14
|
-
|
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
|
-
|
21
|
-
|
22
|
-
|
16
|
+
class DeadfireCompiler < ::Propshaft::Compiler
|
17
|
+
def compile(logical_path, input)
|
18
|
+
path = logical_path.path.to_s
|
23
19
|
|
24
|
-
|
20
|
+
return input if Deadfire.config.excluded_files.include?(path)
|
25
21
|
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
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
|
-
|
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
|
data/lib/deadfire/version.rb
CHANGED
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.
|
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:
|
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.
|
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: []
|