@sap-ux/create 0.14.61 → 0.14.63

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`, `cds-plugin-ui5`, `inbound-navigation`, `cards-editor`, `model`, `annotations`, `html`, `component-usages`, `deploy-config` and `variants-config`
71
+ The available subcommands are: `mockserver-config`, `smartlinks-config`, `cds-plugin-ui5`, `inbound-navigation`, `cards-editor`, `model`, `annotations`, `html`, `component-usages`, `deploy-config`, `variants-config` and `adp-cf-config`
72
72
 
73
73
 
74
74
  --------------------------------
@@ -152,6 +152,9 @@ Options:
152
152
 
153
153
  Add a new OData service and SAPUI5 model to an existing adaptation project.
154
154
 
155
+
156
+ This command is not supported for Cloud Foundry projects.
157
+
155
158
  Example:
156
159
 
157
160
  `npx --yes @sap-ux/create@latest add model`
@@ -165,6 +168,9 @@ Options:
165
168
 
166
169
  Adds an annotation to the OData Source of the base application in an adaptation project.
167
170
 
171
+
172
+ This command is not supported for Cloud Foundry projects.
173
+
168
174
  Example:
169
175
 
170
176
  `npx --yes @sap-ux/create@latest add annotations`
@@ -235,6 +241,23 @@ Options:
235
241
 
236
242
  --------------------------------
237
243
 
244
+ ## [`add adp-cf-config`](#add-adp-cf-config)
245
+
246
+ Configure an existing Cloud Foundry adaptation project for local preview by fetching reusable libraries, building the project, and configuring ui5.yaml file middlewares.
247
+
248
+
249
+ **⚠️ Experimental**: This command is experimental and may be subject to breaking changes or even removal in future versions. Use with caution and be prepared to update your configuration or migrate to alternative solutions, if needed.
250
+
251
+ Example:
252
+
253
+ `npx --yes @sap-ux/create@latest add adp-cf-config`
254
+
255
+ Options:
256
+ - `-v, --verbose` - Show verbose information.
257
+ - `-c, --config <string>` _(required)_ - Path to the project configuration file in YAML format. _(default: `ui5.yaml`)_
258
+
259
+ --------------------------------
260
+
238
261
  ## [`convert`](#convert)
239
262
 
240
263
  Command group for converting existing SAP Fiori applications. A subcommand is required.
@@ -302,6 +325,9 @@ The available subcommands are: `data-source` and `inbound`
302
325
 
303
326
  Replace the OData Source of the base application in an adaptation project.
304
327
 
328
+
329
+ This command is not supported for Cloud Foundry projects.
330
+
305
331
  Example:
306
332
 
307
333
  `npx --yes @sap-ux/create@latest change data-source`
@@ -316,6 +342,9 @@ Options:
316
342
 
317
343
  Replace the inbound FLP configurations of the base application in an adaptation project.
318
344
 
345
+
346
+ This command is not supported for Cloud Foundry projects.
347
+
319
348
  Example:
320
349
 
321
350
  `npx --yes @sap-ux/create@latest change inbound`
@@ -0,0 +1,8 @@
1
+ import type { Command } from 'commander';
2
+ /**
3
+ * Add the "adp-cf-config" sub-command.
4
+ *
5
+ * @param cmd - commander command for setting up CF adaptation project
6
+ */
7
+ export declare function addAdaptationProjectCFConfigCommand(cmd: Command): void;
8
+ //# sourceMappingURL=adp-cf-config.d.ts.map
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.addAdaptationProjectCFConfigCommand = addAdaptationProjectCFConfigCommand;
4
+ const tracing_1 = require("../../tracing");
5
+ const validation_1 = require("../../validation");
6
+ const adp_tooling_1 = require("@sap-ux/adp-tooling");
7
+ const project_access_1 = require("@sap-ux/project-access");
8
+ /**
9
+ * Add the "adp-cf-config" sub-command.
10
+ *
11
+ * @param cmd - commander command for setting up CF adaptation project
12
+ */
13
+ function addAdaptationProjectCFConfigCommand(cmd) {
14
+ cmd.command('adp-cf-config [path]')
15
+ .description(`Configure an existing Cloud Foundry adaptation project for local preview by fetching reusable libraries, building the project, and configuring ui5.yaml file middlewares.\n
16
+ **⚠️ Experimental**: This command is experimental and may be subject to breaking changes or even removal in future versions. Use with caution and be prepared to update your configuration or migrate to alternative solutions, if needed.\n
17
+ Example:
18
+ \`npx --yes @sap-ux/create@latest add adp-cf-config\``)
19
+ .option('-v, --verbose', 'Show verbose information.')
20
+ .option('-c, --config <string>', 'Path to the project configuration file in YAML format.', project_access_1.FileName.Ui5Yaml)
21
+ .action(async (path, options) => {
22
+ if (options.verbose === true) {
23
+ (0, tracing_1.setLogLevelVerbose)();
24
+ }
25
+ await setupAdaptationProjectCF(path ?? process.cwd(), options.config);
26
+ });
27
+ }
28
+ /**
29
+ * Setup a Cloud Foundry adaptation project.
30
+ *
31
+ * @param basePath - path to project root
32
+ * @param yamlPath - path to the project configuration file in YAML format
33
+ */
34
+ async function setupAdaptationProjectCF(basePath, yamlPath) {
35
+ const logger = (0, tracing_1.getLogger)();
36
+ await (0, validation_1.validateBasePath)(basePath);
37
+ await (0, validation_1.validateAdpAppType)(basePath);
38
+ if (!(await (0, adp_tooling_1.isCFEnvironment)(basePath))) {
39
+ throw new Error('This command can only be used for Cloud Foundry adaptation projects.');
40
+ }
41
+ const cfConfig = (0, adp_tooling_1.loadCfConfig)(logger);
42
+ if (!(await (0, adp_tooling_1.isLoggedInCf)(cfConfig, logger))) {
43
+ throw new Error('You are not logged in to Cloud Foundry or your session has expired. Please run "cf login" first.');
44
+ }
45
+ try {
46
+ const fs = await (0, adp_tooling_1.generateCfConfig)(basePath, yamlPath, cfConfig, logger);
47
+ await (0, tracing_1.traceChanges)(fs);
48
+ await new Promise((resolve, reject) => {
49
+ fs.commit([], (err) => {
50
+ if (err) {
51
+ reject(err);
52
+ }
53
+ else {
54
+ resolve();
55
+ }
56
+ });
57
+ });
58
+ }
59
+ catch (error) {
60
+ logger.error(`Failed to setup CF adaptation project: ${error.message}`);
61
+ throw error;
62
+ }
63
+ }
64
+ //# sourceMappingURL=adp-cf-config.js.map
@@ -17,6 +17,7 @@ let loginAttempts = 3;
17
17
  function addAnnotationsToOdataCommand(cmd) {
18
18
  cmd.command('annotations [path]')
19
19
  .description(`Adds an annotation to the OData Source of the base application in an adaptation project.\n
20
+ This command is not supported for Cloud Foundry projects.\n
20
21
  Example:
21
22
  \`npx --yes @sap-ux/create@latest add annotations\``)
22
23
  .option('-s, --simulate', 'Simulate only. Do not write or install.')
@@ -38,7 +39,10 @@ async function addAnnotationsToOdata(basePath, simulate, yamlPath) {
38
39
  if (!basePath) {
39
40
  basePath = process.cwd();
40
41
  }
41
- await (0, validation_1.validateAdpProject)(basePath);
42
+ await (0, validation_1.validateAdpAppType)(basePath);
43
+ if (await (0, adp_tooling_1.isCFEnvironment)(basePath)) {
44
+ throw new Error('This command is not supported for Cloud Foundry projects.');
45
+ }
42
46
  const variant = await (0, adp_tooling_1.getVariant)(basePath);
43
47
  const { target, ignoreCertErrors = false } = await (0, adp_tooling_1.getAdpConfig)(basePath, yamlPath);
44
48
  const provider = await (0, system_access_1.createAbapServiceProvider)(target, {
@@ -33,7 +33,10 @@ async function addComponentUsages(basePath, simulate) {
33
33
  if (!basePath) {
34
34
  basePath = process.cwd();
35
35
  }
36
- await (0, validation_1.validateAdpProject)(basePath);
36
+ await (0, validation_1.validateAdpAppType)(basePath);
37
+ if (await (0, adp_tooling_1.isCFEnvironment)(basePath)) {
38
+ throw new Error('This command is not supported for CF projects.');
39
+ }
37
40
  const variant = await (0, adp_tooling_1.getVariant)(basePath);
38
41
  const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForAddComponentUsages)(basePath, variant.layer), false);
39
42
  const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_ui5_addComponentUsages" /* ChangeType.ADD_COMPONENT_USAGES */, createComponentUsageData(variant, answers));
@@ -13,6 +13,7 @@ const html_1 = require("./html");
13
13
  const component_usages_1 = require("./component-usages");
14
14
  const deploy_config_1 = require("./deploy-config");
15
15
  const variants_config_1 = require("./variants-config");
16
+ const adp_cf_config_1 = require("./adp-cf-config");
16
17
  /**
17
18
  * Return 'create-fiori add *' commands. Commands include also the handler action.
18
19
  *
@@ -31,6 +32,7 @@ function getAddCommands() {
31
32
  (0, component_usages_1.addComponentUsagesCommand)(addCommands);
32
33
  (0, deploy_config_1.addDeployConfigCommand)(addCommands);
33
34
  (0, variants_config_1.addAddVariantsConfigCommand)(addCommands);
35
+ (0, adp_cf_config_1.addAdaptationProjectCFConfigCommand)(addCommands);
34
36
  return addCommands;
35
37
  }
36
38
  //# sourceMappingURL=index.js.map
@@ -13,6 +13,7 @@ const validation_1 = require("../../validation/validation");
13
13
  function addNewModelCommand(cmd) {
14
14
  cmd.command('model [path]')
15
15
  .description(`Add a new OData service and SAPUI5 model to an existing adaptation project.\n
16
+ This command is not supported for Cloud Foundry projects.\n
16
17
  Example:
17
18
  \`npx --yes @sap-ux/create@latest add model\``)
18
19
  .option('-s, --simulate', 'Simulate only. Do not write or install.')
@@ -32,9 +33,12 @@ async function addNewModel(basePath, simulate) {
32
33
  if (!basePath) {
33
34
  basePath = process.cwd();
34
35
  }
35
- await (0, validation_1.validateAdpProject)(basePath);
36
+ await (0, validation_1.validateAdpAppType)(basePath);
37
+ if (await (0, adp_tooling_1.isCFEnvironment)(basePath)) {
38
+ throw new Error('This command is not supported for Cloud Foundry projects.');
39
+ }
36
40
  const variant = await (0, adp_tooling_1.getVariant)(basePath);
37
- const answers = await (0, common_1.promptYUIQuestions)((0, adp_tooling_1.getPromptsForNewModel)(basePath, variant.layer), false);
41
+ const answers = await (0, common_1.promptYUIQuestions)(await (0, adp_tooling_1.getPromptsForNewModel)(basePath, variant.layer), false);
38
42
  const fs = await (0, adp_tooling_1.generateChange)(basePath, "appdescr_ui5_addNewModel" /* ChangeType.ADD_NEW_MODEL */, createNewModelData(variant, answers));
39
43
  if (!simulate) {
40
44
  await new Promise((resolve) => fs.commit(resolve));
@@ -16,6 +16,7 @@ let loginAttempts = 3;
16
16
  function addChangeDataSourceCommand(cmd) {
17
17
  cmd.command('data-source [path]')
18
18
  .description(`Replace the OData Source of the base application in an adaptation project.\n
19
+ This command is not supported for Cloud Foundry projects.\n
19
20
  Example:
20
21
  \`npx --yes @sap-ux/create@latest change data-source\``)
21
22
  .option('-s, --simulate', 'Simulate only. Do not write or install.')
@@ -37,7 +38,10 @@ async function changeDataSource(basePath, simulate, yamlPath) {
37
38
  if (!basePath) {
38
39
  basePath = process.cwd();
39
40
  }
40
- await (0, validation_1.validateAdpProject)(basePath);
41
+ await (0, validation_1.validateAdpAppType)(basePath);
42
+ if (await (0, adp_tooling_1.isCFEnvironment)(basePath)) {
43
+ throw new Error('This command is not supported for Cloud Foundry projects.');
44
+ }
41
45
  const variant = await (0, adp_tooling_1.getVariant)(basePath);
42
46
  const { target, ignoreCertErrors = false } = await (0, adp_tooling_1.getAdpConfig)(basePath, yamlPath);
43
47
  const provider = await (0, system_access_1.createAbapServiceProvider)(target, {
@@ -13,6 +13,7 @@ const validation_1 = require("../../validation");
13
13
  function addChangeInboundCommand(cmd) {
14
14
  cmd.command('inbound [path]')
15
15
  .description(`Replace the inbound FLP configurations of the base application in an adaptation project.\n
16
+ This command is not supported for Cloud Foundry projects.\n
16
17
  Example:
17
18
  \`npx --yes @sap-ux/create@latest change inbound\``)
18
19
  .option('-s, --simulate', 'Simulate only. Do not write or install.')
@@ -32,7 +33,10 @@ async function changeInbound(basePath, simulate) {
32
33
  if (!basePath) {
33
34
  basePath = process.cwd();
34
35
  }
35
- await (0, validation_1.validateAdpProject)(basePath);
36
+ await (0, validation_1.validateAdpAppType)(basePath);
37
+ if (await (0, adp_tooling_1.isCFEnvironment)(basePath)) {
38
+ throw new Error('This command is not supported for Cloud Foundry projects.');
39
+ }
36
40
  await (0, validation_1.validateCloudAdpProject)(basePath);
37
41
  const variant = await (0, adp_tooling_1.getVariant)(basePath);
38
42
  const change = variant.content.find((change) => change.changeType === 'appdescr_app_removeAllInboundsExceptOne');
@@ -1,2 +1,2 @@
1
- export { hasFileDeletes, validateBasePath, validateAdpProject, validateCloudAdpProject } from './validation';
1
+ export { hasFileDeletes, validateBasePath, validateCloudAdpProject, validateAdpAppType } from './validation';
2
2
  //# sourceMappingURL=index.d.ts.map
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.validateCloudAdpProject = exports.validateAdpProject = exports.validateBasePath = exports.hasFileDeletes = void 0;
3
+ exports.validateAdpAppType = exports.validateCloudAdpProject = exports.validateBasePath = exports.hasFileDeletes = void 0;
4
4
  var validation_1 = require("./validation");
5
5
  Object.defineProperty(exports, "hasFileDeletes", { enumerable: true, get: function () { return validation_1.hasFileDeletes; } });
6
6
  Object.defineProperty(exports, "validateBasePath", { enumerable: true, get: function () { return validation_1.validateBasePath; } });
7
- Object.defineProperty(exports, "validateAdpProject", { enumerable: true, get: function () { return validation_1.validateAdpProject; } });
8
7
  Object.defineProperty(exports, "validateCloudAdpProject", { enumerable: true, get: function () { return validation_1.validateCloudAdpProject; } });
8
+ Object.defineProperty(exports, "validateAdpAppType", { enumerable: true, get: function () { return validation_1.validateAdpAppType; } });
9
9
  //# sourceMappingURL=index.js.map
@@ -14,11 +14,11 @@ export declare function validateBasePath(basePath: string, ui5YamlPath?: string)
14
14
  */
15
15
  export declare function hasFileDeletes(fs: Editor): boolean;
16
16
  /**
17
- * Validate if adaptation project is supported for command, throws an error if not supported.
17
+ * Validate if adaptation project is of type 'Fiori Adaptation', throws an error if not.
18
18
  *
19
19
  * @param basePath - path to the adaptation project
20
20
  */
21
- export declare function validateAdpProject(basePath: string): Promise<void>;
21
+ export declare function validateAdpAppType(basePath: string): Promise<void>;
22
22
  /**
23
23
  * Validate if adaptation project is cloud, throws an error if not.
24
24
  *
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.validateBasePath = validateBasePath;
4
4
  exports.hasFileDeletes = hasFileDeletes;
5
- exports.validateAdpProject = validateAdpProject;
5
+ exports.validateAdpAppType = validateAdpAppType;
6
6
  exports.validateCloudAdpProject = validateCloudAdpProject;
7
7
  const node_path_1 = require("node:path");
8
8
  const node_fs_1 = require("node:fs");
@@ -36,17 +36,14 @@ function hasFileDeletes(fs) {
36
36
  return !!Object.keys(changedFiles).find((fileName) => changedFiles[fileName].state === 'deleted');
37
37
  }
38
38
  /**
39
- * Validate if adaptation project is supported for command, throws an error if not supported.
39
+ * Validate if adaptation project is of type 'Fiori Adaptation', throws an error if not.
40
40
  *
41
41
  * @param basePath - path to the adaptation project
42
42
  */
43
- async function validateAdpProject(basePath) {
43
+ async function validateAdpAppType(basePath) {
44
44
  if ((await (0, project_access_1.getAppType)(basePath)) !== 'Fiori Adaptation') {
45
45
  throw new Error('This command can only be used for an adaptation project');
46
46
  }
47
- if ((0, adp_tooling_1.isCFEnvironment)(basePath)) {
48
- throw new Error('This command is not supported for CF projects.');
49
- }
50
47
  }
51
48
  /**
52
49
  * Validate if adaptation project is cloud, throws an error if not.
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.14.61",
4
+ "version": "0.14.63",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -24,25 +24,27 @@
24
24
  "!dist/**/*.map"
25
25
  ],
26
26
  "dependencies": {
27
+ "@sap/cf-tools": "3.3.0",
27
28
  "chalk": "4.1.2",
28
29
  "commander": "9.4.0",
29
30
  "diff": "5.2.2",
30
31
  "mem-fs": "2.1.0",
31
32
  "mem-fs-editor": "9.4.0",
32
33
  "prompts": "2.4.2",
33
- "@sap-ux/abap-deploy-config-inquirer": "1.6.97",
34
- "@sap-ux/abap-deploy-config-writer": "0.2.70",
35
- "@sap-ux/adp-tooling": "0.18.61",
36
- "@sap-ux/app-config-writer": "0.6.95",
37
- "@sap-ux/cap-config-writer": "0.12.60",
34
+ "@sap-ux/abap-deploy-config-inquirer": "1.6.99",
35
+ "@sap-ux/abap-deploy-config-writer": "0.2.72",
36
+ "@sap-ux/adp-tooling": "0.18.63",
37
+ "@sap-ux/app-config-writer": "0.6.97",
38
+ "@sap-ux/cap-config-writer": "0.12.62",
38
39
  "@sap-ux/logger": "0.8.1",
39
- "@sap-ux/mockserver-config-writer": "0.9.49",
40
- "@sap-ux/odata-service-writer": "0.29.17",
41
- "@sap-ux/preview-middleware": "0.23.118",
42
- "@sap-ux/project-access": "1.35.2",
43
- "@sap-ux/system-access": "0.6.50",
40
+ "@sap-ux/mockserver-config-writer": "0.9.50",
41
+ "@sap-ux/odata-service-writer": "0.29.18",
42
+ "@sap-ux/preview-middleware": "0.23.120",
43
+ "@sap-ux/project-access": "1.35.3",
44
+ "@sap-ux/system-access": "0.6.51",
44
45
  "@sap-ux/ui5-config": "0.29.16",
45
- "@sap-ux/flp-config-inquirer": "0.4.120"
46
+ "@sap-ux/flp-config-inquirer": "0.4.122",
47
+ "@sap-ux/nodejs-utils": "0.2.14"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@types/diff": "5.0.9",
@@ -50,8 +52,8 @@
50
52
  "@types/mem-fs": "1.1.2",
51
53
  "@types/mem-fs-editor": "7.0.1",
52
54
  "@types/prompts": "2.4.4",
53
- "@sap-ux/inquirer-common": "0.11.3",
54
- "@sap-ux/store": "1.5.5"
55
+ "@sap-ux/inquirer-common": "0.11.5",
56
+ "@sap-ux/store": "1.5.6"
55
57
  },
56
58
  "scripts": {
57
59
  "build": "tsc --build && node ./scripts/generate-readme.js",