@sap-ux/create 0.7.35 → 0.7.38

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,15 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * Add a new sub-command to add component usages of an adaptation project to the given command.
4
+ *
5
+ * @param {Command} cmd - The command to add the add component-usages sub-command to.
6
+ */
7
+ export declare function addComponentUsagesCommand(cmd: Command): void;
8
+ /**
9
+ * Adds component usages to the adaptation project.
10
+ *
11
+ * @param {string} basePath - The path to the adaptation project.
12
+ * @param {boolean} simulate - If set to true, then no files will be written to the filesystem.
13
+ */
14
+ export declare function addComponentUsages(basePath: string, simulate: boolean): Promise<void>;
15
+ //# sourceMappingURL=component-usages.d.ts.map
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addComponentUsages = exports.addComponentUsagesCommand = void 0;
4
+ const adp_tooling_1 = require("@sap-ux/adp-tooling");
5
+ const tracing_1 = require("../../tracing");
6
+ const validation_1 = require("../../validation/validation");
7
+ const common_1 = require("../../common");
8
+ /**
9
+ * Add a new sub-command to add component usages of an adaptation project to the given command.
10
+ *
11
+ * @param {Command} cmd - The command to add the add component-usages sub-command to.
12
+ */
13
+ function addComponentUsagesCommand(cmd) {
14
+ cmd.command('component-usages [path]')
15
+ .option('-s, --simulate', 'simulate only do not write or install')
16
+ .action(async (path, options) => {
17
+ await addComponentUsages(path, !!options.simulate);
18
+ });
19
+ }
20
+ exports.addComponentUsagesCommand = addComponentUsagesCommand;
21
+ /**
22
+ * Adds component usages to the adaptation project.
23
+ *
24
+ * @param {string} basePath - The path to the adaptation project.
25
+ * @param {boolean} simulate - If set to true, then no files will be written to the filesystem.
26
+ */
27
+ async function addComponentUsages(basePath, simulate) {
28
+ const logger = (0, tracing_1.getLogger)();
29
+ try {
30
+ if (!basePath) {
31
+ basePath = process.cwd();
32
+ }
33
+ await (0, validation_1.validateAdpProject)(basePath);
34
+ const variant = (0, adp_tooling_1.getVariant)(basePath);
35
+ const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForAddComponentUsages)(basePath, variant.layer), false);
36
+ const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_ui5_addComponentUsages" /* ChangeType.ADD_COMPONENT_USAGES */, {
37
+ variant,
38
+ answers
39
+ });
40
+ if (!simulate) {
41
+ await new Promise((resolve) => fs.commit(resolve));
42
+ }
43
+ else {
44
+ await (0, tracing_1.traceChanges)(fs);
45
+ }
46
+ }
47
+ catch (error) {
48
+ logger.error(error.message);
49
+ logger.debug(error);
50
+ }
51
+ }
52
+ exports.addComponentUsages = addComponentUsages;
53
+ //# sourceMappingURL=component-usages.js.map
@@ -10,6 +10,7 @@ const cards_editor_1 = require("./cards-editor");
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");
13
+ const component_usages_1 = require("./component-usages");
13
14
  /**
14
15
  * Return 'create-fiori add *' commands. Commands include also the handler action.
15
16
  *
@@ -33,6 +34,8 @@ function getAddCommands() {
33
34
  (0, annotations_to_odata_1.addAnnotationsToOdataCommand)(addCommands);
34
35
  // create-fiori add html
35
36
  (0, html_1.addAddHtmlFilesCmd)(addCommands);
37
+ // create-fiori add component-usages
38
+ (0, component_usages_1.addComponentUsagesCommand)(addCommands);
36
39
  return addCommands;
37
40
  }
38
41
  exports.getAddCommands = getAddCommands;
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.7.35",
4
+ "version": "0.7.38",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -30,16 +30,16 @@
30
30
  "mem-fs": "2.1.0",
31
31
  "mem-fs-editor": "9.4.0",
32
32
  "prompts": "2.4.2",
33
- "@sap-ux/adp-tooling": "0.12.22",
34
- "@sap-ux/app-config-writer": "0.4.15",
35
- "@sap-ux/cap-config-writer": "0.7.10",
36
- "@sap-ux/cards-editor-config-writer": "0.4.1",
33
+ "@sap-ux/adp-tooling": "0.12.25",
34
+ "@sap-ux/app-config-writer": "0.4.17",
35
+ "@sap-ux/cap-config-writer": "0.7.12",
36
+ "@sap-ux/cards-editor-config-writer": "0.4.2",
37
37
  "@sap-ux/inquirer-common": "0.4.3",
38
38
  "@sap-ux/logger": "0.6.0",
39
- "@sap-ux/mockserver-config-writer": "0.6.1",
40
- "@sap-ux/preview-middleware": "0.16.32",
41
- "@sap-ux/project-access": "1.26.1",
42
- "@sap-ux/system-access": "0.5.3",
39
+ "@sap-ux/mockserver-config-writer": "0.6.2",
40
+ "@sap-ux/preview-middleware": "0.16.35",
41
+ "@sap-ux/project-access": "1.26.3",
42
+ "@sap-ux/system-access": "0.5.4",
43
43
  "@sap-ux/ui5-config": "0.23.1"
44
44
  },
45
45
  "devDependencies": {