@nu-art/build-and-install 0.204.73 → 0.204.75

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.
@@ -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', boolean>;
30
- export declare const BaiParam_DeployFrontend: BaseCliParam<'deployFrontend', boolean>;
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", boolean> | BaseCliParam<"deployFrontend", boolean> | 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", boolean> | BaseCliParam<"deployFrontend", boolean> | BaseCliParam<"noGit", boolean> | BaseCliParam<"debug", boolean> | BaseCliParam<"publish", string> | BaseCliParam<"allLogs", boolean> | BaseCliParam<"encounterManager", boolean> | BaseCliParam<"encounterManagerListen", boolean> | 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", 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[]>)[]>;
@@ -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: (regexp) => regexp !== null && regexp !== void 0 ? regexp : '.*',
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: (regexp) => regexp !== null && regexp !== void 0 ? regexp : '.*',
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: (regexp) => regexp !== null && regexp !== void 0 ? regexp : '.*',
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: 'boolean',
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: 'boolean',
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/build-and-install",
3
- "version": "0.204.73",
3
+ "version": "0.204.75",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",
@@ -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];
@@ -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.filter(unit => {
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 false;
238
- return (0, ts_common_1.exists)(unit[phase.method]);
239
- });
240
- return filteredRow.length ? filteredRow : undefined;
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;
@@ -94,7 +94,7 @@ class Unit_TypescriptLib extends Unit_Typescript_1.Unit_Typescript {
94
94
  .execute();
95
95
  }
96
96
  async copyAssetsToOutput() {
97
- const command = `find . \\( -name ${assetExtensions.map(suffix => `'*.${suffix}'`).join(' -o -name ')} \\) | cpio -pdmuv "${this.runtime.pathTo.output}" > /dev/null`;
97
+ const command = `find . \\( -name ${assetExtensions.map(suffix => `'*.${suffix}'`).join(' -o -name ')} \\) | cpio -pdmuv "${this.runtime.pathTo.output}" > /dev/null 2>&1`;
98
98
  await cli_1.Commando
99
99
  .create(basic_1.Cli_Basic)
100
100
  .cd(`${this.runtime.pathTo.pkg}/src/main`)