tnp-helpers 21.0.14 → 21.0.16

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 (96) hide show
  1. package/browser/fesm2022/tnp-helpers-browser.mjs +242 -1
  2. package/browser/fesm2022/tnp-helpers-browser.mjs.map +1 -1
  3. package/browser/package.json +1 -1
  4. package/browser/types/tnp-helpers-browser.d.ts +5 -0
  5. package/lib/base/classes/base-command-line-feature.backend.d.ts +47 -0
  6. package/lib/base/classes/base-command-line-feature.backend.js +147 -0
  7. package/lib/base/classes/base-command-line-feature.backend.js.map +1 -0
  8. package/lib/base/classes/base-global-command-line.backend.d.ts +243 -0
  9. package/lib/base/classes/base-global-command-line.backend.js +2212 -0
  10. package/lib/base/classes/base-global-command-line.backend.js.map +1 -0
  11. package/lib/base/classes/base-powershell.d.ts +58 -0
  12. package/lib/base/classes/base-powershell.js +105 -0
  13. package/lib/base/classes/base-powershell.js.map +1 -0
  14. package/lib/base/classes/base-process/base-process-api.service.d.ts +7 -0
  15. package/lib/base/classes/base-process/base-process.context.d.ts +19 -0
  16. package/lib/base/classes/base-process/base-process.context.js +22 -0
  17. package/lib/base/classes/base-process/base-process.context.js.map +1 -0
  18. package/lib/base/classes/base-process/base-process.controller.d.ts +17 -0
  19. package/lib/base/classes/base-process/base-process.controller.js +91 -0
  20. package/lib/base/classes/base-process/base-process.controller.js.map +1 -0
  21. package/lib/base/classes/base-process/base-process.d.ts +8 -0
  22. package/lib/base/classes/base-process/base-process.defaults-values.d.ts +2 -0
  23. package/lib/base/classes/base-process/base-process.defaults-values.js +9 -0
  24. package/lib/base/classes/base-process/base-process.defaults-values.js.map +1 -0
  25. package/lib/base/classes/base-process/base-process.js +62 -0
  26. package/lib/base/classes/base-process/base-process.js.map +1 -0
  27. package/lib/base/classes/base-process/base-process.models.d.ts +6 -0
  28. package/lib/base/classes/base-process/base-process.models.js +3 -0
  29. package/lib/base/classes/base-process/base-process.models.js.map +1 -0
  30. package/lib/base/classes/base-process/base-process.provider.d.ts +16 -0
  31. package/lib/base/classes/base-process/base-process.provider.js +69 -0
  32. package/lib/base/classes/base-process/base-process.provider.js.map +1 -0
  33. package/lib/base/classes/base-process/base-process.repository copy.d.ts +8 -0
  34. package/lib/base/classes/base-process/base-process.repository copy.js +32 -0
  35. package/lib/base/classes/base-process/base-process.repository copy.js.map +1 -0
  36. package/lib/base/classes/base-process/base-process.repository.d.ts +8 -0
  37. package/lib/base/classes/base-process/base-process.repository.js +32 -0
  38. package/lib/base/classes/base-process/base-process.repository.js.map +1 -0
  39. package/lib/base/classes/base-process/base-process.terminal-ui.d.ts +11 -0
  40. package/lib/base/classes/base-process/base-process.terminal-ui.js +54 -0
  41. package/lib/base/classes/base-process/base-process.terminal-ui.js.map +1 -0
  42. package/lib/base/classes/base-process/base-process.worker.d.ts +16 -0
  43. package/lib/base/classes/base-process/base-process.worker.js +29 -0
  44. package/lib/base/classes/base-process/base-process.worker.js.map +1 -0
  45. package/lib/base/classes/base-process/index.d.ts +1 -0
  46. package/lib/base/classes/base-process/index.js +22 -0
  47. package/lib/base/classes/base-process/index.js.map +1 -0
  48. package/lib/base/classes/base-process/processes.repository.d.ts +0 -0
  49. package/lib/base/classes/base-process/processes.repository.js +5 -0
  50. package/lib/base/classes/base-process/processes.repository.js.map +1 -0
  51. package/lib/base/core-project.d.ts +2 -2
  52. package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
  53. package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
  54. package/lib/build-info._auto-generated_.d.ts +1 -1
  55. package/lib/build-info._auto-generated_.js +1 -1
  56. package/lib/env-backend._auto-generated_.d.ts +34 -0
  57. package/lib/env-backend._auto-generated_.js +38 -0
  58. package/lib/env-backend._auto-generated_.js.map +1 -0
  59. package/lib/env-browser._auto-generated_.d.ts +34 -0
  60. package/lib/env-browser._auto-generated_.js +38 -0
  61. package/lib/env-browser._auto-generated_.js.map +1 -0
  62. package/lib/env.backend.d.ts +34 -0
  63. package/lib/env.backend.js +40 -0
  64. package/lib/env.backend.js.map +1 -0
  65. package/lib/env.browser.d.ts +34 -0
  66. package/lib/helpers/for-backend/helpers-dependencies.backend.d.ts +2 -0
  67. package/lib/helpers/for-backend/helpers-dependencies.backend.js +7 -0
  68. package/lib/helpers/for-backend/helpers-dependencies.backend.js.map +1 -0
  69. package/lib/helpers/for-backend/helpers-network.backend.d.ts +9 -0
  70. package/lib/helpers/for-backend/helpers-network.backend.js +44 -0
  71. package/lib/helpers/for-backend/helpers-network.backend.js.map +1 -0
  72. package/lib/helpers/for-browser/angular.helper.js +2 -2
  73. package/lib/old/base-component.js +2 -2
  74. package/lib/old/base-formly-component.js +2 -2
  75. package/lib/old/dual-component-ctrl.js +2 -2
  76. package/lib/utils.d.ts +5 -0
  77. package/lib/utils.js +189 -0
  78. package/lib/utils.js.map +1 -1
  79. package/lib/validators/validators-firedev.d.ts +3 -0
  80. package/lib/validators/validators-firedev.js +34 -0
  81. package/lib/validators/validators-firedev.js.map +1 -0
  82. package/lib/validators/validators-git.d.ts +3 -0
  83. package/lib/validators/validators-git.js +13 -0
  84. package/lib/validators/validators-git.js.map +1 -0
  85. package/lib/validators/validators-network.d.ts +3 -0
  86. package/lib/validators/validators-network.js +19 -0
  87. package/lib/validators/validators-network.js.map +1 -0
  88. package/lib/validators/validators.d.ts +6 -0
  89. package/lib/validators/validators.js +11 -0
  90. package/lib/validators/validators.js.map +1 -0
  91. package/package.json +1 -1
  92. package/tmp-environment.json +33 -0
  93. package/websql/fesm2022/tnp-helpers-websql.mjs +242 -1
  94. package/websql/fesm2022/tnp-helpers-websql.mjs.map +1 -1
  95. package/websql/package.json +1 -1
  96. package/websql/types/tnp-helpers-websql.d.ts +5 -0
@@ -1483,6 +1483,8 @@ var UtilsTypescript;
1483
1483
  return (void 0);
1484
1484
  }
1485
1485
  UtilsTypescript.transformFlatImports = transformFlatImports;
1486
+ //#endregion
1487
+ //#region clear require cache recursive
1486
1488
  UtilsTypescript.clearRequireCacheRecursive = (modulePath, seen = new Set()) => {
1487
1489
  /* */
1488
1490
  /* */
@@ -1500,6 +1502,245 @@ var UtilsTypescript;
1500
1502
  /* */
1501
1503
  return (void 0);
1502
1504
  };
1505
+ //#endregion
1506
+ //#region add or update import if not exists
1507
+ UtilsTypescript.addOrUpdateImportIfNotExists = (tsFileContent, identifiers, fromModule) => {
1508
+ const idents = Array.isArray(identifiers) ? identifiers : [identifiers];
1509
+ const impRegex = new RegExp(`${'imp' + 'ort'}\\s*\\{([^}]*)\\}\\s*from\\s*['"]${fromModule}['"];?`, 'm');
1510
+ const match = tsFileContent.match(impRegex);
1511
+ // ----------------------------------------------------
1512
+ // 1. Import exists → merge identifiers
1513
+ // ----------------------------------------------------
1514
+ if (match) {
1515
+ const existing = match[1]
1516
+ .split(',')
1517
+ .map(s => s.trim())
1518
+ .filter(Boolean);
1519
+ const merged = Array.from(new Set([...existing, ...idents])).sort();
1520
+ const updatedImport = `import { ${merged.join(', ')} } from '${fromModule}';`;
1521
+ return tsFileContent.replace(match[0], updatedImport);
1522
+ }
1523
+ // ----------------------------------------------------
1524
+ // 2. Import does NOT exist → insert into //#region imports
1525
+ // ----------------------------------------------------
1526
+ const newImport = `${'imp' + 'ort'} { ${idents.join(', ')} } from '${fromModule}';\n`;
1527
+ const regRegex = new RegExp(`\\/\\/\\#${'reg' + 'ion'} imports\\s*\\n([\\s\\S]*?)\\/\\/\\#${'endr' + 'egion'}`, 'm');
1528
+ const regionMatch = tsFileContent.match(regRegex);
1529
+ if (regionMatch) {
1530
+ const regStart = regionMatch.index + regionMatch[0].indexOf('\n') + 1;
1531
+ return (tsFileContent.slice(0, regStart) +
1532
+ newImport +
1533
+ tsFileContent.slice(regStart));
1534
+ }
1535
+ // ----------------------------------------------------
1536
+ // 3. Fallback → insert at very top (after 'use strict')
1537
+ // ----------------------------------------------------
1538
+ const useStrictMatch = tsFileContent.match(/^(['"])use strict\1;\s*/m);
1539
+ if (useStrictMatch) {
1540
+ const idx = useStrictMatch.index + useStrictMatch[0].length;
1541
+ return tsFileContent.slice(0, idx) + newImport + tsFileContent.slice(idx);
1542
+ }
1543
+ return newImport + tsFileContent;
1544
+ };
1545
+ //#endregion
1546
+ //#region migrate from ng modules to standalone v21
1547
+ UtilsTypescript.migrateFromNgModulesToStandaloneV21 = (tsFileContent, projectName) => {
1548
+ /* */
1549
+ /* */
1550
+ /* */
1551
+ /* */
1552
+ /* */
1553
+ /* */
1554
+ /* */
1555
+ /* */
1556
+ /* */
1557
+ /* */
1558
+ /* */
1559
+ /* */
1560
+ /* */
1561
+ /* */
1562
+ /* */
1563
+ /* */
1564
+ /* */
1565
+ /* */
1566
+ /* */
1567
+ /* */
1568
+ /* */
1569
+ /* */
1570
+ /* */
1571
+ /* */
1572
+ /* */
1573
+ /* */
1574
+ /* */
1575
+ /* */
1576
+ /* */
1577
+ /* */
1578
+ /* */
1579
+ /* */
1580
+ /* */
1581
+ /* */
1582
+ /* */
1583
+ /* */
1584
+ /* */
1585
+ /* */
1586
+ /* */
1587
+ /* */
1588
+ /* */
1589
+ /* */
1590
+ /* */
1591
+ /* */
1592
+ /* */
1593
+ /* */
1594
+ /* */
1595
+ /* */
1596
+ /* */
1597
+ /* */
1598
+ /* */
1599
+ /* */
1600
+ /* */
1601
+ /* */
1602
+ /* */
1603
+ /* */
1604
+ /* */
1605
+ /* */
1606
+ /* */
1607
+ /* */
1608
+ /* */
1609
+ /* */
1610
+ /* */
1611
+ /* */
1612
+ /* */
1613
+ /* */
1614
+ /* */
1615
+ /* */
1616
+ /* */
1617
+ /* */
1618
+ /* */
1619
+ /* */
1620
+ /* */
1621
+ /* */
1622
+ /* */
1623
+ /* */
1624
+ /* */
1625
+ /* */
1626
+ /* */
1627
+ /* */
1628
+ /* */
1629
+ /* */
1630
+ /* */
1631
+ /* */
1632
+ /* */
1633
+ /* */
1634
+ /* */
1635
+ /* */
1636
+ /* */
1637
+ /* */
1638
+ /* */
1639
+ /* */
1640
+ /* */
1641
+ /* */
1642
+ /* */
1643
+ /* */
1644
+ /* */
1645
+ /* */
1646
+ /* */
1647
+ /* */
1648
+ /* */
1649
+ /* */
1650
+ /* */
1651
+ /* */
1652
+ /* */
1653
+ /* */
1654
+ /* */
1655
+ /* */
1656
+ /* */
1657
+ /* */
1658
+ /* */
1659
+ /* */
1660
+ /* */
1661
+ /* */
1662
+ /* */
1663
+ /* */
1664
+ /* */
1665
+ /* */
1666
+ /* */
1667
+ /* */
1668
+ /* */
1669
+ /* */
1670
+ /* */
1671
+ /* */
1672
+ /* */
1673
+ /* */
1674
+ /* */
1675
+ /* */
1676
+ /* */
1677
+ /* */
1678
+ /* */
1679
+ /* */
1680
+ /* */
1681
+ /* */
1682
+ /* */
1683
+ /* */
1684
+ /* */
1685
+ /* */
1686
+ /* */
1687
+ /* */
1688
+ /* */
1689
+ /* */
1690
+ /* */
1691
+ /* */
1692
+ /* */
1693
+ /* */
1694
+ /* */
1695
+ /* */
1696
+ /* */
1697
+ /* */
1698
+ /* */
1699
+ /* */
1700
+ /* */
1701
+ /* */
1702
+ /* */
1703
+ /* */
1704
+ /* */
1705
+ /* */
1706
+ /* */
1707
+ /* */
1708
+ /* */
1709
+ /* */
1710
+ /* */
1711
+ /* */
1712
+ /* */
1713
+ /* */
1714
+ /* */
1715
+ /* */
1716
+ /* */
1717
+ /* */
1718
+ /* */
1719
+ /* */
1720
+ /* */
1721
+ /* */
1722
+ /* */
1723
+ /* */
1724
+ /* */
1725
+ /* */
1726
+ /* */
1727
+ /* */
1728
+ /* */
1729
+ /* */
1730
+ /* */
1731
+ /* */
1732
+ /* */
1733
+ /* */
1734
+ /* */
1735
+ /* */
1736
+ /* */
1737
+ /* */
1738
+ /* */
1739
+ /* */
1740
+ /* */
1741
+ return (void 0);
1742
+ };
1743
+ //#endregion
1503
1744
  })(UtilsTypescript || (UtilsTypescript = {}));
1504
1745
  //#endregion
1505
1746
  //#region utils http
@@ -7644,7 +7885,7 @@ const PROJECT_NPM_NAME = 'tnp-helpers';
7644
7885
  /**
7645
7886
  * Autogenerated by current cli tool. Use *tnp release* to bump version.
7646
7887
  */
7647
- const CURRENT_PACKAGE_VERSION = '21.0.14';
7888
+ const CURRENT_PACKAGE_VERSION = '21.0.16';
7648
7889
  // THIS FILE IS GENERATED - DO NOT MODIFY
7649
7890
 
7650
7891
  //#endregion