Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove full rails as a runtime dependency #404

Merged
merged 16 commits into from
Apr 6, 2021
Merged
Show file tree
Hide file tree
Changes from 7 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
34 changes: 14 additions & 20 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,20 @@ rails_version = (ENV["RAILS_VERSION"] || "6.1.1").to_s
gem "rack-cors"
gem "rake", "~> 12.0"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", rails_version == "main" ? { git: "https://github.com/rails/rails", ref: "main" } : rails_version
if ENV["RAILS_VERSION"] != "main"
manuelpuyol marked this conversation as resolved.
Show resolved Hide resolved
gem "actionview", rails_version
gem "activemodel", rails_version
gem "activesupport", rails_version
gem "railties", rails_version
else
git "https://github.com/rails/rails.git", ref: "main" do
gem "actionview"
gem "activemodel"
gem "activesupport"
gem "railties"
end
end

# Use Puma as the app server
gem "puma", "~> 4.3.6"
# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker
Expand All @@ -19,22 +32,3 @@ gem "bootsnap", ">= 1.4.2", require: false

gem "view_component", path: ENV["VIEW_COMPONENT_PATH"] if ENV["VIEW_COMPONENT_PATH"]
gem "view_component_storybook", "~> 0.8.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"

gem "cuprite", "0.11"
end
21 changes: 9 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ PATH
remote: .
specs:
primer_view_components (0.0.32)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
octicons_helper (>= 9.0.0, < 13.0.0)
rails (>= 5.0.0, < 7.0)
view_component (>= 2.0.0, < 3.0)

GEM
Expand Down Expand Up @@ -116,7 +117,7 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mimemagic (0.3.6)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
Expand All @@ -139,8 +140,6 @@ GEM
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
pry-rails (0.3.9)
pry (>= 0.10.4)
public_suffix (4.0.6)
puma (4.3.7)
nio4r (~> 2.0)
Expand Down Expand Up @@ -213,10 +212,6 @@ GEM
simplecov
terminal-table
simplecov-html (0.12.3)
spring (2.1.1)
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)
Expand Down Expand Up @@ -252,6 +247,9 @@ PLATFORMS
x86_64-darwin-19

DEPENDENCIES
actionview (= 6.1.1)
activemodel (= 6.1.1)
activesupport (= 6.1.1)
allocation_tracer (~> 0.6.3)
benchmark-ips (~> 2.8.4)
bootsnap (>= 1.4.2)
Expand All @@ -262,18 +260,17 @@ DEPENDENCIES
mocha
primer_view_components!
pry
pry-rails
puma (~> 4.3.6)
rack-cors
rails (= 6.1.1)
railties (= 6.1.1)
rake (~> 12.0)
rubocop (= 0.82)
rubocop-github (~> 0.16.0)
rubocop-performance (~> 1.7)
simplecov (~> 0.18.0)
simplecov-console (~> 0.7.2)
spring
spring-watcher-listen (~> 2.0.0)
sprockets
sprockets-rails
view_component_storybook (~> 0.8.0)
webpacker (~> 5.0)
yard (~> 0.9.25)
Expand Down
2 changes: 0 additions & 2 deletions app/components/primer/base_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ module Primer
class BaseComponent < Primer::Component
status :beta

include TestSelectorHelper

# @param test_selector [String] Adds `data-test-selector='given value'` in non-Production environments for testing purposes.
#
# @param m [Integer] Margin. <%= one_of((-6..6).to_a) %>
Expand Down
1 change: 1 addition & 0 deletions app/components/primer/component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ class Component < ViewComponent::Base
include ClassNameHelper
include FetchOrFallbackHelper
include OcticonsHelper
include TestSelectorHelper
include JoinStyleArgumentsHelper
include ViewHelper
include Status::Dsl
Expand Down
4 changes: 0 additions & 4 deletions app/components/primer/octicon_component.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@ module Primer
class OcticonComponent < Primer::Component
status :beta

include ClassNameHelper
include TestSelectorHelper
include OcticonsHelper
Comment on lines -8 to -10
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all of those are included by Primer::Component


SIZE_DEFAULT = :small
SIZE_MAPPINGS = {
SIZE_DEFAULT => 16,
Expand Down
24 changes: 16 additions & 8 deletions demo/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,20 @@ rails_version = (ENV["RAILS_VERSION"] || "6.1.1").to_s
gem "rake", "~> 12.0"
gem "rack-cors"
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem "rails", rails_version == "master" ? { github: "rails/rails" } : rails_version
if ENV["RAILS_VERSION"] != "main"
manuelpuyol marked this conversation as resolved.
Show resolved Hide resolved
gem "actionview", rails_version
gem "activemodel", rails_version
gem "activesupport", rails_version
gem "railties", rails_version
else
git "https://github.com/rails/rails.git", ref: "main" do
gem "actionview"
gem "activemodel"
gem "activesupport"
gem "railties"
end
end

# Use Puma as the app server
gem "puma", "~> 4.3.6"

Expand All @@ -19,17 +32,12 @@ gem "view_component_storybook", "~> 0.8.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"
gem "sprockets"
gem "sprockets-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
35 changes: 9 additions & 26 deletions demo/Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ PATH
remote: ..
specs:
primer_view_components (0.0.32)
actionview (>= 5.0.0)
activesupport (>= 5.0.0)
octicons_helper (>= 9.0.0, < 13.0.0)
rails (>= 5.0.0, < 7.0)
view_component (>= 2.0.0, < 3.0)

GEM
Expand Down Expand Up @@ -68,20 +69,9 @@ GEM
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
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.8)
crass (1.0.6)
erubi (1.10.0)
Expand All @@ -101,7 +91,7 @@ GEM
marcel (0.3.3)
mimemagic (~> 0.3.2)
method_source (1.0.0)
mimemagic (0.3.5)
mimemagic (0.3.6)
mini_mime (1.0.2)
mini_portile2 (2.5.0)
minitest (5.14.4)
Expand All @@ -115,12 +105,6 @@ GEM
octicons_helper (12.1.0)
octicons (= 12.1.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.6)
nio4r (~> 2.0)
racc (1.5.2)
Expand Down Expand Up @@ -159,7 +143,6 @@ GEM
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
regexp_parser (1.7.1)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand All @@ -181,25 +164,25 @@ GEM
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.2)

PLATFORMS
ruby

DEPENDENCIES
actionview (= 6.1.1)
activemodel (= 6.1.1)
activesupport (= 6.1.1)
bootsnap (>= 1.4.2)
capybara (~> 3)
minitest (~> 5.0)
primer_view_components!
pry-rails
puma (~> 4.3.6)
rack-cors
rails (= 6.1.1)
railties (= 6.1.1)
rake (~> 12.0)
spring
spring-watcher-listen (~> 2.0.0)
sprockets
sprockets-rails
view_component_storybook (~> 0.8.0)

BUNDLED WITH
Expand Down
1 change: 0 additions & 1 deletion demo/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
require "action_controller/railtie"
require "action_view/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
require "view_component/engine"
require "view_component/storybook/engine"
require "primer/view_components/engine"
Expand Down
10 changes: 0 additions & 10 deletions demo/config/cable.yml

This file was deleted.

34 changes: 0 additions & 34 deletions demo/config/storage.yml

This file was deleted.

9 changes: 7 additions & 2 deletions primer_view_components.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -27,20 +27,25 @@ Gem::Specification.new do |spec|
spec.files = Dir["CHANGELOG.md", "LICENSE.txt", "README.md", "lib/**/*", "app/**/*", "static/statuses.json"]
spec.require_paths = ["lib"]

spec.add_runtime_dependency "actionview", ">= 5.0.0"
spec.add_runtime_dependency "activesupport", ">= 5.0.0"
spec.add_runtime_dependency "octicons_helper", [">= 9.0.0", "< 13.0.0"]
spec.add_runtime_dependency "rails", [">= 5.0.0", "< 7.0"]
spec.add_runtime_dependency "view_component", [">= 2.0.0", "< 3.0"]

spec.add_development_dependency "allocation_tracer", "~> 0.6.3"
spec.add_development_dependency "benchmark-ips", "~> 2.8.4"
spec.add_development_dependency "capybara", "~> 3"
spec.add_development_dependency "cuprite", "= 0.11"
spec.add_development_dependency "listen", "~> 3.0"
spec.add_development_dependency "minitest", "= 5.6.0"
spec.add_development_dependency "minitest", "~> 5.0"
spec.add_development_dependency "mocha"
spec.add_development_dependency "pry"
spec.add_development_dependency "rubocop", "= 0.82"
spec.add_development_dependency "rubocop-github", "~> 0.16.0"
spec.add_development_dependency "rubocop-performance", "~> 1.7"
spec.add_development_dependency "simplecov", "~> 0.18.0"
spec.add_development_dependency "simplecov-console", "~> 0.7.2"
spec.add_development_dependency "sprockets"
spec.add_development_dependency "sprockets-rails"
spec.add_development_dependency "yard", "~> 0.9.25"
end