@cocreate/cli 1.50.0 → 1.51.1

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,17 @@
1
+ ## [1.51.1](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.51.0...v1.51.1) (2025-05-01)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update [@cocreate](https://github.com/cocreate) dependencies ([37a3fc2](https://github.com/CoCreate-app/CoCreate-cli/commit/37a3fc289e52ad65f399d4c7a803ac4dae6ad468))
7
+
8
+ # [1.51.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.50.0...v1.51.0) (2025-05-01)
9
+
10
+
11
+ ### Features
12
+
13
+ * retry failed repositories ([94ddaed](https://github.com/CoCreate-app/CoCreate-cli/commit/94ddaeda55fd6e19d684165f9b739c0281c3c2d1))
14
+
1
15
  # [1.50.0](https://github.com/CoCreate-app/CoCreate-cli/compare/v1.49.0...v1.50.0) (2025-04-30)
2
16
 
3
17
 
@@ -304,197 +304,198 @@ module.exports = {
304
304
  path: "../../CoCreate-apps/CoCreate-sandbox",
305
305
  repo: "github.com/CoCreate-app/CoCreate-sandbox.git",
306
306
  exclude: ["fs/webpack"]
307
- },
308
- {
309
- path: "../../CoCreate-plugins/CoCreate-charts",
310
- repo: "github.com/CoCreate-app/CoCreate-charts.git"
311
- },
312
- {
313
- path: "../../CoCreate-plugins/CoCreate-alpha-vantage",
314
- repo: "github.com/CoCreate-app/CoCreate-alpha-vantage.git"
315
- },
316
- {
317
- path: "../../CoCreate-plugins/CoCreate-aos",
318
- repo: "github.com/CoCreate-app/CoCreate-aos.git"
319
- },
320
- {
321
- path: "../../CoCreate-plugins/CoCreate-croppie",
322
- repo: "github.com/CoCreate-app/CoCreate-croppie.git"
323
- },
324
- {
325
- path: "../../CoCreate-plugins/CoCreate-domain",
326
- repo: "github.com/CoCreate-app/CoCreate-domain.git"
327
- },
328
- {
329
- path: "../../CoCreate-plugins/CoCreate-fabric",
330
- repo: "github.com/CoCreate-app/CoCreate-fabric.git"
331
- },
332
- {
333
- path: "../../CoCreate-plugins/CoCreate-facebook",
334
- repo: "github.com/CoCreate-app/CoCreate-facebook.git"
335
- },
336
- {
337
- path: "../../CoCreate-plugins/CoCreate-fullcalendar",
338
- repo: "github.com/CoCreate-app/CoCreate-fullcalendar.git"
339
- },
340
- {
341
- path: "../../CoCreate-plugins/CoCreate-ffmpeg",
342
- repo: "github.com/CoCreate-app/CoCreate-ffmpeg.git",
343
- exclude: ["fs/webpack"]
344
- },
345
- {
346
- path: "../../CoCreate-plugins/CoCreate-google-maps",
347
- repo: "github.com/CoCreate-app/CoCreate-google-maps.git"
348
- },
349
- {
350
- path: "../../CoCreate-plugins/CoCreate-google-auth",
351
- repo: "github.com/CoCreate-app/CoCreate-google-auth.git"
352
- },
353
- {
354
- path: "../../CoCreate-plugins/CoCreate-instagram",
355
- repo: "github.com/CoCreate-app/CoCreate-instagram.git"
356
- },
357
- {
358
- path: "../../CoCreate-plugins/CoCreate-lighthouse",
359
- repo: "github.com/CoCreate-app/CoCreate-lighthouse.git"
360
- },
361
- {
362
- path: "../../CoCreate-plugins/CoCreate-linkedin",
363
- repo: "github.com/CoCreate-app/CoCreate-linkedin.git"
364
- },
365
- {
366
- path: "../../CoCreate-plugins/CoCreate-marked",
367
- repo: "github.com/CoCreate-app/CoCreate-marked.git"
368
- },
369
- {
370
- path: "../../CoCreate-plugins/CoCreate-mongodb",
371
- repo: "github.com/CoCreate-app/CoCreate-mongodb.git",
372
- exclude: ["fs/webpack"]
373
- },
374
- {
375
- path: "../../CoCreate-plugins/CoCreate-openai",
376
- repo: "github.com/CoCreate-app/CoCreate-openai.git"
377
- },
378
- {
379
- path: "../../CoCreate-plugins/CoCreate-pickr",
380
- repo: "github.com/CoCreate-app/CoCreate-pickr.git"
381
- },
382
- {
383
- path: "../../CoCreate-plugins/CoCreate-pinterest",
384
- repo: "github.com/CoCreate-app/CoCreate-pinterest.git"
385
- },
386
- {
387
- path: "../../CoCreate-plugins/CoCreate-plaid",
388
- repo: "github.com/CoCreate-app/CoCreate-plaid.git"
389
- },
390
- {
391
- path: "../../CoCreate-plugins/CoCreate-prism",
392
- repo: "github.com/CoCreate-app/CoCreate-prism.git"
393
- },
394
- {
395
- path: "../../CoCreate-plugins/CoCreate-sendgrid",
396
- repo: "github.com/CoCreate-app/CoCreate-sendgrid.git"
397
- },
398
- {
399
- path: "../../CoCreate-plugins/CoCreate-shipengine",
400
- repo: "github.com/CoCreate-app/CoCreate-shipengine.git"
401
- },
402
- {
403
- path: "../../CoCreate-plugins/CoCreate-stripe",
404
- repo: "github.com/CoCreate-app/CoCreate-stripe.git"
405
- },
406
- {
407
- path: "../../CoCreate-plugins/CoCreate-twilio",
408
- repo: "github.com/CoCreate-app/CoCreate-twilio.git"
409
- },
410
- {
411
- path: "../../CoCreate-plugins/CoCreate-twitter",
412
- repo: "github.com/CoCreate-app/CoCreate-twitter.git"
413
- },
414
- {
415
- path: "../../CoCreateWS",
416
- repo: "github.com/CoCreate-app/CoCreateWS.git",
417
- exclude: ["fs/webpack"]
418
- },
419
- {
420
- path: "../CoCreate-acme",
421
- repo: "github.com/CoCreate-app/CoCreate-acme.git",
422
- exclude: ["fs/webpack"]
423
- },
424
- {
425
- path: "../CoCreate-authenticate",
426
- repo: "github.com/CoCreate-app/CoCreate-authenticate.git",
427
- exclude: ["fs/webpack"]
428
- },
429
- {
430
- path: "../CoCreate-authorize",
431
- repo: "github.com/CoCreate-app/CoCreate-authorize.git",
432
- exclude: ["fs/webpack"]
433
- },
434
- {
435
- path: "../CoCreate-cron-jobs",
436
- repo: "github.com/CoCreate-app/CoCreate-cron-jobs.git",
437
- exclude: ["fs/webpack"]
438
- },
439
- {
440
- path: "../CoCreate-crud-server",
441
- repo: "github.com/CoCreate-app/CoCreate-crud-server.git",
442
- exclude: ["fs/webpack"]
443
- },
444
- {
445
- path: "../CoCreate-file-server",
446
- repo: "github.com/CoCreate-app/CoCreate-file-server.git",
447
- exclude: ["fs/webpack"]
448
- },
449
- {
450
- path: "../CoCreate-metrics",
451
- repo: "github.com/CoCreate-app/CoCreate-metrics.git",
452
- exclude: ["fs/webpack"]
453
- },
454
- {
455
- path: "../CoCreate-node-autoscaler",
456
- repo: "github.com/CoCreate-app/CoCreate-node-autoscaler.git",
457
- exclude: ["fs/webpack"]
458
- },
459
- {
460
- path: "../../CoCreate-plugins/CoCreate-nginx",
461
- repo: "github.com/CoCreate-app/CoCreate-nginx.git",
462
- exclude: ["fs/webpack"]
463
- },
464
- {
465
- path: "../CoCreate-server",
466
- repo: "github.com/CoCreate-app/CoCreate-server.git",
467
- exclude: ["fs/webpack"]
468
- },
469
- {
470
- path: "../CoCreate-server-side-render",
471
- repo: "github.com/CoCreate-app/CoCreate-server-side-render.git",
472
- exclude: ["fs/webpack"]
473
- },
474
- {
475
- path: "../CoCreate-socket-server",
476
- repo: "github.com/CoCreate-app/CoCreate-socket-server.git",
477
- exclude: ["fs/webpack"]
478
- },
479
- {
480
- path: "../CoCreate-sitemap",
481
- repo: "github.com/CoCreate-app/CoCreate-sitemap.git",
482
- exclude: ["fs/webpack"]
483
- },
484
- {
485
- path: "../CoCreate-url-uploader",
486
- repo: "github.com/CoCreate-app/CoCreate-url-uploader.git",
487
- exclude: ["fs/webpack"]
488
- },
489
- {
490
- path: "../CoCreate-usage",
491
- repo: "github.com/CoCreate-app/CoCreate-usage.git",
492
- exclude: ["fs/webpack"]
493
- },
494
- {
495
- path: "../../CoCreate-plugins/CoCreate-webpack",
496
- repo: "github.com/CoCreate-app/CoCreate-webpack.git",
497
- exclude: ["fs/webpack"]
498
307
  }
308
+
309
+ // {
310
+ // path: "../../CoCreate-plugins/CoCreate-charts",
311
+ // repo: "github.com/CoCreate-app/CoCreate-charts.git"
312
+ // },
313
+ // {
314
+ // path: "../../CoCreate-plugins/CoCreate-alpha-vantage",
315
+ // repo: "github.com/CoCreate-app/CoCreate-alpha-vantage.git"
316
+ // },
317
+ // {
318
+ // path: "../../CoCreate-plugins/CoCreate-aos",
319
+ // repo: "github.com/CoCreate-app/CoCreate-aos.git"
320
+ // },
321
+ // {
322
+ // path: "../../CoCreate-plugins/CoCreate-croppie",
323
+ // repo: "github.com/CoCreate-app/CoCreate-croppie.git"
324
+ // },
325
+ // {
326
+ // path: "../../CoCreate-plugins/CoCreate-domain",
327
+ // repo: "github.com/CoCreate-app/CoCreate-domain.git"
328
+ // },
329
+ // {
330
+ // path: "../../CoCreate-plugins/CoCreate-fabric",
331
+ // repo: "github.com/CoCreate-app/CoCreate-fabric.git"
332
+ // },
333
+ // {
334
+ // path: "../../CoCreate-plugins/CoCreate-facebook",
335
+ // repo: "github.com/CoCreate-app/CoCreate-facebook.git"
336
+ // },
337
+ // {
338
+ // path: "../../CoCreate-plugins/CoCreate-fullcalendar",
339
+ // repo: "github.com/CoCreate-app/CoCreate-fullcalendar.git"
340
+ // },
341
+ // {
342
+ // path: "../../CoCreate-plugins/CoCreate-ffmpeg",
343
+ // repo: "github.com/CoCreate-app/CoCreate-ffmpeg.git",
344
+ // exclude: ["fs/webpack"]
345
+ // },
346
+ // {
347
+ // path: "../../CoCreate-plugins/CoCreate-google-maps",
348
+ // repo: "github.com/CoCreate-app/CoCreate-google-maps.git"
349
+ // },
350
+ // {
351
+ // path: "../../CoCreate-plugins/CoCreate-google-auth",
352
+ // repo: "github.com/CoCreate-app/CoCreate-google-auth.git"
353
+ // },
354
+ // {
355
+ // path: "../../CoCreate-plugins/CoCreate-instagram",
356
+ // repo: "github.com/CoCreate-app/CoCreate-instagram.git"
357
+ // },
358
+ // {
359
+ // path: "../../CoCreate-plugins/CoCreate-lighthouse",
360
+ // repo: "github.com/CoCreate-app/CoCreate-lighthouse.git"
361
+ // },
362
+ // {
363
+ // path: "../../CoCreate-plugins/CoCreate-linkedin",
364
+ // repo: "github.com/CoCreate-app/CoCreate-linkedin.git"
365
+ // },
366
+ // {
367
+ // path: "../../CoCreate-plugins/CoCreate-marked",
368
+ // repo: "github.com/CoCreate-app/CoCreate-marked.git"
369
+ // },
370
+ // {
371
+ // path: "../../CoCreate-plugins/CoCreate-mongodb",
372
+ // repo: "github.com/CoCreate-app/CoCreate-mongodb.git",
373
+ // exclude: ["fs/webpack"]
374
+ // },
375
+ // {
376
+ // path: "../../CoCreate-plugins/CoCreate-openai",
377
+ // repo: "github.com/CoCreate-app/CoCreate-openai.git"
378
+ // },
379
+ // {
380
+ // path: "../../CoCreate-plugins/CoCreate-pickr",
381
+ // repo: "github.com/CoCreate-app/CoCreate-pickr.git"
382
+ // },
383
+ // {
384
+ // path: "../../CoCreate-plugins/CoCreate-pinterest",
385
+ // repo: "github.com/CoCreate-app/CoCreate-pinterest.git"
386
+ // },
387
+ // {
388
+ // path: "../../CoCreate-plugins/CoCreate-plaid",
389
+ // repo: "github.com/CoCreate-app/CoCreate-plaid.git"
390
+ // },
391
+ // {
392
+ // path: "../../CoCreate-plugins/CoCreate-prism",
393
+ // repo: "github.com/CoCreate-app/CoCreate-prism.git"
394
+ // },
395
+ // {
396
+ // path: "../../CoCreate-plugins/CoCreate-sendgrid",
397
+ // repo: "github.com/CoCreate-app/CoCreate-sendgrid.git"
398
+ // },
399
+ // {
400
+ // path: "../../CoCreate-plugins/CoCreate-shipengine",
401
+ // repo: "github.com/CoCreate-app/CoCreate-shipengine.git"
402
+ // },
403
+ // {
404
+ // path: "../../CoCreate-plugins/CoCreate-stripe",
405
+ // repo: "github.com/CoCreate-app/CoCreate-stripe.git"
406
+ // },
407
+ // {
408
+ // path: "../../CoCreate-plugins/CoCreate-twilio",
409
+ // repo: "github.com/CoCreate-app/CoCreate-twilio.git"
410
+ // },
411
+ // {
412
+ // path: "../../CoCreate-plugins/CoCreate-twitter",
413
+ // repo: "github.com/CoCreate-app/CoCreate-twitter.git"
414
+ // },
415
+ // {
416
+ // path: "../../CoCreateWS",
417
+ // repo: "github.com/CoCreate-app/CoCreateWS.git",
418
+ // exclude: ["fs/webpack"]
419
+ // },
420
+ // {
421
+ // path: "../CoCreate-acme",
422
+ // repo: "github.com/CoCreate-app/CoCreate-acme.git",
423
+ // exclude: ["fs/webpack"]
424
+ // },
425
+ // {
426
+ // path: "../CoCreate-authenticate",
427
+ // repo: "github.com/CoCreate-app/CoCreate-authenticate.git",
428
+ // exclude: ["fs/webpack"]
429
+ // },
430
+ // {
431
+ // path: "../CoCreate-authorize",
432
+ // repo: "github.com/CoCreate-app/CoCreate-authorize.git",
433
+ // exclude: ["fs/webpack"]
434
+ // },
435
+ // {
436
+ // path: "../CoCreate-cron-jobs",
437
+ // repo: "github.com/CoCreate-app/CoCreate-cron-jobs.git",
438
+ // exclude: ["fs/webpack"]
439
+ // },
440
+ // {
441
+ // path: "../CoCreate-crud-server",
442
+ // repo: "github.com/CoCreate-app/CoCreate-crud-server.git",
443
+ // exclude: ["fs/webpack"]
444
+ // },
445
+ // {
446
+ // path: "../CoCreate-file-server",
447
+ // repo: "github.com/CoCreate-app/CoCreate-file-server.git",
448
+ // exclude: ["fs/webpack"]
449
+ // },
450
+ // {
451
+ // path: "../CoCreate-metrics",
452
+ // repo: "github.com/CoCreate-app/CoCreate-metrics.git",
453
+ // exclude: ["fs/webpack"]
454
+ // },
455
+ // {
456
+ // path: "../CoCreate-node-autoscaler",
457
+ // repo: "github.com/CoCreate-app/CoCreate-node-autoscaler.git",
458
+ // exclude: ["fs/webpack"]
459
+ // },
460
+ // {
461
+ // path: "../../CoCreate-plugins/CoCreate-nginx",
462
+ // repo: "github.com/CoCreate-app/CoCreate-nginx.git",
463
+ // exclude: ["fs/webpack"]
464
+ // },
465
+ // {
466
+ // path: "../CoCreate-server",
467
+ // repo: "github.com/CoCreate-app/CoCreate-server.git",
468
+ // exclude: ["fs/webpack"]
469
+ // },
470
+ // {
471
+ // path: "../CoCreate-server-side-render",
472
+ // repo: "github.com/CoCreate-app/CoCreate-server-side-render.git",
473
+ // exclude: ["fs/webpack"]
474
+ // },
475
+ // {
476
+ // path: "../CoCreate-socket-server",
477
+ // repo: "github.com/CoCreate-app/CoCreate-socket-server.git",
478
+ // exclude: ["fs/webpack"]
479
+ // },
480
+ // {
481
+ // path: "../CoCreate-sitemap",
482
+ // repo: "github.com/CoCreate-app/CoCreate-sitemap.git",
483
+ // exclude: ["fs/webpack"]
484
+ // },
485
+ // {
486
+ // path: "../CoCreate-url-uploader",
487
+ // repo: "github.com/CoCreate-app/CoCreate-url-uploader.git",
488
+ // exclude: ["fs/webpack"]
489
+ // },
490
+ // {
491
+ // path: "../CoCreate-usage",
492
+ // repo: "github.com/CoCreate-app/CoCreate-usage.git",
493
+ // exclude: ["fs/webpack"]
494
+ // },
495
+ // {
496
+ // path: "../../CoCreate-plugins/CoCreate-webpack",
497
+ // repo: "github.com/CoCreate-app/CoCreate-webpack.git",
498
+ // exclude: ["fs/webpack"]
499
+ // }
499
500
  ]
500
501
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cocreate/cli",
3
- "version": "1.50.0",
3
+ "version": "1.51.1",
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",
@@ -56,8 +56,8 @@
56
56
  },
57
57
  "dependencies": {
58
58
  "@cocreate/acme": "^1.3.0",
59
- "@cocreate/config": "^1.13.0",
60
- "@cocreate/file": "^1.19.3",
59
+ "@cocreate/config": "^1.13.1",
60
+ "@cocreate/file": "^1.19.4",
61
61
  "@cocreate/nginx": "^1.4.0"
62
62
  }
63
63
  }
package/src/coc.js CHANGED
@@ -1,4 +1,6 @@
1
1
  #!/usr/bin/env node
2
+
3
+ // Import necessary modules for path operations, file system operations, and more
2
4
  const path = require("path");
3
5
  const fs = require("fs");
4
6
  const readline = require("readline");
@@ -6,10 +8,16 @@ const execute = require("./execute");
6
8
  const addMeta = require("./addMeta");
7
9
  const { color } = require("./fonts");
8
10
 
11
+ // Configuration object for storing options
9
12
  let config = {};
10
13
 
14
+ // Extract arguments from the command line input
11
15
  const argv = process.argv.slice(2);
16
+
17
+ // Define available command-line options
12
18
  const options = ["-self"];
19
+
20
+ // Iterate over available options and set configurations if specified in argv
13
21
  for (let option of options) {
14
22
  if (argv.includes(option)) {
15
23
  config[option.replace(/^--/, "")] = true;
@@ -18,12 +26,16 @@ for (let option of options) {
18
26
  }
19
27
  }
20
28
 
29
+ // Format command from argv, handling spaces and quotes
21
30
  command = argv
22
- .map((part) =>
23
- part.match(/ |'|"/) ? `'${part.replace(/'/, "\\'")}'` : part
24
- )
31
+ .map((part) => (part.match(/ |'|"/) ? `'${part.replace(/'/, "'")}'` : part))
25
32
  .join(" ");
26
33
 
34
+ /**
35
+ * Load repository configuration from the given path.
36
+ * @param {string} path - The file path to load repository config from.
37
+ * @returns {Array} - List of repositories.
38
+ */
27
39
  function getRepositories(path) {
28
40
  try {
29
41
  const config = require(path);
@@ -39,28 +51,39 @@ function getRepositories(path) {
39
51
  }
40
52
  }
41
53
 
54
+ /**
55
+ * Main function to execute commands across repositories.
56
+ * @param {Object} config - The configuration object.
57
+ * @param {Array} [repos=null] - List of repositories to process.
58
+ * @param {string} [directory=null] - The directory path of the configuration.
59
+ */
42
60
  async function main(config = {}, repos = null, directory = null) {
43
61
  if (!repos) {
44
- // Existing logic to determine repositories and configuration
62
+ // Determine repositories and configuration file paths
45
63
  const currentRepoPath = path.resolve(
46
64
  process.cwd(),
47
65
  "CoCreate.config.js"
48
66
  );
49
67
  const packageJsonPath = path.resolve(process.cwd(), "package.json");
50
68
 
69
+ // Load repositories from specified config file
51
70
  if (config["c"] && fs.existsSync(config["c"])) {
52
71
  repos = getRepositories(config["c"]);
53
72
  directory = path.dirname(config["c"]);
54
73
  console.warn(
55
74
  `${color.yellow}using ${config["c"]} configuration${color.reset}`
56
75
  );
57
- } else if (!config["self"] && fs.existsSync(currentRepoPath)) {
76
+ }
77
+ // Load repositories from default CoCreate.config.js if exists
78
+ else if (!config["self"] && fs.existsSync(currentRepoPath)) {
58
79
  repos = getRepositories(currentRepoPath);
59
80
  directory = path.dirname(currentRepoPath);
60
81
  console.warn(
61
82
  `${color.yellow}using ${currentRepoPath} configuration${color.reset}`
62
83
  );
63
- } else if (fs.existsSync(packageJsonPath)) {
84
+ }
85
+ // If package.json exists, load repository details from it
86
+ else if (fs.existsSync(packageJsonPath)) {
64
87
  const repoPath = path.resolve(process.cwd());
65
88
  const packageObj = require(packageJsonPath);
66
89
  const repoUrl =
@@ -78,7 +101,9 @@ async function main(config = {}, repos = null, directory = null) {
78
101
  console.warn(
79
102
  `${color.yellow}using ${packageJsonPath} configuration${color.reset}`
80
103
  );
81
- } else {
104
+ }
105
+ // Error if no configuration can be found
106
+ else {
82
107
  console.error(
83
108
  `${color.red}a configuration file cannot be found${color.reset}`
84
109
  );
@@ -86,12 +111,16 @@ async function main(config = {}, repos = null, directory = null) {
86
111
  }
87
112
  }
88
113
 
114
+ // Set default config values
89
115
  config = { hideMessage: false, ...config };
90
116
 
117
+ // Add metadata to repos if any are present
91
118
  if (repos && repos.length) repos = await addMeta(repos, [], directory);
92
119
 
120
+ // Execute the command across repositories
93
121
  const failed = await execute(command, repos, config);
94
122
 
123
+ // Handle any failed command executions
95
124
  if (failed && failed.length > 0) {
96
125
  console.log(
97
126
  color.red +
@@ -104,10 +133,17 @@ async function main(config = {}, repos = null, directory = null) {
104
133
  );
105
134
  }
106
135
 
136
+ // Prompt user to retry failed commands
107
137
  await promptRetry(failed, config, directory);
108
138
  }
109
139
  }
110
140
 
141
+ /**
142
+ * Prompt the user to retry failed commands.
143
+ * @param {Array} failed - List of failed commands.
144
+ * @param {Object} config - Configuration object.
145
+ * @param {string} directory - Path of the configuration directory.
146
+ */
111
147
  async function promptRetry(failed, config, directory) {
112
148
  const rl = readline.createInterface({
113
149
  input: process.stdin,
@@ -127,4 +163,5 @@ async function promptRetry(failed, config, directory) {
127
163
  );
128
164
  }
129
165
 
166
+ // Call the main function with initial configuration
130
167
  main(config);