Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/parklife.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,12 @@ jobs:
- uses: ruby/setup-ruby@v1
with:
bundler-cache: true
working-directory: ./demo
- uses: actions/setup-node@v4
with:
cache: 'npm'
cache-dependency-path: ./demo/package-lock.json
- run: npm install
- uses: actions/configure-pages@v5
id: pages

Expand Down
2 changes: 1 addition & 1 deletion demo/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ gem "tzinfo-data", platforms: %i[windows jruby]
gem "flowbite-components", path: "../.." # Load the gem files from the parent directory
gem "tailwindcss-rails", "~> 4.3"

gem "lookbook", ">= 2.3.11"
gem "parklife"

group :development, :test do
# See https://guides.rubyonrails.org/debugging_rails_applications.html#debugging-with-the-debug-gem
gem "debug", platforms: %i[mri windows], require: "debug/prelude"

gem "listen"
gem "lookbook", ">= 2.3.11"
end
21 changes: 21 additions & 0 deletions demo/app/views/layouts/preview.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html>
<head>
<title><%= content_for(:title) || "Demo" %></title>
<meta name="viewport" content="width=device-width,initial-scale=1">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="mobile-web-app-capable" content="yes">
<%= csrf_meta_tags %>
<%= csp_meta_tag %>

<%= yield :head %>

<%= stylesheet_link_tag :app %>
</head>

<body>
<main class="container mx-auto mt-28 px-5 flex">
<%= yield %>
</main>
</body>
</html>
4 changes: 3 additions & 1 deletion demo/bin/static-build
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@
set -eu

# Run the app in production mode to ensure correct asset URLs are generated etc.
export DISABLE_DATABASE_ENVIRONMENT_CHECK=1
export RAILS_ENV=production
export SECRET_KEY_BASE=dummy

# If your Rails app uses ActiveRecord then this is a good point to create and
# seed the database from db/seeds.rb.
# bundle exec rails db:setup
bundle exec rails db:drop db:setup

# Generate production-optimised assets with Sprockets and friends. This must be
# done before generating the Parklife build as Rails will blow up if it detects
# missing assets in production.
bundle exec rails tailwindcss:build
bundle exec rails assets:precompile

# Build with Parklife - and forward arguments sent to this script.
Expand Down
3 changes: 1 addition & 2 deletions demo/config/database.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test:
<<: *default
database: storage/test.sqlite3


# SQLite3 write its data on the local filesystem, as such it requires
# persistent disks. If you are deploying to a managed service, you should
# make sure it provides disk persistence, as many don't.
Expand All @@ -29,4 +28,4 @@ test:
# ensure the database is located in a persisted volume.
production:
<<: *default
# database: path/to/persistent/storage/production.sqlite3
database: storage/production.sqlite3
3 changes: 3 additions & 0 deletions demo/config/initializers/lookbook.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Rails.application.configure do
config.view_component.previews.default_layout = "preview"
end
6 changes: 2 additions & 4 deletions demo/config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
# Defines the root path route ("/")
root "pages#index"

Rails.application.routes.draw do
if Rails.env.development?
mount Lookbook::Engine, at: "/lookbook"
end
if defined?(Lookbook)
mount Lookbook::Engine, at: "/lookbook"
end
end
294 changes: 294 additions & 0 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.