Updated `embark-pipeline` stack component documentation.

Eric Mastro 2020-02-06 17:15:57 +11:00
parent 938f4a4d5d
commit 479be3e6fb
1 changed files with 74 additions and 15 deletions

@ -19,9 +19,9 @@
* contracts-manager
* deployment
* embarkjs
* library-manager
* [library-manager](#library-manager)
* namesystem
* pipeline
* [pipeline](#embark-pipeline)
* process-logs-api-manager
* [proxy](#proxy)
* storage
@ -583,26 +583,85 @@ module type: stack component
##### requests
name: `pipeline:generateAll`
Generates files registered with the pipeline
arguments:
* cb {function} - function called once all the files have been generated by the pipeline
description: Generates all files registered in the pipeline
name: `pipeline:register`
arguments:
* Object
* `path` (array<string>) - directory to write the file
* `file` <string> - filename
* `format` <string> - file format
* `content` <string> - file content
* params {object} - Params used for generating a file with the pipeline. Interface for params:
```
{
path {string} - output directory,
file: {string} - output filename,
format {string} - output file format (extension),
content {string} - output file contents
}
```
* doneCb {function} - function that is fired once the blockchain node has started
description: Registers a file to be generated by the pipeline when `pipeline:generateAll` is called. If a path+file has already been registered before, it will override it.
registers a file with the pipeline to be generated.
if a path+file has already been registered before, it will override it.
##### actions run
##### actions
* `pipeline:generateAll:before` - Runs registered actions before the pipeline files are generated. Registering an event for this action is useful for timing when to register a pipeline file.
name: `pipeline:generateAll:before`
description: actions to run before the pipeline generates all the files
* `pipeline:generateAll:after` - Runs registered actions after the pipeline files are generated. Registering an event for this action is useful for timing automated front-end build tools, such as Embark's built-in webpack pipeline.
name: `pipeline:generateAll:after`
description: actiosn to run after the pipeline generates all the files
#### Endpoints
##### GET /embark-api/file
- **endpoint**: `/embark-api/file`
- **type**: `GET`
- **description**: Retrieves a file for the given path. Ensures that the file exists in the dapp directory.
- **params**:
- `path {string}` - path of the file of the file to retrieve
- **response**: `object` - Resulting retrieved file.
- `name {string}` - file name
- `content` {string} - file content
- `path` {string} - file path (equivalent to `path` parameter)
##### POST /embark-api/folders
- **endpoint**: `/embark-api/folders`
- **type**: `POST`
- **description**: Creates a directory for the given path. Ensures that the directory is in the dapp path.
- **params**:
- `path {string}` - path of the directory to create
- **response**: `object` - Resulting retrieved file.
- `name {string}` - created directory name
- `path` {string} - created directory path (equivalent to `path` parameter)
##### POST /embark-api/files
- **endpoint**: `/embark-api/files`
- **type**: `POST`
- **description**: Creates a file in the given path. Ensures that the path is in the dapp path.
- **params**:
- `path {string}` - path of the file to create
- `content {string}` - content of the file to create
- **response**: `object` - Resulting retrieved file.
- `name {string}` - created file name
- `path` {string} - created file path (equivalent to `path` parameter)
- `content` {string} - created file content (equivalent to `content` parameter)
##### DELETE /embark-api/file
- **endpoint**: `/embark-api/file`
- **type**: `DELETE`
- **description**: Deletes a file in the given path. Ensures that the path is in the dapp path.
- **params**:
- `path {string}` - path of the file to create
- **response**: `void`
##### GET /embark-api/files
- **endpoint**: `/embark-api/files`
- **type**: `GET`
- **description**: Gets an array of all files and directories in the dapp. Directories contain a `children` property, showing all child files - and directories.
- **params**: none
- **response**: `Array<File>` - An array of files in the dapp.
- `isRoot {boolean}` - `true` if the file or directory exists in the root of the dapp.
- `name` {string} - Name of the file or directory.
- `dirname` {string} - path of the parent directory.
- `path` {string} - Path of the file or directory.
- `ishidden` {boolean} - indicates if the file is meant to be hidden in file trees. `true` if the name begins with "." or the name is "node_modules"
- `children` {Array<File>} - An array of files or directories that exist in the current directory. This property only exists for directories.
### basic-pipeline