@akala/pm 9.0.2 → 9.0.3

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/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "pm": "dist/esm/cli.js",
5
5
  "pm-fork": "dist/esm/fork.js"
6
6
  },
7
- "version": "9.0.2",
7
+ "version": "9.0.3",
8
8
  "scripts": {
9
9
  "test": "echo 1",
10
10
  "generate": "ac generate dist/esm/commands commands.json",
package/src/akala.mts CHANGED
@@ -12,6 +12,7 @@ import { CliContext, ErrorMessage, NamespaceMiddleware, unparse } from '@akala/c
12
12
  import { InteractError } from './index.js';
13
13
  import { ObservableObject, Parser } from '@akala/core';
14
14
  import module from 'module'
15
+ import commands from './container.js';
15
16
 
16
17
  const require = module.createRequire(import.meta.url);
17
18
 
@@ -152,7 +153,7 @@ export default function (_config, program: NamespaceMiddleware)
152
153
  if (!processor)
153
154
  processor = new Processors.JsonRpc(Processors.JsonRpc.getConnection(new NetSocketAdapter(socket)));
154
155
  if (!metaContainer)
155
- metaContainer = require('../../commands.json');
156
+ metaContainer = commands.meta;
156
157
  if (!container)
157
158
  {
158
159
  container = proxy(metaContainer, processor);
@@ -5,5 +5,5 @@ import { CliContext } from "@akala/cli";
5
5
  export default async function restart(pm: pmContainer.container, name: string, context?: CliContext<{ new?: boolean, name: string, inspect?: boolean, verbose?: boolean, wait?: boolean }>): Promise<void | { execPath: string, args: string[], cwd: string, stdio: StdioOptions, shell: boolean, windowsHide: boolean }>
6
6
  {
7
7
  await pm.dispatch('stop', name);
8
- await pm.dispatch('start', name, context);
8
+ await pm.dispatch('start', name, context.options, context);
9
9
  }
@@ -4,7 +4,8 @@
4
4
  "inject": [
5
5
  "$container",
6
6
  "param.0",
7
- "param.1"
7
+ "param.1",
8
+ "param.2"
8
9
  ]
9
10
  },
10
11
  "cli": {
@@ -34,6 +35,7 @@
34
35
  "inject": [
35
36
  "$container",
36
37
  "options.program",
38
+ "options",
37
39
  "context"
38
40
  ],
39
41
  "usage": "start <program>"
@@ -16,18 +16,18 @@ import { fileURLToPath } from 'url'
16
16
  //@ts-ignore
17
17
  const _dirname = typeof __dirname !== 'undefined' ? __dirname : path.dirname(fileURLToPath(import.meta.url))
18
18
 
19
- export default async function start(this: State, pm: pmContainer.container & Container<State>, name: string, context?: CliContext<{ new?: boolean, name: string, keepAttached?: boolean, inspect?: boolean, verbose?: boolean, wait?: boolean }>): Promise<void | { execPath: string, args: string[], cwd: string, stdio: StdioOptions, shell: boolean, windowsHide: boolean }>
19
+ export default async function start(this: State, pm: pmContainer.container & Container<State>, name: string, options?: CliContext<{ new?: boolean, name: string, keepAttached?: boolean, inspect?: boolean, verbose?: boolean, wait?: boolean }>['options'], context?: Pick<CliContext<{}>, 'args'>): Promise<void | { execPath: string, args: string[], cwd: string, stdio: StdioOptions, shell: boolean, windowsHide: boolean }>
20
20
  {
21
21
  let args: string[];
22
-
23
- if (!context.options.name && context.options.new)
24
- context.options.name = getRandomName();
25
- else if (!context.options.name)
26
- context.options.name = name;
22
+ if (options)
23
+ if (!options.name && options.new)
24
+ options.name = getRandomName();
25
+ else if (!options.name)
26
+ options.name = name;
27
27
 
28
28
  if (this.isDaemon)
29
29
  {
30
- var instanceConfig = this.config.mapping[context.options.name];
30
+ var instanceConfig = this.config.mapping[options.name || name];
31
31
  var def: ProxyConfiguration<SidecarMetadata>;
32
32
  if (typeof instanceConfig == 'undefined')
33
33
  def = this.config.containers[name];
@@ -35,7 +35,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
35
35
  def = this.config.containers[instanceConfig.container];
36
36
 
37
37
  // eslint-disable-next-line no-var
38
- var container = this.processes[context.options.name];
38
+ var container = this.processes[options.name || name];
39
39
  if (container && container.running)
40
40
  throw new Error(container.name + ' is already started');
41
41
 
@@ -47,7 +47,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
47
47
  throw new ErrorWithStatus(404, `No mapping was found for ${name}. Did you want to run \`pm install ${name}\` or maybe are you missing the folder to ${name} ?`)
48
48
  }
49
49
 
50
- args.unshift(...context.args, ...unparseOptions({ ...context.options, program: undefined, new: undefined, inspect: undefined }, { ignoreUndefined: true }));
50
+ args.unshift(...context?.args, ...unparseOptions({ ...options, program: undefined, new: undefined, inspect: undefined }, { ignoreUndefined: true }));
51
51
  if (def && def.get('path'))
52
52
  args.unshift('--program=' + def.get('path'));
53
53
  else
@@ -58,7 +58,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
58
58
  if (name != 'pm')
59
59
  throw new ErrorWithStatus(40, 'this command needs to run through daemon process');
60
60
 
61
- args = [...context.args, ...unparseOptions({ ...context.options, inspect: undefined })];
61
+ args = [...context?.args, ...unparseOptions({ ...options, inspect: undefined })];
62
62
  }
63
63
 
64
64
  if (!def?.type || def.type == 'nodejs')
@@ -67,18 +67,18 @@ export default async function start(this: State, pm: pmContainer.container & Con
67
67
  args.unshift(path.resolve(_dirname, '../fork'))
68
68
  }
69
69
 
70
- if (context.options && context.options.inspect)
70
+ if (options && options.inspect)
71
71
  args.unshift('--inspect-brk');
72
72
 
73
73
  args.unshift(...process.execArgv);
74
74
 
75
- if (context.options && context.options.verbose)
75
+ if (options && options.verbose)
76
76
  args.push('-v')
77
77
 
78
78
  let cp: ChildProcess;
79
79
  if (!this.isDaemon)
80
80
  {
81
- if (context.options.keepAttached)
81
+ if (options.keepAttached)
82
82
  cp = spawn(process.execPath, args, { cwd: process.cwd(), stdio: ['inherit', 'inherit', 'inherit', 'ipc'] });
83
83
  else
84
84
  cp = spawn(process.execPath, args, { cwd: process.cwd(), detached: true, stdio: ['ignore', 'ignore', 'ignore', 'ipc'] });
@@ -95,7 +95,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
95
95
  {
96
96
  cp.on('disconnect', function ()
97
97
  {
98
- if (!context.options.keepAttached)
98
+ if (!options.keepAttached)
99
99
  cp.unref();
100
100
  console.log('pm started');
101
101
  resolve();
@@ -108,21 +108,21 @@ export default async function start(this: State, pm: pmContainer.container & Con
108
108
  {
109
109
  var missingDeps = def.dependencies.filter(d => !this.config.mapping[d]);
110
110
  if (missingDeps.length > 0)
111
- throw new ErrorWithStatus(404, `Some dependencies are missing to start ${context.options.name}:\n\t-${missingDeps.join('\n\t-')}`);
111
+ throw new ErrorWithStatus(404, `Some dependencies are missing to start ${options.name}:\n\t-${missingDeps.join('\n\t-')}`);
112
112
 
113
- await eachAsync(def.dependencies, (dep) => pm.dispatch('start', dep, { name: context.options.name + '-' + dep, wait: true }));
113
+ await eachAsync(def.dependencies, async (dep) => { await pm.dispatch('start', dep, { name: options.name + '-' + dep, wait: true }) });
114
114
  }
115
115
 
116
116
  if (def?.type && def.type !== 'nodejs')
117
117
  throw new ErrorWithStatus(400, `container with type ${this.config.containers[name]?.type} are not yet supported`);
118
- cp = spawn(process.execPath, args, { cwd: process.cwd(), detached: !context.options.keepAttached, env: Object.assign({ DEBUG_COLORS: true }, process.env), stdio: ['ignore', 'pipe', 'pipe', 'ipc'], shell: false, windowsHide: true });
119
- cp.stderr?.pipe(new NewLinePrefixer(context.options.name + ' ', { useColors: true })).pipe(process.stderr);
120
- cp.stdout?.pipe(new NewLinePrefixer(context.options.name + ' ', { useColors: true })).pipe(process.stdout);
118
+ cp = spawn(process.execPath, args, { cwd: process.cwd(), detached: !options.keepAttached, env: Object.assign({ DEBUG_COLORS: true }, process.env), stdio: ['ignore', 'pipe', 'pipe', 'ipc'], shell: false, windowsHide: true });
119
+ cp.stderr?.pipe(new NewLinePrefixer(options.name + ' ', { useColors: true })).pipe(process.stderr);
120
+ cp.stdout?.pipe(new NewLinePrefixer(options.name + ' ', { useColors: true })).pipe(process.stdout);
121
121
 
122
122
  if (!container || !container.running)
123
123
  {
124
124
  const socket = new IpcAdapter(cp);
125
- container = new Container(context.options.name, null) as RunningContainer;
125
+ container = new Container(options.name, null) as RunningContainer;
126
126
  const connection = Processors.JsonRpc.getConnection(socket, pm, (params) =>
127
127
  {
128
128
  params.process = cp;
@@ -132,14 +132,14 @@ export default async function start(this: State, pm: pmContainer.container & Con
132
132
 
133
133
  connection.on('close', function disconnected()
134
134
  {
135
- console.warn(`${context.options.name} has disconnected`);
135
+ console.warn(`${options.name} has disconnected`);
136
136
  container.running = false;
137
137
  });
138
138
 
139
139
  if (def?.commandable)
140
140
  pm.register(container, def?.stateless);
141
141
 
142
- this.processes[context.options.name] = container;
142
+ this.processes[options.name] = container;
143
143
  }
144
144
  container.process = cp;
145
145
 
@@ -161,7 +161,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
161
161
  });
162
162
  }, () =>
163
163
  {
164
- console.warn(`${context.options.name} has disconnected`);
164
+ console.warn(`${options.name} has disconnected`);
165
165
  container.running = false;
166
166
  });
167
167
 
@@ -177,7 +177,7 @@ export default async function start(this: State, pm: pmContainer.container & Con
177
177
  container.ready.reject(new Error('program stopped: ' + buffer?.join('')));
178
178
  }
179
179
  });
180
- if (context.options.wait && container.commandable)
180
+ if (options.wait && container.commandable)
181
181
  {
182
182
  //eslint-disable-next-line no-inner-declarations
183
183
  function gather(chunk: string)
package/src/container.ts CHANGED
@@ -24,7 +24,7 @@ namespace commands
24
24
  dispatch (cmd:'ready', ...args: []): ReturnType<typeof import('./commands/ready.js').default>
25
25
  dispatch (cmd:'reload-metadata', ...args: [Argument0<typeof import('./commands/reload-metadata.js').default>]): ReturnType<typeof import('./commands/reload-metadata.js').default>
26
26
  dispatch (cmd:'restart', ...args: [Argument1<typeof import('./commands/restart.js').default>, Argument2<typeof import('./commands/restart.js').default>]): ReturnType<typeof import('./commands/restart.js').default>
27
- dispatch (cmd:'start', ...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
27
+ dispatch (cmd:'start', ...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>, Argument3<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
28
28
  dispatch (cmd:'status', ...args: [Argument0<typeof import('./commands/status.js').default>]): ReturnType<typeof import('./commands/status.js').default>
29
29
  dispatch (cmd:'stop', ...args: [Argument0<typeof import('./commands/stop.js').default>]): ReturnType<typeof import('./commands/stop.js').default>
30
30
  dispatch (cmd:'update', ...args: [Argument0<typeof import('./commands/update.js').default>, Argument1<typeof import('./commands/update.js').default>, Argument2<typeof import('./commands/update.js').default>]): ReturnType<typeof import('./commands/update.js').default>
@@ -48,13 +48,13 @@ namespace commands
48
48
  'ready'(...args: []): ReturnType<typeof import('./commands/ready.js').default>
49
49
  'reload-metadata'(...args: [Argument0<typeof import('./commands/reload-metadata.js').default>]): ReturnType<typeof import('./commands/reload-metadata.js').default>
50
50
  'restart'(...args: [Argument1<typeof import('./commands/restart.js').default>, Argument2<typeof import('./commands/restart.js').default>]): ReturnType<typeof import('./commands/restart.js').default>
51
- 'start'(...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
51
+ 'start'(...args: [Argument1<typeof import('./commands/start.js').default>, Argument2<typeof import('./commands/start.js').default>, Argument3<typeof import('./commands/start.js').default>]): ReturnType<typeof import('./commands/start.js').default>
52
52
  'status'(...args: [Argument0<typeof import('./commands/status.js').default>]): ReturnType<typeof import('./commands/status.js').default>
53
53
  'stop'(...args: [Argument0<typeof import('./commands/stop.js').default>]): ReturnType<typeof import('./commands/stop.js').default>
54
54
  'update'(...args: [Argument0<typeof import('./commands/update.js').default>, Argument1<typeof import('./commands/update.js').default>, Argument2<typeof import('./commands/update.js').default>]): ReturnType<typeof import('./commands/update.js').default>
55
55
  'version'(...args: [Argument0<typeof import('./commands/version.js').default>, Argument1<typeof import('./commands/version.js').default>]): ReturnType<typeof import('./commands/version.js').default>
56
56
  }
57
- export const meta={"name":"commands","commands":[{"name":"$init","config":{"fs":{"disabled":true,"path":"dist/esm/commands/$init.js","source":"src/commands/$init.ts","inject":["$container","param.0"]},"":{"inject":["$container","param.0"]},"cli":{"inject":["$container","context"],"usage":"$init [...args]","options":{"configFile":{"needsValue":true,"aliases":["c"]},"keepAttached":{"needsValue":true}}}}},{"name":"bridge","config":{"fs":{"inject":["param.0","param.1"],"path":"dist/esm/commands/bridge.js","source":"src/commands/bridge.ts"},"jsonrpc":{"inject":["param.0","socket"]},"":{"inject":[]}}},{"name":"config","config":{"fs":{"path":"dist/esm/commands/config.js","source":"src/commands/config.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"inject":["param.0","options"]}}},{"name":"connect","config":{"fs":{"path":"dist/esm/commands/connect.js","source":"src/commands/connect.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/commands/discover.js","source":"src/commands/discover.ts","inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","$container"]},"cli":{"usage":"discover <name> <folder>","options":{"folder":{"normalize":true}},"inject":["options.name","options.folder","$container"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/commands/install.js","source":"src/commands/install.ts","inject":["param.0","$container"]},"":{"inject":["param.0","$container"]},"cli":{"inject":["param.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/commands/link.js","source":"src/commands/link.ts","inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","$container"]},"cli":{"inject":["param.0","param.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/commands/log.js","source":"src/commands/log.ts","inject":["param.0"]},"":{"inject":["param.0"]},"cli":{"inject":["param.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/commands/ls.js","source":"src/commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/commands/map.js","source":"src/commands/map.ts","inject":["param.0","param.1","param.2","param.3"]},"":{"inject":["param.0","param.1","param.2","param.3"]},"cli":{"inject":["options.name","options.path","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false}},"usage":"map <name> <path>"}}},{"name":"name","config":{"fs":{"path":"dist/esm/commands/name.js","source":"src/commands/name.ts","inject":["param.0"]},"":{"inject":["param.0"]}}},{"name":"plugin.add","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/plugin/add.js","source":"src/commands/plugin/add.ts"},"":{"inject":["param.0"]},"cli":{"usage":"add <plugin>","inject":["options.plugin"],"options":{"plugin":{"normalize":true}}}}},{"name":"plugin.remove","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/plugin/remove.js","source":"src/commands/plugin/remove.ts"},"":{"inject":["param.0"]},"cli":{"usage":"remove <plugin>","inject":["options.plugin"],"options":{"plugin":{"normalize":true}}}}},{"name":"proxy","config":{"fs":{"path":"dist/esm/commands/proxy.js","source":"src/commands/proxy.ts","inject":["param.0","param.1"]},"jsonrpc":{"inject":["param.0","socket"]},"":{"inject":["param.0","param.1"]}}},{"name":"ready","config":{"fs":{"path":"dist/esm/commands/ready.js","source":"src/commands/ready.ts","inject":["$container","ignore"]},"jsonrpc":{"inject":["$container","dummy","connectionAsContainer"]},"":{"inject":["$container","connectionAsContainer"]}}},{"name":"reload-metadata","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/reload-metadata.js","source":"src/commands/reload-metadata.ts"},"jsonrpc":{"inject":["connectionAsContainer"]},"":{"inject":["param.0"]}}},{"name":"restart","config":{"fs":{"path":"dist/esm/commands/restart.js","source":"src/commands/restart.ts","inject":["$container","param.0","param.1"]},"":{"inject":["$container","param.0","param.1"]},"cli":{"options":{"wait":{"aliases":["w"]},"inspect":{},"new":{},"name":{}},"inject":["$container","param.0","context"]}}},{"name":"start","config":{"fs":{"path":"dist/esm/commands/start.js","source":"src/commands/start.ts","inject":["$container","param.0","param.1"]},"":{"inject":["$container","param.0","param.1"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["$container","options.program","context"],"usage":"start <program>"}}},{"name":"status","config":{"fs":{"path":"dist/esm/commands/status.js","source":"src/commands/status.ts","inject":["param.0"]},"":{"inject":["param.0"]},"cli":{"inject":["param.0"]}}},{"name":"stop","config":{"fs":{"path":"dist/esm/commands/stop.js","source":"src/commands/stop.ts","inject":["param.0","$container"]},"":{"inject":["param.0","$container"]},"cli":{"inject":["options.process","$container"],"options":{"process":{"doc":"process to stop. Stops all the processes otherwise (including pm)."}},"usage":"stop [process]"}}},{"name":"update","config":{"fs":{"path":"dist/esm/commands/update.js","source":"src/commands/update.ts","inject":["param.0","param.1","param.2"]},"cli":{"inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","param.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/commands/version.js","source":"src/commands/version.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"inject":["param.0","param.1"]}}}]} as Metadata.Container;
57
+ export const meta={"name":"commands","commands":[{"name":"$init","config":{"fs":{"disabled":true,"path":"dist/esm/commands/$init.js","source":"src/commands/$init.ts","inject":["$container","param.0"]},"":{"inject":["$container","param.0"]},"cli":{"inject":["$container","context"],"usage":"$init [...args]","options":{"configFile":{"needsValue":true,"aliases":["c"]},"keepAttached":{"needsValue":true}}}}},{"name":"bridge","config":{"fs":{"inject":["param.0","param.1"],"path":"dist/esm/commands/bridge.js","source":"src/commands/bridge.ts"},"jsonrpc":{"inject":["param.0","socket"]},"":{"inject":[]}}},{"name":"config","config":{"fs":{"path":"dist/esm/commands/config.js","source":"src/commands/config.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"inject":["param.0","options"]}}},{"name":"connect","config":{"fs":{"path":"dist/esm/commands/connect.js","source":"src/commands/connect.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"usage":"connect <name>","inject":["options.name","context"],"options":{"tcpPort":{"needsValue":true,"aliases":["tcp-port"]},"port":{"needsValue":true},"key":{"needsValue":true},"cert":{"needsValue":true}}}}},{"name":"discover","config":{"fs":{"path":"dist/esm/commands/discover.js","source":"src/commands/discover.ts","inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","$container"]},"cli":{"usage":"discover <name> <folder>","options":{"folder":{"normalize":true}},"inject":["options.name","options.folder","$container"]}}},{"name":"install","config":{"fs":{"path":"dist/esm/commands/install.js","source":"src/commands/install.ts","inject":["param.0","$container"]},"":{"inject":["param.0","$container"]},"cli":{"inject":["param.0","$container"]}}},{"name":"link","config":{"fs":{"path":"dist/esm/commands/link.js","source":"src/commands/link.ts","inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","$container"]},"cli":{"inject":["param.0","param.1","$container"]}}},{"name":"log","config":{"fs":{"path":"dist/esm/commands/log.js","source":"src/commands/log.ts","inject":["param.0"]},"":{"inject":["param.0"]},"cli":{"inject":["param.0"]}}},{"name":"ls","config":{"fs":{"path":"dist/esm/commands/ls.js","source":"src/commands/ls.ts","inject":[]},"":{"inject":[]},"cli":{"inject":[]}}},{"name":"map","config":{"fs":{"path":"dist/esm/commands/map.js","source":"src/commands/map.ts","inject":["param.0","param.1","param.2","param.3"]},"":{"inject":["param.0","param.1","param.2","param.3"]},"cli":{"inject":["options.name","options.path","cwd","options"],"options":{"commandable":{"aliases":["c"],"needsValue":false},"stateless":{"aliases":["s"],"needsValue":false}},"usage":"map <name> <path>"}}},{"name":"name","config":{"fs":{"path":"dist/esm/commands/name.js","source":"src/commands/name.ts","inject":["param.0"]},"":{"inject":["param.0"]}}},{"name":"plugin.add","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/plugin/add.js","source":"src/commands/plugin/add.ts"},"":{"inject":["param.0"]},"cli":{"usage":"add <plugin>","inject":["options.plugin"],"options":{"plugin":{"normalize":true}}}}},{"name":"plugin.remove","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/plugin/remove.js","source":"src/commands/plugin/remove.ts"},"":{"inject":["param.0"]},"cli":{"usage":"remove <plugin>","inject":["options.plugin"],"options":{"plugin":{"normalize":true}}}}},{"name":"proxy","config":{"fs":{"path":"dist/esm/commands/proxy.js","source":"src/commands/proxy.ts","inject":["param.0","param.1"]},"jsonrpc":{"inject":["param.0","socket"]},"":{"inject":["param.0","param.1"]}}},{"name":"ready","config":{"fs":{"path":"dist/esm/commands/ready.js","source":"src/commands/ready.ts","inject":["$container","ignore"]},"jsonrpc":{"inject":["$container","dummy","connectionAsContainer"]},"":{"inject":["$container","connectionAsContainer"]}}},{"name":"reload-metadata","config":{"fs":{"inject":["param.0"],"path":"dist/esm/commands/reload-metadata.js","source":"src/commands/reload-metadata.ts"},"jsonrpc":{"inject":["connectionAsContainer"]},"":{"inject":["param.0"]}}},{"name":"restart","config":{"fs":{"path":"dist/esm/commands/restart.js","source":"src/commands/restart.ts","inject":["$container","param.0","param.1"]},"":{"inject":["$container","param.0","param.1"]},"cli":{"options":{"wait":{"aliases":["w"]},"inspect":{},"new":{},"name":{}},"inject":["$container","param.0","context"]}}},{"name":"start","config":{"fs":{"path":"dist/esm/commands/start.js","source":"src/commands/start.ts","inject":["$container","param.0","param.1","param.2"]},"":{"inject":["$container","param.0","param.1","param.2"]},"cli":{"options":{"wait":{"aliases":["w"],"needsValue":false,"doc":"waits for the program to be started before returning, otherwise, returns after the start command is sent to the pm daemon"},"inspect":{"needsValue":false,"doc":"starts the process with --inspect-brk parameter to help debugging"},"new":{"needsValue":false},"name":{"doc":"name to assign to the process","needsValue":true},"program":{"doc":"program to start"}},"inject":["$container","options.program","options","context"],"usage":"start <program>"}}},{"name":"status","config":{"fs":{"path":"dist/esm/commands/status.js","source":"src/commands/status.ts","inject":["param.0"]},"":{"inject":["param.0"]},"cli":{"inject":["param.0"]}}},{"name":"stop","config":{"fs":{"path":"dist/esm/commands/stop.js","source":"src/commands/stop.ts","inject":["param.0","$container"]},"":{"inject":["param.0","$container"]},"cli":{"inject":["options.process","$container"],"options":{"process":{"doc":"process to stop. Stops all the processes otherwise (including pm)."}},"usage":"stop [process]"}}},{"name":"update","config":{"fs":{"path":"dist/esm/commands/update.js","source":"src/commands/update.ts","inject":["param.0","param.1","param.2"]},"cli":{"inject":["param.0","param.1","$container"]},"":{"inject":["param.0","param.1","param.2"]}}},{"name":"version","config":{"fs":{"path":"dist/esm/commands/version.js","source":"src/commands/version.ts","inject":["param.0","param.1"]},"":{"inject":["param.0","param.1"]},"cli":{"inject":["param.0","param.1"]}}}]} as Metadata.Container;
58
58
 
59
59
  export function connect(processor?:ICommandProcessor) {
60
60
  const container = new Container<void>("commands", void 0);