@ui5/webcomponents-tools 1.17.0-rc.0 → 1.17.0-rc.1

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,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.17.0-rc.1](https://github.com/SAP/ui5-webcomponents/compare/v1.17.0-rc.0...v1.17.0-rc.1) (2023-08-17)
7
+
8
+
9
+ ### Features
10
+
11
+ * **framework:** scope css variables per runtime and version ([#7449](https://github.com/SAP/ui5-webcomponents/issues/7449)) ([d3f6c2e](https://github.com/SAP/ui5-webcomponents/commit/d3f6c2efba9cfda389ea4d700a375f75b3e2996b))
12
+
13
+
14
+
15
+
16
+
6
17
  # [1.17.0-rc.0](https://github.com/SAP/ui5-webcomponents/compare/v1.16.0...v1.17.0-rc.0) (2023-08-10)
7
18
 
8
19
 
@@ -1,9 +1,11 @@
1
1
  const postcssImport = require('postcss-import');
2
2
  const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
3
+ const postcssScopeVars = require('../lib/postcss-scope-vars/index.js');
3
4
  const cssnano = require('cssnano');
4
- const fs = require("fs");
5
+ const fs = require("fs")
5
6
 
6
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
7
+
8
+ const packageJSON = JSON.parse(fs.readFileSync("./package.json"))
7
9
 
8
10
  module.exports = {
9
11
  plugins: [
@@ -16,6 +18,7 @@ module.exports = {
16
18
  },
17
19
  ]
18
20
  }),
19
- postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName }),
21
+ postcssScopeVars({version: packageJSON.version}),
22
+ postcssCSStoESM({ toReplace: 'src', includeDefaultTheme: true, packageName: packageJSON.name }),
20
23
  ]
21
24
  }
@@ -2,15 +2,17 @@ const postcssImport = require('postcss-import');
2
2
  const combineSelectors = require('../lib/postcss-combine-duplicated-selectors/index.js');
3
3
  const postcssCSStoJSON = require('../lib/postcss-css-to-json/index.js');
4
4
  const postcssCSStoESM = require('../lib/postcss-css-to-esm/index.js');
5
+ const postcssScopeVars = require('../lib/postcss-scope-vars/index.js');
5
6
  const cssnano = require('cssnano');
6
- const modifySelectors = require("modify-selectors");
7
7
  const fs = require("fs");
8
8
 
9
- const packageName = JSON.parse(fs.readFileSync("./package.json")).name;
10
- const selectors = [".sapUiSizeCompact", ".ui5-content-density-compact", "[data-ui5-compact-size]", "[dir=\"rtl\"]", "[dir=\"ltr\"]"];
9
+
10
+ const packageJSON = JSON.parse(fs.readFileSync("./package.json"))
11
+ const packageName = packageJSON.name;
11
12
 
12
13
  module.exports = {
13
14
  plugins: [
15
+ postcssScopeVars({version: packageJSON.version}),
14
16
  postcssImport(),
15
17
  combineSelectors({
16
18
  removeDuplicatedProperties: true
@@ -22,28 +24,6 @@ module.exports = {
22
24
  },
23
25
  ]
24
26
  },),
25
- modifySelectors({
26
- enable: true,
27
- suffix: [
28
- {
29
- match: '*',
30
- with: '[_ui5host]', // Add suffix to each selector in the file (:root => :root [_ui5host])
31
- },
32
- ],
33
- }),
34
- modifySelectors({
35
- enable: true,
36
- modify: [
37
- {
38
- match: (selector) => {
39
- return selectors.some($ => selector.startsWith($));
40
- },
41
- with: (selector) => {
42
- return `${selector.replace(" ", "")}, ${selector}`;
43
- },
44
- },
45
- ]
46
- }),
47
27
  postcssCSStoJSON({ toReplace: 'src', packageName }),
48
28
  postcssCSStoESM({ toReplace: 'src', packageName }),
49
29
  ]
@@ -60,7 +60,7 @@ module.exports = function (opts) {
60
60
 
61
61
  return {
62
62
  postcssPlugin: 'postcss-css-to-esm',
63
- Once (root) {
63
+ OnceExit(root) {
64
64
  const tsMode = process.env.UI5_TS === "true";
65
65
 
66
66
  let css = root.toString();
@@ -15,7 +15,7 @@ module.exports = function (opts) {
15
15
 
16
16
  return {
17
17
  postcssPlugin: 'postcss-css-to-json',
18
- Once (root) {
18
+ OnceExit (root) {
19
19
  let css = root.toString();
20
20
  css = proccessCSS(css);
21
21
 
@@ -0,0 +1,24 @@
1
+ const name = "postcss-scope-vars";
2
+
3
+ module.exports = (options) => {
4
+ const versionStr = "v" + options?.version?.replaceAll(".", "-");
5
+ return {
6
+ postcssPlugin: name,
7
+ prepare() {
8
+ return {
9
+ Declaration: (declaration) => {
10
+ if (declaration.__ui5_replaced) {
11
+ return;
12
+ }
13
+ // add version after ui5
14
+ const expr = /(--_?ui5)([^\,\:\)\s]+)/g
15
+ declaration.prop = declaration.prop.replaceAll(expr, `$1-${versionStr}$2`)
16
+ declaration.value = declaration.value.replaceAll(expr, `$1-${versionStr}$2`)
17
+ declaration.__ui5_replaced = true;
18
+ },
19
+ };
20
+ },
21
+ };
22
+ };
23
+
24
+ module.exports.postcss = true;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ui5/webcomponents-tools",
3
- "version": "1.17.0-rc.0",
3
+ "version": "1.17.0-rc.1",
4
4
  "description": "UI5 Web Components: webcomponents.tools",
5
5
  "author": "SAP SE (https://www.sap.com)",
6
6
  "license": "Apache-2.0",
@@ -51,7 +51,6 @@
51
51
  "jsdoc": "^3.6.6",
52
52
  "json-beautify": "^1.1.1",
53
53
  "mkdirp": "^1.0.4",
54
- "modify-selectors": "^2.0.0",
55
54
  "nps": "^5.10.0",
56
55
  "postcss": "^8.4.5",
57
56
  "postcss-cli": "^9.1.0",
@@ -79,5 +78,5 @@
79
78
  "devDependencies": {
80
79
  "yargs": "^17.5.1"
81
80
  },
82
- "gitHead": "1a6f71104cf246a2b6d0df6d2482baa5fb94ac51"
81
+ "gitHead": "6ab07172a4a1566c3c598ea1db8dae9b26b4d64e"
83
82
  }