bridgetown-core 2.1.0.beta1 → 2.1.0.beta2
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/.rubocop.yml +0 -1
- data/lib/bridgetown-core/configurations/is-land.rb +0 -1
- data/lib/bridgetown-core/front_matter/ruby.rb +2 -0
- data/lib/bridgetown-core/rack/routes.rb +15 -12
- data/lib/bridgetown-core/readers/plugin_content_reader.rb +2 -2
- data/lib/bridgetown-core/utils/initializers.rb +4 -1
- metadata +3 -6
- data/lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb +0 -9
- data/lib/bridgetown-core/configurations/ruby2js/ruby2js.rb +0 -10
- data/lib/bridgetown-core/configurations/ruby2js.rb +0 -39
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f895d51e27a507afdcb11da40c28ac1d39f2aa63992c8cc3e0fe70234624054
|
|
4
|
+
data.tar.gz: d7cfd9665c5df7bea956e474eaf09bcd2e2c01a7a3f13614998837293ed0bf34
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e6963b721efce454a663b32d3d866a83f3f8e34675f4be92342c3200198fcdeb2ea122f34af67aa14227fc5048b99f0ecfaaf867c2da2b2ad7e794456db858a1
|
|
7
|
+
data.tar.gz: 5ed2af1ac5a40dda08ce53742797106da1b8ed710c59a1aaa3f2c6469f4735faa2ba0a2e89631fca710d431dd477a107f38ac0c530be8f097d5d08fd3e1de8fd
|
data/.rubocop.yml
CHANGED
|
@@ -14,7 +14,7 @@ module Bridgetown
|
|
|
14
14
|
}.freeze
|
|
15
15
|
|
|
16
16
|
class << self
|
|
17
|
-
# rubocop:disable Bridgetown/NoPutsAllowed, Metrics
|
|
17
|
+
# rubocop:disable Bridgetown/NoPutsAllowed, Metrics
|
|
18
18
|
def print_routes
|
|
19
19
|
# TODO: this needs to be fully documented
|
|
20
20
|
routes = begin
|
|
@@ -26,24 +26,27 @@ module Bridgetown
|
|
|
26
26
|
rescue StandardError
|
|
27
27
|
[]
|
|
28
28
|
end
|
|
29
|
+
|
|
30
|
+
puts "Routes:".bold.green
|
|
29
31
|
puts
|
|
30
|
-
|
|
31
|
-
puts "=======\n"
|
|
32
|
+
|
|
32
33
|
if routes.empty?
|
|
33
34
|
puts "No routes found. Have you commented all of your routes?"
|
|
34
|
-
puts "Documentation: https://github.com/jeremyevans/roda-route_list#
|
|
35
|
+
puts "Documentation: https://github.com/jeremyevans/roda-route_list#label-Basic+Usage"
|
|
35
36
|
end
|
|
36
37
|
|
|
37
|
-
routes.each do |
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
routes.group_by { _1["file"] }.each do |file, file_routes|
|
|
39
|
+
file_routes.each_with_index do |route, index|
|
|
40
|
+
puts [
|
|
41
|
+
(route["methods"]&.join("|") || "GET").cyan,
|
|
42
|
+
route["path"],
|
|
43
|
+
file && index == file_routes.length - 1 ? "\n #{"File:".yellow} #{file}" : nil,
|
|
44
|
+
].compact.join(" ")
|
|
45
|
+
end
|
|
46
|
+
puts
|
|
43
47
|
end
|
|
44
|
-
puts
|
|
45
48
|
end
|
|
46
|
-
# rubocop:enable Bridgetown/NoPutsAllowed, Metrics
|
|
49
|
+
# rubocop:enable Bridgetown/NoPutsAllowed, Metrics
|
|
47
50
|
|
|
48
51
|
# @return [Proc]
|
|
49
52
|
attr_accessor :router_block
|
|
@@ -5,11 +5,11 @@ module Bridgetown
|
|
|
5
5
|
attr_reader :site, :manifest, :content_dirs
|
|
6
6
|
|
|
7
7
|
# @param site [Bridgetown::Site]
|
|
8
|
-
# @param manifest [Bridgetown::
|
|
8
|
+
# @param manifest [Bridgetown::Configuration::SourceManifest]
|
|
9
9
|
def initialize(site, manifest)
|
|
10
10
|
@site = site
|
|
11
11
|
@manifest = manifest
|
|
12
|
-
@content_dirs = manifest.contents
|
|
12
|
+
@content_dirs = manifest.contents || {}
|
|
13
13
|
@content_files = Set.new
|
|
14
14
|
@supports_bare_text = manifest.bare_text
|
|
15
15
|
@bare_text_extensions = site.config.markdown_ext.split(",").map { ".#{_1}" } + [".html"]
|
|
@@ -40,10 +40,13 @@ end
|
|
|
40
40
|
Bridgetown.initializer :parse_routes do |config|
|
|
41
41
|
# This builds upon the work done here:
|
|
42
42
|
# https://github.com/jeremyevans/roda-route_list/blob/master/bin/roda-parse_routes
|
|
43
|
+
config.roda do |app|
|
|
44
|
+
app.plugin :route_list, file: ".routes.json"
|
|
45
|
+
end
|
|
43
46
|
|
|
44
47
|
require "roda-route_parser"
|
|
45
48
|
|
|
46
|
-
route_files = Dir["#{config.root_dir}
|
|
49
|
+
route_files = Dir["#{config.root_dir}/#{config.server_dir}/**/*.rb"]
|
|
47
50
|
if config.key?(:routes)
|
|
48
51
|
config.routes.source_paths.each do |routes_dir|
|
|
49
52
|
routes_dir = File.expand_path(routes_dir, config.source)
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: bridgetown-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.1.0.
|
|
4
|
+
version: 2.1.0.beta2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Bridgetown Team
|
|
@@ -71,14 +71,14 @@ dependencies:
|
|
|
71
71
|
requirements:
|
|
72
72
|
- - '='
|
|
73
73
|
- !ruby/object:Gem::Version
|
|
74
|
-
version: 2.1.0.
|
|
74
|
+
version: 2.1.0.beta2
|
|
75
75
|
type: :runtime
|
|
76
76
|
prerelease: false
|
|
77
77
|
version_requirements: !ruby/object:Gem::Requirement
|
|
78
78
|
requirements:
|
|
79
79
|
- - '='
|
|
80
80
|
- !ruby/object:Gem::Version
|
|
81
|
-
version: 2.1.0.
|
|
81
|
+
version: 2.1.0.beta2
|
|
82
82
|
- !ruby/object:Gem::Dependency
|
|
83
83
|
name: csv
|
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -501,9 +501,6 @@ files:
|
|
|
501
501
|
- lib/bridgetown-core/configurations/purgecss.rb
|
|
502
502
|
- lib/bridgetown-core/configurations/render.rb
|
|
503
503
|
- lib/bridgetown-core/configurations/render/render.yaml.erb
|
|
504
|
-
- lib/bridgetown-core/configurations/ruby2js.rb
|
|
505
|
-
- lib/bridgetown-core/configurations/ruby2js/hello_world.js.rb
|
|
506
|
-
- lib/bridgetown-core/configurations/ruby2js/ruby2js.rb
|
|
507
504
|
- lib/bridgetown-core/configurations/seo.rb
|
|
508
505
|
- lib/bridgetown-core/configurations/shoelace.rb
|
|
509
506
|
- lib/bridgetown-core/configurations/tailwindcss.rb
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
class HelloWorld < HTMLElement
|
|
2
|
-
def connected_callback()
|
|
3
|
-
self.inner_html = "<p><strong>Hello World!</strong></p>"
|
|
4
|
-
end
|
|
5
|
-
end
|
|
6
|
-
|
|
7
|
-
# Try adding `<hello-world></hello-world>` somewhere on your site to see this
|
|
8
|
-
# example web component in action!
|
|
9
|
-
custom_elements.define "hello-world", HelloWorld
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
unless Bridgetown::Utils.frontend_bundler_type == :esbuild
|
|
4
|
-
error_message = "#{"esbuild.config.js".bold} not found. (This configuration doesn't currently " \
|
|
5
|
-
"support Webpack.)"
|
|
6
|
-
|
|
7
|
-
@logger.error "\nError:".red, "🚨 #{error_message}"
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
end
|
|
11
|
-
|
|
12
|
-
say_status :ruby2js, "Installing Ruby2JS..."
|
|
13
|
-
|
|
14
|
-
add_gem "ruby2js"
|
|
15
|
-
add_npm_package "-D @ruby2js/esbuild-plugin"
|
|
16
|
-
|
|
17
|
-
insert_into_file "esbuild.config.js",
|
|
18
|
-
after: 'const build = require("./config/esbuild.defaults.js")' do
|
|
19
|
-
<<~JS
|
|
20
|
-
|
|
21
|
-
const ruby2js = require("@ruby2js/esbuild-plugin")
|
|
22
|
-
JS
|
|
23
|
-
end
|
|
24
|
-
|
|
25
|
-
insert_into_file "esbuild.config.js",
|
|
26
|
-
after: "\n plugins: [\n" do
|
|
27
|
-
<<-JS
|
|
28
|
-
ruby2js(),
|
|
29
|
-
JS
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
copy_file in_templates_dir("ruby2js.rb"), "config/ruby2js.rb"
|
|
33
|
-
copy_file in_templates_dir("hello_world.js.rb"), "src/_components/hello_world.js.rb"
|
|
34
|
-
|
|
35
|
-
say_status :ruby2js, "Ruby2JS is now configured!"
|
|
36
|
-
|
|
37
|
-
say "Check out the example `hello_world.js.rb` file in `src/_components`", :blue
|
|
38
|
-
say "Ruby2JS configuration options are saved in `config/ruby2js.rb`", :blue
|
|
39
|
-
say 'For further reading, check out "https://www.ruby2js.com"', :blue
|