@sap-ux/create 0.13.2 → 0.13.4

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.
@@ -0,0 +1,8 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * Add the cards-editor command.
4
+ *
5
+ * @param cmd - commander command for adding card editor config command
6
+ */
7
+ export declare function addCardsEditorConfigCommand(cmd: Command): void;
8
+ //# sourceMappingURL=cards-generator.d.ts.map
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.addCardsEditorConfigCommand = addCardsEditorConfigCommand;
4
- const cards_editor_config_writer_1 = require("@sap-ux/cards-editor-config-writer");
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 common_1 = require("../../common");
8
7
  /**
9
- * Add the cards-editor-config command.
8
+ * Add the cards-editor command.
10
9
  *
11
- * @param cmd - commander command for adding navigation inbounds config command
10
+ * @param cmd - commander command for adding card editor config command
12
11
  */
13
12
  function addCardsEditorConfigCommand(cmd) {
14
13
  cmd.command('cards-editor [path]')
14
+ .option('-c, --config <string>', 'Path to project configuration file in YAML format', 'ui5.yaml')
15
15
  .option('-n, --skip-install', 'skip npm install step')
16
16
  .option('-s, --simulate', 'simulate only do not write config; sets also --verbose')
17
17
  .option('-v, --verbose', 'show verbose information')
@@ -19,35 +19,32 @@ function addCardsEditorConfigCommand(cmd) {
19
19
  if (options.verbose === true || options.simulate) {
20
20
  (0, tracing_1.setLogLevelVerbose)();
21
21
  }
22
- await addCardsEditorConfig(path || process.cwd(), !!options.simulate, !!options.skipInstall);
22
+ await addCardsGeneratorConfig(path ?? process.cwd(), !!options.simulate, options.config);
23
23
  });
24
24
  }
25
25
  /**
26
- * Adds an cards editor config to an app. To prevent overwriting existing inbounds will be checked.
26
+ * Adds an cards generator config to an app. To prevent overwriting existing inbounds will be checked.
27
27
  *
28
28
  * @param basePath - path to application root
29
29
  * @param simulate - if true, do not write but just show what would be changed; otherwise write
30
- * @param skipInstall - if true, do not run npm install
30
+ * @param yamlPath - path to the ui5*.yaml file passed by cli
31
31
  */
32
- async function addCardsEditorConfig(basePath, simulate, skipInstall) {
32
+ async function addCardsGeneratorConfig(basePath, simulate, yamlPath) {
33
33
  const logger = (0, tracing_1.getLogger)();
34
34
  try {
35
- logger.debug(`Called add cards-editor-config for path '${basePath}', simulate is '${simulate}'`);
35
+ logger.debug(`Called add cards-generator-config for path '${basePath}', simulate is '${simulate}'`);
36
36
  await (0, validation_1.validateBasePath)(basePath);
37
- const fs = await (0, cards_editor_config_writer_1.enableCardsEditor)(basePath);
37
+ const fs = await (0, app_config_writer_1.enableCardGeneratorConfig)(basePath, yamlPath, logger);
38
38
  if (!simulate) {
39
- await new Promise((resolve) => fs.commit(resolve));
40
- if (!skipInstall) {
41
- (0, common_1.runNpmInstallCommand)(basePath, [], { logger });
42
- }
39
+ fs.commit(() => logger.info(`Card Generator configuration written.`));
43
40
  }
44
41
  else {
45
42
  await (0, tracing_1.traceChanges)(fs);
46
43
  }
47
44
  }
48
45
  catch (error) {
49
- logger.error(`Error while executing add cards editor configuration '${error.message}'`);
46
+ logger.error(`Error while executing add cards generator configuration '${error.message}'`);
50
47
  logger.debug(error);
51
48
  }
52
49
  }
53
- //# sourceMappingURL=cards-editor.js.map
50
+ //# sourceMappingURL=cards-generator.js.map
@@ -6,7 +6,7 @@ const mockserver_config_1 = require("./mockserver-config");
6
6
  const smartlinks_config_1 = require("./smartlinks-config");
7
7
  const cds_plugin_ui_1 = require("./cds-plugin-ui");
8
8
  const navigation_config_1 = require("./navigation-config");
9
- const cards_editor_1 = require("./cards-editor");
9
+ const cards_generator_1 = require("./cards-generator");
10
10
  const new_model_1 = require("./new-model");
11
11
  const annotations_to_odata_1 = require("./annotations-to-odata");
12
12
  const html_1 = require("./html");
@@ -29,7 +29,7 @@ function getAddCommands() {
29
29
  // create-fiori add inbound-navigation-config
30
30
  (0, navigation_config_1.addInboundNavigationConfigCommand)(addCommands);
31
31
  // create-fiori add cards-editor
32
- (0, cards_editor_1.addCardsEditorConfigCommand)(addCommands);
32
+ (0, cards_generator_1.addCardsEditorConfigCommand)(addCommands);
33
33
  // create-fiori add model
34
34
  (0, new_model_1.addNewModelCommand)(addCommands);
35
35
  // create-fiori add annotations-to-odata
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.2",
4
+ "version": "0.13.4",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -33,13 +33,13 @@
33
33
  "@sap-ux/abap-deploy-config-inquirer": "1.4.1",
34
34
  "@sap-ux/abap-deploy-config-writer": "0.1.1",
35
35
  "@sap-ux/adp-tooling": "0.14.2",
36
- "@sap-ux/app-config-writer": "0.6.1",
36
+ "@sap-ux/app-config-writer": "0.6.2",
37
37
  "@sap-ux/cap-config-writer": "0.10.1",
38
38
  "@sap-ux/cards-editor-config-writer": "0.5.1",
39
39
  "@sap-ux/logger": "0.7.0",
40
40
  "@sap-ux/mockserver-config-writer": "0.9.1",
41
41
  "@sap-ux/odata-service-writer": "0.27.1",
42
- "@sap-ux/preview-middleware": "0.20.2",
42
+ "@sap-ux/preview-middleware": "0.20.4",
43
43
  "@sap-ux/project-access": "1.30.1",
44
44
  "@sap-ux/system-access": "0.6.0",
45
45
  "@sap-ux/ui5-config": "0.28.1",
@@ -1,8 +0,0 @@
1
- import type { Command } from 'commander';
2
- /**
3
- * Add the cards-editor-config command.
4
- *
5
- * @param cmd - commander command for adding navigation inbounds config command
6
- */
7
- export declare function addCardsEditorConfigCommand(cmd: Command): void;
8
- //# sourceMappingURL=cards-editor.d.ts.map