@sap-ux/create 0.16.5 → 0.16.8

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
@@ -68,7 +68,7 @@ Command group for adding features to existing SAP Fiori applications. A subcomma
68
68
 
69
69
  Usage: `npx --yes @sap-ux/create@latest add [subcommand] [options]`
70
70
 
71
- The available subcommands are: `mockserver-config`, `smartlinks-config`, `eslint-config`, `cds-plugin-ui5`, `inbound-navigation`, `cards-editor`, `model`, `annotations`, `html`, `component-usages`, `deploy-config`, `variants-config` and `adp-cf-config`
71
+ The available subcommands are: `mockserver-config`, `smartlinks-config`, `eslint-config`, `cds-plugin-ui5`, `inbound-navigation`, `cards-editor`, `model`, `annotations`, `html`, `component-usages`, `deploy-config`, `variants-config`, `adp-cf-config` and `flp-embedded-config`
72
72
 
73
73
 
74
74
  --------------------------------
@@ -271,6 +271,25 @@ Options:
271
271
 
272
272
  --------------------------------
273
273
 
274
+ ## [`add flp-embedded-config`](#add-flp-embedded-config)
275
+
276
+ Add the necessary configuration for running a Fiori app in FLP Embedded Mode.
277
+ Adds a `start-embedded` script to `package.json` and creates an `flp.yaml` file
278
+ based on the existing `ui5.yaml`. Pre-existing files will be overridden.
279
+
280
+ Example:
281
+
282
+ `npx --yes @sap-ux/create@latest add flp-embedded-config --bspApplication my-bsp-app`
283
+
284
+ Options:
285
+ - `-b, --bspApplication <string>` _(required)_ - BSP application name of the deployed app
286
+ - `-c, --config <string>` - Path (relative to project root) to the ui5.yaml to use as base for flp.yaml _(default: `ui5.yaml`)_
287
+ - `--flp <string>` - FLP URL path used in the start-embedded script _(default: `sap/bc/ui5_ui5/ui2/ushell/shells/abap/Fiorilaunchpad.html`)_
288
+ - `-s, --simulate` - Simulate only. Do not write files. Also sets `--verbose`.
289
+ - `-v, --verbose` - Show verbose information.
290
+
291
+ --------------------------------
292
+
274
293
  ## [`convert`](#convert)
275
294
 
276
295
  Command group for converting existing SAP Fiori applications. A subcommand is required.
@@ -0,0 +1,8 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * Add the "add flp-embedded-config" command to a passed command.
4
+ *
5
+ * @param cmd - commander command to attach the flp-embedded-config subcommand to
6
+ */
7
+ export declare function addFlpEmbeddedConfigCommand(cmd: Command): void;
8
+ //# sourceMappingURL=flp-embedded-config.d.ts.map
@@ -0,0 +1,69 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addFlpEmbeddedConfigCommand = addFlpEmbeddedConfigCommand;
4
+ const tracing_1 = require("../../tracing");
5
+ const app_config_writer_1 = require("@sap-ux/app-config-writer");
6
+ /**
7
+ * Add the "add flp-embedded-config" command to a passed command.
8
+ *
9
+ * @param cmd - commander command to attach the flp-embedded-config subcommand to
10
+ */
11
+ function addFlpEmbeddedConfigCommand(cmd) {
12
+ cmd.command('flp-embedded-config [path]')
13
+ .description(`Add the necessary configuration for running a Fiori app in FLP Embedded Mode.
14
+ Adds a \`start-embedded\` script to \`package.json\` and creates an \`flp.yaml\` file
15
+ based on the existing \`ui5.yaml\`. Pre-existing files will be overridden.
16
+
17
+ Example:
18
+ \`npx --yes @sap-ux/create@latest add flp-embedded-config --bspApplication my-bsp-app\``)
19
+ .requiredOption('-b, --bspApplication <string>', 'BSP application name of the deployed app')
20
+ .option('-c, --config <string>', 'Path (relative to project root) to the ui5.yaml to use as base for flp.yaml', 'ui5.yaml')
21
+ .option('--flp <string>', 'FLP URL path used in the start-embedded script', app_config_writer_1.DEFAULT_FLP_PATH)
22
+ .option('-s, --simulate', 'Simulate only. Do not write files. Also sets `--verbose`.')
23
+ .option('-v, --verbose', 'Show verbose information.')
24
+ .action(async (path, options) => {
25
+ if (options.verbose === true || options.simulate) {
26
+ (0, tracing_1.setLogLevelVerbose)();
27
+ }
28
+ // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing
29
+ await runFlpEmbeddedConfig(path || process.cwd(), options);
30
+ });
31
+ }
32
+ /**
33
+ * Run the flp-embedded-config generation.
34
+ *
35
+ * @param basePath - project root (where package.json and ui5.yaml are)
36
+ * @param options - parsed CLI options
37
+ * @param options.bspApplication - BSP application name of the deployed app
38
+ * @param options.config - path to the ui5.yaml to use as base for flp.yaml
39
+ * @param options.flp - FLP URL path used in the start-embedded script
40
+ * @param options.simulate - if true, simulate only and do not write files
41
+ */
42
+ async function runFlpEmbeddedConfig(basePath, options) {
43
+ const logger = (0, tracing_1.getLogger)();
44
+ try {
45
+ logger.debug(`Called add flp-embedded-config for path '${basePath}', bspApplication '${options.bspApplication}'`);
46
+ const fs = await (0, app_config_writer_1.generateFlpEmbeddedConfig)(basePath, options.bspApplication, options.flp, options.config, undefined, logger);
47
+ if (options.simulate) {
48
+ await (0, tracing_1.traceChanges)(fs);
49
+ }
50
+ else {
51
+ await new Promise((resolve, reject) => {
52
+ fs.commit((error) => {
53
+ if (error) {
54
+ reject(error);
55
+ }
56
+ else {
57
+ logger.info(`FLP Embedded Mode configuration written.`);
58
+ resolve();
59
+ }
60
+ });
61
+ });
62
+ }
63
+ }
64
+ catch (error) {
65
+ logger.error(`Error while executing add flp-embedded-config: ${error.message}`);
66
+ logger.debug(error);
67
+ }
68
+ }
69
+ //# sourceMappingURL=flp-embedded-config.js.map
@@ -15,6 +15,7 @@ const deploy_config_1 = require("./deploy-config");
15
15
  const variants_config_1 = require("./variants-config");
16
16
  const adp_cf_config_1 = require("./adp-cf-config");
17
17
  const eslint_config_1 = require("./eslint-config");
18
+ const flp_embedded_config_1 = require("./flp-embedded-config");
18
19
  /**
19
20
  * Return 'create-fiori add *' commands. Commands include also the handler action.
20
21
  *
@@ -35,6 +36,7 @@ function getAddCommands() {
35
36
  (0, deploy_config_1.addDeployConfigCommand)(addCommands);
36
37
  (0, variants_config_1.addAddVariantsConfigCommand)(addCommands);
37
38
  (0, adp_cf_config_1.addAdaptationProjectCFConfigCommand)(addCommands);
39
+ (0, flp_embedded_config_1.addFlpEmbeddedConfigCommand)(addCommands);
38
40
  return addCommands;
39
41
  }
40
42
  //# sourceMappingURL=index.js.map
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.16.5",
4
+ "version": "0.16.8",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -31,20 +31,20 @@
31
31
  "mem-fs": "2.1.0",
32
32
  "mem-fs-editor": "9.4.0",
33
33
  "prompts": "2.4.2",
34
- "@sap-ux/abap-deploy-config-inquirer": "1.9.2",
35
- "@sap-ux/abap-deploy-config-writer": "0.4.1",
36
- "@sap-ux/adp-tooling": "0.19.3",
34
+ "@sap-ux/abap-deploy-config-inquirer": "1.9.3",
35
+ "@sap-ux/abap-deploy-config-writer": "0.4.2",
36
+ "@sap-ux/adp-tooling": "0.19.6",
37
37
  "@sap-ux/btp-utils": "1.2.0",
38
- "@sap-ux/app-config-writer": "0.7.2",
39
- "@sap-ux/cap-config-writer": "0.13.2",
38
+ "@sap-ux/app-config-writer": "0.7.3",
39
+ "@sap-ux/cap-config-writer": "0.13.3",
40
40
  "@sap-ux/logger": "0.9.0",
41
- "@sap-ux/mockserver-config-writer": "0.10.1",
42
- "@sap-ux/odata-service-writer": "0.32.1",
43
- "@sap-ux/preview-middleware": "0.26.4",
44
- "@sap-ux/project-access": "1.38.0",
41
+ "@sap-ux/mockserver-config-writer": "0.10.2",
42
+ "@sap-ux/odata-service-writer": "0.32.2",
43
+ "@sap-ux/preview-middleware": "0.26.7",
44
+ "@sap-ux/project-access": "1.38.1",
45
45
  "@sap-ux/system-access": "0.8.0",
46
- "@sap-ux/ui5-config": "0.31.0",
47
- "@sap-ux/flp-config-inquirer": "0.5.3",
46
+ "@sap-ux/ui5-config": "0.31.1",
47
+ "@sap-ux/flp-config-inquirer": "0.5.6",
48
48
  "@sap-ux/nodejs-utils": "0.3.0",
49
49
  "@sap-ux/axios-extension": "1.26.0"
50
50
  },
@@ -54,7 +54,7 @@
54
54
  "@types/mem-fs": "1.1.2",
55
55
  "@types/mem-fs-editor": "7.0.1",
56
56
  "@types/prompts": "2.4.9",
57
- "@sap-ux/inquirer-common": "0.13.1",
57
+ "@sap-ux/inquirer-common": "0.13.2",
58
58
  "@sap-ux/store": "1.6.0"
59
59
  },
60
60
  "scripts": {