stimulus_plumbers_mcp 0.4.8 → 0.4.10
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/README.md +12 -1
- data/lib/stimulus_plumbers/mcp/loaders/component_manifest_loader.rb +46 -0
- data/lib/stimulus_plumbers/mcp/loaders/controller_schema_loader.rb +5 -1
- data/lib/stimulus_plumbers/mcp/loaders/guide.md +1 -1
- data/lib/stimulus_plumbers/mcp/version.rb +1 -1
- data/lib/stimulus_plumbers_mcp.rb +1 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 80bbb2046c594d607ab9925c97d5f28425104f819f9c1836b10ce602234b58cd
|
|
4
|
+
data.tar.gz: 015c8c77cd6d22d8bcc97d3125d8908ea57faee6b4c7f058aa7b8f696c059d5b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: '0038a457eafdb1914574927150179d6df8df592a2be76451bf91cdf0c091141429d37c76fb7ee075efc52bb9f7cf4e90ac1ea6e46851d69d211f65e8f278612f'
|
|
7
|
+
data.tar.gz: 81e8e82e215acd21c60857e62a9c1c268bc6573a34bce42e62ccfce627515e6e77c85b77e90f4c633bca8c0b35c0fde4e597bfeb575d44e07bce5996ed6186f4
|
data/README.md
CHANGED
|
@@ -47,8 +47,12 @@ gem install stimulus_plumbers_mcp
|
|
|
47
47
|
| `get_component_helper` | `name` | Full `sp_` helper surface — keyword options grouped by helper signature (incl. `icon_leading`) + slot methods |
|
|
48
48
|
| `get_component_examples` | `name` | ERB code fences from docs |
|
|
49
49
|
| `get_field_as_values` | `builder_method` (`field`/`collection_field`/`choice`) | Valid `as:` values |
|
|
50
|
+
| `get_field_as_controller` | `as` | Stimulus controller identifier backing a controller-backed `as:` value |
|
|
51
|
+
| `list_component_themes` | — | Component keys implementable in a custom theme |
|
|
50
52
|
| `get_component_theme` | `name` | Method signature + return contract for custom theme |
|
|
53
|
+
| `list_component_tailwind` | — | Component keys implemented by the Tailwind theme |
|
|
51
54
|
| `get_component_tailwind` | `name` | Tailwind CSS utility classes per variant |
|
|
55
|
+
| `list_icons` | — | All available icon names bundled with the Tailwind theme |
|
|
52
56
|
| `list_controllers` | — | All Stimulus controller identifiers |
|
|
53
57
|
| `get_controller_schema` | `name` | Targets, values, outlets, classes |
|
|
54
58
|
| `list_controller_docs` | — | Controller doc families available at `controller://docs/{name}` |
|
|
@@ -70,7 +74,7 @@ gem install stimulus_plumbers_mcp
|
|
|
70
74
|
}
|
|
71
75
|
```
|
|
72
76
|
|
|
73
|
-
Requires Ruby >= 3.3. No `cwd` required. Pin a specific version by adding it to your `Gemfile` and running `bundle exec gem exec stimulus-plumbers-mcp`.
|
|
77
|
+
Requires Ruby >= 3.3 for the `gem exec` subcommand (the gem itself supports Ruby >= 3.0). No `cwd` required. Pin a specific version by adding it to your `Gemfile` and running `bundle exec gem exec stimulus-plumbers-mcp`.
|
|
74
78
|
|
|
75
79
|
## Stimulus Manifest
|
|
76
80
|
|
|
@@ -82,6 +86,10 @@ Requires Ruby >= 3.3. No `cwd` required. Pin a specific version by adding it to
|
|
|
82
86
|
|
|
83
87
|
No extra steps needed for setups 1 or 2.
|
|
84
88
|
|
|
89
|
+
Each controller's schema also includes a `wiring` field (which methods/events/targets/values the
|
|
90
|
+
`stimulus_plumbers` gem's Ruby helpers reference for it), sourced from that gem's own
|
|
91
|
+
`vendor/component/manifest.json`, built by `rake build:manifest`.
|
|
92
|
+
|
|
85
93
|
## Development
|
|
86
94
|
|
|
87
95
|
```bash
|
|
@@ -92,6 +100,9 @@ bundle install
|
|
|
92
100
|
# Build the Stimulus controller manifest (pure Node, no toolchain install needed)
|
|
93
101
|
cd ../stimulus-plumbers && node --run build:manifest && cd -
|
|
94
102
|
|
|
103
|
+
# Build the Ruby wiring manifest (needs the controller manifest above)
|
|
104
|
+
cd ../stimulus-plumbers-rails && bundle exec rake build:manifest && cd -
|
|
105
|
+
|
|
95
106
|
# Start the server
|
|
96
107
|
bundle exec ruby bin/server
|
|
97
108
|
```
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module StimulusPlumbers
|
|
4
|
+
module MCP
|
|
5
|
+
# Reads the stimulus_plumbers gem's own generated wiring manifest (vendor/component/manifest.json).
|
|
6
|
+
# Unlike ControllerSchemaLoader, this never crosses ecosystems — stimulus_plumbers is always
|
|
7
|
+
# installed alongside this gem (hard runtime dependency), so there's no node_modules-style path.
|
|
8
|
+
class ComponentManifestLoader
|
|
9
|
+
MANIFEST_FILENAME = "manifest.json"
|
|
10
|
+
|
|
11
|
+
class << self
|
|
12
|
+
def call
|
|
13
|
+
path = resolved_path
|
|
14
|
+
|
|
15
|
+
unless path
|
|
16
|
+
StimulusPlumbers::Logger.warn(
|
|
17
|
+
"component manifest not found. Tried:\n" \
|
|
18
|
+
"#{manifest_paths.map { |p| " - #{p}" }.join("\n")}\n" \
|
|
19
|
+
"Run `bundle exec rake build:manifest` in stimulus-plumbers-rails/ to generate it."
|
|
20
|
+
)
|
|
21
|
+
return {}
|
|
22
|
+
end
|
|
23
|
+
|
|
24
|
+
JSON.parse(File.read(path))
|
|
25
|
+
end
|
|
26
|
+
|
|
27
|
+
def resolved_path
|
|
28
|
+
manifest_paths.find { |p| File.exist?(p) }
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
private
|
|
32
|
+
|
|
33
|
+
def manifest_paths
|
|
34
|
+
[
|
|
35
|
+
# 1. gem exec / installed gem — vendored at release time
|
|
36
|
+
GemVendorPath.resolve("component", MANIFEST_FILENAME),
|
|
37
|
+
# 2. Monorepo dev fallback
|
|
38
|
+
File.expand_path(
|
|
39
|
+
File.join(__dir__, "../../../../..", "stimulus-plumbers-rails", "vendor", "component", MANIFEST_FILENAME)
|
|
40
|
+
)
|
|
41
|
+
].compact
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|
|
@@ -21,7 +21,11 @@ module StimulusPlumbers
|
|
|
21
21
|
return {}
|
|
22
22
|
end
|
|
23
23
|
|
|
24
|
-
JSON.parse(File.read(path))
|
|
24
|
+
controllers = JSON.parse(File.read(path))
|
|
25
|
+
wiring = ComponentManifestLoader.call
|
|
26
|
+
default_wiring = { "actions" => [], "listens" => [], "targets" => [], "values" => [] }
|
|
27
|
+
|
|
28
|
+
controllers.transform_values { |data| data.merge("wiring" => wiring[data["identifier"]] || default_wiring) }
|
|
25
29
|
end
|
|
26
30
|
|
|
27
31
|
# Reused by VersionsLoader to report which fallback location resolved.
|
|
@@ -19,7 +19,7 @@ identifier: `get_field_as_controller(as:)` — `component://{name}/schema` keys
|
|
|
19
19
|
`get_component_schema(name)`; ERB examples: `get_component_examples(name)`. List everything with
|
|
20
20
|
`list_components`; `list_component_docs` shows which components have full docs
|
|
21
21
|
(`component://{name}/docs`) and helper signatures (`component://{name}/helper`). Icon options take a
|
|
22
|
-
name from `component://icons` (or `list_icons`). All
|
|
22
|
+
name from `component://icons` (or `list_icons`). All schema components are queryable via
|
|
23
23
|
`get_component_schema`; only a subset have full docs and ERB examples — use `list_component_docs` to
|
|
24
24
|
see what's covered. Full form builder reference: `component://form/docs`.
|
|
25
25
|
|
|
@@ -17,6 +17,7 @@ require_relative "stimulus_plumbers/mcp/loaders/component_requirements"
|
|
|
17
17
|
require_relative "stimulus_plumbers/mcp/loaders/component_schema_loader"
|
|
18
18
|
require_relative "stimulus_plumbers/mcp/loaders/component_theme_loader"
|
|
19
19
|
|
|
20
|
+
require_relative "stimulus_plumbers/mcp/loaders/component_manifest_loader"
|
|
20
21
|
require_relative "stimulus_plumbers/mcp/loaders/controller_docs_loader"
|
|
21
22
|
require_relative "stimulus_plumbers/mcp/loaders/controller_schema_loader"
|
|
22
23
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: stimulus_plumbers_mcp
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.10
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ryan Chang
|
|
@@ -82,6 +82,7 @@ files:
|
|
|
82
82
|
- lib/stimulus_plumbers/mcp/cli.rb
|
|
83
83
|
- lib/stimulus_plumbers/mcp/loaders/aria_loader.rb
|
|
84
84
|
- lib/stimulus_plumbers/mcp/loaders/component_docs_loader.rb
|
|
85
|
+
- lib/stimulus_plumbers/mcp/loaders/component_manifest_loader.rb
|
|
85
86
|
- lib/stimulus_plumbers/mcp/loaders/component_requirements.rb
|
|
86
87
|
- lib/stimulus_plumbers/mcp/loaders/component_schema_loader.rb
|
|
87
88
|
- lib/stimulus_plumbers/mcp/loaders/component_theme_loader.rb
|