tnp-helpers 19.0.52 → 19.0.54
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.
- package/browser/fesm2022/tnp-helpers.mjs +168 -265
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/browser/lib/base/classes/base-docker.d.ts +16 -0
- package/browser/lib/base/classes/base-git.d.ts +1 -0
- package/browser/lib/base/classes/base-project.d.ts +2 -0
- package/browser/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +7 -6
- package/browser/lib/build-info._auto-generated_.d.ts +1 -1
- package/browser/lib/utils.d.ts +41 -16
- package/browser/package.json +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js +4 -2
- package/lib/base/classes/base-cli-worker/base-cli-worker-terminal-ui.js.map +1 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/lib/base/classes/base-cli-worker/base-cli-worker.js +39 -13
- package/lib/base/classes/base-cli-worker/base-cli-worker.js.map +1 -1
- package/lib/base/classes/base-docker.d.ts +15 -0
- package/lib/base/classes/base-docker.js +56 -0
- package/lib/base/classes/base-docker.js.map +1 -0
- package/lib/base/classes/base-git.d.ts +1 -0
- package/lib/base/classes/base-git.js +4 -0
- package/lib/base/classes/base-git.js.map +1 -1
- package/lib/base/classes/base-global-command-line.backend.d.ts +5 -0
- package/lib/base/classes/base-global-command-line.backend.js +129 -33
- package/lib/base/classes/base-global-command-line.backend.js.map +1 -1
- package/lib/base/classes/base-project.d.ts +2 -0
- package/lib/base/classes/base-project.js +61 -57
- package/lib/base/classes/base-project.js.map +1 -1
- package/lib/base/classes/base-vscode.js +7 -1
- package/lib/base/classes/base-vscode.js.map +1 -1
- package/lib/base/tcp-udp-ports/not-assignable-port.entity.js +2 -2
- package/lib/base/tcp-udp-ports/ports.entity.d.ts +1 -1
- package/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +9 -8
- package/lib/build-info._auto-generated_.d.ts +1 -1
- package/lib/build-info._auto-generated_.js +1 -1
- package/lib/env/env.angular-node-app.d.ts +2 -0
- package/lib/env/env.angular-node-app.js +4 -2
- package/lib/env/env.angular-node-app.js.map +1 -1
- package/lib/env/env.docs-webapp.d.ts +2 -0
- package/lib/env/env.docs-webapp.js +4 -2
- package/lib/env/env.docs-webapp.js.map +1 -1
- package/lib/env/env.electron-app.d.ts +2 -0
- package/lib/env/env.electron-app.js +4 -2
- package/lib/env/env.electron-app.js.map +1 -1
- package/lib/env/env.mobile-app.d.ts +2 -0
- package/lib/env/env.mobile-app.js +4 -2
- package/lib/env/env.mobile-app.js.map +1 -1
- package/lib/env/env.npm-lib-and-cli-tool.d.ts +2 -0
- package/lib/env/env.npm-lib-and-cli-tool.js +4 -2
- package/lib/env/env.npm-lib-and-cli-tool.js.map +1 -1
- package/lib/env/env.vscode-plugin.d.ts +2 -0
- package/lib/env/env.vscode-plugin.js +4 -2
- package/lib/env/env.vscode-plugin.js.map +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.js +1 -1
- package/lib/helpers/for-backend/helpers-file-folders.js.map +1 -1
- package/lib/helpers/for-backend/helpers-git.backend.js +14 -4
- package/lib/helpers/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/helpers/for-browser/angular.helper.js +2 -2
- package/lib/old/base-component.js +2 -2
- package/lib/old/base-formly-component.js +2 -2
- package/lib/old/dual-component-ctrl.js +2 -2
- package/lib/utils.d.ts +41 -16
- package/lib/utils.js +124 -229
- package/lib/utils.js.map +1 -1
- package/package.json +1 -1
- package/websql/fesm2022/tnp-helpers.mjs +168 -265
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base/classes/base-cli-worker/base-cli-worker.d.ts +4 -1
- package/websql/lib/base/classes/base-docker.d.ts +16 -0
- package/websql/lib/base/classes/base-git.d.ts +1 -0
- package/websql/lib/base/classes/base-project.d.ts +2 -0
- package/websql/lib/base/tcp-udp-ports/tcp-udp-ports.context.d.ts +7 -6
- package/websql/lib/build-info._auto-generated_.d.ts +1 -1
- package/websql/lib/utils.d.ts +41 -16
- package/websql/package.json +1 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Subject } from 'rxjs';
|
|
2
|
-
import { CoreModels, Utils, crossPlatformPath, _, CoreHelpers, Helpers as Helpers$1,
|
|
2
|
+
import { CoreModels, Utils, crossPlatformPath, path, _, CoreHelpers, UtilsTerminal, Helpers as Helpers$1, fse, chalk } from 'tnp-core/browser';
|
|
3
|
+
import { CLASS } from 'typescript-class-helpers/browser';
|
|
3
4
|
import * as fuzzy from 'fuzzy';
|
|
4
5
|
import { Level } from 'ng2-logger/browser';
|
|
5
|
-
import { CLASS } from 'typescript-class-helpers/browser';
|
|
6
6
|
import { __decorate, __param, __metadata } from 'tslib';
|
|
7
7
|
import { Taon, BaseContext } from 'taon/browser';
|
|
8
8
|
import { config, folderName, fileName } from 'tnp-config/browser';
|
|
@@ -1532,6 +1532,8 @@ var UtilsQuickFixes;
|
|
|
1532
1532
|
/* */
|
|
1533
1533
|
/* */
|
|
1534
1534
|
/* */
|
|
1535
|
+
/* */
|
|
1536
|
+
/* */
|
|
1535
1537
|
return (void 0);
|
|
1536
1538
|
};
|
|
1537
1539
|
})(UtilsQuickFixes || (UtilsQuickFixes = {}));
|
|
@@ -1638,263 +1640,6 @@ var UtilsVSCode;
|
|
|
1638
1640
|
};
|
|
1639
1641
|
})(UtilsVSCode || (UtilsVSCode = {}));
|
|
1640
1642
|
//#endregion
|
|
1641
|
-
//#region utils dot file
|
|
1642
|
-
var UtilsDotFile;
|
|
1643
|
-
(function (UtilsDotFile) {
|
|
1644
|
-
//#region parse value from dot file util
|
|
1645
|
-
const parseValue = (rawValue) => {
|
|
1646
|
-
const val = rawValue.trim().replace(/^"|"$/g, '');
|
|
1647
|
-
// Try boolean
|
|
1648
|
-
if (val.toLowerCase() === 'true')
|
|
1649
|
-
return true;
|
|
1650
|
-
if (val.toLowerCase() === 'false')
|
|
1651
|
-
return false;
|
|
1652
|
-
// Try number
|
|
1653
|
-
if (!isNaN(Number(val)) && val !== '')
|
|
1654
|
-
return Number(val);
|
|
1655
|
-
return val;
|
|
1656
|
-
};
|
|
1657
|
-
//#endregion
|
|
1658
|
-
//#region set value to/from dot file
|
|
1659
|
-
UtilsDotFile.setValueToDotFile = (dotFileAbsPath, key, value) => {
|
|
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
|
-
return (void 0);
|
|
1692
|
-
};
|
|
1693
|
-
//#endregion
|
|
1694
|
-
//#region set comment to key in dot file
|
|
1695
|
-
UtilsDotFile.setCommentToKeyInDotFile = (dotFileAbsPath, key, comment) => {
|
|
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
|
-
return (void 0);
|
|
1729
|
-
};
|
|
1730
|
-
//#endregion
|
|
1731
|
-
//#region get value from dot file
|
|
1732
|
-
UtilsDotFile.getValueFromDotFile = (dotFileAbsPath, key) => {
|
|
1733
|
-
/* */
|
|
1734
|
-
/* */
|
|
1735
|
-
/* */
|
|
1736
|
-
/* */
|
|
1737
|
-
/* */
|
|
1738
|
-
/* */
|
|
1739
|
-
/* */
|
|
1740
|
-
/* */
|
|
1741
|
-
/* */
|
|
1742
|
-
/* */
|
|
1743
|
-
/* */
|
|
1744
|
-
/* */
|
|
1745
|
-
/* */
|
|
1746
|
-
/* */
|
|
1747
|
-
/* */
|
|
1748
|
-
/* */
|
|
1749
|
-
/* */
|
|
1750
|
-
/* */
|
|
1751
|
-
/* */
|
|
1752
|
-
/* */
|
|
1753
|
-
/* */
|
|
1754
|
-
/* */
|
|
1755
|
-
return (void 0);
|
|
1756
|
-
};
|
|
1757
|
-
//#endregion
|
|
1758
|
-
//#region set values keys from object
|
|
1759
|
-
UtilsDotFile.setValuesKeysFromObject = (dotFileAbsPath, obj, options) => {
|
|
1760
|
-
/* */
|
|
1761
|
-
/* */
|
|
1762
|
-
/* */
|
|
1763
|
-
/* */
|
|
1764
|
-
/* */
|
|
1765
|
-
/* */
|
|
1766
|
-
/* */
|
|
1767
|
-
/* */
|
|
1768
|
-
/* */
|
|
1769
|
-
/* */
|
|
1770
|
-
/* */
|
|
1771
|
-
/* */
|
|
1772
|
-
/* */
|
|
1773
|
-
/* */
|
|
1774
|
-
/* */
|
|
1775
|
-
/* */
|
|
1776
|
-
/* */
|
|
1777
|
-
/* */
|
|
1778
|
-
/* */
|
|
1779
|
-
/* */
|
|
1780
|
-
/* */
|
|
1781
|
-
/* */
|
|
1782
|
-
/* */
|
|
1783
|
-
return (void 0);
|
|
1784
|
-
};
|
|
1785
|
-
//#endregion
|
|
1786
|
-
//#region get values keys as json object
|
|
1787
|
-
UtilsDotFile.getValuesKeysAsJsonObject = (dotFileAbsPath) => {
|
|
1788
|
-
/* */
|
|
1789
|
-
/* */
|
|
1790
|
-
/* */
|
|
1791
|
-
/* */
|
|
1792
|
-
/* */
|
|
1793
|
-
/* */
|
|
1794
|
-
/* */
|
|
1795
|
-
/* */
|
|
1796
|
-
/* */
|
|
1797
|
-
/* */
|
|
1798
|
-
/* */
|
|
1799
|
-
/* */
|
|
1800
|
-
/* */
|
|
1801
|
-
/* */
|
|
1802
|
-
/* */
|
|
1803
|
-
/* */
|
|
1804
|
-
/* */
|
|
1805
|
-
/* */
|
|
1806
|
-
/* */
|
|
1807
|
-
/* */
|
|
1808
|
-
/* */
|
|
1809
|
-
/* */
|
|
1810
|
-
return (void 0);
|
|
1811
|
-
};
|
|
1812
|
-
//#endregion
|
|
1813
|
-
//#region get comments keys as json object
|
|
1814
|
-
/**
|
|
1815
|
-
* @returns key|comment pairs as json object
|
|
1816
|
-
*/
|
|
1817
|
-
UtilsDotFile.getCommentsKeysAsJsonObject = (dotFileAbsPath) => {
|
|
1818
|
-
/* */
|
|
1819
|
-
/* */
|
|
1820
|
-
/* */
|
|
1821
|
-
/* */
|
|
1822
|
-
/* */
|
|
1823
|
-
/* */
|
|
1824
|
-
/* */
|
|
1825
|
-
/* */
|
|
1826
|
-
/* */
|
|
1827
|
-
/* */
|
|
1828
|
-
/* */
|
|
1829
|
-
/* */
|
|
1830
|
-
/* */
|
|
1831
|
-
/* */
|
|
1832
|
-
/* */
|
|
1833
|
-
/* */
|
|
1834
|
-
/* */
|
|
1835
|
-
/* */
|
|
1836
|
-
/* */
|
|
1837
|
-
/* */
|
|
1838
|
-
/* */
|
|
1839
|
-
/* */
|
|
1840
|
-
/* */
|
|
1841
|
-
/* */
|
|
1842
|
-
/* */
|
|
1843
|
-
/* */
|
|
1844
|
-
/* */
|
|
1845
|
-
/* */
|
|
1846
|
-
/* */
|
|
1847
|
-
/* */
|
|
1848
|
-
/* */
|
|
1849
|
-
/* */
|
|
1850
|
-
/* */
|
|
1851
|
-
/* */
|
|
1852
|
-
/* */
|
|
1853
|
-
/* */
|
|
1854
|
-
/* */
|
|
1855
|
-
/* */
|
|
1856
|
-
/* */
|
|
1857
|
-
/* */
|
|
1858
|
-
/* */
|
|
1859
|
-
/* */
|
|
1860
|
-
/* */
|
|
1861
|
-
/* */
|
|
1862
|
-
/* */
|
|
1863
|
-
/* */
|
|
1864
|
-
/* */
|
|
1865
|
-
/* */
|
|
1866
|
-
/* */
|
|
1867
|
-
/* */
|
|
1868
|
-
/* */
|
|
1869
|
-
/* */
|
|
1870
|
-
/* */
|
|
1871
|
-
/* */
|
|
1872
|
-
/* */
|
|
1873
|
-
/* */
|
|
1874
|
-
/* */
|
|
1875
|
-
/* */
|
|
1876
|
-
/* */
|
|
1877
|
-
/* */
|
|
1878
|
-
/* */
|
|
1879
|
-
/* */
|
|
1880
|
-
/* */
|
|
1881
|
-
/* */
|
|
1882
|
-
/* */
|
|
1883
|
-
/* */
|
|
1884
|
-
/* */
|
|
1885
|
-
/* */
|
|
1886
|
-
/* */
|
|
1887
|
-
/* */
|
|
1888
|
-
/* */
|
|
1889
|
-
/* */
|
|
1890
|
-
/* */
|
|
1891
|
-
/* */
|
|
1892
|
-
/* */
|
|
1893
|
-
return (void 0);
|
|
1894
|
-
};
|
|
1895
|
-
//#endregion
|
|
1896
|
-
})(UtilsDotFile || (UtilsDotFile = {}));
|
|
1897
|
-
//#endregion
|
|
1898
1643
|
//#region utils zip browser
|
|
1899
1644
|
var UtilsZipBrowser;
|
|
1900
1645
|
(function (UtilsZipBrowser) {
|
|
@@ -2101,6 +1846,10 @@ var UtilsZip;
|
|
|
2101
1846
|
/* */
|
|
2102
1847
|
/* */
|
|
2103
1848
|
/* */
|
|
1849
|
+
/* */
|
|
1850
|
+
/* */
|
|
1851
|
+
/* */
|
|
1852
|
+
/* */
|
|
2104
1853
|
return (void 0);
|
|
2105
1854
|
};
|
|
2106
1855
|
// Unzip: `/some/path/folder.zip` → `/some/path/folder`
|
|
@@ -2579,6 +2328,120 @@ var UtilsPasswords;
|
|
|
2579
2328
|
// })();
|
|
2580
2329
|
})(UtilsPasswords || (UtilsPasswords = {}));
|
|
2581
2330
|
//#endregion
|
|
2331
|
+
//#region utils filepath metadata
|
|
2332
|
+
var FilePathMetaData;
|
|
2333
|
+
(function (FilePathMetaData) {
|
|
2334
|
+
const TERMINATOR = 'xxxxx'; // terminates metadata block
|
|
2335
|
+
const KV_SEPARATOR = '...'; // key/value separator
|
|
2336
|
+
const PAIR_SEPARATOR = 'IxIxI'; // between pairs
|
|
2337
|
+
//#region embed data into filename
|
|
2338
|
+
/**
|
|
2339
|
+
* Embed metadata into filename while preserving the extension.
|
|
2340
|
+
*
|
|
2341
|
+
* Example:
|
|
2342
|
+
* embedData({ version: "1.2.3", envName: "__" }, "project.zip")
|
|
2343
|
+
* -> "version|-|1.2.3||--||envName|-|__|||project.zip"
|
|
2344
|
+
*/
|
|
2345
|
+
function embedData(data, orgFilename, options) {
|
|
2346
|
+
options = options || {};
|
|
2347
|
+
const ext = path.extname(orgFilename);
|
|
2348
|
+
const base = path.basename(orgFilename, ext);
|
|
2349
|
+
const meta = Object.entries(data)
|
|
2350
|
+
.map(([key, value]) => `${key}${KV_SEPARATOR}${value ?? ''}`)
|
|
2351
|
+
.join(PAIR_SEPARATOR);
|
|
2352
|
+
return `${meta}${TERMINATOR}${options.skipAddingBasenameAtEnd ? '' : base}${ext}`;
|
|
2353
|
+
}
|
|
2354
|
+
FilePathMetaData.embedData = embedData;
|
|
2355
|
+
//#endregion
|
|
2356
|
+
//#region extract data from filename
|
|
2357
|
+
/**
|
|
2358
|
+
* Extract metadata from filename (reverse of embedData).
|
|
2359
|
+
*
|
|
2360
|
+
* Example:
|
|
2361
|
+
* extractData<{ version: string; env: string }>("myfile__version-1.2.3__env-prod.zip")
|
|
2362
|
+
* -> { version: "1.2.3", env: "prod" }
|
|
2363
|
+
*/
|
|
2364
|
+
function extractData(filename) {
|
|
2365
|
+
const ext = path.extname(filename);
|
|
2366
|
+
const thereIsNoExt = ext.includes('|') || ext.includes('-');
|
|
2367
|
+
const base = thereIsNoExt ? filename : path.basename(filename, ext);
|
|
2368
|
+
// Everything BEFORE the FIRST TERMINATOR
|
|
2369
|
+
const idx = base.lastIndexOf(TERMINATOR);
|
|
2370
|
+
const metaPart = idx >= 0 ? base.substring(0, idx) : base;
|
|
2371
|
+
const data = {};
|
|
2372
|
+
let cursor = 0;
|
|
2373
|
+
while (cursor <= metaPart.length) {
|
|
2374
|
+
const sepIdx = metaPart.indexOf(PAIR_SEPARATOR, cursor);
|
|
2375
|
+
const segment = sepIdx === -1
|
|
2376
|
+
? metaPart.substring(cursor)
|
|
2377
|
+
: metaPart.substring(cursor, sepIdx);
|
|
2378
|
+
if (segment) {
|
|
2379
|
+
const kvIdx = segment.indexOf(KV_SEPARATOR);
|
|
2380
|
+
if (kvIdx > -1) {
|
|
2381
|
+
const key = segment.substring(0, kvIdx);
|
|
2382
|
+
const value = segment.substring(kvIdx + KV_SEPARATOR.length);
|
|
2383
|
+
data[key] = value;
|
|
2384
|
+
}
|
|
2385
|
+
}
|
|
2386
|
+
if (sepIdx === -1)
|
|
2387
|
+
break;
|
|
2388
|
+
cursor = sepIdx + PAIR_SEPARATOR.length;
|
|
2389
|
+
}
|
|
2390
|
+
return data;
|
|
2391
|
+
}
|
|
2392
|
+
FilePathMetaData.extractData = extractData;
|
|
2393
|
+
//#endregion
|
|
2394
|
+
//#region get only metadata string
|
|
2395
|
+
FilePathMetaData.getOnlyMetadataString = (filename) => {
|
|
2396
|
+
const ext = path.extname(filename);
|
|
2397
|
+
const base = path.basename(filename, ext);
|
|
2398
|
+
const idx = base.lastIndexOf(TERMINATOR);
|
|
2399
|
+
if (idx === -1)
|
|
2400
|
+
return ''; // no terminator
|
|
2401
|
+
const metaPart = base.substring(0, idx);
|
|
2402
|
+
if (!metaPart.trim())
|
|
2403
|
+
return ''; // empty metadata
|
|
2404
|
+
return metaPart;
|
|
2405
|
+
};
|
|
2406
|
+
//#endregion
|
|
2407
|
+
})(FilePathMetaData || (FilePathMetaData = {}));
|
|
2408
|
+
//#endregion
|
|
2409
|
+
//#region utils cli
|
|
2410
|
+
/**
|
|
2411
|
+
* Easy way to connect CLI commands to cli class methods.
|
|
2412
|
+
*
|
|
2413
|
+
* Example:
|
|
2414
|
+
* in clic class
|
|
2415
|
+
* $FirstCli {
|
|
2416
|
+
*
|
|
2417
|
+
* @UtilsCliMethod.decorator('doSomething')
|
|
2418
|
+
* doSomething() {
|
|
2419
|
+
* console.log('doing something');
|
|
2420
|
+
* }
|
|
2421
|
+
* }
|
|
2422
|
+
*
|
|
2423
|
+
* UtilsCliMethod.getFrom($FirstCli.prototype.doSomething) // "firstcli:dosomething"
|
|
2424
|
+
*
|
|
2425
|
+
*/
|
|
2426
|
+
var UtilsCliMethod;
|
|
2427
|
+
(function (UtilsCliMethod) {
|
|
2428
|
+
const CLI_METHOD_KEY = Symbol('cliMethod');
|
|
2429
|
+
UtilsCliMethod.decorator = (methodName) => {
|
|
2430
|
+
return (target, propertyKey, descriptor) => {
|
|
2431
|
+
// If name not given, fallback to property key
|
|
2432
|
+
Reflect.defineMetadata(CLI_METHOD_KEY, `${_.camelCase(CLASS.getName(target?.constructor)).toLowerCase()}` +
|
|
2433
|
+
`:${_.camelCase(methodName ?? propertyKey).toLowerCase()}`, descriptor.value);
|
|
2434
|
+
};
|
|
2435
|
+
};
|
|
2436
|
+
UtilsCliMethod.getFrom = (ClassPrototypeMethodFnHere, globalMethod = false) => {
|
|
2437
|
+
const fullCliMethodName = Reflect.getMetadata(CLI_METHOD_KEY, ClassPrototypeMethodFnHere);
|
|
2438
|
+
if (globalMethod) {
|
|
2439
|
+
return fullCliMethodName.split(':')[1];
|
|
2440
|
+
}
|
|
2441
|
+
return fullCliMethodName;
|
|
2442
|
+
};
|
|
2443
|
+
})(UtilsCliMethod || (UtilsCliMethod = {}));
|
|
2444
|
+
//#endregion
|
|
2582
2445
|
|
|
2583
2446
|
class HelpersArrayObj {
|
|
2584
2447
|
from(s) {
|
|
@@ -5446,7 +5309,9 @@ class BaseCliWorkerTerminalUI {
|
|
|
5446
5309
|
async infoScreen(options) {
|
|
5447
5310
|
options = options || {};
|
|
5448
5311
|
while (true) {
|
|
5449
|
-
|
|
5312
|
+
if (!UtilsTerminal.isVerboseModeTaon()) {
|
|
5313
|
+
UtilsTerminal.clearConsole();
|
|
5314
|
+
}
|
|
5450
5315
|
await this.header();
|
|
5451
5316
|
await this.infoMessageBelowHeader();
|
|
5452
5317
|
const choices = this.getWorkerTerminalActions(options);
|
|
@@ -5474,6 +5339,20 @@ const WORKER_INIT_START_TIME_LIMIT = 25; // 15 seconds max to start worker
|
|
|
5474
5339
|
const START_PORT_FOR_SERVICES = 3600;
|
|
5475
5340
|
//#endregion
|
|
5476
5341
|
class BaseCliWorker {
|
|
5342
|
+
// private workerRemoteContextFor: {
|
|
5343
|
+
// [ipAddressOfTaonInstance: string]: ReturnType<typeof Taon.createContext>;
|
|
5344
|
+
// } = {};
|
|
5345
|
+
async getRemoteControllerFor(ipAddressOfTaonInstance, port) {
|
|
5346
|
+
// this.workerRemoteContextFor[ipAddressOfTaonInstance] = remoteCtx;
|
|
5347
|
+
const useHttps = ipAddressOfTaonInstance !== CoreModels.localhostIp127;
|
|
5348
|
+
const protocol = useHttps ? 'https' : 'http';
|
|
5349
|
+
const remoteCtx = this.workerContextTemplate().cloneAsRemote({
|
|
5350
|
+
overrideRemoteHost: `${protocol}://${ipAddressOfTaonInstance}${port ? `:${port}` : ''}`,
|
|
5351
|
+
});
|
|
5352
|
+
const contextForRemoteConnection = await remoteCtx.initialize();
|
|
5353
|
+
const taonProjectsController = contextForRemoteConnection.getInstanceBy(this.controllerClass);
|
|
5354
|
+
return taonProjectsController;
|
|
5355
|
+
}
|
|
5477
5356
|
//#region fields & getters / path to process local info
|
|
5478
5357
|
get pathToProcessLocalInfoJson() {
|
|
5479
5358
|
/* */
|
|
@@ -5517,7 +5396,7 @@ class BaseCliWorker {
|
|
|
5517
5396
|
this.startCommand = startCommand;
|
|
5518
5397
|
this.serviceVersion = serviceVersion;
|
|
5519
5398
|
//#region fields & getters
|
|
5520
|
-
this.SPECIAL_WORKER_READY_MESSAGE =
|
|
5399
|
+
this.SPECIAL_WORKER_READY_MESSAGE = CoreModels.SPECIAL_WORKER_READY_MESSAGE;
|
|
5521
5400
|
// @ts-ignore TODO weird inheritance problem
|
|
5522
5401
|
this.terminalUI = new BaseCliWorkerTerminalUI(this);
|
|
5523
5402
|
}
|
|
@@ -5529,7 +5408,12 @@ class BaseCliWorker {
|
|
|
5529
5408
|
* start normally process
|
|
5530
5409
|
* this will crash if process already started
|
|
5531
5410
|
*/
|
|
5532
|
-
async startNormallyInCurrentProcess() {
|
|
5411
|
+
async startNormallyInCurrentProcess(options) {
|
|
5412
|
+
/* */
|
|
5413
|
+
/* */
|
|
5414
|
+
/* */
|
|
5415
|
+
/* */
|
|
5416
|
+
/* */
|
|
5533
5417
|
/* */
|
|
5534
5418
|
/* */
|
|
5535
5419
|
/* */
|
|
@@ -5686,6 +5570,7 @@ class BaseCliWorker {
|
|
|
5686
5570
|
/* */
|
|
5687
5571
|
/* */
|
|
5688
5572
|
/* */
|
|
5573
|
+
/* */
|
|
5689
5574
|
return (void 0);
|
|
5690
5575
|
}
|
|
5691
5576
|
//#endregion
|
|
@@ -5760,6 +5645,8 @@ class BaseCliWorker {
|
|
|
5760
5645
|
/* */
|
|
5761
5646
|
/* */
|
|
5762
5647
|
/* */
|
|
5648
|
+
/* */
|
|
5649
|
+
/* */
|
|
5763
5650
|
return (void 0);
|
|
5764
5651
|
}
|
|
5765
5652
|
//#endregion
|
|
@@ -5964,6 +5851,8 @@ class BaseCliWorker {
|
|
|
5964
5851
|
/* */
|
|
5965
5852
|
/* */
|
|
5966
5853
|
/* */
|
|
5854
|
+
/* */
|
|
5855
|
+
/* */
|
|
5967
5856
|
return (void 0);
|
|
5968
5857
|
}
|
|
5969
5858
|
//#endregion
|
|
@@ -6001,6 +5890,7 @@ class BaseCliWorker {
|
|
|
6001
5890
|
/* */
|
|
6002
5891
|
/* */
|
|
6003
5892
|
/* */
|
|
5893
|
+
/* */
|
|
6004
5894
|
return (void 0);
|
|
6005
5895
|
}
|
|
6006
5896
|
//#endregion
|
|
@@ -6992,7 +6882,7 @@ const PROJECT_NPM_NAME = 'tnp-helpers';
|
|
|
6992
6882
|
/**
|
|
6993
6883
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
6994
6884
|
*/
|
|
6995
|
-
const CURRENT_PACKAGE_VERSION = '19.0.
|
|
6885
|
+
const CURRENT_PACKAGE_VERSION = '19.0.54';
|
|
6996
6886
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
6997
6887
|
|
|
6998
6888
|
//#endregion
|
|
@@ -7387,6 +7277,9 @@ class BaseProject {
|
|
|
7387
7277
|
/* */
|
|
7388
7278
|
/* */
|
|
7389
7279
|
/* */
|
|
7280
|
+
/* */
|
|
7281
|
+
/* */
|
|
7282
|
+
/* */
|
|
7390
7283
|
//#endregion
|
|
7391
7284
|
//#region methods & getters / is monorepo
|
|
7392
7285
|
/**
|
|
@@ -12244,6 +12137,10 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
12244
12137
|
resetIsRestingAlsoChildren() {
|
|
12245
12138
|
return true;
|
|
12246
12139
|
}
|
|
12140
|
+
//#endregion
|
|
12141
|
+
useBranchNameDirectlyAsCommitMessage() {
|
|
12142
|
+
return false;
|
|
12143
|
+
}
|
|
12247
12144
|
}
|
|
12248
12145
|
|
|
12249
12146
|
//#endregion
|
|
@@ -12566,7 +12463,10 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
12566
12463
|
await this.recreateBaseSettings();
|
|
12567
12464
|
this.recreateWindowTitle();
|
|
12568
12465
|
if (!options.skipHiddingTempFiles) {
|
|
12569
|
-
this.toogleFilesVisibilityInVscode({
|
|
12466
|
+
this.toogleFilesVisibilityInVscode({
|
|
12467
|
+
action: 'hide-files',
|
|
12468
|
+
skipSaving: true,
|
|
12469
|
+
});
|
|
12570
12470
|
}
|
|
12571
12471
|
this.saveCurrentSettings();
|
|
12572
12472
|
}
|
|
@@ -13216,6 +13116,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
13216
13116
|
/* */
|
|
13217
13117
|
/* */
|
|
13218
13118
|
/* */
|
|
13119
|
+
/* */
|
|
13120
|
+
/* */
|
|
13219
13121
|
return (void 0);
|
|
13220
13122
|
}
|
|
13221
13123
|
//#endregion
|
|
@@ -13298,6 +13200,7 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
13298
13200
|
'.vscode': true,
|
|
13299
13201
|
browser: true,
|
|
13300
13202
|
dist: true,
|
|
13203
|
+
['dist-*']: true,
|
|
13301
13204
|
'package-lock.json': true,
|
|
13302
13205
|
'tmp-*': true,
|
|
13303
13206
|
'src/lib/env/**/*.*': true,
|
|
@@ -16761,5 +16664,5 @@ const Helpers = HelpersTaon.Instance;
|
|
|
16761
16664
|
* Generated bundle index. Do not edit.
|
|
16762
16665
|
*/
|
|
16763
16666
|
|
|
16764
|
-
export { BaseCliWorker, BaseCliWorkerConfig, BaseCliWorkerController, BaseCliWorkerTerminalUI, BaseCommandLineFeature, BaseCompilerForProject, BaseDebounceCompilerForProject, BaseFeatureForProject, BaseFileFoldersOperations, BaseGit, BaseIgnoreHideHelpers, BaseJsonFileReader, BaseLibraryBuild, BaseLinkedProjects, BaseLinter, BaseNodeModules, BaseNpmHelpers, BasePackageJson, BaseProcessManger, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseQuickFixes, BaseReleaseProcess, BaseVscodeHelpers, CommandConfig, CommandProcess, CommandProcessState, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, PackageJsonDependencyObjArr, Port, PortStatusArr, PortsController, PortsWorker, ProgressData,
|
|
16667
|
+
export { BaseCliWorker, BaseCliWorkerConfig, BaseCliWorkerController, BaseCliWorkerTerminalUI, BaseCommandLineFeature, BaseCompilerForProject, BaseDebounceCompilerForProject, BaseFeatureForProject, BaseFileFoldersOperations, BaseGit, BaseIgnoreHideHelpers, BaseJsonFileReader, BaseLibraryBuild, BaseLinkedProjects, BaseLinter, BaseNodeModules, BaseNpmHelpers, BasePackageJson, BaseProcessManger, BaseProject, BaseProjectResolver, BaseProjectTypeArr, BaseQuickFixes, BaseReleaseProcess, BaseVscodeHelpers, CommandConfig, CommandProcess, CommandProcessState, CommitData, CoreAngularProject, CoreProject, CoreTypescriptProject, FilePathMetaData, Helpers, HelpersAngular, LinkedPorjectsConfig, LinkedProject, PackageJsonDependencyObjArr, Port, PortStatusArr, PortsController, PortsWorker, ProgressData, UtilsCliMethod, UtilsHttp, UtilsJava, UtilsMd, UtilsNpm, UtilsPasswords, UtilsQuickFixes, UtilsTaonWorker, UtilsTypescript, UtilsVSCode, UtilsZip, UtilsZipBrowser, executeCommand, getBaseCliWorkerDatabaseConfig };
|
|
16765
16668
|
//# sourceMappingURL=tnp-helpers.mjs.map
|