@architect/deploy

中文文档
7.0.3发布于 2026/01/20Apache-2.0CommonJS构建来源已验证近 30 天下载 1.1万

Deploys @architect projects

原始使用文档
文档目录8 节
  1. @architect/deploy
  2. Installation
  3. Requirements
  4. API
  5. deploy.direct({ isDryRun, srcDirs }, callback)
  6. deploy.sam({ quiet, verbose, production }, callback)
  7. deploy.static({ bucket, credentials, fingerprint, prefix, p…
  8. aws-sdk caveat

@architect/deploy

Architect serverless framework module for deploying applications to cloud infrastructure

GitHub CI status

Installation

npm i @architect/deploy
let deploy = require('@architect/deploy')

Requirements

You need to have the sam command-line utility available on your $PATH. Check out AWS' docs for instructions on how to install this.

API

deploy.direct({ isDryRun, srcDirs }, callback)

Deploys function code directly to one or more staging (or production) environment Lambdas by ommitting CloudFormation and directly updating code payloads. This is very useful for live debugging; changes made with direct deploys should be considered temporary.

deploy.sam({ quiet, verbose, production }, callback)

Deploys all infrastructure associated to your @architect app.

Set quiet to truthy to suppress deployment progress and status messages (from the updater system). Set verbose to truthy to enable detailed output including CloudFormation logs, file operation details, and deployment artifact information. By default will only push to the staging environment unless production is truthy.

deploy.static({ bucket, credentials, fingerprint, prefix, prune, quiet, region, verbose, production }, callback)

All parameters are optional.

Pushes static assets from the public/ folder of @architect apps to S3, as defined by your @architect app's .arc file. Respects fingerprint (true or external), prefix, prune, and ignore params or @static pragma directives (more information available on the @static arc guide).

By default will only publish to the staging environment unless production is truthy. Set verbose to truthy to enable chatty mode.

aws-sdk caveat

Deploy requires aws-sdk; earlier versions included aws-sdk in peerDependencies, which prior to npm 7 would not automatically install aws-sdk. This is because Architect assumes you already have aws-sdk installed via Architect, or that it's available at runtime if you're using Deploy in a Lambda.

However, npm 7 (once again) changed the behavior of peerDependencies, now automatically installing all peerDependencies (instead of merely printing a reminder). This means any Lambdas that use Deploy would get a >50MB dependency payload if deployed on a machine with npm 7.

As such, please ensure aws-sdk is installed to your project or globally to your machine. We are sorry to make this a userland issue, but we feel this is preferable to unnecessarily and invisibly causing aws-sdk to be double-installed in Lambdas, negatively impacting coldstart times and adding to bug vectors.

版本与发布记录

@architect/deploy 共发布 247 个版本,首次发布于 2019/07/12;过去 12 个月发布了 7 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
7.0.3latest2026/01/209 个月前
7.0.22026/01/169 个月前
7.0.12025/12/1610 个月前
7.0.02025/11/2811 个月前
7.0.0-RC.0RC2025/11/2611 个月前
6.0.12025/11/1411 个月前

关于 @architect/deploy 的常见问题

@architect/deploy 是什么?

Deploys @architect projects

如何安装 @architect/deploy?

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

@architect/deploy 支持 TypeScript 吗?

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

@architect/deploy 支持 ESM 还是 CommonJS?

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

@architect/deploy 需要什么版本的 Node.js?

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

@architect/deploy 可以商用吗?

@architect/deploy 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@architect/deploy 的下载量有多少?

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

@architect/deploy 还在维护吗?

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