livingdocs-cli 2.5.8 → 3.0.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
@@ -44,7 +44,7 @@ OPTIONS
44
44
  -s, --src=src The folder with your .html component templates
45
45
  ```
46
46
 
47
- _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/component-library/build.js)_
47
+ _See code: [src/commands/component-library/build.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/component-library/build.js)_
48
48
 
49
49
  ## `livingdocs-cli config:print`
50
50
 
@@ -59,7 +59,7 @@ OPTIONS
59
59
  -p, --project=project If used configuration options are loaded from .livingdocs-cli file.
60
60
  ```
61
61
 
62
- _See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/config/print.js)_
62
+ _See code: [src/commands/config/print.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/config/print.js)_
63
63
 
64
64
  ## `livingdocs-cli design-server:start`
65
65
 
@@ -78,7 +78,7 @@ OPTIONS
78
78
  --verbose
79
79
  ```
80
80
 
81
- _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/design-server/start.js)_
81
+ _See code: [src/commands/design-server/start.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/design-server/start.js)_
82
82
 
83
83
  ## `livingdocs-cli help [COMMAND]`
84
84
 
@@ -120,7 +120,7 @@ OPTIONS
120
120
  --format=js|js/html|json The format of the files written.
121
121
  ```
122
122
 
123
- _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/download.js)_
123
+ _See code: [src/commands/project-config/download.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/download.js)_
124
124
 
125
125
  ## `livingdocs-cli project-config:import-design`
126
126
 
@@ -137,7 +137,7 @@ OPTIONS
137
137
  -u, --designUri=designUri (required) URL of the design to import
138
138
  ```
139
139
 
140
- _See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/import-design.js)_
140
+ _See code: [src/commands/project-config/import-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/import-design.js)_
141
141
 
142
142
  ## `livingdocs-cli project-config:plan`
143
143
 
@@ -162,7 +162,7 @@ OPTIONS
162
162
  Can be set by the environment variable 'LI_TOKEN'.
163
163
  ```
164
164
 
165
- _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/plan.js)_
165
+ _See code: [src/commands/project-config/plan.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/plan.js)_
166
166
 
167
167
  ## `livingdocs-cli project-config:publish`
168
168
 
@@ -189,7 +189,7 @@ OPTIONS
189
189
  -y, --yes Confirm
190
190
  ```
191
191
 
192
- _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/publish.js)_
192
+ _See code: [src/commands/project-config/publish.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/publish.js)_
193
193
 
194
194
  ## `livingdocs-cli project-config:publish-design`
195
195
 
@@ -211,7 +211,7 @@ OPTIONS
211
211
  -u, --username=username username for login
212
212
  ```
213
213
 
214
- _See code: [src/commands/project-config/publish-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/publish-design.js)_
214
+ _See code: [src/commands/project-config/publish-design.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/publish-design.js)_
215
215
 
216
216
  ## `livingdocs-cli project-config:upload-assets`
217
217
 
@@ -234,5 +234,5 @@ OPTIONS
234
234
  Can be set by the environment variable 'LI_TOKEN'.
235
235
  ```
236
236
 
237
- _See code: [src/commands/project-config/upload-assets.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v2.5.8/src/commands/project-config/upload-assets.js)_
237
+ _See code: [src/commands/project-config/upload-assets.js](https://github.com/livingdocsIO/livingdocs-cli/blob/v3.0.0/src/commands/project-config/upload-assets.js)_
238
238
  <!-- commandsstop -->
@@ -1 +1 @@
1
- {"version":"2.5.8","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-design":{"id":"project-config:publish-design","description":"Publish Design to DesignServer","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"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"},"username":{"name":"username","type":"option","char":"us","description":"username for login"},"password":{"name":"password","type":"option","char":"pw","description":"password for login"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder to the design.","required":true},"forceUpdate":{"name":"forceUpdate","type":"boolean","char":"f","description":"The design name of the assets to upload","allowNo":false}},"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-assets":{"id":"project-config:upload-assets","description":"Upload assets to your design","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."},"designName":{"name":"designName","type":"option","char":"dn","description":"The design name of the assets to upload"},"designVersion":{"name":"designVersion","type":"option","char":"dv","description":"The design version of the assets to upload"}},"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":[]}}}
1
+ {"version":"3.0.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: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-design":{"id":"project-config:publish-design","description":"Publish Design to DesignServer","pluginName":"livingdocs-cli","pluginType":"core","aliases":[],"flags":{"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"},"username":{"name":"username","type":"option","char":"us","description":"username for login"},"password":{"name":"password","type":"option","char":"pw","description":"password for login"},"dist":{"name":"dist","type":"option","char":"d","description":"The folder to the design.","required":true},"forceUpdate":{"name":"forceUpdate","type":"boolean","char":"f","description":"The design name of the assets to upload","allowNo":false}},"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-assets":{"id":"project-config:upload-assets","description":"Upload assets to your design","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."},"designName":{"name":"designName","type":"option","char":"dn","description":"The design name of the assets to upload"},"designVersion":{"name":"designVersion","type":"option","char":"dv","description":"The design version of the assets to upload"}},"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.5.8",
4
+ "version": "3.0.0",
5
5
  "author": "Livingdocs AG",
6
6
  "repository": "livingdocsIO/livingdocs-cli",
7
7
  "homepage": "https://github.com/livingdocsIO/livingdocs-cli",
@@ -89,11 +89,11 @@
89
89
  "isCi": true,
90
90
  "name": "Drone",
91
91
  "service": "drone",
92
- "commit": "3e0014713e02d4d2eecc54f7fa6bce322b7894ee",
93
- "build": "188",
92
+ "commit": "0c169b3a62ffcbab9129f2c5224a4dca6bbeaa38",
93
+ "build": "191",
94
94
  "branch": "master",
95
95
  "isPr": false,
96
96
  "slug": "livingdocsIO/livingdocs-cli",
97
- "date": "2023-10-13T12:47:19.490Z"
97
+ "date": "2023-10-13T13:33:58.826Z"
98
98
  }
99
99
  }
@@ -5,7 +5,7 @@ const {Command, flags} = require('@oclif/command')
5
5
 
6
6
  const sharedFlags = require('../../lib/cli/shared_flags')
7
7
  const liApi = require('../../lib/api/livingdocs_api')
8
- const writeConfig = require('../../lib/write_channel_config')
8
+ const writeConfig = require('../../lib/write_project_config')
9
9
  const errorReporter = require('../../lib/api/error_reporter')
10
10
  const assertDistFolder = require('../../lib/cli/assert_dist_folder')
11
11
 
@@ -38,7 +38,7 @@ class DownloadCommand extends Command {
38
38
  if (dist) {
39
39
  const {fileCount, oldFiles} = await writeConfig({
40
40
  destination: dist,
41
- channelConfig: result,
41
+ projectConfig: result,
42
42
  fileType: format || 'js',
43
43
  componentsAsHtml: false
44
44
  })
@@ -3,8 +3,8 @@ const _ = require('lodash')
3
3
  const {Command} = require('@oclif/command')
4
4
 
5
5
  const sharedFlags = require('../../lib/cli/shared_flags')
6
- const writeConfig = require('../../lib/write_channel_config')
7
- const readChannelConfig = require('../../lib/read_channel_config')
6
+ const writeConfig = require('../../lib/write_project_config')
7
+ const readProjectConfig = require('../../lib/read_project_config')
8
8
  const assertDistFolder = require('../../lib/cli/assert_dist_folder')
9
9
  const downloadDesign = require('../../lib/utils/download_design')
10
10
  const parseDesignV2 = require('../../lib/parsing/parse_design_to_v2')
@@ -25,7 +25,7 @@ class ImportDesignCommand extends Command {
25
25
 
26
26
  let config
27
27
  try {
28
- config = await readChannelConfig({source: dist})
28
+ config = await readProjectConfig({source: dist})
29
29
  } catch (err) {
30
30
  this.log(chalk.red('✕ Parsing Failed'))
31
31
  throw err
@@ -57,7 +57,7 @@ class ImportDesignCommand extends Command {
57
57
 
58
58
  await writeConfig({
59
59
  destination: dist,
60
- channelConfig: config,
60
+ projectConfig: config,
61
61
  fileType: 'js',
62
62
  componentsAsHtml: false
63
63
  })
@@ -4,7 +4,7 @@ const sharedFlags = require('../../lib/cli/shared_flags')
4
4
  const liApi = require('../../lib/api/livingdocs_api')
5
5
  const errorReporter = require('../../lib/api/error_reporter')
6
6
  const resultReporter = require('../../lib/api/project_config_result_reporter')
7
- const readChannelConfig = require('../../lib/read_channel_config')
7
+ const readProjectConfig = require('../../lib/read_project_config')
8
8
 
9
9
  class PlanCommand extends Command {
10
10
  static description = `See what would be updated in a publish command`
@@ -23,9 +23,9 @@ class PlanCommand extends Command {
23
23
 
24
24
  if (!source && !dist) throw new Error('Missing a source param')
25
25
 
26
- const config = await readChannelConfig({source: source || dist})
26
+ const config = await readProjectConfig({source: source || dist})
27
27
 
28
- await liApi.plan({host, token, channelConfig: config})
28
+ await liApi.plan({host, token, projectConfig: config})
29
29
  .then((result) => {
30
30
  resultReporter({result, log: this.log})
31
31
  })
@@ -6,7 +6,7 @@ const sharedFlags = require('../../lib/cli/shared_flags')
6
6
  const liApi = require('../../lib/api/livingdocs_api')
7
7
  const errorReporter = require('../../lib/api/error_reporter')
8
8
  const resultReporter = require('../../lib/api/project_config_result_reporter')
9
- const readChannelConfig = require('../../lib/read_channel_config')
9
+ const readProjectConfig = require('../../lib/read_project_config')
10
10
  const updateRevisionNumber = require('../../lib/update_revision_number')
11
11
 
12
12
  class PublishCommand extends Command {
@@ -27,14 +27,14 @@ class PublishCommand extends Command {
27
27
 
28
28
  if (!source && !dist) throw new Error('Missing a source param')
29
29
 
30
- const config = await readChannelConfig({source: source || dist})
30
+ const config = await readProjectConfig({source: source || dist})
31
31
  .catch((err) => {
32
32
  this.log(chalk.red('✕ Parsing Failed'))
33
33
  throw err
34
34
  })
35
35
 
36
36
  let ok = false
37
- await liApi.plan({host, token, channelConfig: config})
37
+ await liApi.plan({host, token, projectConfig: config})
38
38
  .then((result) => {
39
39
  ok = result.ok
40
40
 
@@ -58,7 +58,7 @@ class PublishCommand extends Command {
58
58
  if (!answers.continue) return
59
59
  }
60
60
 
61
- await liApi.publish({host, token, channelConfig: config})
61
+ await liApi.publish({host, token, projectConfig: config})
62
62
  .then((result) => {
63
63
  resultReporter({result, log: this.log})
64
64
  updateRevisionNumber({
@@ -10,49 +10,31 @@ axiosJarInstance.interceptors.response.use(responseInterceptor)
10
10
  // down- and upload to the ☁️
11
11
  module.exports = {
12
12
 
13
- // ChannelConfig
14
- // -------------
13
+ // Project Config
14
+ // --------------
15
15
 
16
16
  async download ({host, token}) {
17
- return axios(host, token).get('/api/v1/channelConfig')
17
+ return axios(host, token).get('/api/v1/projectConfig')
18
18
  .then((response) => {
19
19
  return response.data
20
20
  })
21
21
 
22
22
  },
23
23
 
24
- async plan ({host, token, channelConfig}) {
25
- return axios(host, token).post('/api/v1/channelConfig', {
24
+ async plan ({host, token, projectConfig}) {
25
+ return axios(host, token).post('/api/v1/projectConfig', {
26
26
  plan: true,
27
- channelConfig
27
+ projectConfig
28
28
  })
29
29
  .then((response) => {
30
30
  return response.data
31
31
  })
32
-
33
32
  },
34
33
 
35
- async publish ({host, token, channelConfig}) {
36
- return axios(host, token).post('/api/v1/channelConfig', {
34
+ async publish ({host, token, projectConfig}) {
35
+ return axios(host, token).post('/api/v1/projectConfig', {
37
36
  plan: false,
38
- channelConfig
39
- })
40
- .then((response) => {
41
- return response.data
42
- })
43
- },
44
-
45
- async listDrafts ({host, token}) {
46
- return axios(host, token).get('/api/v1/channelConfig/drafts')
47
- .then((response) => {
48
- return response.data
49
- })
50
- },
51
-
52
- async uploadDraft ({host, token, draftName, channelConfig}) {
53
- return axios(host, token).put('/api/v1/channelConfig/drafts', {
54
- draftName,
55
- channelConfig
37
+ projectConfig
56
38
  })
57
39
  .then((response) => {
58
40
  return response.data
@@ -52,7 +52,7 @@ module.exports = function ({result, log, omitPatches}) {
52
52
  else info(`\n✓ All ${count} patches look good.\n`)
53
53
  } else {
54
54
  success(dedent`
55
- ✓ Success. Channel Config Published.
55
+ ✓ Success. Project Config Published.
56
56
 
57
57
  Revision: ${result.revisionNumber}
58
58
  DesignVersion: ${result.designVersion || '-'}
@@ -3,11 +3,11 @@ const _map = require('lodash/map')
3
3
  const parseComponents = require('./parsing/parse_components')
4
4
 
5
5
  module.exports = async function ({source}) {
6
- const {rootFolder, channelConfig} = loadChannelConfig(source)
6
+ const {rootFolder, projectConfig} = loadProjectConfig(source)
7
7
 
8
- if (channelConfig.components) {
8
+ if (projectConfig.components) {
9
9
  let needsLoading = false
10
- const filePaths = _map(channelConfig.components, (component) => {
10
+ const filePaths = _map(projectConfig.components, (component) => {
11
11
  if (typeof component === 'string') {
12
12
  needsLoading = true
13
13
  const filePath = path.resolve(rootFolder, component)
@@ -17,19 +17,19 @@ module.exports = async function ({source}) {
17
17
 
18
18
  if (needsLoading) {
19
19
  const {components} = await parseComponents({filePaths})
20
- channelConfig.components = components
20
+ projectConfig.components = components
21
21
  }
22
22
  }
23
- return channelConfig
23
+ return projectConfig
24
24
  }
25
25
 
26
- function loadChannelConfig (source) {
26
+ function loadProjectConfig (source) {
27
27
  try {
28
28
  const rootFolder = path.resolve(source)
29
- const channelConfig = require(rootFolder)
30
- return {rootFolder, channelConfig}
29
+ const projectConfig = require(rootFolder)
30
+ return {rootFolder, projectConfig}
31
31
  } catch (err) {
32
- throw new Error(`Could not load channel config from path '${source}'.
32
+ throw new Error(`Could not load projectConfig from path '${source}'.
33
33
  Error Stack: ${err.stack}
34
34
  Error: ${err.message}`)
35
35
  }
@@ -9,15 +9,15 @@ const {stringify: stringifyjs} = require('javascript-stringify')
9
9
  const buildFile = require('./utils/build_file')
10
10
  const {indentString} = require('./utils')
11
11
 
12
- module.exports = async function ({destination, channelConfig, fileType, componentsAsHtml}) {
12
+ module.exports = async function ({destination, projectConfig, fileType, componentsAsHtml}) {
13
13
  const rootFolder = path.resolve(destination)
14
14
  const writeHtml = fileType === 'js/html'
15
- const baseRevision = channelConfig.$baseRevision
15
+ const baseRevision = projectConfig.$baseRevision
16
16
 
17
17
  await fs.ensureDir(rootFolder)
18
18
 
19
19
  if (fileType === 'json') {
20
- return writeJsonFile(`${rootFolder}/index.json`, channelConfig)
20
+ return writeJsonFile(`${rootFolder}/index.json`, projectConfig)
21
21
  }
22
22
 
23
23
  fileType = 'js'
@@ -36,11 +36,11 @@ module.exports = async function ({destination, channelConfig, fileType, componen
36
36
  }
37
37
  indexFile.line('', 1)
38
38
 
39
- for (const key in channelConfig) {
39
+ for (const key in projectConfig) {
40
40
  if (key === 'v') continue
41
41
  if (key === '$baseRevision') continue
42
42
 
43
- const prop = channelConfig[key]
43
+ const prop = projectConfig[key]
44
44
 
45
45
  if (Array.isArray(prop)) {
46
46
  const folder = `${rootFolder}/${_kebabCase(key)}`
@@ -1,35 +0,0 @@
1
- const chalk = require('chalk')
2
- const {Command} = require('@oclif/command')
3
-
4
- const sharedFlags = require('../../lib/cli/shared_flags')
5
- const liApi = require('../../lib/api/livingdocs_api')
6
- const errorReporter = require('../../lib/api/error_reporter')
7
-
8
- class DraftsCommand extends Command {
9
- static hidden = true
10
- static description = `List project configuration drafts`
11
- static flags = {
12
- token: {...sharedFlags.configReadToken, required: true},
13
- host: sharedFlags.host
14
- }
15
-
16
- async run () {
17
- const {token, host} = this.parse(DraftsCommand).flags
18
- const reportError = errorReporter(this.log, host, {verbose: true})
19
-
20
- await liApi.listDrafts({host, token})
21
- .then((result) => {
22
- this.log(`Drafts:`)
23
- if (!result || !result.length) {
24
- this.log(chalk.gray(`-> 0 drafts found`))
25
- } else {
26
- for (const draftName of result) {
27
- this.log(` • ${draftName}`)
28
- }
29
- }
30
- })
31
- .catch(reportError)
32
- }
33
- }
34
-
35
- module.exports = DraftsCommand
@@ -1,47 +0,0 @@
1
- const chalk = require('chalk')
2
- const {Command, flags} = require('@oclif/command')
3
-
4
- const sharedFlags = require('../../lib/cli/shared_flags')
5
- const liApi = require('../../lib/api/livingdocs_api')
6
- const errorReporter = require('../../lib/api/error_reporter')
7
- const resultReporter = require('../../lib/api/project_config_result_reporter')
8
- const readChannelConfig = require('../../lib/read_channel_config')
9
-
10
- class UploadCommand extends Command {
11
- static hidden = true
12
- static description = `Upload a ChannelConfig into a draft for your project`
13
- static flags = {
14
- project: sharedFlags.project,
15
- env: sharedFlags.env,
16
- token: {...sharedFlags.configWriteToken, required: true},
17
- host: {...sharedFlags.host, required: true},
18
- source: {
19
- ...sharedFlags.source,
20
- required: true
21
- },
22
- draftName: flags.string({
23
- description: 'The name of the draft the config will be saved under.',
24
- required: true
25
- })
26
- }
27
-
28
- async run () {
29
- const {token, host, source} = this.parse(UploadCommand).flags
30
- const reportError = errorReporter(this.log, host, {verbose: true})
31
-
32
- const config = await readChannelConfig({source})
33
- .catch((err) => {
34
- this.log(chalk.red('✕ Parsing Failed'))
35
- throw err
36
- })
37
-
38
-
39
- await liApi.uploadDraft({host, token, channelConfig: config})
40
- .then((result) => {
41
- resultReporter({result, log: this.log})
42
- })
43
- .catch(reportError)
44
- }
45
- }
46
-
47
- module.exports = UploadCommand