@sap-ux/create 0.15.47 → 0.15.49

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
@@ -304,7 +304,7 @@ Options:
304
304
 
305
305
  ## [`convert eslint-config`](#convert-eslint-config)
306
306
 
307
- Executed in the root folder of an app, it converts the ESLint configuration of the respective app to flat config format (ESLint version 9).
307
+ Executed in the root folder of an app, it converts the ESLint configuration of the respective app to flat config format (used since ESLint version 9). It also introduces specific ESLint checks for SAP Fiori applications (using the `@sap-ux/eslint-plugin-fiori-tools` plugin), and deletes the deprecated `eslint-plugin-fiori-custom` plugin. To avoid dependency resolution conflicts, it deletes the `package-lock.json` file as well as the `@sap-ux/eslint-plugin-fiori-tools` module from the `node_modules` folder before running `npm install`.
308
308
 
309
309
  Examples:
310
310
 
@@ -314,7 +314,7 @@ Options:
314
314
  - `-s, --simulate` - Simulate only. Do not write to the config file. Also, sets `--verbose`
315
315
  - `-v, --verbose` - Show verbose information.
316
316
  - `-c, --config <string>` - The name of the SAP Fiori tools ESLint plugin configuration to be used. _(default: `recommended`)_
317
- - `-n, --skip-install` - Skip the `npm install` step.
317
+ - `-n, --skip-install` - Skip the `npm install` step. Also skips deleting the `package-lock.json` file and the `@sap-ux/eslint-plugin-fiori-tools` module from the `node_modules` folder.
318
318
 
319
319
  --------------------------------
320
320
 
@@ -39,21 +39,20 @@ async function addCdsPluginUi5(basePath, simulate, skipInstall) {
39
39
  const fs = await (0, cap_config_writer_1.enableCdsUi5Plugin)(basePath);
40
40
  await (0, tracing_1.traceChanges)(fs);
41
41
  if (!simulate) {
42
- fs.commit(() => {
43
- logger.info(`Changes to enable cds-plugin-ui5 written`);
44
- if (skipInstall) {
45
- logger.warn('To finish enablement of cds-plugin-ui5 run commands:');
46
- const relPath = (0, node_path_1.relative)(basePath, process.cwd());
47
- if (relPath) {
48
- logger.info(`cd ${relPath}`);
49
- }
50
- logger.info('npm install');
42
+ await new Promise((resolve) => fs.commit(resolve));
43
+ logger.info(`Changes to enable cds-plugin-ui5 written`);
44
+ if (skipInstall) {
45
+ logger.warn('To finish enablement of cds-plugin-ui5 run commands:');
46
+ const relPath = (0, node_path_1.relative)(basePath, process.cwd());
47
+ if (relPath) {
48
+ logger.info(`cd ${relPath}`);
51
49
  }
52
- else {
53
- logger.debug('Running npm install command');
54
- (0, common_1.runNpmInstallCommand)(basePath);
55
- }
56
- });
50
+ logger.info('npm install');
51
+ }
52
+ else {
53
+ logger.debug('Running npm install command');
54
+ (0, common_1.runNpmInstallCommand)(basePath);
55
+ }
57
56
  }
58
57
  }
59
58
  catch (error) {
@@ -44,16 +44,15 @@ async function addEslintConfig(basePath, simulate, config, skipInstall = false)
44
44
  const fs = await (0, app_config_writer_1.generateEslintConfig)(basePath, { logger, config });
45
45
  await (0, tracing_1.traceChanges)(fs);
46
46
  if (!simulate) {
47
- fs.commit(() => {
48
- logger.info(`ESlint configuration written. Ensure you install the new dependency by executing 'npm install'.`);
49
- if (skipInstall) {
50
- logger.info(`\`npm install\` will be skipped. Please make sure to install the dependencies before executing any linting commands.`);
51
- }
52
- else {
53
- logger.info(`Executing \`npm install\`.`);
54
- (0, common_1.runNpmInstallCommand)(basePath, undefined, { logger });
55
- }
56
- });
47
+ await new Promise((resolve) => fs.commit(resolve));
48
+ logger.info(`ESlint configuration written. Ensure you install the new dependency by executing 'npm install'.`);
49
+ if (skipInstall) {
50
+ logger.info(`\`npm install\` will be skipped. Please make sure to install the dependencies before executing any linting commands.`);
51
+ }
52
+ else {
53
+ logger.info(`Executing \`npm install\`.`);
54
+ (0, common_1.runNpmInstallCommand)(basePath, undefined, { logger });
55
+ }
57
56
  }
58
57
  }
59
58
  catch (error) {
@@ -52,21 +52,20 @@ async function addMockserverConfig(basePath, simulate, skipInstall, interactive)
52
52
  const fs = await (0, mockserver_config_writer_1.generateMockserverConfig)(basePath, config);
53
53
  await (0, tracing_1.traceChanges)(fs);
54
54
  if (!simulate) {
55
- fs.commit(() => {
56
- logger.info(`Changes written.`);
57
- if (skipInstall) {
58
- logger.warn('To finish mockserver configuration run commands:');
59
- const relPath = (0, node_path_1.relative)(basePath, process.cwd());
60
- if (relPath) {
61
- logger.info(`cd ${relPath}`);
62
- }
63
- logger.info('npm install -D @sap-ux/ui5-middleware-fe-mockserver');
55
+ await new Promise((resolve) => fs.commit(resolve));
56
+ logger.info(`Changes written.`);
57
+ if (skipInstall) {
58
+ logger.warn('To finish mockserver configuration run commands:');
59
+ const relPath = (0, node_path_1.relative)(basePath, process.cwd());
60
+ if (relPath) {
61
+ logger.info(`cd ${relPath}`);
64
62
  }
65
- else {
66
- logger.debug('Running npm install command');
67
- (0, common_1.runNpmInstallCommand)(basePath, ['--save-dev', '@sap-ux/ui5-middleware-fe-mockserver']);
68
- }
69
- });
63
+ logger.info('npm install -D @sap-ux/ui5-middleware-fe-mockserver');
64
+ }
65
+ else {
66
+ logger.debug('Running npm install command');
67
+ (0, common_1.runNpmInstallCommand)(basePath, ['--save-dev', '@sap-ux/ui5-middleware-fe-mockserver']);
68
+ }
70
69
  }
71
70
  }
72
71
  catch (error) {
@@ -5,6 +5,8 @@ const tracing_1 = require("../../tracing");
5
5
  const validation_1 = require("../../validation");
6
6
  const app_config_writer_1 = require("@sap-ux/app-config-writer");
7
7
  const common_1 = require("../../common");
8
+ const project_access_1 = require("@sap-ux/project-access");
9
+ const node_path_1 = require("node:path");
8
10
  /**
9
11
  * Add a new sub-command to convert the eslint configuration of a project to flat config format (eslint version 9).
10
12
  *
@@ -12,13 +14,13 @@ const common_1 = require("../../common");
12
14
  */
13
15
  function addConvertEslintCommand(cmd) {
14
16
  cmd.command('eslint-config [path]')
15
- .description(`Executed in the root folder of an app, it converts the ESLint configuration of the respective app to flat config format (ESLint version 9).\n
17
+ .description(`Executed in the root folder of an app, it converts the ESLint configuration of the respective app to flat config format (used since ESLint version 9). It also introduces specific ESLint checks for SAP Fiori applications (using the \`@sap-ux/eslint-plugin-fiori-tools\` plugin), and deletes the deprecated \`eslint-plugin-fiori-custom\` plugin. To avoid dependency resolution conflicts, it deletes the \`package-lock.json\` file as well as the \`@sap-ux/eslint-plugin-fiori-tools\` module from the \`node_modules\` folder before running \`npm install\`.\n
16
18
  Examples:
17
19
  \`npx --yes @sap-ux/create@latest convert eslint-config\``)
18
20
  .option('-s, --simulate', 'Simulate only. Do not write to the config file. Also, sets `--verbose`')
19
21
  .option('-v, --verbose', 'Show verbose information.')
20
22
  .option('-c, --config <string>', 'The name of the SAP Fiori tools ESLint plugin configuration to be used.', 'recommended')
21
- .option('-n, --skip-install', 'Skip the `npm install` step.')
23
+ .option('-n, --skip-install', 'Skip the `npm install` step. Also skips deleting the `package-lock.json` file and the `@sap-ux/eslint-plugin-fiori-tools` module from the `node_modules` folder.')
22
24
  .action(async (path, options) => {
23
25
  if (options.verbose === true || options.simulate) {
24
26
  (0, tracing_1.setLogLevelVerbose)();
@@ -43,16 +45,30 @@ async function convertEslintConfig(basePath, simulate, config, skipInstall = fal
43
45
  const fs = await (0, app_config_writer_1.convertEslintConfig)(basePath, { logger, config });
44
46
  await (0, tracing_1.traceChanges)(fs);
45
47
  if (!simulate) {
46
- fs.commit(() => {
47
- logger.info(`ESlint configuration converted. Ensure the new configuration is working correctly before deleting old configuration files like '.eslintrc.json' or '.eslintignore'.`);
48
- if (skipInstall) {
49
- logger.info(`\`npm install\` was skipped. Ensure you install the dependencies before executing any linting commands.`);
50
- }
51
- else {
48
+ if (!skipInstall) {
49
+ logger.info(`Deleting \`package-lock.json\` to avoid conflicts.`);
50
+ fs.delete((0, node_path_1.join)(basePath, 'package-lock.json'));
51
+ }
52
+ await new Promise((resolve) => fs.commit(resolve));
53
+ logger.info(`ESlint configuration converted. Ensure the new configuration is working correctly before deleting old configuration files like '.eslintrc.json' or '.eslintignore'.`);
54
+ if (skipInstall) {
55
+ logger.info(`\`npm install\` was skipped. Ensure you install the dependencies before executing any linting commands.`);
56
+ }
57
+ else {
58
+ try {
59
+ logger.info(`Deleting \`@sap-ux/eslint-plugin-fiori-tools\` from \`node_modules\` to avoid dependency resolution conflicts.`);
60
+ await (0, project_access_1.execNpmCommand)(['uninstall', '@sap-ux/eslint-plugin-fiori-tools', '--no-save'], {
61
+ cwd: basePath,
62
+ logger: logger
63
+ });
64
+ logger.info('npm uninstall completed successfully.');
52
65
  logger.info(`Executing \`npm install\`.`);
53
66
  (0, common_1.runNpmInstallCommand)(basePath, undefined, { logger });
54
67
  }
55
- });
68
+ catch (error) {
69
+ logger.error(`npm command failed. '${error.message}'`);
70
+ }
71
+ }
56
72
  }
57
73
  }
58
74
  catch (error) {
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.15.47",
4
+ "version": "0.15.49",
5
5
  "repository": {
6
6
  "type": "git",
7
7
  "url": "https://github.com/SAP/open-ux-tools.git",
@@ -31,21 +31,21 @@
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.8.0",
35
- "@sap-ux/abap-deploy-config-writer": "0.3.0",
36
- "@sap-ux/adp-tooling": "0.18.98",
37
- "@sap-ux/app-config-writer": "0.6.124",
34
+ "@sap-ux/abap-deploy-config-inquirer": "1.8.1",
35
+ "@sap-ux/abap-deploy-config-writer": "0.3.1",
36
+ "@sap-ux/adp-tooling": "0.18.99",
37
+ "@sap-ux/app-config-writer": "0.6.126",
38
38
  "@sap-ux/cap-config-writer": "0.12.80",
39
39
  "@sap-ux/logger": "0.8.2",
40
40
  "@sap-ux/mockserver-config-writer": "0.9.64",
41
41
  "@sap-ux/odata-service-writer": "0.31.0",
42
- "@sap-ux/preview-middleware": "0.24.5",
42
+ "@sap-ux/preview-middleware": "0.24.6",
43
43
  "@sap-ux/project-access": "1.35.14",
44
- "@sap-ux/system-access": "0.7.0",
44
+ "@sap-ux/system-access": "0.7.1",
45
45
  "@sap-ux/ui5-config": "0.30.0",
46
- "@sap-ux/flp-config-inquirer": "0.4.157",
46
+ "@sap-ux/flp-config-inquirer": "0.4.158",
47
47
  "@sap-ux/nodejs-utils": "0.2.17",
48
- "@sap-ux/axios-extension": "1.25.24"
48
+ "@sap-ux/axios-extension": "1.25.25"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/diff": "5.0.9",