panda-core 0.9.0 β 0.9.1
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/lib/panda/core/version.rb +1 -1
- data/lib/tasks/assets.rake +63 -82
- metadata +3 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 52d28416fc7360a3f5cc27ec2ad1f332a61426a8279853461dfe7398f180213a
|
|
4
|
+
data.tar.gz: f68cd0fbaf803d80a3549f67485328c80850e3d035d42f7c89eb1b15a80f6b64
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d71325c49673982b5ae74107eb7e05cb0bd04b12bc64262284392df691b142953fb6f5a25385c4795d605ec243e972ac30cd8688fb4e7f95ebc43e360b7ba5e1
|
|
7
|
+
data.tar.gz: b0391beb484a72298375547b4d526e73ce47ea18a1d73864e6e2ef226e25fef961d83c268a5cdab12b5dbc1c08c984696f344bfe0e974d0e9c1a37badafdb035
|
data/lib/panda/core/version.rb
CHANGED
data/lib/tasks/assets.rake
CHANGED
|
@@ -3,154 +3,136 @@
|
|
|
3
3
|
#
|
|
4
4
|
# Panda Core Asset Tasks
|
|
5
5
|
#
|
|
6
|
-
# This file contains BOTH:
|
|
7
|
-
# 1. Engine-level CSS compilation (existing functionality)
|
|
8
|
-
# 2. Dummy-app asset preparation for system tests (new)
|
|
9
|
-
#
|
|
10
|
-
# These tasks are used by:
|
|
11
|
-
# - engine developers running local dev
|
|
12
|
-
# - panda-cms CI preparing dummy app
|
|
13
|
-
# - system specs that depend on Propshaft + Importmap + Cuprite
|
|
14
|
-
#
|
|
15
6
|
|
|
16
7
|
namespace :panda do
|
|
17
8
|
namespace :core do
|
|
18
9
|
namespace :assets do
|
|
19
|
-
#
|
|
20
|
-
#
|
|
21
|
-
#
|
|
10
|
+
# =========================================================
|
|
11
|
+
# 1) ENGINE CSS COMPILATION (unchanged, just cleaned)
|
|
12
|
+
# =========================================================
|
|
22
13
|
|
|
23
|
-
desc "Compile Panda Core assets
|
|
14
|
+
desc "Compile Panda Core CSS assets (development mode)"
|
|
24
15
|
task :compile do
|
|
25
|
-
puts "πΌ Compiling Panda Core CSS assets
|
|
16
|
+
puts "πΌ Compiling Panda Core CSS assets..."
|
|
26
17
|
|
|
27
18
|
output_dir = panda_engine_root.join("public", "panda-core-assets")
|
|
28
19
|
FileUtils.mkdir_p(output_dir)
|
|
29
20
|
|
|
30
21
|
compile_css_development(output_dir)
|
|
31
22
|
|
|
32
|
-
puts "π
|
|
33
|
-
puts "π Output directory: #{output_dir}"
|
|
34
|
-
puts ""
|
|
23
|
+
puts "π CSS compiled β #{output_dir}"
|
|
35
24
|
end
|
|
36
25
|
|
|
37
26
|
desc "Compile and version Panda Core CSS assets for release"
|
|
38
27
|
task :release do
|
|
39
|
-
puts "πΌ Compiling Panda Core CSS assets for release..."
|
|
40
|
-
|
|
41
28
|
require_relative "../../panda/core/version"
|
|
42
|
-
version = Panda::Core::VERSION
|
|
43
29
|
|
|
30
|
+
version = Panda::Core::VERSION
|
|
44
31
|
output_dir = panda_engine_root.join("public", "panda-core-assets")
|
|
45
32
|
FileUtils.mkdir_p(output_dir)
|
|
46
33
|
|
|
47
34
|
compile_css_release(output_dir, version)
|
|
48
35
|
|
|
49
|
-
puts "π Release
|
|
50
|
-
puts "π Output directory: #{output_dir}"
|
|
51
|
-
puts "π¦ Versioned: panda-core-#{version}.css"
|
|
36
|
+
puts "π Release assets compiled"
|
|
52
37
|
end
|
|
53
38
|
|
|
54
|
-
#
|
|
55
|
-
#
|
|
56
|
-
#
|
|
39
|
+
# =========================================================
|
|
40
|
+
# CSS INTERNAL HELPERS
|
|
41
|
+
# =========================================================
|
|
57
42
|
|
|
58
43
|
def panda_engine_root
|
|
59
44
|
Panda::Core::Engine.root
|
|
60
45
|
end
|
|
61
46
|
|
|
62
47
|
def compile_css_development(output_dir)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
output_file = output_dir.join("panda-core.css")
|
|
66
|
-
|
|
67
|
-
content_paths = Panda::Core::ModuleRegistry.tailwind_content_paths
|
|
68
|
-
content_flags = content_paths.map { |p| "--content '#{p}'" }.join(" ")
|
|
48
|
+
input = panda_engine_root.join("app/assets/tailwind/application.css")
|
|
49
|
+
output = output_dir.join("panda-core.css")
|
|
69
50
|
|
|
70
|
-
|
|
51
|
+
content = Panda::Core::ModuleRegistry.tailwind_content_paths
|
|
52
|
+
flags = content.map { |p| "--content '#{p}'" }.join(" ")
|
|
71
53
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
end
|
|
54
|
+
cmd = "bundle exec tailwindcss -i #{input} -o #{output} #{flags} --minify"
|
|
55
|
+
abort("β CSS compile failed") unless system(cmd)
|
|
75
56
|
|
|
76
|
-
puts "
|
|
57
|
+
puts " β #{output.basename} (#{File.size(output)} bytes)"
|
|
77
58
|
end
|
|
78
59
|
|
|
79
60
|
def compile_css_release(output_dir, version)
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
versioned_file = output_dir.join("panda-core-#{version}.css")
|
|
61
|
+
input = panda_engine_root.join("app/assets/tailwind/application.css")
|
|
62
|
+
file = output_dir.join("panda-core-#{version}.css")
|
|
83
63
|
|
|
84
|
-
|
|
85
|
-
|
|
64
|
+
content = Panda::Core::ModuleRegistry.tailwind_content_paths
|
|
65
|
+
flags = content.map { |p| "--content '#{p}'" }.join(" ")
|
|
86
66
|
|
|
87
|
-
cmd = "bundle exec tailwindcss -i #{
|
|
88
|
-
|
|
89
|
-
unless system(cmd)
|
|
90
|
-
abort("β CSS compilation failed")
|
|
91
|
-
end
|
|
67
|
+
cmd = "bundle exec tailwindcss -i #{input} -o #{file} #{flags} --minify"
|
|
68
|
+
abort("β CSS release compile failed") unless system(cmd)
|
|
92
69
|
|
|
93
70
|
symlink = output_dir.join("panda-core.css")
|
|
94
71
|
FileUtils.rm_f(symlink)
|
|
95
|
-
FileUtils.ln_sf(
|
|
72
|
+
FileUtils.ln_sf(file.basename, symlink)
|
|
96
73
|
|
|
97
|
-
puts "
|
|
74
|
+
puts " β Versioned file + symlink created"
|
|
98
75
|
end
|
|
99
76
|
|
|
100
|
-
#
|
|
101
|
-
#
|
|
102
|
-
#
|
|
77
|
+
# =========================================================
|
|
78
|
+
# 2) DUMMY APP PREP (FOR SYSTEM TESTS + CI)
|
|
79
|
+
# =========================================================
|
|
103
80
|
|
|
104
|
-
desc "Compile Panda Core +
|
|
81
|
+
desc "Compile Panda Core + dummy app assets into spec/dummy/public/assets"
|
|
105
82
|
task compile_dummy: :environment do
|
|
106
83
|
dummy_root = find_dummy_root
|
|
107
84
|
assets_root = dummy_root.join("public/assets")
|
|
108
85
|
|
|
109
|
-
puts "π§ Compiling
|
|
110
|
-
puts "
|
|
111
|
-
|
|
86
|
+
puts "π§ Compiling dummy assets..."
|
|
87
|
+
puts " β #{assets_root}"
|
|
112
88
|
FileUtils.mkdir_p(assets_root)
|
|
113
89
|
|
|
114
90
|
Dir.chdir(dummy_root) do
|
|
115
|
-
#
|
|
116
|
-
unless system("bundle exec rake
|
|
117
|
-
abort("β
|
|
91
|
+
# IMPORTANT: this is now the correct task name
|
|
92
|
+
unless system("bundle exec rake panda:core:assets:compile")
|
|
93
|
+
abort("β panda:core:assets:compile failed in dummy app")
|
|
118
94
|
end
|
|
95
|
+
|
|
96
|
+
# Propshaft (Rails 8)
|
|
97
|
+
abort("β assets:precompile failed") \
|
|
98
|
+
unless system("bundle exec rake assets:precompile RAILS_ENV=#{Rails.env}")
|
|
119
99
|
end
|
|
120
100
|
|
|
121
101
|
puts "β
Dummy assets compiled"
|
|
122
102
|
end
|
|
123
103
|
|
|
124
|
-
desc "Generate importmap.json for
|
|
104
|
+
desc "Generate importmap.json for the dummy app"
|
|
125
105
|
task generate_dummy_importmap: :environment do
|
|
126
106
|
dummy_root = find_dummy_root
|
|
127
|
-
|
|
107
|
+
output = dummy_root.join("public/assets/importmap.json")
|
|
128
108
|
|
|
129
|
-
puts "πΊοΈ
|
|
130
|
-
FileUtils.mkdir_p(
|
|
109
|
+
puts "πΊοΈ Generating importmap.json..."
|
|
110
|
+
FileUtils.mkdir_p(output.dirname)
|
|
131
111
|
|
|
132
112
|
Dir.chdir(dummy_root) do
|
|
133
|
-
|
|
134
|
-
|
|
113
|
+
json = Rails.application.importmap.to_json(
|
|
114
|
+
resolver: ActionController::Base.helpers
|
|
115
|
+
)
|
|
116
|
+
File.write(output, JSON.pretty_generate(json))
|
|
135
117
|
end
|
|
136
118
|
|
|
137
|
-
puts "
|
|
119
|
+
puts " β importmap.json written"
|
|
138
120
|
end
|
|
139
121
|
|
|
140
|
-
desc "Verify dummy
|
|
122
|
+
desc "Verify dummy assets for CI (fail-fast)"
|
|
141
123
|
task verify_dummy: :environment do
|
|
142
124
|
dummy_root = find_dummy_root
|
|
143
|
-
|
|
144
|
-
manifest =
|
|
145
|
-
importmap =
|
|
125
|
+
assets = dummy_root.join("public/assets")
|
|
126
|
+
manifest = assets.join(".manifest.json")
|
|
127
|
+
importmap = assets.join("importmap.json")
|
|
146
128
|
|
|
147
|
-
abort("β Missing
|
|
148
|
-
abort("β Missing #{manifest}") unless
|
|
149
|
-
abort("β Missing #{importmap}") unless
|
|
129
|
+
abort("β Missing #{assets}") unless assets.exist?
|
|
130
|
+
abort("β Missing #{manifest}") unless manifest.exist?
|
|
131
|
+
abort("β Missing #{importmap}") unless importmap.exist?
|
|
150
132
|
|
|
151
133
|
begin
|
|
152
134
|
parsed = JSON.parse(File.read(manifest))
|
|
153
|
-
abort("β Empty manifest
|
|
135
|
+
abort("β Empty .manifest.json") if parsed.empty?
|
|
154
136
|
rescue
|
|
155
137
|
abort("β Invalid .manifest.json")
|
|
156
138
|
end
|
|
@@ -158,20 +140,19 @@ namespace :panda do
|
|
|
158
140
|
puts "β
Dummy assets verified"
|
|
159
141
|
end
|
|
160
142
|
|
|
161
|
-
#
|
|
162
|
-
#
|
|
163
|
-
#
|
|
143
|
+
# =========================================================
|
|
144
|
+
# INTERNAL UTILITIES
|
|
145
|
+
# =========================================================
|
|
164
146
|
|
|
165
147
|
def find_dummy_root
|
|
166
148
|
root = Rails.root
|
|
149
|
+
|
|
167
150
|
return root if root.basename.to_s == "dummy"
|
|
168
151
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
possible = root.join("spec/dummy")
|
|
172
|
-
return possible if possible.exist?
|
|
152
|
+
candidate = root.join("spec/dummy")
|
|
153
|
+
return candidate if candidate.exist?
|
|
173
154
|
|
|
174
|
-
abort("β Cannot find dummy root
|
|
155
|
+
abort("β Cannot find dummy root β expected #{candidate}")
|
|
175
156
|
end
|
|
176
157
|
end
|
|
177
158
|
end
|
metadata
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: panda-core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.9.
|
|
4
|
+
version: 0.9.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Otaina Limited
|
|
8
8
|
- James Inman
|
|
9
|
-
autorequire:
|
|
10
9
|
bindir: bin
|
|
11
10
|
cert_chain: []
|
|
12
|
-
date:
|
|
11
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
13
12
|
dependencies:
|
|
14
13
|
- !ruby/object:Gem::Dependency
|
|
15
14
|
name: image_processing
|
|
@@ -527,7 +526,6 @@ metadata:
|
|
|
527
526
|
homepage_uri: https://github.com/tastybamboo/panda-core
|
|
528
527
|
source_code_uri: https://github.com/tastybamboo/panda-core
|
|
529
528
|
changelog_uri: https://github.com/tastybamboo/panda-core/blob/main/CHANGELOG.md
|
|
530
|
-
post_install_message:
|
|
531
529
|
rdoc_options: []
|
|
532
530
|
require_paths:
|
|
533
531
|
- lib
|
|
@@ -542,8 +540,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
542
540
|
- !ruby/object:Gem::Version
|
|
543
541
|
version: '0'
|
|
544
542
|
requirements: []
|
|
545
|
-
rubygems_version: 3.
|
|
546
|
-
signing_key:
|
|
543
|
+
rubygems_version: 3.6.9
|
|
547
544
|
specification_version: 4
|
|
548
545
|
summary: Core libraries and development tools for Tasty Bamboo projects
|
|
549
546
|
test_files: []
|