@ui5/webcomponents-theming 0.0.0-db2be6526 → 0.0.0-ec448881d
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 +119 -0
- package/config/postcss.themes/postcss.config.js +3 -3
- package/css-vars-usage.json +166 -2
- package/dist/css/themes/sap_belize/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_belize_hcb/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_belize_hcw/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_fiori_3/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_fiori_3_dark/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_horizon/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_horizon_dark/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_horizon_exp/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_horizon_hcb/parameters-bundle.css +1 -0
- package/dist/css/themes/sap_horizon_hcw/parameters-bundle.css +1 -0
- package/dist/generated/assets/themes/sap_belize/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_belize_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_dark/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcb/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_fiori_3_hcw/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_dark/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_exp/parameters-bundle.css.json +1 -1
- package/dist/generated/assets/themes/sap_horizon_hcb/parameters-bundle.css.json +1 -0
- package/dist/generated/assets/themes/sap_horizon_hcw/parameters-bundle.css.json +1 -0
- package/dist/generated/json-imports/Themes-static.js +8 -2
- package/dist/generated/json-imports/Themes.js +4 -1
- package/dist/generated/themes/sap_belize/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_belize_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_dark/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcb/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_fiori_3_hcw/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_dark/parameters-bundle.css.js +1 -0
- package/dist/generated/themes/sap_horizon_exp/parameters-bundle.css.js +1 -1
- package/dist/generated/themes/sap_horizon_hcb/parameters-bundle.css.js +1 -0
- package/dist/generated/themes/sap_horizon_hcw/parameters-bundle.css.js +1 -0
- package/dist/themes/sap_belize/css_variables.css +748 -0
- package/dist/themes/sap_belize/parameters-bundle.css +1 -0
- package/dist/themes/sap_belize_hcb/css_variables.css +747 -0
- package/dist/themes/sap_belize_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_belize_hcw/css_variables.css +747 -0
- package/dist/themes/sap_belize_hcw/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3/css_variables.css +747 -0
- package/dist/themes/sap_fiori_3/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_dark/css_variables.css +747 -0
- package/dist/themes/sap_fiori_3_dark/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_hcb/css_variables.css +747 -0
- package/dist/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_hcw/css_variables.css +747 -0
- package/dist/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon/css_variables.css +747 -0
- package/dist/themes/sap_horizon/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_dark/css_variables.css +747 -0
- package/dist/themes/sap_horizon_dark/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_exp/css_variables.css +747 -0
- package/dist/themes/sap_horizon_exp/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_hcb/css_variables.css +747 -0
- package/dist/themes/sap_horizon_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_hcw/css_variables.css +747 -0
- package/dist/themes/sap_horizon_hcw/parameters-bundle.css +1 -0
- package/lib/generate-css-vars-usage-report/index.js +16 -12
- package/package-scripts.js +1 -6
- package/package.json +8 -10
- package/hash.txt +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import "./css_variables.css";
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
const fs = require('fs');
|
|
1
|
+
const fs = require('fs').promises;
|
|
2
2
|
const path = require("path");
|
|
3
|
-
const glob = require("glob");
|
|
4
3
|
const beautify = require("json-beautify");
|
|
5
4
|
|
|
6
5
|
const vars = new Set();
|
|
7
6
|
|
|
8
|
-
const processFile = file => {
|
|
9
|
-
const content = fs.
|
|
7
|
+
const processFile = async file => {
|
|
8
|
+
const content = await fs.readFile(file);
|
|
10
9
|
const matches = `${content}`.match(/var\(--sap[\-_A-Za-z0-9]+\)/g);
|
|
11
10
|
matches && matches.forEach(match => {
|
|
12
11
|
const cssVar = match.match(/--sap[\-_A-Za-z0-9]+/)[0];
|
|
@@ -14,14 +13,19 @@ const processFile = file => {
|
|
|
14
13
|
});
|
|
15
14
|
};
|
|
16
15
|
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
const generate = async () => {
|
|
17
|
+
const { globby } = await import("globby");
|
|
19
18
|
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
const mainFiles = await globby(path.join(__dirname, "../../../main/src/themes/**/*.css"));
|
|
20
|
+
const fioriFiles = await globby(path.join(__dirname, "../../../fiori/src/themes/**/*.css"));
|
|
21
|
+
await Promise.all([...mainFiles.map(processFile), ...fioriFiles.map(processFile)]);
|
|
22
22
|
|
|
23
|
-
const collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
|
|
24
|
-
const result = Array.from(vars).sort(collator.compare); // natural sort
|
|
23
|
+
const collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
|
|
24
|
+
const result = Array.from(vars).sort(collator.compare); // natural sort
|
|
25
25
|
|
|
26
|
-
fs.
|
|
27
|
-
|
|
26
|
+
return fs.writeFile(path.join(__dirname, "../../css-vars-usage.json"), beautify(result, null, 2, 100));
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
generate().then(() => {
|
|
30
|
+
console.log("CSS Vars usage report generated.");
|
|
31
|
+
});
|
package/package-scripts.js
CHANGED
|
@@ -15,15 +15,11 @@ allThemes.forEach(theme => {
|
|
|
15
15
|
buildThemesCommands[`copy_${theme}_bundle`] = `copy-and-watch "src/themes/${theme}/parameters-bundle.css" dist/themes/${theme}/`;
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const generateHash = resolve.sync("@ui5/webcomponents-tools/lib/hash/generate.js");
|
|
19
|
-
const hashIsUpToDate = resolve.sync("@ui5/webcomponents-tools/lib/hash/upToDate.js");
|
|
20
|
-
const UP_TO_DATE = `node "${hashIsUpToDate}" dist/ hash.txt && echo "Up to date."`;
|
|
21
|
-
|
|
22
18
|
module.exports = {
|
|
23
19
|
scripts: {
|
|
24
20
|
clean: "rimraf dist",
|
|
25
21
|
build: {
|
|
26
|
-
default:
|
|
22
|
+
default: `nps clean build.src build.themes build.postcss build.jsonImports generateReport`,
|
|
27
23
|
src: `copy-and-watch "src/**/*.js" dist/`,
|
|
28
24
|
themes: {
|
|
29
25
|
default: `nps build.themes.prepare ${buildThemesCommandsNames}`,
|
|
@@ -33,6 +29,5 @@ module.exports = {
|
|
|
33
29
|
jsonImports: `node "${jsonImportsScript}" dist/generated/assets/themes dist/generated/json-imports`,
|
|
34
30
|
},
|
|
35
31
|
generateReport: `node "${generateReportScript}"`,
|
|
36
|
-
hash: `node ${generateHash} dist/ hash.txt`,
|
|
37
32
|
},
|
|
38
33
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/webcomponents-theming",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-ec448881d",
|
|
4
4
|
"description": "UI5 Web Components: webcomponents.theming",
|
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
"build": "nps build",
|
|
21
21
|
"start": "nps start",
|
|
22
22
|
"verify": "node ./lib/verify-vars/index.js",
|
|
23
|
-
"hash": "nps hash",
|
|
24
23
|
"prepublishOnly": "npm run clean && npm run build"
|
|
25
24
|
},
|
|
26
25
|
"repository": {
|
|
@@ -29,19 +28,18 @@
|
|
|
29
28
|
"directory": "packages/theming"
|
|
30
29
|
},
|
|
31
30
|
"dependencies": {
|
|
32
|
-
"@sap-theming/theming-base-content": "11.1.
|
|
33
|
-
"@ui5/webcomponents-base": "0.0.0-
|
|
31
|
+
"@sap-theming/theming-base-content": "11.1.38",
|
|
32
|
+
"@ui5/webcomponents-base": "0.0.0-ec448881d"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@ui5/webcomponents-tools": "0.0.0-
|
|
37
|
-
"chromedriver": "
|
|
35
|
+
"@ui5/webcomponents-tools": "0.0.0-ec448881d",
|
|
36
|
+
"chromedriver": "101.0.0",
|
|
38
37
|
"cssnano": "^4.1.11",
|
|
39
|
-
"
|
|
38
|
+
"globby": "^13.1.1",
|
|
40
39
|
"json-beautify": "^1.1.1",
|
|
41
40
|
"nps": "^5.10.0",
|
|
42
|
-
"postcss": "^8.
|
|
43
|
-
"postcss-
|
|
44
|
-
"postcss-import": "^14.0.0",
|
|
41
|
+
"postcss": "^8.4.5",
|
|
42
|
+
"postcss-import": "^14.0.2",
|
|
45
43
|
"resolve": "^1.20.0"
|
|
46
44
|
},
|
|
47
45
|
"resolutions": {}
|
package/hash.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
FsnpyshWJZD7+zjp83zJUigeWoI=
|