@textjs/app

中文文档
1.1.0发布于 2026/11/03MITTypeScriptES Module

React 19 App Router framework for apps that render in the browser console.

原始使用文档

▼ @textjs/app

The Console Framework for the Web. Build React 19 App Router apps that render in the DevTools console. Turbolog writes each changed frame as one console.log call.

bunx create-text-app my-app
cd my-app && bun install && bun dev
CommandDescription
text devVite dev server with React Fast Refresh and the in-console Redbox
text buildOptimized console production build + route summary
text startServe the production build (static files + route handlers)
text runRender the App Router app in a terminal (Bun)
text proxyBridge textjs.org/opencode to your local OpenCode server; same as bunx @textjs/opencode@latest proxy
text mcpServe the app headless to coding agents over MCP (stdio)

Entry points

  • @textjs/app: the full @textjs/react component kit plus defineConfig, Metadata, ViewportConfig, useAppTheme
  • @textjs/app/navigation: useRouter, usePathname, useParams, useSearchParams, notFound, redirect
  • @textjs/app/link: <Link href> (focusable; Enter navigates, optional shortcut)
  • @textjs/app/server: NextRequest and NextResponse for middleware.ts
  • @textjs/app/cache: unstable_cache, cache, revalidateTag, revalidatePath
  • @textjs/app/testing: render, renderToString and cleanup for offscreen tests
  • @textjs/app/terminal: renderToTerminal
  • @textjs/app/router: <AppRouter>, matchAppRoutes, createBrowserHistory, createMemoryHistory
  • @textjs/app/devtools: <TextDevOverlay> (F2 / Ctrl+` ), <RedboxOverlay>, connectViteHmr
  • @textjs/app/vite: textjsVitePlugin() for custom Vite setups
  • @textjs/app/mcp: createTextMcpServer() and HeadlessSession for driving apps from coding agents

app/ conventions

layout.tsx, page.tsx, loading.tsx (Suspense), error.tsx (error boundary with reset), not-found.tsx, [param], [...slug], [[...slug]], (group) and api/**/route.ts handlers exporting GET, POST, PUT, PATCH, DELETE, OPTIONS.

版本与发布记录

@textjs/app 共发布 5 个版本,首次发布于 2026/11/02;过去 12 个月发布了 5 个版本。

版本发布日期距今
1.1.0latest2026/11/03今天
1.0.42026/11/021 天前
1.0.32026/11/021 天前
1.0.22026/11/021 天前
0.0.0-stage2026/11/021 天前

关于 @textjs/app 的常见问题

@textjs/app 是什么?

React 19的应用路由器框架,用于在浏览器控制台中渲染的应用。

如何安装 @textjs/app?

在项目目录运行 npm install @textjs/app,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^19.0.0)、react-dom(^19.0.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 text,可以用 npx text 直接运行。

@textjs/app 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@textjs/app 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@textjs/app 可以商用吗?

@textjs/app 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@textjs/app 还在维护吗?

最新版本 1.1.0 发布于 2026/11/03(今天);至今共发布 5 个版本,其中过去 12 个月发布了 5 个;首次发布于 2026/11/02。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。