@adobe-apimesh/mesh-builder 2.3.0 → 2.4.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +18 -0
- package/dist/meshBuilder.js +1 -1
- package/dist/scripts/buildMesh.js +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -24,6 +24,22 @@ compileMesh(meshId: string) => Promise<string[]>
|
|
|
24
24
|
|
|
25
25
|
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.
|
|
26
26
|
|
|
27
|
+
### normalizeMeshConfig
|
|
28
|
+
|
|
29
|
+
normalizeMeshConfig(meshConfig: MeshConfig, basePath?: string) => Promise<MeshConfig>
|
|
30
|
+
|
|
31
|
+
Normalize Mesh Config function takes the `meshConfig` and normalizes `additionalTypeDefs`.
|
|
32
|
+
|
|
33
|
+
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`.
|
|
34
|
+
|
|
35
|
+
```ts
|
|
36
|
+
import meshBuilder from "@multitenant-graphql/mesh-builder";
|
|
37
|
+
|
|
38
|
+
const normalized = await meshBuilder.normalizeMeshConfig(meshConfig);
|
|
39
|
+
// or
|
|
40
|
+
const normalized = await meshBuilder.normalizeMeshConfig(meshConfig, "/abs/path/to/.meshrc.json");
|
|
41
|
+
```
|
|
42
|
+
|
|
27
43
|
## Types
|
|
28
44
|
|
|
29
45
|
```ts
|
|
@@ -33,6 +49,8 @@ buildMesh(meshId: string, meshConfig: MeshConfig) => Promise<boolean | undefined
|
|
|
33
49
|
|
|
34
50
|
compileMesh(meshId: string) => Promise<string[]>
|
|
35
51
|
|
|
52
|
+
normalizeMeshConfig(meshConfig: MeshConfig, basePath?: string) => Promise<MeshConfig>
|
|
53
|
+
|
|
36
54
|
type MeshBuildError {
|
|
37
55
|
name: string;
|
|
38
56
|
stack?: string;
|