-
Notifications
You must be signed in to change notification settings - Fork 188
Make files with class names configurable #74
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
Closed
faqndo97
wants to merge
6
commits into
rails:main
from
faqndo97:make_files_with_class_names_configurable
Closed
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
3e05ec1
Make files with class names configurable
faqndo97 0728ae1
Remove ActionCable
faqndo97 8968971
Remove ActionMailer
faqndo97 24f7b8c
Delete comments and unnecesary files
faqndo97 c785a1b
Fix test/compressor_test.rb
faqndo97 fcbd778
Continue slimming down the dummy app
faqndo97 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require "test_helper" | ||
|
||
class Tailwindcss::CompressorTest < ActiveSupport::TestCase | ||
test "files_with_class_names on default configuration" do | ||
default_files_with_class_names = Rails.root.glob("app/views/**/*.*") + Rails.root.glob("app/helpers/**/*.rb") + Rails.root.glob("app/javascript/**/*.js") | ||
|
||
assert_equal default_files_with_class_names, Tailwindcss::Compressor.new.instance_variable_get(:@options)[:files_with_class_names] | ||
end | ||
|
||
test "files_with_class_names on custom configuration" do | ||
files_with_class_names = Rails.application.config.tailwind.files_with_class_names + Rails.root.glob("app/custom_views/**/*.*") | ||
with_files_with_class_names_configuration(files_with_class_names) do | ||
assert_equal files_with_class_names, Tailwindcss::Compressor.new.instance_variable_get(:@options)[:files_with_class_names] | ||
end | ||
end | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require_relative "config/application" | ||
|
||
Rails.application.load_tasks |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
//= link_tree ../images | ||
//= link_directory ../stylesheets .css |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
/* | ||
*= require_tree . | ||
*= require_self | ||
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
class ApplicationController < ActionController::Base | ||
end |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class PostsController < ApplicationController | ||
def index; end | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<h1 class="font-bold text-red-500">Posts</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ApplicationHelper | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
//= require rails-ujs | ||
//= require activestorage | ||
//= require_tree . |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
class ApplicationRecord < ActiveRecord::Base | ||
self.abstract_class = true | ||
end |
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>Dummy</title> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"> | ||
<%= csrf_meta_tags %> | ||
<%= csp_meta_tag %> | ||
<%= stylesheet_link_tag "inter-font", "data-turbo-track": "reload" %> | ||
<%= stylesheet_link_tag "tailwind", "data-turbo-track": "reload" %> | ||
|
||
<%= stylesheet_link_tag 'application', media: 'all' %> | ||
</head> | ||
|
||
<body> | ||
<%= yield %> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
APP_PATH = File.expand_path('../config/application', __dir__) | ||
require_relative "../config/boot" | ||
require "rails/commands" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env ruby | ||
require_relative "../config/boot" | ||
require "rake" | ||
Rake.application.run |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/usr/bin/env ruby | ||
require "fileutils" | ||
|
||
APP_ROOT = File.expand_path('..', __dir__) | ||
|
||
def system!(*args) | ||
system(*args) || abort("\n== Command #{args} failed ==") | ||
end | ||
|
||
FileUtils.chdir APP_ROOT do | ||
puts '== Installing dependencies ==' | ||
system! 'gem install bundler --conservative' | ||
system('bundle check') || system!('bundle install') | ||
|
||
puts "\n== Preparing database ==" | ||
system! 'bin/rails db:prepare' | ||
|
||
puts "\n== Removing old logs and tempfiles ==" | ||
system! 'bin/rails log:clear tmp:clear' | ||
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
require_relative "config/environment" | ||
|
||
run Rails.application | ||
Rails.application.load_server |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
require_relative "boot" | ||
|
||
require "rails" | ||
require "active_model/railtie" | ||
require "active_job/railtie" | ||
require "active_record/railtie" | ||
require "action_controller/railtie" | ||
require "action_view/railtie" | ||
require "sprockets/railtie" | ||
|
||
Bundler.require(*Rails.groups) | ||
require "tailwindcss-rails" | ||
|
||
module Dummy | ||
class Application < Rails::Application | ||
config.load_defaults Rails::VERSION::STRING.to_f | ||
|
||
config.paths["app/views"].unshift("#{Rails.root}/app/custom_views") | ||
end | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__) | ||
|
||
require "bundler/setup" if File.exist?(ENV["BUNDLE_GEMFILE"]) | ||
$LOAD_PATH.unshift File.expand_path('../../../lib', __dir__) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
default: &default | ||
adapter: sqlite3 | ||
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | ||
timeout: 5000 | ||
|
||
development: | ||
<<: *default | ||
database: db/development.sqlite3 | ||
|
||
test: | ||
<<: *default | ||
database: db/test.sqlite3 | ||
|
||
production: | ||
<<: *default | ||
database: db/production.sqlite3 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
require_relative "application" | ||
|
||
Rails.application.initialize! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
require "active_support/core_ext/integer/time" | ||
|
||
Rails.application.configure do | ||
config.cache_classes = false | ||
|
||
config.eager_load = false | ||
|
||
config.consider_all_requests_local = true | ||
|
||
if Rails.root.join('tmp', 'caching-dev.txt').exist? | ||
config.action_controller.perform_caching = true | ||
config.action_controller.enable_fragment_cache_logging = true | ||
|
||
config.cache_store = :memory_store | ||
config.public_file_server.headers = { | ||
'Cache-Control' => "public, max-age=#{2.days.to_i}" | ||
} | ||
else | ||
config.action_controller.perform_caching = false | ||
|
||
config.cache_store = :null_store | ||
end | ||
|
||
config.active_support.deprecation = :log | ||
|
||
config.active_support.disallowed_deprecation = :raise | ||
|
||
config.active_support.disallowed_deprecation_warnings = [] | ||
|
||
config.active_record.migration_error = :page_load | ||
|
||
config.active_record.verbose_query_logs = true | ||
|
||
config.assets.debug = true | ||
|
||
config.assets.quiet = true | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
require "active_support/core_ext/integer/time" | ||
|
||
Rails.application.configure do | ||
config.cache_classes = true | ||
|
||
config.eager_load = true | ||
|
||
config.consider_all_requests_local = false | ||
config.action_controller.perform_caching = true | ||
|
||
config.public_file_server.enabled = ENV['RAILS_SERVE_STATIC_FILES'].present? | ||
|
||
config.assets.css_compressor = :purger | ||
|
||
config.assets.compile = false | ||
|
||
config.log_level = :info | ||
|
||
config.log_tags = [ :request_id ] | ||
|
||
config.i18n.fallbacks = true | ||
|
||
config.active_support.deprecation = :notify | ||
|
||
config.active_support.disallowed_deprecation = :log | ||
|
||
config.active_support.disallowed_deprecation_warnings = [] | ||
|
||
config.log_formatter = ::Logger::Formatter.new | ||
|
||
if ENV["RAILS_LOG_TO_STDOUT"].present? | ||
logger = ActiveSupport::Logger.new(STDOUT) | ||
logger.formatter = config.log_formatter | ||
config.logger = ActiveSupport::TaggedLogging.new(logger) | ||
end | ||
|
||
config.active_record.dump_schema_after_migration = false | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
require "active_support/core_ext/integer/time" | ||
|
||
Rails.application.configure do | ||
config.cache_classes = true | ||
|
||
config.eager_load = false | ||
|
||
config.public_file_server.enabled = true | ||
config.public_file_server.headers = { | ||
'Cache-Control' => "public, max-age=#{1.hour.to_i}" | ||
} | ||
|
||
config.consider_all_requests_local = true | ||
config.action_controller.perform_caching = false | ||
config.cache_store = :null_store | ||
|
||
config.action_dispatch.show_exceptions = false | ||
|
||
config.action_controller.allow_forgery_protection = false | ||
|
||
config.active_support.deprecation = :stderr | ||
|
||
config.active_support.disallowed_deprecation = :raise | ||
|
||
config.active_support.disallowed_deprecation_warnings = [] | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Rails.application.config.assets.version = '1.0' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Rails.application.config.action_dispatch.cookies_serializer = :json |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.config.filter_parameters += [ | ||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn | ||
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ActiveSupport.on_load(:action_controller) do | ||
wrap_parameters format: [:json] | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } | ||
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count } | ||
threads min_threads_count, max_threads_count | ||
|
||
worker_timeout 3600 if ENV.fetch("RAILS_ENV", "development") == "development" | ||
|
||
port ENV.fetch("PORT") { 3000 } | ||
|
||
environment ENV.fetch("RAILS_ENV") { "development" } | ||
|
||
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" } | ||
|
||
plugin :tmp_restart |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Rails.application.routes.draw do | ||
get 'posts', to: 'posts#index' | ||
end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
test: | ||
service: Disk | ||
root: <%= Rails.root.join("tmp/storage") %> | ||
|
||
local: | ||
service: Disk | ||
root: <%= Rails.root.join("storage") %> |
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>404</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>422</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<title>500</title> | ||
</head> | ||
<body> | ||
</body> | ||
</html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indentation