tnp-helpers 16.444.7 → 16.444.9

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.
@@ -119,7 +119,7 @@ export declare abstract class BaseProject<PROJCET extends BaseProject = any, TYP
119
119
  checkPackages?: boolean;
120
120
  useYarn?: boolean;
121
121
  force?: boolean;
122
- }): void;
122
+ }): Promise<void>;
123
123
  preferYarnOverNpm(): boolean;
124
124
  /**
125
125
  *
@@ -43,12 +43,12 @@
43
43
  "firedev-helpers"
44
44
  ]
45
45
  },
46
- "version": "16.444.7",
46
+ "version": "16.444.9",
47
47
  "dependencies": {
48
- "json10-writer": "16.444.6",
48
+ "json10-writer": "16.444.7",
49
49
  "lowdb": "7.0.1",
50
50
  "task.js": "0.1.5",
51
- "tnp-models": "16.444.6",
51
+ "tnp-models": "16.444.7",
52
52
  "typescript": "~5.0.2"
53
53
  },
54
54
  "scripts": {
@@ -146,7 +146,7 @@
146
146
  "angular-material-css-vars": "5.0.2",
147
147
  "angular-resize-event": "3.2.0",
148
148
  "animate.css": "4.1.1 ",
149
- "any-project-cli": "16.444.5",
149
+ "any-project-cli": "16.444.7",
150
150
  "app-root-path": "3.0.0",
151
151
  "axios": "1.3.5",
152
152
  "background-worker-process": "16.100.10",
@@ -202,11 +202,11 @@
202
202
  "file-saver": "2.0.5",
203
203
  "file-type": "18.5.0",
204
204
  "firedev": "^16",
205
- "firedev-crud": "16.444.5",
206
- "firedev-crud-deamon": "16.444.5",
207
- "firedev-ports": "16.444.5",
205
+ "firedev-crud": "16.444.7",
206
+ "firedev-crud-deamon": "16.444.7",
207
+ "firedev-ports": "16.444.7",
208
208
  "firedev-storage": "16.444.5",
209
- "firedev-type-sql": "16.444.5",
209
+ "firedev-type-sql": "16.444.7",
210
210
  "firedev-typeorm": "16.444.5",
211
211
  "firedev-ui": "16.444.1",
212
212
  "fkill": "6.1.0",
@@ -226,11 +226,11 @@
226
226
  "image-focus": "1.2.1",
227
227
  "immer": "10.0.2",
228
228
  "immutable": "4.3.0",
229
- "incremental-compiler": "16.444.6",
229
+ "incremental-compiler": "16.444.8",
230
230
  "inquirer": "7.3.3",
231
231
  "inquirer-autocomplete-prompt": "1.3.0",
232
232
  "is-elevated": "3.0.0",
233
- "isomorphic-region-loader": "16.444.5",
233
+ "isomorphic-region-loader": "16.444.7",
234
234
  "istanbul-instrumenter-loader": "2.0.0",
235
235
  "jest": "29.5.0",
236
236
  "jest-date-mock": "1.0.8",
@@ -241,7 +241,7 @@
241
241
  "joi": "17.9.2",
242
242
  "jscodeshift": "0.6.3",
243
243
  "json-stringify-safe": "5.0.1",
244
- "json10": "16.444.5",
244
+ "json10": "16.444.7",
245
245
  "json5": "2.2.1",
246
246
  "json5-writer": "0.2.0",
247
247
  "jszip": "3.10.1",
@@ -250,8 +250,8 @@
250
250
  "localforage": "1.10.0",
251
251
  "lockfile": "1.0.4",
252
252
  "lodash": "4.17.20",
253
- "lodash-walk-object": "16.444.4",
254
- "magic-renamer": "16.444.4",
253
+ "lodash-walk-object": "16.444.6",
254
+ "magic-renamer": "16.444.6",
255
255
  "material-design-icons": "3.0.1",
256
256
  "method-override": "2.3.10",
257
257
  "minimist": "1.2.0",
@@ -263,9 +263,9 @@
263
263
  "ng-lock": "16.0.1",
264
264
  "ng-packagr": "16.0.1",
265
265
  "ng-talkback": "16.444.1",
266
- "ng2-logger": "16.444.6",
266
+ "ng2-logger": "16.444.7",
267
267
  "ng2-pdfjs-viewer": "16.0.4",
268
- "ng2-rest": "16.444.4",
268
+ "ng2-rest": "16.444.6",
269
269
  "ngx-ace-wrapper": "14.0.0",
270
270
  "ngx-editor": "15.3.0",
271
271
  "ngx-highlightjs": "9.0.0",
@@ -327,10 +327,10 @@
327
327
  "systeminformation": "3.45.7",
328
328
  "threads": "1.7.0",
329
329
  "tnp-cli": "16.444.1",
330
- "tnp-config": "16.444.6",
331
- "tnp-core": "16.444.7",
332
- "tnp-db": "16.444.4",
333
- "tnp-helpers": "16.444.6",
330
+ "tnp-config": "16.444.7",
331
+ "tnp-core": "16.444.8",
332
+ "tnp-db": "16.444.6",
333
+ "tnp-helpers": "16.444.8",
334
334
  "ts-debug": "1.3.0",
335
335
  "ts-json-schema-generator": "2.1.1",
336
336
  "ts-loader": "2.3.1",
@@ -340,7 +340,7 @@
340
340
  "turndown": "7.1.2",
341
341
  "typedoc": "0.25.13",
342
342
  "typedoc-plugin-markdown": "4.0.3",
343
- "typescript-class-helpers": "~16.444.6",
343
+ "typescript-class-helpers": "~16.444.7",
344
344
  "typescript-formatter": "~7.2.2",
345
345
  "underscore": "1.9.1",
346
346
  "uuid": "8.3.2",
@@ -356,6 +356,6 @@
356
356
  "yup": "1.1.1",
357
357
  "zone.js": "~0.13.0"
358
358
  },
359
- "lastBuildTagHash": "bbb5cdee498bfbc641d20dfd0c7af2592260458b",
359
+ "lastBuildTagHash": "80bb0e703a94cd665537f0a2e167a1b81c3d3e82",
360
360
  "main": "dist/app.electron.js"
361
361
  }
@@ -120,7 +120,7 @@ export declare abstract class BaseProject<PROJCET extends BaseProject = any, TYP
120
120
  checkPackages?: boolean;
121
121
  useYarn?: boolean;
122
122
  force?: boolean;
123
- }): void;
123
+ }): Promise<void>;
124
124
  preferYarnOverNpm(): boolean;
125
125
  /**
126
126
  *
@@ -902,16 +902,23 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
902
902
  //#region methods & getters /reinstall node modules
903
903
  BaseProject.prototype.reinstalNodeModules = function (options) {
904
904
  //#region @backendFunc
905
+ index_1.Helpers.taskStarted("Reinstalling node modules for ".concat(this.genericName));
905
906
  this.deleteNodeModules();
906
907
  index_1.Helpers.run("".concat((options === null || options === void 0 ? void 0 : options.useYarn) ? 'yarn' : 'npm', " install ").concat((options === null || options === void 0 ? void 0 : options.force) ? '--force' : ''), { cwd: this.location }).sync();
908
+ index_1.Helpers.taskDone("Reinstalled node modules for ".concat(this.genericName));
907
909
  //#endregion
908
910
  };
909
911
  //#endregion
910
912
  //#region methods & getters / make sure node modules installed
911
913
  BaseProject.prototype.makeSureNodeModulesInstalled = function (options) {
912
- if (this.nodeModulesEmpty()) {
913
- this.reinstalNodeModules(options);
914
- }
914
+ return tslib_1.__awaiter(this, void 0, void 0, function () {
915
+ return tslib_1.__generator(this, function (_a) {
916
+ if (this.nodeModulesEmpty()) {
917
+ this.reinstalNodeModules(options);
918
+ }
919
+ return [2 /*return*/];
920
+ });
921
+ });
915
922
  };
916
923
  //#endregion
917
924
  //#region methods & getters / prefer yarn over npm
@@ -1419,40 +1426,47 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
1419
1426
  //#endregion
1420
1427
  //#region methods & getters / push process
1421
1428
  BaseProject.prototype.pushProcess = function (options) {
1422
- var _a;
1429
+ var _a, _b;
1423
1430
  if (options === void 0) { options = {}; }
1424
1431
  return tslib_1.__awaiter(this, void 0, void 0, function () {
1425
1432
  var force, typeofCommit, forcePushNoQuestion, origin, exitCallBack, args, commitMessageRequired, skipChildren, commitData, error_2, childrenRepos, childrenRepos_2, childrenRepos_2_1, child, e_10_1;
1426
- var _b, _c, _d, e_10, _e;
1427
- return tslib_1.__generator(this, function (_f) {
1428
- switch (_f.label) {
1433
+ var _c, _d, _e, e_10, _f;
1434
+ var _this = this;
1435
+ return tslib_1.__generator(this, function (_g) {
1436
+ switch (_g.label) {
1429
1437
  case 0:
1430
- force = (_b = options.force, _b === void 0 ? false : _b), typeofCommit = options.typeofCommit, forcePushNoQuestion = options.forcePushNoQuestion, origin = (_c = options.origin, _c === void 0 ? 'origin' : _c), exitCallBack = options.exitCallBack, args = (_d = options.args, _d === void 0 ? [] : _d), commitMessageRequired = options.commitMessageRequired, skipChildren = options.skipChildren;
1438
+ force = (_c = options.force, _c === void 0 ? false : _c), typeofCommit = options.typeofCommit, forcePushNoQuestion = options.forcePushNoQuestion, origin = (_d = options.origin, _d === void 0 ? 'origin' : _d), exitCallBack = options.exitCallBack, args = (_e = options.args, _e === void 0 ? [] : _e), commitMessageRequired = options.commitMessageRequired, skipChildren = options.skipChildren;
1431
1439
  return [4 /*yield*/, this._beforePushProcessAction()];
1432
1440
  case 1:
1433
- _f.sent();
1441
+ _g.sent();
1434
1442
  return [4 /*yield*/, this.saveLocationToDB()];
1435
1443
  case 2:
1436
- _f.sent();
1444
+ _g.sent();
1437
1445
  return [4 /*yield*/, this._getCommitMessage(typeofCommit, args, commitMessageRequired)];
1438
1446
  case 3:
1439
- commitData = _f.sent();
1440
- _f.label = 4;
1447
+ commitData = _g.sent();
1448
+ if (!this.automaticallyAddAllChnagesWhenPushingToGit()) {
1449
+ if ((_a = commitData.commitMessage) === null || _a === void 0 ? void 0 : _a.split(':').map(function (p) { return p.trim(); }).every(function (p) { return p === _this.git.currentBranchName; })) {
1450
+ // QUICK_FIX
1451
+ index_1.Helpers.error("\n\n Please provide more specific commit message than branch name\n\n\n ", false, true);
1452
+ }
1453
+ }
1454
+ _g.label = 4;
1441
1455
  case 4:
1442
1456
  if (!true) return [3 /*break*/, 10];
1443
- _f.label = 5;
1457
+ _g.label = 5;
1444
1458
  case 5:
1445
- _f.trys.push([5, 7, , 9]);
1459
+ _g.trys.push([5, 7, , 9]);
1446
1460
  return [4 /*yield*/, this.lint()];
1447
1461
  case 6:
1448
- _f.sent();
1462
+ _g.sent();
1449
1463
  return [3 /*break*/, 10];
1450
1464
  case 7:
1451
- error_2 = _f.sent();
1465
+ error_2 = _g.sent();
1452
1466
  index_1.Helpers.warn('Fix your code...');
1453
1467
  return [4 /*yield*/, index_1.Helpers.consoleGui.question.yesNo('Try again lint before commit ?')];
1454
1468
  case 8:
1455
- if (!(_f.sent())) {
1469
+ if (!(_g.sent())) {
1456
1470
  return [3 /*break*/, 10];
1457
1471
  }
1458
1472
  return [3 /*break*/, 9];
@@ -1463,16 +1477,16 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
1463
1477
  if (!(this.git.lastCommitMessage() === commitData.commitMessage)) return [3 /*break*/, 12];
1464
1478
  return [4 /*yield*/, index_1.Helpers.questionYesNo('Soft reset last commit with same message ?')];
1465
1479
  case 11:
1466
- if (_f.sent()) {
1480
+ if (_g.sent()) {
1467
1481
  this.git.resetSoftHEAD(1);
1468
1482
  }
1469
- _f.label = 12;
1483
+ _g.label = 12;
1470
1484
  case 12: return [4 /*yield*/, index_1.Helpers.questionYesNo('Commit and push this ?')];
1471
1485
  case 13:
1472
- if (!(_f.sent())) {
1486
+ if (!(_g.sent())) {
1473
1487
  exitCallBack();
1474
1488
  }
1475
- _f.label = 14;
1489
+ _g.label = 14;
1476
1490
  case 14:
1477
1491
  if (this.automaticallyAddAllChnagesWhenPushingToGit()) {
1478
1492
  // my project
@@ -1480,7 +1494,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
1480
1494
  }
1481
1495
  if (this.useGitBranchesAsMetadataForCommits()) {
1482
1496
  index_1.Helpers.info('Checkingout branches (if needed)...');
1483
- if (((_a = this.git.currentBranchName) === null || _a === void 0 ? void 0 : _a.trim()) !== commitData.branchName) {
1497
+ if (((_b = this.git.currentBranchName) === null || _b === void 0 ? void 0 : _b.trim()) !== commitData.branchName) {
1484
1498
  try {
1485
1499
  this.git.checkout(commitData.branchName, {
1486
1500
  createBranchIfNotExists: true,
@@ -1504,42 +1518,42 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
1504
1518
  askToRetry: true,
1505
1519
  })];
1506
1520
  case 15:
1507
- _f.sent();
1521
+ _g.sent();
1508
1522
  if (!(this.automaticallyAddAllChnagesWhenPushingToGit() && !skipChildren)) return [3 /*break*/, 23];
1509
1523
  if (this.getLinkedProjectsConfig().skipRecrusivePush) {
1510
1524
  index_1.Helpers.warn("Skipping recrusive (children) push for ".concat(this.genericName));
1511
1525
  return [2 /*return*/];
1512
1526
  }
1513
1527
  childrenRepos = this.children.filter(function (f) { return f.git.isInsideGitRepo && f.git.isGitRoot; });
1514
- _f.label = 16;
1528
+ _g.label = 16;
1515
1529
  case 16:
1516
- _f.trys.push([16, 21, 22, 23]);
1530
+ _g.trys.push([16, 21, 22, 23]);
1517
1531
  childrenRepos_2 = tslib_1.__values(childrenRepos), childrenRepos_2_1 = childrenRepos_2.next();
1518
- _f.label = 17;
1532
+ _g.label = 17;
1519
1533
  case 17:
1520
1534
  if (!!childrenRepos_2_1.done) return [3 /*break*/, 20];
1521
1535
  child = childrenRepos_2_1.value;
1522
1536
  return [4 /*yield*/, child.pushProcess(options)];
1523
1537
  case 18:
1524
- _f.sent();
1525
- _f.label = 19;
1538
+ _g.sent();
1539
+ _g.label = 19;
1526
1540
  case 19:
1527
1541
  childrenRepos_2_1 = childrenRepos_2.next();
1528
1542
  return [3 /*break*/, 17];
1529
1543
  case 20: return [3 /*break*/, 23];
1530
1544
  case 21:
1531
- e_10_1 = _f.sent();
1545
+ e_10_1 = _g.sent();
1532
1546
  e_10 = { error: e_10_1 };
1533
1547
  return [3 /*break*/, 23];
1534
1548
  case 22:
1535
1549
  try {
1536
- if (childrenRepos_2_1 && !childrenRepos_2_1.done && (_e = childrenRepos_2.return)) _e.call(childrenRepos_2);
1550
+ if (childrenRepos_2_1 && !childrenRepos_2_1.done && (_f = childrenRepos_2.return)) _f.call(childrenRepos_2);
1537
1551
  }
1538
1552
  finally { if (e_10) throw e_10.error; }
1539
1553
  return [7 /*endfinally*/];
1540
1554
  case 23: return [4 /*yield*/, this.saveAllLinkedProjectsToDB()];
1541
1555
  case 24:
1542
- _f.sent();
1556
+ _g.sent();
1543
1557
  return [2 /*return*/];
1544
1558
  }
1545
1559
  });
@@ -2346,7 +2360,9 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
2346
2360
  // this.parent.location,
2347
2361
  // ...this.parent.children.map(c => c.location),
2348
2362
  ].map(function (l) { return (0, tnp_core_1.crossPlatformPath)([l, tnp_config_1.config.folder.node_modules]); });
2349
- this.makeSureNodeModulesInstalled();
2363
+ return [4 /*yield*/, this.makeSureNodeModulesInstalled()];
2364
+ case 5:
2365
+ _p.sent();
2350
2366
  _loop_1 = function (index, lib) {
2351
2367
  index_1.Helpers.info("Building (".concat(index + 1, "/").concat(allLibs.length, ") ").concat(lib.basename, " (").concat(tnp_core_3.chalk.bold(lib.name), ")"));
2352
2368
  if (strategy === 'link') {
@@ -2422,7 +2438,7 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
2422
2438
  }
2423
2439
  finally { if (e_12) throw e_12.error; }
2424
2440
  }
2425
- if (!watch) return [3 /*break*/, 13];
2441
+ if (!watch) return [3 /*break*/, 14];
2426
2442
  _loop_2 = function (index, lib) {
2427
2443
  return tslib_1.__generator(this, function (_q) {
2428
2444
  switch (_q.label) {
@@ -2455,41 +2471,41 @@ var BaseProject = exports.BaseProject = /** @class */ (function () {
2455
2471
  }
2456
2472
  });
2457
2473
  };
2458
- _p.label = 5;
2459
- case 5:
2460
- _p.trys.push([5, 10, 11, 12]);
2461
- _j = tslib_1.__values(libsToWatch.entries()), _k = _j.next();
2462
2474
  _p.label = 6;
2463
2475
  case 6:
2464
- if (!!_k.done) return [3 /*break*/, 9];
2476
+ _p.trys.push([6, 11, 12, 13]);
2477
+ _j = tslib_1.__values(libsToWatch.entries()), _k = _j.next();
2478
+ _p.label = 7;
2479
+ case 7:
2480
+ if (!!_k.done) return [3 /*break*/, 10];
2465
2481
  _l = tslib_1.__read(_k.value, 2), index = _l[0], lib = _l[1];
2466
2482
  return [5 /*yield**/, _loop_2(index, lib)];
2467
- case 7:
2468
- _p.sent();
2469
- _p.label = 8;
2470
2483
  case 8:
2484
+ _p.sent();
2485
+ _p.label = 9;
2486
+ case 9:
2471
2487
  _k = _j.next();
2472
- return [3 /*break*/, 6];
2473
- case 9: return [3 /*break*/, 12];
2474
- case 10:
2488
+ return [3 /*break*/, 7];
2489
+ case 10: return [3 /*break*/, 13];
2490
+ case 11:
2475
2491
  e_11_1 = _p.sent();
2476
2492
  e_11 = { error: e_11_1 };
2477
- return [3 /*break*/, 12];
2478
- case 11:
2493
+ return [3 /*break*/, 13];
2494
+ case 12:
2479
2495
  try {
2480
2496
  if (_k && !_k.done && (_o = _j.return)) _o.call(_j);
2481
2497
  }
2482
2498
  finally { if (e_11) throw e_11.error; }
2483
2499
  return [7 /*endfinally*/];
2484
- case 12:
2500
+ case 13:
2485
2501
  // await this.__indexRebuilder.startAndWatch({ taskName: 'index rebuild watch' });
2486
2502
  index_1.Helpers.success('BUILD DONE.. watching..');
2487
- return [3 /*break*/, 14];
2488
- case 13:
2503
+ return [3 /*break*/, 15];
2504
+ case 14:
2489
2505
  // await this.__indexRebuilder.start({ taskName: 'index rebuild watch' });
2490
2506
  index_1.Helpers.success('BUILD DONE');
2491
- _p.label = 14;
2492
- case 14: return [2 /*return*/];
2507
+ _p.label = 15;
2508
+ case 15: return [2 /*return*/];
2493
2509
  }
2494
2510
  });
2495
2511
  });