@sap-ux/app-config-writer 0.6.41 → 0.6.42
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/cards-config/index.js +5 -5
- package/dist/common/package-json.js +3 -3
- package/dist/common/ui5-yaml.js +8 -8
- package/dist/common/utils.js +2 -2
- package/dist/navigation-config/index.js +2 -2
- package/dist/preview-config/package-json.js +5 -5
- package/dist/preview-config/prerequisites.js +2 -2
- package/dist/preview-config/preview-files.js +19 -19
- package/dist/preview-config/ui5-yaml.js +4 -4
- package/dist/smartlinks-config/ui5-yaml.js +2 -2
- package/dist/smartlinks-config/utils.js +2 -2
- package/dist/templates.js +2 -2
- package/dist/variants-config/package-json.js +4 -4
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.enableCardGeneratorConfig = enableCardGeneratorConfig;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const mem_fs_1 = require("mem-fs");
|
|
6
6
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
7
7
|
const utils_1 = require("../common/utils");
|
|
@@ -20,7 +20,7 @@ const CARDS_GENERATOR_MIDDLEWARE = 'sap-cards-generator';
|
|
|
20
20
|
* @returns {Promise<void>} A promise that resolves when the `ui5.yaml` file has been successfully updated.
|
|
21
21
|
*/
|
|
22
22
|
async function updateMiddlewareConfigWithGeneratorPath(fs, basePath, yamlPath, logger) {
|
|
23
|
-
const ui5YamlFile = yamlPath ? (0,
|
|
23
|
+
const ui5YamlFile = yamlPath ? (0, node_path_1.basename)(yamlPath) : project_access_1.FileName.Ui5Yaml;
|
|
24
24
|
const ui5YamlConfig = await (0, project_access_1.readUi5Yaml)(basePath, ui5YamlFile, fs);
|
|
25
25
|
if (ui5YamlConfig.findCustomMiddleware(CARDS_GENERATOR_MIDDLEWARE)) {
|
|
26
26
|
try {
|
|
@@ -41,7 +41,7 @@ async function updateMiddlewareConfigWithGeneratorPath(fs, basePath, yamlPath, l
|
|
|
41
41
|
path: cardGeneratorPath
|
|
42
42
|
};
|
|
43
43
|
ui5YamlConfig.updateCustomMiddleware(previewMiddleware);
|
|
44
|
-
fs.write((0,
|
|
44
|
+
fs.write((0, node_path_1.join)(basePath, ui5YamlFile), ui5YamlConfig.toString());
|
|
45
45
|
logger?.debug(`Updated preview middleware in ${ui5YamlFile}.`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -56,12 +56,12 @@ async function updateMiddlewareConfigWithGeneratorPath(fs, basePath, yamlPath, l
|
|
|
56
56
|
* @returns {Promise<void>} A promise that resolves when the `package.json` file has been successfully updated.
|
|
57
57
|
*/
|
|
58
58
|
async function updatePackageJson(basePath, fs, yamlPath, logger) {
|
|
59
|
-
const packageJsonPath = (0,
|
|
59
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
60
60
|
if (!fs.exists(packageJsonPath)) {
|
|
61
61
|
throw new Error('package.json not found');
|
|
62
62
|
}
|
|
63
63
|
const packageJson = (fs.readJSON(packageJsonPath) ?? {});
|
|
64
|
-
const ui5YamlFile = yamlPath ? (0,
|
|
64
|
+
const ui5YamlFile = yamlPath ? (0, node_path_1.basename)(yamlPath) : project_access_1.FileName.Ui5Yaml;
|
|
65
65
|
const ui5YamlConfig = await (0, project_access_1.readUi5Yaml)(basePath, ui5YamlFile, fs);
|
|
66
66
|
const previewMiddleware = await (0, utils_1.getPreviewMiddleware)(ui5YamlConfig, basePath, ui5YamlFile, fs);
|
|
67
67
|
const intent = (0, utils_1.getIntentFromPreviewConfig)(previewMiddleware?.configuration) ?? '#app-preview';
|
|
@@ -8,7 +8,7 @@ exports.extractYamlConfigFileName = extractYamlConfigFileName;
|
|
|
8
8
|
exports.isTestPath = isTestPath;
|
|
9
9
|
exports.isFlpPath = isFlpPath;
|
|
10
10
|
exports.getTestPathForUi5TestRunner = getTestPathForUi5TestRunner;
|
|
11
|
-
const
|
|
11
|
+
const node_path_1 = require("node:path");
|
|
12
12
|
const project_access_1 = require("@sap-ux/project-access");
|
|
13
13
|
/**
|
|
14
14
|
* Map of scripts from the package.json file.
|
|
@@ -23,7 +23,7 @@ const scriptsFromPackageJson = new Map();
|
|
|
23
23
|
* @returns the scripts from the package.json file
|
|
24
24
|
*/
|
|
25
25
|
function getScriptsFromPackageJson(fs, basePath) {
|
|
26
|
-
const packageJsonPath = (0,
|
|
26
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
27
27
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
28
28
|
scriptsFromPackageJson.clear();
|
|
29
29
|
Object.entries(packageJson?.scripts ?? {}).forEach(([scriptName, scriptContent]) => {
|
|
@@ -96,7 +96,7 @@ function isValidPreviewScript(script, convertTests = false) {
|
|
|
96
96
|
* @returns the run script or undefined
|
|
97
97
|
*/
|
|
98
98
|
function getRunScriptForYamlConfig(yamlConfigName, fs, basePath) {
|
|
99
|
-
const packageJsonPath = (0,
|
|
99
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
100
100
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
101
101
|
if (!packageJson) {
|
|
102
102
|
return undefined;
|
package/dist/common/ui5-yaml.js
CHANGED
|
@@ -9,7 +9,7 @@ exports.sanitizePreviewMiddleware = sanitizePreviewMiddleware;
|
|
|
9
9
|
exports.updatePreviewMiddlewareConfig = updatePreviewMiddlewareConfig;
|
|
10
10
|
exports.updateTestConfig = updateTestConfig;
|
|
11
11
|
exports.sanitizeTestScript = sanitizeTestScript;
|
|
12
|
-
const
|
|
12
|
+
const node_path_1 = require("node:path");
|
|
13
13
|
const types_1 = require("../types");
|
|
14
14
|
const project_access_1 = require("@sap-ux/project-access");
|
|
15
15
|
const utils_1 = require("./utils");
|
|
@@ -77,7 +77,7 @@ async function getEnhancedReloadMiddleware(yamlConfig) {
|
|
|
77
77
|
* @returns 'fiori-tools-preview' or 'preview-middleware' configuration
|
|
78
78
|
*/
|
|
79
79
|
function createPreviewMiddlewareConfig(fs, basePath) {
|
|
80
|
-
const packageJsonPath = (0,
|
|
80
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
81
81
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
82
82
|
return {
|
|
83
83
|
name: packageJson?.devDependencies?.['@sap/ux-ui5-tooling']
|
|
@@ -96,7 +96,7 @@ function createPreviewMiddlewareConfig(fs, basePath) {
|
|
|
96
96
|
* @param logger - logger
|
|
97
97
|
*/
|
|
98
98
|
async function updateMiddlewaresForPreview(fs, basePath, yamlPath, logger) {
|
|
99
|
-
const ui5YamlFile = yamlPath ? (0,
|
|
99
|
+
const ui5YamlFile = yamlPath ? (0, node_path_1.basename)(yamlPath) : project_access_1.FileName.Ui5Yaml;
|
|
100
100
|
const ui5YamlConfig = await (0, project_access_1.readUi5Yaml)(basePath, ui5YamlFile, fs);
|
|
101
101
|
let previewMiddleware = await (0, utils_1.getPreviewMiddleware)(ui5YamlConfig);
|
|
102
102
|
if (!previewMiddleware) {
|
|
@@ -120,7 +120,7 @@ async function updateMiddlewaresForPreview(fs, basePath, yamlPath, logger) {
|
|
|
120
120
|
logger?.debug(`Updated reload middleware in ${ui5YamlFile}.`);
|
|
121
121
|
}
|
|
122
122
|
ui5YamlConfig.updateCustomMiddleware(previewMiddleware);
|
|
123
|
-
fs.write((0,
|
|
123
|
+
fs.write((0, node_path_1.join)(basePath, ui5YamlFile), ui5YamlConfig.toString());
|
|
124
124
|
logger?.debug(`Updated preview middleware in ${ui5YamlFile}.`);
|
|
125
125
|
}
|
|
126
126
|
/**
|
|
@@ -275,8 +275,8 @@ async function updateTestConfig(testConfiguration, path, basePath, fs, logger) {
|
|
|
275
275
|
* @param logger logger to report info to the user
|
|
276
276
|
*/
|
|
277
277
|
async function sanitizeTestScript(fs, basePath, path, newConfig, logger) {
|
|
278
|
-
const jsTestScriptPath = (0,
|
|
279
|
-
const tsTestScriptPath = (0,
|
|
278
|
+
const jsTestScriptPath = (0, node_path_1.join)(await (0, project_access_1.getWebappPath)(basePath), path.replace('.html', '.js'));
|
|
279
|
+
const tsTestScriptPath = (0, node_path_1.join)(await (0, project_access_1.getWebappPath)(basePath), path.replace('.html', '.ts'));
|
|
280
280
|
const testScriptPath = fs.exists(jsTestScriptPath) ? jsTestScriptPath : tsTestScriptPath;
|
|
281
281
|
if (fs.exists(testScriptPath)) {
|
|
282
282
|
const file = fs.read(testScriptPath);
|
|
@@ -284,8 +284,8 @@ async function sanitizeTestScript(fs, basePath, path, newConfig, logger) {
|
|
|
284
284
|
if (usesJourneyRunner) {
|
|
285
285
|
const filePathRenamed = testScriptPath.replace(/(\.([jt])s)$/, '.custom$1');
|
|
286
286
|
fs.move(testScriptPath, filePathRenamed);
|
|
287
|
-
newConfig.pattern = `/test/**/${(0,
|
|
288
|
-
logger?.info(`Renamed '${(0,
|
|
287
|
+
newConfig.pattern = `/test/**/${(0, node_path_1.basename)(filePathRenamed)}`;
|
|
288
|
+
logger?.info(`Renamed '${(0, node_path_1.basename)(testScriptPath)}' to '${(0, node_path_1.basename)(filePathRenamed)}'. This file creates the JourneyRunner for OPA5 tests. As the handling of journey runners is not part of the virtual OPA5 test runner endpoint, this file has been renamed and added to the respective UI5 YAML configuration.`);
|
|
289
289
|
}
|
|
290
290
|
else {
|
|
291
291
|
await (0, utils_1.deleteFiles)(fs, [testScriptPath]);
|
package/dist/common/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.getCLIForPreview = getCLIForPreview;
|
|
|
7
7
|
exports.deleteFiles = deleteFiles;
|
|
8
8
|
const project_access_1 = require("@sap-ux/project-access");
|
|
9
9
|
const types_1 = require("../types");
|
|
10
|
-
const
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
11
|
/**
|
|
12
12
|
* Type guard to check if the given configuration is a deprecated preview middleware configuration.
|
|
13
13
|
*
|
|
@@ -74,7 +74,7 @@ async function deleteFiles(fs, files, logger) {
|
|
|
74
74
|
files.forEach((path) => {
|
|
75
75
|
if (fs.exists(path)) {
|
|
76
76
|
fs.delete(path);
|
|
77
|
-
logger?.info(`Deleted the '${(0,
|
|
77
|
+
logger?.info(`Deleted the '${(0, node_path_1.basename)(path)}' file. This file is no longer needed for the virtual endpoints.`);
|
|
78
78
|
}
|
|
79
79
|
});
|
|
80
80
|
}
|
|
@@ -6,7 +6,7 @@ const project_access_1 = require("@sap-ux/project-access");
|
|
|
6
6
|
const mem_fs_1 = require("mem-fs");
|
|
7
7
|
const mem_fs_editor_1 = require("mem-fs-editor");
|
|
8
8
|
const ui5_config_1 = require("@sap-ux/ui5-config");
|
|
9
|
-
const
|
|
9
|
+
const node_path_1 = require("node:path");
|
|
10
10
|
const i18n_1 = require("../i18n");
|
|
11
11
|
/**
|
|
12
12
|
* Adds a basic inbound navigation configuration to the application manifest.
|
|
@@ -57,7 +57,7 @@ async function generateInboundNavigationConfig(appRootPath, { semanticObject, ac
|
|
|
57
57
|
* @returns the manifest object and manifest path
|
|
58
58
|
*/
|
|
59
59
|
async function readManifest(appPath, fs) {
|
|
60
|
-
const manifestPath = (0,
|
|
60
|
+
const manifestPath = (0, node_path_1.join)(await (0, project_access_1.getWebappPath)(appPath, fs), project_access_1.FileName.Manifest);
|
|
61
61
|
const manifest = fs.readJSON(manifestPath);
|
|
62
62
|
if (!manifest) {
|
|
63
63
|
throw Error((0, i18n_1.t)('error.manifestNotFound', { path: manifestPath, ns: i18n_1.NAV_CONFIG_NS }));
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ensurePreviewMiddlewareDependency = ensurePreviewMiddlewareDependency;
|
|
4
4
|
exports.updateVariantsCreationScript = updateVariantsCreationScript;
|
|
5
|
-
const
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const package_json_1 = require("../common/package-json");
|
|
7
7
|
const variants_config_1 = require("../variants-config");
|
|
8
8
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -15,7 +15,7 @@ const project_access_1 = require("@sap-ux/project-access");
|
|
|
15
15
|
* @param basePath - base path to be used for the conversion
|
|
16
16
|
*/
|
|
17
17
|
function ensurePreviewMiddlewareDependency(fs, basePath) {
|
|
18
|
-
const packageJsonPath = (0,
|
|
18
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
19
19
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
20
20
|
if (!packageJson) {
|
|
21
21
|
return;
|
|
@@ -37,11 +37,11 @@ function ensurePreviewMiddlewareDependency(fs, basePath) {
|
|
|
37
37
|
* @param logger logger to report info to the user
|
|
38
38
|
*/
|
|
39
39
|
async function updateVariantsCreationScript(fs, basePath, logger) {
|
|
40
|
-
const packageJsonPath = (0,
|
|
40
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
41
41
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
42
42
|
if (packageJson?.scripts?.['start-variants-management']) {
|
|
43
|
-
const ui5Yaml = (0,
|
|
44
|
-
const yamlPath = (0,
|
|
43
|
+
const ui5Yaml = (0, node_path_1.basename)((0, package_json_1.extractYamlConfigFileName)(packageJson?.scripts?.['start-variants-management']));
|
|
44
|
+
const yamlPath = (0, node_path_1.join)(basePath, ui5Yaml);
|
|
45
45
|
await (0, variants_config_1.generateVariantsConfig)(basePath, yamlPath, logger, fs);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.checkPrerequisites = checkPrerequisites;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const project_access_1 = require("@sap-ux/project-access");
|
|
6
6
|
const semver_1 = require("semver");
|
|
7
7
|
const packageName = {
|
|
@@ -68,7 +68,7 @@ async function isUsingCdsPluginUi5(basePath, fs) {
|
|
|
68
68
|
* @returns indicator if the prerequisites are met
|
|
69
69
|
*/
|
|
70
70
|
async function checkPrerequisites(basePath, fs, convertTests = false, logger) {
|
|
71
|
-
const packageJsonPath = (0,
|
|
71
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, project_access_1.FileName.Package);
|
|
72
72
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
73
73
|
let prerequisitesMet = true;
|
|
74
74
|
if (!packageJson) {
|
|
@@ -4,7 +4,7 @@ exports.renameSandbox = renameSandbox;
|
|
|
4
4
|
exports.renameDefaultSandboxes = renameDefaultSandboxes;
|
|
5
5
|
exports.renameDefaultTestFiles = renameDefaultTestFiles;
|
|
6
6
|
exports.deleteNoLongerUsedFiles = deleteNoLongerUsedFiles;
|
|
7
|
-
const
|
|
7
|
+
const node_path_1 = require("node:path");
|
|
8
8
|
const project_access_1 = require("@sap-ux/project-access");
|
|
9
9
|
const ui5_yaml_1 = require("../common/ui5-yaml");
|
|
10
10
|
const utils_1 = require("../common/utils");
|
|
@@ -20,7 +20,7 @@ const renameMessage = (filePath) => `Renamed '${filePath}' to '${filePath.slice(
|
|
|
20
20
|
* @param logger logger to report info to the user
|
|
21
21
|
*/
|
|
22
22
|
async function renameSandbox(fs, basePath, path, logger) {
|
|
23
|
-
const filePath = (0,
|
|
23
|
+
const filePath = (0, node_path_1.join)(await (0, project_access_1.getWebappPath)(basePath), path);
|
|
24
24
|
if (fs.exists(filePath)) {
|
|
25
25
|
fs.move(filePath, filePath.replace('.html', '_old.html'));
|
|
26
26
|
logger?.info(renameMessage(path));
|
|
@@ -47,7 +47,7 @@ async function renameSandbox(fs, basePath, path, logger) {
|
|
|
47
47
|
* @param logger logger to report info to the user
|
|
48
48
|
*/
|
|
49
49
|
async function renameDefaultSandboxes(fs, basePath, logger) {
|
|
50
|
-
const defaultSandboxPaths = [(0,
|
|
50
|
+
const defaultSandboxPaths = [(0, node_path_1.join)('test', 'flpSandbox.html'), (0, node_path_1.join)('test', 'flpSandboxMockserver.html')];
|
|
51
51
|
for (const path of defaultSandboxPaths) {
|
|
52
52
|
await renameSandbox(fs, basePath, path, logger);
|
|
53
53
|
}
|
|
@@ -75,25 +75,25 @@ async function renameDefaultTestFiles(fs, basePath, logger) {
|
|
|
75
75
|
* @param logger logger to report info to the user
|
|
76
76
|
*/
|
|
77
77
|
async function deleteNoLongerUsedFiles(fs, basePath, convertTests, logger) {
|
|
78
|
-
const webappTestPath = (0,
|
|
78
|
+
const webappTestPath = (0, node_path_1.join)(await (0, project_access_1.getWebappPath)(basePath, fs), 'test');
|
|
79
79
|
const files = [
|
|
80
|
-
(0,
|
|
81
|
-
(0,
|
|
82
|
-
(0,
|
|
83
|
-
(0,
|
|
84
|
-
(0,
|
|
85
|
-
(0,
|
|
86
|
-
(0,
|
|
87
|
-
(0,
|
|
88
|
-
(0,
|
|
80
|
+
(0, node_path_1.join)(webappTestPath, 'locate-reuse-libs.js'),
|
|
81
|
+
(0, node_path_1.join)(webappTestPath, 'changes_loader.js'),
|
|
82
|
+
(0, node_path_1.join)(webappTestPath, 'changes_loader.ts'),
|
|
83
|
+
(0, node_path_1.join)(webappTestPath, 'changes_preview.js'),
|
|
84
|
+
(0, node_path_1.join)(webappTestPath, 'changes_preview.ts'),
|
|
85
|
+
(0, node_path_1.join)(webappTestPath, 'flpSandbox.js'),
|
|
86
|
+
(0, node_path_1.join)(webappTestPath, 'flpSandbox.ts'),
|
|
87
|
+
(0, node_path_1.join)(webappTestPath, 'initFlpSandbox.js'),
|
|
88
|
+
(0, node_path_1.join)(webappTestPath, 'initFlpSandbox.ts')
|
|
89
89
|
];
|
|
90
90
|
if (convertTests) {
|
|
91
|
-
files.push((0,
|
|
92
|
-
files.push((0,
|
|
93
|
-
files.push((0,
|
|
94
|
-
files.push((0,
|
|
95
|
-
files.push((0,
|
|
96
|
-
files.push((0,
|
|
91
|
+
files.push((0, node_path_1.join)(webappTestPath, 'testsuite.qunit.js'));
|
|
92
|
+
files.push((0, node_path_1.join)(webappTestPath, 'testsuite.qunit.ts'));
|
|
93
|
+
files.push((0, node_path_1.join)(webappTestPath, 'integration', 'opaTests.qunit.js'));
|
|
94
|
+
files.push((0, node_path_1.join)(webappTestPath, 'integration', 'opaTests.qunit.ts'));
|
|
95
|
+
files.push((0, node_path_1.join)(webappTestPath, 'unit', 'unitTests.qunit.js'));
|
|
96
|
+
files.push((0, node_path_1.join)(webappTestPath, 'unit', 'unitTests.qunit.ts'));
|
|
97
97
|
}
|
|
98
98
|
await (0, utils_1.deleteFiles)(fs, files, logger);
|
|
99
99
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processUi5YamlConfig = processUi5YamlConfig;
|
|
4
4
|
exports.updateDefaultTestConfig = updateDefaultTestConfig;
|
|
5
5
|
exports.updatePreviewMiddlewareConfigs = updatePreviewMiddlewareConfigs;
|
|
6
|
-
const
|
|
6
|
+
const node_path_1 = require("node:path");
|
|
7
7
|
const ui5_yaml_1 = require("../common/ui5-yaml");
|
|
8
8
|
const package_json_1 = require("./package-json");
|
|
9
9
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -84,7 +84,7 @@ async function processUi5YamlConfig(fs, basePath, ui5Yaml, script, logger, skipP
|
|
|
84
84
|
}
|
|
85
85
|
previewMiddleware = await (0, ui5_yaml_1.updatePreviewMiddlewareConfig)(previewMiddleware, script, basePath, fs, logger);
|
|
86
86
|
ui5YamlConfig.updateCustomMiddleware(previewMiddleware);
|
|
87
|
-
const yamlPath = (0,
|
|
87
|
+
const yamlPath = (0, node_path_1.join)(basePath, ui5Yaml);
|
|
88
88
|
fs.write(yamlPath, ui5YamlConfig.toString());
|
|
89
89
|
}
|
|
90
90
|
/**
|
|
@@ -121,7 +121,7 @@ async function updateDefaultTestConfig(fs, basePath, logger) {
|
|
|
121
121
|
logger?.info(`The UI5 YAML configuration file 'ui5.yaml', has been updated to support the test framework '${defaultConfig.framework}'. Please consider transferring the test configuration to the UI5 YAML configuration file used for testing.`);
|
|
122
122
|
}
|
|
123
123
|
ui5YamlConfig.updateCustomMiddleware(previewMiddleware);
|
|
124
|
-
const yamlPath = (0,
|
|
124
|
+
const yamlPath = (0, node_path_1.join)(basePath, project_access_1.FileName.Ui5Yaml);
|
|
125
125
|
fs.write(yamlPath, ui5YamlConfig.toString());
|
|
126
126
|
}
|
|
127
127
|
/**
|
|
@@ -144,7 +144,7 @@ async function updatePreviewMiddlewareConfigs(fs, basePath, convertTests, logger
|
|
|
144
144
|
if (!scriptValue || !(0, package_json_2.isValidPreviewScript)(script, convertTests)) {
|
|
145
145
|
continue;
|
|
146
146
|
}
|
|
147
|
-
const ui5Yaml = (0,
|
|
147
|
+
const ui5Yaml = (0, node_path_1.basename)((0, package_json_2.extractYamlConfigFileName)(scriptValue));
|
|
148
148
|
unprocessedUi5YamlFileNames.splice(unprocessedUi5YamlFileNames.indexOf(ui5Yaml), 1);
|
|
149
149
|
if (!isUi5YamlToBeConverted(ui5Yaml, scriptName, ui5YamlFileNames, logger) ||
|
|
150
150
|
(await isUi5YamlFlpPathAlreadyConverted(fs, basePath, ui5Yaml, script, convertTests, logger))) {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.readUi5DeployConfigTarget = readUi5DeployConfigTarget;
|
|
4
4
|
exports.addUi5YamlServeStaticMiddleware = addUi5YamlServeStaticMiddleware;
|
|
5
|
-
const
|
|
5
|
+
const node_path_1 = require("node:path");
|
|
6
6
|
const project_access_1 = require("@sap-ux/project-access");
|
|
7
7
|
const i18n_1 = require("../i18n");
|
|
8
8
|
const types_1 = require("../types");
|
|
@@ -67,7 +67,7 @@ async function addUi5YamlServeStaticMiddleware(basePath, fs, logger) {
|
|
|
67
67
|
if (middleware) {
|
|
68
68
|
const yamlConfig = ui5YamlConfig.updateCustomMiddleware(middleware);
|
|
69
69
|
const yaml = yamlConfig.toString();
|
|
70
|
-
fs.write((0,
|
|
70
|
+
fs.write((0, node_path_1.join)(basePath, ui5Yaml), yaml);
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -7,7 +7,7 @@ exports.getTargetMappingsConfig = getTargetMappingsConfig;
|
|
|
7
7
|
exports.writeSmartLinksConfig = writeSmartLinksConfig;
|
|
8
8
|
const chalk_1 = require("chalk");
|
|
9
9
|
const ejs_1 = require("ejs");
|
|
10
|
-
const
|
|
10
|
+
const node_path_1 = require("node:path");
|
|
11
11
|
const axios_extension_1 = require("@sap-ux/axios-extension");
|
|
12
12
|
const btp_utils_1 = require("@sap-ux/btp-utils");
|
|
13
13
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -184,7 +184,7 @@ function mergeTargetMappings(appConfigPath, inboundTargets, fs) {
|
|
|
184
184
|
async function writeSmartLinksConfig(basePath, config, fs, logger) {
|
|
185
185
|
let inboundTargets = await getTargetMappingsConfig(config, logger);
|
|
186
186
|
const templatePath = (0, templates_1.getTemplatePath)('smartlinks-config/fioriSandboxConfig.json');
|
|
187
|
-
const appConfigPath = (0,
|
|
187
|
+
const appConfigPath = (0, node_path_1.join)(basePath, 'appconfig', 'fioriSandboxConfig.json');
|
|
188
188
|
if (!fs.exists(appConfigPath)) {
|
|
189
189
|
fs.copyTpl(templatePath, appConfigPath, { inboundTargets });
|
|
190
190
|
}
|
package/dist/templates.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getTemplatePath = getTemplatePath;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
/**
|
|
6
6
|
* Locates template files relative to the dist folder.
|
|
7
7
|
* This helps to locate templates when this module is bundled and the dir structure is flattened, maintaining the relative paths.
|
|
@@ -10,6 +10,6 @@ const path_1 = require("path");
|
|
|
10
10
|
* @returns the path of the template specified or templates root folder
|
|
11
11
|
*/
|
|
12
12
|
function getTemplatePath(relativeTemplatePath = '') {
|
|
13
|
-
return (0,
|
|
13
|
+
return (0, node_path_1.join)(__dirname, '../templates', relativeTemplatePath);
|
|
14
14
|
}
|
|
15
15
|
//# sourceMappingURL=templates.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addVariantsManagementScript = addVariantsManagementScript;
|
|
4
|
-
const
|
|
4
|
+
const node_path_1 = require("node:path");
|
|
5
5
|
const utils_1 = require("./utils");
|
|
6
6
|
const utils_2 = require("../common/utils");
|
|
7
7
|
const project_access_1 = require("@sap-ux/project-access");
|
|
@@ -16,9 +16,9 @@ const ERROR_MSG = `Script 'start-variants-management' cannot be written to packa
|
|
|
16
16
|
* @returns Promise<void> - rejects in case variants management script can't be added to package.json
|
|
17
17
|
*/
|
|
18
18
|
async function addVariantsManagementScript(fs, basePath, yamlPath, logger) {
|
|
19
|
-
const packageJsonPath = (0,
|
|
19
|
+
const packageJsonPath = (0, node_path_1.join)(basePath, 'package.json');
|
|
20
20
|
const packageJson = fs.readJSON(packageJsonPath);
|
|
21
|
-
const ui5YamlFileName = yamlPath ? (0,
|
|
21
|
+
const ui5YamlFileName = yamlPath ? (0, node_path_1.basename)(yamlPath) : project_access_1.FileName.Ui5Yaml;
|
|
22
22
|
if (!packageJson) {
|
|
23
23
|
throw new Error(`${ERROR_MSG} File 'package.json' not found at ${basePath}`);
|
|
24
24
|
}
|
|
@@ -32,7 +32,7 @@ async function addVariantsManagementScript(fs, basePath, yamlPath, logger) {
|
|
|
32
32
|
throw new Error(`${ERROR_MSG} No RTA editor specified in ui5.yaml.`);
|
|
33
33
|
}
|
|
34
34
|
// set --config flag if default ui5.yaml is not used
|
|
35
|
-
const yamlConfigFile = ui5YamlFileName !== project_access_1.FileName.Ui5Yaml ? ` --config ./${(0,
|
|
35
|
+
const yamlConfigFile = ui5YamlFileName !== project_access_1.FileName.Ui5Yaml ? ` --config ./${(0, node_path_1.basename)(ui5YamlFileName)}` : '';
|
|
36
36
|
const startVariantsManagementScriptOld = packageJson.scripts['start-variants-management'] ?? undefined;
|
|
37
37
|
const startVariantsManagementScriptNew = `${serveCommand}${yamlConfigFile} --open "${url}"`;
|
|
38
38
|
if (!startVariantsManagementScriptOld) {
|
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.
|
|
4
|
+
"version": "0.6.42",
|
|
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/axios-extension": "1.22.
|
|
31
|
-
"@sap-ux/btp-utils": "1.1.
|
|
30
|
+
"@sap-ux/axios-extension": "1.22.10",
|
|
31
|
+
"@sap-ux/btp-utils": "1.1.4",
|
|
32
32
|
"@sap-ux/logger": "0.7.0",
|
|
33
|
-
"@sap-ux/project-access": "1.32.
|
|
34
|
-
"@sap-ux/store": "1.1.
|
|
35
|
-
"@sap-ux/ui5-config": "0.29.
|
|
33
|
+
"@sap-ux/project-access": "1.32.3",
|
|
34
|
+
"@sap-ux/store": "1.1.5",
|
|
35
|
+
"@sap-ux/ui5-config": "0.29.7"
|
|
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.12.2",
|
|
44
44
|
"nock": "13.4.0",
|
|
45
|
-
"@sap-ux/preview-middleware": "0.23.
|
|
45
|
+
"@sap-ux/preview-middleware": "0.23.18"
|
|
46
46
|
},
|
|
47
47
|
"engines": {
|
|
48
48
|
"node": ">=20.x"
|