rails-ai-context 4.2.1 → 4.2.2
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +10 -0
- data/CLAUDE.md +1 -1
- data/README.md +2 -2
- data/lib/rails_ai_context/introspectors/frontend_framework_introspector.rb +1 -1
- data/lib/rails_ai_context/server.rb +10 -1
- data/lib/rails_ai_context/tools/get_component_catalog.rb +5 -1
- data/lib/rails_ai_context/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9930b0d98fb5e6eb1203d30ed2aa29e1582d8d7dce45b8b6046dbf319b6848c6
|
|
4
|
+
data.tar.gz: c8c16b4b5d5d7f2f677079b6b32162f4d1c808cf4766e5ff864386c86deaf5fc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8fd433d22ebcc80e37e3b42e2b81a194cea749bc3a58a5c9cc6a062d263e8c38b4d8e2566197c931d26fd192120f7a327d4fe997141d928ecede7b671bf7bdae
|
|
7
|
+
data.tar.gz: ee8e50f02af410230d37e703eaf048f540f7c8ac7ea745686349c4a16ba5c9e74f0e429c77948f87930089c97cc79ccf5e3510f7f939d0bb0a91bf1f781fb371
|
data/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [4.2.2] — 2026-04-01
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
- **Vite config detection** — framework plugin detection now checks `.mts`, `.mjs`, `.cts`, `.cjs` extensions in addition to `.ts` and `.js`
|
|
12
|
+
- **Component catalog ERB** — no-props no-slots components now generate inline `<%= render Foo.new %>` instead of misleading `do...end` block
|
|
13
|
+
- **Custom tools validation** — invalid entries in `config.custom_tools` are now filtered with a clear warning instead of crashing the MCP server with a cryptic `NoMethodError`
|
|
14
|
+
|
|
15
|
+
### Changed
|
|
16
|
+
- Test count: 998 → 1003
|
|
17
|
+
|
|
8
18
|
## [4.2.1] — 2026-03-31
|
|
9
19
|
|
|
10
20
|
### Fixed
|
data/CLAUDE.md
CHANGED
data/README.md
CHANGED
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
[](https://registry.modelcontextprotocol.io)
|
|
9
9
|
[](https://github.com/crisnahine/rails-ai-context)
|
|
10
10
|
[](https://github.com/crisnahine/rails-ai-context)
|
|
11
|
-
[](https://github.com/crisnahine/rails-ai-context/actions)
|
|
12
12
|
[](LICENSE)
|
|
13
13
|
|
|
14
14
|
**Works with:** Claude Code • Cursor • GitHub Copilot • OpenCode • Any terminal
|
|
15
15
|
|
|
16
|
-
> Built by a Rails developer with 10+ years of production experience. AI assisted — the same way it assists me shipping features at work. I designed the architecture, made every decision, reviewed every line, and wrote
|
|
16
|
+
> Built by a Rails developer with 10+ years of production experience. AI assisted — the same way it assists me shipping features at work. I designed the architecture, made every decision, reviewed every line, and wrote 1003 tests. This gem exists because I understand Rails deeply enough to know exactly what AI agents get wrong and what context they need to get it right.
|
|
17
17
|
|
|
18
18
|
```bash
|
|
19
19
|
gem "rails-ai-context", group: :development
|
|
@@ -262,7 +262,7 @@ module RailsAiContext
|
|
|
262
262
|
|
|
263
263
|
def detect_vite_config_frameworks
|
|
264
264
|
found = []
|
|
265
|
-
%w[vite.config.ts vite.config.js].each do |filename|
|
|
265
|
+
%w[vite.config.ts vite.config.js vite.config.mts vite.config.mjs vite.config.cts vite.config.cjs].each do |filename|
|
|
266
266
|
path = File.join(root, filename)
|
|
267
267
|
next unless File.exist?(path)
|
|
268
268
|
|
|
@@ -53,10 +53,19 @@ module RailsAiContext
|
|
|
53
53
|
def build
|
|
54
54
|
config = RailsAiContext.configuration
|
|
55
55
|
|
|
56
|
+
validated_custom_tools = config.custom_tools.select do |tool|
|
|
57
|
+
if tool.is_a?(Class) && tool < MCP::Tool
|
|
58
|
+
true
|
|
59
|
+
else
|
|
60
|
+
$stderr.puts "[rails-ai-context] WARNING: Skipping invalid custom_tool #{tool.inspect} (must be an MCP::Tool subclass)"
|
|
61
|
+
false
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
|
|
56
65
|
server = MCP::Server.new(
|
|
57
66
|
name: config.server_name,
|
|
58
67
|
version: config.server_version,
|
|
59
|
-
tools: active_tools(config) +
|
|
68
|
+
tools: active_tools(config) + validated_custom_tools,
|
|
60
69
|
resource_templates: Resources.resource_templates
|
|
61
70
|
)
|
|
62
71
|
|
|
@@ -155,7 +155,11 @@ module RailsAiContext
|
|
|
155
155
|
init = parts.any? ? "(#{parts.join(', ')})" : ".new"
|
|
156
156
|
|
|
157
157
|
if slots.empty?
|
|
158
|
-
|
|
158
|
+
if init == ".new"
|
|
159
|
+
"<%= render #{name}.new %>"
|
|
160
|
+
else
|
|
161
|
+
"<%= render #{name}.new#{init} do %>\n Content here\n<% end %>"
|
|
162
|
+
end
|
|
159
163
|
else
|
|
160
164
|
result = "<%= render #{name}.new#{init == ".new" ? "" : init} do |c| %>"
|
|
161
165
|
slots.each do |slot|
|