@loopress/cli 0.27.0 → 0.28.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 (75) hide show
  1. package/README.md +267 -175
  2. package/dist/commands/app/pull.js +17 -4
  3. package/dist/commands/app/push.d.ts +3 -0
  4. package/dist/commands/app/push.js +29 -5
  5. package/dist/commands/composer/push.js +1 -19
  6. package/dist/commands/diff.js +1 -1
  7. package/dist/commands/init.js +2 -0
  8. package/dist/commands/plugin/add.js +6 -3
  9. package/dist/commands/plugin/audit.js +4 -5
  10. package/dist/commands/plugin/pull.d.ts +3 -1
  11. package/dist/commands/plugin/pull.js +17 -9
  12. package/dist/commands/plugin/push.d.ts +5 -1
  13. package/dist/commands/plugin/push.js +90 -37
  14. package/dist/commands/plugin/status.d.ts +1 -0
  15. package/dist/commands/plugin/status.js +21 -2
  16. package/dist/commands/project/config.js +12 -8
  17. package/dist/commands/promote.d.ts +2 -0
  18. package/dist/commands/promote.js +69 -8
  19. package/dist/commands/pull.js +2 -2
  20. package/dist/commands/push.d.ts +1 -0
  21. package/dist/commands/push.js +37 -3
  22. package/dist/commands/template/diff.d.ts +10 -0
  23. package/dist/commands/template/diff.js +13 -0
  24. package/dist/commands/template/list.d.ts +13 -0
  25. package/dist/commands/template/list.js +23 -0
  26. package/dist/commands/template/push.d.ts +20 -0
  27. package/dist/commands/template/push.js +42 -0
  28. package/dist/commands/theme/pull.d.ts +3 -1
  29. package/dist/commands/theme/pull.js +10 -4
  30. package/dist/commands/theme/style/diff.d.ts +2 -0
  31. package/dist/commands/{theme-styles → theme/style}/diff.js +2 -1
  32. package/dist/commands/{theme-styles → theme/style}/pull.d.ts +1 -1
  33. package/dist/commands/{theme-styles → theme/style}/pull.js +3 -3
  34. package/dist/commands/{theme-styles → theme/style}/push.d.ts +1 -1
  35. package/dist/commands/{theme-styles → theme/style}/push.js +5 -5
  36. package/dist/commands/theme/style/rollback.d.ts +2 -0
  37. package/dist/commands/theme/style/rollback.js +6 -0
  38. package/dist/lib/api-client.js +3 -1
  39. package/dist/lib/app-build.d.ts +5 -0
  40. package/dist/lib/app-build.js +69 -0
  41. package/dist/lib/app-manifest.d.ts +4 -0
  42. package/dist/lib/app-manifest.js +8 -0
  43. package/dist/lib/base.js +11 -2
  44. package/dist/lib/bootstrap-full-install.js +45 -14
  45. package/dist/lib/dev-watch.d.ts +1 -1
  46. package/dist/lib/dev-watch.js +3 -1
  47. package/dist/lib/diff-command.d.ts +1 -0
  48. package/dist/lib/diff-command.js +6 -4
  49. package/dist/lib/resource-state.js +43 -1
  50. package/dist/lib/rollback-command.d.ts +1 -0
  51. package/dist/lib/rollback-command.js +8 -6
  52. package/dist/lib/rotate-app-password.js +2 -2
  53. package/dist/lib/validate-local.js +6 -0
  54. package/dist/lib/wp-client.d.ts +4 -1
  55. package/dist/lib/wp-client.js +25 -1
  56. package/dist/types/plugin.d.ts +8 -1
  57. package/dist/types/plugin.js +4 -1
  58. package/dist/types/project-config.generated.d.ts +19 -2
  59. package/dist/utils/composer.d.ts +14 -0
  60. package/dist/utils/composer.js +136 -0
  61. package/dist/utils/page-format.d.ts +8 -0
  62. package/dist/utils/page-format.js +34 -26
  63. package/dist/utils/plugins.d.ts +9 -4
  64. package/dist/utils/plugins.js +16 -7
  65. package/dist/utils/resource-dirs.d.ts +2 -0
  66. package/dist/utils/resource-dirs.js +4 -0
  67. package/dist/utils/seo-format.d.ts +2 -2
  68. package/dist/utils/template-format.d.ts +30 -0
  69. package/dist/utils/template-format.js +36 -0
  70. package/oclif.manifest.json +526 -324
  71. package/package.json +3 -2
  72. package/schemas/project-config.schema.json +25 -4
  73. package/dist/commands/theme-styles/diff.d.ts +0 -2
  74. package/dist/commands/theme-styles/rollback.d.ts +0 -2
  75. package/dist/commands/theme-styles/rollback.js +0 -5
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.27.0",
4
+ "version": "0.28.0",
5
5
  "author": "jean-smaug",
6
6
  "bin": {
7
7
  "loopress": "bin/run.js",
@@ -121,7 +121,7 @@
121
121
  "theme": {
122
122
  "description": "Manage WordPress.org themes tracked in loopress.json (versions only, never switches the active theme)"
123
123
  },
124
- "theme-styles": {
124
+ "theme:style": {
125
125
  "description": "Manage the active block theme's Global Styles customizations (Site Editor > Styles: colors, typography, spacing)"
126
126
  },
127
127
  "telemetry": {
@@ -148,6 +148,7 @@
148
148
  "posttest": "pnpm run lint",
149
149
  "schema:types": "tsx scripts/generate-config-types.ts",
150
150
  "test": "vitest run",
151
+ "typecheck:test": "tsc -p test/tsconfig.json",
151
152
  "pretest:mutation": "pnpm run schema:types",
152
153
  "test:mutation": "stryker run",
153
154
  "version": "oclif manifest && oclif readme && git add README.md oclif.manifest.json",
@@ -54,6 +54,16 @@
54
54
  "description": "Directory where static HTML pages (one <slug>.html per WordPress page, managed by Loopress) are read from, relative to rootDir.",
55
55
  "default": "pages"
56
56
  },
57
+ "templateDir": {
58
+ "type": "string",
59
+ "description": "Directory where block templates (one <slug>.html per template, written to the Loopress child theme of the active block theme) are read from, relative to rootDir. A static page uses one with its `template` header.",
60
+ "default": "templates"
61
+ },
62
+ "partDir": {
63
+ "type": "string",
64
+ "description": "Directory where block template parts (one <slug>.html per part, written to the Loopress child theme of the active block theme) are read from, relative to rootDir.",
65
+ "default": "parts"
66
+ },
57
67
  "optionsDir": {
58
68
  "type": "string",
59
69
  "description": "Directory where explicitly tracked WordPress options (wp_options rows) are read from and written to, relative to rootDir. Only options added via `lps option add` live here, this is never the whole options table.",
@@ -75,15 +85,26 @@
75
85
  },
76
86
  "plugins": {
77
87
  "type": "object",
78
- "description": "WordPress.org plugins managed by Loopress, installed via Composer + WPackagist on the site. Keys are plugin slugs. A value is either an exact version to pin (e.g. \"9.4.2\") or \"latest\" to track the newest release on every push. Removing an entry uninstalls the plugin on the next push. Ignored when a composer.json exists in rootDir (that file becomes authoritative).",
88
+ "description": "WordPress.org plugins managed by Loopress, installed via Composer + WPackagist on the site. Keys are plugin slugs. A value is either an exact version to pin (e.g. \"9.4.2\") or \"latest\" to track the newest release on every push, and the plugin is kept active. An object with \"active\": false keeps the plugin installed but inactive. Removing an entry uninstalls the plugin on the next push. Ignored when a composer.json exists in rootDir (that file becomes authoritative).",
79
89
  "additionalProperties": {
80
- "type": "string",
81
- "examples": ["9.4.2", "latest"]
90
+ "anyOf": [
91
+ {"type": "string", "examples": ["9.4.2", "latest"]},
92
+ {
93
+ "type": "object",
94
+ "properties": {
95
+ "version": {"type": "string", "description": "Exact version to pin, or \"latest\".", "examples": ["1.7.2", "latest"]},
96
+ "active": {"type": "boolean", "description": "false keeps the plugin installed but inactive. Defaults to true.", "default": true}
97
+ },
98
+ "required": ["version"],
99
+ "additionalProperties": false
100
+ }
101
+ ]
82
102
  },
83
103
  "examples": [
84
104
  {
85
105
  "woocommerce": "9.4.2",
86
- "wordpress-seo": "latest"
106
+ "wordpress-seo": "latest",
107
+ "hello-dolly": {"version": "1.7.2", "active": false}
87
108
  }
88
109
  ]
89
110
  },
@@ -1,2 +0,0 @@
1
- declare const _default: typeof import("../../lib/diff-command.js").DiffCommand;
2
- export default _default;
@@ -1,2 +0,0 @@
1
- declare const _default: typeof import("../../lib/base.js").LoopressCommand;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- import { resourceRollbackCommand } from '../../lib/rollback-command.js';
2
- export default resourceRollbackCommand('theme-styles', {
3
- description: 'Restore the active theme’s Global Styles to a snapshot taken automatically before an earlier `lps theme-styles push`',
4
- pathNoun: 'theme styles directory',
5
- });