evjs 技能创建
- 作者仓库星标 11
- 许可证 MIT
- 作者仓库 evjs
evjs Agent Skill
Use this skill when developing applications with the evjs framework.
Overview
evjs is a React fullstack framework built on TanStack Router, TanStack Query, and Hono. It provides:
- Server Functions — write backend logic in files (we recommend using the
.server.tssuffix), call from React as if local - Server Routes — build programmatic REST endpoints and APIs using the
createRoute()handler - Query Integration — type-safe
useQuery(getUsers)with auto query keys and transport - Type-safe Routing — TanStack Router with code-defined route modules and route trees
- Plugin System — extend builds with
buildStart,bundlerConfig,transformHtml, andbuildEndhooks - Convention over Configuration — works out of the box, optionally configure via
ev.config.ts
Quick Start
npx @evjs/create-app my-app
cd my-app
npm install
npm run dev
References
For detailed guides on specific topics, see the references/ directory:
- quick-start.md — Scaffolding projects with
npx @evjs/create-app - project-structure.md — Recommended directory structure and domain-driven design (features)
- dev.md — Development server and configuration
- build.md — Production builds
- deploy.md — Deploying to Node, Docker, Deno, and Edge environments
- client-routes.md — Route definitions, layouts, params, loaders, navigation
- server-functions.md — Server functions, queries, mutations, error handling
- server-routes.md — Creating REST API endpoints using programmatic
createRoute() - config.md —
ev.config.tsoptions, defaults, client/server settings
Key Rules
Server Functions (RPC):
- Server function files must start with
"use server";so evjs can transform and register them - Use
useQuery(getUsers)to query server functions directly — type-safe args & data - Arguments are spread:
useQuery(getUser, id)notuseQuery(getUser, [id]) - For mutations, wrap args in objects/arrays:
mutate({ name, email })ormutate([name, email]) ServerErroron server → automatically mapped toServerFunctionErroron client
REST Routes (createRoute()):
- Use
createRoute()for REST API endpoints, webhooks, or standard Web Request/Response handling - If mixing
createRoute()endpoints, you must explicitly configureserver.entryinev.config.ts - Route Paths: Always use string literals for
pathvalues (e.g.,path: "/posts"). The type system rejects broadstringvariables and template strings at compile time.
React Data Loading:
- Route loaders should fetch using:
context.queryClient.ensureQueryData(getFnQueryOptions(myFn)) - Invalidate cache after mutations:
queryClient.invalidateQueries({ queryKey: getFnQueryKey(myFn) }) - Access server function metadata:
myFn.fnId,myFn.fnName,getFnQueryKey(myFn, ...args)
Misc:
- Use
pluginsin config to extend the build pipeline viabuildStart,bundlerConfig,transformHtml, andbuildEnd
- 流狐分类
- 通用
- 作者声明 Agent
- 未找到明确声明;不据此推断已兼容或已测试
- 静态检查
- 94 / 100 · 启发式扫描,不代表运行安全
- 作者 / 版本 / 许可
- @afx-team · MIT
- 流狐 Token 估算
- 低消耗
- 流狐接入估算
- 需手动接入
- 是否需要外部 API Key
- 未发现要求
- 检测到的系统要求
- Docker
- 底层运行要求
- Node.js · Deno · Docker
- 检测到的文件与系统行为
-
- 只读
- 允许写入 / 修改
- 检测到的网络行为
- 允许外网请求
- 安装命令数
- 无(仅作为资料)
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
作者没有在当前 SKILL.md 中定义固定输出样例。 evjs is a React fullstack framework built on TanStack Router, TanStack Query, and Hono. It provides: Server Functions — write backend logic in files (we recommend using the .server.ts suffix), call from React as if local
Quick Start
For detailed guides on specific topics, see the references/ directory: quick-start.md — Scaffolding projects with npx @evjs/create-app project-structure.md — Recommended directory structure and domain-driven design (features)
Server Functions (RPC): Server function files must start with "use server"; so evjs can transform and register them Use useQuery(getUsers) to query server functions directly — type-safe args & data
# evjs Agent Skill
Use this skill when developing applications with the evjs framework.
## Overview
evjs is a React fullstack framework built on TanStack Router, TanStack Query, and Hono. It provides:
- **Server Functions** — write backend logic in files (we recommend using the `.server.ts` suffix), call from React as if local
- **Server Routes** — build programmatic REST endpoints and APIs using the `createRoute()` handler
- **Query Integration** — type-safe `useQuery(getUsers)` with auto query keys and transport
- **Type-safe Routing** — TanStack Router with code-defined route modules and route trees
- **Plugin System** — extend builds with `buildStart`, `bundlerConfig`, `transformHtml`, and `buildEnd` hooks
- **Convention over Configuration** — works out of the box, optionally configure via `ev.config.ts`
## Quick Start
```bash
npx @evjs/create-app my-app
cd my-app
npm install
npm run dev
```
## References
For detailed guides on specific topics, see the `references/` directory:
- [quick-start.md](../docs/docs/quick-start.md) — Scaffolding projects with `npx @evjs/create-app`
- [project-structure.md](../docs/docs/project-structure.md) — Recommended directory structure and domain-driven design (features)
- [dev.md](../docs/docs/dev.md) — Development server and configuration
- [build.md](../docs/docs/build.md) — Production builds
- [deploy.md](../docs/docs/deploy.md) — Deploying to Node, Docker, Deno, and Edge environments
- [client-routes.md](../docs/docs/client-routes.md) — Route definitions, layouts, params, loaders, navigation
- [server-functions.md](../docs/docs/server-functions.md) — Server functions, queries, mutations, error handling
- [server-routes.md](../docs/docs/server-routes.md) — Creating REST API endpoints using programmatic `createRoute()`
… 作者原文负责流程事实;流狐只索引当前章节、要点、文件与命令。
章节 -> Overview → Quick Start → References → Key Rules
要点 -> Server Functions · Server Routes · Query Integration · Type-safe Routing · Plugin System · Convention over Configuration · Server Functions (RPC) · REST Routes (createRoute())
文件/命令 -> .server.ts · createRoute() · useQuery(getUsers) · buildStart · bundlerConfig · transformHtml · buildEnd · ev.config.ts
内容 SHA-256 -> 8e82bc61ab68
方法与流程
适用与边界
原文中的明确线索
.server.ts、createRoute()、useQuery(getUsers)、buildStart、bundlerConfig、transformHtml、buildEnd、ev.config.ts