ruact 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +110 -48
  3. data/CONTRIBUTING.md +233 -0
  4. data/README.md +14 -4
  5. data/RELEASING.md +125 -139
  6. data/lib/ruact/packaging.rb +68 -0
  7. data/lib/ruact/version.rb +1 -1
  8. data/vendor/javascript/vite-plugin-ruact/flight-client.test.mjs +321 -0
  9. data/vendor/javascript/vite-plugin-ruact/package-lock.json +11 -0
  10. data/vendor/javascript/vite-plugin-ruact/package.json +1 -0
  11. data/vendor/javascript/vite-plugin-ruact/runtime/flight-client.js +14 -3
  12. metadata +6 -107
  13. data/.codecov.yml +0 -31
  14. data/.github/workflows/ci.yml +0 -284
  15. data/.github/workflows/server-functions-bench.yml +0 -54
  16. data/.rubocop.yml +0 -107
  17. data/.rubocop_todo.yml +0 -63
  18. data/Rakefile +0 -10
  19. data/bench/server_functions_dispatch_bench.rb +0 -276
  20. data/bench/server_functions_dispatch_bench.results.md +0 -150
  21. data/docs/internal/README.md +0 -9
  22. data/docs/internal/decisions/server-functions-api.md +0 -2236
  23. data/spec/benchmarks/baseline.json +0 -12
  24. data/spec/benchmarks/render_pipeline_benchmark_spec.rb +0 -109
  25. data/spec/fixtures/flight/README.md +0 -136
  26. data/spec/fixtures/flight/array.txt +0 -1
  27. data/spec/fixtures/flight/as_json_object.txt +0 -2
  28. data/spec/fixtures/flight/bigint.txt +0 -1
  29. data/spec/fixtures/flight/boolean_false.txt +0 -1
  30. data/spec/fixtures/flight/boolean_true.txt +0 -1
  31. data/spec/fixtures/flight/client_component_with_props.txt +0 -2
  32. data/spec/fixtures/flight/client_reference.txt +0 -2
  33. data/spec/fixtures/flight/hash.txt +0 -1
  34. data/spec/fixtures/flight/infinity.txt +0 -1
  35. data/spec/fixtures/flight/nan.txt +0 -1
  36. data/spec/fixtures/flight/negative_infinity.txt +0 -1
  37. data/spec/fixtures/flight/nil.txt +0 -1
  38. data/spec/fixtures/flight/number_float.txt +0 -1
  39. data/spec/fixtures/flight/number_integer.txt +0 -1
  40. data/spec/fixtures/flight/react_element_no_props.txt +0 -1
  41. data/spec/fixtures/flight/redirect_row.txt +0 -1
  42. data/spec/fixtures/flight/serializable_object.txt +0 -2
  43. data/spec/fixtures/flight/string_basic.txt +0 -1
  44. data/spec/fixtures/flight/string_dollar_escape.txt +0 -1
  45. data/spec/fixtures/flight/undefined.txt +0 -1
  46. data/spec/fixtures/readme/children-error.html.erb +0 -3
  47. data/spec/fixtures/readme/children-error.txt +0 -1
  48. data/spec/fixtures/story_7_9_views/controller_request_spec_support/demo/show.html.erb +0 -3
  49. data/spec/fixtures/story_7_9_views/controller_request_spec_support/errors_demo/new.html.erb +0 -3
  50. data/spec/fixtures/story_7_9_views/controller_request_spec_support/exploding_layout_demo/show.html.erb +0 -3
  51. data/spec/fixtures/story_7_9_views/controller_request_spec_support/ghost_layout_demo/show.html.erb +0 -3
  52. data/spec/fixtures/story_7_9_views/controller_request_spec_support/layout_demo/show.html.erb +0 -3
  53. data/spec/fixtures/story_7_9_views/controller_request_spec_support/rootless_layout_demo/show.html.erb +0 -3
  54. data/spec/fixtures/story_7_9_views/controller_request_spec_support/unwired_layout_demo/show.html.erb +0 -3
  55. data/spec/fixtures/story_7_9_views/layouts/bare_host.html.erb +0 -16
  56. data/spec/fixtures/story_7_9_views/layouts/exploding_host.html.erb +0 -24
  57. data/spec/fixtures/story_7_9_views/layouts/rootless_host.html.erb +0 -15
  58. data/spec/fixtures/story_7_9_views/layouts/ruact_host.html.erb +0 -17
  59. data/spec/readme_demo_message_spec.rb +0 -67
  60. data/spec/readme_spec.rb +0 -282
  61. data/spec/ruact/client_manifest_spec.rb +0 -270
  62. data/spec/ruact/component_contract_spec.rb +0 -119
  63. data/spec/ruact/configuration_spec.rb +0 -518
  64. data/spec/ruact/controller_request_spec.rb +0 -671
  65. data/spec/ruact/controller_spec.rb +0 -343
  66. data/spec/ruact/doctor_spec.rb +0 -769
  67. data/spec/ruact/erb_preprocessor_hook_spec.rb +0 -55
  68. data/spec/ruact/erb_preprocessor_spec.rb +0 -361
  69. data/spec/ruact/errors_spec.rb +0 -93
  70. data/spec/ruact/flight/renderer_spec.rb +0 -133
  71. data/spec/ruact/flight/serializer_spec.rb +0 -494
  72. data/spec/ruact/html_converter_spec.rb +0 -375
  73. data/spec/ruact/install_generator_spec.rb +0 -1549
  74. data/spec/ruact/layout_source_spec.rb +0 -108
  75. data/spec/ruact/manifest_resolver_spec.rb +0 -174
  76. data/spec/ruact/query_request_spec.rb +0 -706
  77. data/spec/ruact/query_spec.rb +0 -105
  78. data/spec/ruact/railtie_spec.rb +0 -155
  79. data/spec/ruact/render_context_spec.rb +0 -58
  80. data/spec/ruact/render_pipeline_concurrency_spec.rb +0 -78
  81. data/spec/ruact/render_pipeline_spec.rb +0 -928
  82. data/spec/ruact/scaffold_generator_spec.rb +0 -1849
  83. data/spec/ruact/serializable_spec.rb +0 -179
  84. data/spec/ruact/server_bucket_request_spec.rb +0 -785
  85. data/spec/ruact/server_function_name_spec.rb +0 -53
  86. data/spec/ruact/server_functions/backtrace_cleaner_spec.rb +0 -63
  87. data/spec/ruact/server_functions/bucket_two_payload_spec.rb +0 -200
  88. data/spec/ruact/server_functions/codegen_spec.rb +0 -397
  89. data/spec/ruact/server_functions/error_payload_spec.rb +0 -222
  90. data/spec/ruact/server_functions/error_suggestion_spec.rb +0 -79
  91. data/spec/ruact/server_functions/introspection_spec.rb +0 -135
  92. data/spec/ruact/server_functions/name_bridge_spec.rb +0 -212
  93. data/spec/ruact/server_functions/query_context_spec.rb +0 -72
  94. data/spec/ruact/server_functions/query_source_spec.rb +0 -193
  95. data/spec/ruact/server_functions/railtie_integration_spec.rb +0 -215
  96. data/spec/ruact/server_functions/rake_spec.rb +0 -86
  97. data/spec/ruact/server_functions/route_source_spec.rb +0 -202
  98. data/spec/ruact/server_functions/snapshot_spec.rb +0 -96
  99. data/spec/ruact/server_functions/snapshot_writer_spec.rb +0 -71
  100. data/spec/ruact/server_rescue_request_spec.rb +0 -416
  101. data/spec/ruact/server_spec.rb +0 -179
  102. data/spec/ruact/server_upload_request_spec.rb +0 -311
  103. data/spec/ruact/signed_references_spec.rb +0 -164
  104. data/spec/ruact/string_distance_spec.rb +0 -38
  105. data/spec/ruact/tasks_json_introspection_spec.rb +0 -141
  106. data/spec/ruact/testing/have_ruact_component_spec.rb +0 -170
  107. data/spec/ruact/testing/no_production_load_spec.rb +0 -41
  108. data/spec/ruact/validation_errors_spec.rb +0 -116
  109. data/spec/ruact/view_helper_spec.rb +0 -131
  110. data/spec/spec_helper.rb +0 -77
  111. data/spec/support/fixtures/pixel.png +0 -0
  112. data/spec/support/flight_wire_parser.rb +0 -21
  113. data/spec/support/flight_wire_parser_spec.rb +0 -93
  114. data/spec/support/matchers/flight_fixture_matcher.rb +0 -130
  115. data/spec/support/matchers/flight_fixture_matcher_spec.rb +0 -250
  116. data/spec/support/rails_stub.rb +0 -115
@@ -1,284 +0,0 @@
1
- name: CI
2
-
3
- on:
4
- push:
5
- branches: [main]
6
- pull_request:
7
- branches: [main]
8
-
9
- # Note: this workflow runs in the `luizcg/ruact` repo, where the gem source
10
- # lives at the repo root (no `gem/` subdirectory). The previous version had
11
- # `working-directory: gem` on every step, copy-pasted from a monorepo layout;
12
- # every run since the initial commit failed at `setup-ruby` with
13
- # `ENOENT: no such file or directory, chdir 'gem'`. The e2e jobs depended
14
- # on an `e2e/` Rails app that lives in the planning monorepo, not in this
15
- # repo, and likewise could never run here. Both issues fixed in Story 6.7.
16
-
17
- jobs:
18
- name-propagation:
19
- # Required status check — fails if the legacy gem name or the legacy
20
- # API-surface prefix appear in user-facing files. Two complementary
21
- # guards:
22
- #
23
- # (a) Story 5.1 — guards against the legacy gem-name regression
24
- # (the `rails[_-]rsc` / PascalCase form). The legacy names are
25
- # written here in the same regex-character-class form that the
26
- # grep step itself uses, so this workflow file stays grep-clean
27
- # under its own checks.
28
- # (b) Story 5.12 — guards against the residual legacy prefix on the
29
- # API surface (controller methods, header name, Rake task, view
30
- # helper, token format, Serializable DSL) being re-introduced
31
- # after the pre-v0.1.0 clean cut.
32
- #
33
- # Exclusion list mirrors the AC1 / AC6 contracts exactly: CHANGELOG.md
34
- # (historical record), doc/ (generated YARD), *.gem (built artifacts).
35
- name: No legacy gem-name or legacy-prefix API references
36
- runs-on: ubuntu-latest
37
- steps:
38
- - uses: actions/checkout@v5
39
- - name: Grep for legacy gem-name references (Story 5.1)
40
- # Pattern is assembled from concatenated string fragments so this
41
- # very workflow file is grep-clean even though it talks about the
42
- # legacy names — that lets the canonical exclusion list stay at
43
- # three entries (Story 5.1 review F4).
44
- run: |
45
- PATTERN='rails[_-]rsc|Rails''Rsc'
46
- if git grep -nE "$PATTERN" -- \
47
- ':!CHANGELOG.md' \
48
- ':!doc/' \
49
- ':!*.gem'; then
50
- echo "::error::Legacy gem-name reference found in user-facing file."
51
- echo "::error::Rename to 'ruact' / 'Ruact'. See Story 5.1 in _bmad-output/implementation-artifacts/."
52
- exit 1
53
- fi
54
- echo "::notice::No legacy gem-name references found."
55
- - name: Grep for residual rsc_* API references (Story 5.12)
56
- # AC1 of Story 5.12: every identifier renamed in the clean cut.
57
- # Uses Perl mode (-P) for word boundaries. Pattern fragments are
58
- # split with $R / $RU shell-vars so this workflow file is itself
59
- # grep-clean — the file contains `${R}` / `${RU}` references, not
60
- # literal `rsc` / `RSC` strings that would match the pattern (same
61
- # strategy as Story 5.1 review F4).
62
- #
63
- # Coverage (Story 5.12 review F5 — broaden beyond curated list):
64
- # - any <legacy>_<identifier> (catches private helpers),
65
- # - any __<legacy>_<X>__ helper,
66
- # - any __<UPPER>_<X>__ token format,
67
- # - any data-<legacy> / data-<legacy>-<X> DOM attribute,
68
- # - the [-:] router / suspense / doctor literals,
69
- # - the legacy Request HTTP header,
70
- # - the legacy lib/tasks/<legacy>.rake file path.
71
- # Literals are intentionally written with placeholder text so this
72
- # workflow file is itself grep-clean under its own regex.
73
- run: |
74
- R='rsc'
75
- RU="$(printf '%s' "$R" | tr a-z A-Z)"
76
- PATTERN="\\b(${R}_\\w+|__${R}_\\w+__|__${RU}_\\w*[0-9]+__|data-${R}(-\\w+|=)|${R}[-:](router|suspense|doctor)|${RU}-Request|lib/tasks/${R}\\.rake)\\b"
77
- if git grep -nP "$PATTERN" -- \
78
- ':!CHANGELOG.md' \
79
- ':!doc/' \
80
- ':!*.gem' \
81
- ':!coverage/'; then
82
- echo "::error::Residual rsc_* API reference found in gem source."
83
- echo "::error::Rename to the ruact_* equivalent. See Story 5.12 in _bmad-output/implementation-artifacts/."
84
- exit 1
85
- fi
86
- echo "::notice::No residual rsc_* API references found."
87
-
88
- rspec:
89
- # Required status check — all 8 matrix combinations must pass to merge.
90
- name: RSpec (Ruby ${{ matrix.ruby }} / Rails ${{ matrix.rails }})
91
- runs-on: ubuntu-latest
92
- strategy:
93
- fail-fast: false
94
- matrix:
95
- ruby: ["3.2", "3.3"]
96
- rails: ["7.0", "7.1", "7.2", "8.0"]
97
- env:
98
- RAILS_VERSION: ${{ matrix.rails }}
99
- # The Gemfile injects `gem "rails", "~> #{ENV['RAILS_VERSION']}"` for
100
- # matrix testing, but Gemfile.lock cannot pin all four Rails versions
101
- # at once. `bundler-cache: true` defaults to deployment/frozen mode
102
- # which rejects any Gemfile change vs lockfile, so disable that here
103
- # while keeping the gem cache for everything else.
104
- BUNDLE_DEPLOYMENT: "false"
105
- BUNDLE_FROZEN: "false"
106
- steps:
107
- - uses: actions/checkout@v5
108
- - uses: ruby/setup-ruby@v1
109
- with:
110
- ruby-version: ${{ matrix.ruby }}
111
- bundler-cache: true
112
- - name: Run RSpec
113
- run: bundle exec rspec --format progress
114
- - name: Upload coverage to Codecov
115
- # Upload from one canonical matrix cell only (Ruby 3.3 × Rails 7.2)
116
- # to avoid quota burn and Codecov-side flag merge conflicts. Other
117
- # cells run RSpec but skip the upload. `success()` ensures we never
118
- # upload partial/aborted runs. `fail_ci_if_error: false` keeps a
119
- # Codecov outage from reddening a build whose tests passed.
120
- if: matrix.ruby == '3.3' && matrix.rails == '7.2' && success()
121
- uses: codecov/codecov-action@v5
122
- with:
123
- token: ${{ secrets.CODECOV_TOKEN }}
124
- files: coverage/lcov.info
125
- flags: gem
126
- fail_ci_if_error: false
127
-
128
- rubocop:
129
- # Required status check.
130
- name: RuboCop
131
- runs-on: ubuntu-latest
132
- steps:
133
- - uses: actions/checkout@v5
134
- - uses: ruby/setup-ruby@v1
135
- with:
136
- ruby-version: "3.3"
137
- bundler-cache: true
138
- - name: Run RuboCop
139
- run: bundle exec rubocop --format github
140
-
141
- yard:
142
- # Required status check — fails if any public method is missing YARD docs.
143
- name: YARD Docs
144
- runs-on: ubuntu-latest
145
- steps:
146
- - uses: actions/checkout@v5
147
- - uses: ruby/setup-ruby@v1
148
- with:
149
- ruby-version: "3.3"
150
- bundler-cache: true
151
- - name: Validate YARD docs
152
- run: bundle exec yard --fail-on-warning
153
-
154
- js:
155
- # Required status check — the bundled Vite plugin's JS suite. Runs the
156
- # vitest codegen tests (incl. the Ruby↔JS byte-parity cases, which shell out
157
- # to `ruby` — hence Ruby is set up alongside Node) and, Story 13.4, the
158
- # `tsc --noEmit` type-level test that proves the emitted typed-query accessor
159
- # signatures are enforced at compile time (FR99 / AC6).
160
- name: JS (vite-plugin codegen + typecheck)
161
- runs-on: ubuntu-latest
162
- defaults:
163
- run:
164
- working-directory: vendor/javascript/vite-plugin-ruact
165
- steps:
166
- - uses: actions/checkout@v5
167
- - uses: ruby/setup-ruby@v1
168
- with:
169
- ruby-version: "3.3"
170
- bundler-cache: false
171
- - uses: actions/setup-node@v4
172
- with:
173
- node-version: "20"
174
- - name: Install JS deps
175
- run: npm ci
176
- - name: Install runtime package deps (react for the bundled runtime test)
177
- # The vite-plugin vitest config globs in the sibling runtime package's
178
- # `index.test.mjs`, which imports the runtime's `index.js` → `react`.
179
- # That package keeps `react` in its own deps (lockfile gitignored), so
180
- # install them here. Without this the bundled run fails to resolve react.
181
- working-directory: vendor/javascript/ruact-server-functions-runtime
182
- run: npm install --no-audit --no-fund
183
- - name: Run vitest (codegen + Ruby↔JS parity + runtime)
184
- run: npm test
185
- - name: Type-check emitted accessors (Story 13.4 / FR99)
186
- run: npm run typecheck
187
-
188
- benchmark:
189
- # Required status check — fails if memory allocations exceed 120% of baseline.json.
190
- name: Memory Benchmark
191
- runs-on: ubuntu-latest
192
- steps:
193
- - uses: actions/checkout@v5
194
- - uses: ruby/setup-ruby@v1
195
- with:
196
- ruby-version: "3.3"
197
- bundler-cache: true
198
- - name: Run memory benchmark
199
- run: bundle exec rake benchmark:memory
200
-
201
- # E2E jobs (e2e and e2e-next) were removed from this workflow in Story 6.7.
202
- # They depend on the `e2e/` Rails app in the planning monorepo and cannot run
203
- # here (this repo has no `e2e/` directory). When/if a host-app system test
204
- # is desired in CI, host the workflow in the monorepo (luizcg/ruact-dev) where
205
- # both the gem submodule and the e2e/ Rails app live side by side.
206
-
207
- release:
208
- # Auto-release to RubyGems on every GREEN push to main, gated on the full
209
- # required-check set via `needs:`. Versioning (source of truth:
210
- # lib/ruact/version.rb): story verde -> patch; epic verde -> minor via an
211
- # `[epic-done]` marker in the merge-commit message; major manual for 1.0.0.
212
- # Auth is RubyGems Trusted Publishing (OIDC) — satisfies
213
- # rubygems_mfa_required. The bump commit carries [skip ci] (no re-trigger).
214
- #
215
- # KILL SWITCH (added 2026-06-14): publishing is OFF by default. The job only
216
- # runs when the repo variable RUACT_AUTO_RELEASE is exactly "true". When the
217
- # variable is unset (current state), `vars.RUACT_AUTO_RELEASE` is the empty
218
- # string, the `== 'true'` test is false, and this job is skipped — every
219
- # other check still runs, merges stay green, nothing is published.
220
- # Turn ON : gh variable set RUACT_AUTO_RELEASE -b true -R luizcg/ruact
221
- # Turn OFF: gh variable delete RUACT_AUTO_RELEASE -R luizcg/ruact
222
- # (or GitHub UI: Settings -> Secrets and variables -> Actions -> Variables)
223
- name: Release to RubyGems
224
- needs: [name-propagation, rspec, rubocop, yard, js, benchmark]
225
- if: >-
226
- github.event_name == 'push'
227
- && github.ref == 'refs/heads/main'
228
- && vars.RUACT_AUTO_RELEASE == 'true'
229
- runs-on: ubuntu-latest
230
- permissions:
231
- id-token: write
232
- contents: write
233
- concurrency:
234
- group: release
235
- cancel-in-progress: false
236
- steps:
237
- - uses: actions/checkout@v5
238
- with:
239
- fetch-depth: 0
240
- - uses: ruby/setup-ruby@v1
241
- with:
242
- ruby-version: "3.3"
243
- bundler-cache: true
244
- - name: Decide bump kind & compute next version
245
- id: bump
246
- env:
247
- HEAD_MSG: ${{ github.event.head_commit.message }}
248
- run: |
249
- KIND=patch
250
- printf '%s' "$HEAD_MSG" | grep -qi '\[epic-done\]' && KIND=minor
251
- VERSION=$(ruby -e '
252
- kind = ARGV[0]
253
- path = "lib/ruact/version.rb"
254
- src = File.read(path)
255
- maj, min, pat = src.match(/VERSION = "(\d+)\.(\d+)\.(\d+)"/).captures.map(&:to_i)
256
- case kind
257
- when "major" then maj, min, pat = maj + 1, 0, 0
258
- when "minor" then min, pat = min + 1, 0
259
- else pat += 1
260
- end
261
- v = "#{maj}.#{min}.#{pat}"
262
- File.write(path, src.sub(/VERSION = "[^"]+"/, %(VERSION = "#{v}")))
263
- print v
264
- ' "$KIND")
265
- echo "version=$VERSION" >> "$GITHUB_OUTPUT"
266
- # Resync Gemfile.lock to the bumped path-gem version. Without this the
267
- # release commit carries a new version.rb but a stale lock, and every
268
- # frozen-mode job (rubocop/yard/benchmark) goes red on the next push
269
- # with bundler exit 16 ("gemspecs for path gems changed"). `git commit
270
- # -am` below then picks up the updated lock alongside version.rb.
271
- bundle lock --local
272
- echo "::notice::Release bump $KIND -> v$VERSION"
273
- - uses: rubygems/configure-rubygems-credentials@v2.0.0 # OIDC -> short-lived credential
274
- - name: Commit, tag & publish
275
- env:
276
- VERSION: ${{ steps.bump.outputs.version }}
277
- run: |
278
- git config user.name "github-actions[bot]"
279
- git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
280
- git commit -am "Release v$VERSION [skip ci]"
281
- git tag "v$VERSION"
282
- git push origin HEAD --tags
283
- gem build ruact.gemspec
284
- gem push "ruact-$VERSION.gem"
@@ -1,54 +0,0 @@
1
- name: Server-functions bench (AC12)
2
-
3
- # Story 8.1 AC12 — non-blocking nightly perf guard. Runs the AR-backed
4
- # end-to-end dispatch benchmark and posts the numbers as a workflow
5
- # summary. Does NOT gate merge (the bench measures wall-clock and is
6
- # subject to runner noise); it exists to surface 10× regressions in
7
- # the open instead of after release.
8
- #
9
- # Triggers:
10
- # - nightly cron (06:00 UTC)
11
- # - PRs touching `lib/ruact/server_functions/**` or the bench script
12
- # itself
13
- # - manual `workflow_dispatch`
14
-
15
- on:
16
- schedule:
17
- - cron: "0 6 * * *"
18
- pull_request:
19
- paths:
20
- - "lib/ruact/server_functions/**"
21
- - "lib/ruact/controller.rb"
22
- - "vendor/javascript/ruact-server-functions-runtime/**"
23
- - "bench/server_functions_dispatch_bench.rb"
24
- - ".github/workflows/server-functions-bench.yml"
25
- workflow_dispatch:
26
-
27
- jobs:
28
- bench:
29
- name: Run dispatch bench
30
- runs-on: ubuntu-latest
31
- env:
32
- BUNDLE_DEPLOYMENT: "false"
33
- BUNDLE_FROZEN: "false"
34
- steps:
35
- - uses: actions/checkout@v5
36
- - uses: ruby/setup-ruby@v1
37
- with:
38
- ruby-version: "3.3"
39
- bundler-cache: true
40
- - name: Run bench
41
- id: bench
42
- run: |
43
- bundle exec ruby bench/server_functions_dispatch_bench.rb \
44
- | tee bench-output.txt
45
- - name: Post numbers as workflow summary
46
- if: always()
47
- run: |
48
- {
49
- echo "## Server-functions dispatch bench"
50
- echo ""
51
- echo '```'
52
- cat bench-output.txt
53
- echo '```'
54
- } >> "$GITHUB_STEP_SUMMARY"
data/.rubocop.yml DELETED
@@ -1,107 +0,0 @@
1
- inherit_from: .rubocop_todo.yml
2
-
3
- # Merge (union) Exclude arrays across .rubocop_todo.yml and this file —
4
- # without this, a cop that declares its own Exclude below (e.g.
5
- # Metrics/ModuleLength) would silently DISCARD the todo file's frozen
6
- # exclusions for that cop (RuboCop's per-parameter override semantics).
7
- inherit_mode:
8
- merge:
9
- - Exclude
10
-
11
- require:
12
- - rubocop/cop/ruact
13
-
14
- plugins:
15
- - rubocop-rspec
16
- - rubocop-performance
17
-
18
- AllCops:
19
- TargetRubyVersion: 3.2
20
- NewCops: enable
21
- Exclude:
22
- - "vendor/**/*"
23
- - "sig/**/*"
24
-
25
- # --- Layout ---
26
- Layout/LineLength:
27
- Max: 120
28
-
29
- # --- Metrics ---
30
- Metrics/MethodLength:
31
- Max: 30
32
- CountAsOne: ["array", "hash", "heredoc"]
33
- # Note: case/when chain in serializer.rb and converter is intentional by architecture decision
34
-
35
- Metrics/BlockLength:
36
- Exclude:
37
- - "spec/**/*"
38
- - "Gemfile"
39
- - "lib/tasks/**/*.rake"
40
-
41
- Naming/VariableNumber:
42
- Exclude:
43
- - "lib/tasks/**/*.rake"
44
- # Spec story-tag convention: `describe ..., :story_7_7` mirrors the story
45
- # ID (7.7 → :story_7_7) so a single rspec invocation runs the regression
46
- # suite for that story (project-context §11). Narrowed to the exact symbol
47
- # shape rather than excluding all of spec/ — anything else under spec/ that
48
- # tries to use snake_case-with-numbers still trips the cop. The optional
49
- # trailing letter accommodates carve-out stories like 8.0a → :story_8_0a.
50
- AllowedPatterns:
51
- - '\bstory_\d+_\d+[a-z]?\b'
52
-
53
- Metrics/ClassLength:
54
- Max: 150
55
-
56
- Metrics/ModuleLength:
57
- Max: 150
58
- Exclude:
59
- - "spec/**/*"
60
-
61
- Metrics/AbcSize:
62
- Max: 50
63
- # Note: PoC methods (ruact_render, each, convert_element) will be refactored
64
- # in later stories. Current values reflect tech debt, not design intent.
65
-
66
- Metrics/CyclomaticComplexity:
67
- Max: 20
68
-
69
- Metrics/PerceivedComplexity:
70
- Max: 20
71
-
72
- # --- Style ---
73
- Style/Documentation:
74
- Enabled: false
75
-
76
- Style/FrozenStringLiteralComment:
77
- Enabled: true
78
- EnforcedStyle: always
79
-
80
- Style/StringLiterals:
81
- EnforcedStyle: double_quotes
82
-
83
- # --- RSpec ---
84
- RSpec/MultipleExpectations:
85
- Max: 5
86
-
87
- RSpec/ExampleLength:
88
- Max: 25
89
-
90
- RSpec/MultipleMemoizedHelpers:
91
- Max: 7
92
-
93
- RSpec/NestedGroups:
94
- Max: 4
95
-
96
- RSpec/DescribeClass:
97
- Enabled: false
98
-
99
- # --- Custom Ruact Cops ---
100
- Ruact/NoIoInFlight:
101
- Enabled: true
102
-
103
- Ruact/NoSharedState:
104
- Enabled: true
105
-
106
- Ruact/NoExtendSelf:
107
- Enabled: true
data/.rubocop_todo.yml DELETED
@@ -1,63 +0,0 @@
1
- # This configuration was generated by
2
- # `rubocop --auto-gen-config --auto-gen-only-exclude --exclude-limit 100`
3
- # on 2026-06-15 05:49:26 UTC using RuboCop version 1.85.1.
4
- # The point is for the user to remove these configuration records
5
- # one by one as the offenses are removed from the code base.
6
- # Note that changes in the inspected code, or installation of new
7
- # versions of RuboCop, may require this file to be generated again.
8
-
9
- # Offense count: 2
10
- # This cop supports safe autocorrection (--autocorrect).
11
- # Configuration parameters: AllowAliasSyntax, AllowedMethods.
12
- # AllowedMethods: alias_method, public, protected, private
13
- Layout/EmptyLinesAroundAttributeAccessor:
14
- Exclude:
15
- - 'spec/ruact/server_functions/error_payload_spec.rb'
16
-
17
- # Offense count: 10
18
- # This cop supports safe autocorrection (--autocorrect).
19
- # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
20
- # URISchemes: http, https
21
- Layout/LineLength:
22
- Exclude:
23
- - 'bench/server_functions_dispatch_bench.rb'
24
- - 'lib/ruact/server_functions/error_suggestion.rb'
25
- - 'spec/ruact/server_functions/error_suggestion_spec.rb'
26
-
27
- # Offense count: 1
28
- # Configuration parameters: Prefixes, AllowedPatterns.
29
- # Prefixes: when, with, without
30
- RSpec/ContextWording:
31
- Exclude:
32
- - 'spec/ruact/controller_spec.rb'
33
-
34
- # Offense count: 2
35
- # This cop supports unsafe autocorrection (--autocorrect-all).
36
- # Configuration parameters: AllowedMethods, AllowedPatterns.
37
- # AllowedMethods: ==, equal?, eql?
38
- Style/ClassEqualityComparison:
39
- Exclude:
40
- - 'lib/ruact/server_functions/error_payload.rb'
41
-
42
- # Offense count: 1
43
- # This cop supports safe autocorrection (--autocorrect).
44
- Style/IfUnlessModifier:
45
- Exclude:
46
- - 'bench/server_functions_dispatch_bench.rb'
47
-
48
- # Offense count: 1
49
- Style/MixinUsage:
50
- Exclude:
51
- - 'bench/server_functions_dispatch_bench.rb'
52
-
53
- # Offense count: 4
54
- # Configuration parameters: AllowedClasses.
55
- Style/OneClassPerFile:
56
- Exclude:
57
- - 'bench/server_functions_dispatch_bench.rb'
58
-
59
- # Offense count: 2
60
- # This cop supports safe autocorrection (--autocorrect).
61
- Style/RedundantFreeze:
62
- Exclude:
63
- - 'spec/ruact/server_functions/error_payload_spec.rb'
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "bundler/gem_tasks"
4
- require "rspec/core/rake_task"
5
-
6
- RSpec::Core::RakeTask.new(:spec)
7
-
8
- Dir["lib/tasks/**/*.rake"].each { |f| load f }
9
-
10
- task default: :spec