@nu-art/build-and-install 0.204.74 → 0.204.76
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/core/params/params.d.ts +4 -4
- package/core/params/params.js +10 -5
- package/package.json +1 -1
- package/v2/phase/consts.js +2 -2
- package/v2/phase/types.d.ts +2 -0
- package/v2/phase-runner/PhaseRunner.js +18 -9
- package/v2/unit/firebase-units/Unit_FirebaseFunctionsApp.js +2 -0
- package/v2/unit/firebase-units/Unit_FirebaseHostingApp.js +2 -0
package/core/params/params.d.ts
CHANGED
|
@@ -26,8 +26,8 @@ export declare const BaiParam_LaunchFrontend: BaseCliParam<'launchFrontend', boo
|
|
|
26
26
|
export declare const BaiParam_LaunchBackend: BaseCliParam<'launchBackend', boolean>;
|
|
27
27
|
export declare const BaiParam_DebugBackend: BaseCliParam<'debugBackend', boolean>;
|
|
28
28
|
export declare const BaiParam_Deploy: BaseCliParam<'deploy', string>;
|
|
29
|
-
export declare const BaiParam_DeployBackend: BaseCliParam<'deployBackend',
|
|
30
|
-
export declare const BaiParam_DeployFrontend: BaseCliParam<'deployFrontend',
|
|
29
|
+
export declare const BaiParam_DeployBackend: BaseCliParam<'deployBackend', string>;
|
|
30
|
+
export declare const BaiParam_DeployFrontend: BaseCliParam<'deployFrontend', string>;
|
|
31
31
|
export declare const BaiParam_NoGit: BaseCliParam<'noGit', boolean>;
|
|
32
32
|
export declare const BaiParam_Debug: BaseCliParam<'debug', boolean>;
|
|
33
33
|
export declare const BaiParam_QuickDeploy: BaseCliParam<'quickDeploy', boolean>;
|
|
@@ -36,5 +36,5 @@ export declare const BaiParam_AllLogs: BaseCliParam<'allLogs', boolean>;
|
|
|
36
36
|
export declare const BaiParam_EncounterManager: BaseCliParam<'encounterManager', boolean>;
|
|
37
37
|
export declare const BaiParam_EncounterManagerListen: BaseCliParam<'encounterManagerListen', boolean>;
|
|
38
38
|
export declare const BaiParam_UsePackage: BaseCliParam<'usePackage', string[]>;
|
|
39
|
-
export declare const AllBaiParams: (BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend",
|
|
40
|
-
export declare const RuntimeParams: import("@nu-art/commando/cli/cli-params").CliParams<(BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend",
|
|
39
|
+
export declare const AllBaiParams: (BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend", string> | BaseCliParam<"deployFrontend", string> | BaseCliParam<"noGit", boolean> | BaseCliParam<"debug", boolean> | BaseCliParam<"publish", string> | BaseCliParam<"allLogs", boolean> | BaseCliParam<"encounterManager", boolean> | BaseCliParam<"encounterManagerListen", boolean> | BaseCliParam<"usePackage", string[]>)[];
|
|
40
|
+
export declare const RuntimeParams: import("@nu-art/commando/cli/cli-params").CliParams<(BaseCliParam<"help", boolean> | BaseCliParam<"dependencyTree", boolean> | BaseCliParam<"checkCyclicImports", boolean> | BaseCliParam<"printEnv", boolean> | BaseCliParam<"continue", boolean> | BaseCliParam<"environment", string> | BaseCliParam<"setup", boolean> | BaseCliParam<"install", boolean> | BaseCliParam<"installPackages", boolean> | BaseCliParam<"installGlobals", boolean> | BaseCliParam<"clean", boolean> | BaseCliParam<"purge", boolean> | BaseCliParam<"generate", boolean> | BaseCliParam<"generateDocs", boolean> | BaseCliParam<"noBuild", boolean> | BaseCliParam<"dryRun", boolean> | BaseCliParam<"runWithThunderstorm", boolean> | BaseCliParam<"withCommando", boolean> | BaseCliParam<"noThunderstorm", boolean> | BaseCliParam<"lint", boolean> | BaseCliParam<"watch", boolean> | BaseCliParam<"test", string> | BaseCliParam<"launch", string> | BaseCliParam<"launchFrontend", boolean> | BaseCliParam<"launchBackend", boolean> | BaseCliParam<"debugBackend", boolean> | BaseCliParam<"deploy", string> | BaseCliParam<"deployBackend", string> | BaseCliParam<"deployFrontend", string> | BaseCliParam<"noGit", boolean> | BaseCliParam<"debug", boolean> | BaseCliParam<"publish", string> | BaseCliParam<"allLogs", boolean> | BaseCliParam<"encounterManager", boolean> | BaseCliParam<"encounterManagerListen", boolean> | BaseCliParam<"usePackage", string[]>)[]>;
|
package/core/params/params.js
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.RuntimeParams = exports.AllBaiParams = exports.BaiParam_UsePackage = exports.BaiParam_EncounterManagerListen = exports.BaiParam_EncounterManager = exports.BaiParam_AllLogs = exports.BaiParam_Publish = exports.BaiParam_QuickDeploy = exports.BaiParam_Debug = exports.BaiParam_NoGit = exports.BaiParam_DeployFrontend = exports.BaiParam_DeployBackend = exports.BaiParam_Deploy = exports.BaiParam_DebugBackend = exports.BaiParam_LaunchBackend = exports.BaiParam_LaunchFrontend = exports.BaiParam_Launch = exports.BaiParam_Test = exports.BaiParam_Watch = exports.BaiParam_Lint = exports.BaiParam_NoThunderstorm = exports.BaiParam_WithCommando = exports.BaiParam_RunWithThunderstorm = exports.BaiParam_DryRun = exports.BaiParam_NoBuild = exports.BaiParam_GenerateDocs = exports.BaiParam_Generate = exports.BaiParam_Purge = exports.BaiParam_Clean = exports.BaiParam_InstallGlobals = exports.BaiParam_InstallPackages = exports.BaiParam_Install = exports.BaiParam_Setup = exports.BaiParam_SetEnv = exports.BaiParam_continue = exports.BaiParam_PrintEnv = exports.BaiParam_CheckCyclicImports = exports.BaiParam_DependencyTree = exports.BaiParam_Help = void 0;
|
|
4
4
|
const cli_params_1 = require("@nu-art/commando/cli/cli-params");
|
|
5
|
+
const ts_common_1 = require("@nu-art/ts-common");
|
|
6
|
+
//util regex function
|
|
7
|
+
const regexTemplate = (regexp) => (0, ts_common_1.exists)(regexp) ? `.*${regexp}.*` : '.*';
|
|
5
8
|
exports.BaiParam_Help = {
|
|
6
9
|
keys: ['--help', '-h'],
|
|
7
10
|
keyName: 'help',
|
|
@@ -157,14 +160,14 @@ exports.BaiParam_Test = {
|
|
|
157
160
|
type: 'string',
|
|
158
161
|
group: 'Test',
|
|
159
162
|
description: 'Run the tests in all the project packages\naccepts test label to run optionally. default will be empty string',
|
|
160
|
-
process:
|
|
163
|
+
process: regexTemplate,
|
|
161
164
|
};
|
|
162
165
|
exports.BaiParam_Launch = {
|
|
163
166
|
keys: ['--launch', '-l'],
|
|
164
167
|
keyName: 'launch',
|
|
165
168
|
type: 'string',
|
|
166
169
|
group: 'Apps',
|
|
167
|
-
process:
|
|
170
|
+
process: regexTemplate,
|
|
168
171
|
description: 'It will add the provided App to the launch list \nrequired input: path-to-app-to-launch(string)'
|
|
169
172
|
};
|
|
170
173
|
exports.BaiParam_LaunchFrontend = {
|
|
@@ -193,21 +196,23 @@ exports.BaiParam_Deploy = {
|
|
|
193
196
|
keyName: 'deploy',
|
|
194
197
|
type: 'string',
|
|
195
198
|
group: 'Apps',
|
|
196
|
-
process:
|
|
199
|
+
process: regexTemplate,
|
|
197
200
|
description: 'Will add the provided App to the deploy list or all applications'
|
|
198
201
|
};
|
|
199
202
|
exports.BaiParam_DeployBackend = {
|
|
200
203
|
keys: ['--deploy-backend', '-db'],
|
|
201
204
|
keyName: 'deployBackend',
|
|
202
205
|
group: 'Apps',
|
|
203
|
-
type: '
|
|
206
|
+
type: 'string',
|
|
207
|
+
process: regexTemplate,
|
|
204
208
|
description: 'Will add the app-backend to the deploy list'
|
|
205
209
|
};
|
|
206
210
|
exports.BaiParam_DeployFrontend = {
|
|
207
211
|
keys: ['--deploy-frontend', '-df'],
|
|
208
212
|
keyName: 'deployFrontend',
|
|
209
|
-
type: '
|
|
213
|
+
type: 'string',
|
|
210
214
|
group: 'Apps',
|
|
215
|
+
process: regexTemplate,
|
|
211
216
|
description: 'Will add the app frontend to the deploy list'
|
|
212
217
|
};
|
|
213
218
|
exports.BaiParam_NoGit = {
|
package/package.json
CHANGED
package/v2/phase/consts.js
CHANGED
|
@@ -132,7 +132,7 @@ exports.phase_DeployFrontend = {
|
|
|
132
132
|
key: exports.phaseKey_DeployFrontend,
|
|
133
133
|
name: 'Deploy Frontend',
|
|
134
134
|
method: 'deployFrontend',
|
|
135
|
-
filter: () => params_1.RuntimeParams.deployFrontend,
|
|
135
|
+
filter: () => !!params_1.RuntimeParams.deployFrontend,
|
|
136
136
|
dependencyPhaseKeys: [exports.phaseKey_Lint, exports.phaseKey_Compile],
|
|
137
137
|
};
|
|
138
138
|
exports.phaseKey_DeployBackend = 'deploy-backend';
|
|
@@ -140,7 +140,7 @@ exports.phase_DeployBackend = {
|
|
|
140
140
|
key: exports.phaseKey_DeployBackend,
|
|
141
141
|
name: 'Deploy Backend',
|
|
142
142
|
method: 'deployBackend',
|
|
143
|
-
filter: () => params_1.RuntimeParams.deployBackend,
|
|
143
|
+
filter: () => !!params_1.RuntimeParams.deployBackend,
|
|
144
144
|
dependencyPhaseKeys: [exports.phaseKey_Lint, exports.phaseKey_Compile],
|
|
145
145
|
};
|
|
146
146
|
exports.phases_Deploy = [exports.phase_DeployFrontend, exports.phase_DeployBackend];
|
package/v2/phase/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { BaseUnit } from '../unit/core';
|
|
1
2
|
export type Phase<PhaseMethod extends string> = {
|
|
2
3
|
key: string;
|
|
3
4
|
name: string;
|
|
4
5
|
method: PhaseMethod;
|
|
5
6
|
filter?: () => (Promise<boolean> | boolean);
|
|
7
|
+
unitFilter?: (unit: BaseUnit) => (Promise<boolean> | boolean);
|
|
6
8
|
terminateAfterPhase?: boolean;
|
|
7
9
|
runUnitsInDependency?: boolean;
|
|
8
10
|
dependencyPhaseKeys?: string[];
|
|
@@ -230,15 +230,22 @@ class PhaseRunner extends core_1.BaseUnit {
|
|
|
230
230
|
});
|
|
231
231
|
PhaseRunnerDispatcher_1.dispatcher_UnitChange.dispatch(this.units);
|
|
232
232
|
}
|
|
233
|
-
getUnitsForPhase(phase) {
|
|
234
|
-
return (0, ts_common_1.filterInstances)(this.unitDependencyTree.map(row => {
|
|
235
|
-
const filteredRow = row.
|
|
233
|
+
async getUnitsForPhase(phase) {
|
|
234
|
+
return (0, ts_common_1.filterInstances)(await Promise.all(this.unitDependencyTree.map(async (row) => {
|
|
235
|
+
const filteredRow = await Promise.all(row.map(async (unit) => {
|
|
236
|
+
// Unit filter did not pass
|
|
236
237
|
if ((0, ts_common_1.exists)(unit.config.filter) && !unit.config.filter())
|
|
237
|
-
return
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
238
|
+
return null;
|
|
239
|
+
// Unit doesn't implement the phase method
|
|
240
|
+
if (!(0, ts_common_1.exists)(unit[phase.method]))
|
|
241
|
+
return null;
|
|
242
|
+
// If phase implements unit filter and unit doesn't pass
|
|
243
|
+
if ((0, ts_common_1.exists)(phase.unitFilter) && !(await phase.unitFilter(unit)))
|
|
244
|
+
return null;
|
|
245
|
+
return unit;
|
|
246
|
+
}));
|
|
247
|
+
return (0, ts_common_1.filterInstances)(filteredRow);
|
|
248
|
+
})).then(rows => rows.filter(row => row.length)));
|
|
242
249
|
}
|
|
243
250
|
getUnits() {
|
|
244
251
|
return this.units;
|
|
@@ -257,7 +264,7 @@ class PhaseRunner extends core_1.BaseUnit {
|
|
|
257
264
|
this.logDebug(`Will not execute phase: ${phase.name}, did not pass filter`);
|
|
258
265
|
return false;
|
|
259
266
|
}
|
|
260
|
-
const units = this.getUnitsForPhase(phase);
|
|
267
|
+
const units = await this.getUnitsForPhase(phase);
|
|
261
268
|
if (!units.length) {
|
|
262
269
|
this.logDebug(`Will not execute phase: ${phase.name}, no units to execute`);
|
|
263
270
|
return false;
|
|
@@ -376,7 +383,9 @@ class PhaseRunner extends core_1.BaseUnit {
|
|
|
376
383
|
});
|
|
377
384
|
}
|
|
378
385
|
async killRunner() {
|
|
386
|
+
this.logDebug('Killing units');
|
|
379
387
|
await Promise.all(this.units.map(unit => unit.kill()));
|
|
388
|
+
this.logDebug('Units killed');
|
|
380
389
|
await this.setRunningStatus();
|
|
381
390
|
}
|
|
382
391
|
setScreen(screen) {
|
|
@@ -287,10 +287,12 @@ class Unit_FirebaseFunctionsApp extends core_1.Unit_TypescriptLib {
|
|
|
287
287
|
async kill() {
|
|
288
288
|
if (!this.launchCommandos)
|
|
289
289
|
return;
|
|
290
|
+
this.logWarning(`Killing unit - ${this.config.label}`);
|
|
290
291
|
const emulatorPid = this.getPID(this.listeners.emulator.pid);
|
|
291
292
|
const proxyPid = this.getPID(this.listeners.proxy.pid);
|
|
292
293
|
await this.launchCommandos.emulator.gracefullyKill(emulatorPid);
|
|
293
294
|
await this.launchCommandos.proxy.gracefullyKill(proxyPid);
|
|
295
|
+
this.logWarning(`Unit killed - ${this.config.label}`);
|
|
294
296
|
}
|
|
295
297
|
//######################### Deploy Logic #########################
|
|
296
298
|
async printFiles() {
|
|
@@ -145,8 +145,10 @@ class Unit_FirebaseHostingApp extends core_1.Unit_TypescriptLib {
|
|
|
145
145
|
var _a;
|
|
146
146
|
if (!this.launchCommando)
|
|
147
147
|
return;
|
|
148
|
+
this.logWarning(`Killing unit - ${this.config.label}`);
|
|
148
149
|
const appPid = this.getPID();
|
|
149
150
|
await ((_a = this.launchCommando) === null || _a === void 0 ? void 0 : _a.gracefullyKill(appPid));
|
|
151
|
+
this.logWarning(`Unit killed - ${this.config.label}`);
|
|
150
152
|
}
|
|
151
153
|
//######################### Deploy Logic #########################
|
|
152
154
|
async deployImpl() {
|