@farm.js/create-app

中文文档
0.1.48发布于 2026/11/01MITCommonJS

Create a new FARMJS application

原始使用文档

@farm.js/create-app

Create a new FARMJS application

See Stability and Support for what this package guarantees.

pnpm create @farm.js/app my-app --template basic
cd my-app
pnpm dev

The scaffolder installs FARMJS, React by default, TypeScript, and the other starter dependencies automatically. Every starter also registers the official @farm.js/devtools workspace, available at /__farm/devtools (or Command/Ctrl + Shift + .) during pnpm dev. The command explicitly selects the minimal Basic starter. Use pnpm create, not pnpm add; pnpm resolves this initializer command to the published @farm.js/create-app package. Pass --skip-install when you only want to generate the project files.

Right after a release, pnpm can still start the previous initializer: its create cache lasts a day, and pnpm 11's default release-age policy holds back packages published in the last day. Set both for the shell, then run the command again:

export PNPM_CONFIG_DLX_CACHE_MAX_AGE=0
export PNPM_CONFIG_MINIMUM_RELEASE_AGE_EXCLUDE='["@farm.js/*"]'
pnpm create @farm.js/app my-app --template basic

In PowerShell:

$env:PNPM_CONFIG_DLX_CACHE_MAX_AGE = "0"
$env:PNPM_CONFIG_MINIMUM_RELEASE_AGE_EXCLUDE = '["@farm.js/*"]'
pnpm create @farm.js/app my-app --template basic

Choose React, Preact, Solid, Vue, or Svelte for the Basic and Better Auth starters:

pnpm create @farm.js/app my-app --template better-auth --renderer solid

React remains the default when --renderer is omitted. The interactive Basic and Better Auth flows also offer a renderer chooser.

List every starter:

pnpm create @farm.js/app --list-templates

Available templates:

  • Core: basic, auth, better-auth
  • Auth: auth0, authjs, clerk, supabase, workos
  • Billing: autumn, polar, stripe
  • Product integrations: ai, jobs-inngest, jobs-trigger, resend, unkey

Integration templates include provider wiring, a local UI feature, .env.example, a minimal dark home page, and setup documentation. Better Auth has renderer-native UI for all five renderers; other integration templates currently use React. For example:

pnpm create @farm.js/app stripe-app --template stripe

See the FARMJS repository for documentation, examples, and support.

版本与发布记录

@farm.js/create-app 共发布 160 个版本,首次发布于 2026/07/29;过去 12 个月发布了 160 个版本。

版本发布日期距今
0.1.48latest2026/11/012 天前
0.1.472026/10/313 天前
0.1.462026/10/313 天前
0.1.452026/10/313 天前
0.1.442026/10/313 天前
0.1.432026/10/304 天前

其他发布通道:beta → 0.1.3-beta.0。

关于 @farm.js/create-app 的常见问题

@farm.js/create-app 是什么?

创建一个新的FARMJS应用程序

如何安装 @farm.js/create-app?

在项目目录运行 npm install @farm.js/create-app,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 create-farm-app,可以用 npx create-farm-app 直接运行。

@farm.js/create-app 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/farm.js__create-app 是否存在。

@farm.js/create-app 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@farm.js/create-app 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=22.13.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@farm.js/create-app 可以商用吗?

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

@farm.js/create-app 还在维护吗?

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