@cocreate/cli 1.13.5 → 1.13.7

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/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [1.13.7](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.13.6...v1.13.7) (2022-11-21)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add bump.js to commands/ for testing ([e0fd560](https://github.com/CoCreate-app/CoCreate-cli/commit/e0fd560ec6cada8ac7ecee36339be9217310bd7f))
7
+ * repository.js list ([bb4013d](https://github.com/CoCreate-app/CoCreate-cli/commit/bb4013da20b8b793ad5231dc8539eae9da12dda9))
8
+
9
+ ## [1.13.6](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.13.5...v1.13.6) (2022-10-02)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * minor bug fixes ([1a15c8c](https://github.com/CoCreate-app/CoCreate-cli/commit/1a15c8c6a639845ade671666d5cc34f774e3afd4))
15
+
1
16
  ## [1.13.5](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.13.4...v1.13.5) (2022-10-02)
2
17
 
3
18
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cli",
3
- "version": "1.13.5",
3
+ "version": "1.13.7",
4
4
  "description": "Polyrepo management bash CLI tool. Run all git commands and yarn commands on multiple repositories. Also includes a few custom macros for cloning, installing, etc.",
5
5
  "keywords": [
6
6
  "cli",
@@ -71,7 +71,7 @@
71
71
  "webpack-log": "^3.0.1"
72
72
  },
73
73
  "dependencies": {
74
- "@cocreate/docs": "^1.3.16",
74
+ "@cocreate/docs": "^1.3.17",
75
75
  "@cocreate/hosting": "^1.4.0",
76
76
  "colors": "latest",
77
77
  "glob": "^7.1.7",
package/repositories.js CHANGED
@@ -1,9 +1,9 @@
1
1
  module.exports = [
2
2
 
3
- {
4
- 'path': '/home/ubuntu/CoCreateServer/CoCreateJS',
5
- 'repo': 'github.com/CoCreate-app/CoCreateJS.git'
6
- },
3
+ // {
4
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreateJS',
5
+ // 'repo': 'github.com/CoCreate-app/CoCreateJS.git'
6
+ // },
7
7
  {
8
8
  'path': '/home/ubuntu/CoCreateServer/CoCreateCSS',
9
9
  'repo': 'github.com/CoCreate-app/CoCreateCSS.git'
@@ -409,145 +409,145 @@ module.exports = [
409
409
 
410
410
 
411
411
 
412
- // // {
413
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreateWS',
414
- // // 'repo': 'github.com/CoCreate-app/CoCreateWS.git'
415
- // // },
416
- // // {
417
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreateApi',
418
- // // 'repo': 'github.com/CoCreate-app/CoCreateApi.git'
419
- // // },
420
-
421
- // {
422
- // 'path': '/home/ubuntu/CoCreateServer/CoCreateLB',
423
- // 'repo': 'github.com/CoCreate-app/CoCreateLB.git'
424
- // },
425
-
426
-
427
- // // Components
428
- // {
429
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-auth',
430
- // 'repo': 'github.com/CoCreate-app/CoCreate-auth.git'
431
- // },
432
- // {
433
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crud-server',
434
- // 'repo': 'github.com/CoCreate-app/CoCreate-crud-server.git'
435
- // },
436
- // // {
437
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crdt-server',
438
- // // 'repo': 'github.com/CoCreate-app/CoCreate-crdt-server.git'
439
- // // },
440
- // {
441
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-loadtest',
442
- // 'repo': 'github.com/CoCreate-app/CoCreate-loadtest.git'
443
- // },
444
- // {
445
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-message-server',
446
- // 'repo': 'github.com/CoCreate-app/CoCreate-message-server.git'
447
- // },
448
- // {
449
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-metrics-server',
450
- // 'repo': 'github.com/CoCreate-app/CoCreate-metrics-server.git'
451
- // },
452
- // {
453
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-node-autoscaler',
454
- // 'repo': 'github.com/CoCreate-app/CoCreate-node-autoscaler.git'
455
- // },
456
- // {
457
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-permissions',
458
- // 'repo': 'github.com/CoCreate-app/CoCreate-permissions.git'
459
- // },
460
- // {
461
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-server-side-render',
462
- // 'repo': 'github.com/CoCreate-app/CoCreate-server-side-render.git'
463
- // },
464
- // {
465
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-socket-server',
466
- // 'repo': 'github.com/CoCreate-app/CoCreate-socket-server.git'
467
- // },
468
- // {
469
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-actions',
470
- // 'repo': 'github.com/CoCreate-app/CoCreate-actions.git'
471
- // },
472
- // {
473
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-api',
474
- // 'repo': 'github.com/CoCreate-app/CoCreate-api.git'
475
- // },
476
- // {
477
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-docs',
478
- // 'repo': 'github.com/CoCreate-app/CoCreate-docs.git'
479
- // },
480
- // {
481
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-hosting',
482
- // 'repo': 'github.com/CoCreate-app/CoCreate-hosting.git'
483
- // },
484
412
  // {
485
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crud-client',
486
- // 'repo': 'github.com/CoCreate-app/CoCreate-crud-client.git'
413
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreateWS',
414
+ // 'repo': 'github.com/CoCreate-app/CoCreateWS.git'
487
415
  // },
488
416
  // {
489
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-elements',
490
- // 'repo': 'github.com/CoCreate-app/CoCreate-elements.git'
491
- // },
492
- // {
493
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-industry',
494
- // 'repo': 'github.com/CoCreate-app/CoCreate-industry.git'
495
- // },
496
- // {
497
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-observer',
498
- // 'repo': 'github.com/CoCreate-app/CoCreate-observer.git'
499
- // },
500
- // {
501
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-organizations',
502
- // 'repo': 'github.com/CoCreate-app/CoCreate-organizations.git'
503
- // },
504
- // {
505
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-render',
506
- // 'repo': 'github.com/CoCreate-app/CoCreate-render.git'
507
- // },
508
- // {
509
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-socket-client',
510
- // 'repo': 'github.com/CoCreate-app/CoCreate-socket-client.git'
511
- // },
512
- // {
513
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-unique',
514
- // 'repo': 'github.com/CoCreate-app/CoCreate-unique.git'
515
- // },
516
- // {
517
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-users',
518
- // 'repo': 'github.com/CoCreate-app/CoCreate-users.git'
519
- // },
520
- // {
521
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-utils',
522
- // 'repo': 'github.com/CoCreate-app/CoCreate-utils.git'
417
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreateApi',
418
+ // 'repo': 'github.com/CoCreate-app/CoCreateApi.git'
523
419
  // },
420
+
421
+ {
422
+ 'path': '/home/ubuntu/CoCreateServer/CoCreateLB',
423
+ 'repo': 'github.com/CoCreate-app/CoCreateLB.git'
424
+ },
425
+
426
+
427
+ // Components
428
+ {
429
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-auth',
430
+ 'repo': 'github.com/CoCreate-app/CoCreate-auth.git'
431
+ },
432
+ {
433
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crud-server',
434
+ 'repo': 'github.com/CoCreate-app/CoCreate-crud-server.git'
435
+ },
524
436
  // {
525
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-uuid',
526
- // 'repo': 'github.com/CoCreate-app/CoCreate-uuid.git'
437
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crdt-server',
438
+ // 'repo': 'github.com/CoCreate-app/CoCreate-crdt-server.git'
527
439
  // },
440
+ {
441
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-loadtest',
442
+ 'repo': 'github.com/CoCreate-app/CoCreate-loadtest.git'
443
+ },
444
+ {
445
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-message-server',
446
+ 'repo': 'github.com/CoCreate-app/CoCreate-message-server.git'
447
+ },
448
+ {
449
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-metrics-server',
450
+ 'repo': 'github.com/CoCreate-app/CoCreate-metrics-server.git'
451
+ },
452
+ {
453
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-node-autoscaler',
454
+ 'repo': 'github.com/CoCreate-app/CoCreate-node-autoscaler.git'
455
+ },
456
+ {
457
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-permissions',
458
+ 'repo': 'github.com/CoCreate-app/CoCreate-permissions.git'
459
+ },
460
+ {
461
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-server-side-render',
462
+ 'repo': 'github.com/CoCreate-app/CoCreate-server-side-render.git'
463
+ },
464
+ {
465
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-socket-server',
466
+ 'repo': 'github.com/CoCreate-app/CoCreate-socket-server.git'
467
+ },
468
+ {
469
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-actions',
470
+ 'repo': 'github.com/CoCreate-app/CoCreate-actions.git'
471
+ },
472
+ {
473
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-api',
474
+ 'repo': 'github.com/CoCreate-app/CoCreate-api.git'
475
+ },
476
+ {
477
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-docs',
478
+ 'repo': 'github.com/CoCreate-app/CoCreate-docs.git'
479
+ },
480
+ {
481
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-hosting',
482
+ 'repo': 'github.com/CoCreate-app/CoCreate-hosting.git'
483
+ },
484
+ {
485
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-crud-client',
486
+ 'repo': 'github.com/CoCreate-app/CoCreate-crud-client.git'
487
+ },
488
+ {
489
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-elements',
490
+ 'repo': 'github.com/CoCreate-app/CoCreate-elements.git'
491
+ },
492
+ {
493
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-industry',
494
+ 'repo': 'github.com/CoCreate-app/CoCreate-industry.git'
495
+ },
496
+ {
497
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-observer',
498
+ 'repo': 'github.com/CoCreate-app/CoCreate-observer.git'
499
+ },
500
+ {
501
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-organizations',
502
+ 'repo': 'github.com/CoCreate-app/CoCreate-organizations.git'
503
+ },
504
+ {
505
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-render',
506
+ 'repo': 'github.com/CoCreate-app/CoCreate-render.git'
507
+ },
508
+ {
509
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-socket-client',
510
+ 'repo': 'github.com/CoCreate-app/CoCreate-socket-client.git'
511
+ },
512
+ {
513
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-unique',
514
+ 'repo': 'github.com/CoCreate-app/CoCreate-unique.git'
515
+ },
516
+ {
517
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-users',
518
+ 'repo': 'github.com/CoCreate-app/CoCreate-users.git'
519
+ },
520
+ {
521
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-utils',
522
+ 'repo': 'github.com/CoCreate-app/CoCreate-utils.git'
523
+ },
524
+ {
525
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-uuid',
526
+ 'repo': 'github.com/CoCreate-app/CoCreate-uuid.git'
527
+ },
528
528
 
529
529
 
530
530
 
531
- // // Maybe depreciated
531
+ // Maybe depreciated
532
+ {
533
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-keepalived',
534
+ 'repo': 'github.com/CoCreate-app/CoCreate-keepalived.git'
535
+ },
532
536
  // {
533
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-keepalived',
534
- // 'repo': 'github.com/CoCreate-app/CoCreate-keepalived.git'
537
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-mongodb',
538
+ // 'repo': 'github.com/CoCreate-app/CoCreate-mongodb.git'
535
539
  // },
536
- // // {
537
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-mongodb',
538
- // // 'repo': 'github.com/CoCreate-app/CoCreate-mongodb.git'
539
- // // },
540
- // // {
541
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-openebs',
542
- // // 'repo': 'github.com/CoCreate-app/CoCreate-openebs.git'
543
- // // },
544
540
  // {
545
- // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-ide',
546
- // 'repo': 'github.com/CoCreate-app/CoCreate-ide.git'
541
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-openebs',
542
+ // 'repo': 'github.com/CoCreate-app/CoCreate-openebs.git'
543
+ // },
544
+ {
545
+ 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreate-ide',
546
+ 'repo': 'github.com/CoCreate-app/CoCreate-ide.git'
547
+ },
548
+ // {
549
+ // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreateEmail',
550
+ // 'repo': 'github.com/CoCreate-app/CoCreateEmail.git'
547
551
  // },
548
- // // {
549
- // // 'path': '/home/ubuntu/CoCreateServer/CoCreate-components/CoCreateEmail',
550
- // // 'repo': 'github.com/CoCreate-app/CoCreateEmail.git'
551
- // // },
552
552
 
553
553
  ];
@@ -0,0 +1,106 @@
1
+
2
+ let fs = require('fs');
3
+ const prettier = require("prettier");
4
+ let list = require('../../../repositories.js');
5
+ const path = require("path")
6
+
7
+ const spawn = require('../spawn');
8
+ const colors = require('colors');
9
+ const addMeta = require('../addMeta');
10
+
11
+ let pathList = list.map(o => o.path)
12
+ let nameList = pathList.map(fn => path.basename(fn).toLowerCase());
13
+ console.log('pathList', pathList)
14
+ console.log('pathList', nameList)
15
+ let item = {}
16
+
17
+ // ToDo: excute using command coc bump. when executed it will check for a repository.js file. same as other commands/
18
+ // (async() => {
19
+
20
+ // for (let [index, name] of nameList.entries()) {
21
+ // getVersions(pathList[index] + '/package.json', name).
22
+ // }
23
+ // // console.log('bump versions', item)
24
+ // // for (let [index, name] of nameList.entries()) {
25
+ // // await bumpVersion(pathList[index] + '/package.json', name)
26
+ // // }
27
+
28
+
29
+ // })();
30
+
31
+ async function run() {
32
+ // let failed = [];
33
+
34
+ // try {
35
+ // repos = addMeta(repos, failed)
36
+
37
+ // }
38
+ // catch (err) {
39
+ // failed.push({
40
+ // name: 'GENERAL',
41
+ // des: err.message
42
+ // })
43
+
44
+ // }
45
+
46
+ // // console.log(repos)
47
+ // // return [];
48
+ // for (let repo of repos) {
49
+ // await reAdd(repo.deps, repo, failed, '')
50
+ // await reAdd(repo.devDeps, repo, failed, '-D ')
51
+ // }
52
+ // return failed;
53
+
54
+ // }
55
+
56
+ for (let [index, name] of nameList.entries()) {
57
+ getVersions(pathList[index] + '/package.json', `@${name}`)
58
+ }
59
+ console.log('bump versions', item)
60
+
61
+ for (let [index, name] of nameList.entries()) {
62
+ await bumpVersion(pathList[index] + '/package.json', name)
63
+ }
64
+
65
+ console.log('completed')
66
+ // process.exit()
67
+ }
68
+
69
+ function getVersions(path, name) {
70
+ if(!fs.existsSync(path))
71
+ return console.error('path doesn\'t exist:', path)
72
+ let object = require(path)
73
+ if (object.name && object.version) {
74
+ item[object.name] = `^${object.version}`
75
+ }
76
+ }
77
+
78
+ function bumpVersion(filePath, name) {
79
+ if(!fs.existsSync(filePath))
80
+ return console.error('path doesn\'t exist:', path)
81
+ let object = require(filePath)
82
+ let newObject = {...object}
83
+
84
+ if (!object.dependencies)
85
+ return console.log(name, 'not updated')
86
+ else {
87
+ for (const name of Object.keys(object.dependencies)) {
88
+ if (item[name]) {
89
+ newObject.dependencies[name] = item[name]
90
+ }
91
+ }
92
+
93
+ let str = JSON.stringify(object)
94
+ let formated = prettier.format(str, { semi: false, parser: "json" });
95
+
96
+ filePath = filePath.replace('/package.json', '')
97
+ let Path = path.resolve(filePath, 'package.json')
98
+ if (fs.existsSync(Path)){
99
+ fs.unlinkSync(Path)
100
+ }
101
+
102
+ fs.writeFileSync(Path, formated)
103
+ }
104
+ }
105
+
106
+ // run()