@sap-ux/create 0.13.124 → 0.13.126
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/dist/cli/add/cds-plugin-ui.js +2 -2
- package/dist/cli/add/html.js +2 -2
- package/dist/cli/add/mockserver-config.js +2 -2
- package/dist/cli/add/variants-config.js +2 -2
- package/dist/cli/generate/adaptation-project.js +2 -2
- package/dist/cli/index.js +3 -3
- package/dist/tracing/trace.js +5 -5
- package/dist/validation/validation.js +6 -6
- package/package.json +15 -15
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAddCdsPluginUi5Command = addAddCdsPluginUi5Command;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const cap_config_writer_1 = require("@sap-ux/cap-config-writer");
|
|
6
6
|
const tracing_1 = require("../../tracing");
|
|
7
7
|
const common_1 = require("../../common");
|
|
@@ -41,7 +41,7 @@ async function addCdsPluginUi5(basePath, simulate, skipInstall) {
|
|
|
41
41
|
logger.info(`Changes to enable cds-plugin-ui5 written`);
|
|
42
42
|
if (skipInstall) {
|
|
43
43
|
logger.warn('To finish enablement of cds-plugin-ui5 run commands:');
|
|
44
|
-
const relPath = (0,
|
|
44
|
+
const relPath = (0, node_path_1.relative)(basePath, process.cwd());
|
|
45
45
|
if (relPath) {
|
|
46
46
|
logger.info(`cd ${relPath}`);
|
|
47
47
|
}
|
package/dist/cli/add/html.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.addAddHtmlFilesCmd = addAddHtmlFilesCmd;
|
|
|
4
4
|
const tracing_1 = require("../../tracing");
|
|
5
5
|
const validation_1 = require("../../validation");
|
|
6
6
|
const preview_middleware_1 = require("@sap-ux/preview-middleware");
|
|
7
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
9
9
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
10
10
|
const mem_fs_1 = require("mem-fs");
|
|
@@ -37,7 +37,7 @@ async function addHtmlFiles(basePath, simulate, yamlPath) {
|
|
|
37
37
|
const logger = (0, tracing_1.getLogger)();
|
|
38
38
|
try {
|
|
39
39
|
logger.debug(`Called add html for path '${basePath}', simulate is '${simulate}'`);
|
|
40
|
-
const ui5ConfigPath = (0,
|
|
40
|
+
const ui5ConfigPath = (0, node_path_1.isAbsolute)(yamlPath) ? yamlPath : (0, node_path_1.join)(basePath, yamlPath);
|
|
41
41
|
await (0, validation_1.validateBasePath)(basePath, ui5ConfigPath);
|
|
42
42
|
const fs = (0, mem_fs_editor_1.create)((0, mem_fs_1.create)());
|
|
43
43
|
const ui5Conf = await ui5_config_1.UI5Config.newInstance(fs.read(ui5ConfigPath));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addAddMockserverConfigCommand = addAddMockserverConfigCommand;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const prompts_1 = require("prompts");
|
|
6
6
|
const project_access_1 = require("@sap-ux/project-access");
|
|
7
7
|
const mockserver_config_writer_1 = require("@sap-ux/mockserver-config-writer");
|
|
@@ -54,7 +54,7 @@ async function addMockserverConfig(basePath, simulate, skipInstall, interactive)
|
|
|
54
54
|
logger.info(`Changes written.`);
|
|
55
55
|
if (skipInstall) {
|
|
56
56
|
logger.warn('To finish mockserver configuration run commands:');
|
|
57
|
-
const relPath = (0,
|
|
57
|
+
const relPath = (0, node_path_1.relative)(basePath, process.cwd());
|
|
58
58
|
if (relPath) {
|
|
59
59
|
logger.info(`cd ${relPath}`);
|
|
60
60
|
}
|
|
@@ -4,7 +4,7 @@ exports.addAddVariantsConfigCommand = addAddVariantsConfigCommand;
|
|
|
4
4
|
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
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
/**
|
|
9
9
|
* Add the "add variants config" command to a passed command.
|
|
10
10
|
*
|
|
@@ -35,7 +35,7 @@ async function addVariantsConfig(basePath, simulate, yamlPath) {
|
|
|
35
35
|
const logger = (0, tracing_1.getLogger)();
|
|
36
36
|
try {
|
|
37
37
|
logger.debug(`Called add variants-config for path '${basePath}', simulate is '${simulate}'`);
|
|
38
|
-
const ui5ConfigPath = (0,
|
|
38
|
+
const ui5ConfigPath = (0, node_path_1.isAbsolute)(yamlPath) ? yamlPath : (0, node_path_1.join)(basePath, yamlPath);
|
|
39
39
|
await (0, validation_1.validateBasePath)(basePath, ui5ConfigPath);
|
|
40
40
|
const fs = await (0, app_config_writer_1.generateVariantsConfig)(basePath, ui5ConfigPath, logger);
|
|
41
41
|
if (!simulate) {
|
|
@@ -8,7 +8,7 @@ const chalk_1 = __importDefault(require("chalk"));
|
|
|
8
8
|
const tracing_1 = require("../../tracing");
|
|
9
9
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
10
10
|
const common_1 = require("../../common");
|
|
11
|
-
const
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
12
|
/**
|
|
13
13
|
* Add a new sub-command to generate SAP UI5 adaptation projects the given command.
|
|
14
14
|
*
|
|
@@ -54,7 +54,7 @@ async function generateAdaptationProject(basePath, defaults, useDefaults, simula
|
|
|
54
54
|
}
|
|
55
55
|
const config = useDefaults ? createConfigFromDefaults(defaults) : await (0, adp_tooling_1.promptGeneratorInput)(defaults, logger);
|
|
56
56
|
if (!basePath) {
|
|
57
|
-
basePath = (0,
|
|
57
|
+
basePath = (0, node_path_1.join)(process.cwd(), config.app.id);
|
|
58
58
|
}
|
|
59
59
|
addChangeForResourceModel(config);
|
|
60
60
|
const fs = await (0, adp_tooling_1.generate)(basePath, config);
|
package/dist/cli/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.handleCreateFioriCommand = handleCreateFioriCommand;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const commander_1 = require("commander");
|
|
7
7
|
const tracing_1 = require("../tracing");
|
|
8
8
|
const add_1 = require("./add");
|
|
@@ -68,7 +68,7 @@ function getCommanderProgram() {
|
|
|
68
68
|
function getVersion() {
|
|
69
69
|
let version = '';
|
|
70
70
|
try {
|
|
71
|
-
version = JSON.parse((0,
|
|
71
|
+
version = JSON.parse((0, node_fs_1.readFileSync)((0, node_path_1.join)(__dirname, '../../package.json'), { encoding: 'utf8' }).toString()).version;
|
|
72
72
|
}
|
|
73
73
|
catch (error) {
|
|
74
74
|
const logger = (0, tracing_1.getLogger)();
|
package/dist/tracing/trace.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.traceChanges = traceChanges;
|
|
4
|
-
const
|
|
5
|
-
const
|
|
4
|
+
const node_fs_1 = require("node:fs");
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const compare_1 = require("./compare");
|
|
7
7
|
const logger_1 = require("./logger");
|
|
8
8
|
/**
|
|
@@ -20,19 +20,19 @@ async function traceChanges(fs) {
|
|
|
20
20
|
continue;
|
|
21
21
|
}
|
|
22
22
|
const memContent = fileStat.contents;
|
|
23
|
-
if (!(0,
|
|
23
|
+
if (!(0, node_fs_1.existsSync)(changedFile)) {
|
|
24
24
|
logger.info(`File '${changedFile}' added`);
|
|
25
25
|
logger.debug(`File content:\n${memContent}`);
|
|
26
26
|
continue;
|
|
27
27
|
}
|
|
28
|
-
const discContent = await
|
|
28
|
+
const discContent = await node_fs_1.promises.readFile(changedFile, 'utf-8');
|
|
29
29
|
if (discContent === memContent) {
|
|
30
30
|
logger.info(`File '${changedFile}' unchanged`);
|
|
31
31
|
logger.debug(`File content:\n${memContent}`);
|
|
32
32
|
continue;
|
|
33
33
|
}
|
|
34
34
|
logger.info(`File '${changedFile}' modified`);
|
|
35
|
-
const fileExtension = (0,
|
|
35
|
+
const fileExtension = (0, node_path_1.extname)(changedFile).toLowerCase();
|
|
36
36
|
switch (fileExtension) {
|
|
37
37
|
case '.json': {
|
|
38
38
|
(0, compare_1.compareJson)(JSON.parse(discContent), JSON.parse(memContent));
|
|
@@ -4,8 +4,8 @@ exports.validateBasePath = validateBasePath;
|
|
|
4
4
|
exports.hasFileDeletes = hasFileDeletes;
|
|
5
5
|
exports.validateAdpProject = validateAdpProject;
|
|
6
6
|
exports.validateCloudAdpProject = validateCloudAdpProject;
|
|
7
|
-
const
|
|
8
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
|
+
const node_fs_1 = require("node:fs");
|
|
9
9
|
const project_access_1 = require("@sap-ux/project-access");
|
|
10
10
|
const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
11
11
|
/**
|
|
@@ -15,13 +15,13 @@ const adp_tooling_1 = require("@sap-ux/adp-tooling");
|
|
|
15
15
|
* @param ui5YamlPath - optional path to ui5.yaml file
|
|
16
16
|
*/
|
|
17
17
|
async function validateBasePath(basePath, ui5YamlPath) {
|
|
18
|
-
const packageJsonPath = (0,
|
|
19
|
-
if (!(0,
|
|
18
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
19
|
+
if (!(0, node_fs_1.existsSync)(packageJsonPath)) {
|
|
20
20
|
throw Error(`Required file '${packageJsonPath}' does not exist.`);
|
|
21
21
|
}
|
|
22
|
-
ui5YamlPath ??= (0,
|
|
22
|
+
ui5YamlPath ??= (0, node_path_1.join)(basePath, 'ui5.yaml');
|
|
23
23
|
const webappPath = await (0, project_access_1.getWebappPath)(basePath);
|
|
24
|
-
if (!(0,
|
|
24
|
+
if (!(0, node_fs_1.existsSync)(ui5YamlPath) && !(0, node_fs_1.existsSync)(webappPath)) {
|
|
25
25
|
throw Error(`There must be either a folder '${webappPath}' or a config file '${ui5YamlPath}'`);
|
|
26
26
|
}
|
|
27
27
|
}
|
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.13.
|
|
4
|
+
"version": "0.13.126",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/SAP/open-ux-tools.git",
|
|
@@ -30,19 +30,19 @@
|
|
|
30
30
|
"mem-fs": "2.1.0",
|
|
31
31
|
"mem-fs-editor": "9.4.0",
|
|
32
32
|
"prompts": "2.4.2",
|
|
33
|
-
"@sap-ux/abap-deploy-config-inquirer": "1.6.
|
|
34
|
-
"@sap-ux/abap-deploy-config-writer": "0.2.
|
|
35
|
-
"@sap-ux/adp-tooling": "0.15.
|
|
36
|
-
"@sap-ux/app-config-writer": "0.6.
|
|
37
|
-
"@sap-ux/cap-config-writer": "0.12.
|
|
33
|
+
"@sap-ux/abap-deploy-config-inquirer": "1.6.26",
|
|
34
|
+
"@sap-ux/abap-deploy-config-writer": "0.2.20",
|
|
35
|
+
"@sap-ux/adp-tooling": "0.15.34",
|
|
36
|
+
"@sap-ux/app-config-writer": "0.6.42",
|
|
37
|
+
"@sap-ux/cap-config-writer": "0.12.12",
|
|
38
38
|
"@sap-ux/logger": "0.7.0",
|
|
39
|
-
"@sap-ux/mockserver-config-writer": "0.9.
|
|
40
|
-
"@sap-ux/odata-service-writer": "0.27.
|
|
41
|
-
"@sap-ux/preview-middleware": "0.23.
|
|
42
|
-
"@sap-ux/project-access": "1.32.
|
|
43
|
-
"@sap-ux/system-access": "0.6.
|
|
44
|
-
"@sap-ux/ui5-config": "0.29.
|
|
45
|
-
"@sap-ux/flp-config-inquirer": "0.4.
|
|
39
|
+
"@sap-ux/mockserver-config-writer": "0.9.20",
|
|
40
|
+
"@sap-ux/odata-service-writer": "0.27.24",
|
|
41
|
+
"@sap-ux/preview-middleware": "0.23.18",
|
|
42
|
+
"@sap-ux/project-access": "1.32.3",
|
|
43
|
+
"@sap-ux/system-access": "0.6.19",
|
|
44
|
+
"@sap-ux/ui5-config": "0.29.7",
|
|
45
|
+
"@sap-ux/flp-config-inquirer": "0.4.30"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@types/diff": "5.0.9",
|
|
@@ -50,8 +50,8 @@
|
|
|
50
50
|
"@types/mem-fs": "1.1.2",
|
|
51
51
|
"@types/mem-fs-editor": "7.0.1",
|
|
52
52
|
"@types/prompts": "2.4.4",
|
|
53
|
-
"@sap-ux/inquirer-common": "0.7.
|
|
54
|
-
"@sap-ux/store": "1.1.
|
|
53
|
+
"@sap-ux/inquirer-common": "0.7.48",
|
|
54
|
+
"@sap-ux/store": "1.1.5"
|
|
55
55
|
},
|
|
56
56
|
"scripts": {
|
|
57
57
|
"build": "tsc --build",
|