sitepress-cli 5.0.0.beta → 5.0.0.beta1

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sitepress/cli.rb +26 -1
  3. metadata +3 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2b74952bd0858a3ba2d642dc8160756ace5783cff8bbd9cb101ae14995e258ff
4
- data.tar.gz: a1dba56adaa4323102b7ef7fc497536c590c6a0a02fc7f97580227d13b737339
3
+ metadata.gz: bf31d9c87fc8a37a6ab14dbf9257c9d46214dd3cdd9e65851de260f83678d2d3
4
+ data.tar.gz: 1275820f4e4a076d38bd75677e16622f6c5403245fe18890705079cc9b796ecb
5
5
  SHA512:
6
- metadata.gz: 020c5ce95d5132ed8cc841a16bf9b3c84a0caf7d477106c35dc12d449280a95311e51fce3727cd5c000281f3e40d0c03963ce7f00e99bc2fca88b81336d68fcc
7
- data.tar.gz: 9f0862cbc780d3fc60c36c181f8b4afa019a62a1e4cf256bb5c6019c42a0e2d01828b1f9014cc4f3bf339f1a8ff9b905c7e98666480c9a482f47fb536f68e006
6
+ metadata.gz: 579099d5acb5bd058993d54cfefca63d754cf87677bef40da7eac9774cc143ed073b0ed5b321cd263f35b7811c240760d1123c4fd07a96db4d18d1ea67b0ed03
7
+ data.tar.gz: c4ef3651327b8244460a679ab1781d3429cfb7d0d412fa219139a4c4889c5e6b7d25ae304341b018f4cea687e8c72239372fbff8d3a9024d1753452ab1fc4ffa
data/lib/sitepress/cli.rb CHANGED
@@ -1,5 +1,6 @@
1
1
  require "thor"
2
2
  require "rackup/server"
3
+ require "fileutils"
3
4
 
4
5
  module Sitepress
5
6
  # Command line interface for compiling Sitepress sites.
@@ -55,7 +56,7 @@ module Sitepress
55
56
  initialize!
56
57
 
57
58
  logger.info "Sitepress compiling assets"
58
- rails.assets.reveal(full_path: Pathname.new(options.fetch("output_path")).join("assets"))
59
+ compile_assets(Pathname.new(options.fetch("output_path")).join("assets"))
59
60
 
60
61
  logger.info "Sitepress compiling pages"
61
62
  compiler = Compiler::Files.new \
@@ -107,6 +108,30 @@ module Sitepress
107
108
  end
108
109
 
109
110
  private
111
+ def compile_assets(output_path)
112
+ assets = rails.assets
113
+
114
+ if defined?(Propshaft) && assets.is_a?(Propshaft::Assembly)
115
+ # Propshaft - create processor with our output path
116
+ FileUtils.mkdir_p(output_path)
117
+ processor = Propshaft::Processor.new(
118
+ load_path: assets.load_path,
119
+ output_path: output_path,
120
+ compilers: assets.compilers,
121
+ manifest_path: output_path.join(".manifest.json")
122
+ )
123
+ processor.process
124
+ elsif defined?(Sprockets) && assets.class.name.start_with?("Sprockets::")
125
+ # Sprockets - compile assets from precompile list
126
+ FileUtils.mkdir_p(output_path)
127
+ manifest = Sprockets::Manifest.new(assets, output_path)
128
+ precompile = rails.config.assets.precompile
129
+ manifest.compile(precompile)
130
+ else
131
+ logger.warn "Unknown asset pipeline, skipping asset compilation"
132
+ end
133
+ end
134
+
110
135
  def configuration
111
136
  Sitepress.configuration
112
137
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sitepress-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.beta
4
+ version: 5.0.0.beta1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brad Gessler
@@ -43,14 +43,14 @@ dependencies:
43
43
  requirements:
44
44
  - - '='
45
45
  - !ruby/object:Gem::Version
46
- version: 5.0.0.beta
46
+ version: 5.0.0.beta1
47
47
  type: :runtime
48
48
  prerelease: false
49
49
  version_requirements: !ruby/object:Gem::Requirement
50
50
  requirements:
51
51
  - - '='
52
52
  - !ruby/object:Gem::Version
53
- version: 5.0.0.beta
53
+ version: 5.0.0.beta1
54
54
  email:
55
55
  - bradgessler@gmail.com
56
56
  executables: []