@nu-art/build-and-install 0.204.14 → 0.204.15

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.
@@ -30,7 +30,6 @@ projectManager.registerPhase(phases_1.Phase_CompileWatch);
30
30
  projectManager.registerPhase(phases_1.Phase_Launch);
31
31
  projectManager.registerPhase(phases_1.Phase_DeployFrontend);
32
32
  projectManager.registerPhase(phases_1.Phase_DeployBackend);
33
- projectManager.registerPhase(phases_1.Phase_Debug);
34
33
  projectManager.execute()
35
34
  .then(() => {
36
35
  ts_common_1.StaticLogger.logInfo('completed');
@@ -65,6 +65,7 @@ class ProjectManager extends ts_common_1.Logger {
65
65
  this.projectScreen = new ProjectScreen_1.ProjectScreen([]);
66
66
  params_1.RuntimeParams.allLogs ? this.showAllLogs() : this.showPrettyLogs();
67
67
  this.setMinLevel(ts_common_1.LogLevel.Verbose);
68
+ this.logInfo('Runtime params:', params_1.RuntimeParams);
68
69
  }
69
70
  showAllLogs() {
70
71
  var _a;
@@ -152,6 +153,7 @@ class ProjectManager extends ts_common_1.Logger {
152
153
  return async () => {
153
154
  let didRun = false;
154
155
  let didPrintPhase = false;
156
+ const phasesRan = [];
155
157
  const toRunPackages = consts_1.MemKey_Packages.get().packagesDependency.map((packages, i) => {
156
158
  return async () => {
157
159
  var _a;
@@ -170,6 +172,8 @@ class ProjectManager extends ts_common_1.Logger {
170
172
  if (!this.prevRunningStatus && !phase.terminatingPhase)
171
173
  consts_2.MemKey_RunningStatus.set({ phaseKey: phase.name, packageDependencyIndex: i });
172
174
  if (!didPrintPhase) {
175
+ // will only be called once per phase
176
+ phasesRan.push(phase);
173
177
  this.logInfo(`Running package phase: ${(0, ts_common_1.__stringify)(phasesToRun.map(mapToName))}`);
174
178
  didPrintPhase = true;
175
179
  }
@@ -201,7 +205,7 @@ class ProjectManager extends ts_common_1.Logger {
201
205
  for (const toRunPackage of toRunPackages) {
202
206
  await toRunPackage();
203
207
  }
204
- if (didRun && (0, ts_common_1.lastElement)(phasesToRun).terminatingPhase)
208
+ if (didRun && (0, ts_common_1.lastElement)(phasesRan).terminatingPhase)
205
209
  this.terminate = true;
206
210
  await (nextAction === null || nextAction === void 0 ? void 0 : nextAction());
207
211
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nu-art/build-and-install",
3
- "version": "0.204.14",
3
+ "version": "0.204.15",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/phases/phases.js CHANGED
@@ -389,10 +389,36 @@ exports.Phase_PrepareCompile = {
389
389
  const pathToLocalTsConfig = `${sourceFolder}/${CONST_TS_Config}`;
390
390
  projectScreen.updateOrCreatePackage(pkg.name, 'Compiling');
391
391
  const counter = timeCounter();
392
- const commando = nvm_1.NVM.createCommando();
393
- await commando
394
- .append(`tsc -p "${pathToLocalTsConfig}" --rootDir "${sourceFolder}" --outDir "${pkg.output}"`)
395
- .execute();
392
+ const commando = nvm_1.NVM.createCommando(basic_1.Cli_Basic);
393
+ if (pkg.type === 'firebase-hosting-app') {
394
+ commando
395
+ .cd(pkg.path)
396
+ .append(`ENV=${params_1.RuntimeParams.setEnv} npm run build`);
397
+ }
398
+ else {
399
+ try {
400
+ const otherFiles = [
401
+ 'json',
402
+ 'scss',
403
+ 'svg',
404
+ 'png',
405
+ 'jpg',
406
+ 'jpeg',
407
+ 'rules',
408
+ ];
409
+ const command = `find . \\( -name ${otherFiles.map(suffix => `'*.${suffix}'`).join(' -o -name ')} \\) | cpio -pdm "${pkg.output}" > /dev/null`;
410
+ await cli_1.Commando.create(basic_1.Cli_Basic)
411
+ .cd(`${pkg.path}/src/main`)
412
+ .append(command)
413
+ .execute();
414
+ }
415
+ catch (e) {
416
+ //
417
+ }
418
+ commando
419
+ .append(`tsc -p "${pathToLocalTsConfig}" --rootDir "${sourceFolder}" --outDir "${pkg.output}"`);
420
+ }
421
+ await commando.execute();
396
422
  projectScreen.updateOrCreatePackage(pkg.name, `Compiled (${counter.format('mm:ss.zzz')})`);
397
423
  };
398
424
  }
@@ -425,25 +451,6 @@ exports.Phase_Compile = {
425
451
  const packages = consts_1.MemKey_Packages.get();
426
452
  if (pkg.type === 'sourceless')
427
453
  return;
428
- try {
429
- const otherFiles = [
430
- 'json',
431
- 'scss',
432
- 'svg',
433
- 'png',
434
- 'jpg',
435
- 'jpeg',
436
- 'rules',
437
- ];
438
- const command = `find . \\( -name ${otherFiles.map(suffix => `'*.${suffix}'`).join(' -o -name ')} \\) | cpio -pdm "${pkg.output}" > /dev/null`;
439
- await cli_1.Commando.create(basic_1.Cli_Basic)
440
- .cd(`${pkg.path}/src/main`)
441
- .append(command)
442
- .execute();
443
- }
444
- catch (e) {
445
- //
446
- }
447
454
  const folder = 'main';
448
455
  const sourceFolder = `${pkg.path}/src/${folder}`;
449
456
  const pathToLocalTsConfig = `${sourceFolder}/${CONST_TS_Config}`;
@@ -614,11 +621,13 @@ exports.Phase_Launch = {
614
621
  exports.Phase_DeployFrontend = {
615
622
  type: 'package',
616
623
  name: 'deploy-frontend',
617
- terminatingPhase: true,
624
+ terminatingPhase: false,
618
625
  mandatoryPhases: [exports.Phase_ResolveEnv],
619
626
  filter: async (pkg) => {
620
627
  var _a;
621
- return !!((_a = pkg.name.match(new RegExp(params_1.RuntimeParams.deploy))) === null || _a === void 0 ? void 0 : _a[0]) && pkg.type === 'firebase-hosting-app';
628
+ const match = !!((_a = pkg.name.match(new RegExp(params_1.RuntimeParams.deploy))) === null || _a === void 0 ? void 0 : _a[0]);
629
+ ts_common_1.StaticLogger.logWarning(`deploy-frontend: ${pkg.name} match: ${match}`);
630
+ return match && pkg.type === 'firebase-hosting-app';
622
631
  },
623
632
  action: async (pkg) => {
624
633
  const projectScreen = ProjectScreen_1.MemKey_ProjectScreen.get();
@@ -638,7 +647,12 @@ exports.Phase_DeployBackend = {
638
647
  name: 'deploy-functions',
639
648
  terminatingPhase: true,
640
649
  mandatoryPhases: [exports.Phase_ResolveEnv],
641
- filter: async (pkg) => { var _a; return !!((_a = pkg.name.match(new RegExp(params_1.RuntimeParams.deploy))) === null || _a === void 0 ? void 0 : _a[0]) && pkg.type === 'firebase-functions-app'; },
650
+ filter: async (pkg) => {
651
+ var _a;
652
+ const match = !!((_a = pkg.name.match(new RegExp(params_1.RuntimeParams.deploy))) === null || _a === void 0 ? void 0 : _a[0]);
653
+ ts_common_1.StaticLogger.logWarning(`deploy-functions: ${pkg.name} match: ${match}`);
654
+ return match && pkg.type === 'firebase-functions-app';
655
+ },
642
656
  action: async (pkg) => {
643
657
  const projectScreen = ProjectScreen_1.MemKey_ProjectScreen.get();
644
658
  if (pkg.type !== 'firebase-functions-app')