bridgetown-core 1.0.0.alpha5 → 1.0.0.alpha9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +1 -0
  3. data/bin/bridgetown +8 -1
  4. data/bridgetown-core.gemspec +2 -3
  5. data/lib/bridgetown-core/cache.rb +1 -1
  6. data/lib/bridgetown-core/collection.rb +1 -1
  7. data/lib/bridgetown-core/commands/concerns/configuration_overridable.rb +7 -0
  8. data/lib/bridgetown-core/commands/configure.rb +7 -0
  9. data/lib/bridgetown-core/commands/console.rb +38 -12
  10. data/lib/bridgetown-core/commands/doctor.rb +8 -5
  11. data/lib/bridgetown-core/commands/new.rb +3 -2
  12. data/lib/bridgetown-core/commands/start.rb +4 -2
  13. data/lib/bridgetown-core/component.rb +2 -2
  14. data/lib/bridgetown-core/concerns/front_matter_importer.rb +1 -1
  15. data/lib/bridgetown-core/concerns/site/configurable.rb +6 -3
  16. data/lib/bridgetown-core/concerns/site/extensible.rb +2 -1
  17. data/lib/bridgetown-core/concerns/site/ssr.rb +38 -16
  18. data/lib/bridgetown-core/configuration.rb +77 -46
  19. data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -3
  20. data/lib/bridgetown-core/configurations/cypress/cypress.json +4 -0
  21. data/lib/bridgetown-core/configurations/cypress/cypress_dir/fixtures/example.json +5 -0
  22. data/lib/bridgetown-core/configurations/cypress/cypress_dir/integration/navbar.spec.js +17 -0
  23. data/lib/bridgetown-core/configurations/cypress/cypress_dir/plugins/index.js +21 -0
  24. data/lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js +25 -0
  25. data/lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js +20 -0
  26. data/lib/bridgetown-core/configurations/cypress/cypress_tasks +33 -0
  27. data/lib/bridgetown-core/configurations/cypress.rb +13 -0
  28. data/lib/bridgetown-core/configurations/minitesting.rb +19 -15
  29. data/lib/bridgetown-core/configurations/netlify/netlify.toml +2 -2
  30. data/lib/bridgetown-core/configurations/netlify.rb +2 -4
  31. data/lib/bridgetown-core/configurations/purgecss.rb +2 -2
  32. data/lib/bridgetown-core/configurations/render/render.yaml.erb +26 -0
  33. data/lib/bridgetown-core/configurations/render.rb +6 -0
  34. data/lib/bridgetown-core/configurations/tailwindcss.rb +3 -5
  35. data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
  36. data/lib/bridgetown-core/converters/serbea_templates.rb +71 -0
  37. data/lib/bridgetown-core/core_ext/psych.rb +1 -5
  38. data/lib/bridgetown-core/frontmatter_defaults.rb +2 -2
  39. data/lib/bridgetown-core/liquid_renderer/file_system.rb +1 -3
  40. data/lib/bridgetown-core/liquid_renderer.rb +1 -1
  41. data/lib/bridgetown-core/model/base.rb +23 -26
  42. data/lib/bridgetown-core/model/builder_origin.rb +8 -6
  43. data/lib/bridgetown-core/model/origin.rb +10 -1
  44. data/lib/bridgetown-core/model/plugin_origin.rb +1 -1
  45. data/lib/bridgetown-core/plugin_manager.rb +9 -36
  46. data/lib/bridgetown-core/rack/boot.rb +46 -23
  47. data/lib/bridgetown-core/rack/roda.rb +2 -1
  48. data/lib/bridgetown-core/rack/routes.rb +2 -2
  49. data/lib/bridgetown-core/readers/layout_reader.rb +1 -1
  50. data/lib/bridgetown-core/readers/plugin_content_reader.rb +1 -1
  51. data/lib/bridgetown-core/renderer.rb +2 -2
  52. data/lib/bridgetown-core/resource/base.rb +3 -3
  53. data/lib/bridgetown-core/resource/relations.rb +1 -1
  54. data/lib/bridgetown-core/resource/taxonomy_term.rb +2 -2
  55. data/lib/bridgetown-core/resource/taxonomy_type.rb +2 -2
  56. data/lib/bridgetown-core/ruby_template_view.rb +2 -2
  57. data/lib/bridgetown-core/site.rb +15 -5
  58. data/lib/bridgetown-core/utils/loaders_manager.rb +72 -0
  59. data/lib/bridgetown-core/utils.rb +13 -14
  60. data/lib/bridgetown-core/version.rb +1 -1
  61. data/lib/bridgetown-core/watcher.rb +16 -7
  62. data/lib/bridgetown-core/yaml_parser.rb +1 -5
  63. data/lib/bridgetown-core.rb +0 -1
  64. data/lib/site_template/README.md +1 -1
  65. data/lib/site_template/Rakefile +3 -3
  66. metadata +31 -19
@@ -14,9 +14,17 @@ require_relative "static_indexes"
14
14
 
15
15
  module Bridgetown
16
16
  module Rack
17
- def self.boot
18
- autoload_server_folder(root: Dir.pwd)
19
- RodaApp.opts[:bridgetown_preloaded_config] = Bridgetown::Current.preloaded_configuration
17
+ class << self
18
+ # @return [Bridgetown::Utils::LoadersManager]
19
+ attr_accessor :loaders_manager
20
+ end
21
+
22
+ def self.boot(roda_app = nil)
23
+ self.loaders_manager =
24
+ Bridgetown::Utils::LoadersManager.new(Bridgetown::Current.preloaded_configuration)
25
+ autoload_server_folder
26
+ (roda_app || RodaApp).opts[:bridgetown_preloaded_config] =
27
+ Bridgetown::Current.preloaded_configuration
20
28
  rescue Roda::RodaError => e
21
29
  if e.message.include?("sessions plugin :secret option")
22
30
  raise Bridgetown::Errors::InvalidConfigurationError,
@@ -27,29 +35,44 @@ module Bridgetown
27
35
  raise e
28
36
  end
29
37
 
30
- def self.autoload_server_folder(root:)
38
+ # @param root [String] root of Bridgetown site, defaults to config value
39
+ def self.autoload_server_folder( # rubocop:todo Metrics/MethodLength
40
+ root: Bridgetown::Current.preloaded_configuration.root_dir
41
+ )
31
42
  server_folder = File.join(root, "server")
32
- loader = Zeitwerk::Loader.new
33
- loader.push_dir server_folder
34
- loader.enable_reloading unless ENV["BRIDGETOWN_ENV"] == "production"
35
- loader.setup
36
- loader.eager_load
37
- loader.do_not_eager_load(File.join(server_folder, "roda_app.rb"))
38
-
39
- unless ENV["BRIDGETOWN_ENV"] == "production"
40
- begin
41
- Listen.to(server_folder) do |_modified, _added, _removed|
42
- loader.reload
43
- loader.eager_load
44
- Bridgetown::Rack::Routes.reload_subclasses
45
- end.start
46
- # interrupt isn't handled well by the listener
47
- rescue ThreadError # rubocop:disable Lint/SuppressedException
43
+ # Bridgetown::Current.preloaded_configuration.autoload_paths << server_folder
44
+
45
+ Bridgetown::Hooks.register_one(
46
+ :loader, :post_setup, reloadable: false
47
+ ) do |loader, load_path|
48
+ next unless load_path == server_folder
49
+
50
+ loader.eager_load
51
+ loader.do_not_eager_load(File.join(server_folder, "roda_app.rb"))
52
+
53
+ unless ENV["BRIDGETOWN_ENV"] == "production"
54
+ begin
55
+ Listen.to(server_folder) do |_modified, _added, _removed|
56
+ loader.reload
57
+ loader.eager_load
58
+ Bridgetown::Rack::Routes.reload_subclasses
59
+ end.start
60
+ # interrupt isn't handled well by the listener
61
+ rescue ThreadError # rubocop:disable Lint/SuppressedException
62
+ end
48
63
  end
49
64
  end
50
- rescue Zeitwerk::Error
51
- # We assume if there's an error it's because Zeitwerk already registered this folder,
52
- # so it's fine to swallow the error
65
+
66
+ Bridgetown::Hooks.register_one(
67
+ :loader, :post_reload, reloadable: false
68
+ ) do |loader, load_path|
69
+ next unless load_path == server_folder
70
+
71
+ loader.eager_load
72
+ Bridgetown::Rack::Routes.reload_subclasses
73
+ end
74
+
75
+ loaders_manager.setup_loaders([server_folder])
53
76
  end
54
77
  end
55
78
  end
@@ -6,7 +6,8 @@ class Roda
6
6
  module RodaPlugins
7
7
  module BridgetownSSR
8
8
  def self.configure(app, _opts = {}, &block)
9
- app.opts[:bridgetown_site] = Bridgetown::Site.start_ssr!(&block)
9
+ app.opts[:bridgetown_site] =
10
+ Bridgetown::Site.start_ssr!(loaders_manager: Bridgetown::Rack.loaders_manager, &block)
10
11
  end
11
12
  end
12
13
 
@@ -72,9 +72,9 @@ module Bridgetown
72
72
  instance_exec(@_roda_app.request, &self.class.router_block)
73
73
  end
74
74
 
75
- ruby2_keywords def method_missing(method_name, *args, &block)
75
+ def method_missing(method_name, *args, **kwargs, &block)
76
76
  if @_roda_app.respond_to?(method_name.to_sym)
77
- @_roda_app.send method_name.to_sym, *args, &block
77
+ @_roda_app.send method_name.to_sym, *args, **kwargs, &block
78
78
  else
79
79
  super
80
80
  end
@@ -15,7 +15,7 @@ module Bridgetown
15
15
  Layout.new(site, layout_directory, layout_file)
16
16
  end
17
17
 
18
- Bridgetown::PluginManager.source_manifests.map(&:layouts).compact.each do |plugin_layouts|
18
+ Bridgetown::PluginManager.source_manifests.filter_map(&:layouts).each do |plugin_layouts|
19
19
  layout_entries(plugin_layouts).each do |layout_file|
20
20
  @layouts[layout_name(layout_file)] ||= \
21
21
  Layout.new(site, plugin_layouts, layout_file, from_plugin: true)
@@ -40,7 +40,7 @@ module Bridgetown
40
40
  end
41
41
 
42
42
  def add_to(content_type, klass)
43
- existing_paths = content_type.map(&:relative_path).compact
43
+ existing_paths = content_type.filter_map(&:relative_path)
44
44
  @content_files.select { |item| item.is_a?(klass) }.each do |item|
45
45
  content_type << item unless existing_paths.include?(item.relative_path)
46
46
  end
@@ -161,9 +161,9 @@ module Bridgetown
161
161
  end
162
162
 
163
163
  def output_exts
164
- @output_exts ||= converters.map do |c|
164
+ @output_exts ||= converters.filter_map do |c|
165
165
  c.output_ext(document.extname)
166
- end.compact
166
+ end
167
167
  end
168
168
  end
169
169
  end
@@ -255,8 +255,8 @@ module Bridgetown
255
255
  to_h
256
256
  end
257
257
 
258
- ruby2_keywords def to_json(*options)
259
- as_json(*options).to_json(*options)
258
+ def to_json(...)
259
+ as_json(...).to_json(...)
260
260
  end
261
261
 
262
262
  def inspect
@@ -349,7 +349,7 @@ module Bridgetown
349
349
 
350
350
  # Look for alternative front matter or look at the filename pattern: slug.locale.ext
351
351
  def locale_from_alt_data_or_filename
352
- found_locale = data.language || data.lang || basename_without_ext.split(".")[1..-1].last
352
+ found_locale = data.language || data.lang || basename_without_ext.split(".")[1..].last
353
353
  return unless found_locale && site.config.available_locales.include?(found_locale.to_sym)
354
354
 
355
355
  found_locale
@@ -95,7 +95,7 @@ module Bridgetown
95
95
  def belongs_to_relation_for_type(type)
96
96
  if resource.data[type].is_a?(Array)
97
97
  other_slugs = other_collection_for_type(type).resources_by_slug
98
- resource.data[type].map { |slug| other_slugs[slug] }.compact
98
+ resource.data[type].filter_map { |slug| other_slugs[slug] }
99
99
  else
100
100
  other_collection_for_type(type).resources.find do |other_resource|
101
101
  other_resource.data.slug == resource.data[type]
@@ -22,8 +22,8 @@ module Bridgetown
22
22
  to_h
23
23
  end
24
24
 
25
- ruby2_keywords def to_json(*options)
26
- as_json(*options).to_json(*options)
25
+ def to_json(...)
26
+ as_json(...).to_json(...)
27
27
  end
28
28
  end
29
29
  end
@@ -48,8 +48,8 @@ module Bridgetown
48
48
  to_h
49
49
  end
50
50
 
51
- ruby2_keywords def to_json(*options)
52
- as_json(*options).to_json(*options)
51
+ def to_json(...)
52
+ as_json(...).to_json(...)
53
53
  end
54
54
  end
55
55
  end
@@ -61,9 +61,9 @@ module Bridgetown
61
61
  @helpers ||= Helpers.new(self, site)
62
62
  end
63
63
 
64
- ruby2_keywords def method_missing(method_name, *args, &block)
64
+ def method_missing(method_name, *args, **kwargs, &block)
65
65
  if helpers.respond_to?(method_name.to_sym)
66
- helpers.send method_name.to_sym, *args, &block
66
+ helpers.send method_name.to_sym, *args, **kwargs, &block
67
67
  else
68
68
  super
69
69
  end
@@ -13,9 +13,10 @@ module Bridgetown
13
13
  include SSR
14
14
  include Writable
15
15
 
16
- attr_reader :root_dir, :source, :dest, :cache_dir, :config,
17
- :liquid_renderer, :components_load_paths,
18
- :includes_load_paths
16
+ attr_reader :root_dir, :source, :dest, :cache_dir, :config, :liquid_renderer
17
+
18
+ # @return [Bridgetown::Utils::LoadersManager]
19
+ attr_reader :loaders_manager
19
20
 
20
21
  # All files not pages/documents or structured data in the source folder
21
22
  # @return [Array<StaticFile>]
@@ -33,11 +34,20 @@ module Bridgetown
33
34
 
34
35
  # Initialize a new Site.
35
36
  #
36
- # config - A Hash containing site configuration details.
37
- def initialize(config)
37
+ # @param config [Bridgetown::Configuration]
38
+ # @param loaders_manager [Bridgetown::Utils::LoadersManager] initialized if none provided
39
+ def initialize(config, loaders_manager: nil)
38
40
  self.config = config
39
41
  locale
40
42
 
43
+ loaders_manager = if loaders_manager
44
+ loaders_manager.config = self.config
45
+ loaders_manager
46
+ else
47
+ Bridgetown::Utils::LoadersManager.new(self.config)
48
+ end
49
+ @loaders_manager = loaders_manager
50
+
41
51
  @plugin_manager = PluginManager.new(self)
42
52
  @cleaner = Cleaner.new(self)
43
53
  @reader = Reader.new(self)
@@ -0,0 +1,72 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bridgetown
4
+ module Utils
5
+ class LoadersManager
6
+ attr_accessor :config
7
+
8
+ attr_reader :loaders, :root_dir
9
+
10
+ # @param config [Bridgetown::Configuration]
11
+ # @param root_dir [String] root of the current site
12
+ def initialize(config, root_dir = Dir.pwd)
13
+ @config = config
14
+ @loaders = {}
15
+ @root_dir = root_dir
16
+ end
17
+
18
+ def unload_loaders
19
+ return if @loaders.keys.empty?
20
+
21
+ @loaders.each do |_path, loader|
22
+ loader.unload
23
+ end
24
+ @loaders = {}
25
+ end
26
+
27
+ def reloading_enabled?(load_path)
28
+ load_path.start_with?(root_dir) && ENV["BRIDGETOWN_ENV"] != "production"
29
+ end
30
+
31
+ def setup_loaders(autoload_paths = []) # rubocop:todo Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
32
+ (autoload_paths.presence || config.autoload_paths).each do |load_path|
33
+ if @loaders.key?(load_path)
34
+ raise "Zeitwerk loader already added for `#{load_path}'. Please check your config"
35
+ end
36
+
37
+ next unless Dir.exist? load_path
38
+
39
+ loader = Zeitwerk::Loader.new
40
+ begin
41
+ loader.push_dir(load_path)
42
+ rescue Zeitwerk::Error
43
+ next
44
+ end
45
+ loader.enable_reloading if reloading_enabled?(load_path)
46
+ loader.ignore(File.join(load_path, "**", "*.js.rb"))
47
+ config.autoloader_collapsed_paths.each do |collapsed_path|
48
+ next unless collapsed_path.starts_with?(load_path)
49
+
50
+ loader.collapse(collapsed_path)
51
+ end
52
+ Bridgetown::Hooks.trigger :loader, :pre_setup, loader, load_path
53
+ loader.setup
54
+ loader.eager_load if config.eager_load_paths.include?(load_path)
55
+ Bridgetown::Hooks.trigger :loader, :post_setup, loader, load_path
56
+ @loaders[load_path] = loader
57
+ end
58
+ end
59
+
60
+ def reload_loaders
61
+ @loaders.each do |load_path, loader|
62
+ next unless reloading_enabled?(load_path)
63
+
64
+ Bridgetown::Hooks.trigger :loader, :pre_reload, loader, load_path
65
+ loader.reload
66
+ loader.eager_load if config.eager_load_paths.include?(load_path)
67
+ Bridgetown::Hooks.trigger :loader, :post_reload, loader, load_path
68
+ end
69
+ end
70
+ end
71
+ end
72
+ end
@@ -5,6 +5,7 @@ module Bridgetown
5
5
  extend self
6
6
  autoload :Ansi, "bridgetown-core/utils/ansi"
7
7
  autoload :Aux, "bridgetown-core/utils/aux"
8
+ autoload :LoadersManager, "bridgetown-core/utils/loaders_manager"
8
9
  autoload :RequireGems, "bridgetown-core/utils/require_gems"
9
10
  autoload :RubyExec, "bridgetown-core/utils/ruby_exec"
10
11
  autoload :RubyFrontMatter, "bridgetown-core/utils/ruby_front_matter"
@@ -120,15 +121,11 @@ module Bridgetown
120
121
  # @return [Boolean] if the YAML front matter is present.
121
122
  # rubocop: disable Naming/PredicateName
122
123
  def has_yaml_header?(file)
123
- File.open(file, "rb", &:readline).match? Bridgetown::FrontMatterImporter::YAML_HEADER
124
- rescue EOFError
125
- false
124
+ File.open(file, "rb", &:gets)&.match?(Bridgetown::FrontMatterImporter::YAML_HEADER) || false
126
125
  end
127
126
 
128
127
  def has_rbfm_header?(file)
129
- File.open(file, "rb", &:readline).match? Bridgetown::FrontMatterImporter::RUBY_HEADER
130
- rescue EOFError
131
- false
128
+ File.open(file, "rb", &:gets)&.match?(Bridgetown::FrontMatterImporter::RUBY_HEADER) || false
132
129
  end
133
130
 
134
131
  # Determine whether the given content string contains Liquid Tags or Vaiables
@@ -354,7 +351,7 @@ module Bridgetown
354
351
  # @raise [WebpackAssetError] if unable to find css or js in the manifest
355
352
  # file
356
353
  def parse_webpack_manifest_file(site, asset_type)
357
- return log_webpack_asset_error("Webpack manifest") if site.frontend_manifest.nil?
354
+ return log_webpack_asset_error(site, "Webpack manifest") if site.frontend_manifest.nil?
358
355
 
359
356
  asset_path = if %w(js css).include?(asset_type)
360
357
  site.frontend_manifest["main.#{asset_type}"]
@@ -364,7 +361,7 @@ module Bridgetown
364
361
  end&.last
365
362
  end
366
363
 
367
- return log_webpack_asset_error(asset_type) if asset_path.nil?
364
+ return log_webpack_asset_error(site, asset_type) if asset_path.nil?
368
365
 
369
366
  static_frontend_path site, ["js", asset_path]
370
367
  end
@@ -379,12 +376,14 @@ module Bridgetown
379
376
  Addressable::URI.parse(path_parts.join("/")).normalize.to_s
380
377
  end
381
378
 
382
- def log_webpack_asset_error(asset_type)
383
- Bridgetown.logger.warn(
384
- "Webpack:",
385
- "There was an error parsing your #{asset_type} file. \
386
- Please check your #{asset_type} file for any errors."
387
- )
379
+ def log_webpack_asset_error(site, asset_type)
380
+ site.data[:__webpack_asset_errors] ||= {}
381
+ site.data[:__webpack_asset_errors][asset_type] ||=
382
+ Bridgetown.logger.warn(
383
+ "Webpack:",
384
+ "There was an error parsing your #{asset_type} file. \
385
+ Please check your #{asset_type} file for any errors."
386
+ )
388
387
 
389
388
  "MISSING_WEBPACK_MANIFEST_FILE"
390
389
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Bridgetown
4
- VERSION = "1.0.0.alpha5"
4
+ VERSION = "1.0.0.alpha9"
5
5
  CODE_NAME = "Pearl"
6
6
  end
@@ -41,10 +41,12 @@ module Bridgetown
41
41
  Dir.exist?(path)
42
42
  end
43
43
 
44
+ paths_to_watch = (plugin_paths_to_watch + options.autoload_paths).uniq
45
+
44
46
  Listen.to(
45
47
  options["source"],
46
48
  webpack_path,
47
- *plugin_paths_to_watch,
49
+ *paths_to_watch,
48
50
  ignore: listen_ignore_paths(options),
49
51
  force_polling: options["force_polling"],
50
52
  &listen_handler(site, options)
@@ -57,10 +59,12 @@ module Bridgetown
57
59
  c = modified + added + removed
58
60
  n = c.length
59
61
 
60
- Bridgetown.logger.info "Regenerating…"
61
- Bridgetown.logger.info "", "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")}"
62
+ unless site.ssr?
63
+ Bridgetown.logger.info "Regenerating…"
64
+ Bridgetown.logger.info "", "#{n} file(s) changed at #{t.strftime("%Y-%m-%d %H:%M:%S")}"
65
+ c.each { |path| Bridgetown.logger.info "", path["#{site.root_dir}/".length..] }
66
+ end
62
67
 
63
- c.each { |path| Bridgetown.logger.info "", path["#{site.root_dir}/".length..-1] }
64
68
  process(site, t, options)
65
69
  end
66
70
  end
@@ -101,7 +105,7 @@ module Bridgetown
101
105
  source = Pathname.new(options["source"]).expand_path
102
106
  paths = to_exclude(options)
103
107
 
104
- paths.map do |p|
108
+ paths.filter_map do |p|
105
109
  absolute_path = Pathname.new(normalize_encoding(p, options["source"].encoding)).expand_path
106
110
  next unless absolute_path.exist?
107
111
 
@@ -116,20 +120,25 @@ module Bridgetown
116
120
  rescue ArgumentError
117
121
  # Could not find a relative path
118
122
  end
119
- end.compact + [%r!^\.bridgetown-metadata!]
123
+ end + [%r!^\.bridgetown-metadata!]
120
124
  end
121
125
 
122
126
  def sleep_forever
123
127
  loop { sleep 1000 }
124
128
  end
125
129
 
130
+ # @param site [Bridgetown::Site]
126
131
  def process(site, time, options)
127
132
  begin
128
133
  I18n.reload! # make sure any locale files get read again
134
+ Bridgetown::Current.site = site # needed in SSR mode apparently
129
135
  Bridgetown::Hooks.trigger :site, :pre_reload, site
130
136
  Bridgetown::Hooks.clear_reloadable_hooks
131
137
  site.plugin_manager.reload_plugin_files
132
- site.plugin_manager.reload_component_loaders
138
+ site.loaders_manager.reload_loaders
139
+
140
+ return site.ssr_reload if site.ssr?
141
+
133
142
  site.process
134
143
  Bridgetown.logger.info "Done! 🎉", "#{"Completed".green} in less than" \
135
144
  " #{(Time.now - time).ceil(2)} seconds."
@@ -11,11 +11,7 @@ module Bridgetown
11
11
  end
12
12
 
13
13
  def load(yaml)
14
- if RUBY_VERSION.start_with?("2.5")
15
- YAML.safe_load yaml, PERMITTED_CLASSES
16
- else
17
- YAML.safe_load yaml, permitted_classes: PERMITTED_CLASSES
18
- end
14
+ YAML.safe_load yaml, permitted_classes: PERMITTED_CLASSES
19
15
  end
20
16
  end
21
17
  end
@@ -46,7 +46,6 @@ require "active_support/descendants_tracker"
46
46
  require "hash_with_dot_access"
47
47
  require "addressable/uri"
48
48
  require "liquid"
49
- require "liquid-component"
50
49
  require "listen"
51
50
  require "kramdown"
52
51
  require "colorator"
@@ -16,7 +16,7 @@ Welcome to your new Bridgetown website! You can update this README file to provi
16
16
  - [GCC](https://gcc.gnu.org/install/)
17
17
  - [Make](https://www.gnu.org/software/make/)
18
18
  - [Ruby](https://www.ruby-lang.org/en/downloads/)
19
- - `>= 2.5`
19
+ - `>= 2.7`
20
20
  - [Bridgetown Gem](https://rubygems.org/gems/bridgetown)
21
21
  - `gem install bridgetown -N`
22
22
  - [Node](https://nodejs.org)
@@ -2,6 +2,9 @@ require "bridgetown"
2
2
 
3
3
  Bridgetown.load_tasks
4
4
 
5
+ # Run rake without specifying any command to execute a deploy build by default.
6
+ task default: :deploy
7
+
5
8
  #
6
9
  # Standard set of tasks, which you can customize if you wish:
7
10
  #
@@ -44,6 +47,3 @@ end
44
47
  # say_status :rake, "I'm a Rake tast =) #{site.config.url}"
45
48
  # end
46
49
  # end
47
-
48
- # Run rake without specifying any command to execute a deploy build by default.
49
- task default: :deploy
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bridgetown-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.alpha5
4
+ version: 1.0.0.alpha9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bridgetown Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-10-22 00:00:00.000000000 Z
11
+ date: 2021-11-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -192,20 +192,6 @@ dependencies:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
194
  version: '5.0'
195
- - !ruby/object:Gem::Dependency
196
- name: liquid-component
197
- requirement: !ruby/object:Gem::Requirement
198
- requirements:
199
- - - ">="
200
- - !ruby/object:Gem::Version
201
- version: '0.1'
202
- type: :runtime
203
- prerelease: false
204
- version_requirements: !ruby/object:Gem::Requirement
205
- requirements:
206
- - - ">="
207
- - !ruby/object:Gem::Version
208
- version: '0.1'
209
195
  - !ruby/object:Gem::Dependency
210
196
  name: listen
211
197
  requirement: !ruby/object:Gem::Requirement
@@ -276,6 +262,20 @@ dependencies:
276
262
  - - "~>"
277
263
  - !ruby/object:Gem::Version
278
264
  version: '3.0'
265
+ - !ruby/object:Gem::Dependency
266
+ name: serbea
267
+ requirement: !ruby/object:Gem::Requirement
268
+ requirements:
269
+ - - "~>"
270
+ - !ruby/object:Gem::Version
271
+ version: '1.0'
272
+ type: :runtime
273
+ prerelease: false
274
+ version_requirements: !ruby/object:Gem::Requirement
275
+ requirements:
276
+ - - "~>"
277
+ - !ruby/object:Gem::Version
278
+ version: '1.0'
279
279
  - !ruby/object:Gem::Dependency
280
280
  name: terminal-table
281
281
  requirement: !ruby/object:Gem::Requirement
@@ -390,11 +390,21 @@ files:
390
390
  - lib/bridgetown-core/configurations/.keep
391
391
  - lib/bridgetown-core/configurations/bt-postcss.rb
392
392
  - lib/bridgetown-core/configurations/bt-postcss/postcss.config.js
393
+ - lib/bridgetown-core/configurations/cypress.rb
394
+ - lib/bridgetown-core/configurations/cypress/cypress.json
395
+ - lib/bridgetown-core/configurations/cypress/cypress_dir/fixtures/example.json
396
+ - lib/bridgetown-core/configurations/cypress/cypress_dir/integration/navbar.spec.js
397
+ - lib/bridgetown-core/configurations/cypress/cypress_dir/plugins/index.js
398
+ - lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js
399
+ - lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js
400
+ - lib/bridgetown-core/configurations/cypress/cypress_tasks
393
401
  - lib/bridgetown-core/configurations/minitesting.rb
394
402
  - lib/bridgetown-core/configurations/netlify.rb
395
403
  - lib/bridgetown-core/configurations/netlify/netlify.sh
396
404
  - lib/bridgetown-core/configurations/netlify/netlify.toml
397
405
  - lib/bridgetown-core/configurations/purgecss.rb
406
+ - lib/bridgetown-core/configurations/render.rb
407
+ - lib/bridgetown-core/configurations/render/render.yaml.erb
398
408
  - lib/bridgetown-core/configurations/stimulus.rb
399
409
  - lib/bridgetown-core/configurations/swup.rb
400
410
  - lib/bridgetown-core/configurations/tailwindcss.rb
@@ -408,6 +418,7 @@ files:
408
418
  - lib/bridgetown-core/converters/markdown.rb
409
419
  - lib/bridgetown-core/converters/markdown/kramdown_parser.rb
410
420
  - lib/bridgetown-core/converters/ruby_templates.rb
421
+ - lib/bridgetown-core/converters/serbea_templates.rb
411
422
  - lib/bridgetown-core/converters/smartypants.rb
412
423
  - lib/bridgetown-core/core_ext/psych.rb
413
424
  - lib/bridgetown-core/current.rb
@@ -488,6 +499,7 @@ files:
488
499
  - lib/bridgetown-core/utils.rb
489
500
  - lib/bridgetown-core/utils/ansi.rb
490
501
  - lib/bridgetown-core/utils/aux.rb
502
+ - lib/bridgetown-core/utils/loaders_manager.rb
491
503
  - lib/bridgetown-core/utils/require_gems.rb
492
504
  - lib/bridgetown-core/utils/ruby_exec.rb
493
505
  - lib/bridgetown-core/utils/ruby_front_matter.rb
@@ -542,12 +554,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
542
554
  requirements:
543
555
  - - ">="
544
556
  - !ruby/object:Gem::Version
545
- version: 2.5.0
557
+ version: 2.7.0
546
558
  required_rubygems_version: !ruby/object:Gem::Requirement
547
559
  requirements:
548
- - - ">="
560
+ - - ">"
549
561
  - !ruby/object:Gem::Version
550
- version: 2.7.0
562
+ version: 1.3.1
551
563
  requirements: []
552
564
  rubygems_version: 3.1.4
553
565
  signing_key: