livingdocs-cli 2.4.0 → 2.4.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
@@ -42,7 +42,7 @@ OPTIONS
42
42
  -s, --src=src The folder with your .html component templates
43
43
  ```
44
44
 
45
- _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/component-library/build.js)_
45
+ _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/component-library/build.js)_
46
46
 
47
47
  ## `livingdocs-cli config:print`
48
48
 
@@ -57,7 +57,7 @@ OPTIONS
57
57
  -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
58
58
  ```
59
59
 
60
- _See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/config/print.js)_
60
+ _See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/config/print.js)_
61
61
 
62
62
  ## `livingdocs-cli design-server:start`
63
63
 
@@ -76,7 +76,7 @@ OPTIONS
76
76
  --verbose
77
77
  ```
78
78
 
79
- _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/design-server/start.js)_
79
+ _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/design-server/start.js)_
80
80
 
81
81
  ## `livingdocs-cli help [COMMAND]`
82
82
 
@@ -118,7 +118,7 @@ OPTIONS
118
118
  --format=js|js/html|json The format of the files written.
119
119
  ```
120
120
 
121
- _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/project-config/download.js)_
121
+ _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/project-config/download.js)_
122
122
 
123
123
  ## `livingdocs-cli project-config:import-design`
124
124
 
@@ -135,7 +135,7 @@ OPTIONS
135
135
  -u, --designUri=designUri (required) URL of the design to import
136
136
  ```
137
137
 
138
- _See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/project-config/import-design.js)_
138
+ _See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/project-config/import-design.js)_
139
139
 
140
140
  ## `livingdocs-cli project-config:plan`
141
141
 
@@ -160,7 +160,7 @@ OPTIONS
160
160
  Can be set by the environment variable 'LI_TOKEN'.
161
161
  ```
162
162
 
163
- _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/project-config/plan.js)_
163
+ _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/project-config/plan.js)_
164
164
 
165
165
  ## `livingdocs-cli project-config:publish`
166
166
 
@@ -183,7 +183,9 @@ OPTIONS
183
183
 
184
184
  -t, --token=token (required) Access Token for your project (needs `public-api:config:write` permission).
185
185
  Can be set by the environment variable 'LI_TOKEN'.
186
+
187
+ -y, --yes Confirm
186
188
  ```
187
189
 
188
- _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.0/src/commands/project-config/publish.js)_
190
+ _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.4.1/src/commands/project-config/publish.js)_
189
191
  <!-- commandsstop -->
@@ -1 +1 @@
1
- {"version":"2.4.0","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},"address":{"name":"address","type":"option","char":"a","description":"The address of the design-server."},"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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config."},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."}},"args":[]},"project-config:publish":{"id":"project-config:publish","description":"Publish a project configuration 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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config."},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."}},"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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config.","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":[]}}}
1
+ {"version":"2.4.1","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},"address":{"name":"address","type":"option","char":"a","description":"The address of the design-server."},"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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config."},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."}},"args":[]},"project-config:publish":{"id":"project-config:publish","description":"Publish a project configuration 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."},"yes":{"name":"yes","type":"boolean","char":"y","description":"Confirm","allowNo":false},"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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config."},"dist":{"name":"dist","type":"option","char":"d","description":"The folder where the output will be written."}},"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"},"source":{"name":"source","type":"option","char":"s","description":"The folder or filename to the project config.","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.4.0",
4
+ "version": "2.4.1",
5
5
  "author": "Livingdocs AG",
6
6
  "repository": "livingdocsIO/livingdocs-cli",
7
7
  "homepage": "https://github.com/livingdocsIO/livingdocs-cli",
@@ -86,11 +86,11 @@
86
86
  "isCi": true,
87
87
  "name": "Drone",
88
88
  "service": "drone",
89
- "commit": "073bb133c9abdc5cca5ab3f6e12648a010f595dd",
90
- "build": "103",
89
+ "commit": "7d697c6169bf306d31b76f4fe85f0e4ce94ac805",
90
+ "build": "107",
91
91
  "branch": "master",
92
92
  "isPr": false,
93
93
  "slug": "livingdocsIO/livingdocs-cli",
94
- "date": "2022-02-11T21:50:28.394Z"
94
+ "date": "2022-03-25T12:54:58.687Z"
95
95
  }
96
96
  }
@@ -14,6 +14,7 @@ class PublishCommand extends Command {
14
14
  static flags = {
15
15
  project: sharedFlags.project,
16
16
  env: sharedFlags.env,
17
+ yes: sharedFlags.yes,
17
18
  token: {...sharedFlags.configWriteToken, required: true},
18
19
  host: {...sharedFlags.host, required: true},
19
20
  source: {...sharedFlags.source},
@@ -21,7 +22,7 @@ class PublishCommand extends Command {
21
22
  }
22
23
 
23
24
  async run () {
24
- const {token, host, source, dist, env} = this.parse(PublishCommand).flags
25
+ const {token, host, source, dist, env, yes} = this.parse(PublishCommand).flags
25
26
  const reportError = errorReporter(this.log, host, {verbose: true})
26
27
 
27
28
  if (!source && !dist) throw new Error('Missing a source param')
@@ -46,14 +47,16 @@ class PublishCommand extends Command {
46
47
 
47
48
  if (!ok) return
48
49
 
49
- const answers = await inquirer.prompt([{
50
- name: 'continue',
51
- type: 'confirm',
52
- default: false,
53
- message: `Are you sure to publish${env ? ` to ${env}` : ''}?`
54
- }])
50
+ if (!yes) {
51
+ const answers = await inquirer.prompt([{
52
+ name: 'continue',
53
+ type: 'confirm',
54
+ default: false,
55
+ message: `Are you sure to publish${env ? ` to ${env}` : ''}?`
56
+ }])
55
57
 
56
- if (!answers.continue) return
58
+ if (!answers.continue) return
59
+ }
57
60
 
58
61
  await liApi.publish({host, token, channelConfig: config})
59
62
  .then((result) => {
@@ -70,7 +70,7 @@ module.exports = function ({result, log, omitPatches}) {
70
70
  }
71
71
 
72
72
  if (result.violations) {
73
- error(`\nInvalid Config: there are invliad configuration properties`)
73
+ error(`\nInvalid Config: there are invalid configuration properties`)
74
74
 
75
75
  for (const err of result.violations) {
76
76
  error(` • ${err.pointer}: ${err.message}`)
@@ -11,6 +11,11 @@ module.exports = {
11
11
  char: 'e',
12
12
  description: 'If used configuration options are loaded from .livingdocs-cli file.'
13
13
  }),
14
+ yes: flags.boolean({
15
+ char: 'y',
16
+ description: 'Confirm',
17
+ default () { return !process.stdin.isTTY }
18
+ }),
14
19
  configWriteToken: flags.string({
15
20
  char: 't',
16
21
  description: 'Access Token for your project (needs `public-api:config:write` permission).\n' +