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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09a8389d14bf25a5ebc6d546d1b3857b3515166393f9f5c9ba424337932b7ea5'
4
- data.tar.gz: 406ab4fe14528cf664fcffaa8a371348bb71b91a68797db02002eee69d20d8f9
3
+ metadata.gz: 52d28416fc7360a3f5cc27ec2ad1f332a61426a8279853461dfe7398f180213a
4
+ data.tar.gz: f68cd0fbaf803d80a3549f67485328c80850e3d035d42f7c89eb1b15a80f6b64
5
5
  SHA512:
6
- metadata.gz: 663c29fcfcb8e35cb7c4c8029ab242eae56421964bb9e9acc74b6d1c1f04d5e8ae9d4bb426349f5fec6c1df5f258047c490ba85ef5f8fc4fe429689b8538dc02
7
- data.tar.gz: 22012fde38aaea3b480b31b1063515c079cc90c71e5e4a8a80428aafac457fac1a629c8b102076939bf4124ef026ae626e296d6b23b4d170b73974a62ee956bc
6
+ metadata.gz: d71325c49673982b5ae74107eb7e05cb0bd04b12bc64262284392df691b142953fb6f5a25385c4795d605ec243e972ac30cd8688fb4e7f95ebc43e360b7ba5e1
7
+ data.tar.gz: b0391beb484a72298375547b4d526e73ce47ea18a1d73864e6e2ef226e25fef961d83c268a5cdab12b5dbc1c08c984696f344bfe0e974d0e9c1a37badafdb035
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Panda
4
4
  module Core
5
- VERSION = "0.9.0"
5
+ VERSION = "0.9.1"
6
6
  end
7
7
  end
@@ -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
- # 🐼 1. EXISTING TASKS β€” ENGINE CSS COMPILATION
21
- # --------------------------------------------------------------------------
10
+ # =========================================================
11
+ # 1) ENGINE CSS COMPILATION (unchanged, just cleaned)
12
+ # =========================================================
22
13
 
23
- desc "Compile Panda Core assets for development (overwrites panda-core.css)"
14
+ desc "Compile Panda Core CSS assets (development mode)"
24
15
  task :compile do
25
- puts "🐼 Compiling Panda Core CSS assets (development mode)..."
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 "πŸŽ‰ Asset compilation complete!"
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 asset compilation complete!"
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
- # 🧩 INTERNAL HELPERS (CSS)
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
- engine_root = panda_engine_root
64
- input_file = engine_root.join("app/assets/tailwind/application.css")
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
- cmd = "bundle exec tailwindcss -i #{input_file} -o #{output_file} #{content_flags} --minify"
51
+ content = Panda::Core::ModuleRegistry.tailwind_content_paths
52
+ flags = content.map { |p| "--content '#{p}'" }.join(" ")
71
53
 
72
- unless system(cmd)
73
- abort("❌ CSS compilation failed")
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 "βœ… CSS compiled: #{output_file} (#{File.size(output_file)} bytes)"
57
+ puts " βœ“ #{output.basename} (#{File.size(output)} bytes)"
77
58
  end
78
59
 
79
60
  def compile_css_release(output_dir, version)
80
- engine_root = panda_engine_root
81
- input_file = engine_root.join("app/assets/tailwind/application.css")
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
- content_paths = Panda::Core::ModuleRegistry.tailwind_content_paths
85
- content_flags = content_paths.map { |p| "--content '#{p}'" }.join(" ")
64
+ content = Panda::Core::ModuleRegistry.tailwind_content_paths
65
+ flags = content.map { |p| "--content '#{p}'" }.join(" ")
86
66
 
87
- cmd = "bundle exec tailwindcss -i #{input_file} -o #{versioned_file} #{content_flags} --minify"
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(File.basename(versioned_file), symlink)
72
+ FileUtils.ln_sf(file.basename, symlink)
96
73
 
97
- puts "βœ… Release CSS compiled + symlink generated"
74
+ puts " βœ“ Versioned file + symlink created"
98
75
  end
99
76
 
100
- # --------------------------------------------------------------------------
101
- # πŸš‚ 2. NEW TASKS β€” DUMMY APP ASSET PREPARATION (FOR CI + SYSTEM TESTS)
102
- # --------------------------------------------------------------------------
77
+ # =========================================================
78
+ # 2) DUMMY APP PREP (FOR SYSTEM TESTS + CI)
79
+ # =========================================================
103
80
 
104
- desc "Compile Panda Core + host app assets into spec/dummy/public/assets (CI)"
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 assets into dummy app:"
110
- puts "πŸ‘‰ #{assets_root}"
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
- # Runs the engine's asset compile pipeline in the dummy app context
116
- unless system("bundle exec rake app:panda:core:assets:compile")
117
- abort("❌ Failed to compile Panda Core assets in dummy app")
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 Rails 8 dummy app"
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
- importmap_out = dummy_root.join("public/assets/importmap.json")
107
+ output = dummy_root.join("public/assets/importmap.json")
128
108
 
129
- puts "πŸ—ΊοΈ Generating importmap.json..."
130
- FileUtils.mkdir_p(importmap_out.dirname)
109
+ puts "πŸ—ΊοΈ Generating importmap.json..."
110
+ FileUtils.mkdir_p(output.dirname)
131
111
 
132
112
  Dir.chdir(dummy_root) do
133
- map = Rails.application.importmap
134
- File.write(importmap_out, JSON.pretty_generate(map.to_json))
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 "βœ… importmap.json written to #{importmap_out}"
119
+ puts " βœ“ importmap.json written"
138
120
  end
139
121
 
140
- desc "Verify dummy app asset readiness (fail-fast for CI)"
122
+ desc "Verify dummy assets for CI (fail-fast)"
141
123
  task verify_dummy: :environment do
142
124
  dummy_root = find_dummy_root
143
- assets_root = dummy_root.join("public/assets")
144
- manifest = assets_root.join(".manifest.json")
145
- importmap = assets_root.join("importmap.json")
125
+ assets = dummy_root.join("public/assets")
126
+ manifest = assets.join(".manifest.json")
127
+ importmap = assets.join("importmap.json")
146
128
 
147
- abort("❌ Missing directory: #{assets_root}") unless Dir.exist?(assets_root)
148
- abort("❌ Missing #{manifest}") unless File.exist?(manifest)
149
- abort("❌ Missing #{importmap}") unless File.exist?(importmap)
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!") if parsed.empty?
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
- # 🧩 INTERNAL HELPERS (DUMMY APP)
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
- # For engines, Rails.root will be e.g. panda-cms/
170
- # In CI we want panda-cms/spec/dummy/
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 at #{possible}")
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.0
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: 2025-11-12 00:00:00.000000000 Z
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.5.22
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: []