@nu-art/build-and-install 0.204.96 → 0.204.98
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 +1 -1
- package/v2/phase-runner/PhaseRunner.js +3 -1
- package/v2/unit/core/BaseUnit.d.ts +2 -2
- package/v2/unit/core/BaseUnit.js +3 -3
- package/v2/unit/core/Unit_TypescriptLib.js +4 -1
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.d.ts +1 -0
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +10 -2
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +3 -2
package/package.json
CHANGED
|
@@ -397,11 +397,12 @@ class PhaseRunner extends core_1.BaseUnit {
|
|
|
397
397
|
await this.executeImpl();
|
|
398
398
|
this.killed = true;
|
|
399
399
|
this.logInfo('Completed successfully');
|
|
400
|
+
ts_common_1.StaticLogger.logInfo('-----------', '---------------------------------- Process Completed successfully ----------------------------------');
|
|
400
401
|
if (params_1.RuntimeParams.closeOnExit)
|
|
401
402
|
process.exit(0);
|
|
402
403
|
}
|
|
403
404
|
catch (error) {
|
|
404
|
-
this.logError('Finished with Errors: ', error);
|
|
405
|
+
// this.logError('Finished with Errors: ', error);
|
|
405
406
|
if (params_1.RuntimeParams.closeOnExit)
|
|
406
407
|
process.exit(1);
|
|
407
408
|
}
|
|
@@ -461,6 +462,7 @@ class PhaseRunner extends core_1.BaseUnit {
|
|
|
461
462
|
this.logDebug('Runner Params:', RunnerParams_1.MemKey_RunnerParams.get());
|
|
462
463
|
this.logDebug('Project Config:', RunnerParams_1.MemKey_ProjectConfig.get());
|
|
463
464
|
this.logDebug('Default File Routes:', consts_1.MemKey_DefaultFiles.get());
|
|
465
|
+
this.logDebug('Filtered Units:', this.units.map(unit => unit.config.label));
|
|
464
466
|
const dependencyTree = this.unitDependencyTree.map(row => row.map(unit => unit.config.label));
|
|
465
467
|
this.logInfo('Unit Dependencies Tree:', dependencyTree);
|
|
466
468
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncVoidFunction, Constructor, Logger } from '@nu-art/ts-common';
|
|
1
|
+
import { AsyncVoidFunction, Constructor, Logger, LogLevel } from '@nu-art/ts-common';
|
|
2
2
|
import { RunnerParamKey } from '../../phase-runner/RunnerParams';
|
|
3
3
|
import { CommandoInteractive } from '@nu-art/commando/shell';
|
|
4
4
|
import { BaseCommando } from '@nu-art/commando/shell/core/BaseCommando';
|
|
@@ -30,7 +30,7 @@ export declare class BaseUnit<C extends BaseUnit_Config = BaseUnit_Config, RTC e
|
|
|
30
30
|
protected getRunnerParam(key: RunnerParamKey): string | undefined;
|
|
31
31
|
private initLogClient;
|
|
32
32
|
protected setErrorStatus(status: string, error: Error): void;
|
|
33
|
-
protected setStatus(status: string, type?: 'start' | 'end'): void;
|
|
33
|
+
protected setStatus(status: string, type?: 'start' | 'end', logLevel?: LogLevel): void;
|
|
34
34
|
protected addToClassStack: (cls: Function) => void;
|
|
35
35
|
isInstanceOf: (cls: Function) => boolean;
|
|
36
36
|
getStatus(): string;
|
package/v2/unit/core/BaseUnit.js
CHANGED
|
@@ -75,10 +75,10 @@ class BaseUnit extends ts_common_1.Logger {
|
|
|
75
75
|
ts_common_1.BeLogged.addClient(this.logger);
|
|
76
76
|
}
|
|
77
77
|
setErrorStatus(status, error) {
|
|
78
|
-
this.setStatus(status, 'end');
|
|
78
|
+
this.setStatus(status, 'end', ts_common_1.LogLevel.Error);
|
|
79
79
|
this.logError(error);
|
|
80
80
|
}
|
|
81
|
-
setStatus(status, type) {
|
|
81
|
+
setStatus(status, type, logLevel = ts_common_1.LogLevel.Info) {
|
|
82
82
|
let operationDuration = '';
|
|
83
83
|
if (type === 'start')
|
|
84
84
|
this.timeCounter = timeCounter();
|
|
@@ -89,7 +89,7 @@ class BaseUnit extends ts_common_1.Logger {
|
|
|
89
89
|
operationDuration = ` (${this.timeCounter.format('mm:ss')})`;
|
|
90
90
|
delete this.timeCounter;
|
|
91
91
|
}
|
|
92
|
-
this.
|
|
92
|
+
this.log(logLevel, false, [`Unit status update: ${this.unitStatus} => ${status}${operationDuration}`]);
|
|
93
93
|
this.unitStatus = `${status}${operationDuration}`;
|
|
94
94
|
PhaseRunnerDispatcher_1.dispatcher_UnitStatusChange.dispatch(this);
|
|
95
95
|
}
|
|
@@ -51,7 +51,6 @@ class Unit_TypescriptLib extends Unit_Typescript_1.Unit_Typescript {
|
|
|
51
51
|
constructor(config) {
|
|
52
52
|
super(config);
|
|
53
53
|
this.addToClassStack(Unit_TypescriptLib);
|
|
54
|
-
runner_dispatchers_1.dispatcher_WatchEvent.addListener(this);
|
|
55
54
|
}
|
|
56
55
|
async __onWatchEvent(type, path) {
|
|
57
56
|
if (type === consts_2.WatchEvent_Ready)
|
|
@@ -63,6 +62,7 @@ class Unit_TypescriptLib extends Unit_Typescript_1.Unit_Typescript {
|
|
|
63
62
|
}
|
|
64
63
|
async init(setInitialized = true) {
|
|
65
64
|
await super.init(false);
|
|
65
|
+
runner_dispatchers_1.dispatcher_WatchEvent.addListener(this);
|
|
66
66
|
this.runtime.pathTo.output = this.runtime.pathTo.pkg + `/${this.config.output}`;
|
|
67
67
|
if (setInitialized)
|
|
68
68
|
this.setStatus('Initialized');
|
|
@@ -104,6 +104,9 @@ class Unit_TypescriptLib extends Unit_Typescript_1.Unit_Typescript {
|
|
|
104
104
|
const commando = this.allocateCommando(nvm_1.Commando_NVM, basic_1.Commando_Basic)
|
|
105
105
|
.cd(this.runtime.pathTo.pkg)
|
|
106
106
|
.append(`tsc -p "${pathToTSConfig}" --rootDir "${pathToCompile}" --outDir "${this.runtime.pathTo.output}"`)
|
|
107
|
+
.setLogLevelFilter((log, std) => {
|
|
108
|
+
return ts_common_1.LogLevel.Error;
|
|
109
|
+
})
|
|
107
110
|
.addLogProcessor((log) => !log.includes('Now using node') && !log.includes('.nvmrc\' with version'));
|
|
108
111
|
await this.executeAsyncCommando(commando, (stdout, stderr, exitCode) => {
|
|
109
112
|
if (stderr.length)
|
|
@@ -11,6 +11,7 @@ export declare class Unit_FirebaseFunctionsApp<C extends Unit_FirebaseFunctionsA
|
|
|
11
11
|
static staggerCount: number;
|
|
12
12
|
__onUnitWatchCompiled(unit: BaseUnit): Promise<void>;
|
|
13
13
|
constructor(config: Unit_FirebaseFunctionsApp<C>['config']);
|
|
14
|
+
protected init(setInitialized?: boolean): Promise<void>;
|
|
14
15
|
resolveConfigs(): Promise<void>;
|
|
15
16
|
compile(): Promise<void>;
|
|
16
17
|
launch(): Promise<void>;
|
|
@@ -32,8 +32,14 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
32
32
|
constructor(config) {
|
|
33
33
|
super(config);
|
|
34
34
|
this.addToClassStack(Unit_FirebaseFunctionsApp);
|
|
35
|
+
}
|
|
36
|
+
async init(setInitialized = true) {
|
|
37
|
+
await super.init(false);
|
|
38
|
+
// only sign on listeners when the unit is being initialized
|
|
35
39
|
runner_dispatchers_1.dispatcher_WatchEvent.removeListener(this);
|
|
36
40
|
runner_dispatchers_1.dispatcher_UnitWatchCompile.addListener(this);
|
|
41
|
+
if (setInitialized)
|
|
42
|
+
this.setStatus('Initialized');
|
|
37
43
|
}
|
|
38
44
|
//######################### Phase Implementations #########################
|
|
39
45
|
async resolveConfigs() {
|
|
@@ -258,7 +264,8 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
258
264
|
const commando = this.allocateCommando(nvm_1.Commando_NVM).applyNVM()
|
|
259
265
|
.cd(this.runtime.pathTo.pkg)
|
|
260
266
|
.append('ts-node src/main/proxy.ts');
|
|
261
|
-
|
|
267
|
+
await this.executeAsyncCommando(commando);
|
|
268
|
+
this.logWarning('PROXY TERMINATED');
|
|
262
269
|
}
|
|
263
270
|
async runEmulator() {
|
|
264
271
|
const commando = this.allocateCommando(nvm_1.Commando_NVM).applyNVM()
|
|
@@ -266,7 +273,8 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
266
273
|
.cd(this.runtime.pathTo.pkg)
|
|
267
274
|
.onLog(/.*Emulator Hub running.*/, () => this.setStatus('Launch Complete'))
|
|
268
275
|
.append(`firebase emulators:start --export-on-exit --import=.trash/data ${params_1.RuntimeParams.debugBackend ? `--inspect-functions ${this.config.firebaseConfig.debugPort}` : ''}`);
|
|
269
|
-
|
|
276
|
+
await this.executeAsyncCommando(commando);
|
|
277
|
+
this.logWarning('EMULATORS TERMINATED');
|
|
270
278
|
}
|
|
271
279
|
//######################### Deploy Logic #########################
|
|
272
280
|
async deployImpl() {
|
|
@@ -16,10 +16,10 @@ class Unit_FirebaseHostingApp extends core_1.Unit_TypescriptLib {
|
|
|
16
16
|
constructor(config) {
|
|
17
17
|
super(config);
|
|
18
18
|
this.addToClassStack(Unit_FirebaseHostingApp);
|
|
19
|
-
runner_dispatchers_1.dispatcher_WatchEvent.removeListener(this);
|
|
20
19
|
}
|
|
21
20
|
async init(setInitialized = true) {
|
|
22
21
|
await super.init(setInitialized);
|
|
22
|
+
runner_dispatchers_1.dispatcher_WatchEvent.removeListener(this);
|
|
23
23
|
if (!this.config.firebaseConfig.hostingPort)
|
|
24
24
|
throw new ts_common_1.BadImplementationException(`Unit ${this.config.label} missing hosting port in firebaseConfig`);
|
|
25
25
|
}
|
|
@@ -124,7 +124,8 @@ class Unit_FirebaseHostingApp extends core_1.Unit_TypescriptLib {
|
|
|
124
124
|
.append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
|
|
125
125
|
.append('echo ')
|
|
126
126
|
.append('npm run start');
|
|
127
|
-
|
|
127
|
+
await this.executeAsyncCommando(commando);
|
|
128
|
+
this.logWarning('HOSTING TERMINATED');
|
|
128
129
|
}
|
|
129
130
|
//######################### Deploy Logic #########################
|
|
130
131
|
async deployImpl() {
|