@loopress/cli 0.9.0 → 0.10.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 CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @loopress/cli
21
21
  $ lps COMMAND
22
22
  running command...
23
23
  $ lps (--version)
24
- @loopress/cli/0.9.0 linux-x64 node-v24.18.0
24
+ @loopress/cli/0.10.0 linux-x64 node-v24.18.0
25
25
  $ lps --help [COMMAND]
26
26
  USAGE
27
27
  $ lps COMMAND
@@ -84,7 +84,7 @@ EXAMPLES
84
84
  $ lps composer pull --dry-run
85
85
  ```
86
86
 
87
- _See code: [src/commands/composer/pull.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/composer/pull.ts)_
87
+ _See code: [src/commands/composer/pull.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/composer/pull.ts)_
88
88
 
89
89
  ## `lps composer push`
90
90
 
@@ -106,7 +106,7 @@ EXAMPLES
106
106
  $ lps composer push --dry-run
107
107
  ```
108
108
 
109
- _See code: [src/commands/composer/push.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/composer/push.ts)_
109
+ _See code: [src/commands/composer/push.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/composer/push.ts)_
110
110
 
111
111
  ## `lps help [COMMAND]`
112
112
 
@@ -143,7 +143,7 @@ EXAMPLES
143
143
  $ lps init
144
144
  ```
145
145
 
146
- _See code: [src/commands/init.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/init.ts)_
146
+ _See code: [src/commands/init.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/init.ts)_
147
147
 
148
148
  ## `lps login`
149
149
 
@@ -160,7 +160,7 @@ EXAMPLES
160
160
  $ lps login
161
161
  ```
162
162
 
163
- _See code: [src/commands/login.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/login.ts)_
163
+ _See code: [src/commands/login.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/login.ts)_
164
164
 
165
165
  ## `lps logout`
166
166
 
@@ -177,7 +177,7 @@ EXAMPLES
177
177
  $ lps logout
178
178
  ```
179
179
 
180
- _See code: [src/commands/logout.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/logout.ts)_
180
+ _See code: [src/commands/logout.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/logout.ts)_
181
181
 
182
182
  ## `lps plugin add SLUG [VERSION]`
183
183
 
@@ -205,7 +205,7 @@ EXAMPLES
205
205
  $ lps plugin add contact-form-7 --dry-run
206
206
  ```
207
207
 
208
- _See code: [src/commands/plugin/add.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/plugin/add.ts)_
208
+ _See code: [src/commands/plugin/add.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/plugin/add.ts)_
209
209
 
210
210
  ## `lps plugin pull`
211
211
 
@@ -227,7 +227,7 @@ EXAMPLES
227
227
  $ lps plugin pull --dry-run
228
228
  ```
229
229
 
230
- _See code: [src/commands/plugin/pull.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/plugin/pull.ts)_
230
+ _See code: [src/commands/plugin/pull.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/plugin/pull.ts)_
231
231
 
232
232
  ## `lps plugin push`
233
233
 
@@ -249,7 +249,7 @@ EXAMPLES
249
249
  $ lps plugin push --dry-run
250
250
  ```
251
251
 
252
- _See code: [src/commands/plugin/push.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/plugin/push.ts)_
252
+ _See code: [src/commands/plugin/push.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/plugin/push.ts)_
253
253
 
254
254
  ## `lps project config`
255
255
 
@@ -266,7 +266,7 @@ EXAMPLES
266
266
  $ lps project config
267
267
  ```
268
268
 
269
- _See code: [src/commands/project/config.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/project/config.ts)_
269
+ _See code: [src/commands/project/config.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/project/config.ts)_
270
270
 
271
271
  ## `lps project list`
272
272
 
@@ -283,7 +283,7 @@ EXAMPLES
283
283
  $ lps project list
284
284
  ```
285
285
 
286
- _See code: [src/commands/project/list.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/project/list.ts)_
286
+ _See code: [src/commands/project/list.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/project/list.ts)_
287
287
 
288
288
  ## `lps project remove`
289
289
 
@@ -300,7 +300,7 @@ EXAMPLES
300
300
  $ lps project remove
301
301
  ```
302
302
 
303
- _See code: [src/commands/project/remove.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/project/remove.ts)_
303
+ _See code: [src/commands/project/remove.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/project/remove.ts)_
304
304
 
305
305
  ## `lps project switch`
306
306
 
@@ -317,7 +317,7 @@ EXAMPLES
317
317
  $ lps project switch
318
318
  ```
319
319
 
320
- _See code: [src/commands/project/switch.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/project/switch.ts)_
320
+ _See code: [src/commands/project/switch.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/project/switch.ts)_
321
321
 
322
322
  ## `lps snippet list`
323
323
 
@@ -341,7 +341,7 @@ EXAMPLES
341
341
  $ lps snippet list --plugin wpcode
342
342
  ```
343
343
 
344
- _See code: [src/commands/snippet/list.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/snippet/list.ts)_
344
+ _See code: [src/commands/snippet/list.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/snippet/list.ts)_
345
345
 
346
346
  ## `lps snippet pull [PATH]`
347
347
 
@@ -370,7 +370,7 @@ EXAMPLES
370
370
  $ lps snippet pull --plugin wpcode
371
371
  ```
372
372
 
373
- _See code: [src/commands/snippet/pull.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/snippet/pull.ts)_
373
+ _See code: [src/commands/snippet/pull.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/snippet/pull.ts)_
374
374
 
375
375
  ## `lps snippet push [PATH]`
376
376
 
@@ -400,7 +400,7 @@ EXAMPLES
400
400
  $ lps snippet push --plugin wpcode
401
401
  ```
402
402
 
403
- _See code: [src/commands/snippet/push.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/snippet/push.ts)_
403
+ _See code: [src/commands/snippet/push.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/snippet/push.ts)_
404
404
 
405
405
  ## `lps status`
406
406
 
@@ -417,5 +417,5 @@ EXAMPLES
417
417
  $ lps status
418
418
  ```
419
419
 
420
- _See code: [src/commands/status.ts](https://github.com/loopress/loopress/blob/v0.9.0/src/commands/status.ts)_
420
+ _See code: [src/commands/status.ts](https://github.com/loopress/loopress/blob/v0.10.0/src/commands/status.ts)_
421
421
  <!-- commandsstop -->
@@ -570,5 +570,5 @@
570
570
  ]
571
571
  }
572
572
  },
573
- "version": "0.9.0"
573
+ "version": "0.10.0"
574
574
  }
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.9.0",
4
+ "version": "0.10.0",
5
5
  "author": "jean-smaug",
6
6
  "bin": {
7
7
  "loopress": "bin/run.js",
@@ -46,6 +46,7 @@
46
46
  "files": [
47
47
  "./bin",
48
48
  "./dist",
49
+ "./schemas",
49
50
  "./oclif.manifest.json"
50
51
  ],
51
52
  "homepage": "https://github.com/loopress/loopress",
@@ -0,0 +1,83 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://loopress.dev/schema/global-config.json",
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.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["currentProject", "projects"],
9
+ "properties": {
10
+ "currentProject": {
11
+ "description": "Pointer to the currently active project and environment, or null if none is selected.",
12
+ "oneOf": [{"type": "null"}, {"$ref": "#/definitions/CurrentProjectPointer"}]
13
+ },
14
+ "projects": {
15
+ "type": "object",
16
+ "description": "Known projects, keyed by project id.",
17
+ "additionalProperties": {"$ref": "#/definitions/ProjectConfig"}
18
+ }
19
+ },
20
+ "definitions": {
21
+ "CurrentProjectPointer": {
22
+ "title": "CurrentProjectPointer",
23
+ "type": "object",
24
+ "additionalProperties": false,
25
+ "required": ["env", "id"],
26
+ "properties": {
27
+ "env": {
28
+ "type": "string",
29
+ "description": "Name of the currently active environment."
30
+ },
31
+ "id": {
32
+ "type": "string",
33
+ "description": "Id of the currently active project."
34
+ }
35
+ }
36
+ },
37
+ "ProjectConfig": {
38
+ "title": "ProjectConfig",
39
+ "type": "object",
40
+ "additionalProperties": false,
41
+ "required": ["addedAt", "environments", "name"],
42
+ "properties": {
43
+ "addedAt": {
44
+ "type": "string",
45
+ "description": "ISO timestamp of when the project was added."
46
+ },
47
+ "environments": {
48
+ "type": "object",
49
+ "description": "Environments for this project, keyed by environment name.",
50
+ "additionalProperties": {"$ref": "#/definitions/EnvironmentConfig"}
51
+ },
52
+ "name": {
53
+ "type": "string",
54
+ "description": "Human-readable project name."
55
+ }
56
+ }
57
+ },
58
+ "EnvironmentConfig": {
59
+ "title": "EnvironmentConfig",
60
+ "type": "object",
61
+ "additionalProperties": false,
62
+ "required": ["addedAt", "name", "url"],
63
+ "properties": {
64
+ "addedAt": {
65
+ "type": "string",
66
+ "description": "ISO timestamp of when the environment was added."
67
+ },
68
+ "name": {
69
+ "type": "string",
70
+ "description": "Environment name (e.g. \"production\", \"staging\")."
71
+ },
72
+ "token": {
73
+ "type": "string",
74
+ "description": "API token used to authenticate against this environment."
75
+ },
76
+ "url": {
77
+ "type": "string",
78
+ "description": "Base URL of the WordPress site for this environment."
79
+ }
80
+ }
81
+ }
82
+ }
83
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://loopress.dev/schema/project-config.json",
4
+ "title": "Loopress project configuration",
5
+ "description": "Project-level config for the Loopress CLI (loopress.json).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "rootDir": {
13
+ "type": "string",
14
+ "description": "Base directory for all Loopress paths. All other path options are resolved relative to this directory.",
15
+ "default": "."
16
+ },
17
+ "snippetsDir": {
18
+ "type": "string",
19
+ "description": "Directory where code snippets are read from and written to, relative to rootDir.",
20
+ "default": "snippets"
21
+ },
22
+ "projectId": {
23
+ "type": "string",
24
+ "description": "Project identifier from the global Loopress config. When set, takes precedence over the currently active project in the global config."
25
+ },
26
+ "snippetPlugin": {
27
+ "type": "string",
28
+ "description": "WordPress snippet plugin to use for pull and push commands.",
29
+ "enum": ["wpcode", "code-snippets"],
30
+ "default": "wpcode"
31
+ },
32
+ "plugins": {
33
+ "type": "object",
34
+ "description": "Pinned plugin versions. Keys are WordPress.org plugin slugs, values are version constraints.",
35
+ "additionalProperties": {
36
+ "type": "string",
37
+ "description": "Version to pin. Use an exact version (e.g. \"8.9.1\") or \"latest\".",
38
+ "examples": ["8.9.1", "latest"]
39
+ },
40
+ "examples": [
41
+ {
42
+ "woocommerce": "8.9.1",
43
+ "contact-form-7": "latest"
44
+ }
45
+ ]
46
+ }
47
+ }
48
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "$id": "https://loopress.dev/schema/snippet.json",
4
+ "title": "Loopress snippet metadata",
5
+ "description": "Sidecar .json file paired with a snippet's code file in the snippets directory (e.g. `123-my-snippet.php` + `123-my-snippet.json`).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": {
10
+ "type": "string"
11
+ },
12
+ "id": {
13
+ "type": "integer",
14
+ "description": "Remote snippet id. Omitted until the snippet has been pushed for the first time."
15
+ },
16
+ "name": {
17
+ "type": "string",
18
+ "description": "Snippet name/title. Defaults to the code file's name when omitted."
19
+ },
20
+ "type": {
21
+ "type": "string",
22
+ "description": "Snippet language. Defaults to the type inferred from the code file's extension when omitted.",
23
+ "enum": ["css", "html", "js", "php", "text"]
24
+ },
25
+ "active": {
26
+ "type": "boolean",
27
+ "description": "Whether the snippet is enabled.",
28
+ "default": false
29
+ },
30
+ "location": {
31
+ "type": "string",
32
+ "description": "Where the snippet runs. Supported values depend on the target plugin and snippet type.",
33
+ "enum": ["admin", "body", "everywhere", "footer", "frontend", "header", "once"]
34
+ },
35
+ "description": {
36
+ "type": "string",
37
+ "description": "Free-text note about the snippet."
38
+ },
39
+ "tags": {
40
+ "type": "array",
41
+ "description": "Tags for organizing snippets.",
42
+ "items": {"type": "string"}
43
+ },
44
+ "insertMethod": {
45
+ "type": "string",
46
+ "description": "How the snippet is inserted into the page.",
47
+ "enum": ["auto", "shortcode"],
48
+ "default": "auto"
49
+ },
50
+ "priority": {
51
+ "type": "integer",
52
+ "description": "Execution priority. Lower runs earlier.",
53
+ "default": 10
54
+ },
55
+ "shortcodeAttributes": {
56
+ "type": "array",
57
+ "description": "Attribute names accepted by the snippet's shortcode, used when insertMethod is \"shortcode\".",
58
+ "items": {"type": "string"}
59
+ }
60
+ }
61
+ }