tnp-helpers 16.100.2 → 16.100.4

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 (39) hide show
  1. package/assets/shared/shared_folder_info.txt +1 -1
  2. package/browser/esm2022/lib/base/base-project.mjs +155 -5
  3. package/browser/esm2022/lib/models.mjs +85 -2
  4. package/browser/fesm2022/tnp-helpers.mjs +237 -4
  5. package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
  6. package/browser/lib/base/base-project.d.ts +15 -4
  7. package/browser/lib/models.d.ts +49 -9
  8. package/client/esm2022/lib/base/base-project.mjs +155 -5
  9. package/client/esm2022/lib/models.mjs +85 -2
  10. package/client/fesm2022/tnp-helpers.mjs +237 -4
  11. package/client/fesm2022/tnp-helpers.mjs.map +1 -1
  12. package/client/lib/base/base-project.d.ts +15 -4
  13. package/client/lib/models.d.ts +49 -9
  14. package/client/package.json +174 -124
  15. package/lib/base/base-command-line.backend.d.ts +3 -1
  16. package/lib/base/base-command-line.backend.js +39 -4
  17. package/lib/base/base-command-line.backend.js.map +1 -1
  18. package/lib/base/base-project.d.ts +16 -5
  19. package/lib/base/base-project.js +355 -85
  20. package/lib/base/base-project.js.map +1 -1
  21. package/lib/for-backend/helpers-git.backend.d.ts +5 -2
  22. package/lib/for-backend/helpers-git.backend.js +6 -4
  23. package/lib/for-backend/helpers-git.backend.js.map +1 -1
  24. package/lib/for-browser/angular.helper.js +3 -3
  25. package/lib/models.d.ts +49 -9
  26. package/lib/models.js +107 -0
  27. package/lib/models.js.map +1 -1
  28. package/lib/old/base-component.js +3 -3
  29. package/lib/old/base-formly-component.js +3 -3
  30. package/lib/old/dual-component-ctrl.js +3 -3
  31. package/package.json +5 -5
  32. package/package.json_tnp.json5 +0 -1
  33. package/tmp-environment.json +178 -128
  34. package/websql/esm2022/lib/base/base-project.mjs +155 -5
  35. package/websql/esm2022/lib/models.mjs +85 -2
  36. package/websql/fesm2022/tnp-helpers.mjs +238 -5
  37. package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
  38. package/websql/lib/base/base-project.d.ts +15 -4
  39. package/websql/lib/models.d.ts +49 -9
@@ -1,7 +1,8 @@
1
- import { _, CoreHelpers, crossPlatformPath, path } from 'tnp-core/websql';
1
+ import { _, CoreHelpers, path, crossPlatformPath } from 'tnp-core/websql';
2
2
  import { Subject } from 'rxjs';
3
3
  import * as fuzzy from 'fuzzy';
4
4
  import { CLASS } from 'typescript-class-helpers/websql';
5
+ import { config } from 'tnp-config/websql';
5
6
 
6
7
  var ValidatorsGit;
7
8
  (function (ValidatorsGit) {
@@ -956,6 +957,89 @@ applyMixins(HelpersFiredev, [
956
957
  ;
957
958
  ({}); // @--end-of-file-for-module=tnp-helpers lib/helpers.ts
958
959
 
960
+ class LinkedProject {
961
+ static from(options) {
962
+ const linkedProj = _.merge(new LinkedProject(), _.cloneDeep(options));
963
+ if (!linkedProj.relativeClonePath) {
964
+ linkedProj.relativeClonePath = path.basename(linkedProj.remoteUrl().replace('.git', ''));
965
+ }
966
+ if (!linkedProj.deafultBranch) {
967
+ linkedProj.deafultBranch = 'master';
968
+ }
969
+ return linkedProj;
970
+ }
971
+ static fromName(projectName, currentRemoteUrl, currentBranch) {
972
+ return LinkedProject.from({
973
+ repoUrl: currentRemoteUrl?.replace(path.basename(currentRemoteUrl), `${projectName}.git`),
974
+ deafultBranch: currentBranch,
975
+ relativeClonePath: projectName,
976
+ });
977
+ }
978
+ static detect(insideLocation, recursive = false) {
979
+ /* */
980
+ /* */
981
+ /* */
982
+ /* */
983
+ /* */
984
+ /* */
985
+ /* */
986
+ /* */
987
+ /* */
988
+ /* */
989
+ /* */
990
+ /* */
991
+ /* */
992
+ /* */
993
+ /* */
994
+ /* */
995
+ /* */
996
+ /* */
997
+ /* */
998
+ /* */
999
+ /* */
1000
+ /* */
1001
+ return (void 0);
1002
+ }
1003
+ /**
1004
+ * url for git repo
1005
+ */
1006
+ remoteUrl() {
1007
+ if (this.repoUrl) {
1008
+ return this.repoUrl;
1009
+ }
1010
+ if (this.repoUrlHttp) {
1011
+ return this.repoUrlHttp;
1012
+ }
1013
+ return this.repoUrlSsh;
1014
+ }
1015
+ }
1016
+ class LinkedPorjectsConfig {
1017
+ static from(options) {
1018
+ options = options || {};
1019
+ options.projects = (options.projects || [])
1020
+ .map(linkedProjOrname => {
1021
+ if (_.isString(linkedProjOrname)) {
1022
+ return LinkedProject.fromName(linkedProjOrname);
1023
+ }
1024
+ return LinkedProject.from(linkedProjOrname);
1025
+ })
1026
+ .sort((a, b) => {
1027
+ return (a.relativeClonePath || '').localeCompare((b.relativeClonePath || ''));
1028
+ });
1029
+ return _.merge(new LinkedPorjectsConfig(), _.cloneDeep(options));
1030
+ }
1031
+ }
1032
+ class CoreProject {
1033
+ static from(options) {
1034
+ return _.merge(new CoreProject(), _.cloneDeep(options));
1035
+ }
1036
+ get name() {
1037
+ return path.basename(this.url).replace(/\.git$/, '');
1038
+ }
1039
+ get url() {
1040
+ return this.urlHttp ? this.urlHttp : this.urlSSH;
1041
+ }
1042
+ }
959
1043
  ;
960
1044
  ({}); // @--end-of-file-for-module=tnp-helpers lib/models.ts
961
1045
 
@@ -1202,6 +1286,140 @@ class BaseProject {
1202
1286
  return `${this.name}=>${this.location}`;
1203
1287
  };
1204
1288
  }
1289
+ addLinkedProject(linkedProj) {
1290
+ const linkedProject = _.isString(linkedProj) ? LinkedProject.fromName(linkedProj) : linkedProj;
1291
+ /* */
1292
+ /* */
1293
+ /* */
1294
+ /* */
1295
+ return (void 0);
1296
+ }
1297
+ addLinkedProjects(linkedProjs) {
1298
+ /* */
1299
+ /* */
1300
+ /* */
1301
+ /* */
1302
+ return (void 0);
1303
+ }
1304
+ setLinkedProjectsConfig(linkedPorjectsConfig) {
1305
+ /* */
1306
+ /* */
1307
+ /* */
1308
+ /* */
1309
+ /* */
1310
+ /* */
1311
+ /* */
1312
+ /* */
1313
+ /* */
1314
+ return (void 0);
1315
+ }
1316
+ get linkedProjectsConfigPath() {
1317
+ return this.pathFor(config.file.linked_projects_json);
1318
+ }
1319
+ recreateLinkedProjectsConfig() {
1320
+ /* */
1321
+ /* */
1322
+ /* */
1323
+ /* */
1324
+ return (void 0);
1325
+ }
1326
+ getLinkedProjectsConfig() {
1327
+ /* */
1328
+ /* */
1329
+ /* */
1330
+ /* */
1331
+ /* */
1332
+ /* */
1333
+ /* */
1334
+ /* */
1335
+ /* */
1336
+ /* */
1337
+ /* */
1338
+ /* */
1339
+ /* */
1340
+ /* */
1341
+ /* */
1342
+ /* */
1343
+ /* */
1344
+ /* */
1345
+ /* */
1346
+ /* */
1347
+ /* */
1348
+ /* */
1349
+ /* */
1350
+ /* */
1351
+ /* */
1352
+ /* */
1353
+ /* */
1354
+ /* */
1355
+ return (void 0);
1356
+ }
1357
+ get linkedProjects() {
1358
+ return this.getLinkedProjectsConfig().projects || [];
1359
+ }
1360
+ get detectedLinkedProjects() {
1361
+ const detectedLinkedProjects = LinkedProject.detect(this.location)
1362
+ .filter(linkedProj => !!this.ins.From([this.location, linkedProj.relativeClonePath]));
1363
+ return detectedLinkedProjects;
1364
+ }
1365
+ get linkedProjectsPrefix() {
1366
+ return this.getLinkedProjectsConfig().prefix;
1367
+ }
1368
+ get linkedProjectsExisted() {
1369
+ /* */
1370
+ /* */
1371
+ /* */
1372
+ /* */
1373
+ /* */
1374
+ /* */
1375
+ /* */
1376
+ return (void 0);
1377
+ }
1378
+ async cloneUnexistedLinkedProjects(actionType, cloneChildren = false) {
1379
+ /* */
1380
+ /* */
1381
+ /* */
1382
+ /* */
1383
+ /* */
1384
+ /* */
1385
+ /* */
1386
+ /* */
1387
+ /* */
1388
+ /* */
1389
+ /* */
1390
+ /* */
1391
+ /* */
1392
+ /* */
1393
+ /* */
1394
+ /* */
1395
+ /* */
1396
+ /* */
1397
+ /* */
1398
+ /* */
1399
+ /* */
1400
+ /* */
1401
+ /* */
1402
+ /* */
1403
+ /* */
1404
+ /* */
1405
+ /* */
1406
+ /* */
1407
+ /* */
1408
+ /* */
1409
+ /* */
1410
+ /* */
1411
+ /* */
1412
+ /* */
1413
+ /* */
1414
+ /* */
1415
+ /* */
1416
+ /* */
1417
+ /* */
1418
+ /* */
1419
+ /* */
1420
+ /* */
1421
+ return (void 0);
1422
+ }
1205
1423
  setType(type) {
1206
1424
  // @ts-ignore
1207
1425
  this.type = type;
@@ -1629,7 +1847,7 @@ class BaseProject {
1629
1847
  /* */
1630
1848
  /* */
1631
1849
  }
1632
- async pullProcess() {
1850
+ async pullProcess(cloneChildren = false) {
1633
1851
  /* */
1634
1852
  /* */
1635
1853
  /* */
@@ -1755,9 +1973,11 @@ class BaseProject {
1755
1973
  /* */
1756
1974
  /* */
1757
1975
  /* */
1976
+ /* */
1758
1977
  return (void 0);
1759
1978
  }
1760
- async _beforePullProcessAction() {
1979
+ async _beforePullProcessAction(cloneChildren = false) {
1980
+ /* */
1761
1981
  /* */
1762
1982
  /* */
1763
1983
  return (void 0);
@@ -1820,7 +2040,13 @@ class BaseProject {
1820
2040
  /* */
1821
2041
  return (void 0);
1822
2042
  },
1823
- clone(url, destinationFolderName = '') {
2043
+ async clone(url, destinationFolderName = '', branchName) {
2044
+ /* */
2045
+ /* */
2046
+ /* */
2047
+ /* */
2048
+ /* */
2049
+ /* */
1824
2050
  /* */
1825
2051
  /* */
1826
2052
  return (void 0);
@@ -2150,6 +2376,13 @@ class BaseProject {
2150
2376
  children (${proj?.children.length}): ${(!proj || !proj.children.length) ? '< none >' : ''}
2151
2377
  ${proj?.children.map(c => '+' + c.genericName).join('\n')}
2152
2378
 
2379
+ linked porject prefix: "${this.linkedProjectsPrefix}"
2380
+
2381
+ linked projects from json (${this.linkedProjects?.length || 0}):
2382
+ ${(this.linkedProjects || []).map(c => '- ' + c.relativeClonePath).join('\n')}
2383
+
2384
+ linked projects detected (${this.detectedLinkedProjects?.length || 0}):
2385
+ ${(this.detectedLinkedProjects || []).map(c => '- ' + c.relativeClonePath).join('\n')}
2153
2386
 
2154
2387
  `);
2155
2388
  }
@@ -2653,5 +2886,5 @@ const Helpers = HelpersFiredev.Instance;
2653
2886
  * Generated bundle index. Do not edit.
2654
2887
  */
2655
2888
 
2656
- export { BaseFeatureForProject, BaseProject, BaseProjectResolver, CommitData, Helpers, HelpersAngular, Validators };
2889
+ export { BaseFeatureForProject, BaseProject, BaseProjectResolver, CommitData, CoreProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, Validators };
2657
2890
  //# sourceMappingURL=tnp-helpers.mjs.map