@amitkaps/craftz

中文文档
0.20.0发布于 2026/11/05MITES Module零依赖构建来源已验证近 30 天下载 3864

craftz — one way to build, check, deploy and release.

原始使用文档
文档目录3 节
  1. What it does
  2. Install
  3. Use

craftz

One way to build, check, deploy and release a repository, as a package each one depends on.

Every repository makes the same choices, like its toolchain, versions, workflows, branch protection and deploys. Made in each one separately, they drift. craftz holds them as rules, checks a repository against the version it installs, and fixes what it can. Moving every repository to a new choice is then a version bump, not a copy into each one.

What it does

CommandDoes
craftz checkchecks the repository against every rule, as part of its verify
craftz fixwrites every fix that can be automated
craftz upgrademoves the repository to the latest craftz, and runs its fix
craftz settingschecks and writes what lives outside the files, on GitHub and Cloudflare
craftz statusreads what's live: CI, pull requests, npm, and a site's latest build and addresses
craftz deploydeploys a site the way its Worker config says
craftz propens a pull request that merges itself once CI passes
craftz gonedeletes the local branches that merged
craftz releaseopens the pull request that releases a package
craftz depssays what the install holds, and which dependency brings it
craftz shotsaves a page as a PNG, with the repository's Playwright
craftz rulesprints the rules, or one rule or part, from the installed version
craftz helplists the commands, or prints what one does
craftz newstarts a repository that already follows the rules

An agent reads the rules with craftz rules, from the version the repository installed, so it never works from a fetched page or an older copy.

It's opinionated, and built for one setup: Vite+, pnpm, Node 26, GitHub and Cloudflare Workers. A repository on that setup gets the same build, checks, pull requests, releases and deploys as every other one.

Install

pnpm add -D @amitkaps/craftz
pnpm exec craftz fix

The first fix writes the craftz, pr and gone scripts, and the rest of what can be fixed. From then on, pnpm craftz runs it.

It needs Node 26.13.0 or newer, the Node it's built and tested on.

Use

pnpm craftz check                 # what's out of line
pnpm craftz fix                   # fix what can be fixed
pnpm craftz rules scripts-verify  # what one rule asks, and why
pnpm craftz rules scripts         # the Scripts part, and Practice

To start a repository instead, run pnpm dlx @amitkaps/craftz new. To move to a new craftz, add it again at @latest and run pnpm craftz fix, as its usage says.

Read the docs for its design, the rules, its usage, the plan and the lessons.

版本与发布记录

@amitkaps/craftz 共发布 24 个版本,首次发布于 2026/10/20;过去 12 个月发布了 24 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.20.0latest2026/11/051 天前
0.19.02026/11/051 天前
0.18.12026/11/042 天前
0.18.02026/11/042 天前
0.17.02026/11/042 天前
0.16.02026/11/015 天前

关于 @amitkaps/craftz 的常见问题

@amitkaps/craftz 是什么?

craftz — one way to build, check, deploy and release.

如何安装 @amitkaps/craftz?

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

@amitkaps/craftz 支持 TypeScript 吗?

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

@amitkaps/craftz 支持 ESM 还是 CommonJS?

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

@amitkaps/craftz 需要什么版本的 Node.js?

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

@amitkaps/craftz 可以商用吗?

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

@amitkaps/craftz 的下载量有多少?

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

@amitkaps/craftz 还在维护吗?

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