Skip to content

Commit

Permalink
Merge tag 'v1.6.29'
Browse files Browse the repository at this point in the history
# Conflicts:
#	Gemfile.lock
  • Loading branch information
jagthedrummer committed Feb 7, 2024
2 parents 36a9025 + b2476b8 commit 45a73af
Show file tree
Hide file tree
Showing 16 changed files with 335 additions and 252 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_run_super_scaffolding_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ jobs:
CIRCLE_NODE_INDEX: ${{ strategy.job-index }}

- name: 'Run Super Scaffolding Test'
run: bundle exec rails test test/system/super_scaffolding_test.rb test/system/super_scaffolding_partial_test.rb test/controllers/webhooks/incoming/some_provider_webhooks_controller_test.rb
run: bundle exec rails test test/system/super_scaffolding/super_scaffolding_test.rb test/system/super_scaffolding/partial_test.rb test/controllers/webhooks/incoming/some_provider_webhooks_controller_test.rb
working-directory: tmp/starter

- name: Test Summary
Expand Down
6 changes: 3 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ Untitled
# Ignore application configuration
/config/application.yml

# Ignore Active Storage
/storage

# Ignore IDE specific folders
.idea/

Expand All @@ -72,4 +69,7 @@ dump.rdb
# Ignore test reports generated by minitest-reporters
/test/reports

# Ignore output from rails-erd
erd.pdf

# 🚅 add your files to ignore here.
6 changes: 5 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,10 @@ group :test do
# Use system testing [https://guides.rubyonrails.org/testing.html#system-testing]
gem "capybara", "~> 3.39"

# Synchronize Capybara commands with client-side JavaScript and AJAX requests to greatly improve
# system test stability. Only works on the Selenium Driver though.
gem "capybara-lockstep"

# Selenium is the default default Capybara driver for system tests that ships with
# Rails. Cuprite is an alternative driver that uses Chrome's native DevTools protocol
# and offers improved speed and reliability, but only works with Chrome. If you want
Expand All @@ -108,7 +112,7 @@ end

# We use a constant here so that we can ensure that all of the bullet_train-*
# packages are on the same version.
BULLET_TRAIN_VERSION = "1.6.27"
BULLET_TRAIN_VERSION = "1.6.29"

# Core packages.
gem "bullet_train", BULLET_TRAIN_VERSION
Expand Down
86 changes: 46 additions & 40 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ GEM
bootsnap (1.17.1)
msgpack (~> 1.2)
builder (3.2.4)
bullet_train (1.6.27)
bullet_train (1.6.29)
awesome_print
bullet_train-has_uuid
bullet_train-roles
Expand Down Expand Up @@ -160,7 +160,7 @@ GEM
unicode-emoji
valid_email
xxhash
bullet_train-api (1.6.27)
bullet_train-api (1.6.29)
bullet_train
bullet_train-super_scaffolding
colorizer
Expand All @@ -171,59 +171,59 @@ GEM
pagy_cursor
rack-cors
rails (>= 6.0.0)
bullet_train-fields (1.6.27)
bullet_train-fields (1.6.29)
chronic
cloudinary
phonelib
rails (>= 6.0.0)
bullet_train-has_uuid (1.6.27)
bullet_train-has_uuid (1.6.29)
rails (>= 6.0.0)
bullet_train-incoming_webhooks (1.6.27)
bullet_train-incoming_webhooks (1.6.29)
bullet_train
bullet_train-api
bullet_train-super_scaffolding
rails (>= 6.0.0)
bullet_train-integrations (1.6.27)
bullet_train-integrations (1.6.29)
rails (>= 6.0.0)
bullet_train-integrations-stripe (1.6.27)
bullet_train-integrations-stripe (1.6.29)
omniauth
omniauth-rails_csrf_protection
omniauth-stripe-connect
rails (>= 6.0.0)
stripe
bullet_train-obfuscates_id (1.6.27)
bullet_train-obfuscates_id (1.6.29)
hashids
rails (>= 6.0.0)
bullet_train-outgoing_webhooks (1.6.27)
bullet_train-outgoing_webhooks (1.6.29)
public_suffix
rails (>= 6.0.0)
bullet_train-roles (1.6.27)
bullet_train-roles (1.6.29)
active_hash
activesupport
cancancan
bullet_train-routes (1.0.0)
rails (>= 6.0.0)
bullet_train-scope_questions (1.6.27)
bullet_train-scope_questions (1.6.29)
rails (>= 6.0.0)
bullet_train-scope_validator (1.6.27)
bullet_train-scope_validator (1.6.29)
rails
bullet_train-sortable (1.6.27)
bullet_train-sortable (1.6.29)
rails (>= 6.0.0)
bullet_train-super_load_and_authorize_resource (1.6.27)
bullet_train-super_load_and_authorize_resource (1.6.29)
cancancan
rails (>= 6.0.0)
bullet_train-super_scaffolding (1.6.27)
bullet_train-super_scaffolding (1.6.29)
colorizer
indefinite_article
masamune-ast (~> 2.0.2)
rails (>= 6.0.0)
bullet_train-themes (1.6.27)
bullet_train-themes (1.6.29)
rails (>= 6.0.0)
bullet_train-themes-light (1.6.27)
bullet_train-themes-light (1.6.29)
bullet_train-themes-tailwind_css
masamune-ast (~> 2.0.2)
rails (>= 6.0.0)
bullet_train-themes-tailwind_css (1.6.27)
bullet_train-themes-tailwind_css (1.6.29)
bullet_train
bullet_train-themes
rails (>= 6.0.0)
Expand All @@ -246,6 +246,11 @@ GEM
capybara-email (3.0.2)
capybara (>= 2.4, < 4.0)
mail
capybara-lockstep (2.1.0)
activesupport (>= 4.2)
capybara (>= 3.0)
ruby2_keywords
selenium-webdriver (>= 4.0)
charlock_holmes (0.7.7)
choice (0.2.0)
chronic (0.10.2)
Expand Down Expand Up @@ -393,7 +398,7 @@ GEM
activesupport (>= 4.1.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2023.1205)
mime-types-data (3.2024.0206)
mini_magick (4.12.0)
mini_mime (1.1.5)
mini_portile2 (2.8.5)
Expand All @@ -407,7 +412,7 @@ GEM
minitest (>= 5.0)
msgpack (1.7.2)
multi_xml (0.6.0)
multipart-post (2.3.0)
multipart-post (2.4.0)
mutex_m (0.2.0)
net-http (0.4.1)
uri
Expand Down Expand Up @@ -471,7 +476,7 @@ GEM
actionmailer (>= 3)
net-smtp
premailer (~> 1.7, >= 1.7.9)
prism (0.19.0)
prism (0.22.0)
pry (0.14.2)
coderay (~> 1.1)
method_source (~> 1.0)
Expand Down Expand Up @@ -647,7 +652,7 @@ GEM
stimulus-rails (1.3.0)
railties (>= 6.0.0)
stringio (3.0.8)
stripe (10.6.0)
stripe (10.7.1)
terser (1.1.20)
execjs (>= 0.3.0, < 3)
thor (1.3.0)
Expand Down Expand Up @@ -705,26 +710,27 @@ DEPENDENCIES
avo (>= 3.1.7)
aws-sdk-s3
bootsnap
bullet_train (= 1.6.27)
bullet_train-api (= 1.6.27)
bullet_train-fields (= 1.6.27)
bullet_train-has_uuid (= 1.6.27)
bullet_train-incoming_webhooks (= 1.6.27)
bullet_train-integrations (= 1.6.27)
bullet_train-integrations-stripe (= 1.6.27)
bullet_train-obfuscates_id (= 1.6.27)
bullet_train-outgoing_webhooks (= 1.6.27)
bullet_train-roles (= 1.6.27)
bullet_train-scope_questions (= 1.6.27)
bullet_train-scope_validator (= 1.6.27)
bullet_train-sortable (= 1.6.27)
bullet_train-super_load_and_authorize_resource (= 1.6.27)
bullet_train-super_scaffolding (= 1.6.27)
bullet_train-themes (= 1.6.27)
bullet_train-themes-light (= 1.6.27)
bullet_train-themes-tailwind_css (= 1.6.27)
bullet_train (= 1.6.29)
bullet_train-api (= 1.6.29)
bullet_train-fields (= 1.6.29)
bullet_train-has_uuid (= 1.6.29)
bullet_train-incoming_webhooks (= 1.6.29)
bullet_train-integrations (= 1.6.29)
bullet_train-integrations-stripe (= 1.6.29)
bullet_train-obfuscates_id (= 1.6.29)
bullet_train-outgoing_webhooks (= 1.6.29)
bullet_train-roles (= 1.6.29)
bullet_train-scope_questions (= 1.6.29)
bullet_train-scope_validator (= 1.6.29)
bullet_train-sortable (= 1.6.29)
bullet_train-super_load_and_authorize_resource (= 1.6.29)
bullet_train-super_scaffolding (= 1.6.29)
bullet_train-themes (= 1.6.29)
bullet_train-themes-light (= 1.6.29)
bullet_train-themes-tailwind_css (= 1.6.29)
capybara (~> 3.39)
capybara-email
capybara-lockstep
chronic
colorize
commonmarker (~> 1.0.0.pre10)
Expand Down
17 changes: 17 additions & 0 deletions app/assets/stylesheets/application.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
/* The theme's stylesheet initializes tailwindcss and imports the theme's default styles.
The $ThemeStylesheet path is evaluated via a postcss resolver, which finds the theme's
main stylesheet within the theme's gem.
To control the order of the tailwindcss imports further, you can eject the theme's
stylesheet locally using the following command, which will take precedence.
> rake bullet_train:themes:light:eject_css
Read more: https://bullettrain.co/docs/stylesheets
*/
@import "$ThemeStylesheet";

/* ✅ YOUR APPLICATION'S CSS */
/* If you need to customize your application's CSS, this is the place to do it. This helps
avoid merge conflicts in the future when Rails or Bullet Train update their own CSS.
*/
2 changes: 2 additions & 0 deletions app/views/layouts/_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,6 @@

<%= render 'magic_test/support' if Rails.env.test? %>
<%= capybara_lockstep if defined?(Capybara::Lockstep) %>
<% # put your application-specific additions below to avoid merge conflicts later. %>
14 changes: 13 additions & 1 deletion bin/theme
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ when "tailwind-mailer-config"
["/tailwind.mailer.#{theme}.config.js", "/tailwind.#{theme}.config.js"]
when "tailwind-stylesheet"
["/app/assets/stylesheets/#{theme}.tailwind.css", nil]
when "stylesheets-dir"
["/app/assets/stylesheets/#{theme}/", nil]
when "javascript"
["/app/javascript/application.#{theme}.js", nil]
when "postcss-import-config"
["/postcss-import-config.js", nil]
else
raise "Sorry, we couldn't recognize the file you're looking for: \"#{file_type}\""
end
Expand All @@ -49,4 +53,12 @@ end
find_file(file_path)
find_file(fallback_file_path) if fallback_file_path

raise "Sorry, we couldn't find `#{file_path}` in any of the following paths: #{@candidate_paths.join(", ")}"
if file_type == "postcss-import-config" && @candidate_paths.size == 1 && @candidate_paths.first == Dir.pwd
raise <<~ERROR
It looks like you're using an ejected theme and you don't have a `postcss-import-config.js` file in your project.
Use the following command to copy the default `postcss-import-config.js` file to your project:
> bin/resolve postcss-import-config.js --eject
ERROR
else
raise "Sorry, we couldn't find `#{file_path}` in any of the following paths: #{@candidate_paths.join(", ")}"
end
4 changes: 4 additions & 0 deletions config/environments/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@
# TODO for some reason this doesn't seem to be doing anything.
config.active_job.queue_adapter = :inline

if defined?(Capybara::Lockstep)
config.middleware.insert_before 0, Capybara::Lockstep::Middleware
end

# ✅ YOUR APPLICATION'S CONFIGURATION
# If you need to customize your application's configuration, this is the place to do it. This helps avoid merge
# conflicts in the future when Rails or Bullet Train update their own default settings.
Expand Down
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "app",
"private": true,
"dependencies": {
"@bullet-train/bullet-train": "1.6.27",
"@bullet-train/bullet-train-sortable": "1.6.27",
"@bullet-train/fields": "1.6.27",
"@bullet-train/bullet-train": "1.6.29",
"@bullet-train/bullet-train-sortable": "1.6.29",
"@bullet-train/fields": "1.6.29",
"@esbuild-plugins/node-globals-polyfill": "^0.2.3",
"@fullhuman/postcss-purgecss": "5.0.0",
"@hotwired/turbo-rails": "^7.3.0",
Expand All @@ -20,11 +20,11 @@
"autoprefixer": "^10.4.17",
"cable_ready": "^5.0.3",
"dragula": "^3.7.3",
"esbuild": "^0.19.11",
"esbuild": "^0.20.0",
"glob": "^10.3.10",
"jquery": "^3.7.0",
"jstz": "^2.1.1",
"postcss": "^8.4.33",
"postcss": "^8.4.34",
"postcss-css-variables": "^0.19.0",
"postcss-extend-rule": "^4.0.0",
"postcss-import": "^16.0.0",
Expand All @@ -37,7 +37,7 @@
"scripts": {
"build": "THEME=\"light\" node esbuild.config.js",
"build:css": "bin/link; THEME=\"light\" yarn build; yarn light:build:css; yarn light:build:mailer:css",
"light:build:css": "THEME=\"light\" NODE_PATH=./node_modules tailwindcss -c tailwind.config.js -i $(bundle exec bin/theme tailwind-stylesheet light) -o ./app/assets/builds/application.light.css --postcss ./postcss.config.js",
"light:build:mailer:css": "NODE_PATH=./node_modules tailwindcss -c $(bundle exec bin/theme tailwind-mailer-config light) -i $(bundle exec bin/theme tailwind-stylesheet light) -o ./app/assets/builds/application.mailer.light.css --postcss ./postcss.mailer.config.js"
"light:build:css": "THEME=\"light\" NODE_PATH=./node_modules tailwindcss -c tailwind.config.js -i ./app/assets/stylesheets/application.css -o ./app/assets/builds/application.light.css --postcss ./postcss.config.js",
"light:build:mailer:css": "THEME=\"light\" NODE_PATH=./node_modules tailwindcss -c $(bundle exec bin/theme tailwind-mailer-config light) -i $(bundle exec bin/theme tailwind-stylesheet light) -o ./app/assets/builds/application.mailer.light.css --postcss ./postcss.mailer.config.js"
}
}
7 changes: 6 additions & 1 deletion postcss.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const { execSync } = require("child_process");

const postcssImportConfigFile = execSync(`bundle exec bin/theme postcss-import-config ${process.env.THEME}`).toString().trim()
const postcssImportConfig = require(postcssImportConfigFile)

module.exports = {
plugins: [
require('postcss-import'),
require('postcss-import')(postcssImportConfig),
require('postcss-extend-rule'),
require('postcss-nested'),
require('tailwindcss'),
Expand Down
7 changes: 6 additions & 1 deletion postcss.mailer.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
const { execSync } = require("child_process");

const postcssImportConfigFile = execSync(`bundle exec bin/theme postcss-import-config ${process.env.THEME}`).toString().trim()
const postcssImportConfig = require(postcssImportConfigFile)

module.exports = {
plugins: [
require('postcss-import'),
require('postcss-import')(postcssImportConfig),
require('postcss-extend-rule'),
require('postcss-nested'),
require('tailwindcss'),
Expand Down
19 changes: 2 additions & 17 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,6 @@
end
Capybara.default_driver = Capybara.javascript_driver = :bt_cuprite
else # Selenium

# TODO: Ideally we shouldn't have to register this driver. Once a new version of
# capybara > 3.39.2 is released we should be able to remove this entire block.
# https://github.com/teamcapybara/capybara/pull/2726
Capybara.register_driver :selenium_chrome_headless do |app|
version = Capybara::Selenium::Driver.load_selenium
options_key = Capybara::Selenium::Driver::CAPS_VERSION.satisfied_by?(version) ? :capabilities : :options
browser_options = Selenium::WebDriver::Chrome::Options.new.tap do |opts|
opts.add_argument("--headless=new")
opts.add_argument("--disable-gpu") if Gem.win_platform?
# Workaround https://bugs.chromium.org/p/chromedriver/issues/detail?id=2650&q=load&sort=-id&colspec=ID%20Status%20Pri%20Owner%20Summary
opts.add_argument("--disable-site-isolation-trials")
end

Capybara::Selenium::Driver.new(app, **{:browser => :chrome, options_key => browser_options})
end

Capybara.javascript_driver = ENV["MAGIC_TEST"].present? ? :selenium_chrome : :selenium_chrome_headless
Capybara.default_driver = ENV["MAGIC_TEST"].present? ? :selenium_chrome : :selenium_chrome_headless
end
Expand Down Expand Up @@ -77,6 +60,8 @@ def self.use_cuprite?
include Warden::Test::Helpers
include Waiting

# Capybara::Lockstep.debug = true # Uncomment to inspect and verify the integration in your app.

def example_password
@example_password ||= SecureRandom.hex
end
Expand Down
Loading

0 comments on commit 45a73af

Please sign in to comment.