livingdocs-cli 2.0.0 → 2.0.1

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
@@ -20,7 +20,7 @@ $ npm install -g livingdocs-cli
20
20
  $ livingdocs-cli COMMAND
21
21
  running command...
22
22
  $ livingdocs-cli (-v|--version|version)
23
- livingdocs-cli/0.0.0 darwin-x64 node-v12.10.0
23
+ livingdocs-cli/2.0.1 linux-x64 node-v16.11.1
24
24
  $ livingdocs-cli --help [COMMAND]
25
25
  USAGE
26
26
  $ livingdocs-cli COMMAND
@@ -35,6 +35,7 @@ USAGE
35
35
  * [`livingdocs-cli help [COMMAND]`](#livingdocs-cli-help-command)
36
36
  * [`livingdocs-cli project-config:download`](#livingdocs-cli-project-configdownload)
37
37
  * [`livingdocs-cli project-config:drafts`](#livingdocs-cli-project-configdrafts)
38
+ * [`livingdocs-cli project-config:import-design`](#livingdocs-cli-project-configimport-design)
38
39
  * [`livingdocs-cli project-config:plan`](#livingdocs-cli-project-configplan)
39
40
  * [`livingdocs-cli project-config:publish`](#livingdocs-cli-project-configpublish)
40
41
  * [`livingdocs-cli project-config:upload`](#livingdocs-cli-project-configupload)
@@ -49,7 +50,7 @@ USAGE
49
50
  $ livingdocs-cli cli-config:print
50
51
  ```
51
52
 
52
- _See code: [src/commands/cli-config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/cli-config/print.js)_
53
+ _See code: [src/commands/cli-config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/cli-config/print.js)_
53
54
 
54
55
  ## `livingdocs-cli component-library:build`
55
56
 
@@ -64,7 +65,7 @@ OPTIONS
64
65
  -s, --src=src The folder with your .html component templates
65
66
  ```
66
67
 
67
- _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/component-library/build.js)_
68
+ _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/component-library/build.js)_
68
69
 
69
70
  ## `livingdocs-cli design-server:start`
70
71
 
@@ -75,13 +76,14 @@ USAGE
75
76
  $ livingdocs-cli design-server:start
76
77
 
77
78
  OPTIONS
78
- -d, --dist=dist (required) The folder to load designs from.
79
- -p, --port=port [default: 9030] The port of the design-server.
80
- --assets=assets Asset folder to serve static files.
79
+ -d, --dist=dist (required) The folder to load designs from.
80
+ -p, --port=port [default: 9030] The port of the design-server.
81
+ --assets=assets Asset folder to serve static files.
82
+ --basePath=basePath The basePath to set in `assets.basePath`.
81
83
  --verbose
82
84
  ```
83
85
 
84
- _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/design-server/start.js)_
86
+ _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/design-server/start.js)_
85
87
 
86
88
  ## `livingdocs-cli help [COMMAND]`
87
89
 
@@ -110,17 +112,20 @@ USAGE
110
112
 
111
113
  OPTIONS
112
114
  -d, --dist=dist The folder where the output will be written.
115
+ -e, --env=env If used configuration options are loaded from .livingdocs-cli file.
113
116
 
114
- -h, --host=host [default: http://localhost:9090] The livingdocs host.
117
+ -h, --host=host (required) [default: http://localhost:9090] The livingdocs host.
115
118
  Can be set by the environment variable 'LI_HOST'.
116
119
 
117
- -t, --token=token (required) The Access Token to your project (needs write permission).
120
+ -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
121
+
122
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:read` permission).
118
123
  Can be set by the environment variable 'LI_TOKEN'.
119
124
 
120
125
  --format=js|js/html|json The format of the files written.
121
126
  ```
122
127
 
123
- _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/download.js)_
128
+ _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/download.js)_
124
129
 
125
130
  ## `livingdocs-cli project-config:drafts`
126
131
 
@@ -134,11 +139,28 @@ OPTIONS
134
139
  -h, --host=host [default: http://localhost:9090] The livingdocs host.
135
140
  Can be set by the environment variable 'LI_HOST'.
136
141
 
137
- -t, --token=token (required) The Access Token to your project (needs write permission).
142
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:read` permission).
138
143
  Can be set by the environment variable 'LI_TOKEN'.
139
144
  ```
140
145
 
141
- _See code: [src/commands/project-config/drafts.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/drafts.js)_
146
+ _See code: [src/commands/project-config/drafts.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/drafts.js)_
147
+
148
+ ## `livingdocs-cli project-config:import-design`
149
+
150
+ Import a design into a given project configuration
151
+
152
+ ```
153
+ USAGE
154
+ $ livingdocs-cli project-config:import-design
155
+
156
+ OPTIONS
157
+ -d, --dist=dist (required) The folder where the output will be written.
158
+ -e, --env=env If used configuration options are loaded from .livingdocs-cli file.
159
+ -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
160
+ -u, --designUri=designUri (required) URL of the design to import
161
+ ```
162
+
163
+ _See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/import-design.js)_
142
164
 
143
165
  ## `livingdocs-cli project-config:plan`
144
166
 
@@ -149,16 +171,19 @@ USAGE
149
171
  $ livingdocs-cli project-config:plan
150
172
 
151
173
  OPTIONS
152
- -d, --dist=dist The folder or filename where to download to.
174
+ -d, --dist=dist (required) The folder or filename to the channelConfig.
175
+ -e, --env=env If used configuration options are loaded from .livingdocs-cli file.
153
176
 
154
- -h, --host=host [default: http://localhost:9090] The livingdocs host.
155
- Can be set by the environment variable 'LI_HOST'.
177
+ -h, --host=host (required) [default: http://localhost:9090] The livingdocs host.
178
+ Can be set by the environment variable 'LI_HOST'.
156
179
 
157
- -t, --token=token (required) The Access Token to your project (needs write permission).
158
- Can be set by the environment variable 'LI_TOKEN'.
180
+ -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
181
+
182
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
183
+ Can be set by the environment variable 'LI_TOKEN'.
159
184
  ```
160
185
 
161
- _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/plan.js)_
186
+ _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/plan.js)_
162
187
 
163
188
  ## `livingdocs-cli project-config:publish`
164
189
 
@@ -169,16 +194,19 @@ USAGE
169
194
  $ livingdocs-cli project-config:publish
170
195
 
171
196
  OPTIONS
172
- -d, --dist=dist The folder to publish from.
197
+ -d, --dist=dist (required) The folder or filename to the channelConfig.
198
+ -e, --env=env If used configuration options are loaded from .livingdocs-cli file.
173
199
 
174
- -h, --host=host [default: http://localhost:9090] The livingdocs host.
175
- Can be set by the environment variable 'LI_HOST'.
200
+ -h, --host=host (required) [default: http://localhost:9090] The livingdocs host.
201
+ Can be set by the environment variable 'LI_HOST'.
176
202
 
177
- -t, --token=token (required) The Access Token to your project (needs write permission).
178
- Can be set by the environment variable 'LI_TOKEN'.
203
+ -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
204
+
205
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
206
+ Can be set by the environment variable 'LI_TOKEN'.
179
207
  ```
180
208
 
181
- _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/publish.js)_
209
+ _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/publish.js)_
182
210
 
183
211
  ## `livingdocs-cli project-config:upload`
184
212
 
@@ -189,18 +217,21 @@ USAGE
189
217
  $ livingdocs-cli project-config:upload
190
218
 
191
219
  OPTIONS
192
- -d, --dist=dist The folder or filename where to download to.
220
+ -d, --dist=dist (required) The folder or filename to the channelConfig.
221
+ -e, --env=env If used configuration options are loaded from .livingdocs-cli file.
193
222
 
194
- -h, --host=host [default: http://localhost:9090] The livingdocs host.
223
+ -h, --host=host (required) [default: http://localhost:9090] The livingdocs host.
195
224
  Can be set by the environment variable 'LI_HOST'.
196
225
 
197
- -t, --token=token (required) The Access Token to your project (needs write permission).
226
+ -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
227
+
228
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
198
229
  Can be set by the environment variable 'LI_TOKEN'.
199
230
 
200
231
  --draftName=draftName (required) The name of the draft the config will be saved under.
201
232
  ```
202
233
 
203
- _See code: [src/commands/project-config/upload.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/upload.js)_
234
+ _See code: [src/commands/project-config/upload.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/upload.js)_
204
235
 
205
236
  ## `livingdocs-cli project-config:upload_assets`
206
237
 
@@ -216,9 +247,9 @@ OPTIONS
216
247
  -h, --host=host [default: http://localhost:9090] The livingdocs host.
217
248
  Can be set by the environment variable 'LI_HOST'.
218
249
 
219
- -t, --token=token (required) The Access Token to your project (needs write permission).
250
+ -t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
220
251
  Can be set by the environment variable 'LI_TOKEN'.
221
252
  ```
222
253
 
223
- _See code: [src/commands/project-config/upload_assets.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v0.0.0/src/commands/project-config/upload_assets.js)_
254
+ _See code: [src/commands/project-config/upload_assets.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.0.1/src/commands/project-config/upload_assets.js)_
224
255
  <!-- commandsstop -->
@@ -0,0 +1 @@
1
+ {"version":"2.0.1","commands":{"cli-config:print":{"id":"cli-config:print","description":"Print current CLI configuration","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{},"args":[]},"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":[]},"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","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","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","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.0.0",
4
+ "version": "2.0.1",
5
5
  "author": "Livingdocs AG",
6
6
  "repository": "livingdocsIO/livingdocs-cli",
7
7
  "homepage": "https://github.com/livingdocsIO/livingdocs-cli",
@@ -15,8 +15,7 @@
15
15
  "test": "mocha --forbid-only \"test/**/*.test.js\"",
16
16
  "test:coverage": "nyc mocha --forbid-only \"test/**/*.test.js\"",
17
17
  "posttest": "eslint .",
18
- "version": "oclif-dev readme && git add README.md",
19
- "postversion": "/release/node_modules/.bin/set-ci"
18
+ "version": "oclif-dev readme && git add README.md"
20
19
  },
21
20
  "dependencies": {
22
21
  "@oclif/command": "^1.5.19",
@@ -24,7 +23,7 @@
24
23
  "@oclif/plugin-help": "^2.2.1",
25
24
  "@oclif/plugin-not-found": "^1.2.3",
26
25
  "@oclif/plugin-warn-if-update-available": "^1.7.0",
27
- "axios": "^0.19.0",
26
+ "axios": "^0.21.2",
28
27
  "chalk": "^2.4.2",
29
28
  "cheerio": "^1.0.0-rc.3",
30
29
  "dedent": "^0.7.0",
@@ -85,11 +84,11 @@
85
84
  "isCi": true,
86
85
  "name": "Drone",
87
86
  "service": "drone",
88
- "commit": "c336b1974fd30ebee4c7bfea493be9281b4bffad",
89
- "build": "72",
87
+ "commit": "ffb53d4f5e402ac0f3b663811e1551ff04e29e5d",
88
+ "build": "80",
90
89
  "branch": "master",
91
90
  "isPr": false,
92
91
  "slug": "livingdocsIO/livingdocs-cli",
93
- "date": "2021-10-19T14:13:12.332Z"
92
+ "date": "2021-12-10T15:16:18.151Z"
94
93
  }
95
94
  }
@@ -85,9 +85,20 @@ class DesignServerCommand extends Command {
85
85
  return
86
86
  }
87
87
 
88
- designConfig.assets = designConfig.assets || {}
89
- const defaultBasePath = `${host}/designs/${designName}/${version}`
90
- designConfig.assets.basePath = basePath || defaultBasePath
88
+ const designBasePath = basePath || `${host}/designs/${designName}/${version}`
89
+ if (
90
+ typeof designConfig.assets === 'object' &&
91
+ !designConfig.assets.basePath
92
+ ) {
93
+ designConfig.assets.basePath = designBasePath
94
+ }
95
+
96
+ if (
97
+ typeof designConfig.designSettings?.assets === 'object' &&
98
+ !designConfig.designSettings.assets.basePath
99
+ ) {
100
+ designConfig.designSettings.assets.basePath = designBasePath
101
+ }
91
102
 
92
103
  reply.send(designConfig)
93
104
  })