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,9 +1,9 @@
|
|
|
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/websql';
|
|
3
3
|
import { isImportDeclaration, isNamedImports, isExportDeclaration, isNamedExports, createSourceFile, ScriptTarget, ScriptKind } from 'typescript';
|
|
4
|
+
import { CLASS } from 'typescript-class-helpers/websql';
|
|
4
5
|
import * as fuzzy from 'fuzzy';
|
|
5
6
|
import { Level } from 'ng2-logger/websql';
|
|
6
|
-
import { CLASS } from 'typescript-class-helpers/websql';
|
|
7
7
|
import { __decorate, __metadata, __param } from 'tslib';
|
|
8
8
|
import { Taon, BaseContext } from 'taon/websql';
|
|
9
9
|
import { config, folderName, fileName } from 'tnp-config/websql';
|
|
@@ -1513,6 +1513,8 @@ var UtilsQuickFixes;
|
|
|
1513
1513
|
/* */
|
|
1514
1514
|
/* */
|
|
1515
1515
|
/* */
|
|
1516
|
+
/* */
|
|
1517
|
+
/* */
|
|
1516
1518
|
return (void 0);
|
|
1517
1519
|
};
|
|
1518
1520
|
})(UtilsQuickFixes || (UtilsQuickFixes = {}));
|
|
@@ -1619,263 +1621,6 @@ var UtilsVSCode;
|
|
|
1619
1621
|
};
|
|
1620
1622
|
})(UtilsVSCode || (UtilsVSCode = {}));
|
|
1621
1623
|
//#endregion
|
|
1622
|
-
//#region utils dot file
|
|
1623
|
-
var UtilsDotFile;
|
|
1624
|
-
(function (UtilsDotFile) {
|
|
1625
|
-
//#region parse value from dot file util
|
|
1626
|
-
const parseValue = (rawValue) => {
|
|
1627
|
-
const val = rawValue.trim().replace(/^"|"$/g, '');
|
|
1628
|
-
// Try boolean
|
|
1629
|
-
if (val.toLowerCase() === 'true')
|
|
1630
|
-
return true;
|
|
1631
|
-
if (val.toLowerCase() === 'false')
|
|
1632
|
-
return false;
|
|
1633
|
-
// Try number
|
|
1634
|
-
if (!isNaN(Number(val)) && val !== '')
|
|
1635
|
-
return Number(val);
|
|
1636
|
-
return val;
|
|
1637
|
-
};
|
|
1638
|
-
//#endregion
|
|
1639
|
-
//#region set value to/from dot file
|
|
1640
|
-
UtilsDotFile.setValueToDotFile = (dotFileAbsPath, key, value) => {
|
|
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
|
-
return (void 0);
|
|
1673
|
-
};
|
|
1674
|
-
//#endregion
|
|
1675
|
-
//#region set comment to key in dot file
|
|
1676
|
-
UtilsDotFile.setCommentToKeyInDotFile = (dotFileAbsPath, key, comment) => {
|
|
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
|
-
return (void 0);
|
|
1710
|
-
};
|
|
1711
|
-
//#endregion
|
|
1712
|
-
//#region get value from dot file
|
|
1713
|
-
UtilsDotFile.getValueFromDotFile = (dotFileAbsPath, key) => {
|
|
1714
|
-
/* */
|
|
1715
|
-
/* */
|
|
1716
|
-
/* */
|
|
1717
|
-
/* */
|
|
1718
|
-
/* */
|
|
1719
|
-
/* */
|
|
1720
|
-
/* */
|
|
1721
|
-
/* */
|
|
1722
|
-
/* */
|
|
1723
|
-
/* */
|
|
1724
|
-
/* */
|
|
1725
|
-
/* */
|
|
1726
|
-
/* */
|
|
1727
|
-
/* */
|
|
1728
|
-
/* */
|
|
1729
|
-
/* */
|
|
1730
|
-
/* */
|
|
1731
|
-
/* */
|
|
1732
|
-
/* */
|
|
1733
|
-
/* */
|
|
1734
|
-
/* */
|
|
1735
|
-
/* */
|
|
1736
|
-
return (void 0);
|
|
1737
|
-
};
|
|
1738
|
-
//#endregion
|
|
1739
|
-
//#region set values keys from object
|
|
1740
|
-
UtilsDotFile.setValuesKeysFromObject = (dotFileAbsPath, obj, options) => {
|
|
1741
|
-
/* */
|
|
1742
|
-
/* */
|
|
1743
|
-
/* */
|
|
1744
|
-
/* */
|
|
1745
|
-
/* */
|
|
1746
|
-
/* */
|
|
1747
|
-
/* */
|
|
1748
|
-
/* */
|
|
1749
|
-
/* */
|
|
1750
|
-
/* */
|
|
1751
|
-
/* */
|
|
1752
|
-
/* */
|
|
1753
|
-
/* */
|
|
1754
|
-
/* */
|
|
1755
|
-
/* */
|
|
1756
|
-
/* */
|
|
1757
|
-
/* */
|
|
1758
|
-
/* */
|
|
1759
|
-
/* */
|
|
1760
|
-
/* */
|
|
1761
|
-
/* */
|
|
1762
|
-
/* */
|
|
1763
|
-
/* */
|
|
1764
|
-
return (void 0);
|
|
1765
|
-
};
|
|
1766
|
-
//#endregion
|
|
1767
|
-
//#region get values keys as json object
|
|
1768
|
-
UtilsDotFile.getValuesKeysAsJsonObject = (dotFileAbsPath) => {
|
|
1769
|
-
/* */
|
|
1770
|
-
/* */
|
|
1771
|
-
/* */
|
|
1772
|
-
/* */
|
|
1773
|
-
/* */
|
|
1774
|
-
/* */
|
|
1775
|
-
/* */
|
|
1776
|
-
/* */
|
|
1777
|
-
/* */
|
|
1778
|
-
/* */
|
|
1779
|
-
/* */
|
|
1780
|
-
/* */
|
|
1781
|
-
/* */
|
|
1782
|
-
/* */
|
|
1783
|
-
/* */
|
|
1784
|
-
/* */
|
|
1785
|
-
/* */
|
|
1786
|
-
/* */
|
|
1787
|
-
/* */
|
|
1788
|
-
/* */
|
|
1789
|
-
/* */
|
|
1790
|
-
/* */
|
|
1791
|
-
return (void 0);
|
|
1792
|
-
};
|
|
1793
|
-
//#endregion
|
|
1794
|
-
//#region get comments keys as json object
|
|
1795
|
-
/**
|
|
1796
|
-
* @returns key|comment pairs as json object
|
|
1797
|
-
*/
|
|
1798
|
-
UtilsDotFile.getCommentsKeysAsJsonObject = (dotFileAbsPath) => {
|
|
1799
|
-
/* */
|
|
1800
|
-
/* */
|
|
1801
|
-
/* */
|
|
1802
|
-
/* */
|
|
1803
|
-
/* */
|
|
1804
|
-
/* */
|
|
1805
|
-
/* */
|
|
1806
|
-
/* */
|
|
1807
|
-
/* */
|
|
1808
|
-
/* */
|
|
1809
|
-
/* */
|
|
1810
|
-
/* */
|
|
1811
|
-
/* */
|
|
1812
|
-
/* */
|
|
1813
|
-
/* */
|
|
1814
|
-
/* */
|
|
1815
|
-
/* */
|
|
1816
|
-
/* */
|
|
1817
|
-
/* */
|
|
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
|
-
return (void 0);
|
|
1875
|
-
};
|
|
1876
|
-
//#endregion
|
|
1877
|
-
})(UtilsDotFile || (UtilsDotFile = {}));
|
|
1878
|
-
//#endregion
|
|
1879
1624
|
//#region utils zip browser
|
|
1880
1625
|
var UtilsZipBrowser;
|
|
1881
1626
|
(function (UtilsZipBrowser) {
|
|
@@ -2082,6 +1827,10 @@ var UtilsZip;
|
|
|
2082
1827
|
/* */
|
|
2083
1828
|
/* */
|
|
2084
1829
|
/* */
|
|
1830
|
+
/* */
|
|
1831
|
+
/* */
|
|
1832
|
+
/* */
|
|
1833
|
+
/* */
|
|
2085
1834
|
return (void 0);
|
|
2086
1835
|
};
|
|
2087
1836
|
// Unzip: `/some/path/folder.zip` → `/some/path/folder`
|
|
@@ -2560,6 +2309,120 @@ var UtilsPasswords;
|
|
|
2560
2309
|
// })();
|
|
2561
2310
|
})(UtilsPasswords || (UtilsPasswords = {}));
|
|
2562
2311
|
//#endregion
|
|
2312
|
+
//#region utils filepath metadata
|
|
2313
|
+
var FilePathMetaData;
|
|
2314
|
+
(function (FilePathMetaData) {
|
|
2315
|
+
const TERMINATOR = 'xxxxx'; // terminates metadata block
|
|
2316
|
+
const KV_SEPARATOR = '...'; // key/value separator
|
|
2317
|
+
const PAIR_SEPARATOR = 'IxIxI'; // between pairs
|
|
2318
|
+
//#region embed data into filename
|
|
2319
|
+
/**
|
|
2320
|
+
* Embed metadata into filename while preserving the extension.
|
|
2321
|
+
*
|
|
2322
|
+
* Example:
|
|
2323
|
+
* embedData({ version: "1.2.3", envName: "__" }, "project.zip")
|
|
2324
|
+
* -> "version|-|1.2.3||--||envName|-|__|||project.zip"
|
|
2325
|
+
*/
|
|
2326
|
+
function embedData(data, orgFilename, options) {
|
|
2327
|
+
options = options || {};
|
|
2328
|
+
const ext = path.extname(orgFilename);
|
|
2329
|
+
const base = path.basename(orgFilename, ext);
|
|
2330
|
+
const meta = Object.entries(data)
|
|
2331
|
+
.map(([key, value]) => `${key}${KV_SEPARATOR}${value ?? ''}`)
|
|
2332
|
+
.join(PAIR_SEPARATOR);
|
|
2333
|
+
return `${meta}${TERMINATOR}${options.skipAddingBasenameAtEnd ? '' : base}${ext}`;
|
|
2334
|
+
}
|
|
2335
|
+
FilePathMetaData.embedData = embedData;
|
|
2336
|
+
//#endregion
|
|
2337
|
+
//#region extract data from filename
|
|
2338
|
+
/**
|
|
2339
|
+
* Extract metadata from filename (reverse of embedData).
|
|
2340
|
+
*
|
|
2341
|
+
* Example:
|
|
2342
|
+
* extractData<{ version: string; env: string }>("myfile__version-1.2.3__env-prod.zip")
|
|
2343
|
+
* -> { version: "1.2.3", env: "prod" }
|
|
2344
|
+
*/
|
|
2345
|
+
function extractData(filename) {
|
|
2346
|
+
const ext = path.extname(filename);
|
|
2347
|
+
const thereIsNoExt = ext.includes('|') || ext.includes('-');
|
|
2348
|
+
const base = thereIsNoExt ? filename : path.basename(filename, ext);
|
|
2349
|
+
// Everything BEFORE the FIRST TERMINATOR
|
|
2350
|
+
const idx = base.lastIndexOf(TERMINATOR);
|
|
2351
|
+
const metaPart = idx >= 0 ? base.substring(0, idx) : base;
|
|
2352
|
+
const data = {};
|
|
2353
|
+
let cursor = 0;
|
|
2354
|
+
while (cursor <= metaPart.length) {
|
|
2355
|
+
const sepIdx = metaPart.indexOf(PAIR_SEPARATOR, cursor);
|
|
2356
|
+
const segment = sepIdx === -1
|
|
2357
|
+
? metaPart.substring(cursor)
|
|
2358
|
+
: metaPart.substring(cursor, sepIdx);
|
|
2359
|
+
if (segment) {
|
|
2360
|
+
const kvIdx = segment.indexOf(KV_SEPARATOR);
|
|
2361
|
+
if (kvIdx > -1) {
|
|
2362
|
+
const key = segment.substring(0, kvIdx);
|
|
2363
|
+
const value = segment.substring(kvIdx + KV_SEPARATOR.length);
|
|
2364
|
+
data[key] = value;
|
|
2365
|
+
}
|
|
2366
|
+
}
|
|
2367
|
+
if (sepIdx === -1)
|
|
2368
|
+
break;
|
|
2369
|
+
cursor = sepIdx + PAIR_SEPARATOR.length;
|
|
2370
|
+
}
|
|
2371
|
+
return data;
|
|
2372
|
+
}
|
|
2373
|
+
FilePathMetaData.extractData = extractData;
|
|
2374
|
+
//#endregion
|
|
2375
|
+
//#region get only metadata string
|
|
2376
|
+
FilePathMetaData.getOnlyMetadataString = (filename) => {
|
|
2377
|
+
const ext = path.extname(filename);
|
|
2378
|
+
const base = path.basename(filename, ext);
|
|
2379
|
+
const idx = base.lastIndexOf(TERMINATOR);
|
|
2380
|
+
if (idx === -1)
|
|
2381
|
+
return ''; // no terminator
|
|
2382
|
+
const metaPart = base.substring(0, idx);
|
|
2383
|
+
if (!metaPart.trim())
|
|
2384
|
+
return ''; // empty metadata
|
|
2385
|
+
return metaPart;
|
|
2386
|
+
};
|
|
2387
|
+
//#endregion
|
|
2388
|
+
})(FilePathMetaData || (FilePathMetaData = {}));
|
|
2389
|
+
//#endregion
|
|
2390
|
+
//#region utils cli
|
|
2391
|
+
/**
|
|
2392
|
+
* Easy way to connect CLI commands to cli class methods.
|
|
2393
|
+
*
|
|
2394
|
+
* Example:
|
|
2395
|
+
* in clic class
|
|
2396
|
+
* $FirstCli {
|
|
2397
|
+
*
|
|
2398
|
+
* @UtilsCliMethod.decorator('doSomething')
|
|
2399
|
+
* doSomething() {
|
|
2400
|
+
* console.log('doing something');
|
|
2401
|
+
* }
|
|
2402
|
+
* }
|
|
2403
|
+
*
|
|
2404
|
+
* UtilsCliMethod.getFrom($FirstCli.prototype.doSomething) // "firstcli:dosomething"
|
|
2405
|
+
*
|
|
2406
|
+
*/
|
|
2407
|
+
var UtilsCliMethod;
|
|
2408
|
+
(function (UtilsCliMethod) {
|
|
2409
|
+
const CLI_METHOD_KEY = Symbol('cliMethod');
|
|
2410
|
+
UtilsCliMethod.decorator = (methodName) => {
|
|
2411
|
+
return (target, propertyKey, descriptor) => {
|
|
2412
|
+
// If name not given, fallback to property key
|
|
2413
|
+
Reflect.defineMetadata(CLI_METHOD_KEY, `${_.camelCase(CLASS.getName(target?.constructor)).toLowerCase()}` +
|
|
2414
|
+
`:${_.camelCase(methodName ?? propertyKey).toLowerCase()}`, descriptor.value);
|
|
2415
|
+
};
|
|
2416
|
+
};
|
|
2417
|
+
UtilsCliMethod.getFrom = (ClassPrototypeMethodFnHere, globalMethod = false) => {
|
|
2418
|
+
const fullCliMethodName = Reflect.getMetadata(CLI_METHOD_KEY, ClassPrototypeMethodFnHere);
|
|
2419
|
+
if (globalMethod) {
|
|
2420
|
+
return fullCliMethodName.split(':')[1];
|
|
2421
|
+
}
|
|
2422
|
+
return fullCliMethodName;
|
|
2423
|
+
};
|
|
2424
|
+
})(UtilsCliMethod || (UtilsCliMethod = {}));
|
|
2425
|
+
//#endregion
|
|
2563
2426
|
|
|
2564
2427
|
class HelpersArrayObj {
|
|
2565
2428
|
from(s) {
|
|
@@ -5458,7 +5321,9 @@ class BaseCliWorkerTerminalUI {
|
|
|
5458
5321
|
async infoScreen(options) {
|
|
5459
5322
|
options = options || {};
|
|
5460
5323
|
while (true) {
|
|
5461
|
-
|
|
5324
|
+
if (!UtilsTerminal.isVerboseModeTaon()) {
|
|
5325
|
+
UtilsTerminal.clearConsole();
|
|
5326
|
+
}
|
|
5462
5327
|
await this.header();
|
|
5463
5328
|
await this.infoMessageBelowHeader();
|
|
5464
5329
|
const choices = this.getWorkerTerminalActions(options);
|
|
@@ -5486,6 +5351,20 @@ const WORKER_INIT_START_TIME_LIMIT = 25; // 15 seconds max to start worker
|
|
|
5486
5351
|
const START_PORT_FOR_SERVICES = 3600;
|
|
5487
5352
|
//#endregion
|
|
5488
5353
|
class BaseCliWorker {
|
|
5354
|
+
// private workerRemoteContextFor: {
|
|
5355
|
+
// [ipAddressOfTaonInstance: string]: ReturnType<typeof Taon.createContext>;
|
|
5356
|
+
// } = {};
|
|
5357
|
+
async getRemoteControllerFor(ipAddressOfTaonInstance, port) {
|
|
5358
|
+
// this.workerRemoteContextFor[ipAddressOfTaonInstance] = remoteCtx;
|
|
5359
|
+
const useHttps = ipAddressOfTaonInstance !== CoreModels.localhostIp127;
|
|
5360
|
+
const protocol = useHttps ? 'https' : 'http';
|
|
5361
|
+
const remoteCtx = this.workerContextTemplate().cloneAsRemote({
|
|
5362
|
+
overrideRemoteHost: `${protocol}://${ipAddressOfTaonInstance}${port ? `:${port}` : ''}`,
|
|
5363
|
+
});
|
|
5364
|
+
const contextForRemoteConnection = await remoteCtx.initialize();
|
|
5365
|
+
const taonProjectsController = contextForRemoteConnection.getInstanceBy(this.controllerClass);
|
|
5366
|
+
return taonProjectsController;
|
|
5367
|
+
}
|
|
5489
5368
|
//#region fields & getters / path to process local info
|
|
5490
5369
|
get pathToProcessLocalInfoJson() {
|
|
5491
5370
|
/* */
|
|
@@ -5529,7 +5408,7 @@ class BaseCliWorker {
|
|
|
5529
5408
|
this.startCommand = startCommand;
|
|
5530
5409
|
this.serviceVersion = serviceVersion;
|
|
5531
5410
|
//#region fields & getters
|
|
5532
|
-
this.SPECIAL_WORKER_READY_MESSAGE =
|
|
5411
|
+
this.SPECIAL_WORKER_READY_MESSAGE = CoreModels.SPECIAL_WORKER_READY_MESSAGE;
|
|
5533
5412
|
// @ts-ignore TODO weird inheritance problem
|
|
5534
5413
|
this.terminalUI = new BaseCliWorkerTerminalUI(this);
|
|
5535
5414
|
}
|
|
@@ -5541,7 +5420,12 @@ class BaseCliWorker {
|
|
|
5541
5420
|
* start normally process
|
|
5542
5421
|
* this will crash if process already started
|
|
5543
5422
|
*/
|
|
5544
|
-
async startNormallyInCurrentProcess() {
|
|
5423
|
+
async startNormallyInCurrentProcess(options) {
|
|
5424
|
+
/* */
|
|
5425
|
+
/* */
|
|
5426
|
+
/* */
|
|
5427
|
+
/* */
|
|
5428
|
+
/* */
|
|
5545
5429
|
/* */
|
|
5546
5430
|
/* */
|
|
5547
5431
|
/* */
|
|
@@ -5698,6 +5582,7 @@ class BaseCliWorker {
|
|
|
5698
5582
|
/* */
|
|
5699
5583
|
/* */
|
|
5700
5584
|
/* */
|
|
5585
|
+
/* */
|
|
5701
5586
|
return (void 0);
|
|
5702
5587
|
}
|
|
5703
5588
|
//#endregion
|
|
@@ -5772,6 +5657,8 @@ class BaseCliWorker {
|
|
|
5772
5657
|
/* */
|
|
5773
5658
|
/* */
|
|
5774
5659
|
/* */
|
|
5660
|
+
/* */
|
|
5661
|
+
/* */
|
|
5775
5662
|
return (void 0);
|
|
5776
5663
|
}
|
|
5777
5664
|
//#endregion
|
|
@@ -5976,6 +5863,8 @@ class BaseCliWorker {
|
|
|
5976
5863
|
/* */
|
|
5977
5864
|
/* */
|
|
5978
5865
|
/* */
|
|
5866
|
+
/* */
|
|
5867
|
+
/* */
|
|
5979
5868
|
return (void 0);
|
|
5980
5869
|
}
|
|
5981
5870
|
//#endregion
|
|
@@ -6013,6 +5902,7 @@ class BaseCliWorker {
|
|
|
6013
5902
|
/* */
|
|
6014
5903
|
/* */
|
|
6015
5904
|
/* */
|
|
5905
|
+
/* */
|
|
6016
5906
|
return (void 0);
|
|
6017
5907
|
}
|
|
6018
5908
|
//#endregion
|
|
@@ -7004,7 +6894,7 @@ const PROJECT_NPM_NAME = 'tnp-helpers';
|
|
|
7004
6894
|
/**
|
|
7005
6895
|
* Autogenerated by current cli tool. Use *tnp release* to bump version.
|
|
7006
6896
|
*/
|
|
7007
|
-
const CURRENT_PACKAGE_VERSION = '19.0.
|
|
6897
|
+
const CURRENT_PACKAGE_VERSION = '19.0.54';
|
|
7008
6898
|
// THIS FILE IS GENERATED - DO NOT MODIFY
|
|
7009
6899
|
|
|
7010
6900
|
//#endregion
|
|
@@ -7392,6 +7282,9 @@ class BaseProject {
|
|
|
7392
7282
|
/* */
|
|
7393
7283
|
/* */
|
|
7394
7284
|
/* */
|
|
7285
|
+
/* */
|
|
7286
|
+
/* */
|
|
7287
|
+
/* */
|
|
7395
7288
|
//#endregion
|
|
7396
7289
|
//#region methods & getters / is monorepo
|
|
7397
7290
|
/**
|
|
@@ -12238,6 +12131,10 @@ class BaseGit extends BaseFeatureForProject {
|
|
|
12238
12131
|
resetIsRestingAlsoChildren() {
|
|
12239
12132
|
return true;
|
|
12240
12133
|
}
|
|
12134
|
+
//#endregion
|
|
12135
|
+
useBranchNameDirectlyAsCommitMessage() {
|
|
12136
|
+
return false;
|
|
12137
|
+
}
|
|
12241
12138
|
}
|
|
12242
12139
|
|
|
12243
12140
|
//#endregion
|
|
@@ -12560,7 +12457,10 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
12560
12457
|
await this.recreateBaseSettings();
|
|
12561
12458
|
this.recreateWindowTitle();
|
|
12562
12459
|
if (!options.skipHiddingTempFiles) {
|
|
12563
|
-
this.toogleFilesVisibilityInVscode({
|
|
12460
|
+
this.toogleFilesVisibilityInVscode({
|
|
12461
|
+
action: 'hide-files',
|
|
12462
|
+
skipSaving: true,
|
|
12463
|
+
});
|
|
12564
12464
|
}
|
|
12565
12465
|
this.saveCurrentSettings();
|
|
12566
12466
|
}
|
|
@@ -13210,6 +13110,8 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
13210
13110
|
/* */
|
|
13211
13111
|
/* */
|
|
13212
13112
|
/* */
|
|
13113
|
+
/* */
|
|
13114
|
+
/* */
|
|
13213
13115
|
return (void 0);
|
|
13214
13116
|
}
|
|
13215
13117
|
//#endregion
|
|
@@ -13292,6 +13194,7 @@ class BaseVscodeHelpers extends BaseFeatureForProject {
|
|
|
13292
13194
|
'.vscode': true,
|
|
13293
13195
|
browser: true,
|
|
13294
13196
|
dist: true,
|
|
13197
|
+
['dist-*']: true,
|
|
13295
13198
|
'package-lock.json': true,
|
|
13296
13199
|
'tmp-*': true,
|
|
13297
13200
|
'src/lib/env/**/*.*': true,
|
|
@@ -16755,5 +16658,5 @@ const Helpers = HelpersTaon.Instance;
|
|
|
16755
16658
|
* Generated bundle index. Do not edit.
|
|
16756
16659
|
*/
|
|
16757
16660
|
|
|
16758
|
-
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,
|
|
16661
|
+
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 };
|
|
16759
16662
|
//# sourceMappingURL=tnp-helpers.mjs.map
|