@loopress/cli 0.32.2 → 0.34.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 (166) hide show
  1. package/README.md +549 -179
  2. package/dist/commands/acf/list.d.ts +1 -1
  3. package/dist/commands/acf/list.js +3 -4
  4. package/dist/commands/acf/pull.d.ts +1 -1
  5. package/dist/commands/acf/pull.js +9 -6
  6. package/dist/commands/acf/push.d.ts +1 -1
  7. package/dist/commands/acf/push.js +5 -4
  8. package/dist/commands/api/publish.js +2 -1
  9. package/dist/commands/app/pull.js +2 -1
  10. package/dist/commands/app/push.js +7 -5
  11. package/dist/commands/app/{remove.d.ts → rm.d.ts} +1 -0
  12. package/dist/commands/app/{remove.js → rm.js} +2 -1
  13. package/dist/commands/block/diff.d.ts +2 -0
  14. package/dist/commands/block/diff.js +5 -0
  15. package/dist/commands/block/list.d.ts +8 -0
  16. package/dist/commands/block/list.js +23 -0
  17. package/dist/commands/block/pull.d.ts +21 -0
  18. package/dist/commands/block/pull.js +67 -0
  19. package/dist/commands/block/push.d.ts +20 -0
  20. package/dist/commands/block/push.js +53 -0
  21. package/dist/commands/block/rm.d.ts +23 -0
  22. package/dist/commands/block/rm.js +69 -0
  23. package/dist/commands/block/rollback.d.ts +2 -0
  24. package/dist/commands/block/rollback.js +5 -0
  25. package/dist/commands/composer/init.js +1 -0
  26. package/dist/commands/composer/push.js +5 -4
  27. package/dist/commands/content/copy.d.ts +3 -0
  28. package/dist/commands/content/copy.js +79 -2
  29. package/dist/commands/dev.d.ts +2 -2
  30. package/dist/commands/dev.js +13 -18
  31. package/dist/commands/diff.d.ts +6 -3
  32. package/dist/commands/diff.js +63 -13
  33. package/dist/commands/doctor.d.ts +4 -2
  34. package/dist/commands/doctor.js +49 -25
  35. package/dist/commands/form/pull.js +7 -5
  36. package/dist/commands/form/push.js +4 -3
  37. package/dist/commands/init.js +4 -3
  38. package/dist/commands/menu/push.js +8 -8
  39. package/dist/commands/option/list.js +5 -2
  40. package/dist/commands/option/push.js +3 -1
  41. package/dist/commands/option/{remove.d.ts → rm.d.ts} +1 -0
  42. package/dist/commands/option/{remove.js → rm.js} +2 -1
  43. package/dist/commands/page/push.js +3 -1
  44. package/dist/commands/plugin/add.d.ts +1 -0
  45. package/dist/commands/plugin/add.js +50 -9
  46. package/dist/commands/plugin/audit.d.ts +4 -4
  47. package/dist/commands/plugin/audit.js +35 -15
  48. package/dist/commands/plugin/pull.js +3 -2
  49. package/dist/commands/plugin/push.js +41 -6
  50. package/dist/commands/plugin/status.js +3 -1
  51. package/dist/commands/project/config.js +7 -7
  52. package/dist/commands/project/pull.js +3 -1
  53. package/dist/commands/project/push.js +6 -4
  54. package/dist/commands/project/{remove.d.ts → rm.d.ts} +1 -0
  55. package/dist/commands/project/{remove.js → rm.js} +3 -2
  56. package/dist/commands/project/switch.js +6 -4
  57. package/dist/commands/promote.d.ts +1 -0
  58. package/dist/commands/promote.js +15 -6
  59. package/dist/commands/pull.d.ts +7 -0
  60. package/dist/commands/pull.js +67 -18
  61. package/dist/commands/push.d.ts +11 -1
  62. package/dist/commands/push.js +157 -48
  63. package/dist/commands/snippet/publish.js +9 -5
  64. package/dist/commands/snippet/push.d.ts +1 -1
  65. package/dist/commands/snippet/push.js +15 -12
  66. package/dist/commands/status.js +1 -0
  67. package/dist/commands/theme/activate.d.ts +21 -0
  68. package/dist/commands/theme/activate.js +44 -0
  69. package/dist/commands/theme/pull.js +2 -1
  70. package/dist/commands/theme/push.js +7 -3
  71. package/dist/commands/theme/style/diff.js +1 -1
  72. package/dist/commands/theme/style/push.js +8 -3
  73. package/dist/commands/theme/style/rollback.js +1 -1
  74. package/dist/commands/theme/template/push.d.ts +2 -0
  75. package/dist/commands/theme/template/push.js +66 -18
  76. package/dist/commands/validate.js +3 -0
  77. package/dist/config/auth.manager.d.ts +10 -7
  78. package/dist/config/auth.manager.js +5 -1
  79. package/dist/config/json-file.d.ts +1 -1
  80. package/dist/config/project-config.manager.d.ts +2 -2
  81. package/dist/config/project-config.manager.js +13 -21
  82. package/dist/lib/api-client.js +16 -21
  83. package/dist/lib/app-build.js +6 -2
  84. package/dist/lib/app-manifest.js +6 -6
  85. package/dist/lib/base.d.ts +8 -1
  86. package/dist/lib/base.js +43 -9
  87. package/dist/lib/bootstrap-full-install.js +8 -6
  88. package/dist/lib/capabilities.d.ts +44 -0
  89. package/dist/lib/capabilities.js +85 -0
  90. package/dist/lib/declared-plugins.d.ts +9 -0
  91. package/dist/lib/declared-plugins.js +21 -0
  92. package/dist/lib/declared-type-command.js +7 -2
  93. package/dist/lib/dev-watch.d.ts +1 -1
  94. package/dist/lib/dev-watch.js +13 -15
  95. package/dist/lib/diff-command.d.ts +19 -3
  96. package/dist/lib/diff-command.js +132 -14
  97. package/dist/lib/diff-state.js +2 -3
  98. package/dist/lib/environment-urls.d.ts +6 -0
  99. package/dist/lib/environment-urls.js +59 -0
  100. package/dist/lib/exclude.d.ts +16 -0
  101. package/dist/lib/exclude.js +102 -0
  102. package/dist/lib/load-files.js +2 -1
  103. package/dist/lib/load-snippets.js +39 -43
  104. package/dist/lib/local-callback-server.js +7 -1
  105. package/dist/lib/narrow.d.ts +5 -0
  106. package/dist/lib/narrow.js +26 -0
  107. package/dist/lib/php-files-command.js +13 -8
  108. package/dist/lib/plugin-detection.d.ts +0 -1
  109. package/dist/lib/plugin-detection.js +2 -4
  110. package/dist/lib/push-command.d.ts +5 -1
  111. package/dist/lib/push-command.js +48 -7
  112. package/dist/lib/put-or-create.d.ts +2 -2
  113. package/dist/lib/readdir-tolerant.js +9 -4
  114. package/dist/lib/resource-selection.d.ts +9 -0
  115. package/dist/lib/resource-selection.js +49 -0
  116. package/dist/lib/resource-state.d.ts +2 -0
  117. package/dist/lib/resource-state.js +60 -14
  118. package/dist/lib/rollback-command.d.ts +1 -1
  119. package/dist/lib/rollback-command.js +4 -3
  120. package/dist/lib/rollback-materialize.js +29 -9
  121. package/dist/lib/rotate-app-password.js +1 -0
  122. package/dist/lib/sentry.js +2 -2
  123. package/dist/lib/snapshot-store.d.ts +10 -7
  124. package/dist/lib/snapshot-store.js +21 -5
  125. package/dist/lib/spinner.js +4 -0
  126. package/dist/lib/validate-local.d.ts +1 -0
  127. package/dist/lib/validate-local.js +102 -28
  128. package/dist/lib/wp-client.d.ts +7 -1
  129. package/dist/lib/wp-client.js +60 -69
  130. package/dist/lib/wp-site-diagnostic.js +3 -5
  131. package/dist/types/global-config.generated.d.ts +1 -1
  132. package/dist/types/plugin.d.ts +7 -5
  133. package/dist/types/plugin.js +6 -1
  134. package/dist/types/project-config.generated.d.ts +24 -5
  135. package/dist/types/snippet.d.ts +2 -2
  136. package/dist/types/snippet.js +1 -1
  137. package/dist/utils/acf-format.js +6 -3
  138. package/dist/utils/block-format.d.ts +29 -0
  139. package/dist/utils/block-format.js +109 -0
  140. package/dist/utils/composer.d.ts +7 -15
  141. package/dist/utils/composer.js +43 -16
  142. package/dist/utils/declared-type-format.js +26 -19
  143. package/dist/utils/form-format.js +2 -2
  144. package/dist/utils/loopress-config.js +9 -1
  145. package/dist/utils/menu-format.d.ts +3 -1
  146. package/dist/utils/menu-format.js +5 -0
  147. package/dist/utils/option-format.d.ts +2 -2
  148. package/dist/utils/option-format.js +15 -25
  149. package/dist/utils/page-format.js +9 -7
  150. package/dist/utils/php-top-level.js +15 -4
  151. package/dist/utils/plugin-sync.d.ts +7 -7
  152. package/dist/utils/plugin-sync.js +11 -11
  153. package/dist/utils/plugins.js +9 -6
  154. package/dist/utils/resource-dirs.d.ts +2 -0
  155. package/dist/utils/resource-dirs.js +13 -5
  156. package/dist/utils/snippet-format.d.ts +1 -1
  157. package/dist/utils/snippet-format.js +5 -3
  158. package/dist/utils/template-format.js +2 -2
  159. package/dist/utils/theme-css.js +14 -6
  160. package/dist/utils/theme-styles-format.d.ts +3 -0
  161. package/dist/utils/theme-styles-format.js +15 -5
  162. package/dist/utils/version.js +1 -1
  163. package/oclif.manifest.json +2661 -1235
  164. package/package.json +45 -20
  165. package/schemas/global-config.schema.json +1 -1
  166. package/schemas/project-config.schema.json +32 -5
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@loopress/cli",
3
3
  "description": "Build, review and ship WordPress, in one loop: pull, diff, push and roll back a site's code and config from git",
4
- "version": "0.32.2",
4
+ "version": "0.34.0",
5
5
  "author": "jean-smaug",
6
6
  "bin": {
7
7
  "loopress": "bin/run.js",
@@ -11,44 +11,46 @@
11
11
  "url": "https://github.com/loopress/loopress/issues"
12
12
  },
13
13
  "dependencies": {
14
- "@inquirer/prompts": "^8.7.3",
15
- "@oclif/core": "^5.1.7",
16
- "@oclif/plugin-help": "^7.0.4",
17
- "@oclif/plugin-warn-if-update-available": "^4.0.3",
18
- "@sentry/node": "^11.6.0",
19
- "chokidar": "^5.0.0",
14
+ "@inquirer/prompts": "^8.7.5",
15
+ "@oclif/core": "^5.1.9",
16
+ "@oclif/plugin-help": "^7.0.6",
17
+ "@oclif/plugin-warn-if-update-available": "^4.0.5",
18
+ "@sentry/node": "^11.9.0",
19
+ "chokidar": "^6.0.0",
20
20
  "compare-versions": "^6.1.1",
21
21
  "diff": "^9.0.0",
22
22
  "esbuild": "0.28.2",
23
- "got": "^16.0.0",
24
- "listr2": "^11.1.1",
23
+ "got": "^16.1.0",
24
+ "listr2": "^11.4.0",
25
25
  "microdiff": "^1.6.0",
26
26
  "open": "^11.0.4",
27
- "playwright-core": "^1.64.0",
27
+ "playwright-core": "^1.64.1",
28
28
  "slugify": "^1.6.9",
29
29
  "tty-table": "^5.0.0",
30
- "write-file-atomic": "^8.0.0"
30
+ "write-file-atomic": "^8.0.0",
31
+ "zod": "^4.6.7"
31
32
  },
32
33
  "devDependencies": {
33
- "@oclif/prettier-config": "^0.2.1",
34
- "@stryker-mutator/core": "^10.0.0",
35
- "@stryker-mutator/vitest-runner": "^10.0.0",
34
+ "@oclif/prettier-config": "^0.2.2",
35
+ "@stryker-mutator/core": "^10.1.1",
36
+ "@stryker-mutator/vitest-runner": "^10.1.1",
36
37
  "@types/node": "26.6.5",
37
38
  "@types/write-file-atomic": "^4.0.3",
38
- "@vitest/coverage-v8": "^4.1.11",
39
- "@vitest/eslint-plugin": "^1.6.27",
40
- "eslint": "^10.12.0",
39
+ "@vitest/coverage-v8": "^5.0.3",
40
+ "@vitest/eslint-plugin": "^1.6.28",
41
+ "eslint": "^10.13.0",
41
42
  "eslint-config-oclif": "^7.1.10",
42
43
  "eslint-config-prettier": "^10",
44
+ "eslint-plugin-regexp": "^3.3.1",
43
45
  "eslint-plugin-sonarjs": "^4.2.2",
44
46
  "json-schema-to-typescript": "^16.0.0",
45
- "oclif": "^6.0.6",
47
+ "oclif": "^6.0.15",
46
48
  "prettier": "3.9.10",
47
49
  "shx": "^0.4.0",
48
50
  "ts-node": "10.9.2",
49
51
  "tsx": "4.23.15",
50
52
  "typescript": "^6.0.3",
51
- "vitest": "^4.1.11"
53
+ "vitest": "^5.0.3"
52
54
  },
53
55
  "engines": {
54
56
  "node": ">=22.0.0"
@@ -61,6 +63,11 @@
61
63
  ],
62
64
  "homepage": "https://github.com/loopress/loopress",
63
65
  "keywords": [
66
+ "wordpress",
67
+ "git",
68
+ "deploy",
69
+ "acf",
70
+ "cli",
64
71
  "oclif"
65
72
  ],
66
73
  "license": "MPL-2.0",
@@ -104,6 +111,9 @@
104
111
  "api": {
105
112
  "description": "Manage custom WordPress REST API routes"
106
113
  },
114
+ "app": {
115
+ "description": "Build and ship single-page app bundles (Vue, React, Svelte...), mounted with a shortcode"
116
+ },
107
117
  "content": {
108
118
  "description": "Copy an environment's content (posts, pages, terms) into the local site, never the reverse"
109
119
  },
@@ -113,6 +123,21 @@
113
123
  "composer": {
114
124
  "description": "Sync composer.json and composer.lock between your project and WordPress"
115
125
  },
126
+ "form": {
127
+ "description": "Manage WPForms forms"
128
+ },
129
+ "hook": {
130
+ "description": "Manage hook files: WordPress actions, filters and cron events"
131
+ },
132
+ "menu": {
133
+ "description": "Manage nav menus and their theme locations"
134
+ },
135
+ "option": {
136
+ "description": "Manage the wp_options rows the project tracks, only the ones added with lps option add"
137
+ },
138
+ "page": {
139
+ "description": "Manage static HTML pages rendered inside the theme's header and footer"
140
+ },
116
141
  "plugin": {
117
142
  "description": "Manage WordPress.org plugins tracked in loopress.json"
118
143
  },
@@ -123,7 +148,7 @@
123
148
  "description": "Manage WordPress code snippets"
124
149
  },
125
150
  "theme": {
126
- "description": "Manage everything theme related: versions, block templates and parts, Global Styles (never switches the active theme)"
151
+ "description": "Manage everything theme related: versions, block templates and parts, Global Styles, and activating the Loopress child theme"
127
152
  },
128
153
  "theme:template": {
129
154
  "description": "Manage block templates and template parts, written as the files of the <parent>-loopress child theme"
@@ -91,7 +91,7 @@
91
91
  },
92
92
  "token": {
93
93
  "type": "string",
94
- "description": "API token used to authenticate against this environment."
94
+ "description": "WordPress Application Password credentials for this environment, as \"user:password\". Not the Loopress account token."
95
95
  },
96
96
  "url": {
97
97
  "type": "string",
@@ -34,12 +34,17 @@
34
34
  "description": "Directory where custom API route files are read from and written to, relative to rootDir.",
35
35
  "default": "api"
36
36
  },
37
- "hooksDir": {
37
+ "blockDir": {
38
+ "type": "string",
39
+ "description": "Directory of dynamic blocks, one <slug>/ folder holding block.json and render.php, registered as loopress/<slug>, relative to rootDir.",
40
+ "default": "blocks"
41
+ },
42
+ "hookDir": {
38
43
  "type": "string",
39
44
  "description": "Directory where hook files (WordPress actions, filters, and scheduled tasks) are read from and written to, relative to rootDir.",
40
45
  "default": "hooks"
41
46
  },
42
- "appsDir": {
47
+ "appDir": {
43
48
  "type": "string",
44
49
  "description": "Directory where single-page app bundles are read from and written to, relative to rootDir. Each subdirectory is one app: a loopress.app.json plus a built dist/ folder.",
45
50
  "default": "apps"
@@ -69,7 +74,7 @@
69
74
  "description": "Directory of per-block CSS (one <namespace>/<block>.css per block, e.g. core/button.css), relative to rootDir. Each file is bundled into the Loopress child theme and only loaded on pages that render that block.",
70
75
  "default": "theme/blocks"
71
76
  },
72
- "optionsDir": {
77
+ "optionDir": {
73
78
  "type": "string",
74
79
  "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
80
  "default": "options"
@@ -104,7 +109,7 @@
104
109
  "description": "Directory where nav menus (one JSON file per menu, plus menu-locations.json for the active theme's menu locations) are read from and written to, relative to rootDir.",
105
110
  "default": "menus"
106
111
  },
107
- "themeStylesDir": {
112
+ "themeStyleDir": {
108
113
  "type": "string",
109
114
  "description": "Directory where the active block theme's Global Styles customizations (Site Editor > Styles: colors, typography, spacing) are read from and written to, relative to rootDir. Classic (non-block) themes are not supported.",
110
115
  "default": "theme"
@@ -138,9 +143,31 @@
138
143
  }
139
144
  ]
140
145
  },
146
+ "environments": {
147
+ "type": "object",
148
+ "description": "Per-environment settings, keyed by environment name (as in `lps project config`).",
149
+ "additionalProperties": {
150
+ "type": "object",
151
+ "additionalProperties": false,
152
+ "properties": {
153
+ "exclude": {
154
+ "type": "array",
155
+ "description": "Globs relative to rootDir (`*`, `**`, `?`) of files this environment never receives. `lps push`, `lps diff` and `lps promote` leave them alone on it: never pushed, never pruned or mirrored away, reported as held back instead of drift. A glob matching a directory covers everything inside. `lps pull` and `lps dev` ignore it.",
156
+ "items": {"type": "string"},
157
+ "examples": [["cpt/vocabulary-games.json", "theme/templates/*-vocabulary-games.html"]]
158
+ }
159
+ }
160
+ },
161
+ "examples": [{"production": {"exclude": ["hooks/vocabulary-games-page.php"]}}]
162
+ },
163
+ "activateChildTheme": {
164
+ "type": "boolean",
165
+ "description": "Keep the Loopress child theme (<parent>-loopress) active: `lps theme template push`, and so `lps push`, activates it when it isn't. Off by default, a theme switch changes the settings WordPress stores per theme.",
166
+ "default": false
167
+ },
141
168
  "themes": {
142
169
  "type": "object",
143
- "description": "WordPress.org themes managed by Loopress, installed via Composer + WPackagist on the site. Keys are theme slugs; values are an exact version or \"latest\". Loopress manages installed theme versions only, it never switches the active theme. Ignored when a composer.json exists in rootDir.",
170
+ "description": "WordPress.org themes managed by Loopress, installed via Composer + WPackagist on the site. Keys are theme slugs; values are an exact version or \"latest\". Loopress manages installed theme versions only, it never switches the active theme (see activateChildTheme and `lps theme activate`). Ignored when a composer.json exists in rootDir.",
144
171
  "additionalProperties": {
145
172
  "type": "string",
146
173
  "examples": ["3.4.0", "latest"]