@loopress/cli 0.13.0 → 0.15.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 (43) hide show
  1. package/README.md +96 -44
  2. package/dist/commands/init.js +5 -5
  3. package/dist/commands/plugin/add.d.ts +0 -2
  4. package/dist/commands/plugin/add.js +6 -47
  5. package/dist/commands/plugin/pull.js +4 -6
  6. package/dist/commands/plugin/push.d.ts +1 -2
  7. package/dist/commands/plugin/push.js +18 -50
  8. package/dist/commands/project/pull.d.ts +8 -0
  9. package/dist/commands/project/pull.js +69 -0
  10. package/dist/commands/project/{sync.d.ts → push.d.ts} +1 -2
  11. package/dist/commands/project/{sync.js → push.js} +8 -44
  12. package/dist/commands/snippet/publish.js +1 -1
  13. package/dist/commands/status.js +6 -2
  14. package/dist/commands/telemetry/disable.d.ts +6 -0
  15. package/dist/commands/telemetry/disable.js +14 -0
  16. package/dist/commands/telemetry/enable.d.ts +6 -0
  17. package/dist/commands/telemetry/enable.js +14 -0
  18. package/dist/config/auth.manager.d.ts +4 -2
  19. package/dist/config/auth.manager.js +15 -5
  20. package/dist/config/project-config.manager.d.ts +7 -2
  21. package/dist/config/project-config.manager.js +39 -10
  22. package/dist/hooks/finally.js +17 -3
  23. package/dist/hooks/init.js +8 -16
  24. package/dist/lib/local-callback-server.d.ts +3 -3
  25. package/dist/lib/local-callback-server.js +14 -4
  26. package/dist/lib/open-browser.d.ts +1 -1
  27. package/dist/lib/open-browser.js +3 -10
  28. package/dist/lib/sentry.d.ts +1 -1
  29. package/dist/lib/sentry.js +17 -8
  30. package/dist/lib/wp-authorize-flow.d.ts +15 -3
  31. package/dist/lib/wp-authorize-flow.js +31 -24
  32. package/dist/lib/wp-client.d.ts +1 -1
  33. package/dist/lib/wp-client.js +1 -1
  34. package/dist/types/config.d.ts +1 -1
  35. package/dist/types/global-config.generated.d.ts +13 -3
  36. package/dist/types/plugin.d.ts +4 -5
  37. package/dist/types/project-config.generated.d.ts +1 -4
  38. package/dist/utils/plugins.d.ts +3 -7
  39. package/dist/utils/plugins.js +27 -13
  40. package/oclif.manifest.json +236 -169
  41. package/package.json +6 -2
  42. package/schemas/global-config.schema.json +19 -3
  43. package/schemas/project-config.schema.json +3 -4
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.13.0",
4
+ "version": "0.15.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": {
@@ -46,7 +50,7 @@
46
50
  },
47
51
  "apiProjectId": {
48
52
  "type": "string",
49
- "description": "Id of the matching project on the Loopress API, once synced via `lps project sync`."
53
+ "description": "Id of the matching project on the Loopress API, once pushed via `lps project push`."
50
54
  },
51
55
  "environments": {
52
56
  "type": "object",
@@ -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",
@@ -71,7 +87,7 @@
71
87
  },
72
88
  "apiEnvironmentId": {
73
89
  "type": "string",
74
- "description": "Id of the matching environment on the Loopress API, once synced via `lps project sync`."
90
+ "description": "Id of the matching environment on the Loopress API, once pushed via `lps project push`."
75
91
  },
76
92
  "name": {
77
93
  "type": "string",
@@ -25,15 +25,14 @@
25
25
  },
26
26
  "plugins": {
27
27
  "type": "object",
28
- "description": "Pinned plugin versions. Keys are WordPress.org plugin slugs, values are version constraints.",
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
- "description": "Version to pin. Use an exact version (e.g. \"8.9.1\") or \"latest\".",
32
- "examples": ["8.9.1", "latest"]
31
+ "examples": ["latest"]
33
32
  },
34
33
  "examples": [
35
34
  {
36
- "woocommerce": "8.9.1",
35
+ "woocommerce": "latest",
37
36
  "contact-form-7": "latest"
38
37
  }
39
38
  ]