panda-core 0.8.4 β†’ 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: 28b16d6a5d79cf880c87149553332200a4b0c685fd1c9e654ec969475c85b1a7
4
- data.tar.gz: 67a0a3ae10b209c96219e3974f8917007443cfbd1734db1943c255c99554d674
3
+ metadata.gz: 52d28416fc7360a3f5cc27ec2ad1f332a61426a8279853461dfe7398f180213a
4
+ data.tar.gz: f68cd0fbaf803d80a3549f67485328c80850e3d035d42f7c89eb1b15a80f6b64
5
5
  SHA512:
6
- metadata.gz: 501c2f8db9b9a09c55d1c2c990672683a11e1fe63ff99067b2844edab3c7c31a10ef50c7f76658e0ce9862acfd0cdc5d979227f6b56ab18c797634b2a0343776
7
- data.tar.gz: ce9f83f3d6619f6bf6b58d29c4b589a6bb3727120e0695391edbe8c22007c50aeb96c1a508b1c9798386db6a9c567f31644943a48dc7978700fb0a7377e0d7fb
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.8.4"
5
+ VERSION = "0.9.1"
6
6
  end
7
7
  end
@@ -1,98 +1,158 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ #
4
+ # Panda Core Asset Tasks
5
+ #
6
+
3
7
  namespace :panda do
4
8
  namespace :core do
5
9
  namespace :assets do
6
- desc "Compile Panda Core assets for development (overwrites panda-core.css)"
10
+ # =========================================================
11
+ # 1) ENGINE CSS COMPILATION (unchanged, just cleaned)
12
+ # =========================================================
13
+
14
+ desc "Compile Panda Core CSS assets (development mode)"
7
15
  task :compile do
8
- puts "🐼 Compiling Panda Core assets..."
16
+ puts "🐼 Compiling Panda Core CSS assets..."
9
17
 
10
- # Create output directory
11
- output_dir = Panda::Core::Engine.root.join("public", "panda-core-assets")
18
+ output_dir = panda_engine_root.join("public", "panda-core-assets")
12
19
  FileUtils.mkdir_p(output_dir)
13
20
 
14
- # Compile CSS using Tailwind CSS v4
15
21
  compile_css_development(output_dir)
16
22
 
17
- puts "πŸŽ‰ Asset compilation complete!"
18
- puts "πŸ“ Output directory: #{output_dir}"
19
- puts ""
20
- puts "πŸ’‘ CSS is served via Rack middleware from Core gem at /panda-core-assets/panda-core.css"
21
- puts " No need to copy to CMS or other apps - they load it from Core automatically!"
23
+ puts "πŸŽ‰ CSS compiled β†’ #{output_dir}"
22
24
  end
23
25
 
24
- desc "Compile and version Panda Core assets for release"
26
+ desc "Compile and version Panda Core CSS assets for release"
25
27
  task :release do
26
- puts "🐼 Compiling Panda Core assets for release..."
28
+ require_relative "../../panda/core/version"
27
29
 
28
- # Get version
29
- require_relative "../panda/core/version"
30
30
  version = Panda::Core::VERSION
31
- puts "Version: #{version}"
32
-
33
- # Create output directory
34
- output_dir = Panda::Core::Engine.root.join("public", "panda-core-assets")
31
+ output_dir = panda_engine_root.join("public", "panda-core-assets")
35
32
  FileUtils.mkdir_p(output_dir)
36
33
 
37
- # Compile CSS with versioning
38
34
  compile_css_release(output_dir, version)
39
35
 
40
- puts "πŸŽ‰ Release asset compilation complete!"
41
- puts "πŸ“ Output directory: #{output_dir}"
42
- puts "πŸ“¦ Versioned: panda-core-#{version}.css"
43
- puts "πŸ”— Symlink: panda-core.css -> panda-core-#{version}.css"
36
+ puts "πŸŽ‰ Release assets compiled"
37
+ end
38
+
39
+ # =========================================================
40
+ # CSS INTERNAL HELPERS
41
+ # =========================================================
42
+
43
+ def panda_engine_root
44
+ Panda::Core::Engine.root
44
45
  end
45
46
 
46
47
  def compile_css_development(output_dir)
47
- puts "Compiling Tailwind CSS (development mode)..."
48
+ input = panda_engine_root.join("app/assets/tailwind/application.css")
49
+ output = output_dir.join("panda-core.css")
50
+
51
+ content = Panda::Core::ModuleRegistry.tailwind_content_paths
52
+ flags = content.map { |p| "--content '#{p}'" }.join(" ")
53
+
54
+ cmd = "bundle exec tailwindcss -i #{input} -o #{output} #{flags} --minify"
55
+ abort("❌ CSS compile failed") unless system(cmd)
56
+
57
+ puts " βœ“ #{output.basename} (#{File.size(output)} bytes)"
58
+ end
59
+
60
+ def compile_css_release(output_dir, version)
61
+ input = panda_engine_root.join("app/assets/tailwind/application.css")
62
+ file = output_dir.join("panda-core-#{version}.css")
63
+
64
+ content = Panda::Core::ModuleRegistry.tailwind_content_paths
65
+ flags = content.map { |p| "--content '#{p}'" }.join(" ")
66
+
67
+ cmd = "bundle exec tailwindcss -i #{input} -o #{file} #{flags} --minify"
68
+ abort("❌ CSS release compile failed") unless system(cmd)
69
+
70
+ symlink = output_dir.join("panda-core.css")
71
+ FileUtils.rm_f(symlink)
72
+ FileUtils.ln_sf(file.basename, symlink)
73
+
74
+ puts " βœ“ Versioned file + symlink created"
75
+ end
48
76
 
49
- engine_root = Panda::Core::Engine.root
50
- input_file = engine_root.join("app/assets/tailwind/application.css")
51
- output_file = output_dir.join("panda-core.css")
77
+ # =========================================================
78
+ # 2) DUMMY APP PREP (FOR SYSTEM TESTS + CI)
79
+ # =========================================================
52
80
 
53
- # Get content paths from ModuleRegistry
54
- content_paths = Panda::Core::ModuleRegistry.tailwind_content_paths
55
- content_flags = content_paths.map { |path| "--content '#{path}'" }.join(" ")
81
+ desc "Compile Panda Core + dummy app assets into spec/dummy/public/assets"
82
+ task compile_dummy: :environment do
83
+ dummy_root = find_dummy_root
84
+ assets_root = dummy_root.join("public/assets")
56
85
 
57
- # Compile with all registered module content
58
- cmd = "bundle exec tailwindcss -i #{input_file} -o #{output_file} #{content_flags} --minify"
86
+ puts "🚧 Compiling dummy assets..."
87
+ puts " β†’ #{assets_root}"
88
+ FileUtils.mkdir_p(assets_root)
59
89
 
60
- if system(cmd)
61
- puts "βœ… CSS compiled: #{output_file} (#{File.size(output_file)} bytes)"
62
- puts "πŸ“¦ Included content from: #{Panda::Core::ModuleRegistry.registered_modules.join(", ")}" if Panda::Core::ModuleRegistry.registered_modules.any?
63
- else
64
- puts "❌ CSS compilation failed"
65
- exit 1
90
+ Dir.chdir(dummy_root) do
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")
94
+ end
95
+
96
+ # Propshaft (Rails 8)
97
+ abort("❌ assets:precompile failed") \
98
+ unless system("bundle exec rake assets:precompile RAILS_ENV=#{Rails.env}")
66
99
  end
100
+
101
+ puts "βœ… Dummy assets compiled"
67
102
  end
68
103
 
69
- def compile_css_release(output_dir, version)
70
- puts "Compiling Tailwind CSS (release mode)..."
71
-
72
- engine_root = Panda::Core::Engine.root
73
- input_file = engine_root.join("app/assets/tailwind/application.css")
74
- versioned_file = output_dir.join("panda-core-#{version}.css")
75
-
76
- # Get content paths from ModuleRegistry
77
- content_paths = Panda::Core::ModuleRegistry.tailwind_content_paths
78
- content_flags = content_paths.map { |path| "--content '#{path}'" }.join(" ")
79
-
80
- # Compile to versioned file with all registered module content
81
- cmd = "bundle exec tailwindcss -i #{input_file} -o #{versioned_file} #{content_flags} --minify"
82
-
83
- if system(cmd)
84
- puts "βœ… CSS compiled: #{versioned_file} (#{File.size(versioned_file)} bytes)"
85
- puts "πŸ“¦ Included content from: #{Panda::Core::ModuleRegistry.registered_modules.join(", ")}" if Panda::Core::ModuleRegistry.registered_modules.any?
86
-
87
- # Create/update unversioned symlink
88
- symlink = output_dir.join("panda-core.css")
89
- FileUtils.rm_f(symlink) if File.exist?(symlink)
90
- FileUtils.ln_sf(File.basename(versioned_file), symlink)
91
- puts "βœ… Created symlink: #{symlink} -> #{File.basename(versioned_file)}"
92
- else
93
- puts "❌ CSS compilation failed"
94
- exit 1
104
+ desc "Generate importmap.json for the dummy app"
105
+ task generate_dummy_importmap: :environment do
106
+ dummy_root = find_dummy_root
107
+ output = dummy_root.join("public/assets/importmap.json")
108
+
109
+ puts "πŸ—ΊοΈ Generating importmap.json..."
110
+ FileUtils.mkdir_p(output.dirname)
111
+
112
+ Dir.chdir(dummy_root) do
113
+ json = Rails.application.importmap.to_json(
114
+ resolver: ActionController::Base.helpers
115
+ )
116
+ File.write(output, JSON.pretty_generate(json))
117
+ end
118
+
119
+ puts " βœ“ importmap.json written"
120
+ end
121
+
122
+ desc "Verify dummy assets for CI (fail-fast)"
123
+ task verify_dummy: :environment do
124
+ dummy_root = find_dummy_root
125
+ assets = dummy_root.join("public/assets")
126
+ manifest = assets.join(".manifest.json")
127
+ importmap = assets.join("importmap.json")
128
+
129
+ abort("❌ Missing #{assets}") unless assets.exist?
130
+ abort("❌ Missing #{manifest}") unless manifest.exist?
131
+ abort("❌ Missing #{importmap}") unless importmap.exist?
132
+
133
+ begin
134
+ parsed = JSON.parse(File.read(manifest))
135
+ abort("❌ Empty .manifest.json") if parsed.empty?
136
+ rescue
137
+ abort("❌ Invalid .manifest.json")
95
138
  end
139
+
140
+ puts "βœ… Dummy assets verified"
141
+ end
142
+
143
+ # =========================================================
144
+ # INTERNAL UTILITIES
145
+ # =========================================================
146
+
147
+ def find_dummy_root
148
+ root = Rails.root
149
+
150
+ return root if root.basename.to_s == "dummy"
151
+
152
+ candidate = root.join("spec/dummy")
153
+ return candidate if candidate.exist?
154
+
155
+ abort("❌ Cannot find dummy root β€” expected #{candidate}")
96
156
  end
97
157
  end
98
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.8.4
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: []