- Extract preset definitions from templates.lua into per-framework JSON files under lua/project_search/templates/ (common, react, vue, nest) - templates.lua now loads from JSON via M.load(name), keeping the default_rules() API unchanged - Expand common: add console.log, deprecated, live search presets - Expand React: add React Query hooks, context providers, Zustand stores, shadcn imports, service files/content presets - Expand Vue: add watch/watchEffect, Pinia stores, provide/inject, composables, page components presets - Expand NestJS: add DTOs, guards, interceptors, decorators, entity/module files presets - Split preset guide into separate en/ and zh/ directories Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
118 lines
3.5 KiB
JSON
118 lines
3.5 KiB
JSON
[
|
|
{
|
|
"id": "react.hooks.kebab",
|
|
"name": "Hooks: use-* kebab files",
|
|
"description": "Find hook files such as hooks/use-claw-history-panel.ts.",
|
|
"type": "files_regex",
|
|
"regex": "(^|/)hooks/use-[a-z0-9-]+\\.(ts|tsx|js|jsx)$",
|
|
"dirs": ["src", "app", "packages"],
|
|
"exclude": ["node_modules", "dist", "build", ".next"]
|
|
},
|
|
{
|
|
"id": "react.hooks.claw",
|
|
"name": "Hooks: claw hooks",
|
|
"description": "Find hook files whose names start with use-claw-.",
|
|
"type": "files_regex",
|
|
"regex": "(^|/)hooks/use-claw-[a-z0-9-]+\\.(ts|tsx)$",
|
|
"dirs": ["src", "app", "packages"]
|
|
},
|
|
{
|
|
"id": "react.hooks.panel",
|
|
"name": "Hooks: panel hooks",
|
|
"description": "Find hook files whose names contain panel.",
|
|
"type": "files_regex",
|
|
"regex": "(^|/)hooks/use-[a-z0-9-]*panel[a-z0-9-]*\\.(ts|tsx)$",
|
|
"dirs": ["src", "app", "packages"]
|
|
},
|
|
{
|
|
"id": "react.class_name",
|
|
"name": "React: className",
|
|
"description": "Search JSX className usage.",
|
|
"type": "grep",
|
|
"search": "className",
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.tsx", "*.jsx"]
|
|
},
|
|
{
|
|
"id": "react.query_key",
|
|
"name": "React: queryKey",
|
|
"description": "Search TanStack Query queryKey usage.",
|
|
"type": "grep",
|
|
"search": "queryKey",
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.ts", "*.tsx"]
|
|
},
|
|
{
|
|
"id": "react.custom_hook_definitions",
|
|
"name": "React: custom hook definitions",
|
|
"description": "Search exported custom hook definitions.",
|
|
"type": "grep",
|
|
"search": "\\bexport\\s+(function|const)\\s+use[A-Z][A-Za-z0-9_]*",
|
|
"regex": true,
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.ts", "*.tsx"]
|
|
},
|
|
{
|
|
"id": "react.react_query_hooks",
|
|
"name": "React Query: hooks",
|
|
"description": "Search TanStack Query hook usage (useQuery, useMutation, useInfiniteQuery).",
|
|
"type": "grep",
|
|
"search": "useQuery|useMutation|useInfiniteQuery",
|
|
"regex": true,
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.ts", "*.tsx"],
|
|
"exclude": ["*.test.*", "*.spec.*"]
|
|
},
|
|
{
|
|
"id": "react.context_providers",
|
|
"name": "React: context providers",
|
|
"description": "Search createContext and useContext usage.",
|
|
"type": "grep",
|
|
"search": "createContext|useContext",
|
|
"regex": true,
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.ts", "*.tsx"]
|
|
},
|
|
{
|
|
"id": "react.zustand_stores",
|
|
"name": "Zustand: store definitions",
|
|
"description": "Search Zustand store creation patterns.",
|
|
"type": "grep",
|
|
"search": "create\\(\\)|create<",
|
|
"regex": true,
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.ts", "*.tsx"]
|
|
},
|
|
{
|
|
"id": "react.ui_component_imports",
|
|
"name": "UI: shadcn component imports",
|
|
"description": "Search imports from @/components/ui/ (shadcn/ui pattern).",
|
|
"type": "grep",
|
|
"search": "from\\s+['\"]@/components/ui/",
|
|
"regex": true,
|
|
"dirs": ["src", "app"],
|
|
"glob": ["*.tsx", "*.jsx"]
|
|
},
|
|
{
|
|
"id": "react.service_files",
|
|
"name": "Service: API layer files",
|
|
"description": "Find service/API layer files by path convention.",
|
|
"type": "files_regex",
|
|
"regex": "service/[^/]+\\.(ts|tsx)$",
|
|
"dirs": ["src"],
|
|
"exclude": ["*.test.*", "*.spec.*"]
|
|
},
|
|
{
|
|
"id": "react.service_content",
|
|
"name": "Search: service content",
|
|
"description": "Interactive content search across service directory.",
|
|
"type": "grep",
|
|
"search": "",
|
|
"live": true,
|
|
"regex": true,
|
|
"dirs": ["src/service", "src/services", "src/api"],
|
|
"glob": ["*.ts", "*.tsx"],
|
|
"exclude": ["*.test.*", "*.spec.*"]
|
|
}
|
|
]
|