@nu-art/build-and-install 0.204.28 → 0.204.30

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/build-and-install",
3
- "version": "0.204.28",
3
+ "version": "0.204.30",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/phases/phases.js CHANGED
@@ -619,20 +619,50 @@ exports.Phase_Launch = {
619
619
  .append(`array=($(lsof -ti:${allPorts.join(',')}))`)
620
620
  .append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
621
621
  .execute();
622
+ const PROXY_PID_PROCESS = 'PROXY_PID_PROCESS';
623
+ let proxyPid;
624
+ const proxyPidProcessor = (stdout) => {
625
+ var _a;
626
+ const pid = (_a = stdout.match(new RegExp(`${PROXY_PID_PROCESS}=(\\d+)`))) === null || _a === void 0 ? void 0 : _a[1];
627
+ if (!(0, ts_common_1.exists)(pid))
628
+ return;
629
+ proxyPid = +pid;
630
+ proxyCommando.removeStdoutProcessor(proxyPidProcessor);
631
+ };
622
632
  const proxyCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
623
633
  .setUID(pkg.name)
624
634
  .cd(pkg.path)
625
- .append(`ts-node src/main/proxy.ts`);
635
+ .addStdoutProcessor(proxyPidProcessor)
636
+ .addStderrProcessor(proxyPidProcessor)
637
+ .append('ts-node src/main/proxy.ts &')
638
+ .append('pid=$!')
639
+ .append(`echo "${PROXY_PID_PROCESS}=\${pid}"`)
640
+ .append(`wait \$pid`);
641
+ const EMULATOR_PID_PROCESS = 'EMULATOR_PID_PROCESS';
642
+ let emulatorPid;
643
+ const emulatorPidProcessor = (stdout) => {
644
+ var _a;
645
+ const pid = (_a = stdout.match(new RegExp(`${EMULATOR_PID_PROCESS}=(\\d+)`))) === null || _a === void 0 ? void 0 : _a[1];
646
+ if (!(0, ts_common_1.exists)(pid))
647
+ return;
648
+ emulatorPid = +pid;
649
+ emulatorCommando.removeStdoutProcessor(emulatorPidProcessor);
650
+ };
626
651
  const emulatorCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
627
652
  .setUID(pkg.name)
628
653
  .cd(pkg.path)
629
- .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''}`);
654
+ .addStdoutProcessor(emulatorPidProcessor)
655
+ .addStderrProcessor(emulatorPidProcessor)
656
+ .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''} &`)
657
+ .append('pid=$!')
658
+ .append(`echo "${EMULATOR_PID_PROCESS}=\${pid}"`)
659
+ .append(`wait \$pid`);
630
660
  await proxyCommando.execute();
631
661
  await emulatorCommando.execute();
632
662
  runningAppsLogs.addOnTerminateCallback(async () => {
633
663
  console.log('HERE');
634
- await proxyCommando.gracefullyKill();
635
- await emulatorCommando.gracefullyKill();
664
+ await emulatorCommando.gracefullyKill(emulatorPid);
665
+ await proxyCommando.gracefullyKill(proxyPid);
636
666
  });
637
667
  return;
638
668
  }
@@ -11,7 +11,7 @@ class ProjectScreen extends ConsoleScreen_1.ConsoleScreen {
11
11
  title: 'Build and install',
12
12
  keyBinding: [{
13
13
  keys: ['escape', 'q', 'C-c'],
14
- callback: () => {
14
+ callback: async () => {
15
15
  return process.exit(1); // Quit on q, esc, or ctrl-c
16
16
  }
17
17
  }]
@@ -5,6 +5,7 @@ const ts_common_1 = require("@nu-art/ts-common");
5
5
  const ConsoleScreen_1 = require("@nu-art/commando/console/ConsoleScreen");
6
6
  class RunningProcessLogs extends ConsoleScreen_1.ConsoleScreen {
7
7
  constructor() {
8
+ let killed = false;
8
9
  super({
9
10
  smartCSR: true,
10
11
  title: 'Runtime-Logs',
@@ -12,6 +13,14 @@ class RunningProcessLogs extends ConsoleScreen_1.ConsoleScreen {
12
13
  {
13
14
  keys: ['C-c'],
14
15
  callback: async () => {
16
+ if (killed)
17
+ return;
18
+ killed = true;
19
+ // this.dispose();
20
+ console.log('exiting1');
21
+ await (0, ts_common_1.sleep)(2000);
22
+ console.log('exiting2');
23
+ await (0, ts_common_1.sleep)(2000);
15
24
  await Promise.all(this.onTerminateCallbacks.map(callback => callback()));
16
25
  process.exit(0);
17
26
  }