tnp-helpers 16.100.8 → 16.100.10

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.
Files changed (105) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/README.md +24 -24
  3. package/browser/esm2022/lib/base/base-db.mjs +48 -0
  4. package/browser/esm2022/lib/base/base-project-resolver.mjs +9 -27
  5. package/browser/esm2022/lib/base/base-project.mjs +73 -13
  6. package/browser/esm2022/lib/base/commit-data.mjs +22 -5
  7. package/browser/esm2022/lib/base/config-database.mjs +42 -0
  8. package/browser/esm2022/lib/base/linked-project.mjs +2 -1
  9. package/browser/esm2022/lib/base/project-database.mjs +18 -0
  10. package/browser/esm2022/lib/helpers/helpers-array-obj.mjs +1 -1
  11. package/browser/esm2022/lib/lowdb/adapters/Memory.mjs +26 -0
  12. package/browser/esm2022/lib/lowdb/core/Low.mjs +49 -0
  13. package/browser/esm2022/lib/lowdb/index.mjs +4 -0
  14. package/browser/fesm2022/tnp-helpers.mjs +190 -26
  15. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  16. package/browser/lib/base/base-db.d.ts +12 -0
  17. package/browser/lib/base/base-project-resolver.d.ts +9 -14
  18. package/browser/lib/base/base-project.d.ts +5 -4
  19. package/browser/lib/base/config-database.d.ts +15 -0
  20. package/browser/lib/base/project-database.d.ts +13 -0
  21. package/browser/lib/lowdb/adapters/Memory.d.ts +12 -0
  22. package/browser/lib/lowdb/core/Low.d.ts +25 -0
  23. package/browser/lib/lowdb/index.d.ts +3 -0
  24. package/client/README.md +24 -24
  25. package/client/esm2022/lib/base/base-db.mjs +48 -0
  26. package/client/esm2022/lib/base/base-project-resolver.mjs +9 -27
  27. package/client/esm2022/lib/base/base-project.mjs +73 -13
  28. package/client/esm2022/lib/base/commit-data.mjs +22 -5
  29. package/client/esm2022/lib/base/config-database.mjs +42 -0
  30. package/client/esm2022/lib/base/linked-project.mjs +2 -1
  31. package/client/esm2022/lib/base/project-database.mjs +18 -0
  32. package/client/esm2022/lib/helpers/helpers-array-obj.mjs +1 -1
  33. package/client/esm2022/lib/lowdb/adapters/Memory.mjs +26 -0
  34. package/client/esm2022/lib/lowdb/core/Low.mjs +49 -0
  35. package/client/esm2022/lib/lowdb/index.mjs +4 -0
  36. package/client/fesm2022/tnp-helpers.mjs +190 -26
  37. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  38. package/client/lib/base/base-db.d.ts +12 -0
  39. package/client/lib/base/base-project-resolver.d.ts +9 -14
  40. package/client/lib/base/base-project.d.ts +5 -4
  41. package/client/lib/base/config-database.d.ts +15 -0
  42. package/client/lib/base/project-database.d.ts +13 -0
  43. package/client/lib/lowdb/adapters/Memory.d.ts +12 -0
  44. package/client/lib/lowdb/core/Low.d.ts +25 -0
  45. package/client/lib/lowdb/index.d.ts +3 -0
  46. package/client/package.json +30 -30
  47. package/firedev.jsonc +61 -61
  48. package/lib/base/base-command-line.backend.d.ts +4 -0
  49. package/lib/base/base-command-line.backend.js +129 -20
  50. package/lib/base/base-command-line.backend.js.map +1 -1
  51. package/lib/base/base-db.d.ts +12 -0
  52. package/lib/base/base-db.js +74 -0
  53. package/lib/base/base-db.js.map +1 -0
  54. package/lib/base/base-project-resolver.d.ts +8 -12
  55. package/lib/base/base-project-resolver.js +8 -50
  56. package/lib/base/base-project-resolver.js.map +1 -1
  57. package/lib/base/base-project.d.ts +9 -6
  58. package/lib/base/base-project.js +283 -216
  59. package/lib/base/base-project.js.map +1 -1
  60. package/lib/base/base-start-config.backend.js +1 -1
  61. package/lib/base/base-start-config.backend.js.map +1 -1
  62. package/lib/base/command-line-feature.backend.d.ts +3 -1
  63. package/lib/base/command-line-feature.backend.js +2 -1
  64. package/lib/base/command-line-feature.backend.js.map +1 -1
  65. package/lib/base/commit-data.js +46 -24
  66. package/lib/base/commit-data.js.map +1 -1
  67. package/lib/base/config-database.d.ts +14 -0
  68. package/lib/base/config-database.js +74 -0
  69. package/lib/base/config-database.js.map +1 -0
  70. package/lib/base/linked-project.js.map +1 -1
  71. package/lib/base/project-database.d.ts +14 -0
  72. package/lib/base/project-database.js +31 -0
  73. package/lib/base/project-database.js.map +1 -0
  74. package/lib/helpers/for-backend/helpers-git.backend.js +1 -1
  75. package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
  76. package/lib/helpers/for-browser/angular.helper.js +3 -3
  77. package/lib/helpers/helpers-array-obj.js +1 -0
  78. package/lib/helpers/helpers-array-obj.js.map +1 -1
  79. package/lib/old/base-component.js +3 -3
  80. package/lib/old/base-formly-component.js +3 -3
  81. package/lib/old/dual-component-ctrl.js +3 -3
  82. package/package.json +4 -4
  83. package/tmp-environment.json +34 -34
  84. package/websql/README.md +24 -24
  85. package/websql/esm2022/lib/base/base-db.mjs +48 -0
  86. package/websql/esm2022/lib/base/base-project-resolver.mjs +9 -27
  87. package/websql/esm2022/lib/base/base-project.mjs +73 -13
  88. package/websql/esm2022/lib/base/commit-data.mjs +22 -5
  89. package/websql/esm2022/lib/base/config-database.mjs +42 -0
  90. package/websql/esm2022/lib/base/linked-project.mjs +2 -1
  91. package/websql/esm2022/lib/base/project-database.mjs +18 -0
  92. package/websql/esm2022/lib/helpers/helpers-array-obj.mjs +1 -1
  93. package/websql/esm2022/lib/lowdb/adapters/Memory.mjs +26 -0
  94. package/websql/esm2022/lib/lowdb/core/Low.mjs +49 -0
  95. package/websql/esm2022/lib/lowdb/index.mjs +4 -0
  96. package/websql/fesm2022/tnp-helpers.mjs +192 -28
  97. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  98. package/websql/lib/base/base-db.d.ts +12 -0
  99. package/websql/lib/base/base-project-resolver.d.ts +9 -14
  100. package/websql/lib/base/base-project.d.ts +5 -4
  101. package/websql/lib/base/config-database.d.ts +15 -0
  102. package/websql/lib/base/project-database.d.ts +13 -0
  103. package/websql/lib/lowdb/adapters/Memory.d.ts +12 -0
  104. package/websql/lib/lowdb/core/Low.d.ts +25 -0
  105. package/websql/lib/lowdb/index.d.ts +3 -0
@@ -961,18 +961,31 @@ applyMixins(HelpersFiredev, [
961
961
  /* */
962
962
  /* */
963
963
  /* */
964
- /* */
965
- /* */
966
- /* */
967
- /* */
968
- const defaultDb$1 = {
969
- projects: [],
970
- };
971
- class BaseProjectResolver {
964
+ class BaseDb {
965
+ constructor(ins, dbName, defaultDb) {
966
+ this.ins = ins;
967
+ this.dbName = dbName;
968
+ this.defaultDb = defaultDb;
969
+ }
970
+ /* */
971
+ /* */
972
972
  get isUnsingDB() {
973
- return !!this.lowDB;
973
+ /* */
974
+ /* */
975
+ return (void 0);
976
+ }
977
+ get projectsDbLocation() {
978
+ /* */
979
+ /* */
980
+ /* */
981
+ /* */
982
+ /* */
983
+ /* */
984
+ return (void 0);
974
985
  }
975
- async useDB(appName) {
986
+ async useDB() {
987
+ /* */
988
+ /* */
976
989
  /* */
977
990
  /* */
978
991
  /* */
@@ -988,12 +1001,85 @@ class BaseProjectResolver {
988
1001
  // @ts-ignore
989
1002
  return void 0;
990
1003
  }
991
- async getAllProjectsFromDB(appName) {
992
- const db = await this.useDB(appName);
993
- return db.data.projects;
1004
+ }
1005
+ ;
1006
+ ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-db.ts
1007
+
1008
+ /* */
1009
+ /* */
1010
+ const defaultDb$2 = {
1011
+ config: {},
1012
+ };
1013
+ class ConfigDatabase extends BaseDb {
1014
+ constructor(ins) {
1015
+ super(ins, 'config', defaultDb$2);
1016
+ }
1017
+ get selectedCodeEditorKey() {
1018
+ return 'selected-code-editor';
1019
+ }
1020
+ async selectCodeEditor() {
1021
+ /* */
1022
+ /* */
1023
+ /* */
1024
+ /* */
1025
+ /* */
1026
+ /* */
1027
+ /* */
1028
+ /* */
1029
+ /* */
1030
+ /* */
1031
+ /* */
1032
+ /* */
1033
+ return (void 0);
1034
+ }
1035
+ async getCodeEditor() {
1036
+ /* */
1037
+ /* */
1038
+ /* */
1039
+ /* */
1040
+ /* */
1041
+ /* */
1042
+ /* */
1043
+ return (void 0);
1044
+ }
1045
+ }
1046
+ ;
1047
+ ({}); // @--end-of-file-for-module=tnp-helpers lib/base/config-database.ts
1048
+
1049
+ const defaultDb$1 = {
1050
+ projects: [],
1051
+ };
1052
+ class ProjectDatabase extends BaseDb {
1053
+ constructor(ins) {
1054
+ super(ins, 'projects', defaultDb$1);
1055
+ }
1056
+ async getAllProjectsFromDB() {
1057
+ /* */
1058
+ /* */
1059
+ /* */
1060
+ return (void 0);
994
1061
  }
1062
+ }
1063
+ ;
1064
+ ({}); // @--end-of-file-for-module=tnp-helpers lib/base/project-database.ts
1065
+
1066
+ /* */
1067
+ /* */
1068
+ /* */
1069
+ /* */
1070
+ /* */
1071
+ /* */
1072
+ /* */
1073
+ /* */
1074
+ class BaseProjectResolver {
995
1075
  constructor(classFn) {
996
1076
  this.classFn = classFn;
1077
+ /**
1078
+ * general name for project company
1079
+ */
1080
+ this.orgName = 'firedev';
1081
+ this.configDb = new ConfigDatabase(this);
1082
+ this.projectsDb = new ProjectDatabase(this);
997
1083
  this.NPM_PROJECT_KEY = 'npm';
998
1084
  this.projects = [];
999
1085
  /**
@@ -1220,6 +1306,23 @@ class BaseProject {
1220
1306
  projects.forEach(project => visit(project));
1221
1307
  return result;
1222
1308
  }
1309
+ get embeddedProject() {
1310
+ const nearsetProj = this.ins.nearestTo(crossPlatformPath([this.location, '..']));
1311
+ const linkedPorj = nearsetProj.linkedProjects.find(l => {
1312
+ return this.location === crossPlatformPath([nearsetProj.location, l.relativeClonePath]);
1313
+ });
1314
+ if (!linkedPorj) {
1315
+ return;
1316
+ }
1317
+ const pathToEmbededProj = crossPlatformPath([nearsetProj.location, linkedPorj.relativeClonePath, linkedPorj.internalRealtiveProjectPath || '']);
1318
+ const embdedresult = this.ins.From(pathToEmbededProj);
1319
+ return embdedresult;
1320
+ }
1321
+ get projectsDbLocation() {
1322
+ /* */
1323
+ /* */
1324
+ return (void 0);
1325
+ }
1223
1326
  async saveLocationToDB() {
1224
1327
  /* */
1225
1328
  /* */
@@ -1239,6 +1342,8 @@ class BaseProject {
1239
1342
  /* */
1240
1343
  /* */
1241
1344
  /* */
1345
+ /* */
1346
+ /* */
1242
1347
  return (void 0);
1243
1348
  }
1244
1349
  // @ts-ignore
@@ -1250,21 +1355,33 @@ class BaseProject {
1250
1355
  this.location = location;
1251
1356
  this.cache = {};
1252
1357
  this.type = 'unknow';
1253
- /**
1254
- * general name for project company
1255
- */
1256
- this.orgName = 'firedev';
1257
1358
  this.toString = () => {
1258
1359
  return `${this.name}=>${this.location}`;
1259
1360
  };
1260
1361
  }
1362
+ async saveAllLinkedProjectsToDB() {
1363
+ const proj = this;
1364
+ await proj.saveLocationToDB();
1365
+ for (const link of proj.linkedProjects) {
1366
+ const linkedPorj = this.ins.From([proj.location, link.relativeClonePath, link.internalRealtiveProjectPath || '']);
1367
+ if (linkedPorj) {
1368
+ await linkedPorj.saveLocationToDB();
1369
+ }
1370
+ else {
1371
+ Helpers.warn(`Folder ${link.relativeClonePath} is missing projects...`);
1372
+ }
1373
+ }
1374
+ }
1375
+ get isMonorepo() {
1376
+ return false;
1377
+ }
1261
1378
  get core() {
1262
1379
  if (this.cache['core']) {
1263
1380
  return this.cache['core'];
1264
1381
  }
1265
- const proj = CoreProject.coreProjects.find(p => p.recognizedFn(this));
1266
- this.cache['core'] = proj;
1267
- return proj;
1382
+ const coreProject = CoreProject.coreProjects.find(p => p.recognizedFn(this));
1383
+ this.cache['core'] = coreProject;
1384
+ return coreProject;
1268
1385
  }
1269
1386
  addLinkedProject(linkedProj) {
1270
1387
  const linkedProject = _.isString(linkedProj) ? LinkedProject.fromName(linkedProj) : linkedProj;
@@ -1354,6 +1471,9 @@ class BaseProject {
1354
1471
  /* */
1355
1472
  return (void 0);
1356
1473
  }
1474
+ resetLinkedProjectsOnlyToCoreBranches() {
1475
+ return false;
1476
+ }
1357
1477
  async cloneUnexistedLinkedProjects(actionType, cloneChildren = false) {
1358
1478
  /* */
1359
1479
  /* */
@@ -1397,6 +1517,19 @@ class BaseProject {
1397
1517
  /* */
1398
1518
  /* */
1399
1519
  /* */
1520
+ /* */
1521
+ /* */
1522
+ /* */
1523
+ /* */
1524
+ /* */
1525
+ /* */
1526
+ /* */
1527
+ /* */
1528
+ /* */
1529
+ /* */
1530
+ /* */
1531
+ /* */
1532
+ /* */
1400
1533
  return (void 0);
1401
1534
  }
1402
1535
  setType(type) {
@@ -1556,6 +1689,7 @@ class BaseProject {
1556
1689
  this.basename,
1557
1690
  /* */
1558
1691
  /* */
1692
+ /* */
1559
1693
  ]
1560
1694
  .filter(f => !!f)
1561
1695
  .join('/');
@@ -1831,6 +1965,14 @@ class BaseProject {
1831
1965
  /* */
1832
1966
  /* */
1833
1967
  /* */
1968
+ /* */
1969
+ /* */
1970
+ /* */
1971
+ /* */
1972
+ /* */
1973
+ /* */
1974
+ /* */
1975
+ /* */
1834
1976
  }
1835
1977
  async pullProcess(cloneChildren = false) {
1836
1978
  /* */
@@ -1857,6 +1999,8 @@ class BaseProject {
1857
1999
  /* */
1858
2000
  /* */
1859
2001
  /* */
2002
+ /* */
2003
+ /* */
1860
2004
  return (void 0);
1861
2005
  }
1862
2006
  async pushProcess(options = {}) {
@@ -1936,6 +2080,8 @@ class BaseProject {
1936
2080
  /* */
1937
2081
  /* */
1938
2082
  /* */
2083
+ /* */
2084
+ /* */
1939
2085
  return (void 0);
1940
2086
  }
1941
2087
  _beforeAnyActionOnGitRoot() {
@@ -2043,6 +2189,7 @@ class BaseProject {
2043
2189
  /* */
2044
2190
  /* */
2045
2191
  /* */
2192
+ /* */
2046
2193
  return (void 0);
2047
2194
  },
2048
2195
  restoreLastVersion(localFilePath) {
@@ -2374,15 +2521,13 @@ class BaseProject {
2374
2521
  type: ${proj?.type}
2375
2522
  children (${proj?.children.length}): ${(!proj || !proj.children.length) ? '< none >' : ''}
2376
2523
  ${proj?.children.map(c => '+' + c.genericName).join('\n')}
2377
-
2524
+ ` +
2525
+ `
2378
2526
  linked porject prefix: "${this.linkedProjectsPrefix}"
2379
2527
 
2380
2528
  linked projects from json (${this.linkedProjects?.length || 0}):
2381
2529
  ${(this.linkedProjects || []).map(c => '- ' + c.relativeClonePath).join('\n')}
2382
2530
 
2383
- linked projects detected (${this.detectedLinkedProjects?.length || 0}):
2384
- ${(this.detectedLinkedProjects || []).map(c => '- ' + c.relativeClonePath).join('\n')}
2385
-
2386
2531
  `);
2387
2532
  }
2388
2533
  /**
@@ -2609,6 +2754,7 @@ ${(this.detectedLinkedProjects || []).map(c => '- ' + c.relativeClonePath).join(
2609
2754
  /* */
2610
2755
  /* */
2611
2756
  /* */
2757
+ /* */
2612
2758
  }
2613
2759
  getLibraryBuildComamnd(options) {
2614
2760
  /* */
@@ -2639,8 +2785,8 @@ class BaseFeatureForProject {
2639
2785
  ({}); // @--end-of-file-for-module=tnp-helpers lib/base/base-feature-for-project.ts
2640
2786
 
2641
2787
  const regexTeamsID = /[A-Z0-9]+\#/;
2642
- const regexCommitModuleInArgs = /\[[a-z|\-]+\]/;
2643
- const regexCommitModuleInBranch = /\-\-[a-z|\-]+\-\-/;
2788
+ const regexCommitModuleInArgs = /\[[a-z|\-|\,]+\]/;
2789
+ const regexCommitModuleInBranch = /\-\-[a-z|\-|\_]+\-\-/;
2644
2790
  class CommitData {
2645
2791
  /**
2646
2792
  *
@@ -2680,8 +2826,9 @@ class CommitData {
2680
2826
  if (commitModuleName) {
2681
2827
  commitMsg = commitMsg.replace(commitModuleName, '');
2682
2828
  }
2829
+ commitModuleName = commitModuleName?.replace(/\[/g, '').replace(/\]/g, '');
2683
2830
  return {
2684
- commitMsg, commitModuleName: commitModuleName?.replace(/\[/g, '').replace(/\]/g, '')
2831
+ commitMsg, commitModuleName,
2685
2832
  };
2686
2833
  }
2687
2834
  static getModuleNameFromBranch(branchName) {
@@ -2693,7 +2840,8 @@ class CommitData {
2693
2840
  commitModuleName = commitModuleName.replace(/^\-/, '');
2694
2841
  }
2695
2842
  }
2696
- return { commitModuleName: commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '') };
2843
+ commitModuleName = commitModuleName?.replace(/^\-\-/, '')?.replace(/\-\-$/, '').replace(/\_/, ',');
2844
+ return { commitModuleName };
2697
2845
  }
2698
2846
  static async getFromArgs(args, typeOfCommit) {
2699
2847
  /* */
@@ -2769,6 +2917,19 @@ class CommitData {
2769
2917
  /* */
2770
2918
  /* */
2771
2919
  /* */
2920
+ /* */
2921
+ /* */
2922
+ /* */
2923
+ /* */
2924
+ /* */
2925
+ /* */
2926
+ /* */
2927
+ /* */
2928
+ /* */
2929
+ /* */
2930
+ /* */
2931
+ /* */
2932
+ /* */
2772
2933
  return (void 0);
2773
2934
  }
2774
2935
  static from(options) {
@@ -2795,6 +2956,8 @@ class CommitData {
2795
2956
  }
2796
2957
  if (this.commitModuleName) {
2797
2958
  message = message.replace(this.commitModuleName.replace(/\-/g, ' '), ' ');
2959
+ message = message.replace(this.commitModuleName.replace(/\,/g, ' '), ' ');
2960
+ message = message.replace(this.commitModuleName.replace(/\,/g, '_'), ' ');
2798
2961
  }
2799
2962
  return message;
2800
2963
  }
@@ -2945,6 +3108,7 @@ class LinkedProject {
2945
3108
  /* */
2946
3109
  /* */
2947
3110
  /* */
3111
+ /* */
2948
3112
  return (void 0);
2949
3113
  }
2950
3114
  /**