workflow-init
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chineseworkflow-init
workflow-init
Initial setup of Vercel Workflow DevKit before is installed. Fetch the official getting-started guide for the user's framework.
workflow在安装完成之前,完成Vercel Workflow DevKit的初始设置。为用户的框架获取官方入门指南。
workflowDecision Flow
决策流程
0) Sanity check
0) 完整性检查
Read . If is already a dependency, tell the user to use instead (it reads versioned docs from ). Only continue if workflow is missing.
package.jsonworkflow/workflownode_modules/workflow/docs/读取。如果已经是依赖项,告知用户改用(它会从读取带版本的文档)。仅当workflow缺失时才继续。
package.jsonworkflow/workflownode_modules/workflow/docs/1) Determine the framework
1) 确定框架
Non-interactive: If the user named a framework in their prompt, use it directly.
Auto-detect: Inspect deps and config files. Use the first match:
package.json- Next.js - dep or
nextnext.config.* - Nuxt - dep or
nuxtnuxt.config.* - SvelteKit - dep or
@sveltejs/kitsvelte.config.* - Astro - dep or
astroastro.config.* - NestJS - dep or
@nestjs/corenest-cli.json - Nitro - dep or
nitronitro.config.* - Express - dep
express - Fastify - dep
fastify - Hono - dep
hono - Vite - dep (and not matched above)
vite
If no match or multiple matches, ask the user to pick.
非交互式: 如果用户在提示中指定了框架,直接使用该框架。
自动检测: 检查依赖项和配置文件。使用第一个匹配项:
package.json- Next.js - 存在依赖或
next文件next.config.* - Nuxt - 存在依赖或
nuxt文件nuxt.config.* - SvelteKit - 存在依赖或
@sveltejs/kit文件svelte.config.* - Astro - 存在依赖或
astro文件astro.config.* - NestJS - 存在依赖或
@nestjs/core文件nest-cli.json - Nitro - 存在依赖或
nitro文件nitro.config.* - Express - 存在依赖
express - Fastify - 存在依赖
fastify - Hono - 存在依赖
hono - Vite - 存在依赖(且未匹配上述框架)
vite
如果没有匹配项或存在多个匹配项,请让用户选择。
2) Fetch and follow the getting-started guide
2) 获取并遵循入门指南
Fetch exactly one of these URLs and follow the guide step-by-step:
Each guide covers: install deps, configure framework, create first workflow, create route handler, run + verify.
获取恰好一个以下URL并逐步遵循指南:
每个指南涵盖:安装依赖项、配置框架、创建第一个工作流、创建路由处理器、运行并验证。
3) Verify setup
3) 验证设置
- Start the dev server per the guide.
- Trigger the example endpoint with the provided .
curl - Confirm logs show the workflow and steps executing.
- Optional: or
npx workflow web.npx workflow inspect runs
- 按照指南启动开发服务器。
- 使用提供的命令触发示例端点。
curl - 确认日志显示工作流和步骤正在执行。
- 可选操作:或
npx workflow web。npx workflow inspect runs
4) No framework yet?
4) 尚未选择框架?
If no framework exists, ask what the user wants:
- Web app: Next.js / Nuxt / SvelteKit / Astro
- API server: Express / Fastify / Hono
- Minimal server: Nitro or Vite
Then follow the "Create Your Project" section of the chosen guide.
如果还没有框架,请询问用户需求:
- Web应用:Next.js / Nuxt / SvelteKit / Astro
- API服务器:Express / Fastify / Hono
- 轻量服务器:Nitro或Vite
然后遵循所选指南中的“创建你的项目”部分。
Concept questions (pre-install)
概念问题(安装前)
If the user asks conceptual questions before installing, fetch:
Handoff
交接
When setup is complete, tell the user: Use for ongoing development - it reads the versioned docs bundled in .
/workflownode_modules/workflow/docs/设置完成后,告知用户:后续开发请使用 - 它会读取中捆绑的带版本文档。
/workflownode_modules/workflow/docs/