@loopress/cli 0.33.0 → 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 (62) hide show
  1. package/README.md +174 -161
  2. package/dist/commands/app/push.js +2 -1
  3. package/dist/commands/block/push.js +9 -4
  4. package/dist/commands/dev.d.ts +2 -2
  5. package/dist/commands/dev.js +10 -16
  6. package/dist/commands/diff.d.ts +6 -4
  7. package/dist/commands/diff.js +49 -29
  8. package/dist/commands/doctor.js +12 -2
  9. package/dist/commands/option/push.js +1 -0
  10. package/dist/commands/page/push.js +1 -0
  11. package/dist/commands/plugin/add.d.ts +1 -0
  12. package/dist/commands/plugin/add.js +50 -9
  13. package/dist/commands/plugin/push.js +39 -4
  14. package/dist/commands/project/config.js +0 -1
  15. package/dist/commands/promote.d.ts +1 -0
  16. package/dist/commands/promote.js +8 -4
  17. package/dist/commands/pull.d.ts +5 -0
  18. package/dist/commands/pull.js +26 -1
  19. package/dist/commands/push.d.ts +9 -0
  20. package/dist/commands/push.js +104 -39
  21. package/dist/commands/theme/style/diff.js +1 -1
  22. package/dist/commands/theme/style/push.js +1 -1
  23. package/dist/commands/theme/style/rollback.js +1 -1
  24. package/dist/commands/theme/template/push.d.ts +2 -0
  25. package/dist/commands/theme/template/push.js +42 -13
  26. package/dist/commands/validate.js +3 -0
  27. package/dist/lib/base.d.ts +6 -0
  28. package/dist/lib/base.js +33 -1
  29. package/dist/lib/declared-plugins.d.ts +9 -0
  30. package/dist/lib/declared-plugins.js +21 -0
  31. package/dist/lib/declared-type-command.js +3 -0
  32. package/dist/lib/dev-watch.d.ts +1 -1
  33. package/dist/lib/dev-watch.js +11 -13
  34. package/dist/lib/diff-command.d.ts +17 -0
  35. package/dist/lib/diff-command.js +125 -9
  36. package/dist/lib/environment-urls.d.ts +6 -0
  37. package/dist/lib/environment-urls.js +59 -0
  38. package/dist/lib/exclude.d.ts +16 -0
  39. package/dist/lib/exclude.js +102 -0
  40. package/dist/lib/load-snippets.js +2 -1
  41. package/dist/lib/php-files-command.js +5 -3
  42. package/dist/lib/push-command.d.ts +4 -0
  43. package/dist/lib/push-command.js +38 -2
  44. package/dist/lib/readdir-tolerant.js +6 -3
  45. package/dist/lib/resource-selection.d.ts +9 -0
  46. package/dist/lib/resource-selection.js +49 -0
  47. package/dist/lib/resource-state.d.ts +2 -0
  48. package/dist/lib/resource-state.js +25 -4
  49. package/dist/lib/rollback-command.js +1 -1
  50. package/dist/lib/rollback-materialize.js +1 -1
  51. package/dist/lib/validate-local.d.ts +1 -0
  52. package/dist/lib/validate-local.js +67 -8
  53. package/dist/lib/wp-client.d.ts +1 -0
  54. package/dist/lib/wp-client.js +6 -0
  55. package/dist/types/project-config.generated.d.ts +15 -4
  56. package/dist/utils/block-format.d.ts +2 -0
  57. package/dist/utils/block-format.js +18 -2
  58. package/dist/utils/page-format.js +2 -1
  59. package/dist/utils/resource-dirs.js +4 -4
  60. package/oclif.manifest.json +2275 -1394
  61. package/package.json +7 -7
  62. package/schemas/project-config.schema.json +21 -4
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.33.0",
4
+ "version": "0.34.0",
5
5
  "author": "jean-smaug",
6
6
  "bin": {
7
7
  "loopress": "bin/run.js",
@@ -11,12 +11,12 @@
11
11
  "url": "https://github.com/loopress/loopress/issues"
12
12
  },
13
13
  "dependencies": {
14
- "@inquirer/prompts": "^8.7.4",
14
+ "@inquirer/prompts": "^8.7.5",
15
15
  "@oclif/core": "^5.1.9",
16
- "@oclif/plugin-help": "^7.0.5",
16
+ "@oclif/plugin-help": "^7.0.6",
17
17
  "@oclif/plugin-warn-if-update-available": "^4.0.5",
18
18
  "@sentry/node": "^11.9.0",
19
- "chokidar": "^5.0.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",
@@ -36,7 +36,7 @@
36
36
  "@stryker-mutator/vitest-runner": "^10.1.1",
37
37
  "@types/node": "26.6.5",
38
38
  "@types/write-file-atomic": "^4.0.3",
39
- "@vitest/coverage-v8": "^4.1.11",
39
+ "@vitest/coverage-v8": "^5.0.3",
40
40
  "@vitest/eslint-plugin": "^1.6.28",
41
41
  "eslint": "^10.13.0",
42
42
  "eslint-config-oclif": "^7.1.10",
@@ -44,13 +44,13 @@
44
44
  "eslint-plugin-regexp": "^3.3.1",
45
45
  "eslint-plugin-sonarjs": "^4.2.2",
46
46
  "json-schema-to-typescript": "^16.0.0",
47
- "oclif": "^6.0.10",
47
+ "oclif": "^6.0.15",
48
48
  "prettier": "3.9.10",
49
49
  "shx": "^0.4.0",
50
50
  "ts-node": "10.9.2",
51
51
  "tsx": "4.23.15",
52
52
  "typescript": "^6.0.3",
53
- "vitest": "^4.1.11"
53
+ "vitest": "^5.0.3"
54
54
  },
55
55
  "engines": {
56
56
  "node": ">=22.0.0"
@@ -39,12 +39,12 @@
39
39
  "description": "Directory of dynamic blocks, one <slug>/ folder holding block.json and render.php, registered as loopress/<slug>, relative to rootDir.",
40
40
  "default": "blocks"
41
41
  },
42
- "hooksDir": {
42
+ "hookDir": {
43
43
  "type": "string",
44
44
  "description": "Directory where hook files (WordPress actions, filters, and scheduled tasks) are read from and written to, relative to rootDir.",
45
45
  "default": "hooks"
46
46
  },
47
- "appsDir": {
47
+ "appDir": {
48
48
  "type": "string",
49
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.",
50
50
  "default": "apps"
@@ -74,7 +74,7 @@
74
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.",
75
75
  "default": "theme/blocks"
76
76
  },
77
- "optionsDir": {
77
+ "optionDir": {
78
78
  "type": "string",
79
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.",
80
80
  "default": "options"
@@ -109,7 +109,7 @@
109
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.",
110
110
  "default": "menus"
111
111
  },
112
- "themeStylesDir": {
112
+ "themeStyleDir": {
113
113
  "type": "string",
114
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.",
115
115
  "default": "theme"
@@ -143,6 +143,23 @@
143
143
  }
144
144
  ]
145
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
+ },
146
163
  "activateChildTheme": {
147
164
  "type": "boolean",
148
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.",