locomotivecms_wagon 3.1.1 → 3.2.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/locomotive/wagon/cli.rb +1 -1
- data/lib/locomotive/wagon/commands/concerns/steam_concern.rb +0 -1
- data/lib/locomotive/wagon/commands/pull_sub_commands/concerns/assets_concern.rb +1 -1
- data/lib/locomotive/wagon/commands/pull_sub_commands/pull_base_command.rb +2 -2
- data/lib/locomotive/wagon/commands/pull_sub_commands/pull_content_entries_command.rb +1 -1
- data/lib/locomotive/wagon/commands/push_sub_commands/push_theme_assets_command.rb +8 -20
- data/lib/locomotive/wagon/commands/serve_command.rb +5 -5
- data/lib/locomotive/wagon/decorators/site_decorator.rb +1 -1
- data/lib/locomotive/wagon/generators/relationship.rb +2 -2
- data/lib/locomotive/wagon/generators/section.rb +2 -2
- data/lib/locomotive/wagon/generators/site.rb +1 -1
- data/lib/locomotive/wagon/version.rb +1 -1
- data/locomotivecms_wagon.gemspec +13 -10
- metadata +40 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0a9b567d83067dc20a30af98839354b7133485296ee5c1f5d1453e891cab362
|
4
|
+
data.tar.gz: 4885df5290423f696c3174f780fabe7080b9289ae0aadc63541eb0a15c14c162
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 387002c374963eab9f2614e4895b2f96f046fe8083d45809d645cb7a9643890d341397cb83af6a004728ebdfbb1211e5b0e4f206117d5419b15d28a3ca5071e5
|
7
|
+
data.tar.gz: c4a79a201524a74911233dc41169aef27cc15666b5aa5a3262c49fff1da6df63e29c88c1bac50195505d93d9ee72e4dc60e3c372c782e3bb17ad912e788109bd
|
data/lib/locomotive/wagon/cli.rb
CHANGED
@@ -21,7 +21,7 @@ module Locomotive
|
|
21
21
|
|
22
22
|
path = path == '.' ? Dir.pwd : File.expand_path(path)
|
23
23
|
|
24
|
-
site_or_deploy_file = File.
|
24
|
+
site_or_deploy_file = File.exist?(File.join(path, 'config', 'site.yml')) || File.exist?(File.join(path, 'config', 'deploy.yml'))
|
25
25
|
|
26
26
|
(site_or_deploy_file ? path : nil).tap do |_path|
|
27
27
|
if _path.nil?
|
@@ -11,7 +11,6 @@ module Locomotive::Wagon
|
|
11
11
|
config.mode = :test
|
12
12
|
config.adapter = { name: :filesystem, path: path, env: options[:env]&.to_sym || :local }
|
13
13
|
config.asset_path = File.expand_path(File.join(path, 'public'))
|
14
|
-
config.minify_assets = false
|
15
14
|
end
|
16
15
|
|
17
16
|
@steam_services = Locomotive::Steam::Services.build_instance.tap do |services|
|
@@ -50,7 +50,7 @@ module Locomotive::Wagon
|
|
50
50
|
private
|
51
51
|
|
52
52
|
def find_unique_filepath(filepath, binary_file, index = 1)
|
53
|
-
if File.
|
53
|
+
if File.exist?(filepath) && File.file?(filepath)
|
54
54
|
# required because we need to make sure we use the content of file from its start
|
55
55
|
binary_file.rewind
|
56
56
|
|
@@ -51,7 +51,7 @@ module Locomotive::Wagon
|
|
51
51
|
|
52
52
|
folder = File.dirname(_filepath)
|
53
53
|
|
54
|
-
FileUtils.mkdir_p(folder) unless File.
|
54
|
+
FileUtils.mkdir_p(folder) unless File.exist?(folder)
|
55
55
|
|
56
56
|
File.open(_filepath, mode) do |file|
|
57
57
|
if content
|
@@ -66,7 +66,7 @@ module Locomotive::Wagon
|
|
66
66
|
|
67
67
|
def reset_file(filepath)
|
68
68
|
_filepath = File.join(path, filepath)
|
69
|
-
FileUtils.rm(_filepath) if File.
|
69
|
+
FileUtils.rm(_filepath) if File.exist?(_filepath)
|
70
70
|
end
|
71
71
|
|
72
72
|
def instrument_base_name
|
@@ -67,7 +67,7 @@ module Locomotive::Wagon
|
|
67
67
|
locales.each do |locale|
|
68
68
|
next if locale != default_locale && content_type.localized_names.empty?
|
69
69
|
|
70
|
-
(_entries = api_client.content_entries(content_type).all(nil, { page: page, order_by: '
|
70
|
+
(_entries = api_client.content_entries(content_type).all(nil, { page: page, order_by: 'created_at asc' }, locale)).each do |entry|
|
71
71
|
(entries[entry._id] ||= {})[locale] = entry
|
72
72
|
end
|
73
73
|
|
@@ -4,8 +4,6 @@ module Locomotive::Wagon
|
|
4
4
|
|
5
5
|
class PushThemeAssetsCommand < PushBaseCommand
|
6
6
|
|
7
|
-
WEBPACK_BUNDLED_ASSETS = ['stylesheets/bundle.css', 'javascripts/bundle.js'].freeze
|
8
|
-
|
9
7
|
def entities
|
10
8
|
repositories.theme_asset.all.map do |entity|
|
11
9
|
next if skip?(entity)
|
@@ -42,7 +40,7 @@ module Locomotive::Wagon
|
|
42
40
|
return unless entity.stylesheet_or_javascript?
|
43
41
|
|
44
42
|
Tempfile.new(entity.realname).tap do |file|
|
45
|
-
content =
|
43
|
+
content = read_content(entity)
|
46
44
|
|
47
45
|
# replace paths to images or fonts by the absolute URL used in the Engine
|
48
46
|
content = replace_assets(content)
|
@@ -87,23 +85,13 @@ module Locomotive::Wagon
|
|
87
85
|
@remote_urls[resource.local_path] = "#{resource.url}?#{resource.checksum}"
|
88
86
|
end
|
89
87
|
|
90
|
-
def
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
rescue Exception => e
|
98
|
-
instrument :warning, message: "Unable to compress and minify it, error: #{e.message}"
|
99
|
-
# use the original file instead"
|
100
|
-
File.read(File.join(path, entity.source))
|
101
|
-
end
|
102
|
-
end
|
103
|
-
|
104
|
-
def sprockets_env
|
105
|
-
@sprockets_env ||= Locomotive::Steam::SprocketsEnvironment.new(File.join(path, 'public'),
|
106
|
-
minify: ENV['WAGON_NO_MINIFY_ASSETS'].present? ? false : true)
|
88
|
+
def read_content(entity)
|
89
|
+
File.read(
|
90
|
+
File.join(
|
91
|
+
Locomotive::Steam.configuration.asset_path,
|
92
|
+
entity.relative_url
|
93
|
+
)
|
94
|
+
)
|
107
95
|
end
|
108
96
|
|
109
97
|
def skip?(entity)
|
@@ -46,7 +46,7 @@ module Locomotive::Wagon
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def stop(force = false)
|
49
|
-
unless File.
|
49
|
+
unless File.exist?(server_pid_file)
|
50
50
|
shell.say "No Wagon server is running.", :red
|
51
51
|
return
|
52
52
|
end
|
@@ -76,7 +76,6 @@ module Locomotive::Wagon
|
|
76
76
|
config.mode = :test
|
77
77
|
config.adapter = { name: :filesystem, path: File.expand_path(path), env: options[:env]&.to_sym || :local }
|
78
78
|
config.asset_path = File.expand_path(File.join(path, 'public'))
|
79
|
-
config.minify_assets = false
|
80
79
|
|
81
80
|
config.middleware.insert_before Rack::Lint, Locomotive::Wagon::Middlewares::ErrorPage
|
82
81
|
|
@@ -108,9 +107,10 @@ module Locomotive::Wagon
|
|
108
107
|
end
|
109
108
|
|
110
109
|
def build_puma_server
|
110
|
+
require 'rackup'
|
111
111
|
require 'rack/handler/puma'
|
112
112
|
|
113
|
-
|
113
|
+
Rackup::Handler::Puma.run(Locomotive::Steam.to_app,
|
114
114
|
daemon: options[:daemonize],
|
115
115
|
pidfile: server_pid_file,
|
116
116
|
redirect_stdout: options[:daemonize] ? server_log_file : nil,
|
@@ -119,7 +119,7 @@ module Locomotive::Wagon
|
|
119
119
|
Port: options[:port],
|
120
120
|
Verbose: ENV['PUMA_DEBUG_ON'] || false,
|
121
121
|
Silent: true
|
122
|
-
|
122
|
+
)
|
123
123
|
end
|
124
124
|
|
125
125
|
def configure_logger
|
@@ -140,7 +140,7 @@ module Locomotive::Wagon
|
|
140
140
|
|
141
141
|
filepath = File.join(File.expand_path(path), 'app', 'views', 'pages', fullpath + (locale != default_locale ? ".#{locale}" : '') + '.liquid')
|
142
142
|
|
143
|
-
message = if File.
|
143
|
+
message = if File.exist?(filepath)
|
144
144
|
"[Warning]".red + ' by default and unless you override the slug in the YAML header of your page, Wagon will replace underscores by dashes in your page slug. Try this instead: ' + fullpath.dasherize.light_white
|
145
145
|
else
|
146
146
|
"[Tip]".light_white + " add a new page in your Wagon site at this location: " + filepath.light_white
|
@@ -17,11 +17,11 @@ module Locomotive
|
|
17
17
|
argument :target_path # path to the site
|
18
18
|
|
19
19
|
def content_types_must_exist
|
20
|
-
unless File.
|
20
|
+
unless File.exist?(File.join(destination_root, source_path))
|
21
21
|
fail Thor::Error, "The #{source} content type does not exist"
|
22
22
|
end
|
23
23
|
|
24
|
-
unless File.
|
24
|
+
unless File.exist?(File.join(destination_root, target_path))
|
25
25
|
fail Thor::Error, "The #{target} content type does not exist"
|
26
26
|
end
|
27
27
|
end
|
@@ -56,7 +56,7 @@ module Locomotive
|
|
56
56
|
end
|
57
57
|
|
58
58
|
def create_javascript_file
|
59
|
-
if File.
|
59
|
+
if File.exist?(sections_js_path)
|
60
60
|
js_class_name = @options[:type].classify
|
61
61
|
file_path = File.join(sections_js_path, @options[:type])
|
62
62
|
|
@@ -73,7 +73,7 @@ export { default as #{js_class_name} } from './#{@options[:type]}';
|
|
73
73
|
end
|
74
74
|
|
75
75
|
def create_stylesheet_file
|
76
|
-
if File.
|
76
|
+
if File.exist?(sections_css_path)
|
77
77
|
css_class_name = "#{@options[:type].dasherize}-section"
|
78
78
|
file_path = File.join(sections_css_path, @options[:type])
|
79
79
|
|
@@ -108,7 +108,7 @@ module Locomotive
|
|
108
108
|
name: template.name,
|
109
109
|
description: template.description,
|
110
110
|
path: path,
|
111
|
-
icon: icon && File.
|
111
|
+
icon: icon && File.exist?(icon) ? icon : nil,
|
112
112
|
options: class_options_to_json(template)
|
113
113
|
}
|
114
114
|
end.to_json
|
data/locomotivecms_wagon.gemspec
CHANGED
@@ -24,18 +24,21 @@ Gem::Specification.new do |gem|
|
|
24
24
|
|
25
25
|
gem.add_development_dependency 'rake', '~> 13.0.1'
|
26
26
|
|
27
|
-
gem.add_dependency 'thor', '~>
|
28
|
-
|
27
|
+
gem.add_dependency 'thor', '~> 1.3.0'
|
28
|
+
|
29
|
+
gem.add_dependency 'puma', '~> 6.4.0'
|
30
|
+
gem.add_dependency 'rackup', '~> 2.1.0'
|
31
|
+
|
29
32
|
gem.add_dependency 'netrc', '~> 0.11.0'
|
30
|
-
gem.add_dependency 'oj', '~> 3.
|
33
|
+
gem.add_dependency 'oj', '~> 3.16.1'
|
31
34
|
|
32
|
-
gem.add_dependency 'locomotivecms_common', '~> 0.
|
33
|
-
gem.add_dependency 'locomotivecms_coal', '~> 1.
|
34
|
-
gem.add_dependency 'locomotivecms_steam', '~> 1.
|
35
|
+
gem.add_dependency 'locomotivecms_common', '~> 0.6.0.alpha1'
|
36
|
+
gem.add_dependency 'locomotivecms_coal', '~> 1.8.0.alpha1'
|
37
|
+
gem.add_dependency 'locomotivecms_steam', '~> 1.8.0.alpha2'
|
35
38
|
|
36
|
-
gem.add_dependency 'haml', '~>
|
37
|
-
gem.add_dependency 'listen', '~> 3.
|
38
|
-
gem.add_dependency 'neatjson', '~> 0.
|
39
|
+
gem.add_dependency 'haml', '~> 6.2.3'
|
40
|
+
gem.add_dependency 'listen', '~> 3.8.0'
|
41
|
+
gem.add_dependency 'neatjson', '~> 0.10'
|
39
42
|
|
40
|
-
gem.add_dependency 'faker', '~>
|
43
|
+
gem.add_dependency 'faker', '~> 3.2'
|
41
44
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: locomotivecms_wagon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0.alpha2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Didier Lafforgue
|
8
8
|
- Rodrigo Alvarez
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2024-06-25 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -31,28 +31,42 @@ dependencies:
|
|
31
31
|
requirements:
|
32
32
|
- - "~>"
|
33
33
|
- !ruby/object:Gem::Version
|
34
|
-
version:
|
34
|
+
version: 1.3.0
|
35
35
|
type: :runtime
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
39
|
- - "~>"
|
40
40
|
- !ruby/object:Gem::Version
|
41
|
-
version:
|
41
|
+
version: 1.3.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: puma
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
46
|
- - "~>"
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version:
|
48
|
+
version: 6.4.0
|
49
49
|
type: :runtime
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - "~>"
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version:
|
55
|
+
version: 6.4.0
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rackup
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 2.1.0
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 2.1.0
|
56
70
|
- !ruby/object:Gem::Dependency
|
57
71
|
name: netrc
|
58
72
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,112 +87,112 @@ dependencies:
|
|
73
87
|
requirements:
|
74
88
|
- - "~>"
|
75
89
|
- !ruby/object:Gem::Version
|
76
|
-
version: 3.
|
90
|
+
version: 3.16.1
|
77
91
|
type: :runtime
|
78
92
|
prerelease: false
|
79
93
|
version_requirements: !ruby/object:Gem::Requirement
|
80
94
|
requirements:
|
81
95
|
- - "~>"
|
82
96
|
- !ruby/object:Gem::Version
|
83
|
-
version: 3.
|
97
|
+
version: 3.16.1
|
84
98
|
- !ruby/object:Gem::Dependency
|
85
99
|
name: locomotivecms_common
|
86
100
|
requirement: !ruby/object:Gem::Requirement
|
87
101
|
requirements:
|
88
102
|
- - "~>"
|
89
103
|
- !ruby/object:Gem::Version
|
90
|
-
version: 0.
|
104
|
+
version: 0.6.0.alpha1
|
91
105
|
type: :runtime
|
92
106
|
prerelease: false
|
93
107
|
version_requirements: !ruby/object:Gem::Requirement
|
94
108
|
requirements:
|
95
109
|
- - "~>"
|
96
110
|
- !ruby/object:Gem::Version
|
97
|
-
version: 0.
|
111
|
+
version: 0.6.0.alpha1
|
98
112
|
- !ruby/object:Gem::Dependency
|
99
113
|
name: locomotivecms_coal
|
100
114
|
requirement: !ruby/object:Gem::Requirement
|
101
115
|
requirements:
|
102
116
|
- - "~>"
|
103
117
|
- !ruby/object:Gem::Version
|
104
|
-
version: 1.
|
118
|
+
version: 1.8.0.alpha1
|
105
119
|
type: :runtime
|
106
120
|
prerelease: false
|
107
121
|
version_requirements: !ruby/object:Gem::Requirement
|
108
122
|
requirements:
|
109
123
|
- - "~>"
|
110
124
|
- !ruby/object:Gem::Version
|
111
|
-
version: 1.
|
125
|
+
version: 1.8.0.alpha1
|
112
126
|
- !ruby/object:Gem::Dependency
|
113
127
|
name: locomotivecms_steam
|
114
128
|
requirement: !ruby/object:Gem::Requirement
|
115
129
|
requirements:
|
116
130
|
- - "~>"
|
117
131
|
- !ruby/object:Gem::Version
|
118
|
-
version: 1.
|
132
|
+
version: 1.8.0.alpha2
|
119
133
|
type: :runtime
|
120
134
|
prerelease: false
|
121
135
|
version_requirements: !ruby/object:Gem::Requirement
|
122
136
|
requirements:
|
123
137
|
- - "~>"
|
124
138
|
- !ruby/object:Gem::Version
|
125
|
-
version: 1.
|
139
|
+
version: 1.8.0.alpha2
|
126
140
|
- !ruby/object:Gem::Dependency
|
127
141
|
name: haml
|
128
142
|
requirement: !ruby/object:Gem::Requirement
|
129
143
|
requirements:
|
130
144
|
- - "~>"
|
131
145
|
- !ruby/object:Gem::Version
|
132
|
-
version:
|
146
|
+
version: 6.2.3
|
133
147
|
type: :runtime
|
134
148
|
prerelease: false
|
135
149
|
version_requirements: !ruby/object:Gem::Requirement
|
136
150
|
requirements:
|
137
151
|
- - "~>"
|
138
152
|
- !ruby/object:Gem::Version
|
139
|
-
version:
|
153
|
+
version: 6.2.3
|
140
154
|
- !ruby/object:Gem::Dependency
|
141
155
|
name: listen
|
142
156
|
requirement: !ruby/object:Gem::Requirement
|
143
157
|
requirements:
|
144
158
|
- - "~>"
|
145
159
|
- !ruby/object:Gem::Version
|
146
|
-
version: 3.
|
160
|
+
version: 3.8.0
|
147
161
|
type: :runtime
|
148
162
|
prerelease: false
|
149
163
|
version_requirements: !ruby/object:Gem::Requirement
|
150
164
|
requirements:
|
151
165
|
- - "~>"
|
152
166
|
- !ruby/object:Gem::Version
|
153
|
-
version: 3.
|
167
|
+
version: 3.8.0
|
154
168
|
- !ruby/object:Gem::Dependency
|
155
169
|
name: neatjson
|
156
170
|
requirement: !ruby/object:Gem::Requirement
|
157
171
|
requirements:
|
158
172
|
- - "~>"
|
159
173
|
- !ruby/object:Gem::Version
|
160
|
-
version: '0.
|
174
|
+
version: '0.10'
|
161
175
|
type: :runtime
|
162
176
|
prerelease: false
|
163
177
|
version_requirements: !ruby/object:Gem::Requirement
|
164
178
|
requirements:
|
165
179
|
- - "~>"
|
166
180
|
- !ruby/object:Gem::Version
|
167
|
-
version: '0.
|
181
|
+
version: '0.10'
|
168
182
|
- !ruby/object:Gem::Dependency
|
169
183
|
name: faker
|
170
184
|
requirement: !ruby/object:Gem::Requirement
|
171
185
|
requirements:
|
172
186
|
- - "~>"
|
173
187
|
- !ruby/object:Gem::Version
|
174
|
-
version: '
|
188
|
+
version: '3.2'
|
175
189
|
type: :runtime
|
176
190
|
prerelease: false
|
177
191
|
version_requirements: !ruby/object:Gem::Requirement
|
178
192
|
requirements:
|
179
193
|
- - "~>"
|
180
194
|
- !ruby/object:Gem::Version
|
181
|
-
version: '
|
195
|
+
version: '3.2'
|
182
196
|
description: Wagon is a site generator for the LocomotiveCMS engine
|
183
197
|
email:
|
184
198
|
- did@locomotivecms.com
|
@@ -346,7 +360,7 @@ homepage: https://www.locomotivecms.com
|
|
346
360
|
licenses:
|
347
361
|
- MIT
|
348
362
|
metadata: {}
|
349
|
-
post_install_message:
|
363
|
+
post_install_message:
|
350
364
|
rdoc_options: []
|
351
365
|
require_paths:
|
352
366
|
- lib
|
@@ -361,8 +375,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
361
375
|
- !ruby/object:Gem::Version
|
362
376
|
version: '0'
|
363
377
|
requirements: []
|
364
|
-
rubygems_version: 3.
|
365
|
-
signing_key:
|
378
|
+
rubygems_version: 3.5.7
|
379
|
+
signing_key:
|
366
380
|
specification_version: 4
|
367
381
|
summary: Wagon is a site generator for the LocomotiveCMS engine powered by all the
|
368
382
|
efficient and modern HTML development tools (SASS, Webpack, ...etc).
|