@loopress/cli 0.8.0 → 0.9.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.
Files changed (37) hide show
  1. package/README.md +40 -71
  2. package/dist/commands/composer/pull.d.ts +0 -3
  3. package/dist/commands/composer/pull.js +0 -1
  4. package/dist/commands/composer/push.d.ts +0 -3
  5. package/dist/commands/composer/push.js +0 -1
  6. package/dist/commands/plugin/add.d.ts +0 -3
  7. package/dist/commands/plugin/add.js +0 -1
  8. package/dist/commands/plugin/pull.d.ts +0 -3
  9. package/dist/commands/plugin/pull.js +0 -1
  10. package/dist/commands/plugin/push.d.ts +3 -3
  11. package/dist/commands/plugin/push.js +63 -32
  12. package/dist/commands/sentry-test.d.ts +6 -0
  13. package/dist/commands/sentry-test.js +8 -0
  14. package/dist/commands/snippet/list.d.ts +0 -3
  15. package/dist/commands/snippet/list.js +1 -6
  16. package/dist/commands/snippet/pull.d.ts +0 -3
  17. package/dist/commands/snippet/pull.js +16 -23
  18. package/dist/commands/snippet/push.d.ts +1 -3
  19. package/dist/commands/snippet/push.js +25 -24
  20. package/dist/hooks/finally.d.ts +3 -0
  21. package/dist/hooks/finally.js +21 -0
  22. package/dist/hooks/init.d.ts +3 -0
  23. package/dist/hooks/init.js +18 -0
  24. package/dist/lib/base.d.ts +0 -5
  25. package/dist/lib/base.js +1 -29
  26. package/dist/lib/sentry.d.ts +8 -0
  27. package/dist/lib/sentry.js +24 -0
  28. package/dist/types/config.d.ts +1 -19
  29. package/dist/types/global-config.generated.d.ts +59 -0
  30. package/dist/types/global-config.generated.js +2 -0
  31. package/dist/types/project-config.generated.d.ts +31 -0
  32. package/dist/types/project-config.generated.js +2 -0
  33. package/dist/types/snippet.generated.d.ts +46 -0
  34. package/dist/types/snippet.generated.js +2 -0
  35. package/dist/utils/loopress-config.d.ts +2 -7
  36. package/oclif.manifest.json +118 -292
  37. package/package.json +15 -3
@@ -69,6 +69,27 @@
69
69
  "logout.js"
70
70
  ]
71
71
  },
72
+ "sentry-test": {
73
+ "aliases": [],
74
+ "args": {},
75
+ "description": "Throw a test error to verify Sentry error reporting is wired up correctly",
76
+ "flags": {},
77
+ "hasDynamicHelp": false,
78
+ "hidden": true,
79
+ "hiddenAliases": [],
80
+ "id": "sentry-test",
81
+ "pluginAlias": "@loopress/cli",
82
+ "pluginName": "@loopress/cli",
83
+ "pluginType": "core",
84
+ "strict": true,
85
+ "enableJsonFlag": false,
86
+ "isESM": true,
87
+ "relativePath": [
88
+ "dist",
89
+ "commands",
90
+ "sentry-test.js"
91
+ ]
92
+ },
72
93
  "status": {
73
94
  "aliases": [],
74
95
  "args": {},
@@ -101,30 +122,6 @@
101
122
  "$ lps composer pull --dry-run"
102
123
  ],
103
124
  "flags": {
104
- "password": {
105
- "description": "WordPress application password (overrides project config, requires --user)",
106
- "helpGroup": "GLOBAL",
107
- "name": "password",
108
- "hasDynamicHelp": false,
109
- "multiple": false,
110
- "type": "option"
111
- },
112
- "url": {
113
- "description": "WordPress URL (overrides project config)",
114
- "helpGroup": "GLOBAL",
115
- "name": "url",
116
- "hasDynamicHelp": false,
117
- "multiple": false,
118
- "type": "option"
119
- },
120
- "user": {
121
- "description": "WordPress username (overrides project config, requires --password)",
122
- "helpGroup": "GLOBAL",
123
- "name": "user",
124
- "hasDynamicHelp": false,
125
- "multiple": false,
126
- "type": "option"
127
- },
128
125
  "dry-run": {
129
126
  "char": "d",
130
127
  "description": "Show what would change without making changes",
@@ -166,30 +163,6 @@
166
163
  "$ lps composer push --dry-run"
167
164
  ],
168
165
  "flags": {
169
- "password": {
170
- "description": "WordPress application password (overrides project config, requires --user)",
171
- "helpGroup": "GLOBAL",
172
- "name": "password",
173
- "hasDynamicHelp": false,
174
- "multiple": false,
175
- "type": "option"
176
- },
177
- "url": {
178
- "description": "WordPress URL (overrides project config)",
179
- "helpGroup": "GLOBAL",
180
- "name": "url",
181
- "hasDynamicHelp": false,
182
- "multiple": false,
183
- "type": "option"
184
- },
185
- "user": {
186
- "description": "WordPress username (overrides project config, requires --password)",
187
- "helpGroup": "GLOBAL",
188
- "name": "user",
189
- "hasDynamicHelp": false,
190
- "multiple": false,
191
- "type": "option"
192
- },
193
166
  "dry-run": {
194
167
  "char": "d",
195
168
  "description": "Show what would change without making changes",
@@ -233,30 +206,6 @@
233
206
  "$ lps plugin add contact-form-7 --dry-run"
234
207
  ],
235
208
  "flags": {
236
- "password": {
237
- "description": "WordPress application password (overrides project config, requires --user)",
238
- "helpGroup": "GLOBAL",
239
- "name": "password",
240
- "hasDynamicHelp": false,
241
- "multiple": false,
242
- "type": "option"
243
- },
244
- "url": {
245
- "description": "WordPress URL (overrides project config)",
246
- "helpGroup": "GLOBAL",
247
- "name": "url",
248
- "hasDynamicHelp": false,
249
- "multiple": false,
250
- "type": "option"
251
- },
252
- "user": {
253
- "description": "WordPress username (overrides project config, requires --password)",
254
- "helpGroup": "GLOBAL",
255
- "name": "user",
256
- "hasDynamicHelp": false,
257
- "multiple": false,
258
- "type": "option"
259
- },
260
209
  "dry-run": {
261
210
  "char": "d",
262
211
  "description": "Show what would change without making changes",
@@ -298,30 +247,6 @@
298
247
  "$ lps plugin pull --dry-run"
299
248
  ],
300
249
  "flags": {
301
- "password": {
302
- "description": "WordPress application password (overrides project config, requires --user)",
303
- "helpGroup": "GLOBAL",
304
- "name": "password",
305
- "hasDynamicHelp": false,
306
- "multiple": false,
307
- "type": "option"
308
- },
309
- "url": {
310
- "description": "WordPress URL (overrides project config)",
311
- "helpGroup": "GLOBAL",
312
- "name": "url",
313
- "hasDynamicHelp": false,
314
- "multiple": false,
315
- "type": "option"
316
- },
317
- "user": {
318
- "description": "WordPress username (overrides project config, requires --password)",
319
- "helpGroup": "GLOBAL",
320
- "name": "user",
321
- "hasDynamicHelp": false,
322
- "multiple": false,
323
- "type": "option"
324
- },
325
250
  "dry-run": {
326
251
  "char": "d",
327
252
  "description": "Show what would change without making changes",
@@ -363,30 +288,6 @@
363
288
  "$ lps plugin push --dry-run"
364
289
  ],
365
290
  "flags": {
366
- "password": {
367
- "description": "WordPress application password (overrides project config, requires --user)",
368
- "helpGroup": "GLOBAL",
369
- "name": "password",
370
- "hasDynamicHelp": false,
371
- "multiple": false,
372
- "type": "option"
373
- },
374
- "url": {
375
- "description": "WordPress URL (overrides project config)",
376
- "helpGroup": "GLOBAL",
377
- "name": "url",
378
- "hasDynamicHelp": false,
379
- "multiple": false,
380
- "type": "option"
381
- },
382
- "user": {
383
- "description": "WordPress username (overrides project config, requires --password)",
384
- "helpGroup": "GLOBAL",
385
- "name": "user",
386
- "hasDynamicHelp": false,
387
- "multiple": false,
388
- "type": "option"
389
- },
390
291
  "dry-run": {
391
292
  "char": "d",
392
293
  "description": "Show what would change without making changes",
@@ -410,40 +311,111 @@
410
311
  "push.js"
411
312
  ]
412
313
  },
314
+ "project:config": {
315
+ "aliases": [],
316
+ "args": {},
317
+ "description": "Add or update a WordPress project environment",
318
+ "examples": [
319
+ "$ lps project config"
320
+ ],
321
+ "flags": {},
322
+ "hasDynamicHelp": false,
323
+ "hiddenAliases": [],
324
+ "id": "project:config",
325
+ "pluginAlias": "@loopress/cli",
326
+ "pluginName": "@loopress/cli",
327
+ "pluginType": "core",
328
+ "strict": true,
329
+ "enableJsonFlag": false,
330
+ "isESM": true,
331
+ "relativePath": [
332
+ "dist",
333
+ "commands",
334
+ "project",
335
+ "config.js"
336
+ ]
337
+ },
338
+ "project:list": {
339
+ "aliases": [],
340
+ "args": {},
341
+ "description": "List configured WordPress projects",
342
+ "examples": [
343
+ "$ lps project list"
344
+ ],
345
+ "flags": {},
346
+ "hasDynamicHelp": false,
347
+ "hiddenAliases": [],
348
+ "id": "project:list",
349
+ "pluginAlias": "@loopress/cli",
350
+ "pluginName": "@loopress/cli",
351
+ "pluginType": "core",
352
+ "strict": true,
353
+ "enableJsonFlag": false,
354
+ "isESM": true,
355
+ "relativePath": [
356
+ "dist",
357
+ "commands",
358
+ "project",
359
+ "list.js"
360
+ ]
361
+ },
362
+ "project:remove": {
363
+ "aliases": [],
364
+ "args": {},
365
+ "description": "Remove one or more WordPress projects or environments",
366
+ "examples": [
367
+ "$ lps project remove"
368
+ ],
369
+ "flags": {},
370
+ "hasDynamicHelp": false,
371
+ "hiddenAliases": [],
372
+ "id": "project:remove",
373
+ "pluginAlias": "@loopress/cli",
374
+ "pluginName": "@loopress/cli",
375
+ "pluginType": "core",
376
+ "strict": true,
377
+ "enableJsonFlag": false,
378
+ "isESM": true,
379
+ "relativePath": [
380
+ "dist",
381
+ "commands",
382
+ "project",
383
+ "remove.js"
384
+ ]
385
+ },
386
+ "project:switch": {
387
+ "aliases": [],
388
+ "args": {},
389
+ "description": "Switch the active project and environment",
390
+ "examples": [
391
+ "$ lps project switch"
392
+ ],
393
+ "flags": {},
394
+ "hasDynamicHelp": false,
395
+ "hiddenAliases": [],
396
+ "id": "project:switch",
397
+ "pluginAlias": "@loopress/cli",
398
+ "pluginName": "@loopress/cli",
399
+ "pluginType": "core",
400
+ "strict": true,
401
+ "enableJsonFlag": false,
402
+ "isESM": true,
403
+ "relativePath": [
404
+ "dist",
405
+ "commands",
406
+ "project",
407
+ "switch.js"
408
+ ]
409
+ },
413
410
  "snippet:list": {
414
411
  "aliases": [],
415
412
  "args": {},
416
413
  "description": "List snippets from WordPress",
417
414
  "examples": [
418
415
  "$ lps snippet list",
419
- "$ lps snippet list --url http://example.com",
420
416
  "$ lps snippet list --plugin wpcode"
421
417
  ],
422
418
  "flags": {
423
- "password": {
424
- "description": "WordPress application password (overrides project config, requires --user)",
425
- "helpGroup": "GLOBAL",
426
- "name": "password",
427
- "hasDynamicHelp": false,
428
- "multiple": false,
429
- "type": "option"
430
- },
431
- "url": {
432
- "description": "WordPress URL (overrides project config)",
433
- "helpGroup": "GLOBAL",
434
- "name": "url",
435
- "hasDynamicHelp": false,
436
- "multiple": false,
437
- "type": "option"
438
- },
439
- "user": {
440
- "description": "WordPress username (overrides project config, requires --password)",
441
- "helpGroup": "GLOBAL",
442
- "name": "user",
443
- "hasDynamicHelp": false,
444
- "multiple": false,
445
- "type": "option"
446
- },
447
419
  "json": {
448
420
  "char": "j",
449
421
  "description": "Output in JSON format",
@@ -499,35 +471,10 @@
499
471
  "description": "Pull snippets from WordPress",
500
472
  "examples": [
501
473
  "$ lps snippet pull",
502
- "$ lps snippet pull --url http://example.com",
503
474
  "$ lps snippet pull --path ./snippets",
504
475
  "$ lps snippet pull --plugin wpcode"
505
476
  ],
506
477
  "flags": {
507
- "password": {
508
- "description": "WordPress application password (overrides project config, requires --user)",
509
- "helpGroup": "GLOBAL",
510
- "name": "password",
511
- "hasDynamicHelp": false,
512
- "multiple": false,
513
- "type": "option"
514
- },
515
- "url": {
516
- "description": "WordPress URL (overrides project config)",
517
- "helpGroup": "GLOBAL",
518
- "name": "url",
519
- "hasDynamicHelp": false,
520
- "multiple": false,
521
- "type": "option"
522
- },
523
- "user": {
524
- "description": "WordPress username (overrides project config, requires --password)",
525
- "helpGroup": "GLOBAL",
526
- "name": "user",
527
- "hasDynamicHelp": false,
528
- "multiple": false,
529
- "type": "option"
530
- },
531
478
  "dry-run": {
532
479
  "char": "d",
533
480
  "description": "Show what would change without making changes",
@@ -583,35 +530,10 @@
583
530
  "description": "Push snippets to WordPress. Local snippet files created or updated remotely are renamed on disk to the `<id>-<slug>` convention.",
584
531
  "examples": [
585
532
  "$ lps snippet push",
586
- "$ lps snippet push --url http://example.com",
587
533
  "$ lps snippet push --path ./snippets",
588
534
  "$ lps snippet push --plugin wpcode"
589
535
  ],
590
536
  "flags": {
591
- "password": {
592
- "description": "WordPress application password (overrides project config, requires --user)",
593
- "helpGroup": "GLOBAL",
594
- "name": "password",
595
- "hasDynamicHelp": false,
596
- "multiple": false,
597
- "type": "option"
598
- },
599
- "url": {
600
- "description": "WordPress URL (overrides project config)",
601
- "helpGroup": "GLOBAL",
602
- "name": "url",
603
- "hasDynamicHelp": false,
604
- "multiple": false,
605
- "type": "option"
606
- },
607
- "user": {
608
- "description": "WordPress username (overrides project config, requires --password)",
609
- "helpGroup": "GLOBAL",
610
- "name": "user",
611
- "hasDynamicHelp": false,
612
- "multiple": false,
613
- "type": "option"
614
- },
615
537
  "dry-run": {
616
538
  "char": "d",
617
539
  "description": "Show what would change without making changes",
@@ -646,103 +568,7 @@
646
568
  "snippet",
647
569
  "push.js"
648
570
  ]
649
- },
650
- "project:config": {
651
- "aliases": [],
652
- "args": {},
653
- "description": "Add or update a WordPress project environment",
654
- "examples": [
655
- "$ lps project config"
656
- ],
657
- "flags": {},
658
- "hasDynamicHelp": false,
659
- "hiddenAliases": [],
660
- "id": "project:config",
661
- "pluginAlias": "@loopress/cli",
662
- "pluginName": "@loopress/cli",
663
- "pluginType": "core",
664
- "strict": true,
665
- "enableJsonFlag": false,
666
- "isESM": true,
667
- "relativePath": [
668
- "dist",
669
- "commands",
670
- "project",
671
- "config.js"
672
- ]
673
- },
674
- "project:list": {
675
- "aliases": [],
676
- "args": {},
677
- "description": "List configured WordPress projects",
678
- "examples": [
679
- "$ lps project list"
680
- ],
681
- "flags": {},
682
- "hasDynamicHelp": false,
683
- "hiddenAliases": [],
684
- "id": "project:list",
685
- "pluginAlias": "@loopress/cli",
686
- "pluginName": "@loopress/cli",
687
- "pluginType": "core",
688
- "strict": true,
689
- "enableJsonFlag": false,
690
- "isESM": true,
691
- "relativePath": [
692
- "dist",
693
- "commands",
694
- "project",
695
- "list.js"
696
- ]
697
- },
698
- "project:remove": {
699
- "aliases": [],
700
- "args": {},
701
- "description": "Remove one or more WordPress projects or environments",
702
- "examples": [
703
- "$ lps project remove"
704
- ],
705
- "flags": {},
706
- "hasDynamicHelp": false,
707
- "hiddenAliases": [],
708
- "id": "project:remove",
709
- "pluginAlias": "@loopress/cli",
710
- "pluginName": "@loopress/cli",
711
- "pluginType": "core",
712
- "strict": true,
713
- "enableJsonFlag": false,
714
- "isESM": true,
715
- "relativePath": [
716
- "dist",
717
- "commands",
718
- "project",
719
- "remove.js"
720
- ]
721
- },
722
- "project:switch": {
723
- "aliases": [],
724
- "args": {},
725
- "description": "Switch the active project and environment",
726
- "examples": [
727
- "$ lps project switch"
728
- ],
729
- "flags": {},
730
- "hasDynamicHelp": false,
731
- "hiddenAliases": [],
732
- "id": "project:switch",
733
- "pluginAlias": "@loopress/cli",
734
- "pluginName": "@loopress/cli",
735
- "pluginType": "core",
736
- "strict": true,
737
- "enableJsonFlag": false,
738
- "isESM": true,
739
- "relativePath": [
740
- "dist",
741
- "commands",
742
- "project",
743
- "switch.js"
744
- ]
745
571
  }
746
572
  },
747
- "version": "0.8.0"
573
+ "version": "0.9.0"
748
574
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loopress/cli",
3
3
  "description": "CLI tool for syncing WordPress code snippets, plugins, and Composer dependencies via the REST API",
4
- "version": "0.8.0",
4
+ "version": "0.9.0",
5
5
  "author": "jean-smaug",
6
6
  "bin": {
7
7
  "loopress": "bin/run.js",
@@ -15,8 +15,10 @@
15
15
  "@oclif/core": "^4.11.11",
16
16
  "@oclif/plugin-help": "^6.2.53",
17
17
  "@oclif/plugin-plugins": "^5.4.80",
18
+ "@sentry/node": "^10.63.0",
18
19
  "glob": "13.0.6",
19
20
  "got": "^15.0.7",
21
+ "listr2": "^10.2.2",
20
22
  "slugify": "^1.6.9",
21
23
  "write-file-atomic": "^5.0.1"
22
24
  },
@@ -30,6 +32,7 @@
30
32
  "eslint": "^9",
31
33
  "eslint-config-oclif": "^6.0.174",
32
34
  "eslint-config-prettier": "^10",
35
+ "json-schema-to-typescript": "^15.0.4",
33
36
  "oclif": "^4.23.24",
34
37
  "prettier": "3.9.4",
35
38
  "shx": "^0.4.0",
@@ -53,7 +56,9 @@
53
56
  "main": "dist/index.js",
54
57
  "exports": {
55
58
  ".": "./dist/index.js",
56
- "./schema": "./loopress.schema.json"
59
+ "./schema/global-config": "./schemas/global-config.schema.json",
60
+ "./schema/project-config": "./schemas/project-config.schema.json",
61
+ "./schema/snippet": "./schemas/snippet.schema.json"
57
62
  },
58
63
  "type": "module",
59
64
  "oclif": {
@@ -65,6 +70,10 @@
65
70
  "dirname": "loopress",
66
71
  "commands": "./dist/commands",
67
72
  "helpClass": "./dist/help.js",
73
+ "hooks": {
74
+ "finally": "./dist/hooks/finally.js",
75
+ "init": "./dist/hooks/init.js"
76
+ },
68
77
  "plugins": [
69
78
  "@oclif/plugin-help"
70
79
  ],
@@ -93,10 +102,13 @@
93
102
  "test": "test"
94
103
  },
95
104
  "scripts": {
105
+ "prewatch": "pnpm run schema:types",
96
106
  "watch": "tsc -b --watch",
97
- "build": "shx rm -rf dist && tsc -b",
107
+ "build": "shx rm -rf dist && pnpm run schema:types && tsc -b",
98
108
  "lint": "eslint",
109
+ "pretest": "pnpm run schema:types",
99
110
  "posttest": "pnpm run lint",
111
+ "schema:types": "tsx scripts/generate-config-types.ts",
100
112
  "test": "vitest run",
101
113
  "version": "oclif readme && git add README.md",
102
114
  "format": "prettier . --write"