Loading...
Loading...
Compare original and translation side by side
inertia_rails## Inertia Rails Stack@/vite.config.tsvite-plugin-rubytsconfig.jsonalba-inertiajbuilderblueprinterinertia_rails## Inertia Rails Stackvite.config.ts@/vite-plugin-rubytsconfig.jsonjbuilderalba-inertiablueprinteralba-inertiaGemfileGemfile.lockpackage.json| Look for | Means |
|---|---|
| Inertia Rails installed (required) |
| React frontend |
| Vue 3 frontend |
| Svelte frontend |
| Convention-based rendering active |
| Alba serialization without convention rendering |
| Pagy pagination |
| Kaminari pagination |
| RSpec testing |
| Typed frontend path helpers |
| Devise authentication |
| Pundit authorization |
| Action Policy authorization |
| shadcn installed (React: shadcn/ui, Vue: shadcn-vue, Svelte: shadcn-svelte) |
GemfileGemfile.lockpackage.json| 检测目标 | 含义 |
|---|---|
| 已安装Inertia Rails(必填) |
| React前端 |
| Vue 3前端 |
| Svelte前端 |
| 已启用约定式渲染 |
| 使用Alba序列化但未启用约定式渲染 |
| Pagy分页 |
| Kaminari分页 |
| RSpec测试 |
| 类型化前端路径助手 |
| Devise身份验证 |
| Pundit授权 |
| Action Policy授权 |
根目录存在 | 已安装shadcn(React:shadcn/ui,Vue:shadcn-vue,Svelte:shadcn-svelte) |
| Dep | Type | Install command | What it unlocks |
|---|---|---|---|
| gems | | Convention-based rendering, auto-generated TypeScript types from Ruby. Eliminates |
| gem | | Typed path helpers ( |
| gem | | Lightweight pagination with Inertia-friendly metadata. |
| shadcn/ui (React) | npx | | Pre-built React components adapted for Inertia. Unlocks |
| shadcn-vue (Vue) | npx | | Pre-built Vue components adapted for Inertia. Unlocks |
| shadcn-svelte (Svelte) | npx | | Pre-built Svelte components (bits-ui) adapted for Inertia. Unlocks |
jbuilderblueprinter| 依赖 | 类型 | 安装命令 | 解锁功能 |
|---|---|---|---|
| gems | | 约定式渲染,从Ruby自动生成TypeScript类型。消除 |
| gem | | React中的类型化路径助手( |
| gem | | 轻量级分页,支持Inertia友好的元数据。 |
| shadcn/ui (React) | npx | | 适配Inertia的预构建React组件。解锁 |
| shadcn-vue (Vue) | npx | | 适配Inertia的预构建Vue组件。解锁 |
| shadcn-svelte (Svelte) | npx | | 适配Inertia的预构建Svelte组件(bits-ui)。解锁 |
jbuilderblueprinterApplicationResource# app/resources/application_resource.rb
class ApplicationResource
include Alba::Resource
helper Typelizer::DSL
helper Alba::Inertia::Resource
include Rails.application.routes.url_helpers
end# config/initializers/typelizer.rb
Typelizer.configure do |config|
config.output_dir = Rails.root.join("app/frontend/types/generated")
endrails generate js_routesnpx shadcn@latest initnpx shadcn-vue@latest initnpx shadcn-svelte@latest init@/tsconfig.jsonApplicationResource# app/resources/application_resource.rb
class ApplicationResource
include Alba::Resource
helper Typelizer::DSL
helper Alba::Inertia::Resource
include Rails.application.routes.url_helpers
end# config/initializers/typelizer.rb
Typelizer.configure do |config|
config.output_dir = Rails.root.join("app/frontend/types/generated")
endrails generate js_routesnpx shadcn@latest initnpx shadcn-vue@latest initnpx shadcn-svelte@latest inittsconfig.json@/CLAUDE.md## Inertia Rails Stack##references/claude-md-templates.mdCLAUDE.md## Inertia Rails Stack##references/claude-md-templates.md| Symptom | Cause | Fix |
|---|---|---|
| Missing or misconfigured | Ensure |
| Typelizer generates types in wrong directory | Missing or wrong | Add |
| Aliases added to | |
| CLAUDE.md has conflicting instructions | Multiple | Delete duplicates — only one auto-generated block should exist |
Skills reference | Setup wasn't run, or alba wasn't selected | Re-run setup; CLAUDE.md should say "alba-inertia skill does NOT apply" if gem is absent |
| | Run |
| 症状 | 原因 | 解决方法 |
|---|---|---|
| | 运行初始化前,确保已配置 |
| Typelizer在错误目录生成类型 | 初始化文件缺失或 | 添加 |
| 别名被添加到 | |
| CLAUDE.md存在冲突指令 | 存在多个 | 删除重复内容 —— 仅保留一个自动生成的区块 |
技能引用 | 未运行本设置,或未选择安装alba | 重新运行本设置;若gem未安装,CLAUDE.md应显示“alba-inertia skill does NOT apply” |
| 已安装 | 先运行 |
## Inertia Rails Stack## Inertia Rails Stack