# @adobe-apimesh/mesh-builder

> Package with mesh artifacts building and compiling logic

Latest version **2.6.0-alpha.0** (published 2026-11-04) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @adobe-apimesh/mesh-builder
pnpm add @adobe-apimesh/mesh-builder
yarn add @adobe-apimesh/mesh-builder
bun add @adobe-apimesh/mesh-builder
```

## Health

**Score 55/100 (C)** — status: active.

Positive: no vulnerabilities; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

## Facts

| | |
|---|---|
| Version | 2.6.0-alpha.0 |
| Published | 2026-11-04 |
| First published | 2023-10-04 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | annavara, adobe-apimesh-svc, dthampy, amolina-adobe, ajazsumaiya |

## Links

- npm: https://www.npmjs.com/package/@adobe-apimesh/mesh-builder
- npm.io page: https://npm.io/package/@adobe-apimesh/mesh-builder

## Recent versions

- 2.6.0-alpha.0 (latest) — 2026-11-04
- 1.3.4-beta.0 (beta) — 2023-11-27
- 2.5.5 — 2026-11-02
- 2.5.4 — 2026-09-17
- 2.5.3 — 2026-09-11
- 2.5.3-alpha.0 — 2026-09-09
- 2.5.2 — 2026-09-03
- 2.5.2-alpha.4 — 2026-09-01
- 2.5.2-alpha.1 — 2026-07-22
- 2.5.1 — 2026-06-02
- 2.4.2-alpha.1 — 2026-05-19
- 2.4.1 — 2026-05-12
- 2.4.1-alpha.1 — 2026-04-29
- 2.4.0 — 2026-03-25
- 2.4.0-alpha.2 — 2026-03-24
- … 46 more at https://npm.io/package/@adobe-apimesh/mesh-builder/versions

## README

# Mesh Builder

Package with mesh artifacts building and compiling logic

## Exports

### validateMesh

validateMesh(meshConfig: MeshConfig) => Promise<boolean>

Validate Mesh function takes the `meshConfig` as argument and validates if the mesh confines with the CLI rules. Upon a successful validation the function resolves the returned promise. If validation fails, all reasons for invalidation will be thrown in the rejected promise.

### buildMesh

buildMesh(meshId: string, meshConfig: MeshConfig) => Promise<boolean | undefined>

Build Mesh function takes the `meshId` and `meshConfig` as arguments and builds the mesh artifacts under the `mesh-artifact` folder in the current working directory under the `meshId` sub directory.

Upon a successful build, `buildMesh` returns a Promise that resolves to `true` and `false` for a failure. `buildMesh` will throw `MeshBuildError` if there is a bulid error.

### compileMesh

compileMesh(meshId: string) => Promise<string[]>

Compile Mesh function takes the `meshId` to find the built TypeScript mesh artifacts under the `mesh-artifact` folder and compiles them to JavaScript using the `typescript` package. It returns a Promise of JavaScript file paths that have been compiled and written to file system.

### normalizeMeshConfig

normalizeMeshConfig(meshConfig: MeshConfig, basePath?: string) => Promise<MeshConfig>

Normalize Mesh Config function takes the `meshConfig` and normalizes `additionalTypeDefs`.

If `additionalTypeDefs` contains `.graphql`/`.gql` paths, it will resolve their contents (including via `meshConfig.files`, disk, or relative to `basePath` when provided), keeps `additionalTypeDefs` as an array of strings, and removes any GraphQL file entries from `meshConfig.files`.

```ts
import meshBuilder from "@multitenant-graphql/mesh-builder";

const normalized = await meshBuilder.normalizeMeshConfig(meshConfig);
// or
const normalized = await meshBuilder.normalizeMeshConfig(meshConfig, "/abs/path/to/.meshrc.json");
```

## Types

```ts
validateMesh(meshConfig: MeshConfig) => Promise<boolean>

buildMesh(meshId: string, meshConfig: MeshConfig) => Promise<boolean | undefined>

compileMesh(meshId: string) => Promise<string[]>

normalizeMeshConfig(meshConfig: MeshConfig, basePath?: string) => Promise<MeshConfig>

type MeshBuildError {
    name: string;
    stack?: string;
    cause?: unknown;
    requestId?: string;
}
```

---
_Source: https://npm.io/package/@adobe-apimesh/mesh-builder · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
