flightdeck 0.0.5 → 0.0.7

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.
@@ -13,10 +13,7 @@
13
13
  "type": "object",
14
14
  "properties": {
15
15
  "run": {
16
- "type": "array",
17
- "items": {
18
- "type": "string"
19
- }
16
+ "type": "string"
20
17
  },
21
18
  "waitFor": {
22
19
  "type": "boolean"
@@ -180,8 +180,8 @@ class FlightDeck {
180
180
  this.startService(serviceName);
181
181
  return;
182
182
  }
183
- const [executable, ...args] = this.options.services[serviceName].run;
184
- const serviceProcess = spawn(executable, args, {
183
+ const [exe, ...args] = this.options.services[serviceName].run.split(` `);
184
+ const serviceProcess = spawn(exe, args, {
185
185
  cwd: this.options.flightdeckRootDir,
186
186
  env: import.meta.env
187
187
  });
@@ -275,7 +275,7 @@ class FlightDeck {
275
275
  stopService(serviceName) {
276
276
  if (this.services[serviceName]) {
277
277
  this.serviceLoggers[serviceName].info(`Stopping service...`);
278
- this.services[serviceName].process.kill();
278
+ this.services[serviceName].process.kill(`SIGINT`);
279
279
  this.services[serviceName] = null;
280
280
  this.servicesDead[this.serviceIdx[serviceName]].use(Promise.resolve());
281
281
  this.servicesLive[this.serviceIdx[serviceName]] = new Future(() => {
@@ -301,7 +301,7 @@ var FLIGHTDECK_MANUAL = {
301
301
  optionsSchema: z.object({
302
302
  secret: z.string(),
303
303
  packageName: z.string(),
304
- services: z.record(z.object({ run: z.array(z.string()), waitFor: z.boolean() })),
304
+ services: z.record(z.object({ run: z.string(), waitFor: z.boolean() })),
305
305
  flightdeckRootDir: z.string(),
306
306
  scripts: z.object({
307
307
  download: z.string(),
@@ -325,7 +325,7 @@ var FLIGHTDECK_MANUAL = {
325
325
  flag: `s`,
326
326
  required: true,
327
327
  description: `Map of service names to executables.`,
328
- example: `--services="{\\"frontend\\":{\\"run\\":[\\"./app\\"],\\"waitFor\\":false},\\"backend\\":{\\"run\\":[\\"./backend\\"],\\"waitFor\\":true}}"`,
328
+ example: `--services="{\\"frontend\\":{\\"run\\":\\"./frontend\\",\\"waitFor\\":false},\\"backend\\":{\\"run\\":\\"./backend\\",\\"waitFor\\":true}}"`,
329
329
  parse: JSON.parse
330
330
  },
331
331
  flightdeckRootDir: {
@@ -13,10 +13,7 @@
13
13
  "type": "object",
14
14
  "properties": {
15
15
  "run": {
16
- "type": "array",
17
- "items": {
18
- "type": "string"
19
- }
16
+ "type": "string"
20
17
  },
21
18
  "waitFor": {
22
19
  "type": "boolean"
package/dist/lib.d.ts CHANGED
@@ -7,7 +7,7 @@ type FlightDeckOptions<S extends string = string> = {
7
7
  packageName: string;
8
8
  services: {
9
9
  [service in S]: {
10
- run: string[];
10
+ run: string;
11
11
  waitFor: boolean;
12
12
  };
13
13
  };
package/dist/lib.js CHANGED
@@ -184,8 +184,8 @@ class FlightDeck {
184
184
  this.startService(serviceName);
185
185
  return;
186
186
  }
187
- const [executable, ...args] = this.options.services[serviceName].run;
188
- const serviceProcess = spawn(executable, args, {
187
+ const [exe, ...args] = this.options.services[serviceName].run.split(` `);
188
+ const serviceProcess = spawn(exe, args, {
189
189
  cwd: this.options.flightdeckRootDir,
190
190
  env: import.meta.env
191
191
  });
@@ -279,7 +279,7 @@ class FlightDeck {
279
279
  stopService(serviceName) {
280
280
  if (this.services[serviceName]) {
281
281
  this.serviceLoggers[serviceName].info(`Stopping service...`);
282
- this.services[serviceName].process.kill();
282
+ this.services[serviceName].process.kill(`SIGINT`);
283
283
  this.services[serviceName] = null;
284
284
  this.servicesDead[this.serviceIdx[serviceName]].use(Promise.resolve());
285
285
  this.servicesLive[this.serviceIdx[serviceName]] = new Future(() => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "flightdeck",
3
- "version": "0.0.5",
3
+ "version": "0.0.7",
4
4
  "license": "MIT",
5
5
  "author": {
6
6
  "name": "Jeremy Banka",
@@ -13,9 +13,7 @@ const FLIGHTDECK_MANUAL = {
13
13
  optionsSchema: z.object({
14
14
  secret: z.string(),
15
15
  packageName: z.string(),
16
- services: z.record(
17
- z.object({ run: z.array(z.string()), waitFor: z.boolean() }),
18
- ),
16
+ services: z.record(z.object({ run: z.string(), waitFor: z.boolean() })),
19
17
  flightdeckRootDir: z.string(),
20
18
  scripts: z.object({
21
19
  download: z.string(),
@@ -39,7 +37,7 @@ const FLIGHTDECK_MANUAL = {
39
37
  flag: `s`,
40
38
  required: true,
41
39
  description: `Map of service names to executables.`,
42
- example: `--services="{\\"frontend\\":{\\"run\\":[\\"./app\\"],\\"waitFor\\":false},\\"backend\\":{\\"run\\":[\\"./backend\\"],\\"waitFor\\":true}}"`,
40
+ example: `--services="{\\"frontend\\":{\\"run\\":\\"./frontend\\",\\"waitFor\\":false},\\"backend\\":{\\"run\\":\\"./backend\\",\\"waitFor\\":true}}"`,
43
41
  parse: JSON.parse,
44
42
  },
45
43
  flightdeckRootDir: {
@@ -18,7 +18,7 @@ import { ChildSocket } from "atom.io/realtime-server"
18
18
  export type FlightDeckOptions<S extends string = string> = {
19
19
  secret: string
20
20
  packageName: string
21
- services: { [service in S]: { run: string[]; waitFor: boolean } }
21
+ services: { [service in S]: { run: string; waitFor: boolean } }
22
22
  scripts: {
23
23
  download: string
24
24
  install: string
@@ -237,8 +237,8 @@ export class FlightDeck<S extends string = string> {
237
237
  return
238
238
  }
239
239
 
240
- const [executable, ...args] = this.options.services[serviceName].run
241
- const serviceProcess = spawn(executable, args, {
240
+ const [exe, ...args] = this.options.services[serviceName].run.split(` `)
241
+ const serviceProcess = spawn(exe, args, {
242
242
  cwd: this.options.flightdeckRootDir,
243
243
  env: import.meta.env,
244
244
  })
@@ -347,7 +347,7 @@ export class FlightDeck<S extends string = string> {
347
347
  public stopService(serviceName: S): void {
348
348
  if (this.services[serviceName]) {
349
349
  this.serviceLoggers[serviceName].info(`Stopping service...`)
350
- this.services[serviceName].process.kill()
350
+ this.services[serviceName].process.kill(`SIGINT`)
351
351
  this.services[serviceName] = null
352
352
  this.servicesDead[this.serviceIdx[serviceName]].use(Promise.resolve())
353
353
  this.servicesLive[this.serviceIdx[serviceName]] = new Future(() => {})