lib/playbook.rb in playbook_ui-8.0.0.pre.alpha1 vs lib/playbook.rb in playbook_ui-8.0.0.pre.alpha4
- old
+ new
@@ -7,25 +7,30 @@
require "view_component/engine"
require "playbook/props"
require "playbook/version"
require "playbook/pb_kit_helper"
+require "playbook/pb_doc_helper"
require "playbook/kit_base"
require "playbook/kit_resolver"
-require "playbook/markdown/template_handler"
+require "playbook/markdown"
require "playbook/engine" if defined?(Rails)
module Playbook
ROOT_PATH = Pathname.new(File.join(__dir__, ".."))
class ConflictingPropsError < StandardError; end
class MissingPropError < StandardError; end
- class << self
- def webpacker
- @webpacker ||= ::Webpacker::Instance.new(
- root_path: ROOT_PATH,
- config_path: ROOT_PATH.join("config/webpacker.yml")
- )
- end
+module_function
+
+ def webpacker
+ @webpacker ||= ::Webpacker::Instance.new(
+ root_path: ROOT_PATH,
+ config_path: ROOT_PATH.join("config/webpacker.yml")
+ )
+ end
+
+ def kit_path(kit, *args)
+ Playbook::Engine.root.join("app/pb_kits/playbook/pb_#{kit}", *args)
end
end