diff --git a/.github/workflows/github-actions-alpha-version.yml b/.github/workflows/github-actions-alpha-version.yml index 314ffceb4d..7e824225c0 100644 --- a/.github/workflows/github-actions-alpha-version.yml +++ b/.github/workflows/github-actions-alpha-version.yml @@ -68,7 +68,7 @@ jobs: npm publish --registry https://registry.npmjs.org playbook-ui-${{ env.new_npm_alpha_version }}.tgz --tag alpha - name: Version Up, Distribute and Publish (RubyGems) run: | - gem build playbook_ui.gemspec + bin/build_gem gem build lib/playbook_ui_docs.gemspec rm -rf dist/playbook-doc.js dist/playbook-rails.js dist/app dist/pb_doc_helper.rb dist/menu.yml echo "${{ env.new_ruby_alpha_version }}" diff --git a/playbook/bin/build_gem b/playbook/bin/build_gem new file mode 100755 index 0000000000..8abbe6bb19 --- /dev/null +++ b/playbook/bin/build_gem @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +cp ../playbook-website/config/menu.yml dist/menu.yml + +time $(gem build playbook_ui.gemspec) + +rm dist/menu.yml diff --git a/playbook/lib/playbook/engine.rb b/playbook/lib/playbook/engine.rb index e90c4401bd..f6671601f9 100644 --- a/playbook/lib/playbook/engine.rb +++ b/playbook/lib/playbook/engine.rb @@ -17,11 +17,13 @@ class Engine < ::Rails::Engine if config.respond_to?(:assets) config.assets.paths ||= [] config.assets.paths << Playbook::Engine.root.join("fonts") + config.assets.paths << Playbook::Engine.root.join("dist") config.assets.paths << Playbook::Engine.root.join("app/pb_kits/playbook/pb_*") end if config.respond_to?(:sass) config.sass.load_paths ||= [] + config.sass.load_paths << Playbook::Engine.root.join("dist") config.sass.load_paths << Playbook::Engine.root.join("app/pb_kits/playbook") end end diff --git a/playbook/playbook_ui.gemspec b/playbook/playbook_ui.gemspec index 1ec49bccf7..cf3a0fbbd6 100644 --- a/playbook/playbook_ui.gemspec +++ b/playbook/playbook_ui.gemspec @@ -17,19 +17,20 @@ Gem::Specification.new do |s| s.files = Dir[ "app/pb_kits/playbook/pb_*/**/*", "app/pb_kits/playbook/{plugins,tokens,utilities}/**/*", - "app/pb_kits/playbook/*.{scss,js,rb}", "app/assets/images/*", "fonts/**/*", "lib/*.rb", "lib/playbook/**/*", + "dist/chunks/*", + "dist/playbook.css", "dist/reset.css", + "dist/playbook-doc.js", "dist/playbook-rails.js", + "dist/playbook-rails-react-bindings.js", "dist/menu.yml", ] + ["Rakefile"] - # s.files += Dir.glob("app/pb_kits/playbook/pb_*/**/*").reject do |file| - # (file == "docs") || (file.include? "docs") - # end + s.files.reject! { |file| file == "dist/chunks/lib.js" } s.add_dependency "actionpack", ">= 5.2.4.5" s.add_dependency "actionview", ">= 5.2.4.5" diff --git a/playbook/private/tasks/pb_release.rake b/playbook/private/tasks/pb_release.rake index c62862f12b..a02b5a8631 100644 --- a/playbook/private/tasks/pb_release.rake +++ b/playbook/private/tasks/pb_release.rake @@ -96,7 +96,7 @@ namespace :pb_release do # RubyGems puts "\nCreating Gem..." - `gem build playbook_ui.gemspec` + `bin/build_gem` puts "\nCreating Docs Gem..." `gem build lib/playbook_ui_docs.gemspec` # Publish to RubyGems