@fuzdev/gro

中文文档
0.237.0发布于 2026/11/160BSDTypeScriptES Module近 30 天下载 5172

security-first JS runtime and toolchain on V8

原始使用文档
文档目录7 节
  1. Docs
  2. Install
  3. Usage
  4. Develop
  5. Credits 🐢 🐢 🐢
  6. Contributing
  7. License 🐦

gro a pixelated green oak acorn with a glint of sun

a pixelated green oak acorn with a glint of sun

security-first JS runtime and toolchain on V8 🌰 generate, run, optimize

⚠️ The TypeScript tool doesn't support Windows because its spawn host module runs only ELF, Mach-O, and #! programs, not a Windows .exe, .bat, or .cmd; the Rust runtime will.

Today, Gro is a task runner and toolkit extending SvelteKit and Vite for making web frontends and libraries with TypeScript. It runs on Node and is a dev tool, not for production use.

npm i -D @fuzdev/gro

Gro is also becoming its own JS runtime, a Rust binary on V8 with granular control over what your dependencies and agents can reach. As designed, a run is confined by default: code reaches only what its imports declare, reads of the project's own files without asking, and the network, processes, and anything outside the project only once accepted in a small policy file you review like a lockfile, so changing capabilities is a diff, and the runtime is designed to enforce it. A hermetic run is also confined but strictly deterministic, with its clock and randomness fixed or denied, so it's designed to replay and cache; an unconfined run (-A) is the escape hatch when you need it. The runtime grew out of the loader Gro already uses to run tasks, config, and codegen, and makes a clean break from Node toward web standards. Its model, authority by import with nothing ambient, is why it's a new runtime and not Deno with other defaults. It's an in-progress design, and of the confinement only fgro eval's kernel box is built so far. The experimental build runs modules with no API to the OS (no fs, network, env, or spawn), though fgro run's process itself isn't sandboxed yet - see the runtime docs for why it exists, the model in a page, the design, and the roadmap, and feedback is invited in discussions.

The Node tool includes:

Docs

Install

depends on node >=24.14

Typical usage installs @fuzdev/gro as a dev dependency:

npm i -D @fuzdev/gro
npx @fuzdev/gro # note the package is namespaced, don't install `gro`

It's handy to install globally too:

npm i -g @fuzdev/gro
gro

Usage

Gro has a task runner that runs TypeScript modules with the .task. subextension in-process with explicit composition. Builtins run by name and project tasks by path. Running gro with no args prints the builtins and usage:

gro # prints the builtins - defers to any local gro installation
builtin tasks:

build      build the project
changeset  call changeset with gro patterns
check      check that everything is ready to commit
clean      remove build files, and optionally prune git branches
commit     commit and push to a new branch
deploy     deploy to a branch
dev        start SvelteKit and other dev plugins
format     format source files
gen        run code generation scripts
lint       run eslint
publish    bump version, publish to the configured registry, and git push
reinstall  refreshes package-lock.json with the latest and cleanest deps
release    publish and deploy
run        execute a file with the loader, like `node` but works for TypeScript
sync       optionally install packages, sync SvelteKit, update `package.json`, and run `gro gen`
test       run tests with vitest
typecheck  run svelte-check or tsc on the project without emitting any files
upgrade    upgrade deps

Run a builtin:        gro [name]
View its help:        gro [name] --help
Run a project task:   gro task [path/to/file.task.ts]
List project tasks:   gro task [dir], defaults to src/

A name always means a builtin, so a project task never shadows one, and a path names exactly one task file, with nothing searched for:

gro check # runs the builtin `check`
gro check --help # displays docs for the task and its args, works for every task
gro task # lists the project's tasks under `src/`
gro task src/lib/some/ # lists the tasks under `src/lib/some/`
gro task src/lib/some/file.task.ts # runs that task file

Gro can also run non-task TypeScript files directly with the gro run task or register hook:

gro run foo.ts --any args # everything after the path goes to the script verbatim
node --import @fuzdev/gro/register.js foo.ts

Or programmatically:

// myfile.js
import { register } from "node:module";
register("@fuzdev/gro/loader.ts", import.meta.url);
await import("./foo.ts");

Gro has a number of builtin tasks that you can run with the CLI. To learn more see the task docs and the generated task index.

gro dev # start developing in watch mode
gro dev -- vite --port 3003 # forward args by separating sections with --
gro build # build everything for production

Testing with vitest, including shims for SvelteKit modules:

gro test # run all tests for `*.test.ts` files with `vitest`
gro test filepattern1 some.test another.test
gro test optional_pattern -t "optional search string for test name"
gro test -- --forwarded_args 'to vitest' # verbatim, also `-- vitest --forwarded_args`

Check all the things:

gro check # does all of the following:
gro typecheck # svelte-check with tsc fallback
gro test # run tests
gro gen --check # ensure generated files are current
gro format --check # ensure everything is formatted
gro lint # eslint

For a usage example see the check.yml CI config.

Formatting with tsv:

gro format # format all of the source files using tsv
gro format --check # check that all source files are formatted

Codegen with gen:

gro gen # run codegen for all `*.gen.*` files
gro gen --check # error if any generated files are new or different

To deploy: (also see src/docs/deploy.md)

gro deploy # build and push to the `deploy` branch

To publish: (also see src/docs/publish.md)

gro publish # flush changeset to changelog, bump version, publish to npm, and git push

More:

gro clean # delete all build artifacts from the filesystem
gro clean --sveltekit --nodemodules --git # also deletes dirs and prunes git branches
gro upgrade excluded-dep-1 excluded-dep-2 # npm updates to the latest everything
gro --version # print the Gro version

For more see the tasks index, the task feature docs, and the docs index.

Develop

npm i
npm run bootstrap # build and link `gro` without itself - needed only once
gro build # rebuilds `dist/`, which the linked `gro` CLI runs
gro test # make sure everything looks good - same as `npm test`
gro test some.test another.test

# use your development version of `gro` locally in another project:
npm link -f # points the global `gro` at this checkout, once - `npm run bootstrap` does this too
cd ../otherproject
npm link ../gro # from `otherproject/`
gro build # from `../gro` on changes

The Rust runtime in crates/ (docs) builds on x86_64 Linux. Run cargo xtask fetch-v8 before any plain cargo command, since every build links the pinned V8 archive it downloads and verifies. cargo xtask build --release builds fgro with its startup snapshot, target/gro_snapshot/release/fgro run file.ts runs a module, and cargo xtask check runs every gate, the Rust and JS halves together.

Credits 🐢🐢🐢

Gro builds on TypeScript ∙ Svelte ∙ SvelteKit ∙ Vite ∙ Vitest ∙ chokidar ∙ @fuzdev/fuz_util ∙ @fuzdev/fuz_schema ∙ ESLint ∙ tsv ∙ svelte-check & more

Contributing

fuz.dev/contributing

License 🐦

0BSD

版本与发布记录

@fuzdev/gro 共发布 58 个版本,首次发布于 2026/02/11;过去 12 个月发布了 58 个版本。

版本发布日期距今
0.237.0latest2026/11/16今天
0.236.02026/11/133 天前
0.235.02026/11/124 天前
0.234.02026/11/114 天前
0.233.02026/11/105 天前
0.232.02026/11/105 天前

关于 @fuzdev/gro 的常见问题

@fuzdev/gro 是什么?

security-first JS runtime and toolchain on V8

如何安装 @fuzdev/gro?

在项目目录运行 npm install @fuzdev/gro,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:svelte(^5)、typescript(^6)、@fuzdev/fuz_util(>=0.81.0)、@fuzdev/fuz_schema(^0.5.7)、@fuzdev/blake3-wasm(^0.2.0)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。它还提供命令行工具 gro,可以用 npx gro 直接运行。

@fuzdev/gro 支持 TypeScript 吗?

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

@fuzdev/gro 支持 ESM 还是 CommonJS?

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

@fuzdev/gro 需要什么版本的 Node.js?

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

@fuzdev/gro 可以商用吗?

@fuzdev/gro 使用 0BSD 许可。几乎没有限制:可自由使用、修改和分发,连保留版权声明也不要求。以上为概括,不构成法律意见,请以许可原文为准。

@fuzdev/gro 的下载量有多少?

根据 npm 官方下载统计,@fuzdev/gro 在 2026/10/16 – 2026/11/14 这 30 天内被下载 5,172 次,日均约 172 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@fuzdev/gro 还在维护吗?

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