bridgetown-core 1.0.0.alpha6 → 1.0.0.alpha10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +5 -0
- data/bin/bridgetown +8 -1
- data/bridgetown-core.gemspec +3 -3
- data/lib/bridgetown-core/cache.rb +1 -1
- data/lib/bridgetown-core/collection.rb +1 -1
- data/lib/bridgetown-core/commands/concerns/configuration_overridable.rb +7 -0
- data/lib/bridgetown-core/commands/configure.rb +7 -0
- data/lib/bridgetown-core/commands/console.rb +38 -12
- data/lib/bridgetown-core/commands/doctor.rb +8 -5
- data/lib/bridgetown-core/commands/new.rb +1 -0
- data/lib/bridgetown-core/commands/plugins.rb +1 -1
- data/lib/bridgetown-core/component.rb +2 -2
- data/lib/bridgetown-core/concerns/front_matter_importer.rb +1 -1
- data/lib/bridgetown-core/concerns/site/configurable.rb +6 -3
- data/lib/bridgetown-core/concerns/site/extensible.rb +2 -1
- data/lib/bridgetown-core/concerns/site/ssr.rb +38 -16
- data/lib/bridgetown-core/configuration.rb +77 -46
- data/lib/bridgetown-core/configurations/bt-postcss.rb +1 -3
- data/lib/bridgetown-core/configurations/cypress/cypress.json +4 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_dir/fixtures/example.json +5 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_dir/integration/navbar.spec.js +17 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_dir/plugins/index.js +21 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js +25 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js +20 -0
- data/lib/bridgetown-core/configurations/cypress/cypress_tasks +33 -0
- data/lib/bridgetown-core/configurations/cypress.rb +13 -0
- data/lib/bridgetown-core/configurations/minitesting.rb +19 -15
- data/lib/bridgetown-core/configurations/netlify.rb +2 -4
- data/lib/bridgetown-core/configurations/purgecss.rb +2 -2
- data/lib/bridgetown-core/configurations/render/render.yaml.erb +26 -0
- data/lib/bridgetown-core/configurations/render.rb +6 -0
- data/lib/bridgetown-core/configurations/tailwindcss.rb +3 -5
- data/lib/bridgetown-core/converters/erb_templates.rb +1 -1
- data/lib/bridgetown-core/converters/markdown/kramdown_parser.rb +1 -1
- data/lib/bridgetown-core/converters/serbea_templates.rb +71 -0
- data/lib/bridgetown-core/core_ext/psych.rb +1 -5
- data/lib/bridgetown-core/frontmatter_defaults.rb +2 -2
- data/lib/bridgetown-core/liquid_renderer/file_system.rb +1 -3
- data/lib/bridgetown-core/liquid_renderer.rb +1 -1
- data/lib/bridgetown-core/model/base.rb +23 -26
- data/lib/bridgetown-core/model/builder_origin.rb +8 -6
- data/lib/bridgetown-core/model/origin.rb +10 -1
- data/lib/bridgetown-core/model/plugin_origin.rb +1 -1
- data/lib/bridgetown-core/plugin_manager.rb +9 -36
- data/lib/bridgetown-core/rack/boot.rb +46 -23
- data/lib/bridgetown-core/rack/roda.rb +2 -1
- data/lib/bridgetown-core/rack/routes.rb +2 -2
- data/lib/bridgetown-core/readers/layout_reader.rb +1 -1
- data/lib/bridgetown-core/readers/plugin_content_reader.rb +1 -1
- data/lib/bridgetown-core/renderer.rb +2 -2
- data/lib/bridgetown-core/resource/base.rb +3 -3
- data/lib/bridgetown-core/resource/relations.rb +1 -1
- data/lib/bridgetown-core/resource/taxonomy_term.rb +2 -2
- data/lib/bridgetown-core/resource/taxonomy_type.rb +2 -2
- data/lib/bridgetown-core/ruby_template_view.rb +2 -2
- data/lib/bridgetown-core/site.rb +15 -5
- data/lib/bridgetown-core/utils/loaders_manager.rb +83 -0
- data/lib/bridgetown-core/utils.rb +13 -14
- data/lib/bridgetown-core/version.rb +1 -1
- data/lib/bridgetown-core/watcher.rb +16 -7
- data/lib/bridgetown-core/yaml_parser.rb +1 -5
- data/lib/bridgetown-core.rb +0 -1
- data/lib/site_template/README.md +1 -1
- data/lib/site_template/Rakefile +3 -3
- metadata +45 -19
@@ -14,9 +14,17 @@ require_relative "static_indexes"
|
|
14
14
|
|
15
15
|
module Bridgetown
|
16
16
|
module Rack
|
17
|
-
|
18
|
-
|
19
|
-
|
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
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
loader
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
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
|
-
|
51
|
-
|
52
|
-
|
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] =
|
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
|
-
|
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.
|
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.
|
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
|
@@ -255,8 +255,8 @@ module Bridgetown
|
|
255
255
|
to_h
|
256
256
|
end
|
257
257
|
|
258
|
-
|
259
|
-
as_json(
|
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
|
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].
|
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]
|
@@ -61,9 +61,9 @@ module Bridgetown
|
|
61
61
|
@helpers ||= Helpers.new(self, site)
|
62
62
|
end
|
63
63
|
|
64
|
-
|
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
|
data/lib/bridgetown-core/site.rb
CHANGED
@@ -13,9 +13,10 @@ module Bridgetown
|
|
13
13
|
include SSR
|
14
14
|
include Writable
|
15
15
|
|
16
|
-
attr_reader
|
17
|
-
|
18
|
-
|
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
|
37
|
-
|
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,83 @@
|
|
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 clear_descendants_for_reload(_cpath, value, _abspath)
|
32
|
+
unless value.is_a?(Class) && value.singleton_class < ActiveSupport::DescendantsTracker
|
33
|
+
return
|
34
|
+
end
|
35
|
+
|
36
|
+
ActiveSupport::DescendantsTracker.class_variable_get(
|
37
|
+
:@@direct_descendants
|
38
|
+
)[value.superclass]&.reject! { _1 == value }
|
39
|
+
end
|
40
|
+
|
41
|
+
def setup_loaders(autoload_paths = []) # rubocop:todo Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/MethodLength, Metrics/PerceivedComplexity
|
42
|
+
(autoload_paths.presence || config.autoload_paths).each do |load_path|
|
43
|
+
if @loaders.key?(load_path)
|
44
|
+
raise "Zeitwerk loader already added for `#{load_path}'. Please check your config"
|
45
|
+
end
|
46
|
+
|
47
|
+
next unless Dir.exist? load_path
|
48
|
+
|
49
|
+
loader = Zeitwerk::Loader.new
|
50
|
+
begin
|
51
|
+
loader.push_dir(load_path)
|
52
|
+
rescue Zeitwerk::Error
|
53
|
+
next
|
54
|
+
end
|
55
|
+
loader.enable_reloading if reloading_enabled?(load_path)
|
56
|
+
loader.ignore(File.join(load_path, "**", "*.js.rb"))
|
57
|
+
config.autoloader_collapsed_paths.each do |collapsed_path|
|
58
|
+
next unless collapsed_path.starts_with?(load_path)
|
59
|
+
|
60
|
+
loader.collapse(collapsed_path)
|
61
|
+
end
|
62
|
+
loader.on_unload(&method(:clear_descendants_for_reload)) # rubocop:disable Performance/MethodObjectAsBlock
|
63
|
+
Bridgetown::Hooks.trigger :loader, :pre_setup, loader, load_path
|
64
|
+
loader.setup
|
65
|
+
loader.eager_load if config.eager_load_paths.include?(load_path)
|
66
|
+
Bridgetown::Hooks.trigger :loader, :post_setup, loader, load_path
|
67
|
+
@loaders[load_path] = loader
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
def reload_loaders
|
72
|
+
@loaders.each do |load_path, loader|
|
73
|
+
next unless reloading_enabled?(load_path)
|
74
|
+
|
75
|
+
Bridgetown::Hooks.trigger :loader, :pre_reload, loader, load_path
|
76
|
+
loader.reload
|
77
|
+
loader.eager_load if config.eager_load_paths.include?(load_path)
|
78
|
+
Bridgetown::Hooks.trigger :loader, :post_reload, loader, load_path
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
82
|
+
end
|
83
|
+
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", &:
|
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", &:
|
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
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
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
|
@@ -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
|
-
*
|
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
|
-
|
61
|
-
|
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.
|
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
|
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.
|
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
|
-
|
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
|
data/lib/bridgetown-core.rb
CHANGED
data/lib/site_template/README.md
CHANGED
@@ -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.
|
19
|
+
- `>= 2.7`
|
20
20
|
- [Bridgetown Gem](https://rubygems.org/gems/bridgetown)
|
21
21
|
- `gem install bridgetown -N`
|
22
22
|
- [Node](https://nodejs.org)
|
data/lib/site_template/Rakefile
CHANGED
@@ -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.
|
4
|
+
version: 1.0.0.alpha10
|
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-
|
11
|
+
date: 2021-11-16 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
|
@@ -332,6 +332,20 @@ dependencies:
|
|
332
332
|
- - "~>"
|
333
333
|
- !ruby/object:Gem::Version
|
334
334
|
version: '1.7'
|
335
|
+
- !ruby/object:Gem::Dependency
|
336
|
+
name: zeitwerk
|
337
|
+
requirement: !ruby/object:Gem::Requirement
|
338
|
+
requirements:
|
339
|
+
- - "~>"
|
340
|
+
- !ruby/object:Gem::Version
|
341
|
+
version: '2.5'
|
342
|
+
type: :runtime
|
343
|
+
prerelease: false
|
344
|
+
version_requirements: !ruby/object:Gem::Requirement
|
345
|
+
requirements:
|
346
|
+
- - "~>"
|
347
|
+
- !ruby/object:Gem::Version
|
348
|
+
version: '2.5'
|
335
349
|
description: Bridgetown is a Webpack-aware, Ruby-powered static site generator for
|
336
350
|
the modern Jamstack era
|
337
351
|
email: maintainers@bridgetownrb.com
|
@@ -390,11 +404,21 @@ files:
|
|
390
404
|
- lib/bridgetown-core/configurations/.keep
|
391
405
|
- lib/bridgetown-core/configurations/bt-postcss.rb
|
392
406
|
- lib/bridgetown-core/configurations/bt-postcss/postcss.config.js
|
407
|
+
- lib/bridgetown-core/configurations/cypress.rb
|
408
|
+
- lib/bridgetown-core/configurations/cypress/cypress.json
|
409
|
+
- lib/bridgetown-core/configurations/cypress/cypress_dir/fixtures/example.json
|
410
|
+
- lib/bridgetown-core/configurations/cypress/cypress_dir/integration/navbar.spec.js
|
411
|
+
- lib/bridgetown-core/configurations/cypress/cypress_dir/plugins/index.js
|
412
|
+
- lib/bridgetown-core/configurations/cypress/cypress_dir/support/commands.js
|
413
|
+
- lib/bridgetown-core/configurations/cypress/cypress_dir/support/index.js
|
414
|
+
- lib/bridgetown-core/configurations/cypress/cypress_tasks
|
393
415
|
- lib/bridgetown-core/configurations/minitesting.rb
|
394
416
|
- lib/bridgetown-core/configurations/netlify.rb
|
395
417
|
- lib/bridgetown-core/configurations/netlify/netlify.sh
|
396
418
|
- lib/bridgetown-core/configurations/netlify/netlify.toml
|
397
419
|
- lib/bridgetown-core/configurations/purgecss.rb
|
420
|
+
- lib/bridgetown-core/configurations/render.rb
|
421
|
+
- lib/bridgetown-core/configurations/render/render.yaml.erb
|
398
422
|
- lib/bridgetown-core/configurations/stimulus.rb
|
399
423
|
- lib/bridgetown-core/configurations/swup.rb
|
400
424
|
- lib/bridgetown-core/configurations/tailwindcss.rb
|
@@ -408,6 +432,7 @@ files:
|
|
408
432
|
- lib/bridgetown-core/converters/markdown.rb
|
409
433
|
- lib/bridgetown-core/converters/markdown/kramdown_parser.rb
|
410
434
|
- lib/bridgetown-core/converters/ruby_templates.rb
|
435
|
+
- lib/bridgetown-core/converters/serbea_templates.rb
|
411
436
|
- lib/bridgetown-core/converters/smartypants.rb
|
412
437
|
- lib/bridgetown-core/core_ext/psych.rb
|
413
438
|
- lib/bridgetown-core/current.rb
|
@@ -488,6 +513,7 @@ files:
|
|
488
513
|
- lib/bridgetown-core/utils.rb
|
489
514
|
- lib/bridgetown-core/utils/ansi.rb
|
490
515
|
- lib/bridgetown-core/utils/aux.rb
|
516
|
+
- lib/bridgetown-core/utils/loaders_manager.rb
|
491
517
|
- lib/bridgetown-core/utils/require_gems.rb
|
492
518
|
- lib/bridgetown-core/utils/ruby_exec.rb
|
493
519
|
- lib/bridgetown-core/utils/ruby_front_matter.rb
|
@@ -542,12 +568,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
542
568
|
requirements:
|
543
569
|
- - ">="
|
544
570
|
- !ruby/object:Gem::Version
|
545
|
-
version: 2.
|
571
|
+
version: 2.7.0
|
546
572
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
547
573
|
requirements:
|
548
|
-
- - "
|
574
|
+
- - ">"
|
549
575
|
- !ruby/object:Gem::Version
|
550
|
-
version:
|
576
|
+
version: 1.3.1
|
551
577
|
requirements: []
|
552
578
|
rubygems_version: 3.1.4
|
553
579
|
signing_key:
|