@loopress/cli 0.13.0 → 0.14.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 +62 -28
- package/dist/commands/init.js +5 -5
- package/dist/commands/plugin/add.d.ts +0 -2
- package/dist/commands/plugin/add.js +6 -47
- package/dist/commands/plugin/pull.js +4 -6
- package/dist/commands/plugin/push.d.ts +1 -2
- package/dist/commands/plugin/push.js +18 -50
- package/dist/commands/status.js +6 -2
- package/dist/commands/telemetry/disable.d.ts +6 -0
- package/dist/commands/telemetry/disable.js +14 -0
- package/dist/commands/telemetry/enable.d.ts +6 -0
- package/dist/commands/telemetry/enable.js +14 -0
- package/dist/config/auth.manager.d.ts +4 -2
- package/dist/config/auth.manager.js +15 -5
- package/dist/config/project-config.manager.d.ts +7 -2
- package/dist/config/project-config.manager.js +35 -6
- package/dist/hooks/finally.js +11 -2
- package/dist/hooks/init.js +8 -16
- package/dist/lib/local-callback-server.d.ts +3 -3
- package/dist/lib/local-callback-server.js +14 -4
- package/dist/lib/open-browser.d.ts +1 -1
- package/dist/lib/open-browser.js +3 -10
- package/dist/lib/sentry.d.ts +0 -1
- package/dist/lib/sentry.js +6 -8
- package/dist/lib/wp-authorize-flow.d.ts +15 -3
- package/dist/lib/wp-authorize-flow.js +31 -24
- package/dist/lib/wp-client.d.ts +1 -1
- package/dist/lib/wp-client.js +1 -1
- package/dist/types/config.d.ts +1 -1
- package/dist/types/global-config.generated.d.ts +11 -1
- package/dist/types/plugin.d.ts +4 -5
- package/dist/types/project-config.generated.d.ts +1 -4
- package/dist/utils/plugins.d.ts +3 -7
- package/dist/utils/plugins.js +27 -13
- package/oclif.manifest.json +133 -90
- package/package.json +6 -2
- package/schemas/global-config.schema.json +17 -1
- package/schemas/project-config.schema.json +3 -4
package/oclif.manifest.json
CHANGED
|
@@ -193,16 +193,11 @@
|
|
|
193
193
|
"description": "Plugin slug on WordPress.org",
|
|
194
194
|
"name": "slug",
|
|
195
195
|
"required": true
|
|
196
|
-
},
|
|
197
|
-
"version": {
|
|
198
|
-
"description": "Version to pin (default: latest)",
|
|
199
|
-
"name": "version"
|
|
200
196
|
}
|
|
201
197
|
},
|
|
202
198
|
"description": "Add a WordPress.org plugin to loopress.json",
|
|
203
199
|
"examples": [
|
|
204
200
|
"$ lps plugin add woocommerce",
|
|
205
|
-
"$ lps plugin add woocommerce 8.9.1",
|
|
206
201
|
"$ lps plugin add contact-form-7 --dry-run"
|
|
207
202
|
],
|
|
208
203
|
"flags": {
|
|
@@ -311,6 +306,126 @@
|
|
|
311
306
|
"push.js"
|
|
312
307
|
]
|
|
313
308
|
},
|
|
309
|
+
"project:config": {
|
|
310
|
+
"aliases": [],
|
|
311
|
+
"args": {},
|
|
312
|
+
"description": "Add or update a WordPress project environment. By default, authorizes via WordPress in your browser; manual username/Application Password entry is available as a fallback.",
|
|
313
|
+
"examples": [
|
|
314
|
+
"$ lps project config"
|
|
315
|
+
],
|
|
316
|
+
"flags": {},
|
|
317
|
+
"hasDynamicHelp": false,
|
|
318
|
+
"hiddenAliases": [],
|
|
319
|
+
"id": "project:config",
|
|
320
|
+
"pluginAlias": "@loopress/cli",
|
|
321
|
+
"pluginName": "@loopress/cli",
|
|
322
|
+
"pluginType": "core",
|
|
323
|
+
"strict": true,
|
|
324
|
+
"enableJsonFlag": false,
|
|
325
|
+
"isESM": true,
|
|
326
|
+
"relativePath": [
|
|
327
|
+
"dist",
|
|
328
|
+
"commands",
|
|
329
|
+
"project",
|
|
330
|
+
"config.js"
|
|
331
|
+
]
|
|
332
|
+
},
|
|
333
|
+
"project:list": {
|
|
334
|
+
"aliases": [],
|
|
335
|
+
"args": {},
|
|
336
|
+
"description": "List configured WordPress projects",
|
|
337
|
+
"examples": [
|
|
338
|
+
"$ lps project list"
|
|
339
|
+
],
|
|
340
|
+
"flags": {},
|
|
341
|
+
"hasDynamicHelp": false,
|
|
342
|
+
"hiddenAliases": [],
|
|
343
|
+
"id": "project:list",
|
|
344
|
+
"pluginAlias": "@loopress/cli",
|
|
345
|
+
"pluginName": "@loopress/cli",
|
|
346
|
+
"pluginType": "core",
|
|
347
|
+
"strict": true,
|
|
348
|
+
"enableJsonFlag": false,
|
|
349
|
+
"isESM": true,
|
|
350
|
+
"relativePath": [
|
|
351
|
+
"dist",
|
|
352
|
+
"commands",
|
|
353
|
+
"project",
|
|
354
|
+
"list.js"
|
|
355
|
+
]
|
|
356
|
+
},
|
|
357
|
+
"project:remove": {
|
|
358
|
+
"aliases": [],
|
|
359
|
+
"args": {},
|
|
360
|
+
"description": "Remove one or more WordPress projects or environments",
|
|
361
|
+
"examples": [
|
|
362
|
+
"$ lps project remove"
|
|
363
|
+
],
|
|
364
|
+
"flags": {},
|
|
365
|
+
"hasDynamicHelp": false,
|
|
366
|
+
"hiddenAliases": [],
|
|
367
|
+
"id": "project:remove",
|
|
368
|
+
"pluginAlias": "@loopress/cli",
|
|
369
|
+
"pluginName": "@loopress/cli",
|
|
370
|
+
"pluginType": "core",
|
|
371
|
+
"strict": true,
|
|
372
|
+
"enableJsonFlag": false,
|
|
373
|
+
"isESM": true,
|
|
374
|
+
"relativePath": [
|
|
375
|
+
"dist",
|
|
376
|
+
"commands",
|
|
377
|
+
"project",
|
|
378
|
+
"remove.js"
|
|
379
|
+
]
|
|
380
|
+
},
|
|
381
|
+
"project:switch": {
|
|
382
|
+
"aliases": [],
|
|
383
|
+
"args": {},
|
|
384
|
+
"description": "Switch the active project and environment",
|
|
385
|
+
"examples": [
|
|
386
|
+
"$ lps project switch"
|
|
387
|
+
],
|
|
388
|
+
"flags": {},
|
|
389
|
+
"hasDynamicHelp": false,
|
|
390
|
+
"hiddenAliases": [],
|
|
391
|
+
"id": "project:switch",
|
|
392
|
+
"pluginAlias": "@loopress/cli",
|
|
393
|
+
"pluginName": "@loopress/cli",
|
|
394
|
+
"pluginType": "core",
|
|
395
|
+
"strict": true,
|
|
396
|
+
"enableJsonFlag": false,
|
|
397
|
+
"isESM": true,
|
|
398
|
+
"relativePath": [
|
|
399
|
+
"dist",
|
|
400
|
+
"commands",
|
|
401
|
+
"project",
|
|
402
|
+
"switch.js"
|
|
403
|
+
]
|
|
404
|
+
},
|
|
405
|
+
"project:sync": {
|
|
406
|
+
"aliases": [],
|
|
407
|
+
"args": {},
|
|
408
|
+
"description": "Sync locally configured projects and environments with your Loopress account",
|
|
409
|
+
"examples": [
|
|
410
|
+
"$ lps project sync"
|
|
411
|
+
],
|
|
412
|
+
"flags": {},
|
|
413
|
+
"hasDynamicHelp": false,
|
|
414
|
+
"hiddenAliases": [],
|
|
415
|
+
"id": "project:sync",
|
|
416
|
+
"pluginAlias": "@loopress/cli",
|
|
417
|
+
"pluginName": "@loopress/cli",
|
|
418
|
+
"pluginType": "core",
|
|
419
|
+
"strict": true,
|
|
420
|
+
"enableJsonFlag": false,
|
|
421
|
+
"isESM": true,
|
|
422
|
+
"relativePath": [
|
|
423
|
+
"dist",
|
|
424
|
+
"commands",
|
|
425
|
+
"project",
|
|
426
|
+
"sync.js"
|
|
427
|
+
]
|
|
428
|
+
},
|
|
314
429
|
"snippet:list": {
|
|
315
430
|
"aliases": [],
|
|
316
431
|
"args": {},
|
|
@@ -464,65 +579,17 @@
|
|
|
464
579
|
"push.js"
|
|
465
580
|
]
|
|
466
581
|
},
|
|
467
|
-
"
|
|
468
|
-
"aliases": [],
|
|
469
|
-
"args": {},
|
|
470
|
-
"description": "Add or update a WordPress project environment. By default, authorizes via WordPress in your browser; manual username/Application Password entry is available as a fallback.",
|
|
471
|
-
"examples": [
|
|
472
|
-
"$ lps project config"
|
|
473
|
-
],
|
|
474
|
-
"flags": {},
|
|
475
|
-
"hasDynamicHelp": false,
|
|
476
|
-
"hiddenAliases": [],
|
|
477
|
-
"id": "project:config",
|
|
478
|
-
"pluginAlias": "@loopress/cli",
|
|
479
|
-
"pluginName": "@loopress/cli",
|
|
480
|
-
"pluginType": "core",
|
|
481
|
-
"strict": true,
|
|
482
|
-
"enableJsonFlag": false,
|
|
483
|
-
"isESM": true,
|
|
484
|
-
"relativePath": [
|
|
485
|
-
"dist",
|
|
486
|
-
"commands",
|
|
487
|
-
"project",
|
|
488
|
-
"config.js"
|
|
489
|
-
]
|
|
490
|
-
},
|
|
491
|
-
"project:list": {
|
|
492
|
-
"aliases": [],
|
|
493
|
-
"args": {},
|
|
494
|
-
"description": "List configured WordPress projects",
|
|
495
|
-
"examples": [
|
|
496
|
-
"$ lps project list"
|
|
497
|
-
],
|
|
498
|
-
"flags": {},
|
|
499
|
-
"hasDynamicHelp": false,
|
|
500
|
-
"hiddenAliases": [],
|
|
501
|
-
"id": "project:list",
|
|
502
|
-
"pluginAlias": "@loopress/cli",
|
|
503
|
-
"pluginName": "@loopress/cli",
|
|
504
|
-
"pluginType": "core",
|
|
505
|
-
"strict": true,
|
|
506
|
-
"enableJsonFlag": false,
|
|
507
|
-
"isESM": true,
|
|
508
|
-
"relativePath": [
|
|
509
|
-
"dist",
|
|
510
|
-
"commands",
|
|
511
|
-
"project",
|
|
512
|
-
"list.js"
|
|
513
|
-
]
|
|
514
|
-
},
|
|
515
|
-
"project:remove": {
|
|
582
|
+
"telemetry:disable": {
|
|
516
583
|
"aliases": [],
|
|
517
584
|
"args": {},
|
|
518
|
-
"description": "
|
|
585
|
+
"description": "Disable error reporting to Sentry",
|
|
519
586
|
"examples": [
|
|
520
|
-
"$ lps
|
|
587
|
+
"$ lps telemetry disable"
|
|
521
588
|
],
|
|
522
589
|
"flags": {},
|
|
523
590
|
"hasDynamicHelp": false,
|
|
524
591
|
"hiddenAliases": [],
|
|
525
|
-
"id": "
|
|
592
|
+
"id": "telemetry:disable",
|
|
526
593
|
"pluginAlias": "@loopress/cli",
|
|
527
594
|
"pluginName": "@loopress/cli",
|
|
528
595
|
"pluginType": "core",
|
|
@@ -532,21 +599,21 @@
|
|
|
532
599
|
"relativePath": [
|
|
533
600
|
"dist",
|
|
534
601
|
"commands",
|
|
535
|
-
"
|
|
536
|
-
"
|
|
602
|
+
"telemetry",
|
|
603
|
+
"disable.js"
|
|
537
604
|
]
|
|
538
605
|
},
|
|
539
|
-
"
|
|
606
|
+
"telemetry:enable": {
|
|
540
607
|
"aliases": [],
|
|
541
608
|
"args": {},
|
|
542
|
-
"description": "
|
|
609
|
+
"description": "Enable error reporting to Sentry",
|
|
543
610
|
"examples": [
|
|
544
|
-
"$ lps
|
|
611
|
+
"$ lps telemetry enable"
|
|
545
612
|
],
|
|
546
613
|
"flags": {},
|
|
547
614
|
"hasDynamicHelp": false,
|
|
548
615
|
"hiddenAliases": [],
|
|
549
|
-
"id": "
|
|
616
|
+
"id": "telemetry:enable",
|
|
550
617
|
"pluginAlias": "@loopress/cli",
|
|
551
618
|
"pluginName": "@loopress/cli",
|
|
552
619
|
"pluginType": "core",
|
|
@@ -556,34 +623,10 @@
|
|
|
556
623
|
"relativePath": [
|
|
557
624
|
"dist",
|
|
558
625
|
"commands",
|
|
559
|
-
"
|
|
560
|
-
"
|
|
561
|
-
]
|
|
562
|
-
},
|
|
563
|
-
"project:sync": {
|
|
564
|
-
"aliases": [],
|
|
565
|
-
"args": {},
|
|
566
|
-
"description": "Sync locally configured projects and environments with your Loopress account",
|
|
567
|
-
"examples": [
|
|
568
|
-
"$ lps project sync"
|
|
569
|
-
],
|
|
570
|
-
"flags": {},
|
|
571
|
-
"hasDynamicHelp": false,
|
|
572
|
-
"hiddenAliases": [],
|
|
573
|
-
"id": "project:sync",
|
|
574
|
-
"pluginAlias": "@loopress/cli",
|
|
575
|
-
"pluginName": "@loopress/cli",
|
|
576
|
-
"pluginType": "core",
|
|
577
|
-
"strict": true,
|
|
578
|
-
"enableJsonFlag": false,
|
|
579
|
-
"isESM": true,
|
|
580
|
-
"relativePath": [
|
|
581
|
-
"dist",
|
|
582
|
-
"commands",
|
|
583
|
-
"project",
|
|
584
|
-
"sync.js"
|
|
626
|
+
"telemetry",
|
|
627
|
+
"enable.js"
|
|
585
628
|
]
|
|
586
629
|
}
|
|
587
630
|
},
|
|
588
|
-
"version": "0.
|
|
631
|
+
"version": "0.14.0"
|
|
589
632
|
}
|
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.
|
|
4
|
+
"version": "0.14.0",
|
|
5
5
|
"author": "jean-smaug",
|
|
6
6
|
"bin": {
|
|
7
7
|
"loopress": "bin/run.js",
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
"glob": "13.0.6",
|
|
20
20
|
"got": "^15.0.7",
|
|
21
21
|
"listr2": "^10.2.2",
|
|
22
|
+
"open": "^10.2.0",
|
|
22
23
|
"slugify": "^1.6.9",
|
|
23
24
|
"write-file-atomic": "^5.0.1"
|
|
24
25
|
},
|
|
@@ -94,6 +95,9 @@
|
|
|
94
95
|
},
|
|
95
96
|
"snippet": {
|
|
96
97
|
"description": "Manage WordPress code snippets"
|
|
98
|
+
},
|
|
99
|
+
"telemetry": {
|
|
100
|
+
"description": "Manage error reporting preferences"
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
},
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
"test": "vitest run",
|
|
118
122
|
"pretest:mutation": "pnpm run schema:types",
|
|
119
123
|
"test:mutation": "stryker run",
|
|
120
|
-
"version": "oclif readme && git add README.md",
|
|
124
|
+
"version": "oclif manifest && oclif readme && git add README.md oclif.manifest.json",
|
|
121
125
|
"format": "prettier . --write"
|
|
122
126
|
}
|
|
123
127
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
3
|
"$id": "https://loopress.dev/schema/global-config.json",
|
|
4
4
|
"title": "Loopress global configuration",
|
|
5
|
-
"description": "Global CLI state stored at ~/.loopress/config.json: known projects, their environments, and which one is currently active.",
|
|
5
|
+
"description": "Global CLI state stored at $XDG_CONFIG_HOME/loopress/config.json (or ~/.config/loopress/config.json): known projects, their environments, and which one is currently active.",
|
|
6
6
|
"type": "object",
|
|
7
7
|
"additionalProperties": false,
|
|
8
8
|
"required": ["currentProject", "projects"],
|
|
@@ -15,6 +15,10 @@
|
|
|
15
15
|
"type": "object",
|
|
16
16
|
"description": "Known projects, keyed by project id.",
|
|
17
17
|
"additionalProperties": {"$ref": "#/definitions/ProjectConfig"}
|
|
18
|
+
},
|
|
19
|
+
"telemetry": {
|
|
20
|
+
"description": "User preferences for error reporting, set via `lps telemetry disable`/`lps telemetry enable`.",
|
|
21
|
+
"$ref": "#/definitions/TelemetryConfig"
|
|
18
22
|
}
|
|
19
23
|
},
|
|
20
24
|
"definitions": {
|
|
@@ -59,6 +63,18 @@
|
|
|
59
63
|
}
|
|
60
64
|
}
|
|
61
65
|
},
|
|
66
|
+
"TelemetryConfig": {
|
|
67
|
+
"title": "TelemetryConfig",
|
|
68
|
+
"type": "object",
|
|
69
|
+
"additionalProperties": false,
|
|
70
|
+
"required": ["disabled"],
|
|
71
|
+
"properties": {
|
|
72
|
+
"disabled": {
|
|
73
|
+
"type": "boolean",
|
|
74
|
+
"description": "Whether error reporting to Sentry is disabled."
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
},
|
|
62
78
|
"EnvironmentConfig": {
|
|
63
79
|
"title": "EnvironmentConfig",
|
|
64
80
|
"type": "object",
|
|
@@ -25,15 +25,14 @@
|
|
|
25
25
|
},
|
|
26
26
|
"plugins": {
|
|
27
27
|
"type": "object",
|
|
28
|
-
"description": "
|
|
28
|
+
"description": "WordPress.org plugins managed by Loopress. Keys are plugin slugs; values are written as \"latest\" since installs go through WordPress's native plugin API, which only installs the current version. Older files may still have a pinned version string here from before this was the case; it is read but no longer acted on.",
|
|
29
29
|
"additionalProperties": {
|
|
30
30
|
"type": "string",
|
|
31
|
-
"
|
|
32
|
-
"examples": ["8.9.1", "latest"]
|
|
31
|
+
"examples": ["latest"]
|
|
33
32
|
},
|
|
34
33
|
"examples": [
|
|
35
34
|
{
|
|
36
|
-
"woocommerce": "
|
|
35
|
+
"woocommerce": "latest",
|
|
37
36
|
"contact-form-7": "latest"
|
|
38
37
|
}
|
|
39
38
|
]
|