less-openui5 0.11.6 → 0.11.7

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/CONTRIBUTING.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Contributing to less-openui5
2
2
 
3
3
  In general the contributing guidelines of OpenUI5 also apply to this project. They can be found here:
4
- https://github.com/SAP/openui5/blob/master/CONTRIBUTING.md
4
+ https://github.com/SAP/openui5/blob/-/CONTRIBUTING.md
5
5
 
6
6
  Some parts might not be relevant for this project (e.g. the browser-specific requirements like jQuery, CSS and accessibility in the "Contribution Content Guidelines") and the contribution process is easier (pull requests will be merged directly on GitHub).
7
+
8
+ # Contributing with AI-generated code
9
+ As artificial intelligence evolves, AI-generated code is becoming valuable for many software projects, including open-source initiatives. While we recognize the potential benefits of incorporating AI-generated content into our open-source projects there are certain requirements that need to be reflected and adhered to when making contributions.
10
+
11
+ Please see our [guideline for AI-generated code contributions to SAP Open Source Software Projects](https://github.com/SAP/.github/blob/main/CONTRIBUTING_USING_GENAI.md) for these requirements.
package/LICENSE.txt CHANGED
@@ -186,7 +186,7 @@
186
186
  same "printed page" as the copyright notice for easier
187
187
  identification within third-party archives.
188
188
 
189
- Copyright 2023 SAP SE or an SAP affiliate company.
189
+ Copyright [yyyy] [name of copyright owner]
190
190
 
191
191
  Licensed under the Apache License, Version 2.0 (the "License");
192
192
  you may not use this file except in compliance with the License.
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  ![OpenUI5](http://openui5.org/images/OpenUI5_new_big_side.png)
2
2
 
3
3
  [![REUSE status](https://api.reuse.software/badge/github.com/SAP/less-openui5)](https://api.reuse.software/info/github.com/SAP/less-openui5)
4
- [![Build Status](http://img.shields.io/travis/SAP/less-openui5.svg?style=flat)](https://travis-ci.org/SAP/less-openui5)
4
+ [![GitHub CI](https://github.com/SAP/less-openui5/actions/workflows/github-ci.yml/badge.svg)](https://github.com/SAP/less-openui5/actions/workflows/github-ci.yml)
5
5
  [![NPM Version](http://img.shields.io/npm/v/less-openui5.svg?style=flat)](https://www.npmjs.org/package/less-openui5)
6
6
 
7
7
  # less-openui5
package/lib/Compiler.js CHANGED
@@ -1,6 +1,5 @@
1
1
  const path = require("path");
2
2
  const createParser = require("./less/parser");
3
- const clone = require("clone");
4
3
 
5
4
  // Plugins
6
5
  const ImportCollectorPlugin = require("./plugin/import-collector");
@@ -56,7 +55,7 @@ class Compiler {
56
55
  };
57
56
  }
58
57
  async compile(config) {
59
- const parserOptions = clone(this.options.parser);
58
+ const parserOptions = structuredClone(this.options.parser);
60
59
  let rootpath;
61
60
 
62
61
  if (config.path) {
package/lib/plugin/rtl.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  const less = require("../thirdparty/less");
4
4
  const path = require("path");
5
- const url = require("url");
5
+ const {isAbsoluteUrl} = require("./util");
6
6
 
7
7
  const cssSizePattern = /(-?[.0-9]+)([a-z]*)/;
8
8
  const percentagePattern = /^\s*(-?[.0-9]+)%\s*$/;
@@ -619,9 +619,8 @@ LessRtlPlugin.prototype = {
619
619
  }
620
620
  modifyOnce(node, "replaceUrl", (urlNode) => {
621
621
  const imgPath = urlNode.value.value;
622
- const parsedUrl = url.parse(imgPath);
623
- if (parsedUrl.protocol || imgPath.startsWith("/")) {
624
- // Ignore absolute urls
622
+ if (isAbsoluteUrl(imgPath)) {
623
+ // Ignore urls with a scheme (http:, data:, etc.) and server-absolute urls.
625
624
  return;
626
625
  }
627
626
  const imgPathRTL = LessRtlPlugin.getRtlImgUrl(imgPath);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
3
  const path = require("path");
4
- const url = require("url");
5
4
  const less = require("../thirdparty/less");
5
+ const {isAbsoluteUrl} = require("./util");
6
6
 
7
7
  const urlNodeNames = {
8
8
  "background": true,
@@ -48,10 +48,8 @@ UrlCollectorPlugin.prototype = {
48
48
  if (node.type === "Url") {
49
49
  const relativeUrl = node.value.value;
50
50
 
51
- const parsedUrl = url.parse(relativeUrl);
52
- // Ignore urls with protocol (also includes data urls)
53
- // Ignore server absolute urls
54
- if (parsedUrl.protocol || relativeUrl.startsWith("/")) {
51
+ // Ignore urls with a scheme (http:, data:, etc.) and server-absolute urls.
52
+ if (isAbsoluteUrl(relativeUrl)) {
55
53
  return;
56
54
  }
57
55
 
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * Checks whether a CSS url() value should be treated as absolute, i.e. must not be resolved
5
+ * relative to the current file. This covers urls carrying a scheme (http:, https:, data:, ...)
6
+ * as well as server-absolute urls starting with "/".
7
+ *
8
+ * URL.canParse only succeeds for absolute urls (those with a scheme), so relative urls return
9
+ * false.
10
+ *
11
+ * @param {string} value the url value as taken from the CSS url() node
12
+ * @returns {boolean} true if the url is absolute and should not be resolved relatively
13
+ */
14
+ function isAbsoluteUrl(value) {
15
+ return URL.canParse(value) || value.startsWith("/");
16
+ }
17
+
18
+ module.exports = {
19
+ isAbsoluteUrl
20
+ };
@@ -39,6 +39,7 @@ VariableCollector.prototype = {
39
39
  filename: node.currentFileInfo.filename,
40
40
  rootFilename: node.currentFileInfo.rootFilename
41
41
  };
42
+ // eslint-disable-next-line no-unused-vars
42
43
  } catch (err) {
43
44
  // Errors might occur within mixins.
44
45
  // But as we only collect global variables, this doesn't matter...
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "less-openui5",
3
- "version": "0.11.6",
3
+ "version": "0.11.7",
4
4
  "description": "Build OpenUI5 themes with Less.js",
5
5
  "author": {
6
6
  "name": "SAP SE",
@@ -18,20 +18,20 @@
18
18
  ],
19
19
  "main": "lib/index.js",
20
20
  "engines": {
21
- "node": ">= 10",
22
- "npm": ">= 5"
21
+ "node": "^20.11.0 || >=22.0.0",
22
+ "npm": ">= 8"
23
23
  },
24
24
  "scripts": {
25
25
  "lint": "eslint ./",
26
26
  "unit": "mocha test/*.js test/lib/**",
27
27
  "unit-debug": "mocha --inspect --inspect-brk test/*.js test/lib/**",
28
28
  "coverage": "nyc npm run unit",
29
- "test": "npm run lint && npm run coverage && npm run depcheck",
29
+ "test": "npm run lint && npm run coverage && npm run knip",
30
30
  "preversion": "npm test",
31
31
  "version": "git-chglog --next-tag v$npm_package_version -o CHANGELOG.md 0.7.0.. && git add CHANGELOG.md",
32
- "postversion": "git push --follow-tags",
32
+ "prepublishOnly": "git push --follow-tags",
33
33
  "release-note": "git-chglog -c .chglog/release-config.yml v$npm_package_version",
34
- "depcheck": "depcheck --ignores clean-css,source-map"
34
+ "knip": "knip --config knip.config.js"
35
35
  },
36
36
  "files": [
37
37
  "CONTRIBUTING.md",
@@ -49,7 +49,8 @@
49
49
  "coverage/**",
50
50
  "test/**",
51
51
  ".eslintrc.js",
52
- "lib/thirdparty/**"
52
+ "lib/thirdparty/**",
53
+ "knip.config.js"
53
54
  ],
54
55
  "check-coverage": true,
55
56
  "statements": 95,
@@ -82,17 +83,19 @@
82
83
  "url": "git@github.com:SAP/less-openui5.git"
83
84
  },
84
85
  "dependencies": {
85
- "@adobe/css-tools": "^4.0.2",
86
- "clone": "^2.1.2",
86
+ "@adobe/css-tools": "^4.5.0",
87
87
  "mime": "^1.6.0"
88
88
  },
89
89
  "devDependencies": {
90
- "depcheck": "^1.4.3",
91
- "eslint": "^7.32.0",
90
+ "@eslint/js": "^9.15.0",
91
+ "eslint": "^9.39.5",
92
92
  "eslint-config-google": "^0.14.0",
93
- "graceful-fs": "^4.2.10",
94
- "mocha": "^8.4.0",
95
- "nyc": "^15.1.0",
96
- "sinon": "^11.1.2"
93
+ "eslint-plugin-jsdoc": "61.5.0",
94
+ "globals": "^17.7.0",
95
+ "graceful-fs": "^4.2.11",
96
+ "knip": "^5.88.1",
97
+ "mocha": "^11.7.6",
98
+ "nyc": "^18.0.0",
99
+ "sinon": "^16.1.3"
97
100
  }
98
101
  }
package/.reuse/dep5 DELETED
@@ -1,33 +0,0 @@
1
- Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
2
- Upstream-Name: less-openui5
3
- Upstream-Contact: SAP OpenUI5 <openui5@sap.com>
4
- Source: https://github.com/SAP/less-openui5
5
- Disclaimer: The code in this project may include calls to APIs (“API Calls”) of
6
- SAP or third-party products or services developed outside of this project
7
- (“External Products”).
8
- “APIs” means application programming interfaces, as well as their respective
9
- specifications and implementing code that allows software to communicate with
10
- other software.
11
- API Calls to External Products are not licensed under the open source license
12
- that governs this project. The use of such API Calls and related External
13
- Products are subject to applicable additional agreements with the relevant
14
- provider of the External Products. In no event shall the open source license
15
- that governs this project grant any rights in or to any External Products,or
16
- alter, expand or supersede any terms of the applicable additional agreements.
17
- If you have a valid license agreement with SAP for the use of a particular SAP
18
- External Product, then you may make use of any API Calls included in this
19
- project’s code for that SAP External Product, subject to the terms of such
20
- license agreement. If you do not have a valid license agreement for the use of
21
- a particular SAP External Product, then you may only make use of any API Calls
22
- in this project for that SAP External Product for your internal, non-productive
23
- and non-commercial test and evaluation of such API Calls. Nothing herein grants
24
- you any rights to use or access any SAP External Product, or provide any third
25
- parties the right to use of access any SAP External Product, through API Calls.
26
-
27
- Files: *
28
- Copyright: 2016-2023 SAP SE or an SAP affiliate company and less-openui5 contributors
29
- License: Apache-2.0
30
-
31
- Files: lib/thirdparty/less/*
32
- Copyright: Copyright (c) 2009-2014 Alexis Sellier & The Core Less Team
33
- License: Apache-2.0