@ui5/webcomponents-tools 0.0.0-df5b4199a → 0.0.0-e03cd01f3
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/CHANGELOG.md +81 -2
- package/bin/ui5nps.js +10 -1
- package/components-package/nps.js +2 -2
- package/lib/cem/custom-elements-manifest.config.mjs +4 -0
- package/lib/chokidar/chokidar.js +1 -2
- package/lib/create-illustrations/index.js +1 -2
- package/lib/css-processors/css-processor-components.mjs +2 -2
- package/lib/css-processors/css-processor-themes.mjs +26 -42
- package/lib/css-processors/scope-variables.mjs +9 -17
- package/lib/eslint/eslint.js +3 -1
- package/lib/i18n/toJSON.js +24 -1
- package/lib/test-runner/test-runner.js +6 -6
- package/lib/vite-bundler/vite-bundler.mjs +35 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,13 +3,92 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
# [0.0.0-
|
|
6
|
+
# [0.0.0-e03cd01f3](https://github.com/UI5/webcomponents/compare/v2.18.0...v0.0.0-e03cd01f3) (2026-01-06)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **i18n:** handle utf-8 escape sequences in message bundle properties files ([#12784](https://github.com/UI5/webcomponents/issues/12784)) ([54a3f15](https://github.com/UI5/webcomponents/commit/54a3f15a8d23de8683db5829c78255307ef3f8b5))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
# [2.18.0](https://github.com/UI5/webcomponents/compare/v2.18.0-rc.3...v2.18.0) (2026-01-05)
|
|
18
|
+
|
|
19
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
# [2.18.0-rc.3](https://github.com/UI5/webcomponents/compare/v2.18.0-rc.2...v2.18.0-rc.3) (2026-01-01)
|
|
26
|
+
|
|
27
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
# [2.18.0-rc.2](https://github.com/UI5/webcomponents/compare/v2.18.0-rc.1...v2.18.0-rc.2) (2025-12-25)
|
|
34
|
+
|
|
35
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
# [2.18.0-rc.1](https://github.com/UI5/webcomponents/compare/v2.18.0-rc.0...v2.18.0-rc.1) (2025-12-18)
|
|
42
|
+
|
|
43
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
# [2.18.0-rc.0](https://github.com/UI5/webcomponents/compare/v2.17.0...v2.18.0-rc.0) (2025-12-11)
|
|
50
|
+
|
|
51
|
+
**Note:** Version bump only for package @ui5/webcomponents-tools
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [2.17.0](https://github.com/UI5/webcomponents/compare/v2.17.0-rc.5...v2.17.0) (2025-12-05)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Reverts
|
|
61
|
+
|
|
62
|
+
* Revert "feat(framework): scope theming css variables with component packages (#12491)" (#12775) ([3385623](https://github.com/UI5/webcomponents/commit/33856235e357a3d4d0b9391eab2a83a5b3010556)), closes [#12491](https://github.com/UI5/webcomponents/issues/12491) [#12775](https://github.com/UI5/webcomponents/issues/12775)
|
|
63
|
+
* Revert "chore: scope theming variables used in illustrations (#12687)" (#12770) ([c9288ff](https://github.com/UI5/webcomponents/commit/c9288ff0f655fdd03262b71ac788e5688c904add)), closes [#12687](https://github.com/UI5/webcomponents/issues/12687) [#12770](https://github.com/UI5/webcomponents/issues/12770)
|
|
64
|
+
* Revert "feat(framework): introduce loadBaseThemingCSSVariables configuration (#12699)" (#12767) ([db375d3](https://github.com/UI5/webcomponents/commit/db375d30b9f4a7e07961fabbdcefdcdc78a93f46)), closes [#12699](https://github.com/UI5/webcomponents/issues/12699) [#12767](https://github.com/UI5/webcomponents/issues/12767)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
# [2.17.0-rc.5](https://github.com/UI5/webcomponents/compare/v2.17.0-rc.4...v2.17.0-rc.5) (2025-12-04)
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
### Bug Fixes
|
|
74
|
+
|
|
75
|
+
* **tools:** dependencies usage ([#12716](https://github.com/UI5/webcomponents/issues/12716)) ([89bb0dd](https://github.com/UI5/webcomponents/commit/89bb0dd62322598bd1ea7ce984eaf0618546a6f2))
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
### Features
|
|
79
|
+
|
|
80
|
+
* **framework:** introduce loadBaseThemingCSSVariables configuration ([#12699](https://github.com/UI5/webcomponents/issues/12699)) ([f01b2eb](https://github.com/UI5/webcomponents/commit/f01b2eb6256f2032bd802d0a60c4625b0d1af5fe))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
# [2.17.0-rc.4](https://github.com/UI5/webcomponents/compare/v2.17.0-rc.3...v2.17.0-rc.4) (2025-11-27)
|
|
7
87
|
|
|
8
88
|
|
|
9
89
|
### Bug Fixes
|
|
10
90
|
|
|
11
91
|
* **build:** fix issue with legacy dev setup ([#12706](https://github.com/UI5/webcomponents/issues/12706)) ([89fa5ca](https://github.com/UI5/webcomponents/commit/89fa5ca9f83551363e8c1d9980269cd58fa09d85))
|
|
12
|
-
* **tools:** dependencies usage ([0153001](https://github.com/UI5/webcomponents/commit/0153001817687f59130b1e220ad418e65672acfb))
|
|
13
92
|
|
|
14
93
|
|
|
15
94
|
|
package/bin/ui5nps.js
CHANGED
|
@@ -165,7 +165,12 @@ class Parser {
|
|
|
165
165
|
return new Promise(async (resolve, reject) => {
|
|
166
166
|
if (command.trim().startsWith("ui5nps-script")) {
|
|
167
167
|
const argv = parseArgsStringToArgv(command);
|
|
168
|
-
|
|
168
|
+
if (!path.isAbsolute(argv[1])) {
|
|
169
|
+
throw new Error(`Script path must be absolute: ${argv[1]}`);
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
const importPath = argv[1];
|
|
173
|
+
const importedContent = require(importPath);
|
|
169
174
|
let _ui5mainFn;
|
|
170
175
|
|
|
171
176
|
if (importedContent.__esModule) {
|
|
@@ -174,6 +179,10 @@ class Parser {
|
|
|
174
179
|
_ui5mainFn = importedContent._ui5mainFn;
|
|
175
180
|
}
|
|
176
181
|
|
|
182
|
+
if (!_ui5mainFn) {
|
|
183
|
+
return reject(new Error(`No valid _ui5mainFn function exported from ${importPath} tried to be executed with ui5nps-script. Either provide a valid _ui5mainFn function or use another way to execute the script (via node).`));
|
|
184
|
+
}
|
|
185
|
+
|
|
177
186
|
console.log(` | Executing command ${commandName} as module.`);
|
|
178
187
|
const result = _ui5mainFn(argv);
|
|
179
188
|
|
|
@@ -92,7 +92,7 @@ const getScripts = (options) => {
|
|
|
92
92
|
},
|
|
93
93
|
build: {
|
|
94
94
|
default: "ui5nps prepare lint build.bundle", // build.bundle2
|
|
95
|
-
templates: options.legacy ? `
|
|
95
|
+
templates: options.legacy ? `node "${LIB}hbs2ui5/index.js" -d src/ -o src/generated/templates` : "",
|
|
96
96
|
styles: {
|
|
97
97
|
default: `ui5nps-p build.styles.themes build.styles.components`, // concurently
|
|
98
98
|
themes: `ui5nps-script "${LIB}css-processors/css-processor-themes.mjs"`,
|
|
@@ -114,7 +114,7 @@ const getScripts = (options) => {
|
|
|
114
114
|
default: "ui5nps build.jsImports.illustrationsLoaders",
|
|
115
115
|
illustrationsLoaders: createIllustrationsLoadersScript,
|
|
116
116
|
},
|
|
117
|
-
bundle: `vite
|
|
117
|
+
bundle: `ui5nps-script "${LIB}vite-bundler/vite-bundler.mjs" ${viteConfig} --mode testing --base ${websiteBaseUrl}`,
|
|
118
118
|
bundle2: ``,
|
|
119
119
|
illustrations: createIllustrationsJSImportsScript,
|
|
120
120
|
},
|
|
@@ -389,6 +389,10 @@ const processPublicAPI = object => {
|
|
|
389
389
|
}
|
|
390
390
|
for (const key of keys) {
|
|
391
391
|
if ((key === "privacy" && object[key] !== "public") || (key === "_ui5privacy" && object[key] !== "public")) {
|
|
392
|
+
if (keys.includes("kind") && object["kind"] === "class") {
|
|
393
|
+
continue;
|
|
394
|
+
}
|
|
395
|
+
|
|
392
396
|
return true;
|
|
393
397
|
} else if (typeof object[key] === "object") {
|
|
394
398
|
if (key === "cssParts" || key === "attributes" || key === "_ui5implements") {
|
package/lib/chokidar/chokidar.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
const chokidar = require('chokidar');
|
|
2
2
|
const { exec } = require("child_process");
|
|
3
3
|
|
|
4
|
-
|
|
5
4
|
const main = async (argv) => {
|
|
6
5
|
if (argv.length < 4) {
|
|
7
6
|
console.error("Please provide a file pattern to watch and a command to execute on changes.");
|
|
8
7
|
console.error("<file-pattern> <command>");
|
|
9
8
|
process.exit(1);
|
|
10
9
|
}
|
|
11
|
-
|
|
10
|
+
|
|
12
11
|
const filePattern = argv[2];
|
|
13
12
|
const command = argv.slice(3).join(' ');
|
|
14
13
|
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
const fs = require("fs").promises;
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const { scopeThemingVariables } = require("../css-processors/scope-variables.mjs");
|
|
4
3
|
|
|
5
4
|
const generate = async (argv) => {
|
|
6
5
|
if (argv.length < 7) {
|
|
@@ -92,7 +91,7 @@ const generate = async (argv) => {
|
|
|
92
91
|
console.log(`Generating illustrations from ${srcPath} to ${destPath}`)
|
|
93
92
|
|
|
94
93
|
const svgImportTemplate = svgContent => {
|
|
95
|
-
return `export default \`${
|
|
94
|
+
return `export default \`${svgContent}\`;`
|
|
96
95
|
};
|
|
97
96
|
const svgToJs = async fileName => {
|
|
98
97
|
const svg = await fs.readFile(path.join(srcPath, fileName), { encoding: "utf-8" });
|
|
@@ -4,7 +4,7 @@ import * as fs from "fs";
|
|
|
4
4
|
import * as path from "path";
|
|
5
5
|
import { writeFile, mkdir } from "fs/promises";
|
|
6
6
|
import chokidar from "chokidar";
|
|
7
|
-
import
|
|
7
|
+
import scopeVariables from "./scope-variables.mjs";
|
|
8
8
|
import { writeFileIfChanged, getFileContent } from "./shared.mjs";
|
|
9
9
|
import { pathToFileURL } from "url";
|
|
10
10
|
|
|
@@ -24,7 +24,7 @@ const generate = async (argv) => {
|
|
|
24
24
|
build.onEnd(result => {
|
|
25
25
|
result.outputFiles.forEach(async f => {
|
|
26
26
|
// scoping
|
|
27
|
-
let newText =
|
|
27
|
+
let newText = scopeVariables(f.text, packageJSON);
|
|
28
28
|
newText = newText.replaceAll(/\\/g, "\\\\"); // Escape backslashes as they might appear in css rules
|
|
29
29
|
await mkdir(path.dirname(f.path), { recursive: true });
|
|
30
30
|
writeFile(f.path, newText);
|
|
@@ -6,45 +6,10 @@ import { writeFile, mkdir } from "fs/promises";
|
|
|
6
6
|
import postcss from "postcss";
|
|
7
7
|
import combineDuplicatedSelectors from "../postcss-combine-duplicated-selectors/index.js"
|
|
8
8
|
import { writeFileIfChanged, getFileContent } from "./shared.mjs";
|
|
9
|
-
import
|
|
9
|
+
import scopeVariables from "./scope-variables.mjs";
|
|
10
10
|
import { pathToFileURL } from "url";
|
|
11
11
|
|
|
12
|
-
async
|
|
13
|
-
const selector = ':root';
|
|
14
|
-
const newRule = postcss.rule({ selector });
|
|
15
|
-
const result = await postcss().process(f.text);
|
|
16
|
-
|
|
17
|
-
result.root.walkRules(selector, rule => {
|
|
18
|
-
for (const decl of rule.nodes) {
|
|
19
|
-
if (decl.type !== 'decl' ) {
|
|
20
|
-
continue;
|
|
21
|
-
} else if (decl.prop.startsWith('--sapFontUrl')) {
|
|
22
|
-
continue;
|
|
23
|
-
} else if (!decl.prop.startsWith('--sap')) {
|
|
24
|
-
newRule.append(decl.clone());
|
|
25
|
-
} else {
|
|
26
|
-
const originalProp = decl.prop;
|
|
27
|
-
const originalValue = decl.value;
|
|
28
|
-
|
|
29
|
-
newRule.append(decl.clone({ prop: originalProp.replace("--sap", "--ui5-sap"), value: `var(${originalProp}, ${originalValue})` }));
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
return newRule.toString();
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
async function processComponentPackageFile(f, packageJSON) {
|
|
38
|
-
let result = await postcss(combineDuplicatedSelectors).process(f.text);
|
|
39
|
-
|
|
40
|
-
result = scopeUi5Variables(result.css, packageJSON, f.path);
|
|
41
|
-
|
|
42
|
-
result = scopeThemingVariables(result);
|
|
43
|
-
|
|
44
|
-
return result;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async function generate(argv) {
|
|
12
|
+
const generate = async (argv) => {
|
|
48
13
|
const tsMode = process.env.UI5_TS === "true";
|
|
49
14
|
const extension = tsMode ? ".css.ts" : ".css.js";
|
|
50
15
|
|
|
@@ -55,6 +20,29 @@ async function generate(argv) {
|
|
|
55
20
|
]);
|
|
56
21
|
const restArgs = argv.slice(2);
|
|
57
22
|
|
|
23
|
+
const processThemingPackageFile = async (f) => {
|
|
24
|
+
const selector = ':root';
|
|
25
|
+
const result = await postcss().process(f.text);
|
|
26
|
+
|
|
27
|
+
const newRule = postcss.rule({ selector });
|
|
28
|
+
|
|
29
|
+
result.root.walkRules(selector, rule => {
|
|
30
|
+
rule.walkDecls(decl => {
|
|
31
|
+
if (!decl.prop.startsWith('--sapFontUrl')) {
|
|
32
|
+
newRule.append(decl.clone());
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
return newRule.toString();
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
const processComponentPackageFile = async (f) => {
|
|
41
|
+
const result = await postcss(combineDuplicatedSelectors).process(f.text);
|
|
42
|
+
|
|
43
|
+
return scopeVariables(result.css, packageJSON, f.path);
|
|
44
|
+
}
|
|
45
|
+
|
|
58
46
|
let scopingPlugin = {
|
|
59
47
|
name: 'scoping',
|
|
60
48
|
setup(build) {
|
|
@@ -62,7 +50,7 @@ async function generate(argv) {
|
|
|
62
50
|
|
|
63
51
|
build.onEnd(result => {
|
|
64
52
|
result.outputFiles.forEach(async f => {
|
|
65
|
-
let newText = f.path.includes("packages/theming") ? await processThemingPackageFile(f) : await processComponentPackageFile(f
|
|
53
|
+
let newText = f.path.includes("packages/theming") ? await processThemingPackageFile(f) : await processComponentPackageFile(f);
|
|
66
54
|
|
|
67
55
|
await mkdir(path.dirname(f.path), { recursive: true });
|
|
68
56
|
writeFile(f.path, newText);
|
|
@@ -111,8 +99,4 @@ if (import.meta.url === fileUrl) {
|
|
|
111
99
|
|
|
112
100
|
export default {
|
|
113
101
|
_ui5mainFn: generate
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
export {
|
|
117
|
-
processComponentPackageFile
|
|
118
102
|
}
|
|
@@ -9,9 +9,9 @@ const require = createRequire(import.meta.url);
|
|
|
9
9
|
* @returns
|
|
10
10
|
*/
|
|
11
11
|
const getOverrideVersion = filePath => {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
if (!filePath) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
15
|
|
|
16
16
|
if (!filePath.includes(`overrides${path.sep}`)) {
|
|
17
17
|
return; // The "overrides/" directory is the marker
|
|
@@ -36,22 +36,14 @@ const getOverrideVersion = filePath => {
|
|
|
36
36
|
return overrideVersion;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
const expr = /(--_?ui5)([^\,\:\)\s]+)/g;
|
|
43
|
-
let newText = cssText.replaceAll(expr, `$1-${versionStr}$2`);
|
|
39
|
+
const scopeVariables = (cssText, packageJSON, inputFile) => {
|
|
40
|
+
const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-");
|
|
41
|
+
const versionStr = escapeVersion(getOverrideVersion(inputFile) || packageJSON.version);
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
}
|
|
43
|
+
const expr = /(--_?ui5)([^\,\:\)\s]+)/g;
|
|
47
44
|
|
|
48
|
-
|
|
49
|
-
const scopeThemingVariables = (cssText) => {
|
|
50
|
-
return cssText.replaceAll("--sap", `--ui5-sap`);
|
|
45
|
+
return cssText.replaceAll(expr, `$1-${versionStr}$2`);
|
|
51
46
|
}
|
|
52
47
|
|
|
53
|
-
export
|
|
54
|
-
scopeUi5Variables,
|
|
55
|
-
scopeThemingVariables,
|
|
56
|
-
};
|
|
48
|
+
export default scopeVariables;
|
|
57
49
|
|
package/lib/eslint/eslint.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const fs = require("fs");
|
|
2
2
|
const { ESLint: ESLint7 } = require("eslint"); // isolated v7
|
|
3
|
+
const path = require("path");
|
|
3
4
|
|
|
4
5
|
const main = async argv => {
|
|
5
6
|
let eslintConfig;
|
|
@@ -11,11 +12,12 @@ const main = async argv => {
|
|
|
11
12
|
eslintConfig = require.resolve("@ui5/webcomponents-tools/components-package/eslint.js")
|
|
12
13
|
};
|
|
13
14
|
|
|
15
|
+
const packageDir = path.dirname(require.resolve("@ui5/webcomponents-tools/package.json"));
|
|
14
16
|
const eslint = new ESLint7({
|
|
15
17
|
overrideConfigFile: eslintConfig,
|
|
16
18
|
fix: argv.includes("--fix"),
|
|
19
|
+
resolvePluginsRelativeTo: packageDir,
|
|
17
20
|
});
|
|
18
|
-
|
|
19
21
|
console.log("Running ESLint v7...");
|
|
20
22
|
|
|
21
23
|
// Lint files
|
package/lib/i18n/toJSON.js
CHANGED
|
@@ -14,8 +14,31 @@ const assets = require('../../assets-meta.js');
|
|
|
14
14
|
|
|
15
15
|
const allLanguages = assets.languages.all;
|
|
16
16
|
|
|
17
|
+
/**
|
|
18
|
+
* The translation system has a configuration whether to return UTF-8 sequences
|
|
19
|
+
* or the actual characters. This function inlines UTF-8 sequences to actual characters.
|
|
20
|
+
*
|
|
21
|
+
* For example, it converts "Keine Produkte erf\u00FCgbar" to "Keine Produkte verfügbar"
|
|
22
|
+
* This makes the JSON files more readable and smaller.
|
|
23
|
+
*/
|
|
24
|
+
function inlineUTF(properties) {
|
|
25
|
+
for (const key in properties) {
|
|
26
|
+
if (Object.prototype.hasOwnProperty.call(properties, key)) {
|
|
27
|
+
try {
|
|
28
|
+
// escape double quotes to avoid JSON parse error
|
|
29
|
+
const escaped = properties[key].replaceAll("\"", "\\\"");
|
|
30
|
+
properties[key] = JSON.parse(`"${escaped}"`); // utilize JSON parser to decode UTF-8 sequences
|
|
31
|
+
} catch (e) {
|
|
32
|
+
// in case of error, just keep the original string
|
|
33
|
+
console.log(`Warning: failed to inline UTF-8 for key "${key}" with value "${properties[key]}"`);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
return properties;
|
|
38
|
+
}
|
|
39
|
+
|
|
17
40
|
const convertToJSON = async (file, distPath) => {
|
|
18
|
-
const properties = PropertiesReader(file)._properties;
|
|
41
|
+
const properties = inlineUTF(PropertiesReader(file)._properties);
|
|
19
42
|
const filename = path.basename(file, path.extname(file));
|
|
20
43
|
const language = filename.match(/^messagebundle_(.*?)$/)[1];
|
|
21
44
|
if (!allLanguages.includes(language)) {
|
|
@@ -3,7 +3,7 @@ const { readFileSync } = require("fs");
|
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const fs = require("fs");
|
|
5
5
|
|
|
6
|
-
function testFn() {
|
|
6
|
+
function testFn(outArgv) {
|
|
7
7
|
// search for dev-server port
|
|
8
8
|
// start in current folder
|
|
9
9
|
// traversing upwards in case of mono repo tests and dev-server running in root folder of repository
|
|
@@ -48,15 +48,15 @@ function testFn() {
|
|
|
48
48
|
|
|
49
49
|
// add single spec parameter if passed
|
|
50
50
|
let spec = "";
|
|
51
|
-
if (
|
|
52
|
-
const specFile =
|
|
51
|
+
if (outArgv.length === 3) {
|
|
52
|
+
const specFile = outArgv[2];
|
|
53
53
|
spec = `--spec ${specFile}`;
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
// more parameters - pass them to wdio
|
|
57
57
|
let restParams = "";
|
|
58
|
-
if (
|
|
59
|
-
restParams =
|
|
58
|
+
if (outArgv.length > 3) {
|
|
59
|
+
restParams = outArgv.slice(2).join(" ");
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
let wdioConfig = "";
|
|
@@ -67,7 +67,7 @@ function testFn() {
|
|
|
67
67
|
}
|
|
68
68
|
|
|
69
69
|
// run wdio with calculated parameters
|
|
70
|
-
const cmd = `
|
|
70
|
+
const cmd = `npx cross-env WDIO_LOG_LEVEL=error wdio ${wdioConfig} ${spec} ${baseUrl} ${restParams}`;
|
|
71
71
|
console.log(`executing: ${cmd}`);
|
|
72
72
|
child_process.execSync(cmd, {stdio: 'inherit'});
|
|
73
73
|
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { build } from 'vite';
|
|
2
|
+
import yargs from 'yargs';
|
|
3
|
+
import { hideBin } from 'yargs/helpers';
|
|
4
|
+
import { pathToFileURL } from "url";
|
|
5
|
+
|
|
6
|
+
async function start(outArgv) {
|
|
7
|
+
const argv = yargs(hideBin(outArgv))
|
|
8
|
+
.alias("c", "config")
|
|
9
|
+
.alias("mode", "mode")
|
|
10
|
+
.alias("base", "base")
|
|
11
|
+
.argv;
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
await build({
|
|
15
|
+
configFile: argv.config || undefined,
|
|
16
|
+
mode: argv.mode || undefined,
|
|
17
|
+
base: argv.base || undefined,
|
|
18
|
+
logLevel: 'info',
|
|
19
|
+
});
|
|
20
|
+
} catch (e) {
|
|
21
|
+
console.error(e)
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
const filePath = process.argv[1];
|
|
27
|
+
const fileUrl = pathToFileURL(filePath).href;
|
|
28
|
+
|
|
29
|
+
if (import.meta.url === fileUrl) {
|
|
30
|
+
start(process.argv)
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export default {
|
|
34
|
+
_ui5mainFn: start
|
|
35
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-tools",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-e03cd01f3",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.tools",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -82,5 +82,5 @@
|
|
|
82
82
|
"esbuild": "^0.25.0",
|
|
83
83
|
"yargs": "^17.5.1"
|
|
84
84
|
},
|
|
85
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "f28ab61f9c4395563d4664b411455d7c28f47597"
|
|
86
86
|
}
|