@ui5/webcomponents-tools 1.11.0-rc.2 → 1.11.0-rc.3
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 +11 -0
- package/lib/create-icons/index.js +29 -6
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,17 @@
|
|
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
|
+
# [1.11.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.2...v1.11.0-rc.3) (2023-02-23)
|
7
|
+
|
8
|
+
|
9
|
+
### Features
|
10
|
+
|
11
|
+
* **playground:** next playground with storybook ([#5831](https://github.com/SAP/ui5-webcomponents/issues/5831)) ([79274c8](https://github.com/SAP/ui5-webcomponents/commit/79274c8e442cf5854a7fe6327f25aaed04312103)), closes [#5898](https://github.com/SAP/ui5-webcomponents/issues/5898)
|
12
|
+
|
13
|
+
|
14
|
+
|
15
|
+
|
16
|
+
|
6
17
|
# [1.11.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.11.0-rc.1...v1.11.0-rc.2) (2023-02-16)
|
7
18
|
|
8
19
|
**Note:** Version bump only for package @ui5/webcomponents-tools
|
@@ -38,13 +38,13 @@ export { pathData, ltr, accData };`;
|
|
38
38
|
|
39
39
|
|
40
40
|
|
41
|
-
const collectionTemplate = (name, versions) => `import { isThemeFamily } from "@ui5/webcomponents-base/dist/config/Theme.js";
|
41
|
+
const collectionTemplate = (name, versions, fullName) => `import { isThemeFamily } from "@ui5/webcomponents-base/dist/config/Theme.js";
|
42
42
|
import { pathData as pathData${versions[0]}, ltr, accData } from "./${versions[0]}/${name}.js";
|
43
43
|
import { pathData as pathData${versions[1]} } from "./${versions[1]}/${name}.js";
|
44
44
|
|
45
45
|
const pathData = isThemeFamily("sap_horizon") ? pathData${versions[1]} : pathData${versions[0]};
|
46
46
|
|
47
|
-
export default "${
|
47
|
+
export default "${fullName}";
|
48
48
|
export { pathData, ltr, accData };`;
|
49
49
|
|
50
50
|
|
@@ -80,22 +80,45 @@ const createIcons = async (file) => {
|
|
80
80
|
const pathData = iconData.path;
|
81
81
|
const ltr = !!iconData.ltr;
|
82
82
|
const acc = iconData.acc;
|
83
|
+
const packageName = json.packageName;
|
84
|
+
const collection = json.collection;
|
83
85
|
|
84
|
-
const content = acc ? iconAccTemplate(name, pathData, ltr, acc,
|
86
|
+
const content = acc ? iconAccTemplate(name, pathData, ltr, acc, collection, packageName) : iconTemplate(name, pathData, ltr, collection, packageName);
|
85
87
|
|
86
88
|
promises.push(fs.writeFile(path.join(destDir, `${name}.js`), content));
|
87
89
|
promises.push(fs.writeFile(path.join(destDir, `${name}.svg`), svgTemplate(pathData)));
|
88
|
-
promises.push(fs.writeFile(path.join(destDir, `${name}.d.ts`), typeDefinitionTemplate(name, acc,
|
90
|
+
promises.push(fs.writeFile(path.join(destDir, `${name}.d.ts`), typeDefinitionTemplate(name, acc, collection)));
|
91
|
+
|
92
|
+
// For versioned icons collections, the script creates top level (unversioned) module that internally imports the versioned ones.
|
93
|
+
// For example, the top level "@ui5/ui5-webcomponents-icons/dist/accept.js" imports:
|
94
|
+
// - "@ui5/ui5-webcomponents-icons/dist/v5/accept.js"
|
95
|
+
// - "@ui5/ui5-webcomponents-icons/dist/v4/accept.js"
|
89
96
|
|
90
97
|
if (json.version) {
|
91
|
-
|
92
|
-
|
98
|
+
// The exported value from the top level (unversioned) icon module depends on whether the collection is the default,
|
99
|
+
// to add or not the collection name to the exported value:
|
100
|
+
// For the default collection (SAPIcons) we export just the icon name - "export default { 'accept' }"
|
101
|
+
// For non-default collections (SAPTNTIcons and SAPBSIcons) we export the full name - "export default { 'tnt/actor' }"
|
102
|
+
const effectiveName = isDefaultCollection(collection) ? name : getUnversionedFullIconName(name, collection);
|
103
|
+
promises.push(fs.writeFile(path.join(path.normalize("dist/"), `${name}.js`), collectionTemplate(name, json.versions, effectiveName)));
|
104
|
+
promises.push(fs.writeFile(path.join(path.normalize("dist/"), `${name}.d.ts`), collectionTypeDefinitionTemplate(effectiveName, acc)));
|
93
105
|
}
|
94
106
|
}
|
95
107
|
|
96
108
|
return Promise.all(promises);
|
97
109
|
};
|
98
110
|
|
111
|
+
const isDefaultCollection = collectionName => collectionName === "SAP-icons-v4" || collectionName === "SAP-icons-v5";
|
112
|
+
const getUnversionedFullIconName = (name, collection) => `${getUnversionedCollectionName(collection)}/${name}`;
|
113
|
+
const getUnversionedCollectionName = collectionName => CollectionVersionedToUnversionedMap[collectionName] || collectionName;
|
114
|
+
|
115
|
+
const CollectionVersionedToUnversionedMap = {
|
116
|
+
"tnt-v2": "tnt",
|
117
|
+
"tnt-v3": "tnt",
|
118
|
+
"business-suite-v1": "business-suite",
|
119
|
+
"business-suite-v2": "business-suite",
|
120
|
+
};
|
121
|
+
|
99
122
|
createIcons(srcFile).then(() => {
|
100
123
|
console.log("Icons created.");
|
101
124
|
});
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@ui5/webcomponents-tools",
|
3
|
-
"version": "1.11.0-rc.
|
3
|
+
"version": "1.11.0-rc.3",
|
4
4
|
"description": "UI5 Web Components: webcomponents.tools",
|
5
5
|
"author": "SAP SE (https://www.sap.com)",
|
6
6
|
"license": "Apache-2.0",
|
@@ -62,7 +62,7 @@
|
|
62
62
|
"resolve": "^1.20.0",
|
63
63
|
"rimraf": "^3.0.2",
|
64
64
|
"slash": "3.0.0",
|
65
|
-
"vite": "^
|
65
|
+
"vite": "^3.0.4",
|
66
66
|
"wdio-chromedriver-service": "^7.3.2",
|
67
67
|
"zx": "^4.3.0"
|
68
68
|
},
|
@@ -72,5 +72,5 @@
|
|
72
72
|
"devDependencies": {
|
73
73
|
"yargs": "^17.5.1"
|
74
74
|
},
|
75
|
-
"gitHead": "
|
75
|
+
"gitHead": "228475d7914731c7dd1a59e570eb406add604047"
|
76
76
|
}
|