livingdocs-cli 2.1.1 → 2.1.2
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 +16 -95
- package/oclif.manifest.json +1 -1
- package/package.json +4 -4
- package/src/commands/project-config/drafts.js +1 -0
- package/src/commands/project-config/publish.js +14 -11
- package/src/commands/project-config/upload.js +1 -0
- package/src/commands/project-config/upload_assets.js +1 -0
package/README.md
CHANGED
|
@@ -1,45 +1,29 @@
|
|
|
1
|
-
livingdocs-cli
|
|
2
|
-
==============
|
|
3
|
-
|
|
4
|
-
Livingdocs Command Line Interface
|
|
5
|
-
|
|
6
1
|
[](https://oclif.io)
|
|
7
2
|
[](https://npmjs.org/package/livingdocs-cli)
|
|
8
|
-
[](https://codecov.io/gh/livingdocsIO/livingdocs-cli)
|
|
9
3
|
[](https://npmjs.org/package/livingdocs-cli)
|
|
10
4
|
[](https://github.com/livingdocsIO/livingdocs-cli/blob/master/package.json)
|
|
11
5
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
6
|
+
# livingdocs-cli
|
|
7
|
+
|
|
8
|
+
Livingdocs Command Line Interface
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
18
12
|
```sh-session
|
|
19
13
|
$ npm install -g livingdocs-cli
|
|
20
|
-
$ livingdocs-cli
|
|
21
|
-
running command...
|
|
22
|
-
$ livingdocs-cli (-v|--version|version)
|
|
23
|
-
livingdocs-cli/2.1.1 linux-x64 node-v16.11.1
|
|
24
|
-
$ livingdocs-cli --help [COMMAND]
|
|
25
|
-
USAGE
|
|
26
|
-
$ livingdocs-cli COMMAND
|
|
27
|
-
...
|
|
14
|
+
$ livingdocs-cli --help
|
|
28
15
|
```
|
|
29
|
-
|
|
30
|
-
# Commands
|
|
16
|
+
|
|
17
|
+
# Commands Reference
|
|
31
18
|
<!-- commands -->
|
|
32
19
|
* [`livingdocs-cli component-library:build`](#livingdocs-cli-component-librarybuild)
|
|
33
20
|
* [`livingdocs-cli config:print`](#livingdocs-cli-configprint)
|
|
34
21
|
* [`livingdocs-cli design-server:start`](#livingdocs-cli-design-serverstart)
|
|
35
22
|
* [`livingdocs-cli help [COMMAND]`](#livingdocs-cli-help-command)
|
|
36
23
|
* [`livingdocs-cli project-config:download`](#livingdocs-cli-project-configdownload)
|
|
37
|
-
* [`livingdocs-cli project-config:drafts`](#livingdocs-cli-project-configdrafts)
|
|
38
24
|
* [`livingdocs-cli project-config:import-design`](#livingdocs-cli-project-configimport-design)
|
|
39
25
|
* [`livingdocs-cli project-config:plan`](#livingdocs-cli-project-configplan)
|
|
40
26
|
* [`livingdocs-cli project-config:publish`](#livingdocs-cli-project-configpublish)
|
|
41
|
-
* [`livingdocs-cli project-config:upload`](#livingdocs-cli-project-configupload)
|
|
42
|
-
* [`livingdocs-cli project-config:upload_assets`](#livingdocs-cli-project-configupload_assets)
|
|
43
27
|
|
|
44
28
|
## `livingdocs-cli component-library:build`
|
|
45
29
|
|
|
@@ -54,7 +38,7 @@ OPTIONS
|
|
|
54
38
|
-s, --src=src The folder with your .html component templates
|
|
55
39
|
```
|
|
56
40
|
|
|
57
|
-
_See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
41
|
+
_See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/component-library/build.js)_
|
|
58
42
|
|
|
59
43
|
## `livingdocs-cli config:print`
|
|
60
44
|
|
|
@@ -69,7 +53,7 @@ OPTIONS
|
|
|
69
53
|
-p, --project=project If used configuration options are loaded from .livingdocs-cli file.
|
|
70
54
|
```
|
|
71
55
|
|
|
72
|
-
_See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
56
|
+
_See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/config/print.js)_
|
|
73
57
|
|
|
74
58
|
## `livingdocs-cli design-server:start`
|
|
75
59
|
|
|
@@ -87,7 +71,7 @@ OPTIONS
|
|
|
87
71
|
--verbose
|
|
88
72
|
```
|
|
89
73
|
|
|
90
|
-
_See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
74
|
+
_See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/design-server/start.js)_
|
|
91
75
|
|
|
92
76
|
## `livingdocs-cli help [COMMAND]`
|
|
93
77
|
|
|
@@ -129,25 +113,7 @@ OPTIONS
|
|
|
129
113
|
--format=js|js/html|json The format of the files written.
|
|
130
114
|
```
|
|
131
115
|
|
|
132
|
-
_See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
133
|
-
|
|
134
|
-
## `livingdocs-cli project-config:drafts`
|
|
135
|
-
|
|
136
|
-
List project configuration drafts
|
|
137
|
-
|
|
138
|
-
```
|
|
139
|
-
USAGE
|
|
140
|
-
$ livingdocs-cli project-config:drafts
|
|
141
|
-
|
|
142
|
-
OPTIONS
|
|
143
|
-
-h, --host=host [default: http://localhost:9090] The livingdocs host.
|
|
144
|
-
Can be set by the environment variable 'LI_HOST'.
|
|
145
|
-
|
|
146
|
-
-t, --token=token (required) Access Token for your project (needs `public-api:config:read` permission).
|
|
147
|
-
Can be set by the environment variable 'LI_TOKEN'.
|
|
148
|
-
```
|
|
149
|
-
|
|
150
|
-
_See code: [src/commands/project-config/drafts.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.1/src/commands/project-config/drafts.js)_
|
|
116
|
+
_See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/project-config/download.js)_
|
|
151
117
|
|
|
152
118
|
## `livingdocs-cli project-config:import-design`
|
|
153
119
|
|
|
@@ -164,7 +130,7 @@ OPTIONS
|
|
|
164
130
|
-u, --designUri=designUri (required) URL of the design to import
|
|
165
131
|
```
|
|
166
132
|
|
|
167
|
-
_See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
133
|
+
_See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/project-config/import-design.js)_
|
|
168
134
|
|
|
169
135
|
## `livingdocs-cli project-config:plan`
|
|
170
136
|
|
|
@@ -187,7 +153,7 @@ OPTIONS
|
|
|
187
153
|
Can be set by the environment variable 'LI_TOKEN'.
|
|
188
154
|
```
|
|
189
155
|
|
|
190
|
-
_See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
156
|
+
_See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/project-config/plan.js)_
|
|
191
157
|
|
|
192
158
|
## `livingdocs-cli project-config:publish`
|
|
193
159
|
|
|
@@ -210,50 +176,5 @@ OPTIONS
|
|
|
210
176
|
Can be set by the environment variable 'LI_TOKEN'.
|
|
211
177
|
```
|
|
212
178
|
|
|
213
|
-
_See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.
|
|
214
|
-
|
|
215
|
-
## `livingdocs-cli project-config:upload`
|
|
216
|
-
|
|
217
|
-
Upload a ChannelConfig into a draft for your project
|
|
218
|
-
|
|
219
|
-
```
|
|
220
|
-
USAGE
|
|
221
|
-
$ livingdocs-cli project-config:upload
|
|
222
|
-
|
|
223
|
-
OPTIONS
|
|
224
|
-
-d, --dist=dist (required) The folder or filename to the channelConfig.
|
|
225
|
-
-e, --env=env If used configuration options are loaded from .livingdocs-cli file.
|
|
226
|
-
|
|
227
|
-
-h, --host=host (required) [default: http://localhost:9090] The livingdocs host.
|
|
228
|
-
Can be set by the environment variable 'LI_HOST'.
|
|
229
|
-
|
|
230
|
-
-p, --project=project If used configuration options are loaded from .livingdocs-cli file.
|
|
231
|
-
|
|
232
|
-
-t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
|
|
233
|
-
Can be set by the environment variable 'LI_TOKEN'.
|
|
234
|
-
|
|
235
|
-
--draftName=draftName (required) The name of the draft the config will be saved under.
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
_See code: [src/commands/project-config/upload.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.1/src/commands/project-config/upload.js)_
|
|
239
|
-
|
|
240
|
-
## `livingdocs-cli project-config:upload_assets`
|
|
241
|
-
|
|
242
|
-
Upload assets to your project
|
|
243
|
-
|
|
244
|
-
```
|
|
245
|
-
USAGE
|
|
246
|
-
$ livingdocs-cli project-config:upload_assets
|
|
247
|
-
|
|
248
|
-
OPTIONS
|
|
249
|
-
-a, --assets=assets The folder where you asset files are located.
|
|
250
|
-
|
|
251
|
-
-h, --host=host [default: http://localhost:9090] The livingdocs host.
|
|
252
|
-
Can be set by the environment variable 'LI_HOST'.
|
|
253
|
-
|
|
254
|
-
-t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
|
|
255
|
-
Can be set by the environment variable 'LI_TOKEN'.
|
|
256
|
-
```
|
|
257
|
-
|
|
258
|
-
_See code: [src/commands/project-config/upload_assets.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.1/src/commands/project-config/upload_assets.js)_
|
|
179
|
+
_See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.1.2/src/commands/project-config/publish.js)_
|
|
259
180
|
<!-- commandsstop -->
|
package/oclif.manifest.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.1.
|
|
1
|
+
{"version":"2.1.2","commands":{"component-library:build":{"id":"component-library:build","description":"Build a Component Library JSON file","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"src":{"name":"src","type":"option","char":"s","description":"The folder with your .html component templates"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."}},"args":[]},"config:print":{"id":"config:print","description":"Print current CLI configuration","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."}},"args":[]},"design-server:start":{"id":"design-server:start","description":"Start a design server for development","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"The port of the design-server.","default":9030},"dist":{"name":"dist","type":"option","char":"d","description":"The folder to load designs from.","required":true},"assets":{"name":"assets","type":"option","description":"Asset folder to serve static files."},"basePath":{"name":"basePath","type":"option","description":"The basePath to set in `assets.basePath`."},"verbose":{"name":"verbose","type":"boolean","allowNo":false}},"args":[]},"project-config:download":{"id":"project-config:download","description":"Download a project configuration","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."},"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:read` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","required":true,"default":"http://localhost:9090"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."},"format":{"name":"format","type":"option","description":"The format of the files written.","options":["js","js/html","json"]}},"args":[]},"project-config:drafts":{"id":"project-config:drafts","description":"List project configuration drafts","pluginName":"livingdocs-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:read` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","default":"http://localhost:9090"}},"args":[]},"project-config:import-design":{"id":"project-config:import-design","description":"Import a design into a given project configuration","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written.","required":true},"designUri":{"name":"designUri","type":"option","char":"u","description":"URL of the design to import","required":true}},"args":[]},"project-config:plan":{"id":"project-config:plan","description":"See what would be updated in a publish command","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."},"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:write` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","required":true,"default":"http://localhost:9090"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder or filename to the channelConfig.","required":true}},"args":[]},"project-config:publish":{"id":"project-config:publish","description":"Publish a ChannelConfig to your project","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."},"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:write` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","required":true,"default":"http://localhost:9090"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder or filename to the channelConfig.","required":true}},"args":[]},"project-config:upload":{"id":"project-config:upload","description":"Upload a ChannelConfig into a draft for your project","pluginName":"livingdocs-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"project":{"name":"project","type":"option","char":"p","description":"If used configuration options are loaded from .livingdocs-cli file."},"env":{"name":"env","type":"option","char":"e","description":"If used configuration options are loaded from .livingdocs-cli file."},"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:write` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","required":true,"default":"http://localhost:9090"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder or filename to the channelConfig.","required":true},"draftName":{"name":"draftName","type":"option","description":"The name of the draft the config will be saved under.","required":true}},"args":[]},"project-config:upload_assets":{"id":"project-config:upload_assets","description":"Upload assets to your project","pluginName":"livingdocs-cli","pluginType":"core","hidden":true,"aliases":[],"flags":{"token":{"name":"token","type":"option","char":"t","description":"Access Token for your project (needs `public-api:config:write` permission).\nCan be set by the environment variable 'LI_TOKEN'.","required":true},"host":{"name":"host","type":"option","char":"h","description":"The livingdocs host.\nCan be set by the environment variable 'LI_HOST'.","default":"http://localhost:9090"},"assets":{"name":"assets","type":"option","char":"a","description":"The folder where you asset files are located."}},"args":[]}}}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "livingdocs-cli",
|
|
3
3
|
"description": "Livingdocs Command Line Utility",
|
|
4
|
-
"version": "2.1.
|
|
4
|
+
"version": "2.1.2",
|
|
5
5
|
"author": "Livingdocs AG",
|
|
6
6
|
"repository": "livingdocsIO/livingdocs-cli",
|
|
7
7
|
"homepage": "https://github.com/livingdocsIO/livingdocs-cli",
|
|
@@ -85,11 +85,11 @@
|
|
|
85
85
|
"isCi": true,
|
|
86
86
|
"name": "Drone",
|
|
87
87
|
"service": "drone",
|
|
88
|
-
"commit": "
|
|
89
|
-
"build": "
|
|
88
|
+
"commit": "5a1d56a52c578fc950d7bad0c488f627c92629a3",
|
|
89
|
+
"build": "87",
|
|
90
90
|
"branch": "master",
|
|
91
91
|
"isPr": false,
|
|
92
92
|
"slug": "livingdocsIO/livingdocs-cli",
|
|
93
|
-
"date": "2022-01-03T13:
|
|
93
|
+
"date": "2022-01-03T13:58:43.325Z"
|
|
94
94
|
}
|
|
95
95
|
}
|
|
@@ -6,6 +6,7 @@ const liApi = require('../../lib/api/livingdocs_api')
|
|
|
6
6
|
const errorReporter = require('../../lib/api/error_reporter')
|
|
7
7
|
|
|
8
8
|
class DraftsCommand extends Command {
|
|
9
|
+
static hidden = true
|
|
9
10
|
static description = `List project configuration drafts`
|
|
10
11
|
static flags = {
|
|
11
12
|
token: {...sharedFlags.configReadToken, required: true},
|
|
@@ -24,7 +24,7 @@ class PublishCommand extends Command {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
async run () {
|
|
27
|
-
const {token, host, dist
|
|
27
|
+
const {token, host, dist} = this.parse(PublishCommand).flags
|
|
28
28
|
const reportError = errorReporter(this.log, host, {verbose: true})
|
|
29
29
|
|
|
30
30
|
const config = await readChannelConfig({source: dist})
|
|
@@ -33,17 +33,20 @@ class PublishCommand extends Command {
|
|
|
33
33
|
throw err
|
|
34
34
|
})
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
default: false,
|
|
42
|
-
message: `Are you sure to publish to production?`
|
|
43
|
-
}])
|
|
36
|
+
await liApi.plan({host, token, channelConfig: config})
|
|
37
|
+
.then((result) => {
|
|
38
|
+
resultReporter(result, this.log)
|
|
39
|
+
})
|
|
40
|
+
.catch(reportError)
|
|
44
41
|
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
const answers = await inquirer.prompt([{
|
|
43
|
+
name: 'continue',
|
|
44
|
+
type: 'confirm',
|
|
45
|
+
default: false,
|
|
46
|
+
message: `Are you sure to publish to production?`
|
|
47
|
+
}])
|
|
48
|
+
|
|
49
|
+
if (!answers.continue) return
|
|
47
50
|
|
|
48
51
|
await liApi.publish({host, token, channelConfig: config})
|
|
49
52
|
.then((result) => {
|
|
@@ -8,6 +8,7 @@ const resultReporter = require('../../lib/api/channel_config_result_reporter')
|
|
|
8
8
|
const readChannelConfig = require('../../lib/read_channel_config')
|
|
9
9
|
|
|
10
10
|
class UploadCommand extends Command {
|
|
11
|
+
static hidden = true
|
|
11
12
|
static description = `Upload a ChannelConfig into a draft for your project`
|
|
12
13
|
static flags = {
|
|
13
14
|
project: sharedFlags.project,
|
|
@@ -6,6 +6,7 @@ const sharedFlags = require('../../lib/cli/shared_flags')
|
|
|
6
6
|
const liApi = require('../../lib/api/livingdocs_api')
|
|
7
7
|
|
|
8
8
|
class UploadAssetsCommand extends Command {
|
|
9
|
+
static hidden = true
|
|
9
10
|
static description = `Upload assets to your project`
|
|
10
11
|
static flags = {
|
|
11
12
|
token: {...sharedFlags.configWriteToken, required: true},
|