Skip to content

Commit b9b0ec7

Browse files
authored
Merge pull request #2085 from ViewComponent/v4
v4.0.0.rc1 release
2 parents a531d9d + 66ee8ad commit b9b0ec7

File tree

220 files changed

+8964
-2739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

220 files changed

+8964
-2739
lines changed

.erb-lint.yml

Lines changed: 0 additions & 9 deletions
This file was deleted.

.erb_lint.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
EnableDefaultLinters: true
3+
exclude:
4+
- '**/vendor/**/*'
5+
linters:
6+
ErbSafety:
7+
enabled: true
8+
FinalNewline:
9+
enabled: true
10+
Rubocop:
11+
enabled: true
12+
rubocop_config:
13+
inherit_from:
14+
- .rubocop.yml
15+
Layout/InitialIndentation:
16+
Enabled: false
17+
Layout/TrailingEmptyLines:
18+
Enabled: false

.github/workflows/ci.yml

Lines changed: 8 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -23,60 +23,20 @@ jobs:
2323
bundle exec appraisal rails-8.0 rake partial_benchmark
2424
bundle exec appraisal rails-8.0 rake translatable_benchmark
2525
test:
26-
name: test (${{ matrix.rails_version }}, ${{ matrix.ruby_version }}, ${{ matrix.mode }})
26+
name: test (Rails ${{ matrix.rails_version }}, Ruby ${{ matrix.ruby_version }})
2727
runs-on: ubuntu-latest
2828
strategy:
2929
fail-fast: false
3030
matrix:
3131
include:
32-
- ruby_version: "3.0"
33-
rails_version: "6.1"
34-
mode: "capture_patch_enabled"
35-
- ruby_version: "3.0"
36-
rails_version: "6.1"
37-
mode: "capture_patch_disabled"
38-
- ruby_version: "3.1"
39-
rails_version: "7.0"
40-
mode: "capture_patch_enabled"
41-
- ruby_version: "3.1"
42-
rails_version: "7.0"
43-
mode: "capture_patch_disabled"
4432
- ruby_version: "3.2"
4533
rails_version: "7.1"
46-
mode: "capture_patch_enabled"
47-
- ruby_version: "3.2"
48-
rails_version: "7.1"
49-
mode: "capture_patch_disabled"
50-
- ruby_version: "3.3"
51-
rails_version: "7.2"
52-
mode: "capture_patch_disabled"
5334
- ruby_version: "3.3"
5435
rails_version: "7.2"
55-
mode: "capture_patch_enabled"
56-
- ruby_version: "3.3"
57-
rails_version: "8.0"
58-
mode: "capture_patch_disabled"
59-
- ruby_version: "3.3"
60-
rails_version: "8.0"
61-
mode: "capture_patch_enabled"
62-
- ruby_version: "3.4"
63-
rails_version: "8.0"
64-
mode: "capture_patch_disabled"
6536
- ruby_version: "3.4"
6637
rails_version: "8.0"
67-
mode: "capture_patch_enabled"
68-
- ruby_version: "3.4"
69-
rails_version: "main"
70-
mode: "capture_patch_disabled"
71-
- ruby_version: "3.4"
72-
rails_version: "main"
73-
mode: "capture_patch_enabled"
74-
- ruby_version: "3.5"
75-
rails_version: "8.0"
76-
mode: "capture_patch_disabled"
77-
- ruby_version: "3.5"
78-
rails_version: "8.0"
79-
mode: "capture_patch_enabled"
38+
# - ruby_version: "head"
39+
# rails_version: "main"
8040
env:
8141
BUNDLE_GEMFILE: gemfiles/rails_${{ matrix.rails_version }}.gemfile
8242
steps:
@@ -87,17 +47,13 @@ jobs:
8747
ruby-version: ${{ matrix.ruby_version }}
8848
bundler-cache: true
8949
- name: Build and test with Rake
90-
# Code-reloading isn't compatible with simplecov, so we need to run once
91-
# to collect coverage, and again to test reloads.
9250
run: |
93-
bundle exec appraisal rails-${{ matrix.rails_version }} bundle
94-
MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
95-
ENABLE_RELOADING=true bundle exec appraisal rails-${{ matrix.rails_version }} rake
51+
bundle exec appraisal rails-${{ matrix.rails_version }} bundle --quiet
52+
MEASURE_COVERAGE=true bundle exec appraisal rails-${{ matrix.rails_version }} rake all_tests
9653
env:
9754
RAISE_ON_WARNING: 1
9855
RAILS_VERSION: ${{ matrix.rails_version }}
9956
RUBY_VERSION: ${{ matrix.ruby_version }}
100-
CAPTURE_PATCH_ENABLED: ${{ matrix.mode == 'capture_patch_enabled' && 'true' || 'false' }}
10157
- name: Upload coverage results
10258
uses: actions/[email protected]
10359
if: always()
@@ -113,6 +69,7 @@ jobs:
11369
with:
11470
repository: 'primer/view_components'
11571
path: 'primer_view_components'
72+
ref: '20250603-vc-compat'
11673
- uses: actions/[email protected]
11774
with:
11875
path: 'view_component'
@@ -132,10 +89,10 @@ jobs:
13289
cd primer_view_components
13390
npm ci
13491
cd demo && npm ci && cd ..
135-
bundle && bundle exec rake
92+
bundle --quiet && bundle exec rake
13693
env:
13794
VIEW_COMPONENT_PATH: ../view_component
138-
RAILS_VERSION: '7.1.1'
95+
RAILS_VERSION: '7.1.5'
13996
PARALLEL_WORKERS: '1'
14097
coverage:
14198
needs: test

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,12 @@ jobs:
7474
- uses: actions/cache@v4
7575
with:
7676
path: vendor/bundle
77-
key: gems-build-rails-7.1-ruby-3.2-${{ hashFiles('**/Gemfile.lock') }}
77+
key: gems-build-rails-8-ruby-3.2-${{ hashFiles('**/Gemfile.lock') }}
7878
- name: Lint with Rubocop and ERB Lint
7979
run: |
8080
bundle config path vendor/bundle
8181
bundle update
8282
bundle exec standardrb -r "rubocop-md"
83-
bundle exec erblint **/*.html.erb
83+
bundle exec erb_lint --lint-all
8484
env:
85-
RAILS_VERSION: '~> 7.1.0'
85+
RAILS_VERSION: '~> 8'

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
*.gem
22
*.rbc
33
.ruby-version
4+
.DS_Store
45
/.config
56
/coverage/assets
67
/coverage/index.html

.rubocop.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
ruby_version: 2.5
21
require:
32
- standard
4-
- "rubocop-md"
3+
plugins:
4+
- rubocop-md
55
inherit_gem:
66
standard: config/base.yml

.standard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
ruby_version: 2.5
1+
ruby_version: 3.2
22
ignore:
33
- 'docs/CHANGELOG.md' # Rubocop doesn't like our indenting of code examples

Appraisals

Lines changed: 8 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,46 +1,26 @@
11
# frozen_string_literal: true
22

3-
appraise "rails-6.1" do
4-
gem "rails", "~> 6.1"
5-
gem "tailwindcss-rails", "~> 2.0"
6-
gem "sprockets-rails", "~> 3.4.2"
7-
gem "concurrent-ruby", "1.3.4"
8-
9-
# Required for Ruby 3.1.0
10-
gem "net-smtp", require: false
11-
gem "net-imap", require: false
12-
gem "net-pop", require: false
13-
gem "turbo-rails", "~> 1"
14-
end
15-
16-
appraise "rails-7.0" do
17-
gem "rails", "~> 7.0"
18-
gem "tailwindcss-rails", "~> 2.0"
19-
gem "turbo-rails", "~> 1"
20-
gem "sprockets-rails", "~> 3.4.2"
21-
end
22-
233
appraise "rails-7.1" do
244
gem "rails", "~> 7.1"
25-
gem "tailwindcss-rails", "~> 2.0"
5+
gem "tailwindcss-rails", "~> 2"
266
gem "turbo-rails", "~> 1"
27-
gem "sprockets-rails", "~> 3.4.2"
287
end
298

309
appraise "rails-7.2" do
3110
gem "rails", "~> 7.2"
32-
gem "tailwindcss-rails", "~> 2.0"
33-
gem "sprockets-rails", "~> 3.4.2"
11+
gem "tailwindcss-rails", "~> 2"
12+
gem "turbo-rails", "~> 2"
3413
end
3514

3615
appraise "rails-8.0" do
3716
gem "rails", "~> 8.0"
38-
gem "tailwindcss-rails", "~> 2.0"
39-
gem "propshaft", "~> 1.1.0"
17+
gem "tailwindcss-rails", "~> 2"
18+
gem "turbo-rails", "~> 2"
4019
end
4120

4221
appraise "rails-main" do
22+
gem "rack", git: "https://github.com/rack/rack", ref: "8a4475a9f416a72e5b02bd7817e4a8ed684f29b0"
4323
gem "rails", github: "rails/rails", branch: "main"
44-
gem "tailwindcss-rails", "~> 2.0"
45-
gem "turbo-rails", "~> 1"
24+
gem "tailwindcss-rails", "~> 2"
25+
gem "turbo-rails", "~> 2"
4626
end

Gemfile

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,42 @@ source "https://rubygems.org"
44
gemspec
55

66
rails_version = (ENV["RAILS_VERSION"] || "~> 8").to_s
7+
78
gem "rails", (rails_version == "main") ? {git: "https://github.com/rails/rails", ref: "main"} : rails_version
89

910
ruby_version = (ENV["RUBY_VERSION"] || "~> 3.4").to_s
1011
ruby ruby_version
12+
13+
group :development, :test do
14+
gem "allocation_stats"
15+
gem "appraisal", "~> 2"
16+
gem "benchmark-ips", "~> 2"
17+
gem "better_html"
18+
gem "bundler", "~> 2"
19+
gem "capybara", "~> 3"
20+
gem "cuprite"
21+
gem "dry-initializer", require: true
22+
gem "erb_lint"
23+
gem "haml", "~> 6"
24+
gem "jbuilder", "~> 2"
25+
gem "m", "~> 1"
26+
gem "method_source", "~> 1"
27+
gem "minitest", "~> 5"
28+
gem "propshaft", "~> 1"
29+
gem "puma", "~> 6"
30+
gem "rake", "~> 13"
31+
gem "rails-dom-testing", "~> 2.3.0"
32+
gem "redis"
33+
gem "rspec-rails", "~> 7"
34+
gem "rubocop-md", "~> 2"
35+
gem "selenium-webdriver", "~> 4"
36+
gem "simplecov-console", "< 1"
37+
gem "simplecov", "< 1"
38+
gem "slim", "~> 5"
39+
gem "sprockets-rails", "~> 3"
40+
gem "standard", "~> 1"
41+
gem "turbo-rails"
42+
gem "warning"
43+
gem "yard-activesupport-concern", "< 1"
44+
gem "yard", "< 1"
45+
end

0 commit comments

Comments
 (0)