diff --git a/.gitignore b/.gitignore index d6de502..fc68f4c 100644 --- a/.gitignore +++ b/.gitignore @@ -30,5 +30,10 @@ # Ignore master key for decrypting credentials and more. /config/master.key -/app/assets/builds/* -!/app/assets/builds/.keep +# Vite Ruby +/public/vite* +node_modules +# Vite uses dotenv and suggests to ignore local-only env files. See +# https://vitejs.dev/guide/env-and-mode.html#env-files +*.local + diff --git a/.nvmrc b/.nvmrc new file mode 100644 index 0000000..7af24b7 --- /dev/null +++ b/.nvmrc @@ -0,0 +1 @@ +22.11.0 diff --git a/.ruby-version b/.ruby-version index 9e79f6c..e3cc07a 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -ruby-3.2.2 +ruby-3.4.4 diff --git a/Gemfile b/Gemfile index e616099..e63d2d6 100644 --- a/Gemfile +++ b/Gemfile @@ -1,28 +1,18 @@ source "https://rubygems.org" -git_source(:github) { |repo| "https://github.com/#{repo}.git" } - -ruby "3.2.2" # Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main" gem "railties" gem "actionpack" gem "actionview" -# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails] -gem "sprockets-rails" - # Use the Puma web server [https://github.com/puma/puma] -gem "puma", "~> 5.0" - -# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails] -gem "importmap-rails" - -# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails] -gem "tailwindcss-rails" +gem "puma" # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem "tzinfo-data", platforms: %i[ mingw mswin x64_mingw jruby ] +gem "vite_rails" + group :development, :test do # See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem gem "debug", platforms: %i[ mri mingw x64_mingw ] @@ -60,4 +50,4 @@ gem "torture", ">= 0.0.3" # gem "torture-server", path: "../torture-server" gem "torture-server", github: "apotonick/torture-server", branch: "cms" -# gem "trailblazer-developer" +gem "ostruct" diff --git a/Gemfile.lock b/Gemfile.lock index aedb36e..fd1e096 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,13 @@ +GIT + remote: https://github.com/apotonick/torture-server.git + revision: 0f57406ac50966d903bfd8155a83f7f7ffbcbb42 + branch: cms + specs: + torture-server (0.1.0) + kramdown + minitest-line + trailblazer-activity-dsl-linear + GIT remote: https://github.com/trailblazer/cells.git revision: 3e87c147b0595555ef4b1e929da8d18f896bece3 @@ -6,161 +16,183 @@ GIT cells (5.0.0.alpha1) tilt (~> 2.1.0) -PATH - remote: ../torture-server - specs: - torture-server (0.1.0) - kramdown - minitest-line - trailblazer-activity-dsl-linear - GEM remote: https://rubygems.org/ specs: - actionpack (7.0.8) - actionview (= 7.0.8) - activesupport (= 7.0.8) - rack (~> 2.0, >= 2.2.4) + actionpack (8.0.2) + actionview (= 8.0.2) + activesupport (= 8.0.2) + nokogiri (>= 1.8.5) + rack (>= 2.2.4) + rack-session (>= 1.0.1) rack-test (>= 0.6.3) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.2.0) - actionview (7.0.8) - activesupport (= 7.0.8) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + useragent (~> 0.16) + actionview (8.0.2) + activesupport (= 8.0.2) builder (~> 3.1) - erubi (~> 1.4) - rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.1, >= 1.2.0) - activesupport (7.0.8) - concurrent-ruby (~> 1.0, >= 1.0.2) + erubi (~> 1.11) + rails-dom-testing (~> 2.2) + rails-html-sanitizer (~> 1.6) + activesupport (8.0.2) + base64 + benchmark (>= 0.3) + bigdecimal + concurrent-ruby (~> 1.0, >= 1.3.1) + connection_pool (>= 2.2.5) + drb i18n (>= 1.6, < 2) + logger (>= 1.4.2) minitest (>= 5.1) - tzinfo (~> 2.0) - addressable (2.8.5) - public_suffix (>= 2.0.2, < 6.0) - builder (3.2.4) - capybara (3.39.2) + securerandom (>= 0.3) + tzinfo (~> 2.0, >= 2.0.5) + uri (>= 0.13.1) + addressable (2.8.7) + public_suffix (>= 2.0.2, < 7.0) + base64 (0.2.0) + benchmark (0.4.0) + bigdecimal (3.1.9) + builder (3.3.0) + capybara (3.40.0) addressable matrix mini_mime (>= 0.1.3) - nokogiri (~> 1.8) + nokogiri (~> 1.11) rack (>= 1.6.0) rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) coderay (1.1.3) - concurrent-ruby (1.2.2) + concurrent-ruby (1.3.5) + connection_pool (2.5.3) crass (1.0.6) - debug (1.8.0) - irb (>= 1.5.0) - reline (>= 0.3.1) + date (3.4.1) + debug (1.10.0) + irb (~> 1.10) + reline (>= 0.3.8) + drb (2.2.3) + dry-cli (1.2.0) + erb (5.0.1) erbse (0.1.4) temple - erubi (1.12.0) - ffi (1.16.2) + erubi (1.13.1) + ffi (1.17.2-arm64-darwin) + ffi (1.17.2-x86_64-linux-gnu) formatador (1.1.0) - guard (2.18.1) + guard (2.19.1) formatador (>= 0.2.4) listen (>= 2.7, < 4.0) + logger (~> 1.6) lumberjack (>= 1.0.12, < 2.0) nenv (~> 0.1) notiffany (~> 0.0) + ostruct (~> 0.6) pry (>= 0.13.0) shellany (~> 0.0) thor (>= 0.18.1) hashie (5.0.0) hirb (0.7.3) - i18n (1.14.1) + i18n (1.14.7) concurrent-ruby (~> 1.0) - importmap-rails (1.2.1) - actionpack (>= 6.0.0) - railties (>= 6.0.0) - io-console (0.6.0) - irb (1.8.1) - rdoc - reline (>= 0.3.8) - kramdown (2.4.0) - rexml - listen (3.8.0) + io-console (0.8.0) + irb (1.15.2) + pp (>= 0.6.0) + rdoc (>= 4.0.0) + reline (>= 0.4.2) + kramdown (2.5.1) + rexml (>= 3.3.9) + listen (3.9.0) rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) - loofah (2.21.3) + logger (1.7.0) + loofah (2.24.1) crass (~> 1.0.2) nokogiri (>= 1.12.0) - lumberjack (1.2.9) + lumberjack (1.2.10) matrix (0.4.2) - method_source (1.0.0) + method_source (1.1.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.25.5) minitest-line (0.6.5) minitest (~> 5.0) + mutex_m (0.3.0) nenv (0.3.0) - nio4r (2.5.9) - nokogiri (1.15.4-x86_64-linux) + nio4r (2.7.4) + nokogiri (1.18.8-arm64-darwin) + racc (~> 1.4) + nokogiri (1.18.8-x86_64-linux-gnu) racc (~> 1.4) notiffany (0.1.3) nenv (~> 0.1) shellany (~> 0.0) - pry (0.14.2) + ostruct (0.6.1) + pp (0.6.2) + prettyprint + prettyprint (0.2.0) + pry (0.15.2) coderay (~> 1.1) method_source (~> 1.0) - psych (5.1.0) + psych (5.2.6) + date stringio - public_suffix (5.0.3) - puma (5.6.7) + public_suffix (6.0.2) + puma (6.6.0) nio4r (~> 2.0) - racc (1.7.1) - rack (2.2.8) - rack-test (2.1.0) + racc (1.8.1) + rack (3.1.15) + rack-proxy (0.7.7) + rack + rack-session (2.1.1) + base64 (>= 0.1.0) + rack (>= 3.0.0) + rack-test (2.2.0) rack (>= 1.3) - rails-dom-testing (2.2.0) + rackup (2.2.1) + rack (>= 3) + rails-dom-testing (2.3.0) activesupport (>= 5.0.0) minitest nokogiri (>= 1.6) - rails-html-sanitizer (1.6.0) + rails-html-sanitizer (1.6.2) loofah (~> 2.21) - nokogiri (~> 1.14) - railties (7.0.8) - actionpack (= 7.0.8) - activesupport (= 7.0.8) - method_source + nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0) + railties (8.0.2) + actionpack (= 8.0.2) + activesupport (= 8.0.2) + irb (~> 1.13) + rackup (>= 1.0.0) rake (>= 12.2) - thor (~> 1.0) - zeitwerk (~> 2.5) - rake (13.0.6) + thor (~> 1.0, >= 1.2.2) + zeitwerk (~> 2.6) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.5.0) + rdoc (6.14.0) + erb psych (>= 4.0.0) - regexp_parser (2.8.1) - reline (0.3.8) + regexp_parser (2.10.0) + reline (0.6.1) io-console (~> 0.5) - rexml (3.2.6) - rubyzip (2.3.2) + rexml (3.4.1) + rubyzip (2.4.1) + securerandom (0.4.1) selenium-webdriver (4.10.0) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) shellany (0.0.1) - sprockets (4.2.1) - concurrent-ruby (~> 1.0) - rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) - sprockets (>= 3.0.0) - stringio (3.0.8) - tailwindcss-rails (2.0.30-x86_64-linux) - railties (>= 6.0.0) - temple (0.10.2) - thor (1.2.2) + stringio (3.1.7) + temple (0.10.3) + thor (1.3.2) tilt (2.1.0) torture (0.0.3) - trailblazer-activity (0.16.1) + trailblazer-activity (0.17.0) trailblazer-context (~> 0.5.0) trailblazer-option (~> 0.1.0) - trailblazer-activity-dsl-linear (1.2.4) - trailblazer-activity (>= 0.16.0, < 0.17.0) + trailblazer-activity-dsl-linear (1.2.6) + trailblazer-activity (>= 0.17.0, < 0.18.0) trailblazer-declarative (>= 0.0.1, < 0.1.0) trailblazer-context (0.5.1) hashie (>= 3.0.0) @@ -171,16 +203,28 @@ GEM trailblazer-option (0.1.2) tzinfo (2.0.6) concurrent-ruby (~> 1.0) + uri (1.0.3) + useragent (0.16.11) + vite_rails (3.0.19) + railties (>= 5.1, < 9) + vite_ruby (~> 3.0, >= 3.2.2) + vite_ruby (3.9.2) + dry-cli (>= 0.7, < 2) + logger (~> 1.6) + mutex_m + rack-proxy (~> 0.6, >= 0.6.1) + zeitwerk (~> 2.2) webdrivers (5.3.1) nokogiri (~> 1.6) rubyzip (>= 1.3.0) selenium-webdriver (~> 4.0, < 4.11) - websocket (1.2.10) + websocket (1.2.11) xpath (3.2.0) nokogiri (~> 1.8) - zeitwerk (2.6.12) + zeitwerk (2.7.3) PLATFORMS + arm64-darwin-24 x86_64-linux DEPENDENCIES @@ -191,20 +235,16 @@ DEPENDENCIES debug erbse guard - importmap-rails - puma (~> 5.0) + ostruct + puma railties selenium-webdriver - sprockets-rails - tailwindcss-rails torture (>= 0.0.3) torture-server! trailblazer-developer tzinfo-data + vite_rails webdrivers -RUBY VERSION - ruby 3.2.2p53 - BUNDLED WITH - 2.4.10 + 2.6.9 diff --git a/Procfile.dev b/Procfile.dev index 023e98a..25b701e 100644 --- a/Procfile.dev +++ b/Procfile.dev @@ -1,2 +1,2 @@ web: bin/rails server -p 3000 -css: bin/rails tailwindcss:watch +vite: bin/vite dev diff --git a/README.md b/README.md index ca6e1b5..4e220e4 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ To write docs, use `guard` and `rails` as a server. -``` +```shell bundle exec guard rails s ``` @@ -16,7 +16,7 @@ To work on CSS and new features, you need to run the "development mode" where Ta Run with -``` +```shell $ foreman start -f Procfile.dev ``` @@ -30,25 +30,13 @@ Browse to If styles don't show up, run -``` +```shell $ rails assets:clobber ``` -### Troubleshooting - -``` -The asset "tailwind.css" is not present in the asset pipeline. (Sprockets::Rails::Helper::AssetNotFound) -``` - -Run - -``` -rails tailwindcss:build -``` - ## Publishing -``` +```shell $ rails site:deploy ``` @@ -74,12 +62,11 @@ https://crawler.algolia.com/admin/crawlers/870e3bcd-5879-4bfd-9d57-8241620b249b/ ## Javascript -```ruby -bin/importmap pin jquery --download -``` - -will copy the library to `vendor/javascript/jquery.js` +JS dependencies are handled by [ViteJS](https://vitejs.dev/) and npm tool (installed with Node) +```shell +$ npm install +``` ## Publishing (before Netlify) diff --git a/app/assets/builds/.keep b/app/assets/builds/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/config/manifest.js b/app/assets/config/manifest.js deleted file mode 100644 index 5b95087..0000000 --- a/app/assets/config/manifest.js +++ /dev/null @@ -1,6 +0,0 @@ -//= link_tree ../fonts -//= link_tree ../images -//= link_directory ../stylesheets .css -//= link_tree ../../javascript .js -//= link_tree ../../../vendor/javascript .js -//= link_tree ../builds .css diff --git a/app/assets/stylesheets/application.tailwind.css b/app/assets/stylesheets/application.tailwind.css deleted file mode 100644 index 7d47070..0000000 --- a/app/assets/stylesheets/application.tailwind.css +++ /dev/null @@ -1,73 +0,0 @@ -@tailwind base; -@tailwind components; -@tailwind utilities; - -@layer components { -/* FIXME: doesn't show up*/ - .DocSearch-Button { - @apply rounded bg-white !important h-20; - } - - .hamburger-toggle { - @apply - [&>div]:h-0 - [&>div::before]:translate-y-0 - [&>div::before]:rotate-45 - [&>div::after]:translate-y-0 - [&>div::after]:-rotate-45 - } - - .active-mobile-navbar { - @apply sticky top-0 h-screen bg-purple; - } - - .base-button { - @apply w-60 h-14 rounded flex items-center justify-center text-base font-bold - lg:w-[18.75rem] lg:h-16 lg:text-2xl - } - - .section-content-wrapper { - @apply mobile-section-width mx-auto py-12 max-w-[28rem] - lg:max-w-[58.5rem] lg:py-22; - } - - .mobile-section-width { - @apply w-10/12; - } - - .section-header { - @apply text-center text-3xl lg:text-5xl; - } - - .section-description { - @apply text-center text-lg mt-5 lg:text-2xl; - } - - .list-checkmark { - @apply list-image-[url(list_checkmark)]; - } - - .list-white-checkmark { - @apply list-image-[url(list_white_checkmark)]; - } - - .documentation-right-toc-h3-active { - @apply text-white bg-dark-purple; - } - - .documentation-right-toc-h4-active { - @apply bg-lighter-purple; - } - - .display_none { - display: none; - } - - .display_block { - display: block; - } - - .toc-right-height { - height: calc(100dvh - 10rem); - } -} diff --git a/app/concepts/cell/about/about.erb b/app/concepts/cell/about/about.erb index aa1d0af..4bf1848 100644 --- a/app/concepts/cell/about/about.erb +++ b/app/concepts/cell/about/about.erb @@ -20,7 +20,7 @@ Follow us on LinkedIn for updates.

- <%= image_tag "memo-create.png", class: "hidden lg:block rounded relative h-[29rem] w-auto bottom-[29rem] left-[54rem] -mb-[29rem]" %> + <%= vite_image_tag "images/memo-create.png", class: "hidden lg:block rounded relative h-[29rem] w-auto bottom-[29rem] left-[54rem] -mb-[29rem]" %>

diff --git a/app/concepts/cell/application/container.erb b/app/concepts/cell/application/container.erb index 3b0f9bf..d8c6390 100644 --- a/app/concepts/cell/application/container.erb +++ b/app/concepts/cell/application/container.erb @@ -6,10 +6,12 @@ <%#= csrf_meta_tags %> <%#= csp_meta_tag %> - <%= stylesheet_link_tag "tailwind", "inter-font" %> - <%= stylesheet_link_tag "application" %> + + <%= vite_client_tag %> + <%= vite_javascript_tag 'application' %> + <%= vite_stylesheet_tag "application.css" %> + <%= script_for_page_identifier %> - <%= javascript_importmap_tags %> <%= yield %> diff --git a/app/concepts/cell/application/footer.erb b/app/concepts/cell/application/footer.erb index f2057c7..d7d7ee6 100644 --- a/app/concepts/cell/application/footer.erb +++ b/app/concepts/cell/application/footer.erb @@ -2,10 +2,10 @@

- <%= image_tag "logo_white_ruby.svg", class: "w-48" %> + <%= vite_image_tag "images/logo_white_ruby.svg", class: "w-48" %>
@@ -18,12 +18,10 @@
<%= link_to "About us", "/2.1/about/", class: "font-bold text-xl" %> -
- LinkedIn - - - -
+ + LinkedIn + + <%= link_to "Blog", "https://dev.to/trailblazer" %> <%= link_to "Trailblazer GmbH", "/2.1/about/" %> <%= link_to "Trailblazer PRO", "/2.1/pro/" %> @@ -36,6 +34,6 @@
- © 2023 Trailblazer GmbH + © 2025 Trailblazer GmbH
diff --git a/app/concepts/cell/application/navbar.erb b/app/concepts/cell/application/navbar.erb index 01872ad..045525c 100644 --- a/app/concepts/cell/application/navbar.erb +++ b/app/concepts/cell/application/navbar.erb @@ -1,6 +1,6 @@