@sap-ux/preview-middleware 0.16.21 → 0.16.23
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/base/config.d.ts +3 -1
- package/dist/base/config.js +5 -3
- package/dist/base/flp.js +1 -1
- package/package.json +3 -3
- package/templates/test/qunit.html +1 -1
package/dist/base/config.d.ts
CHANGED
|
@@ -109,13 +109,15 @@ export declare function createFlpTemplateConfig(config: FlpConfig, manifest: Par
|
|
|
109
109
|
*
|
|
110
110
|
* @param config test configuration
|
|
111
111
|
* @param id application id
|
|
112
|
+
* @param theme theme to be used
|
|
112
113
|
* @returns configuration object for the test template
|
|
113
114
|
*/
|
|
114
|
-
export declare function createTestTemplateConfig(config: InternalTestConfig, id: string): {
|
|
115
|
+
export declare function createTestTemplateConfig(config: InternalTestConfig, id: string, theme: string): {
|
|
115
116
|
id: string;
|
|
116
117
|
framework: "OPA5" | "QUnit" | "Testsuite";
|
|
117
118
|
basePath: string;
|
|
118
119
|
initPath: string;
|
|
120
|
+
theme: string;
|
|
119
121
|
};
|
|
120
122
|
export type PreviewUrls = {
|
|
121
123
|
path: string;
|
package/dist/base/config.js
CHANGED
|
@@ -226,14 +226,16 @@ exports.createFlpTemplateConfig = createFlpTemplateConfig;
|
|
|
226
226
|
*
|
|
227
227
|
* @param config test configuration
|
|
228
228
|
* @param id application id
|
|
229
|
+
* @param theme theme to be used
|
|
229
230
|
* @returns configuration object for the test template
|
|
230
231
|
*/
|
|
231
|
-
function createTestTemplateConfig(config, id) {
|
|
232
|
+
function createTestTemplateConfig(config, id, theme) {
|
|
232
233
|
return {
|
|
233
234
|
id,
|
|
234
235
|
framework: config.framework,
|
|
235
236
|
basePath: path_1.posix.relative(path_1.posix.dirname(config.path), '/') ?? '.',
|
|
236
|
-
initPath: path_1.posix.relative(path_1.posix.dirname(config.path), config.init)
|
|
237
|
+
initPath: path_1.posix.relative(path_1.posix.dirname(config.path), config.init),
|
|
238
|
+
theme
|
|
237
239
|
};
|
|
238
240
|
}
|
|
239
241
|
exports.createTestTemplateConfig = createTestTemplateConfig;
|
|
@@ -282,7 +284,7 @@ function generateTestRunners(configs, manifest, fs, webappPath, flpTemplConfig)
|
|
|
282
284
|
const testConfig = (0, test_1.mergeTestConfigDefaults)(test);
|
|
283
285
|
if (['QUnit', 'OPA5'].includes(test.framework)) {
|
|
284
286
|
const testTemlpate = (0, fs_1.readFileSync)((0, path_1.join)(TEMPLATE_PATH, 'test/qunit.html'), 'utf-8');
|
|
285
|
-
const testTemplateConfig = createTestTemplateConfig(testConfig, manifest['sap.app'].id);
|
|
287
|
+
const testTemplateConfig = createTestTemplateConfig(testConfig, manifest['sap.app'].id, flpTemplConfig.ui5.theme);
|
|
286
288
|
fs.write((0, path_1.join)(webappPath, testConfig.path), (0, ejs_1.render)(testTemlpate, testTemplateConfig));
|
|
287
289
|
}
|
|
288
290
|
else if (test.framework === 'Testsuite') {
|
package/dist/base/flp.js
CHANGED
|
@@ -374,7 +374,7 @@ class FlpSandbox {
|
|
|
374
374
|
next();
|
|
375
375
|
}
|
|
376
376
|
else {
|
|
377
|
-
const templateConfig = (0, config_1.createTestTemplateConfig)(config, id);
|
|
377
|
+
const templateConfig = (0, config_1.createTestTemplateConfig)(config, id, this.templateConfig.ui5.theme);
|
|
378
378
|
const html = (0, ejs_1.render)(htmlTemplate, templateConfig);
|
|
379
379
|
this.sendResponse(res, 'text/html', 200, html);
|
|
380
380
|
}
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"bugs": {
|
|
10
10
|
"url": "https://github.com/SAP/open-ux-tools/issues?q=is%3Aopen+is%3Aissue+label%3Abug+label%3Apreview-middleware"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.16.
|
|
12
|
+
"version": "0.16.23",
|
|
13
13
|
"license": "Apache-2.0",
|
|
14
14
|
"author": "@SAP/ux-tools-team",
|
|
15
15
|
"main": "dist/index.js",
|
|
@@ -27,9 +27,9 @@
|
|
|
27
27
|
"mem-fs-editor": "9.4.0",
|
|
28
28
|
"@sap-ux/logger": "0.6.0",
|
|
29
29
|
"@sap-ux/btp-utils": "0.15.0",
|
|
30
|
-
"@sap-ux/adp-tooling": "0.12.
|
|
30
|
+
"@sap-ux/adp-tooling": "0.12.16",
|
|
31
31
|
"@sap-ux/control-property-editor-sources": "npm:@sap-ux/control-property-editor@0.4.25",
|
|
32
|
-
"@sap-ux/project-access": "1.25.
|
|
32
|
+
"@sap-ux/project-access": "1.25.7"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@types/ejs": "3.1.2",
|