lookbook 0.9.2 → 0.9.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3aef0fb4a6cbd200e129c3557e1b49188be466dcf73b0447964239f98cdb1263
4
- data.tar.gz: 7a04c0d210854191cd18424aaac033201200ab3a26883a8884b6fe2646530b53
3
+ metadata.gz: 32c809771b3d81b6622d1624bd3197efb2cc55d825f1543dd444454b18bcd980
4
+ data.tar.gz: 424739885629f6ca7870322a962934abf80cceb0e849e94ebf9284c093044c6a
5
5
  SHA512:
6
- metadata.gz: 91397d74515100b3d1a6f465209bbaa482251275722da317dcc30306e26659aadb5e923f4d1390e60f25fe527ada10015bc7c2631a292fa8a2e33b4c4c885dad
7
- data.tar.gz: '0901051f061b47bbebcd0900b976ab1a2302e867f126b587ef5ae220b2ccb68e048f90354e3830b392be61466443a6b23926382a83ba88383366d91b5d95d37b'
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:
@@ -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: /\.(rb|html.*)$/) do |modified, added, removed|
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
@@ -23,10 +23,6 @@ module Lookbook
23
23
  registry.get(path)
24
24
  end
25
25
 
26
- # def yardoc_file_path
27
- # Rails&.root ? Rails.root.join(YARDOC_FILE_PATH) : YARDOC_FILE_PATH
28
- # end
29
-
30
26
  class << self
31
27
  def define_tags
32
28
  YARD::Tags::Library.define_tag("Hidden status", :hidden)
@@ -1,3 +1,3 @@
1
1
  module Lookbook
2
- VERSION = "0.9.2"
2
+ VERSION = "0.9.3"
3
3
  end
@@ -4,7 +4,7 @@ namespace :lookbook do
4
4
 
5
5
  namespace :previews do
6
6
  desc "Preparse the previews"
7
- task :preparse do
7
+ task :preparse => :environment do
8
8
  Lookbook::Engine.parser.parse
9
9
  puts "Lookbook preview parsing complete"
10
10
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lookbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mark Perkins