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

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.29",
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();
@@ -618,17 +618,23 @@ exports.Phase_Launch = {
618
618
  .setUID(pkg.name).debug()
619
619
  .append(`array=($(lsof -ti:${allPorts.join(',')}))`)
620
620
  .append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
621
+ // .append(`echo ZE ZEVEL`)
621
622
  .execute();
622
- await nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
623
+ const proxyCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
623
624
  .setUID(pkg.name)
624
625
  .cd(pkg.path)
625
- .append(`ts-node src/main/proxy.ts`)
626
- .execute();
627
- await nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
626
+ .append(`ts-node src/main/proxy.ts`);
627
+ const emulatorCommando = nvm_1.NVM.createInteractiveCommando(basic_1.Cli_Basic)
628
628
  .setUID(pkg.name)
629
629
  .cd(pkg.path)
630
- .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''}`)
631
- .execute();
630
+ .append(`firebase emulators:start --export-on-exit --import=.trash/data ${runInDebug ? `--inspect-functions ${pkg.envConfig.ssl}` : ''}`);
631
+ await proxyCommando.execute();
632
+ await emulatorCommando.execute();
633
+ runningAppsLogs.addOnTerminateCallback(async () => {
634
+ console.log('HERE');
635
+ await proxyCommando.gracefullyKill();
636
+ await emulatorCommando.gracefullyKill();
637
+ });
632
638
  return;
633
639
  }
634
640
  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() {