@nu-art/build-and-install 0.204.111 → 0.204.113
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/defaults/backend-proxy/proxy._ts +3 -1
- package/package.json +1 -1
- package/v2/screens/BAIScreen_Launch.d.ts +1 -0
- package/v2/screens/BAIScreen_Launch.js +2 -1
- package/v2/unit/core/BaseUnit.d.ts +2 -2
- package/v2/unit/core/Unit_TypescriptProject.js +1 -1
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.d.ts +4 -0
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +17 -0
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +4 -0
- package/v2/unit/firebase-units/consts.d.ts +2 -0
- package/v2/unit/firebase-units/consts.js +9 -0
|
@@ -17,6 +17,8 @@ _express.all('*', (req, res) => {
|
|
|
17
17
|
console.log(`PROXY ${counter} - [${req.method}] ${url}`);
|
|
18
18
|
|
|
19
19
|
const handleError = (error: any) => {
|
|
20
|
+
if(!error)
|
|
21
|
+
return;
|
|
20
22
|
console.log(`ERROR calling: ${url}`, error);
|
|
21
23
|
};
|
|
22
24
|
|
|
@@ -65,4 +67,4 @@ const options = {
|
|
|
65
67
|
};
|
|
66
68
|
|
|
67
69
|
require('https').createServer(options, _express).listen(PROXY_PORT);
|
|
68
|
-
console.log('SSL proxy started!!!');
|
|
70
|
+
console.log('SSL proxy started!!!');
|
package/package.json
CHANGED
|
@@ -6,6 +6,7 @@ export declare class BAIScreen_Launch extends BAIScreen implements PhaseRunner_O
|
|
|
6
6
|
private focusUnits;
|
|
7
7
|
private gridDimensions;
|
|
8
8
|
private withRunningLogs;
|
|
9
|
+
private renderDebounceAction;
|
|
9
10
|
private gridCellWidgets;
|
|
10
11
|
constructor();
|
|
11
12
|
__onUnitsChange: (data: BaseUnit[]) => void;
|
|
@@ -14,6 +14,7 @@ class BAIScreen_Launch extends BAIScreen_1.BAIScreen {
|
|
|
14
14
|
this.focusUnits = [];
|
|
15
15
|
this.gridDimensions = [[{ width: 1, height: 1 }]];
|
|
16
16
|
this.withRunningLogs = false;
|
|
17
|
+
this.renderDebounceAction = (0, ts_common_1.debounce)(() => this.renderGridWidgets(), ts_common_1.Second, 2 * ts_common_1.Second);
|
|
17
18
|
//Widgets
|
|
18
19
|
this.gridCellWidgets = [];
|
|
19
20
|
this.__onUnitsChange = (data) => {
|
|
@@ -21,7 +22,7 @@ class BAIScreen_Launch extends BAIScreen_1.BAIScreen {
|
|
|
21
22
|
this.rebuildScreens();
|
|
22
23
|
};
|
|
23
24
|
this.onLogUpdated = () => {
|
|
24
|
-
this.
|
|
25
|
+
this.renderDebounceAction();
|
|
25
26
|
};
|
|
26
27
|
this.updateUnits = () => {
|
|
27
28
|
const runner = consts_1.MemKey_PhaseRunner.get();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AsyncVoidFunction, Constructor, Logger, LogLevel } from '@nu-art/ts-common';
|
|
1
|
+
import { AsyncVoidFunction, Constructor, LogClient_MemBuffer, 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';
|
|
@@ -17,7 +17,7 @@ export declare class BaseUnit<C extends BaseUnit_Config = BaseUnit_Config, RTC e
|
|
|
17
17
|
readonly config: Readonly<C>;
|
|
18
18
|
readonly runtime: RTC;
|
|
19
19
|
private unitStatus;
|
|
20
|
-
|
|
20
|
+
protected logger: LogClient_MemBuffer;
|
|
21
21
|
private classStack;
|
|
22
22
|
private processTerminator;
|
|
23
23
|
private timeCounter?;
|
|
@@ -47,7 +47,7 @@ class Unit_TypescriptProject extends Unit_Typescript_1.Unit_Typescript {
|
|
|
47
47
|
];
|
|
48
48
|
this.findUnit = (pathDeclarations, currentPath) => {
|
|
49
49
|
var _a;
|
|
50
|
-
const unitToReturn = (_a = pathDeclarations.find(declaration => currentPath.startsWith(declaration.pathToPackage))) === null || _a === void 0 ? void 0 : _a.unit;
|
|
50
|
+
const unitToReturn = (_a = pathDeclarations.find(declaration => currentPath.startsWith(`${declaration.pathToPackage}/`))) === null || _a === void 0 ? void 0 : _a.unit;
|
|
51
51
|
if (!unitToReturn)
|
|
52
52
|
throw new ts_common_1.MUSTNeverHappenException(`current path doesnt match any declared unit, current path: ${currentPath}`);
|
|
53
53
|
return unitToReturn;
|
|
@@ -9,6 +9,10 @@ export type Unit_FirebaseFunctionsApp_Config = Unit_TypescriptLib_Config & {
|
|
|
9
9
|
};
|
|
10
10
|
export declare class Unit_FirebaseFunctionsApp<C extends Unit_FirebaseFunctionsApp_Config = Unit_FirebaseFunctionsApp_Config> extends Unit_TypescriptLib<C> implements UnitPhaseImplementor<[Phase_ResolveConfigs, Phase_Launch, Phase_DeployBackend]>, OnUnitWatchCompiled {
|
|
11
11
|
static staggerCount: number;
|
|
12
|
+
readonly emulatorLogStrings: {
|
|
13
|
+
error: string[];
|
|
14
|
+
warning: string[];
|
|
15
|
+
};
|
|
12
16
|
__onUnitWatchCompiled(units: BaseUnit[]): Promise<void>;
|
|
13
17
|
constructor(config: Unit_FirebaseFunctionsApp<C>['config']);
|
|
14
18
|
protected init(setInitialized?: boolean): Promise<void>;
|
|
@@ -11,6 +11,7 @@ const RunnerParams_1 = require("../../phase-runner/RunnerParams");
|
|
|
11
11
|
const consts_3 = require("../../phase-runner/consts");
|
|
12
12
|
const runner_dispatchers_1 = require("../runner-dispatchers");
|
|
13
13
|
const nvm_1 = require("@nu-art/commando/shell/plugins/nvm");
|
|
14
|
+
const consts_4 = require("./consts");
|
|
14
15
|
const CONST_VersionApp = 'version-app.json';
|
|
15
16
|
class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
16
17
|
async __onUnitWatchCompiled(units) {
|
|
@@ -31,7 +32,17 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
31
32
|
}
|
|
32
33
|
constructor(config) {
|
|
33
34
|
super(config);
|
|
35
|
+
this.emulatorLogStrings = {
|
|
36
|
+
error: consts_4.firebaseFunctionEmulator_ErrorStrings,
|
|
37
|
+
warning: consts_4.firebaseFunctionEmulator_WarningStrings,
|
|
38
|
+
};
|
|
34
39
|
this.addToClassStack(Unit_FirebaseFunctionsApp);
|
|
40
|
+
this.logger.setLogTransformer(log => {
|
|
41
|
+
const prefix = ts_common_1._logger_logPrefixes.find(prefix => log.includes(prefix));
|
|
42
|
+
if (!prefix)
|
|
43
|
+
return log;
|
|
44
|
+
return log.substring(log.indexOf(prefix) + prefix.length);
|
|
45
|
+
});
|
|
35
46
|
}
|
|
36
47
|
async init(setInitialized = true) {
|
|
37
48
|
await super.init(false);
|
|
@@ -271,6 +282,12 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
271
282
|
const commando = this.allocateCommando(nvm_1.Commando_NVM).applyNVM()
|
|
272
283
|
.setUID(this.config.key)
|
|
273
284
|
.cd(this.runtime.pathTo.pkg)
|
|
285
|
+
.setLogLevelFilter((log, type) => {
|
|
286
|
+
if (this.emulatorLogStrings.error.some(errStr => log.includes(errStr)))
|
|
287
|
+
return ts_common_1.LogLevel.Error;
|
|
288
|
+
if (this.emulatorLogStrings.warning.some(warnStr => log.includes(warnStr)))
|
|
289
|
+
return ts_common_1.LogLevel.Warning;
|
|
290
|
+
})
|
|
274
291
|
.onLog(/.*Emulator Hub running.*/, () => this.setStatus('Launch Complete'))
|
|
275
292
|
.append(`firebase emulators:start --export-on-exit --import=.trash/data ${params_1.RuntimeParams.debugBackend ? `--inspect-functions ${this.config.firebaseConfig.debugPort}` : ''}`);
|
|
276
293
|
await this.executeAsyncCommando(commando);
|
|
@@ -116,6 +116,10 @@ class Unit_FirebaseHostingApp extends core_1.Unit_TypescriptLib {
|
|
|
116
116
|
const commando = this.allocateCommando(nvm_1.Commando_NVM).applyNVM()
|
|
117
117
|
.setUID(this.config.key)
|
|
118
118
|
.cd(this.runtime.pathTo.pkg)
|
|
119
|
+
.setLogLevelFilter((log, type) => {
|
|
120
|
+
if (log.toLowerCase().includes('<i>'))
|
|
121
|
+
return ts_common_1.LogLevel.Info;
|
|
122
|
+
})
|
|
119
123
|
.append(`array=($(lsof -ti:${[this.config.firebaseConfig.hostingPort].join(',')}))`)
|
|
120
124
|
.append(`((\${#array[@]} > 0)) && kill -9 "\${array[@]}"`)
|
|
121
125
|
.append('echo ')
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.firebaseFunctionEmulator_WarningStrings = exports.firebaseFunctionEmulator_ErrorStrings = void 0;
|
|
4
|
+
exports.firebaseFunctionEmulator_ErrorStrings = [
|
|
5
|
+
'functions: Failed',
|
|
6
|
+
];
|
|
7
|
+
exports.firebaseFunctionEmulator_WarningStrings = [
|
|
8
|
+
'⚠',
|
|
9
|
+
];
|