@adobe-apimesh/mesh-builder 1.0.0 → 1.0.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 +40 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Mesh Builder
|
|
2
|
+
|
|
3
|
+
Package with mesh artifacts building and compiling logic
|
|
4
|
+
|
|
5
|
+
## Exports
|
|
6
|
+
|
|
7
|
+
### validateMesh
|
|
8
|
+
|
|
9
|
+
validateMesh(meshConfig: MeshConfig) => Promise<boolean>
|
|
10
|
+
|
|
11
|
+
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.
|
|
12
|
+
|
|
13
|
+
### buildMesh
|
|
14
|
+
|
|
15
|
+
buildMesh(meshId: string, meshConfig: MeshConfig) => Promise<boolean | undefined>
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
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.
|
|
20
|
+
|
|
21
|
+
### compileMesh
|
|
22
|
+
|
|
23
|
+
compileMesh(meshId: string) => Promise<string[]>
|
|
24
|
+
|
|
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
|
+
|
|
27
|
+
## Types
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
buildMesh(meshId: string, meshConfig: MeshConfig) => Promise<boolean | undefined>
|
|
31
|
+
|
|
32
|
+
compileMesh(meshId: string) => Promise<string[]>
|
|
33
|
+
|
|
34
|
+
type MeshBuildError {
|
|
35
|
+
name: string;
|
|
36
|
+
stack?: string;
|
|
37
|
+
cause?: unknown;
|
|
38
|
+
requestId?: string;
|
|
39
|
+
}
|
|
40
|
+
```
|