@ui5/webcomponents-theming 0.0.0-4180fe799 → 0.0.0-49cef2d02
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 +188 -0
- package/README.md +5 -6
- package/config/postcss.themes/postcss.config.js +1 -1
- package/css-vars-usage.json +146 -6
- package/dist/Assets-static.d.ts +1 -0
- package/dist/Assets-static.js +1 -0
- package/dist/Assets-static.js.map +1 -0
- package/dist/Assets.d.ts +1 -0
- package/dist/Assets.js +1 -0
- package/dist/Assets.js.map +1 -0
- 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 +9 -3
- package/dist/generated/json-imports/Themes.js +6 -3
- 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 +822 -0
- package/dist/themes/sap_belize/parameters-bundle.css +1 -0
- package/dist/themes/sap_belize_hcb/css_variables.css +821 -0
- package/dist/themes/sap_belize_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_belize_hcw/css_variables.css +821 -0
- package/dist/themes/sap_belize_hcw/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3/css_variables.css +821 -0
- package/dist/themes/sap_fiori_3/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_dark/css_variables.css +821 -0
- package/dist/themes/sap_fiori_3_dark/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_hcb/css_variables.css +821 -0
- package/dist/themes/sap_fiori_3_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_fiori_3_hcw/css_variables.css +821 -0
- package/dist/themes/sap_fiori_3_hcw/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon/css_variables.css +821 -0
- package/dist/themes/sap_horizon/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_dark/css_variables.css +821 -0
- package/dist/themes/sap_horizon_dark/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_exp/css_variables.css +821 -0
- package/dist/themes/sap_horizon_exp/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_hcb/css_variables.css +821 -0
- package/dist/themes/sap_horizon_hcb/parameters-bundle.css +1 -0
- package/dist/themes/sap_horizon_hcw/css_variables.css +821 -0
- package/dist/themes/sap_horizon_hcw/parameters-bundle.css +1 -0
- package/lib/generate-css-vars-usage-report/index.js +17 -12
- package/package-scripts.js +2 -6
- package/package.json +8 -10
- package/tsconfig.json +14 -0
- 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,20 @@ 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").replace(/\\/g, "/"));
|
|
20
|
+
const fioriFiles = await globby(path.join(__dirname, "../../../fiori/src/themes/**/*.css").replace(/\\/g, "/"));
|
|
22
21
|
|
|
23
|
-
|
|
24
|
-
const result = Array.from(vars).sort(collator.compare); // natural sort
|
|
22
|
+
await Promise.all([...mainFiles.map(processFile), ...fioriFiles.map(processFile)]);
|
|
25
23
|
|
|
26
|
-
|
|
27
|
-
|
|
24
|
+
const collator = new Intl.Collator(undefined, {numeric: true, sensitivity: 'base'});
|
|
25
|
+
const result = Array.from(vars).sort(collator.compare); // natural sort
|
|
26
|
+
|
|
27
|
+
return fs.writeFile(path.join(__dirname, "../../css-vars-usage.json"), beautify(result, null, 2, 100));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
generate().then(() => {
|
|
31
|
+
console.log("CSS Vars usage report generated.");
|
|
32
|
+
});
|
package/package-scripts.js
CHANGED
|
@@ -15,16 +15,13 @@ 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.typescript build.themes build.postcss build.jsonImports generateReport`,
|
|
27
23
|
src: `copy-and-watch "src/**/*.js" dist/`,
|
|
24
|
+
typescript: "tsc",
|
|
28
25
|
themes: {
|
|
29
26
|
default: `nps build.themes.prepare ${buildThemesCommandsNames}`,
|
|
30
27
|
...buildThemesCommands
|
|
@@ -33,6 +30,5 @@ module.exports = {
|
|
|
33
30
|
jsonImports: `node "${jsonImportsScript}" dist/generated/assets/themes dist/generated/json-imports`,
|
|
34
31
|
},
|
|
35
32
|
generateReport: `node "${generateReportScript}"`,
|
|
36
|
-
hash: `node ${generateHash} dist/ hash.txt`,
|
|
37
33
|
},
|
|
38
34
|
};
|
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-49cef2d02",
|
|
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.48",
|
|
32
|
+
"@ui5/webcomponents-base": "0.0.0-49cef2d02"
|
|
34
33
|
},
|
|
35
34
|
"devDependencies": {
|
|
36
|
-
"@ui5/webcomponents-tools": "0.0.0-
|
|
37
|
-
"chromedriver": "
|
|
35
|
+
"@ui5/webcomponents-tools": "0.0.0-49cef2d02",
|
|
36
|
+
"chromedriver": "107.0.3",
|
|
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/tsconfig.json
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"include": ["src/**/*"],
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ES2021",
|
|
5
|
+
// Generate d.ts files
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"outDir": "dist",
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"strict": true,
|
|
11
|
+
"moduleResolution": "node",
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
},
|
|
14
|
+
}
|
package/hash.txt
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
rZnyMTmoc2CFM82C+7zGHcw3GGY=
|