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

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.27",
3
+ "version": "0.204.28",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/phases/phases.js CHANGED
@@ -593,7 +593,7 @@ exports.Phase_Launch = {
593
593
  const projectManager = project_manager_1.MemKey_ProjectManager.get();
594
594
  const projectScreen = ProjectScreen_1.MemKey_ProjectScreen.get();
595
595
  if (!runningAppsLogs) {
596
- projectScreen.dispose();
596
+ projectScreen.dispose().releaseScreen();
597
597
  projectManager.clearLogger();
598
598
  runningAppsLogs = new RunningProcessLogs_1.RunningProcessLogs();
599
599
  runningAppsLogs.create();
@@ -619,16 +619,21 @@ exports.Phase_Launch = {
619
619
  .append(`array=($(lsof -ti:${allPorts.join(',')}))`)
620
620
  .append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
621
621
  .execute();
622
- await nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
622
+ const proxyCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
623
623
  .setUID(pkg.name)
624
624
  .cd(pkg.path)
625
- .append(`ts-node src/main/proxy.ts`)
626
- .execute();
627
- await nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
625
+ .append(`ts-node src/main/proxy.ts`);
626
+ const emulatorCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
628
627
  .setUID(pkg.name)
629
628
  .cd(pkg.path)
630
- .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''}`)
631
- .execute();
629
+ .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''}`);
630
+ await proxyCommando.execute();
631
+ await emulatorCommando.execute();
632
+ runningAppsLogs.addOnTerminateCallback(async () => {
633
+ console.log('HERE');
634
+ await proxyCommando.gracefullyKill();
635
+ await emulatorCommando.gracefullyKill();
636
+ });
632
637
  return;
633
638
  }
634
639
  if (pkg.type === 'firebase-hosting-app') {
@@ -1,4 +1,4 @@
1
- import { LogClient_MemBuffer } from '@nu-art/ts-common';
1
+ import { AsyncVoidFunction, LogClient_MemBuffer } from '@nu-art/ts-common';
2
2
  import { ConsoleScreen } from '@nu-art/commando/console/ConsoleScreen';
3
3
  export declare class RunningProcessLogs extends ConsoleScreen<{
4
4
  logs: {
@@ -6,9 +6,11 @@ export declare class RunningProcessLogs extends ConsoleScreen<{
6
6
  logClient: LogClient_MemBuffer;
7
7
  }[];
8
8
  }> {
9
+ private onTerminateCallbacks;
9
10
  constructor();
10
11
  protected createWidgets(): void;
11
12
  registerApp(appKey: string, logClient: LogClient_MemBuffer): void;
12
13
  unregisterApp(appKey: string): void;
13
14
  protected render(): void;
15
+ addOnTerminateCallback: (callback: AsyncVoidFunction) => void;
14
16
  }
@@ -11,10 +11,17 @@ class RunningProcessLogs extends ConsoleScreen_1.ConsoleScreen {
11
11
  keyBinding: [
12
12
  {
13
13
  keys: ['C-c'],
14
- callback: () => process.exit(0)
14
+ callback: async () => {
15
+ await Promise.all(this.onTerminateCallbacks.map(callback => callback()));
16
+ process.exit(0);
17
+ }
15
18
  }
16
19
  ]
17
20
  });
21
+ this.onTerminateCallbacks = [];
22
+ this.addOnTerminateCallback = (callback) => {
23
+ this.onTerminateCallbacks.push(callback);
24
+ };
18
25
  this.state = { logs: [] };
19
26
  }
20
27
  createWidgets() {