bridgetown-core 0.10.1 → 0.10.2
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1e97f803a7a5d0bbe98ccb9a14cc2dc4054b4fec9f0803f5dd030e5d5812ce72
|
4
|
+
data.tar.gz: 7cec8b571520772cd25e87a75555d3f988e9d81b33181545ce93fbd294a0d99c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e75fb63ae6d579080f70d8664a8a1accb035e6da4953982079873d152f0baf0dcfc7de193c1eff1cc5ac135388e39712557e6b38338d950e2f8e0d5067c204e
|
7
|
+
data.tar.gz: 743fb5560819f0849c4d8c137568f7500389e46b1918e9c86f4d18a08c34a13f793c7b39402991f616f1a6ff0271df3e7b41596d47a3e37a5d766c254b1fb59c
|
@@ -26,6 +26,7 @@ module Bridgetown
|
|
26
26
|
|
27
27
|
Bundler.setup
|
28
28
|
required_gems = Bundler.require(:bridgetown_plugins)
|
29
|
+
install_yarn_dependencies(required_gems)
|
29
30
|
message = "Required #{required_gems.map(&:name).join(", ")}"
|
30
31
|
Bridgetown.logger.debug("PluginManager:", message)
|
31
32
|
ENV["BRIDGETOWN_NO_BUNDLER_REQUIRE"] = "true"
|
@@ -36,6 +37,31 @@ module Bridgetown
|
|
36
37
|
end
|
37
38
|
end
|
38
39
|
|
40
|
+
# Iterates through loaded plugins and finds yard-add gemspec metadata.
|
41
|
+
# If that exact package hasn't been installed, execute yarn add
|
42
|
+
#
|
43
|
+
# Returns nothing.
|
44
|
+
def self.install_yarn_dependencies(required_gems)
|
45
|
+
return unless File.exist?("package.json")
|
46
|
+
|
47
|
+
package_json = JSON.parse(File.read("package.json"))
|
48
|
+
|
49
|
+
required_gems.each do |loaded_gem|
|
50
|
+
next unless loaded_gem.to_spec&.metadata&.dig("yarn-add")
|
51
|
+
|
52
|
+
yarn_add_dependency = loaded_gem.to_spec.metadata["yarn-add"].split("@")
|
53
|
+
next unless yarn_add_dependency.length == 2
|
54
|
+
|
55
|
+
# check matching version number is see if it's already installed
|
56
|
+
current_package = package_json["dependencies"].dig(yarn_add_dependency.first)
|
57
|
+
next unless current_package.nil? || current_package != yarn_add_dependency.last
|
58
|
+
|
59
|
+
# all right, time to install the package
|
60
|
+
cmd = "yarn add #{yarn_add_dependency.join("@")}"
|
61
|
+
system cmd
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
39
65
|
# Require all .rb files
|
40
66
|
#
|
41
67
|
# Returns nothing.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<meta charset="utf-8" />
|
2
2
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
3
3
|
{% capture page_title %}{{ page.title | strip_html | strip_newlines }}{% endcapture %}
|
4
|
-
<title>{% if page_title != "" %}{{ page_title | escape }} | {{ site.metadata.title | escape }}{% else %}{{ site
|
4
|
+
<title>{% if page_title != "" %}{{ page_title | escape }} | {{ site.metadata.title | escape }}{% else %}{{ site.metadata.title | escape }}: {{ site.metadata.tagline | escape }}{% endif %}</title>
|
5
5
|
|
6
6
|
<meta name="description" content="{{ site.metadata.description }}" />
|
7
7
|
|
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: 0.10.
|
4
|
+
version: 0.10.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bridgetown Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|