mirror of https://github.com/embarklabs/embark.git
Updated `embark-pipeline` stack component documentation.
parent
938f4a4d5d
commit
479be3e6fb
|
@ -19,9 +19,9 @@
|
||||||
* contracts-manager
|
* contracts-manager
|
||||||
* deployment
|
* deployment
|
||||||
* embarkjs
|
* embarkjs
|
||||||
* library-manager
|
* [library-manager](#library-manager)
|
||||||
* namesystem
|
* namesystem
|
||||||
* pipeline
|
* [pipeline](#embark-pipeline)
|
||||||
* process-logs-api-manager
|
* process-logs-api-manager
|
||||||
* [proxy](#proxy)
|
* [proxy](#proxy)
|
||||||
* storage
|
* storage
|
||||||
|
@ -583,26 +583,85 @@ module type: stack component
|
||||||
##### requests
|
##### requests
|
||||||
|
|
||||||
name: `pipeline:generateAll`
|
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`
|
name: `pipeline:register`
|
||||||
arguments:
|
arguments:
|
||||||
* Object
|
* params {object} - Params used for generating a file with the pipeline. Interface for params:
|
||||||
* `path` (array<string>) - directory to write the file
|
```
|
||||||
* `file` <string> - filename
|
{
|
||||||
* `format` <string> - file format
|
path {string} - output directory,
|
||||||
* `content` <string> - file content
|
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.
|
##### actions run
|
||||||
if a path+file has already been registered before, it will override it.
|
|
||||||
|
|
||||||
##### 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`
|
* `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.
|
||||||
description: actions to run before the pipeline generates all the files
|
|
||||||
|
|
||||||
name: `pipeline:generateAll:after`
|
#### Endpoints
|
||||||
description: actiosn to run after the pipeline generates all the files
|
|
||||||
|
##### 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
|
### basic-pipeline
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue