tnp-helpers 16.0.9 → 16.0.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.
- package/assets/shared/shared_folder_info.txt +1 -1
- package/browser/esm2022/lib/base-project.mjs +309 -0
- package/browser/esm2022/lib/index.mjs +2 -1
- package/browser/esm2022/lib/project.mjs +6 -1
- package/browser/fesm2022/tnp-helpers.mjs +315 -3
- package/browser/fesm2022/tnp-helpers.mjs.map +1 -1
- package/browser/lib/base-project.d.ts +55 -0
- package/browser/lib/index.d.ts +1 -0
- package/browser/lib/project.d.ts +5 -0
- package/client/esm2022/lib/base-project.mjs +309 -0
- package/client/esm2022/lib/index.mjs +2 -1
- package/client/esm2022/lib/project.mjs +6 -1
- package/client/fesm2022/tnp-helpers.mjs +315 -3
- package/client/fesm2022/tnp-helpers.mjs.map +1 -1
- package/client/lib/base-project.d.ts +55 -0
- package/client/lib/index.d.ts +1 -0
- package/client/lib/project.d.ts +5 -0
- package/client/package.json +17 -10
- package/lib/base-project.d.ts +64 -0
- package/lib/base-project.js +365 -0
- package/lib/base-project.js.map +1 -0
- package/lib/for-backend/helpers-file-folders.backend.d.ts +6 -0
- package/lib/for-backend/helpers-file-folders.backend.js +12 -1
- package/lib/for-backend/helpers-file-folders.backend.js.map +1 -1
- package/lib/for-backend/helpers-git.backend.js +9 -0
- package/lib/for-backend/helpers-git.backend.js.map +1 -1
- package/lib/for-browser/angular.helper.js +3 -3
- package/lib/git-project.d.ts +2 -1
- package/lib/git-project.js +3 -0
- package/lib/git-project.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/lib/old/base-component.js +3 -3
- package/lib/old/base-formly-component.js +3 -3
- package/lib/old/dual-component-ctrl.js +3 -3
- package/lib/project.d.ts +5 -0
- package/lib/project.js +5 -0
- package/lib/project.js.map +1 -1
- package/package.json +3 -3
- package/tmp-environment.json +21 -14
- package/websql/esm2022/lib/base-project.mjs +296 -0
- package/websql/esm2022/lib/index.mjs +2 -1
- package/websql/esm2022/lib/project.mjs +6 -1
- package/websql/fesm2022/tnp-helpers.mjs +301 -4
- package/websql/fesm2022/tnp-helpers.mjs.map +1 -1
- package/websql/lib/base-project.d.ts +55 -0
- package/websql/lib/index.d.ts +1 -0
- package/websql/lib/project.d.ts +5 -0
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { _, CoreHelpers } from 'tnp-core/websql';
|
|
1
|
+
import { _, CoreHelpers, crossPlatformPath, path } from 'tnp-core/websql';
|
|
2
2
|
import { Subject } from 'rxjs';
|
|
3
3
|
import * as fuzzy from 'fuzzy';
|
|
4
4
|
import axios from 'axios';
|
|
5
5
|
import { CLASS } from 'typescript-class-helpers/websql';
|
|
6
6
|
import { Morphi } from 'morphi/websql';
|
|
7
|
+
import { CLI } from 'tnp-cli/websql';
|
|
8
|
+
import { config } from 'tnp-config/websql';
|
|
7
9
|
|
|
8
10
|
var ValidatorsGit;
|
|
9
11
|
(function (ValidatorsGit) {
|
|
@@ -959,7 +961,12 @@ applyMixins(HelpersFiredev, [
|
|
|
959
961
|
/* */
|
|
960
962
|
/* */
|
|
961
963
|
/* */
|
|
962
|
-
const Helpers$
|
|
964
|
+
const Helpers$2 = HelpersFiredev.Instance;
|
|
965
|
+
/**
|
|
966
|
+
* @deprecated
|
|
967
|
+
*
|
|
968
|
+
* use BaseProject instead
|
|
969
|
+
*/
|
|
963
970
|
class Project {
|
|
964
971
|
constructor() {
|
|
965
972
|
this.cache = {};
|
|
@@ -1222,7 +1229,7 @@ class Project {
|
|
|
1222
1229
|
}
|
|
1223
1230
|
}
|
|
1224
1231
|
static get isBundleMode() {
|
|
1225
|
-
if (Helpers$
|
|
1232
|
+
if (Helpers$2.isBrowser) {
|
|
1226
1233
|
return true;
|
|
1227
1234
|
}
|
|
1228
1235
|
/* */
|
|
@@ -1361,6 +1368,296 @@ class Project {
|
|
|
1361
1368
|
;
|
|
1362
1369
|
({}); // @--end-of-file-for-module=tnp-helpers lib/project.ts
|
|
1363
1370
|
|
|
1371
|
+
/* */
|
|
1372
|
+
/* */
|
|
1373
|
+
/* */
|
|
1374
|
+
/* */
|
|
1375
|
+
/* */
|
|
1376
|
+
const Helpers$1 = HelpersFiredev.Instance;
|
|
1377
|
+
const takenPorts = [];
|
|
1378
|
+
class BaseProjectResolver {
|
|
1379
|
+
constructor(classFn) {
|
|
1380
|
+
this.classFn = classFn;
|
|
1381
|
+
this.NPM_PROJECT_KEY = 'npm';
|
|
1382
|
+
this.projects = [];
|
|
1383
|
+
this.emptyLocations = [];
|
|
1384
|
+
}
|
|
1385
|
+
get allowedTypes() {
|
|
1386
|
+
return [this.NPM_PROJECT_KEY];
|
|
1387
|
+
}
|
|
1388
|
+
get Current() {
|
|
1389
|
+
const current = (this.classFn).From(process.cwd());
|
|
1390
|
+
if (!current) {
|
|
1391
|
+
Helpers$1.warn(`[firedev-helpers] Current location is not a ${CLI.chalk.bold(config.frameworkName)} type project.
|
|
1392
|
+
|
|
1393
|
+
location: "${process.cwd()}"
|
|
1394
|
+
|
|
1395
|
+
}`);
|
|
1396
|
+
return void 0;
|
|
1397
|
+
}
|
|
1398
|
+
return current;
|
|
1399
|
+
}
|
|
1400
|
+
/**
|
|
1401
|
+
* override this
|
|
1402
|
+
*/
|
|
1403
|
+
typeFrom(location) {
|
|
1404
|
+
/* */
|
|
1405
|
+
/* */
|
|
1406
|
+
/* */
|
|
1407
|
+
/* */
|
|
1408
|
+
/* */
|
|
1409
|
+
return (void 0);
|
|
1410
|
+
}
|
|
1411
|
+
From(locationOfProject) {
|
|
1412
|
+
if (Array.isArray(locationOfProject)) {
|
|
1413
|
+
locationOfProject = locationOfProject.join('/');
|
|
1414
|
+
}
|
|
1415
|
+
let location = crossPlatformPath(locationOfProject.replace(/\/\//g, '/'));
|
|
1416
|
+
if (!_.isString(location)) {
|
|
1417
|
+
Helpers$1.warn(`[project.from] location is not a string`);
|
|
1418
|
+
return;
|
|
1419
|
+
}
|
|
1420
|
+
if (path.basename(location) === 'dist') {
|
|
1421
|
+
location = path.dirname(location);
|
|
1422
|
+
}
|
|
1423
|
+
location = crossPlatformPath(path.resolve(location));
|
|
1424
|
+
const alreadyExist = this.projects.find(l => l.location.trim() === location.trim());
|
|
1425
|
+
if (alreadyExist) {
|
|
1426
|
+
return alreadyExist;
|
|
1427
|
+
}
|
|
1428
|
+
/* */
|
|
1429
|
+
/* */
|
|
1430
|
+
/* */
|
|
1431
|
+
/* */
|
|
1432
|
+
/* */
|
|
1433
|
+
/* */
|
|
1434
|
+
/* */
|
|
1435
|
+
/* */
|
|
1436
|
+
/* */
|
|
1437
|
+
/* */
|
|
1438
|
+
/* */
|
|
1439
|
+
/* */
|
|
1440
|
+
/* */
|
|
1441
|
+
/* */
|
|
1442
|
+
/* */
|
|
1443
|
+
/* */
|
|
1444
|
+
/* */
|
|
1445
|
+
/* */
|
|
1446
|
+
/* */
|
|
1447
|
+
/* */
|
|
1448
|
+
/* */
|
|
1449
|
+
/* */
|
|
1450
|
+
/* */
|
|
1451
|
+
/* */
|
|
1452
|
+
/* */
|
|
1453
|
+
/* */
|
|
1454
|
+
/* */
|
|
1455
|
+
}
|
|
1456
|
+
nearestTo(absoluteLocation, options) {
|
|
1457
|
+
/* */
|
|
1458
|
+
/* */
|
|
1459
|
+
/* */
|
|
1460
|
+
/* */
|
|
1461
|
+
/* */
|
|
1462
|
+
/* */
|
|
1463
|
+
/* */
|
|
1464
|
+
/* */
|
|
1465
|
+
/* */
|
|
1466
|
+
/* */
|
|
1467
|
+
/* */
|
|
1468
|
+
/* */
|
|
1469
|
+
/* */
|
|
1470
|
+
/* */
|
|
1471
|
+
/* */
|
|
1472
|
+
/* */
|
|
1473
|
+
/* */
|
|
1474
|
+
/* */
|
|
1475
|
+
/* */
|
|
1476
|
+
/* */
|
|
1477
|
+
/* */
|
|
1478
|
+
/* */
|
|
1479
|
+
/* */
|
|
1480
|
+
/* */
|
|
1481
|
+
/* */
|
|
1482
|
+
/* */
|
|
1483
|
+
/* */
|
|
1484
|
+
/* */
|
|
1485
|
+
/* */
|
|
1486
|
+
/* */
|
|
1487
|
+
/* */
|
|
1488
|
+
/* */
|
|
1489
|
+
/* */
|
|
1490
|
+
/* */
|
|
1491
|
+
/* */
|
|
1492
|
+
/* */
|
|
1493
|
+
/* */
|
|
1494
|
+
/* */
|
|
1495
|
+
/* */
|
|
1496
|
+
/* */
|
|
1497
|
+
/* */
|
|
1498
|
+
/* */
|
|
1499
|
+
/* */
|
|
1500
|
+
/* */
|
|
1501
|
+
/* */
|
|
1502
|
+
/* */
|
|
1503
|
+
/* */
|
|
1504
|
+
/* */
|
|
1505
|
+
/* */
|
|
1506
|
+
/* */
|
|
1507
|
+
/* */
|
|
1508
|
+
/* */
|
|
1509
|
+
/* */
|
|
1510
|
+
/* */
|
|
1511
|
+
/* */
|
|
1512
|
+
/* */
|
|
1513
|
+
/* */
|
|
1514
|
+
/* */
|
|
1515
|
+
return (void 0);
|
|
1516
|
+
}
|
|
1517
|
+
unload(project) {
|
|
1518
|
+
this.projects = this.projects.filter(f => f !== project);
|
|
1519
|
+
}
|
|
1520
|
+
allProjectFrom(absoluteLocation, stopOnCwd = '/') {
|
|
1521
|
+
/* */
|
|
1522
|
+
/* */
|
|
1523
|
+
/* */
|
|
1524
|
+
/* */
|
|
1525
|
+
/* */
|
|
1526
|
+
/* */
|
|
1527
|
+
/* */
|
|
1528
|
+
/* */
|
|
1529
|
+
/* */
|
|
1530
|
+
/* */
|
|
1531
|
+
/* */
|
|
1532
|
+
/* */
|
|
1533
|
+
/* */
|
|
1534
|
+
/* */
|
|
1535
|
+
/* */
|
|
1536
|
+
/* */
|
|
1537
|
+
/* */
|
|
1538
|
+
/* */
|
|
1539
|
+
/* */
|
|
1540
|
+
/* */
|
|
1541
|
+
/* */
|
|
1542
|
+
/* */
|
|
1543
|
+
/* */
|
|
1544
|
+
/* */
|
|
1545
|
+
/* */
|
|
1546
|
+
/* */
|
|
1547
|
+
return (void 0);
|
|
1548
|
+
}
|
|
1549
|
+
}
|
|
1550
|
+
class BaseProject {
|
|
1551
|
+
static { this.ins = new BaseProjectResolver(BaseProject); }
|
|
1552
|
+
get name() {
|
|
1553
|
+
return this.packageJSON?.name;
|
|
1554
|
+
}
|
|
1555
|
+
get version() {
|
|
1556
|
+
return this.packageJSON?.version;
|
|
1557
|
+
}
|
|
1558
|
+
get parent() {
|
|
1559
|
+
return this.ins.From(path.join(this.location, '..'));
|
|
1560
|
+
}
|
|
1561
|
+
get genericName() {
|
|
1562
|
+
let parent = this.parent;
|
|
1563
|
+
return [
|
|
1564
|
+
parent ? path.basename(path.dirname(parent.location)) : void 0,
|
|
1565
|
+
parent ? parent.basename : path.basename(this.location),
|
|
1566
|
+
this.basename,
|
|
1567
|
+
/* */
|
|
1568
|
+
/* */
|
|
1569
|
+
]
|
|
1570
|
+
.filter(f => !!f)
|
|
1571
|
+
.join('/');
|
|
1572
|
+
}
|
|
1573
|
+
/**
|
|
1574
|
+
* try run but continue when it fails
|
|
1575
|
+
* @param command
|
|
1576
|
+
* @param options
|
|
1577
|
+
* @returns
|
|
1578
|
+
*/
|
|
1579
|
+
tryRunSync(command
|
|
1580
|
+
/* */
|
|
1581
|
+
/* */
|
|
1582
|
+
) {
|
|
1583
|
+
/* */
|
|
1584
|
+
/* */
|
|
1585
|
+
/* */
|
|
1586
|
+
/* */
|
|
1587
|
+
/* */
|
|
1588
|
+
/* */
|
|
1589
|
+
return (void 0);
|
|
1590
|
+
}
|
|
1591
|
+
pathFor(relativePath) {
|
|
1592
|
+
/* */
|
|
1593
|
+
/* */
|
|
1594
|
+
/* */
|
|
1595
|
+
/* */
|
|
1596
|
+
/* */
|
|
1597
|
+
return (void 0);
|
|
1598
|
+
}
|
|
1599
|
+
writeJson(relativePath, json) {
|
|
1600
|
+
/* */
|
|
1601
|
+
/* */
|
|
1602
|
+
/* */
|
|
1603
|
+
/* */
|
|
1604
|
+
/* */
|
|
1605
|
+
return (void 0);
|
|
1606
|
+
}
|
|
1607
|
+
run(command
|
|
1608
|
+
/* */
|
|
1609
|
+
/* */
|
|
1610
|
+
) {
|
|
1611
|
+
/* */
|
|
1612
|
+
/* */
|
|
1613
|
+
/* */
|
|
1614
|
+
/* */
|
|
1615
|
+
/* */
|
|
1616
|
+
return (void 0);
|
|
1617
|
+
}
|
|
1618
|
+
outputFrom(command
|
|
1619
|
+
/* */
|
|
1620
|
+
/* */
|
|
1621
|
+
) {
|
|
1622
|
+
/* */
|
|
1623
|
+
/* */
|
|
1624
|
+
return (void 0);
|
|
1625
|
+
}
|
|
1626
|
+
remove(relativePath, exactPath = true) {
|
|
1627
|
+
/* */
|
|
1628
|
+
/* */
|
|
1629
|
+
return (void 0);
|
|
1630
|
+
}
|
|
1631
|
+
async assignFreePort(startFrom = 4200) {
|
|
1632
|
+
/* */
|
|
1633
|
+
/* */
|
|
1634
|
+
/* */
|
|
1635
|
+
/* */
|
|
1636
|
+
/* */
|
|
1637
|
+
/* */
|
|
1638
|
+
/* */
|
|
1639
|
+
/* */
|
|
1640
|
+
/* */
|
|
1641
|
+
/* */
|
|
1642
|
+
/* */
|
|
1643
|
+
/* */
|
|
1644
|
+
/* */
|
|
1645
|
+
/* */
|
|
1646
|
+
/* */
|
|
1647
|
+
/* */
|
|
1648
|
+
/* */
|
|
1649
|
+
/* */
|
|
1650
|
+
/* */
|
|
1651
|
+
/* */
|
|
1652
|
+
/* */
|
|
1653
|
+
/* */
|
|
1654
|
+
/* */
|
|
1655
|
+
return (void 0);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
;
|
|
1659
|
+
({}); // @--end-of-file-for-module=tnp-helpers lib/base-project.ts
|
|
1660
|
+
|
|
1364
1661
|
;
|
|
1365
1662
|
({}); // @--end-of-file-for-module=tnp-helpers lib/models.ts
|
|
1366
1663
|
|
|
@@ -1375,5 +1672,5 @@ const Helpers = HelpersFiredev.Instance;
|
|
|
1375
1672
|
* Generated bundle index. Do not edit.
|
|
1376
1673
|
*/
|
|
1377
1674
|
|
|
1378
|
-
export { Helpers, HelpersAngular, Project, Validators };
|
|
1675
|
+
export { BaseProject, BaseProjectResolver, Helpers, HelpersAngular, Project, Validators };
|
|
1379
1676
|
//# sourceMappingURL=tnp-helpers.mjs.map
|