@loopress/cli 0.11.0 → 0.13.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 +45 -20
- package/dist/commands/login.d.ts +0 -1
- package/dist/commands/login.js +21 -90
- package/dist/commands/project/config.d.ts +2 -0
- package/dist/commands/project/config.js +45 -11
- package/dist/commands/project/sync.js +15 -5
- package/dist/commands/snippet/publish.d.ts +10 -0
- package/dist/commands/snippet/publish.js +74 -0
- package/dist/commands/snippet/pull.d.ts +1 -0
- package/dist/commands/snippet/pull.js +38 -4
- package/dist/commands/snippet/push.js +5 -61
- package/dist/config/project-config.manager.d.ts +3 -0
- package/dist/config/project-config.manager.js +12 -0
- package/dist/lib/load-snippets.d.ts +2 -0
- package/dist/lib/load-snippets.js +84 -0
- package/dist/lib/local-callback-server.d.ts +25 -0
- package/dist/lib/local-callback-server.js +93 -0
- package/dist/lib/open-browser.d.ts +2 -0
- package/dist/lib/open-browser.js +12 -0
- package/dist/lib/wp-authorize-flow.d.ts +10 -0
- package/dist/lib/wp-authorize-flow.js +53 -0
- package/dist/lib/wp-client.js +18 -1
- package/dist/lib/wp-site-diagnostic.d.ts +13 -0
- package/dist/lib/wp-site-diagnostic.js +46 -0
- package/oclif.manifest.json +138 -108
- package/package.json +2 -1
package/oclif.manifest.json
CHANGED
|
@@ -311,41 +311,63 @@
|
|
|
311
311
|
"push.js"
|
|
312
312
|
]
|
|
313
313
|
},
|
|
314
|
-
"
|
|
314
|
+
"snippet:list": {
|
|
315
315
|
"aliases": [],
|
|
316
316
|
"args": {},
|
|
317
|
-
"description": "
|
|
317
|
+
"description": "List snippets from WordPress",
|
|
318
318
|
"examples": [
|
|
319
|
-
"$ lps
|
|
319
|
+
"$ lps snippet list"
|
|
320
320
|
],
|
|
321
|
-
"flags": {
|
|
321
|
+
"flags": {
|
|
322
|
+
"json": {
|
|
323
|
+
"char": "j",
|
|
324
|
+
"description": "Output in JSON format",
|
|
325
|
+
"name": "json",
|
|
326
|
+
"allowNo": false,
|
|
327
|
+
"type": "boolean"
|
|
328
|
+
}
|
|
329
|
+
},
|
|
322
330
|
"hasDynamicHelp": false,
|
|
323
331
|
"hiddenAliases": [],
|
|
324
|
-
"id": "
|
|
332
|
+
"id": "snippet:list",
|
|
325
333
|
"pluginAlias": "@loopress/cli",
|
|
326
334
|
"pluginName": "@loopress/cli",
|
|
327
335
|
"pluginType": "core",
|
|
328
336
|
"strict": true,
|
|
329
337
|
"enableJsonFlag": false,
|
|
338
|
+
"dryRunFlag": {
|
|
339
|
+
"dry-run": {
|
|
340
|
+
"char": "d",
|
|
341
|
+
"description": "Show what would change without making changes",
|
|
342
|
+
"allowNo": false,
|
|
343
|
+
"type": "boolean"
|
|
344
|
+
}
|
|
345
|
+
},
|
|
330
346
|
"isESM": true,
|
|
331
347
|
"relativePath": [
|
|
332
348
|
"dist",
|
|
333
349
|
"commands",
|
|
334
|
-
"
|
|
335
|
-
"
|
|
350
|
+
"snippet",
|
|
351
|
+
"list.js"
|
|
336
352
|
]
|
|
337
353
|
},
|
|
338
|
-
"
|
|
354
|
+
"snippet:publish": {
|
|
339
355
|
"aliases": [],
|
|
340
|
-
"args": {
|
|
341
|
-
|
|
356
|
+
"args": {
|
|
357
|
+
"path": {
|
|
358
|
+
"description": "Path to snippets directory (overrides project config)",
|
|
359
|
+
"name": "path"
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"description": "Publish snippets to your Loopress account so they can be deployed to other projects. Does not touch any WordPress site.",
|
|
342
363
|
"examples": [
|
|
343
|
-
"$ lps
|
|
364
|
+
"$ lps snippet publish",
|
|
365
|
+
"$ lps snippet publish --path ./snippets"
|
|
344
366
|
],
|
|
345
367
|
"flags": {},
|
|
346
368
|
"hasDynamicHelp": false,
|
|
347
369
|
"hiddenAliases": [],
|
|
348
|
-
"id": "
|
|
370
|
+
"id": "snippet:publish",
|
|
349
371
|
"pluginAlias": "@loopress/cli",
|
|
350
372
|
"pluginName": "@loopress/cli",
|
|
351
373
|
"pluginType": "core",
|
|
@@ -355,45 +377,104 @@
|
|
|
355
377
|
"relativePath": [
|
|
356
378
|
"dist",
|
|
357
379
|
"commands",
|
|
358
|
-
"
|
|
359
|
-
"
|
|
380
|
+
"snippet",
|
|
381
|
+
"publish.js"
|
|
360
382
|
]
|
|
361
383
|
},
|
|
362
|
-
"
|
|
384
|
+
"snippet:pull": {
|
|
363
385
|
"aliases": [],
|
|
364
|
-
"args": {
|
|
365
|
-
|
|
386
|
+
"args": {
|
|
387
|
+
"path": {
|
|
388
|
+
"description": "Path to snippets directory (overrides project config)",
|
|
389
|
+
"name": "path"
|
|
390
|
+
}
|
|
391
|
+
},
|
|
392
|
+
"description": "Pull snippets from WordPress",
|
|
366
393
|
"examples": [
|
|
367
|
-
"$ lps
|
|
394
|
+
"$ lps snippet pull",
|
|
395
|
+
"$ lps snippet pull --path ./snippets"
|
|
368
396
|
],
|
|
369
|
-
"flags": {
|
|
397
|
+
"flags": {
|
|
398
|
+
"dry-run": {
|
|
399
|
+
"char": "d",
|
|
400
|
+
"description": "Show what would change without making changes",
|
|
401
|
+
"name": "dry-run",
|
|
402
|
+
"allowNo": false,
|
|
403
|
+
"type": "boolean"
|
|
404
|
+
}
|
|
405
|
+
},
|
|
370
406
|
"hasDynamicHelp": false,
|
|
371
407
|
"hiddenAliases": [],
|
|
372
|
-
"id": "
|
|
408
|
+
"id": "snippet:pull",
|
|
373
409
|
"pluginAlias": "@loopress/cli",
|
|
374
410
|
"pluginName": "@loopress/cli",
|
|
375
411
|
"pluginType": "core",
|
|
376
412
|
"strict": true,
|
|
377
413
|
"enableJsonFlag": false,
|
|
414
|
+
"dryRunFlag": {
|
|
415
|
+
"dry-run": {
|
|
416
|
+
"char": "d",
|
|
417
|
+
"description": "Show what would change without making changes",
|
|
418
|
+
"allowNo": false,
|
|
419
|
+
"type": "boolean"
|
|
420
|
+
}
|
|
421
|
+
},
|
|
378
422
|
"isESM": true,
|
|
379
423
|
"relativePath": [
|
|
380
424
|
"dist",
|
|
381
425
|
"commands",
|
|
382
|
-
"
|
|
383
|
-
"
|
|
426
|
+
"snippet",
|
|
427
|
+
"pull.js"
|
|
384
428
|
]
|
|
385
429
|
},
|
|
386
|
-
"
|
|
430
|
+
"snippet:push": {
|
|
431
|
+
"aliases": [],
|
|
432
|
+
"args": {
|
|
433
|
+
"path": {
|
|
434
|
+
"description": "Path to snippets directory (overrides project config)",
|
|
435
|
+
"name": "path"
|
|
436
|
+
}
|
|
437
|
+
},
|
|
438
|
+
"description": "Push snippets to WordPress. Local snippet files created or updated remotely are renamed on disk to the `<id>-<slug>` convention.",
|
|
439
|
+
"examples": [
|
|
440
|
+
"$ lps snippet push",
|
|
441
|
+
"$ lps snippet push --path ./snippets"
|
|
442
|
+
],
|
|
443
|
+
"flags": {
|
|
444
|
+
"dry-run": {
|
|
445
|
+
"char": "d",
|
|
446
|
+
"description": "Show what would change without making changes",
|
|
447
|
+
"name": "dry-run",
|
|
448
|
+
"allowNo": false,
|
|
449
|
+
"type": "boolean"
|
|
450
|
+
}
|
|
451
|
+
},
|
|
452
|
+
"hasDynamicHelp": false,
|
|
453
|
+
"hiddenAliases": [],
|
|
454
|
+
"id": "snippet:push",
|
|
455
|
+
"pluginAlias": "@loopress/cli",
|
|
456
|
+
"pluginName": "@loopress/cli",
|
|
457
|
+
"pluginType": "core",
|
|
458
|
+
"strict": true,
|
|
459
|
+
"isESM": true,
|
|
460
|
+
"relativePath": [
|
|
461
|
+
"dist",
|
|
462
|
+
"commands",
|
|
463
|
+
"snippet",
|
|
464
|
+
"push.js"
|
|
465
|
+
]
|
|
466
|
+
},
|
|
467
|
+
"project:config": {
|
|
387
468
|
"aliases": [],
|
|
388
469
|
"args": {},
|
|
389
|
-
"description": "
|
|
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.",
|
|
390
471
|
"examples": [
|
|
391
|
-
"$ lps project
|
|
472
|
+
"$ lps project config"
|
|
392
473
|
],
|
|
393
474
|
"flags": {},
|
|
394
475
|
"hasDynamicHelp": false,
|
|
395
476
|
"hiddenAliases": [],
|
|
396
|
-
"id": "project:
|
|
477
|
+
"id": "project:config",
|
|
397
478
|
"pluginAlias": "@loopress/cli",
|
|
398
479
|
"pluginName": "@loopress/cli",
|
|
399
480
|
"pluginType": "core",
|
|
@@ -404,20 +485,20 @@
|
|
|
404
485
|
"dist",
|
|
405
486
|
"commands",
|
|
406
487
|
"project",
|
|
407
|
-
"
|
|
488
|
+
"config.js"
|
|
408
489
|
]
|
|
409
490
|
},
|
|
410
|
-
"project:
|
|
491
|
+
"project:list": {
|
|
411
492
|
"aliases": [],
|
|
412
493
|
"args": {},
|
|
413
|
-
"description": "
|
|
494
|
+
"description": "List configured WordPress projects",
|
|
414
495
|
"examples": [
|
|
415
|
-
"$ lps project
|
|
496
|
+
"$ lps project list"
|
|
416
497
|
],
|
|
417
498
|
"flags": {},
|
|
418
499
|
"hasDynamicHelp": false,
|
|
419
500
|
"hiddenAliases": [],
|
|
420
|
-
"id": "project:
|
|
501
|
+
"id": "project:list",
|
|
421
502
|
"pluginAlias": "@loopress/cli",
|
|
422
503
|
"pluginName": "@loopress/cli",
|
|
423
504
|
"pluginType": "core",
|
|
@@ -428,132 +509,81 @@
|
|
|
428
509
|
"dist",
|
|
429
510
|
"commands",
|
|
430
511
|
"project",
|
|
431
|
-
"
|
|
512
|
+
"list.js"
|
|
432
513
|
]
|
|
433
514
|
},
|
|
434
|
-
"
|
|
515
|
+
"project:remove": {
|
|
435
516
|
"aliases": [],
|
|
436
517
|
"args": {},
|
|
437
|
-
"description": "
|
|
518
|
+
"description": "Remove one or more WordPress projects or environments",
|
|
438
519
|
"examples": [
|
|
439
|
-
"$ lps
|
|
520
|
+
"$ lps project remove"
|
|
440
521
|
],
|
|
441
|
-
"flags": {
|
|
442
|
-
"json": {
|
|
443
|
-
"char": "j",
|
|
444
|
-
"description": "Output in JSON format",
|
|
445
|
-
"name": "json",
|
|
446
|
-
"allowNo": false,
|
|
447
|
-
"type": "boolean"
|
|
448
|
-
}
|
|
449
|
-
},
|
|
522
|
+
"flags": {},
|
|
450
523
|
"hasDynamicHelp": false,
|
|
451
524
|
"hiddenAliases": [],
|
|
452
|
-
"id": "
|
|
525
|
+
"id": "project:remove",
|
|
453
526
|
"pluginAlias": "@loopress/cli",
|
|
454
527
|
"pluginName": "@loopress/cli",
|
|
455
528
|
"pluginType": "core",
|
|
456
529
|
"strict": true,
|
|
457
530
|
"enableJsonFlag": false,
|
|
458
|
-
"dryRunFlag": {
|
|
459
|
-
"dry-run": {
|
|
460
|
-
"char": "d",
|
|
461
|
-
"description": "Show what would change without making changes",
|
|
462
|
-
"allowNo": false,
|
|
463
|
-
"type": "boolean"
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
531
|
"isESM": true,
|
|
467
532
|
"relativePath": [
|
|
468
533
|
"dist",
|
|
469
534
|
"commands",
|
|
470
|
-
"
|
|
471
|
-
"
|
|
535
|
+
"project",
|
|
536
|
+
"remove.js"
|
|
472
537
|
]
|
|
473
538
|
},
|
|
474
|
-
"
|
|
539
|
+
"project:switch": {
|
|
475
540
|
"aliases": [],
|
|
476
|
-
"args": {
|
|
477
|
-
|
|
478
|
-
"description": "Path to snippets directory (overrides project config)",
|
|
479
|
-
"name": "path"
|
|
480
|
-
}
|
|
481
|
-
},
|
|
482
|
-
"description": "Pull snippets from WordPress",
|
|
541
|
+
"args": {},
|
|
542
|
+
"description": "Switch the active project and environment",
|
|
483
543
|
"examples": [
|
|
484
|
-
"$ lps
|
|
485
|
-
"$ lps snippet pull --path ./snippets"
|
|
544
|
+
"$ lps project switch"
|
|
486
545
|
],
|
|
487
|
-
"flags": {
|
|
488
|
-
"dry-run": {
|
|
489
|
-
"char": "d",
|
|
490
|
-
"description": "Show what would change without making changes",
|
|
491
|
-
"name": "dry-run",
|
|
492
|
-
"allowNo": false,
|
|
493
|
-
"type": "boolean"
|
|
494
|
-
}
|
|
495
|
-
},
|
|
546
|
+
"flags": {},
|
|
496
547
|
"hasDynamicHelp": false,
|
|
497
548
|
"hiddenAliases": [],
|
|
498
|
-
"id": "
|
|
549
|
+
"id": "project:switch",
|
|
499
550
|
"pluginAlias": "@loopress/cli",
|
|
500
551
|
"pluginName": "@loopress/cli",
|
|
501
552
|
"pluginType": "core",
|
|
502
553
|
"strict": true,
|
|
503
554
|
"enableJsonFlag": false,
|
|
504
|
-
"dryRunFlag": {
|
|
505
|
-
"dry-run": {
|
|
506
|
-
"char": "d",
|
|
507
|
-
"description": "Show what would change without making changes",
|
|
508
|
-
"allowNo": false,
|
|
509
|
-
"type": "boolean"
|
|
510
|
-
}
|
|
511
|
-
},
|
|
512
555
|
"isESM": true,
|
|
513
556
|
"relativePath": [
|
|
514
557
|
"dist",
|
|
515
558
|
"commands",
|
|
516
|
-
"
|
|
517
|
-
"
|
|
559
|
+
"project",
|
|
560
|
+
"switch.js"
|
|
518
561
|
]
|
|
519
562
|
},
|
|
520
|
-
"
|
|
563
|
+
"project:sync": {
|
|
521
564
|
"aliases": [],
|
|
522
|
-
"args": {
|
|
523
|
-
|
|
524
|
-
"description": "Path to snippets directory (overrides project config)",
|
|
525
|
-
"name": "path"
|
|
526
|
-
}
|
|
527
|
-
},
|
|
528
|
-
"description": "Push snippets to WordPress. Local snippet files created or updated remotely are renamed on disk to the `<id>-<slug>` convention.",
|
|
565
|
+
"args": {},
|
|
566
|
+
"description": "Sync locally configured projects and environments with your Loopress account",
|
|
529
567
|
"examples": [
|
|
530
|
-
"$ lps
|
|
531
|
-
"$ lps snippet push --path ./snippets"
|
|
568
|
+
"$ lps project sync"
|
|
532
569
|
],
|
|
533
|
-
"flags": {
|
|
534
|
-
"dry-run": {
|
|
535
|
-
"char": "d",
|
|
536
|
-
"description": "Show what would change without making changes",
|
|
537
|
-
"name": "dry-run",
|
|
538
|
-
"allowNo": false,
|
|
539
|
-
"type": "boolean"
|
|
540
|
-
}
|
|
541
|
-
},
|
|
570
|
+
"flags": {},
|
|
542
571
|
"hasDynamicHelp": false,
|
|
543
572
|
"hiddenAliases": [],
|
|
544
|
-
"id": "
|
|
573
|
+
"id": "project:sync",
|
|
545
574
|
"pluginAlias": "@loopress/cli",
|
|
546
575
|
"pluginName": "@loopress/cli",
|
|
547
576
|
"pluginType": "core",
|
|
548
577
|
"strict": true,
|
|
578
|
+
"enableJsonFlag": false,
|
|
549
579
|
"isESM": true,
|
|
550
580
|
"relativePath": [
|
|
551
581
|
"dist",
|
|
552
582
|
"commands",
|
|
553
|
-
"
|
|
554
|
-
"
|
|
583
|
+
"project",
|
|
584
|
+
"sync.js"
|
|
555
585
|
]
|
|
556
586
|
}
|
|
557
587
|
},
|
|
558
|
-
"version": "0.
|
|
588
|
+
"version": "0.13.0"
|
|
559
589
|
}
|
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.13.0",
|
|
5
5
|
"author": "jean-smaug",
|
|
6
6
|
"bin": {
|
|
7
7
|
"loopress": "bin/run.js",
|
|
@@ -109,6 +109,7 @@
|
|
|
109
109
|
"prewatch": "pnpm run schema:types",
|
|
110
110
|
"watch": "tsc -b --watch",
|
|
111
111
|
"build": "shx rm -rf dist && pnpm run schema:types && tsc -b",
|
|
112
|
+
"prelint": "pnpm run schema:types",
|
|
112
113
|
"lint": "eslint",
|
|
113
114
|
"pretest": "pnpm run schema:types",
|
|
114
115
|
"posttest": "pnpm run lint",
|