@dafish/gogo-meta 1.3.0 → 1.4.0
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/README.md +129 -89
- package/dist/cli.js +94 -41
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +13 -3
- package/dist/index.js +95 -42
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -10,6 +10,7 @@ A modern TypeScript CLI for managing multi-repository projects. Execute commands
|
|
|
10
10
|
- Flexible filtering (include/exclude by name or pattern)
|
|
11
11
|
- NPM operations across all projects
|
|
12
12
|
- Symlink projects for local development
|
|
13
|
+
- JSON and YAML configuration formats
|
|
13
14
|
|
|
14
15
|
## Installation
|
|
15
16
|
|
|
@@ -79,7 +80,11 @@ gogo exec "git status" --parallel
|
|
|
79
80
|
|
|
80
81
|
### .gogo
|
|
81
82
|
|
|
82
|
-
The
|
|
83
|
+
The config file defines child repositories, ignore patterns, and predefined commands. Both JSON and YAML formats are supported.
|
|
84
|
+
|
|
85
|
+
gogo looks for config files in the following order of precedence: `.gogo` (JSON) > `.gogo.yaml` > `.gogo.yml`. The first file found is used.
|
|
86
|
+
|
|
87
|
+
#### JSON format (.gogo)
|
|
83
88
|
|
|
84
89
|
```json
|
|
85
90
|
{
|
|
@@ -106,6 +111,37 @@ The `.gogo` file defines child repositories, ignore patterns, and predefined com
|
|
|
106
111
|
}
|
|
107
112
|
```
|
|
108
113
|
|
|
114
|
+
#### YAML format (.gogo.yaml)
|
|
115
|
+
|
|
116
|
+
```yaml
|
|
117
|
+
# Main services
|
|
118
|
+
projects:
|
|
119
|
+
api: git@github.com:org/api.git
|
|
120
|
+
web: git@github.com:org/web.git
|
|
121
|
+
libs/shared: git@github.com:org/shared.git
|
|
122
|
+
|
|
123
|
+
ignore:
|
|
124
|
+
- .git
|
|
125
|
+
- node_modules
|
|
126
|
+
- .vagrant
|
|
127
|
+
- .vscode
|
|
128
|
+
|
|
129
|
+
# Predefined commands
|
|
130
|
+
commands:
|
|
131
|
+
build: npm run build
|
|
132
|
+
test:
|
|
133
|
+
cmd: npm test
|
|
134
|
+
parallel: true
|
|
135
|
+
description: Run tests in all projects
|
|
136
|
+
deploy:
|
|
137
|
+
cmd: npm run deploy
|
|
138
|
+
parallel: true
|
|
139
|
+
concurrency: 2
|
|
140
|
+
includeOnly:
|
|
141
|
+
- api
|
|
142
|
+
- web
|
|
143
|
+
```
|
|
144
|
+
|
|
109
145
|
### .looprc (optional)
|
|
110
146
|
|
|
111
147
|
Define default ignore patterns for command execution:
|
|
@@ -122,29 +158,31 @@ Define default ignore patterns for command execution:
|
|
|
122
158
|
|
|
123
159
|
These options are available for most commands:
|
|
124
160
|
|
|
125
|
-
| Option
|
|
126
|
-
|
|
127
|
-
| `--include-only <dirs>`
|
|
128
|
-
| `--exclude-only <dirs>`
|
|
129
|
-
| `--include-pattern <regex>` | Include directories matching regex pattern
|
|
130
|
-
| `--exclude-pattern <regex>` | Exclude directories matching regex pattern
|
|
131
|
-
| `--parallel`
|
|
132
|
-
| `--concurrency <n>`
|
|
161
|
+
| Option | Description |
|
|
162
|
+
| --------------------------- | --------------------------------------------------- |
|
|
163
|
+
| `--include-only <dirs>` | Only target specified directories (comma-separated) |
|
|
164
|
+
| `--exclude-only <dirs>` | Exclude specified directories (comma-separated) |
|
|
165
|
+
| `--include-pattern <regex>` | Include directories matching regex pattern |
|
|
166
|
+
| `--exclude-pattern <regex>` | Exclude directories matching regex pattern |
|
|
167
|
+
| `--parallel` | Execute commands concurrently |
|
|
168
|
+
| `--concurrency <n>` | Maximum parallel processes (default: 4) |
|
|
133
169
|
|
|
134
170
|
---
|
|
135
171
|
|
|
136
172
|
### `gogo init`
|
|
137
173
|
|
|
138
|
-
Initialize a new gogo-meta repository by creating a
|
|
174
|
+
Initialize a new gogo-meta repository by creating a config file.
|
|
139
175
|
|
|
140
176
|
```bash
|
|
141
|
-
gogo init
|
|
142
|
-
gogo init --
|
|
177
|
+
gogo init # Create .gogo (JSON, default)
|
|
178
|
+
gogo init --format yaml # Create .gogo.yaml (YAML)
|
|
179
|
+
gogo init --force # Overwrite existing config file
|
|
143
180
|
```
|
|
144
181
|
|
|
145
|
-
| Option
|
|
146
|
-
|
|
147
|
-
| `-f, --force`
|
|
182
|
+
| Option | Description |
|
|
183
|
+
| ------------------- | ---------------------------------------------- |
|
|
184
|
+
| `-f, --force` | Overwrite existing config file |
|
|
185
|
+
| `--format <format>` | Config file format: `json` (default) or `yaml` |
|
|
148
186
|
|
|
149
187
|
---
|
|
150
188
|
|
|
@@ -172,14 +210,14 @@ gogo exec "npm install" --exclude-only docs
|
|
|
172
210
|
gogo exec "npm test" --include-pattern "^libs/"
|
|
173
211
|
```
|
|
174
212
|
|
|
175
|
-
| Option
|
|
176
|
-
|
|
177
|
-
| `--include-only <dirs>`
|
|
178
|
-
| `--exclude-only <dirs>`
|
|
213
|
+
| Option | Description |
|
|
214
|
+
| --------------------------- | ------------------------------------ |
|
|
215
|
+
| `--include-only <dirs>` | Only run in specified directories |
|
|
216
|
+
| `--exclude-only <dirs>` | Skip specified directories |
|
|
179
217
|
| `--include-pattern <regex>` | Include directories matching pattern |
|
|
180
218
|
| `--exclude-pattern <regex>` | Exclude directories matching pattern |
|
|
181
|
-
| `--parallel`
|
|
182
|
-
| `--concurrency <n>`
|
|
219
|
+
| `--parallel` | Run commands concurrently |
|
|
220
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
183
221
|
|
|
184
222
|
---
|
|
185
223
|
|
|
@@ -207,15 +245,15 @@ gogo run deploy --include-only api
|
|
|
207
245
|
# CLI flags override these config defaults
|
|
208
246
|
```
|
|
209
247
|
|
|
210
|
-
| Option
|
|
211
|
-
|
|
212
|
-
| `-l, --list`
|
|
213
|
-
| `--include-only <dirs>`
|
|
214
|
-
| `--exclude-only <dirs>`
|
|
248
|
+
| Option | Description |
|
|
249
|
+
| --------------------------- | ------------------------------------------------------- |
|
|
250
|
+
| `-l, --list` | List all available commands |
|
|
251
|
+
| `--include-only <dirs>` | Only run in specified directories (overrides config) |
|
|
252
|
+
| `--exclude-only <dirs>` | Skip specified directories (overrides config) |
|
|
215
253
|
| `--include-pattern <regex>` | Include directories matching pattern (overrides config) |
|
|
216
254
|
| `--exclude-pattern <regex>` | Exclude directories matching pattern (overrides config) |
|
|
217
|
-
| `--parallel`
|
|
218
|
-
| `--concurrency <n>`
|
|
255
|
+
| `--parallel` | Run commands concurrently (overrides config) |
|
|
256
|
+
| `--concurrency <n>` | Max parallel processes (overrides config) |
|
|
219
257
|
|
|
220
258
|
---
|
|
221
259
|
|
|
@@ -231,8 +269,8 @@ gogo git clone git@github.com:org/meta-repo.git
|
|
|
231
269
|
gogo git clone git@github.com:org/meta-repo.git -d my-project
|
|
232
270
|
```
|
|
233
271
|
|
|
234
|
-
| Option
|
|
235
|
-
|
|
272
|
+
| Option | Description |
|
|
273
|
+
| ----------------------- | --------------------- |
|
|
236
274
|
| `-d, --directory <dir>` | Target directory name |
|
|
237
275
|
|
|
238
276
|
---
|
|
@@ -247,12 +285,12 @@ gogo git update --parallel
|
|
|
247
285
|
gogo git update --include-only api,web
|
|
248
286
|
```
|
|
249
287
|
|
|
250
|
-
| Option
|
|
251
|
-
|
|
288
|
+
| Option | Description |
|
|
289
|
+
| ----------------------- | ------------------------------ |
|
|
252
290
|
| `--include-only <dirs>` | Only update specified projects |
|
|
253
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
254
|
-
| `--parallel`
|
|
255
|
-
| `--concurrency <n>`
|
|
291
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
292
|
+
| `--parallel` | Clone in parallel |
|
|
293
|
+
| `--concurrency <n>` | Max parallel clones |
|
|
256
294
|
|
|
257
295
|
---
|
|
258
296
|
|
|
@@ -266,11 +304,11 @@ gogo git status --parallel
|
|
|
266
304
|
gogo git status --include-only api
|
|
267
305
|
```
|
|
268
306
|
|
|
269
|
-
| Option
|
|
270
|
-
|
|
307
|
+
| Option | Description |
|
|
308
|
+
| ----------------------- | ----------------------------- |
|
|
271
309
|
| `--include-only <dirs>` | Only check specified projects |
|
|
272
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
273
|
-
| `--parallel`
|
|
310
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
311
|
+
| `--parallel` | Run in parallel |
|
|
274
312
|
|
|
275
313
|
---
|
|
276
314
|
|
|
@@ -283,12 +321,12 @@ gogo git pull
|
|
|
283
321
|
gogo git pull --parallel
|
|
284
322
|
```
|
|
285
323
|
|
|
286
|
-
| Option
|
|
287
|
-
|
|
324
|
+
| Option | Description |
|
|
325
|
+
| ----------------------- | ---------------------------- |
|
|
288
326
|
| `--include-only <dirs>` | Only pull specified projects |
|
|
289
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
290
|
-
| `--parallel`
|
|
291
|
-
| `--concurrency <n>`
|
|
327
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
328
|
+
| `--parallel` | Pull in parallel |
|
|
329
|
+
| `--concurrency <n>` | Max parallel pulls |
|
|
292
330
|
|
|
293
331
|
---
|
|
294
332
|
|
|
@@ -301,11 +339,11 @@ gogo git push
|
|
|
301
339
|
gogo git push --include-only api,web
|
|
302
340
|
```
|
|
303
341
|
|
|
304
|
-
| Option
|
|
305
|
-
|
|
342
|
+
| Option | Description |
|
|
343
|
+
| ----------------------- | ---------------------------- |
|
|
306
344
|
| `--include-only <dirs>` | Only push specified projects |
|
|
307
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
308
|
-
| `--parallel`
|
|
345
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
346
|
+
| `--parallel` | Push in parallel |
|
|
309
347
|
|
|
310
348
|
---
|
|
311
349
|
|
|
@@ -327,13 +365,13 @@ gogo git branch feature/new-feature
|
|
|
327
365
|
gogo git branch feature/old-feature --delete
|
|
328
366
|
```
|
|
329
367
|
|
|
330
|
-
| Option
|
|
331
|
-
|
|
332
|
-
| `-d, --delete`
|
|
333
|
-
| `-a, --all`
|
|
334
|
-
| `--include-only <dirs>` | Only target specified projects
|
|
335
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
336
|
-
| `--parallel`
|
|
368
|
+
| Option | Description |
|
|
369
|
+
| ----------------------- | ------------------------------------ |
|
|
370
|
+
| `-d, --delete` | Delete the specified branch |
|
|
371
|
+
| `-a, --all` | List all branches (local and remote) |
|
|
372
|
+
| `--include-only <dirs>` | Only target specified projects |
|
|
373
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
374
|
+
| `--parallel` | Run in parallel |
|
|
337
375
|
|
|
338
376
|
---
|
|
339
377
|
|
|
@@ -349,12 +387,12 @@ gogo git checkout main
|
|
|
349
387
|
gogo git checkout -b feature/new-feature
|
|
350
388
|
```
|
|
351
389
|
|
|
352
|
-
| Option
|
|
353
|
-
|
|
354
|
-
| `-b, --create`
|
|
355
|
-
| `--include-only <dirs>` | Only target specified projects
|
|
356
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
357
|
-
| `--parallel`
|
|
390
|
+
| Option | Description |
|
|
391
|
+
| ----------------------- | ------------------------------------- |
|
|
392
|
+
| `-b, --create` | Create the branch if it doesn't exist |
|
|
393
|
+
| `--include-only <dirs>` | Only target specified projects |
|
|
394
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
395
|
+
| `--parallel` | Run in parallel |
|
|
358
396
|
|
|
359
397
|
---
|
|
360
398
|
|
|
@@ -367,11 +405,11 @@ gogo git commit -m "Update dependencies"
|
|
|
367
405
|
gogo git commit -m "Fix bug" --include-only api
|
|
368
406
|
```
|
|
369
407
|
|
|
370
|
-
| Option
|
|
371
|
-
|
|
372
|
-
| `-m, --message <msg>`
|
|
408
|
+
| Option | Description |
|
|
409
|
+
| ----------------------- | --------------------------------- |
|
|
410
|
+
| `-m, --message <msg>` | Commit message (required) |
|
|
373
411
|
| `--include-only <dirs>` | Only commit in specified projects |
|
|
374
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
412
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
375
413
|
|
|
376
414
|
---
|
|
377
415
|
|
|
@@ -384,6 +422,7 @@ gogo project create libs/new-lib git@github.com:org/new-lib.git
|
|
|
384
422
|
```
|
|
385
423
|
|
|
386
424
|
This will:
|
|
425
|
+
|
|
387
426
|
1. Create the directory
|
|
388
427
|
2. Initialize git
|
|
389
428
|
3. Add the remote origin
|
|
@@ -407,11 +446,12 @@ gogo project import existing-folder
|
|
|
407
446
|
gogo project import api git@github.com:org/api.git --no-clone
|
|
408
447
|
```
|
|
409
448
|
|
|
410
|
-
| Option
|
|
411
|
-
|
|
449
|
+
| Option | Description |
|
|
450
|
+
| ------------ | ------------------------------------------- |
|
|
412
451
|
| `--no-clone` | Register project in `.gogo` without cloning |
|
|
413
452
|
|
|
414
453
|
This will:
|
|
454
|
+
|
|
415
455
|
1. Clone the repository (if URL provided and directory doesn't exist, unless `--no-clone`)
|
|
416
456
|
2. Add the project to `.gogo`
|
|
417
457
|
3. Add the path to `.gitignore` (unless `--no-clone`)
|
|
@@ -428,12 +468,12 @@ gogo npm i # Alias
|
|
|
428
468
|
gogo npm install --parallel
|
|
429
469
|
```
|
|
430
470
|
|
|
431
|
-
| Option
|
|
432
|
-
|
|
471
|
+
| Option | Description |
|
|
472
|
+
| ----------------------- | ---------------------------------- |
|
|
433
473
|
| `--include-only <dirs>` | Only install in specified projects |
|
|
434
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
435
|
-
| `--parallel`
|
|
436
|
-
| `--concurrency <n>`
|
|
474
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
475
|
+
| `--parallel` | Run in parallel |
|
|
476
|
+
| `--concurrency <n>` | Max parallel installs |
|
|
437
477
|
|
|
438
478
|
---
|
|
439
479
|
|
|
@@ -446,12 +486,12 @@ gogo npm ci
|
|
|
446
486
|
gogo npm ci --parallel
|
|
447
487
|
```
|
|
448
488
|
|
|
449
|
-
| Option
|
|
450
|
-
|
|
489
|
+
| Option | Description |
|
|
490
|
+
| ----------------------- | ------------------------------ |
|
|
451
491
|
| `--include-only <dirs>` | Only run in specified projects |
|
|
452
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
453
|
-
| `--parallel`
|
|
454
|
-
| `--concurrency <n>`
|
|
492
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
493
|
+
| `--parallel` | Run in parallel |
|
|
494
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
455
495
|
|
|
456
496
|
---
|
|
457
497
|
|
|
@@ -467,11 +507,11 @@ gogo npm link
|
|
|
467
507
|
gogo npm link --all
|
|
468
508
|
```
|
|
469
509
|
|
|
470
|
-
| Option
|
|
471
|
-
|
|
472
|
-
| `--all`
|
|
473
|
-
| `--include-only <dirs>` | Only link specified projects
|
|
474
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
510
|
+
| Option | Description |
|
|
511
|
+
| ----------------------- | -------------------------------------------------------- |
|
|
512
|
+
| `--all` | Link all projects bidirectionally (symlink dependencies) |
|
|
513
|
+
| `--include-only <dirs>` | Only link specified projects |
|
|
514
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
475
515
|
|
|
476
516
|
---
|
|
477
517
|
|
|
@@ -490,13 +530,13 @@ gogo npm run test --parallel
|
|
|
490
530
|
gogo npm run lint --if-present
|
|
491
531
|
```
|
|
492
532
|
|
|
493
|
-
| Option
|
|
494
|
-
|
|
495
|
-
| `--if-present`
|
|
496
|
-
| `--include-only <dirs>` | Only run in specified projects
|
|
497
|
-
| `--exclude-only <dirs>` | Skip specified projects
|
|
498
|
-
| `--parallel`
|
|
499
|
-
| `--concurrency <n>`
|
|
533
|
+
| Option | Description |
|
|
534
|
+
| ----------------------- | --------------------------------------------- |
|
|
535
|
+
| `--if-present` | Only run if the script exists in package.json |
|
|
536
|
+
| `--include-only <dirs>` | Only run in specified projects |
|
|
537
|
+
| `--exclude-only <dirs>` | Skip specified projects |
|
|
538
|
+
| `--parallel` | Run in parallel |
|
|
539
|
+
| `--concurrency <n>` | Max parallel processes |
|
|
500
540
|
|
|
501
541
|
---
|
|
502
542
|
|