@codama/renderers-js-umi

中文文档
1.1.25发布于 2026/09/15MITTypeScriptESM + CJS构建来源已验证近 30 天下载 6.4万

JavaScript renderer compatible with the Umi framework

原始使用文档
文档目录3 节
  1. Installation
  2. Usage
  3. Options

Codama ➤ Renderers ➤ JavaScript Umi

npm npm-downloads

This package generates JavaScript clients from your Codama IDLs. The generated clients are compatible with Metaplex's Umi framework.

Installation

pnpm install @codama/renderers-js-umi

Usage

Add the following script to your Codama configuration file.

{
    "scripts": {
        "js": {
            "from": "@codama/renderers-js-umi",
            "args": ["clients/js/src/generated"]
        }
    }
}

An object can be passed as a second argument to further configure the renderer. See the Options section below for more details.

Options

The renderVisitor accepts the following options.

NameTypeDefaultDescription
deleteFolderBeforeRenderingbooleantrueWhether the base directory should be cleaned before generating new files.
formatCodebooleantrueWhether we should use Prettier to format the generated code.
prettierOptionsPrettierOptions{}The options to use when formatting the code using Prettier.
throwLevel'debug' | 'trace' | 'info' | 'warn' | 'error''error'When validating the Codama IDL, the level at which the validation should throw an error.
customAccountDatastring[][]The names of all AccountNodes whose data should be manually written in JavaScript.
customInstructionDatastring[][]The names of all InstructionNodes whose data should be manually written in JavaScript.
linkOverridesRecord<'accounts' | 'definedTypes' | 'instructions' | 'pdas' | 'programs' | 'resolvers', Record<string, string>>{}A object that overrides the import path of link nodes. For instance, { definedTypes: { counter: 'hooked' } } uses the hooked folder to import any link node referring to the counter type.
dependencyMapRecord<string, string>{}A mapping between import aliases and their actual package name or path in JavaScript.
internalNodesstring[][]The names of all nodes that should be generated but not exported by the index.ts files.
nonScalarEnumsstring[][]The names of enum variants with no data that should be treated as a data union instead of a native enum type. This is only useful if you are referencing an enum value in your Codama IDL.
renderParentInstructionsbooleanfalseWhen using nested instructions, whether the parent instructions should also be rendered. When set to false (default), only the instruction leaves are being rendered.

版本与发布记录

@codama/renderers-js-umi 共发布 28 个版本,首次发布于 2024/10/10;过去 12 个月发布了 2 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.1.25latest2026/09/151 个月前
1.1.242025/11/2611 个月前
1.1.232025/09/191.1 年前
1.1.222025/09/121.2 年前
1.1.212025/09/111.2 年前
1.1.202025/09/021.2 年前

关于 @codama/renderers-js-umi 的常见问题

@codama/renderers-js-umi 是什么?

JavaScript renderer compatible with the Umi framework

如何安装 @codama/renderers-js-umi?

在项目目录运行 npm install @codama/renderers-js-umi,或使用 pnpm add / yarn add / bun add。

@codama/renderers-js-umi 支持 TypeScript 吗?

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

@codama/renderers-js-umi 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@codama/renderers-js-umi 需要什么版本的 Node.js?

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

@codama/renderers-js-umi 可以商用吗?

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

@codama/renderers-js-umi 的下载量有多少?

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

@codama/renderers-js-umi 还在维护吗?

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