@ui5/builder 3.0.0-rc.0 → 3.0.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/.reuse/dep5 +2 -2
- package/CHANGELOG.md +8 -1
- package/LICENSE.txt +1 -1
- package/lib/processors/libraryLessGenerator.js +4 -30
- package/package.json +4 -4
package/.reuse/dep5
CHANGED
|
@@ -25,9 +25,9 @@ Disclaimer: The code in this project may include calls to APIs (“API Calls”)
|
|
|
25
25
|
parties the right to use of access any SAP External Product, through API Calls.
|
|
26
26
|
|
|
27
27
|
Files: *
|
|
28
|
-
Copyright: 2018-
|
|
28
|
+
Copyright: 2018-2023 SAP SE or an SAP affiliate company and UI5 Tooling contributors
|
|
29
29
|
License: Apache-2.0
|
|
30
30
|
|
|
31
31
|
Files: lib/processors/jsdoc/lib/*
|
|
32
|
-
Copyright: 2009-
|
|
32
|
+
Copyright: 2009-2023 SAP SE or an SAP affiliate company and OpenUI5 contributors
|
|
33
33
|
License: Apache-2.0
|
package/CHANGELOG.md
CHANGED
|
@@ -2,7 +2,13 @@
|
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
4
4
|
|
|
5
|
-
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v3.0.0-rc.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v3.0.0-rc.1...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v3.0.0-rc.1"></a>
|
|
8
|
+
## [v3.0.0-rc.1] - 2023-01-11
|
|
9
|
+
### Breaking Changes
|
|
10
|
+
- **libraryLessGenerator:** Throw error when import can't be inlined [`d2be9bb`](https://github.com/SAP/ui5-builder/commit/d2be9bb68600ec97b9bc007f348f87ad456fb5a3)
|
|
11
|
+
|
|
6
12
|
|
|
7
13
|
<a name="v3.0.0-rc.0"></a>
|
|
8
14
|
## [v3.0.0-rc.0] - 2022-12-23
|
|
@@ -831,6 +837,7 @@ to load the custom bundle file instead.
|
|
|
831
837
|
- Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
|
|
832
838
|
|
|
833
839
|
|
|
840
|
+
[v3.0.0-rc.1]: https://github.com/SAP/ui5-builder/compare/v3.0.0-rc.0...v3.0.0-rc.1
|
|
834
841
|
[v3.0.0-rc.0]: https://github.com/SAP/ui5-builder/compare/v3.0.0-beta.6...v3.0.0-rc.0
|
|
835
842
|
[v3.0.0-beta.6]: https://github.com/SAP/ui5-builder/compare/v3.0.0-beta.5...v3.0.0-beta.6
|
|
836
843
|
[v3.0.0-beta.5]: https://github.com/SAP/ui5-builder/compare/v3.0.0-beta.4...v3.0.0-beta.5
|
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 2018-
|
|
189
|
+
Copyright 2018-2023 SAP SE or an SAP affiliate company and UI5 Tooling contributors
|
|
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.
|
|
@@ -9,14 +9,6 @@ const IMPORT_PATTERN = /@import .*"(.*)";/g;
|
|
|
9
9
|
const BASE_LESS_PATTERN = /^\/resources\/sap\/ui\/core\/themes\/([^/]+)\/base\.less$/;
|
|
10
10
|
const GLOBAL_LESS_PATTERN = /^\/resources\/sap\/ui\/core\/themes\/([^/]+)\/global\.less$/;
|
|
11
11
|
|
|
12
|
-
class ImportError extends Error {
|
|
13
|
-
constructor(message) {
|
|
14
|
-
super();
|
|
15
|
-
this.name = "ImportError";
|
|
16
|
-
this.message = message;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
|
|
20
12
|
class LibraryLessGenerator {
|
|
21
13
|
constructor({fs}) {
|
|
22
14
|
const readFile = promisify(fs.readFile);
|
|
@@ -42,17 +34,7 @@ class LibraryLessGenerator {
|
|
|
42
34
|
const replacements = await Promise.all(imports.map(async (importMatch) => {
|
|
43
35
|
const baseDir = posixPath.dirname(filePath);
|
|
44
36
|
const resolvedFilePath = posixPath.resolve(baseDir, importMatch.path);
|
|
45
|
-
|
|
46
|
-
importMatch.content = await this.resolveLessImport(importMatch.path, resolvedFilePath, baseDir);
|
|
47
|
-
} catch (error) {
|
|
48
|
-
if (error instanceof ImportError) {
|
|
49
|
-
// Add message of import errors after the import statements
|
|
50
|
-
// Currently those errors should not break the build (see comments in resolveLessImport)
|
|
51
|
-
importMatch.content = importMatch.fullMatch + ` /* ${error} */`;
|
|
52
|
-
} else {
|
|
53
|
-
throw error;
|
|
54
|
-
}
|
|
55
|
-
}
|
|
37
|
+
importMatch.content = await this.resolveLessImport(importMatch.path, resolvedFilePath, baseDir);
|
|
56
38
|
return importMatch;
|
|
57
39
|
}));
|
|
58
40
|
|
|
@@ -97,26 +79,19 @@ class LibraryLessGenerator {
|
|
|
97
79
|
}
|
|
98
80
|
|
|
99
81
|
/*
|
|
100
|
-
*
|
|
82
|
+
* Throw error in case of files which are not in the same directory as the current file because
|
|
101
83
|
* inlining them would break relative URLs.
|
|
102
84
|
* A possible solution would be to rewrite relative URLs when inlining the content.
|
|
103
85
|
*
|
|
104
86
|
* Keeping the import will cause errors since only "library.less" and "global.less" are
|
|
105
87
|
* configured to be available to the Theme Designer (.theming generated in generateThemeDesignerResources).
|
|
106
|
-
* However, the previous implementation did not break the build.
|
|
107
|
-
* In many cases the library.less file is currently not relevant so breaking the build would cause
|
|
108
|
-
* unnecessary issues.
|
|
109
|
-
*
|
|
110
88
|
*/
|
|
111
89
|
const relativeFilePath = posixPath.relative(baseDir, resolvedFilePath);
|
|
112
90
|
if (relativeFilePath.includes(posixPath.sep)) {
|
|
113
|
-
|
|
91
|
+
throw new Error(
|
|
114
92
|
`Could not inline import '${resolvedFilePath}' outside of theme directory '${baseDir}'. ` +
|
|
115
|
-
`Stylesheets must be located in the theme directory (no sub-directories)
|
|
116
|
-
`The generated '${baseDir}/library.less' will cause errors when compiled with the Theme Designer.`
|
|
93
|
+
`Stylesheets must be located in the theme directory (no sub-directories).`
|
|
117
94
|
);
|
|
118
|
-
// Throw error to be added as comment to the import statement
|
|
119
|
-
throw new ImportError("Could not inline import outside of theme directory");
|
|
120
95
|
}
|
|
121
96
|
|
|
122
97
|
let importedFileContent;
|
|
@@ -145,7 +120,6 @@ class LibraryLessGenerator {
|
|
|
145
120
|
while ((match = IMPORT_PATTERN.exec(fileContent)) !== null) {
|
|
146
121
|
imports.push({
|
|
147
122
|
path: match[1],
|
|
148
|
-
fullMatch: match[0],
|
|
149
123
|
matchStart: match.index,
|
|
150
124
|
matchLength: match[0].length
|
|
151
125
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/builder",
|
|
3
|
-
"version": "3.0.0-rc.
|
|
3
|
+
"version": "3.0.0-rc.1",
|
|
4
4
|
"description": "UI5 Tooling - Builder",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -119,7 +119,7 @@
|
|
|
119
119
|
},
|
|
120
120
|
"dependencies": {
|
|
121
121
|
"@jridgewell/sourcemap-codec": "^1.4.14",
|
|
122
|
-
"@ui5/fs": "^3.0.0-rc.
|
|
122
|
+
"@ui5/fs": "^3.0.0-rc.1",
|
|
123
123
|
"@ui5/logger": "^3.0.1-rc.0",
|
|
124
124
|
"cheerio": "1.0.0-rc.12",
|
|
125
125
|
"escape-unicode": "^0.2.0",
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
},
|
|
138
138
|
"devDependencies": {
|
|
139
139
|
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
140
|
-
"@ui5/project": "^3.0.0-
|
|
140
|
+
"@ui5/project": "^3.0.0-rc.1",
|
|
141
141
|
"ava": "^5.1.0",
|
|
142
142
|
"chai": "^4.3.7",
|
|
143
143
|
"chai-fs": "^2.0.0",
|
|
@@ -145,7 +145,7 @@
|
|
|
145
145
|
"cross-env": "^7.0.3",
|
|
146
146
|
"depcheck": "^1.4.3",
|
|
147
147
|
"docdash": "^2.0.0",
|
|
148
|
-
"eslint": "^8.
|
|
148
|
+
"eslint": "^8.31.0",
|
|
149
149
|
"eslint-config-google": "^0.14.0",
|
|
150
150
|
"eslint-plugin-ava": "^13.2.0",
|
|
151
151
|
"eslint-plugin-jsdoc": "^39.6.4",
|