lookbook 0.9.2 → 0.9.3
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 +8 -0
- data/lib/lookbook/engine.rb +5 -1
- data/lib/lookbook/parser.rb +0 -4
- data/lib/lookbook/version.rb +1 -1
- data/lib/tasks/lookbook_tasks.rake +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32c809771b3d81b6622d1624bd3197efb2cc55d825f1543dd444454b18bcd980
|
4
|
+
data.tar.gz: 424739885629f6ca7870322a962934abf80cceb0e849e94ebf9284c093044c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ab5ba4963b759623cbfafdd3270a03f2be2282ffd817466f821dbcc92c36360f72c3766b894b1f1013681392c569479c19263af95bebd1028a0bd2d265117d4a
|
7
|
+
data.tar.gz: db263a69c03239c9865aeb068c31c9ba60e475aa5b685a17128599fe5cba2aa0d4b501047a95e9650191bc57557b896328390c24d821e77eff41f51c8923c075
|
data/README.md
CHANGED
@@ -802,6 +802,14 @@ If you wish to add additional paths to listen for changes in, you can use the `l
|
|
802
802
|
config.lookbook.listen_paths << Rails.root.join('app/other/directory')
|
803
803
|
```
|
804
804
|
|
805
|
+
By default Lookbook listens for changes to files with the extensions `rb` and `html.*` (i.e. `.html.erb`).
|
806
|
+
|
807
|
+
You can add additional extensions by using the `listen_extensions` option:
|
808
|
+
|
809
|
+
```ruby
|
810
|
+
config.lookbook.listen_extensions = ['js', 'scss'] # Will not overwrite default extensions
|
811
|
+
```
|
812
|
+
|
805
813
|
### Custom favicon
|
806
814
|
|
807
815
|
If you want to change the favicon used by the Lookbook UI, you can provide a path to your own (or a data-uri string) using the `ui_favicon` option:
|
data/lib/lookbook/engine.rb
CHANGED
@@ -23,6 +23,7 @@ module Lookbook
|
|
23
23
|
|
24
24
|
config.lookbook = ActiveSupport::OrderedOptions.new
|
25
25
|
config.lookbook.listen_paths ||= []
|
26
|
+
config.lookbook.listen_extensions ||= []
|
26
27
|
config.lookbook.preview_paths ||= []
|
27
28
|
config.lookbook.page_paths ||= ["test/components/docs"]
|
28
29
|
|
@@ -55,6 +56,9 @@ module Lookbook
|
|
55
56
|
options.listen_paths << (vc_options.view_component_path || Rails.root.join("app/components"))
|
56
57
|
options.listen_paths.select! { |path| Dir.exist? path }
|
57
58
|
|
59
|
+
options.listen_extensions += ["rb", "html.*"]
|
60
|
+
options.listen_extensions.uniq!
|
61
|
+
|
58
62
|
options.cable_mount_path ||= "/lookbook-cable"
|
59
63
|
options.cable_logger ||= Rails.logger
|
60
64
|
|
@@ -80,7 +84,7 @@ module Lookbook
|
|
80
84
|
@preview_controller.include(Lookbook::PreviewController)
|
81
85
|
|
82
86
|
if config.lookbook.listen
|
83
|
-
@preview_listener = Listen.to(*config.lookbook.listen_paths, only: /\.(
|
87
|
+
@preview_listener = Listen.to(*config.lookbook.listen_paths, only: /\.(#{config.lookbook.listen_extensions.join("|")})$/) do |modified, added, removed|
|
84
88
|
begin
|
85
89
|
parser.parse
|
86
90
|
rescue
|
data/lib/lookbook/parser.rb
CHANGED
data/lib/lookbook/version.rb
CHANGED