Skip to content

Commit

Permalink
move demo app into top level
Browse files Browse the repository at this point in the history
  • Loading branch information
joelhawksley committed Aug 7, 2020
1 parent d61574f commit 1e14990
Show file tree
Hide file tree
Showing 68 changed files with 266 additions and 20 deletions.
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@
**/*.stories.json
**/node_modules/
*.log
test/demo/public/packs/
test/demo/tmp/
test/demo/config/master.key
demo/public/packs/
demo/tmp/
demo/config/master.key
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.7.0
2.7.1
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ gem "webpacker", "~> 5.0"
# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.2", require: false

gem "view_component_storybook", "~> 0.4.0"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "minitest", "~> 5.0"
Expand Down
6 changes: 3 additions & 3 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
stories: cd test/demo; bin/rails view_component_storybook:write_stories_json
rails: cd test/demo; bin/rails s -p 4000
storybook: cd test/demo; bin/yarn storybook -p 5000
stories: cd demo; bin/rails view_component_storybook:write_stories_json
rails: cd demo; bin/rails s -p 4000
storybook: cd demo; bin/yarn storybook -p 5000
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/demo/.storybook/main.js → demo/.storybook/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
stories: ['../../components/**/*.stories.json'],
stories: ['../../test/components/**/*.stories.json'],
addons: [
'@storybook/addon-controls',
],
Expand Down
File renamed without changes.
36 changes: 36 additions & 0 deletions demo/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# frozen_string_literal: true

source "https://rubygems.org"

rails_version = "#{ENV['RAILS_VERSION'] || '6.0.3.2'}"

gem "rake", "~> 12.0"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", rails_version == "master" ? { github: "rails/rails" } : rails_version
# Use Puma as the app server
gem "puma", "~> 4.1"
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
gem "webpacker", "~> 5.0"

# Reduces boot times through caching; required in config/boot.rb
gem "bootsnap", ">= 1.4.2", require: false

gem "primer_view_components", path: "../"
gem "view_component_storybook", "~> 0.4.0"

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem "minitest", "~> 5.0"
gem "pry-rails"
end

group :development do
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem "spring"
gem "spring-watcher-listen", "~> 2.0.0"
end

group :test do
# Adds support for Capybara system testing and selenium driver
gem "capybara", "~> 3"
end
209 changes: 209 additions & 0 deletions demo/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
PATH
remote: ..
specs:
primer_view_components (0.0.1)
octicons_helper (>= 9.0.0, < 11.0.0)
rails (>= 5.0.0, < 7.0)
view_component (>= 2.0.0, < 3.0)

GEM
remote: https://rubygems.org/
specs:
actioncable (6.0.3.2)
actionpack (= 6.0.3.2)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
actionmailbox (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
mail (>= 2.7.1)
actionmailer (6.0.3.2)
actionpack (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0)
actionpack (6.0.3.2)
actionview (= 6.0.3.2)
activesupport (= 6.0.3.2)
rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actiontext (6.0.3.2)
actionpack (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
nokogiri (>= 1.8.5)
actionview (6.0.3.2)
activesupport (= 6.0.3.2)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (6.0.3.2)
activesupport (= 6.0.3.2)
globalid (>= 0.3.6)
activemodel (6.0.3.2)
activesupport (= 6.0.3.2)
activerecord (6.0.3.2)
activemodel (= 6.0.3.2)
activesupport (= 6.0.3.2)
activestorage (6.0.3.2)
actionpack (= 6.0.3.2)
activejob (= 6.0.3.2)
activerecord (= 6.0.3.2)
marcel (~> 0.3.1)
activesupport (6.0.3.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
zeitwerk (~> 2.2, >= 2.2.2)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
bootsnap (1.4.7)
msgpack (~> 1.0)
builder (3.2.4)
capybara (3.33.0)
addressable
mini_mime (>= 0.1.3)
nokogiri (~> 1.8)
rack (>= 1.6.0)
rack-test (>= 0.6.3)
regexp_parser (~> 1.5)
xpath (~> 3.2)
coderay (1.1.3)
concurrent-ruby (1.1.6)
crass (1.0.6)
erubi (1.9.0)
ffi (1.13.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
listen (3.2.1)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
loofah (2.6.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
mini_mime (>= 0.1.1)
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.14.1)
msgpack (1.3.3)
nio4r (2.5.2)
nokogiri (1.10.10)
mini_portile2 (~> 2.4.0)
octicons (10.0.0)
nokogiri (>= 1.6.3.1)
octicons_helper (10.0.0)
octicons (= 10.0.0)
rails
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.5)
puma (4.3.5)
nio4r (~> 2.0)
rack (2.2.3)
rack-proxy (0.6.5)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
rails (6.0.3.2)
actioncable (= 6.0.3.2)
actionmailbox (= 6.0.3.2)
actionmailer (= 6.0.3.2)
actionpack (= 6.0.3.2)
actiontext (= 6.0.3.2)
actionview (= 6.0.3.2)
activejob (= 6.0.3.2)
activemodel (= 6.0.3.2)
activerecord (= 6.0.3.2)
activestorage (= 6.0.3.2)
activesupport (= 6.0.3.2)
bundler (>= 1.3.0)
railties (= 6.0.3.2)
sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
nokogiri (>= 1.6)
rails-html-sanitizer (1.3.0)
loofah (~> 2.3)
railties (6.0.3.2)
actionpack (= 6.0.3.2)
activesupport (= 6.0.3.2)
method_source
rake (>= 0.8.7)
thor (>= 0.20.3, < 2.0)
rake (12.3.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.7.1)
require_reloader (0.2.1)
semantic_range (2.3.0)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
spring (>= 1.2, < 3.0)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.1)
actionpack (>= 4.0)
activesupport (>= 4.0)
sprockets (>= 3.0.0)
thor (1.0.1)
thread_safe (0.3.6)
tzinfo (1.2.7)
thread_safe (~> 0.1)
view_component (2.18.0)
activesupport (>= 5.0.0, < 7.0)
view_component_storybook (0.4.0)
view_component (>= 2.2)
webpacker (5.1.1)
activesupport (>= 5.2)
rack-proxy (>= 0.6.1)
railties (>= 5.2)
semantic_range (>= 2.3.0)
websocket-driver (0.7.3)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
xpath (3.2.0)
nokogiri (~> 1.8)
zeitwerk (2.4.0)

PLATFORMS
ruby

DEPENDENCIES
bootsnap (>= 1.4.2)
capybara (~> 3)
minitest (~> 5.0)
primer_view_components!
pry-rails
puma (~> 4.1)
rails (= 6.0.3.2)
rake (~> 12.0)
require_reloader
spring
spring-watcher-listen (~> 2.0.0)
view_component_storybook (~> 0.4.0)
webpacker (~> 5.0)

BUNDLED WITH
2.1.4
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/demo/bin/bundle → demo/bin/bundle
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ m = Module.new do
gemfile = ENV["BUNDLE_GEMFILE"]
return gemfile if gemfile && !gemfile.empty?

File.expand_path("../../Gemfile", __FILE__)
File.expand_path("../Gemfile", __FILE__)
end

def lockfile
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/demo/bin/spring → demo/bin/spring
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# This file loads Spring without using Bundler, in order to be fast.
# It gets overwritten when you run the `spring binstub` command.

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

unless defined?(Spring)
require "rubygems"
Expand Down
2 changes: 1 addition & 1 deletion test/demo/bin/webpack → demo/bin/webpack
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile",
Pathname.new(__FILE__).realpath)

require "bundler/setup"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ENV["RAILS_ENV"] ||= ENV["RACK_ENV"] || "development"
ENV["NODE_ENV"] ||= "development"

require "pathname"
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../Gemfile",
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile",
Pathname.new(__FILE__).realpath)

require "bundler/setup"
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
module Demo
class Application < Rails::Application
# Initialize configuration defaults for originally generated Rails version.
config.view_component_storybook.stories_path = Rails.root.join("../components/stories")
config.view_component_storybook.stories_path = Rails.root.join("../test/components/stories")
config.action_dispatch.default_headers.clear

config.action_dispatch.default_headers = {
Expand Down
2 changes: 1 addition & 1 deletion test/demo/config/boot.rb → demo/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../../../Gemfile", __dir__)
ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__)

require "bundler/setup" # Set up gems listed in the Gemfile.
require "bootsnap/setup" # Speed up boot time by caching expensive operations.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion test/demo/config/spring.rb → demo/config/spring.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true
Spring.application_root = "test/demo"
Spring.application_root = "demo"
Spring.watch(
".ruby-version",
".rbenv-vars",
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion primer_view_components.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,4 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "pry"
spec.add_development_dependency "rubocop", "= 0.74"
spec.add_development_dependency "rubocop-github", "~> 0.13.0"
spec.add_development_dependency "view_component_storybook", "~> 0.4.0"
end
4 changes: 2 additions & 2 deletions script/setup
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
bundle install --path vendor/bundle

# NPM packages
cd test/demo
cd demo
bundle install
yarn install

# back to root
cd ../../
cd ../
2 changes: 1 addition & 1 deletion script/storybook
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ if command -v overmind &> /dev/null
then
exec overmind start
else
cd test/demo
cd demo

bin/rails view_component_storybook:write_stories_json
bin/rails s -p 4000 &
Expand Down
Binary file added test/.DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

ENV["RAILS_ENV"] = "test"

require File.expand_path("../demo/config/environment.rb", __FILE__)
require File.expand_path("../../demo/config/environment.rb", __FILE__)
require "rails/test_help"
require "view_component/test_helpers"
require "test_helpers/component_test_helpers"
Expand Down

0 comments on commit 1e14990

Please sign in to comment.