@sap-ux/create 0.13.44 → 0.13.46

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
@@ -29,7 +29,7 @@ Options:
29
29
 
30
30
  ### [Command Options](#command-options)
31
31
 
32
- To use a option for a specific command run:
32
+ To use an option for a specific command run:
33
33
  ```sh
34
34
  npx sap-ux [command] [sub-command] [options]
35
35
  ```
@@ -68,7 +68,8 @@ It will use the configuration from the yaml file passed by cli or default to ui5
68
68
  sap-ux add cards-editor [path]
69
69
  ```
70
70
  - `-c | --config` path to project configuration file in YAML format, e.g.: -c ui5Custom.yaml
71
-
71
+ `Note:` Adding the card generator configuration is not supported for CAP projects.
72
+ -
72
73
  ### [component-usages](#add-component-usages)<a id="add-component-usages"></a>
73
74
  Calling `sap-ux add component-usages` adds the component usages to an adaptation project.
74
75
  ```sh
@@ -4,6 +4,7 @@ exports.addCardsEditorConfigCommand = addCardsEditorConfigCommand;
4
4
  const app_config_writer_1 = require("@sap-ux/app-config-writer");
5
5
  const tracing_1 = require("../../tracing");
6
6
  const validation_1 = require("../../validation");
7
+ const project_access_1 = require("@sap-ux/project-access");
7
8
  /**
8
9
  * Add the cards-editor command.
9
10
  *
@@ -33,12 +34,19 @@ async function addCardsGeneratorConfig(basePath, simulate, yamlPath) {
33
34
  try {
34
35
  logger.debug(`Called add cards-generator-config for path '${basePath}', simulate is '${simulate}'`);
35
36
  await (0, validation_1.validateBasePath)(basePath);
36
- const fs = await (0, app_config_writer_1.enableCardGeneratorConfig)(basePath, yamlPath, logger);
37
- if (!simulate) {
38
- fs.commit(() => logger.info(`Card Generator configuration written.`));
37
+ const projectRoot = await (0, project_access_1.findProjectRoot)(basePath, true, true);
38
+ const projectType = await (0, project_access_1.getProjectType)(projectRoot);
39
+ if (projectType === 'CAPJava' || projectType === 'CAPNodejs') {
40
+ await Promise.reject(new Error(`Adding the card generator configuration is not supported for CAP projects.`));
39
41
  }
40
42
  else {
41
- await (0, tracing_1.traceChanges)(fs);
43
+ const fs = await (0, app_config_writer_1.enableCardGeneratorConfig)(basePath, yamlPath, logger);
44
+ if (!simulate) {
45
+ fs.commit(() => logger.info(`Card Generator configuration written.`));
46
+ }
47
+ else {
48
+ await (0, tracing_1.traceChanges)(fs);
49
+ }
42
50
  }
43
51
  }
44
52
  catch (error) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/create",
3
3
  "description": "SAP Fiori tools module to add or remove features",
4
- "version": "0.13.44",
4
+ "version": "0.13.46",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -31,10 +31,10 @@
31
31
  "mem-fs-editor": "9.4.0",
32
32
  "prompts": "2.4.2",
33
33
  "@sap-ux/abap-deploy-config-inquirer": "1.4.19",
34
- "@sap-ux/abap-deploy-config-writer": "0.1.6",
34
+ "@sap-ux/abap-deploy-config-writer": "0.1.7",
35
35
  "@sap-ux/adp-tooling": "0.14.25",
36
- "@sap-ux/cap-config-writer": "0.10.8",
37
36
  "@sap-ux/app-config-writer": "0.6.11",
37
+ "@sap-ux/cap-config-writer": "0.10.9",
38
38
  "@sap-ux/cards-editor-config-writer": "0.5.2",
39
39
  "@sap-ux/logger": "0.7.0",
40
40
  "@sap-ux/mockserver-config-writer": "0.9.2",