import {BuildNodeRunnerProcess} from 'projext/src/services/building/buildNodeRunnerProcess.js'BuildNodeRunnerProcess
Extends:
This service implements nodemon and NodeWatcher in order to run Node apps while
watching, transpiling and copying files.
Constructor Summary
| Public Constructor | ||
| public |
constructor(appLogger: Logger, buildTranspiler: BuildTranspiler, projectConfiguration: ProjectConfigurationSettings) |
|
Member Summary
| Public Members | ||
| public |
A local reference for the |
|
| public |
A local reference for the |
|
| public |
defaultOptions: {"executable": *, "inspectOptions": *, "watch": *, "ignore": *, "envVars": *, "legacyWatch": *} The default values for the options that can be customized when calling |
|
| public |
This dictionary is where the parameters sent to the |
|
| public |
A simple flag to check whether the process is running or not. |
|
Method Summary
| Public Methods | ||
| public |
Enables |
|
| public |
run(executable: string, watch: Array, inspectOptions: NodeInspectorSettings, transpilationPaths: Array, copyPaths: Array, envVars: Object, ignore: Array, setupFn: Function(instance:BuildNodeRunnerProcess)): Nodemon Run a Node application. |
|
Inherited Summary
| From class NodeWatcher | ||
| public |
Whether or not the service is watching. |
|
| private |
This will be the instance of |
|
| public |
Gets the list of paths the service is watching. |
|
| public |
stop() Stops watching the directories. |
|
| public |
Starts watching the directories. |
|
Public Constructors
public constructor(appLogger: Logger, buildTranspiler: BuildTranspiler, projectConfiguration: ProjectConfigurationSettings) source
Override:
NodeWatcher#constructorParams:
| Name | Type | Attribute | Description |
| appLogger | Logger | The inform on the CLI of the events of the runner. |
|
| buildTranspiler | BuildTranspiler | To transpile files if needed. |
|
| projectConfiguration | ProjectConfigurationSettings | To read the watch settings. |
Public Members
public defaultOptions: {"executable": *, "inspectOptions": *, "watch": *, "ignore": *, "envVars": *, "legacyWatch": *} source
The default values for the options that can be customized when calling run.
Properties:
| Name | Type | Attribute | Description |
| executable | string | The path to the file |
|
| inspectOptions | NodeInspectorSettings | The settings for the Node inspector. |
|
| watch | Array | The list of directories |
|
| ignore | Array | A list of patterns |
|
| envVars | Object | A dictionary of environment variables to send to the execution process. |
|
| legacyWatch | boolean | Whether or not to enable |
Public Methods
public run(executable: string, watch: Array, inspectOptions: NodeInspectorSettings, transpilationPaths: Array, copyPaths: Array, envVars: Object, ignore: Array, setupFn: Function(instance:BuildNodeRunnerProcess)): Nodemon source
Run a Node application.
Params:
| Name | Type | Attribute | Description |
| executable | string | The path to the file to execute. |
|
| watch | Array | The list of directories to watch in order to restart the application. |
|
| inspectOptions | NodeInspectorSettings | The settings for the Node inspector. |
|
| transpilationPaths | Array |
|
A list of dictionaries with |
| copyPaths | Array |
|
A list of dictionaries with |
| envVars | Object |
|
A dictionary with extra environment variables to send to the execution process. |
| ignore | Array |
|
A list of file name patterns the service that will be ignored by the |
| setupFn | Function(instance:BuildNodeRunnerProcess) |
|
A custom callback that will be executed before starting (and restaring) a Node application. It can be used to "modify the environment" before the application runs. |
TODO:
- refactor the parameters into a single "options object".
- watch the .env files.
