@ui5/webcomponents-tools 1.20.0-rc.2 → 1.20.0

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 CHANGED
@@ -3,6 +3,25 @@
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.20.0](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.3...v1.20.0) (2023-12-04)
7
+
8
+ **Note:** Version bump only for package @ui5/webcomponents-tools
9
+
10
+
11
+
12
+
13
+
14
+ # [1.20.0-rc.3](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.2...v1.20.0-rc.3) (2023-11-30)
15
+
16
+
17
+ ### Features
18
+
19
+ * register custom theme properties ([#7750](https://github.com/SAP/ui5-webcomponents/issues/7750)) ([c6c04c6](https://github.com/SAP/ui5-webcomponents/commit/c6c04c609d82a7442bdf79ef5bba46a406859a27))
20
+
21
+
22
+
23
+
24
+
6
25
  # [1.20.0-rc.2](https://github.com/SAP/ui5-webcomponents/compare/v1.20.0-rc.1...v1.20.0-rc.2) (2023-11-23)
7
26
 
8
27
  **Note:** Version bump only for package @ui5/webcomponents-tools
package/assets-meta.js CHANGED
@@ -25,6 +25,7 @@ const assetsMeta = {
25
25
  "ar",
26
26
  "bg",
27
27
  "ca",
28
+ "cnr",
28
29
  "cs",
29
30
  "cy",
30
31
  "da",
@@ -52,6 +53,7 @@ const assetsMeta = {
52
53
  "ko",
53
54
  "lt",
54
55
  "lv",
56
+ "mk",
55
57
  "ms",
56
58
  "nl",
57
59
  "no",
@@ -63,6 +65,7 @@ const assetsMeta = {
63
65
  "sh",
64
66
  "sk",
65
67
  "sl",
68
+ "sr",
66
69
  "sv",
67
70
  "th",
68
71
  "tr",
@@ -80,6 +83,7 @@ const assetsMeta = {
80
83
  "ar_SA",
81
84
  "bg",
82
85
  "ca",
86
+ // "cnr_ME" - cldr for not available yet
83
87
  "cs",
84
88
  "da",
85
89
  "de",
@@ -127,6 +131,7 @@ const assetsMeta = {
127
131
  "lt",
128
132
  "lv",
129
133
  "ms",
134
+ // "mk_MK" cldr not available yet
130
135
  "nb",
131
136
  "nl",
132
137
  "nl_BE",
@@ -139,6 +144,7 @@ const assetsMeta = {
139
144
  "sk",
140
145
  "sl",
141
146
  "sr",
147
+ // "sr_Cyrl_RS" - cldr not available yet
142
148
  "sr_Latn",
143
149
  "sv",
144
150
  "th",
@@ -1,10 +1,45 @@
1
+ const path = require("path");
1
2
  const name = "postcss-scope-vars";
2
3
 
4
+ const escapeVersion = version => "v" + version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-");
5
+
6
+ /**
7
+ * Tries to detect an override for a package
8
+ * @param {*} filePath For example: /my_project/src/themes/overrides/@ui5/webcomponents/my_custom_theme/parameters-bundle.css
9
+ * @returns
10
+ */
11
+ const getOverrideVersion = filePath => {
12
+ console.log(filePath);
13
+ if (!filePath.includes(`overrides${path.sep}`)) {
14
+ return; // The "overrides/" directory is the marker
15
+ }
16
+ const override = filePath.split(`overrides${path.sep}`)[1]; // For example, this will be: @ui5/webcomponents/my_custom_theme/parameters-bundle.css
17
+ if (!override) {
18
+ return; // There must be other directories after overrides/, the path can't end with it
19
+ }
20
+ const parts = override.split(path.sep);
21
+ if (parts.length < 3) {
22
+ return; // There must be at least a directory for the theme that is being overridden (my_custom_theme) and the name of the CSS file after the name of the package that is overridden
23
+ }
24
+ const packageName = parts.slice(0, -2).join(path.sep); // After the last 2 parts are removed (my_custom_theme and parameters-bundle.css from the example), the rest is the package
25
+
26
+ let overrideVersion;
27
+ try {
28
+ overrideVersion = require(`${packageName}${path.sep}package.json`).version;
29
+ } catch (e) {
30
+ console.log(`Error requiring package ${packageName}: ${e.message}`);
31
+ }
32
+
33
+ return overrideVersion;
34
+ }
35
+
3
36
  module.exports = (options) => {
4
- const versionStr = "v" + options?.version?.replaceAll(/[^0-9A-Za-z\-_]/g, "-");
5
37
  return {
6
38
  postcssPlugin: name,
7
- prepare() {
39
+ prepare(opts) {
40
+ const filePath = opts.root.source.input.file;
41
+ const versionStr = escapeVersion(getOverrideVersion(filePath) || options?.version);
42
+
8
43
  return {
9
44
  Declaration: (declaration) => {
10
45
  if (declaration.__ui5_replaced) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "1.20.0-rc.2",
3
+ "version": "1.20.0",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -78,5 +78,5 @@
78
78
  "devDependencies": {
79
79
  "yargs": "^17.5.1"
80
80
  },
81
- "gitHead": "1d9acab8af658e34d3fd5abebf8f8a744ba0b1ab"
81
+ "gitHead": "7a0ba149b9ebe08b7a965f122db4491358f9dbec"
82
82
  }