with one click
building-farm-from-source
// Use when building Farm locally from source, native bindings or Rust plugin artifacts are missing, or an example/E2E needs local core and plugin artifacts.
// Use when building Farm locally from source, native bindings or Rust plugin artifacts are missing, or an example/E2E needs local core and plugin artifacts.
Comprehensive Farm build-tool reference for AI agents. Use when writing or reviewing farm.config.ts, adding/configuring plugins, troubleshooting builds, implementing SSR or library mode, using the JavaScript API, writing Farm JS/Rust plugins, or authoring custom plugins from scratch. Covers all config options, official plugins, CLI commands, key features, and plugin authoring sourced from website/docs.
Deep integration with Docusaurus for documentation site development. Configure projects, manage sidebars, versioning, i18n, develop plugins, and optimize builds for React-based documentation.
Run Farm verification with build-first constraints. For verify/acceptance, use npm run build only for core, rust plugins, and affected examples; do not run cargo check/clippy. Use when validating changes before merge or push.
Commit and push repository changes safely. Use when user asks to commit, push, or verify and push current changes.
Fetch origin/main, rebase current branch, resolve conflicts safely, then commit and push changes; create a PR if none exists for the branch.
Use when encountering any bug, test failure, or unexpected behavior, before proposing fixes
| name | building-farm-from-source |
| description | Use when building Farm locally from source, native bindings or Rust plugin artifacts are missing, or an example/E2E needs local core and plugin artifacts. |
| license | MIT |
| compatibility | Requires Node, pnpm, cargo, npm scripts, and optional Playwright browsers for E2E. |
| metadata | {"author":"farm","version":"1.0"} |
Farm examples depend on generated JS packages and native .node / .farm
artifacts. Build missing prerequisites from the bottom up before running example
builds or E2E.
napi: not found, missing binding.cjs, or missing farm.*.node.Cannot find module '@farmfe/plugin-*-linux-x64-gnu'.packages/cli/dist/index.js or package dist/ files are missing.examples/<name> or pnpm run test-e2e -- --example <name> locally.Run from /home/runner/work/farm/farm unless noted:
ELECTRON_SKIP_BINARY_DOWNLOAD=1 PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1 corepack pnpm install
cd /home/runner/work/farm/farm/packages/core && npm run build:rs
cd /home/runner/work/farm/farm/packages/utils && npx tsc -p tsconfig.json --outDir dist
cd /home/runner/work/farm/farm
corepack pnpm --filter @farmfe/runtime run build
corepack pnpm --filter @farmfe/runtime-plugin-hmr run build
corepack pnpm --filter @farmfe/runtime-plugin-import-meta run build
corepack pnpm --filter @farmfe/plugin-tools run build
cd /home/runner/work/farm/farm/rust-plugins/replace-dirname && npm run build
cd /home/runner/work/farm/farm/rust-plugins/react && npm run build
cd /home/runner/work/farm/farm/rust-plugins/tailwindcss && npm run build
cd /home/runner/work/farm/farm
corepack pnpm --filter @farmfe/core run build
corepack pnpm --filter @farmfe/cli run build
cd /home/runner/work/farm/farm/examples/tailwindcss-rust-plugin && npm run build
cd /home/runner/work/farm/farm
corepack pnpm exec playwright install chromium
corepack pnpm run test-e2e -- --example tailwindcss-rust-plugin
| Symptom | Build first |
|---|---|
napi: not found | corepack pnpm install |
Missing @farmfe/utils/colors | cd packages/utils && npx tsc -p tsconfig.json --outDir dist |
Missing @farmfe/plugin-replace-dirname-* | cd rust-plugins/replace-dirname && npm run build |
Missing @farmfe/plugin-react-* | cd rust-plugins/react && npm run build |
Missing @farmfe/plugin-tailwindcss-* | cd rust-plugins/tailwindcss && npm run build |
Missing packages/cli/dist/index.js | corepack pnpm --filter @farmfe/cli run build |
| Playwright executable missing | corepack pnpm exec playwright install chromium |
npm run build scripts over direct
Cargo commands.rust-plugins/*/npm/<abi>/.pnpm install cannot download Electron or Playwright binaries, skip them
during install and install Playwright Chromium only when E2E is needed.