@sap-ux/app-config-writer 0.6.5 → 0.6.7

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.
@@ -7,6 +7,8 @@ const mem_fs_editor_1 = require("mem-fs-editor");
7
7
  const utils_1 = require("../common/utils");
8
8
  const project_access_1 = require("@sap-ux/project-access");
9
9
  const ui5_yaml_1 = require("../common/ui5-yaml");
10
+ const DEPENDENCY_NAME = '@sap-ux/cards-editor-middleware';
11
+ const CARDS_GENERATOR_MIDDLEWARE = 'sap-cards-generator';
10
12
  /**
11
13
  * Updates the `ui5.yaml` file to add card generator path to preview middleware configuration.
12
14
  * Removes the `sap-cards-generator` middleware if it exists.
@@ -20,12 +22,14 @@ const ui5_yaml_1 = require("../common/ui5-yaml");
20
22
  async function updateMiddlewareConfigWithGeneratorPath(fs, basePath, yamlPath, logger) {
21
23
  const ui5YamlFile = yamlPath ? (0, path_1.basename)(yamlPath) : project_access_1.FileName.Ui5Yaml;
22
24
  const ui5YamlConfig = await (0, project_access_1.readUi5Yaml)(basePath, ui5YamlFile, fs);
23
- try {
24
- ui5YamlConfig.removeCustomMiddleware('sap-cards-generator');
25
- logger?.info(`Removed 'sap-cards-generator' middleware configuration from ${ui5YamlFile}. It is no longer needed because this feature has been integrated into fiori-tools-preview / preview-middleware.`);
26
- }
27
- catch (error) {
28
- logger?.warn(`Failed to remove 'sap-cards-generator' middleware: ${error.message}`);
25
+ if (ui5YamlConfig.findCustomMiddleware(CARDS_GENERATOR_MIDDLEWARE)) {
26
+ try {
27
+ ui5YamlConfig.removeCustomMiddleware(CARDS_GENERATOR_MIDDLEWARE);
28
+ logger?.info(`Removed '${CARDS_GENERATOR_MIDDLEWARE}' middleware configuration from ${ui5YamlFile}. It is no longer needed because this feature has been integrated into fiori-tools-preview / preview-middleware.`);
29
+ }
30
+ catch (error) {
31
+ logger?.warn(`Failed to remove '${CARDS_GENERATOR_MIDDLEWARE}' middleware: ${error.message}`);
32
+ }
29
33
  }
30
34
  const previewMiddleware = await (0, utils_1.getPreviewMiddleware)(ui5YamlConfig, basePath, yamlPath, fs);
31
35
  if (previewMiddleware) {
@@ -64,12 +68,11 @@ async function updatePackageJson(basePath, fs, yamlPath, logger) {
64
68
  const cardGeneratorPath = previewMiddleware?.configuration?.editors?.cardGenerator?.path ??
65
69
  '/test/flpCardGeneratorSandbox.html';
66
70
  const cliForPreview = await (0, utils_1.getCLIForPreview)(basePath, yamlPath ?? '', fs);
67
- const dependencyName = '@sap-ux/cards-editor-middleware';
68
71
  packageJson.scripts ??= {};
69
72
  packageJson.scripts['start-cards-generator'] = `${cliForPreview} --open "${cardGeneratorPath}${intent}"`;
70
- if (packageJson.devDependencies?.[dependencyName]) {
71
- delete packageJson.devDependencies[dependencyName];
72
- logger?.info(`Removed devDependency ${dependencyName} from package.json. It is no longer needed because this feature has been integrated into fiori-tools-preview / preview-middleware.`);
73
+ if (packageJson.devDependencies?.[DEPENDENCY_NAME]) {
74
+ delete packageJson.devDependencies[DEPENDENCY_NAME];
75
+ logger?.info(`Removed devDependency ${DEPENDENCY_NAME} from package.json. It is no longer needed because this feature has been integrated into fiori-tools-preview / preview-middleware.`);
73
76
  }
74
77
  fs.writeJSON(packageJsonPath, packageJson);
75
78
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@sap-ux/app-config-writer",
3
3
  "description": "Add or update configuration for SAP Fiori tools application",
4
- "version": "0.6.5",
4
+ "version": "0.6.7",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -27,12 +27,12 @@
27
27
  "mem-fs-editor": "9.4.0",
28
28
  "prompts": "2.4.2",
29
29
  "semver": "7.6.3",
30
- "@sap-ux/btp-utils": "1.1.0",
31
30
  "@sap-ux/axios-extension": "1.21.1",
32
31
  "@sap-ux/logger": "0.7.0",
33
- "@sap-ux/project-access": "1.30.1",
34
- "@sap-ux/store": "1.1.0",
35
- "@sap-ux/ui5-config": "0.28.1"
32
+ "@sap-ux/btp-utils": "1.1.0",
33
+ "@sap-ux/project-access": "1.30.2",
34
+ "@sap-ux/ui5-config": "0.28.2",
35
+ "@sap-ux/store": "1.1.0"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@types/ejs": "3.1.2",
@@ -42,7 +42,7 @@
42
42
  "@types/semver": "7.5.8",
43
43
  "axios": "1.8.2",
44
44
  "nock": "13.4.0",
45
- "@sap-ux/preview-middleware": "0.20.15"
45
+ "@sap-ux/preview-middleware": "0.20.17"
46
46
  },
47
47
  "engines": {
48
48
  "node": ">=20.x"