@ui5/builder 4.1.6 → 4.2.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 +15 -2
- package/README.md +1 -1
- package/lib/lbt/bundle/Resolver.js +9 -0
- package/lib/lbt/resources/ResourceFilterList.js +10 -0
- package/lib/processors/bundlers/flexChangesBundler.js +17 -6
- package/lib/processors/bundlers/moduleBundler.js +7 -1
- package/lib/tasks/bundlers/generateFlexChangesBundle.js +3 -1
- package/package.json +11 -13
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,22 @@
|
|
|
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/v4.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v4.2.0...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v4.2.0"></a>
|
|
8
|
+
## [v4.2.0] - 2026-06-15
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- **lbt/bundle/Resolver:** Ensure deterministic ordering of raw modules [`88953bc`](https://github.com/SAP/ui5-builder/commit/88953bc3fe727af0d9e2c540081f81bacc461939)
|
|
11
|
+
|
|
12
|
+
### Dependency Updates
|
|
13
|
+
- Bump workerpool from 9.3.4 to 10.0.2 ([#1216](https://github.com/SAP/ui5-builder/issues/1216)) [`e19bb00`](https://github.com/SAP/ui5-builder/commit/e19bb005536ee2c5facfc3f44a31c93712651dd6)
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
- **flexChangesBundler:** Add annotation changes in the flexibility-bundle [`880a091`](https://github.com/SAP/ui5-builder/commit/880a0917a7edd65c509b93f8ceb5c8810a5490ad)
|
|
17
|
+
|
|
6
18
|
|
|
7
19
|
<a name="v4.1.6"></a>
|
|
8
|
-
## [v4.1.6] - 2026-04-
|
|
20
|
+
## [v4.1.6] - 2026-04-20
|
|
9
21
|
### Bug Fixes
|
|
10
22
|
- **Bundler:** Also detect import.meta as ESM indicator [`58013d5`](https://github.com/SAP/ui5-builder/commit/58013d5a75e3fbf245b0042fb0b81f4e729a7a55)
|
|
11
23
|
- **Bundler:** Skip ESM modules during bundling and log errors [`d28f63a`](https://github.com/SAP/ui5-builder/commit/d28f63a6ace823d9fcfac23312c09e66be6fb7d4)
|
|
@@ -1027,6 +1039,7 @@ to load the custom bundle file instead.
|
|
|
1027
1039
|
|
|
1028
1040
|
### Features
|
|
1029
1041
|
- Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
|
|
1042
|
+
[v4.2.0]: https://github.com/SAP/ui5-builder/compare/v4.1.6...v4.2.0
|
|
1030
1043
|
[v4.1.6]: https://github.com/SAP/ui5-builder/compare/v4.1.5...v4.1.6
|
|
1031
1044
|
[v4.1.5]: https://github.com/SAP/ui5-builder/compare/v4.1.4...v4.1.5
|
|
1032
1045
|
[v4.1.4]: https://github.com/SAP/ui5-builder/compare/v4.1.3...v4.1.4
|
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
> Part of the [UI5 CLI](https://github.com/UI5/cli)
|
|
15
15
|
|
|
16
16
|
[](https://api.reuse.software/info/github.com/SAP/ui5-builder)
|
|
17
|
-
[](https://github.com/SAP/ui5-builder/actions/workflows/github-ci.yml)
|
|
18
18
|
[](https://www.npmjs.com/package/@ui5/builder)
|
|
19
19
|
[](https://coveralls.io/github/SAP/ui5-builder)
|
|
20
20
|
|
|
@@ -329,6 +329,15 @@ class BundleResolver {
|
|
|
329
329
|
return collectModulesForSection(section).
|
|
330
330
|
then( (modules) => {
|
|
331
331
|
if ( section.mode == SectionType.Raw && section.sort !== false ) {
|
|
332
|
+
// Sort modules by their filter definition order to ensure
|
|
333
|
+
// deterministic input for the topological sort.
|
|
334
|
+
// Topological sort preserves input order for tie-breaking,
|
|
335
|
+
// so this ensures modules at the same dependency level
|
|
336
|
+
// appear in the order defined by the section filters.
|
|
337
|
+
const filterOrder = new ResourceFilterList(section.filters, fileTypes);
|
|
338
|
+
modules.sort((a, b) => {
|
|
339
|
+
return filterOrder.matchIndex(a) - filterOrder.matchIndex(b);
|
|
340
|
+
});
|
|
332
341
|
// sort the modules in topological order
|
|
333
342
|
return topologicalSort(pool, modules).then( (modules) => {
|
|
334
343
|
log.silly(` Resolved modules (sorted): ${modules}`);
|
|
@@ -124,6 +124,16 @@ export default class ResourceFilterList {
|
|
|
124
124
|
);
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
+
matchIndex(candidate) {
|
|
128
|
+
for (let i = 0; i < this.matchers.length; i++) {
|
|
129
|
+
const matcher = this.matchers[i];
|
|
130
|
+
if (matcher.include && matcher.calcMatch(candidate, false)) {
|
|
131
|
+
return i;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
return this.matchers.length;
|
|
135
|
+
}
|
|
136
|
+
|
|
127
137
|
toString() {
|
|
128
138
|
return this.matchers.map((matcher) => matcher.pattern).join(",");
|
|
129
139
|
}
|
|
@@ -18,8 +18,8 @@ import {createResource} from "@ui5/fs/resourceFactory";
|
|
|
18
18
|
* @param {@ui5/fs/Resource[]} parameters.resources List of resources to be processed
|
|
19
19
|
* @param {object} parameters.options Options
|
|
20
20
|
* @param {string} parameters.options.pathPrefix Prefix for bundle path
|
|
21
|
-
* @param {string} parameters.options.hasFlexBundleVersion true if minUI5Version >= 1.73
|
|
22
|
-
* create flexibility-bundle.json
|
|
21
|
+
* @param {string} parameters.options.hasFlexBundleVersion true if minUI5Version >= 1.73
|
|
22
|
+
* and create flexibility-bundle.json
|
|
23
23
|
* @param {object} [parameters.existingFlexBundle={}] Object with existing flexibility-bundle.json
|
|
24
24
|
* to merge with new changes
|
|
25
25
|
* @returns {Promise<@ui5/fs/Resource[]>} Promise resolving with flex changes bundle resources
|
|
@@ -45,6 +45,7 @@ export default function({resources, options: {pathPrefix, hasFlexBundleVersion},
|
|
|
45
45
|
const variants = [];
|
|
46
46
|
const variantChanges = [];
|
|
47
47
|
const variantManagementChanges = [];
|
|
48
|
+
const annotationChanges = [];
|
|
48
49
|
|
|
49
50
|
changesContent.forEach(function(content) {
|
|
50
51
|
if (content.layer === "VENDOR") {
|
|
@@ -74,14 +75,23 @@ export default function({resources, options: {pathPrefix, hasFlexBundleVersion},
|
|
|
74
75
|
case "ctrl_variant_management_change":
|
|
75
76
|
variantManagementChanges.push(content);
|
|
76
77
|
break;
|
|
78
|
+
case "annotation_change":
|
|
79
|
+
annotationChanges.push(content);
|
|
80
|
+
break;
|
|
77
81
|
}
|
|
78
82
|
});
|
|
79
83
|
|
|
80
|
-
if (!hasFlexBundleVersion && (
|
|
81
|
-
|
|
84
|
+
if (!hasFlexBundleVersion && (
|
|
85
|
+
compVariants.length != 0 ||
|
|
86
|
+
variants.length != 0 ||
|
|
87
|
+
variantChanges.length != 0 ||
|
|
88
|
+
variantDependentControlChanges.length != 0 ||
|
|
89
|
+
variantManagementChanges.length != 0 ||
|
|
90
|
+
annotationChanges.length != 0
|
|
91
|
+
)) {
|
|
82
92
|
throw new Error(
|
|
83
|
-
"There are some
|
|
84
|
-
"
|
|
93
|
+
"There are some files in the changes folder supported only with a UI5 version 1.73 and above. " +
|
|
94
|
+
"Please update the minUI5Version in the manifest.json to 1.73 or higher");
|
|
85
95
|
}
|
|
86
96
|
// create changes-bundle.json
|
|
87
97
|
if (!hasFlexBundleVersion) {
|
|
@@ -89,6 +99,7 @@ export default function({resources, options: {pathPrefix, hasFlexBundleVersion},
|
|
|
89
99
|
} else {
|
|
90
100
|
bundleName = "flexibility-bundle.json";
|
|
91
101
|
let newChangeFormat = {
|
|
102
|
+
annotationChanges,
|
|
92
103
|
changes,
|
|
93
104
|
compVariants,
|
|
94
105
|
variants,
|
|
@@ -45,12 +45,18 @@ const log = getLogger("builder:processors:bundlers:moduleBundler");
|
|
|
45
45
|
* the module itself.
|
|
46
46
|
* This requires the ui5loader to be available at build time and UI5 version 1.74.0 or higher at runtime.
|
|
47
47
|
* </li>
|
|
48
|
+
* <li>
|
|
49
|
+
* <code>depCache</code>: A 'depCache' section is transformed into a `sap.ui.loader.config` call that maps
|
|
50
|
+
* module names to their respective dependencies (including declarative views/fragments).
|
|
51
|
+
* This requires the ui5loader to be available at build time.
|
|
52
|
+
* </li>
|
|
48
53
|
* </ul>
|
|
49
54
|
* </p>
|
|
50
55
|
*
|
|
51
56
|
* @public
|
|
52
57
|
* @typedef {object} ModuleBundleDefinitionSection
|
|
53
|
-
* @property {string} mode The embedding mode. Either 'provided', 'raw', 'preload', 'require'
|
|
58
|
+
* @property {string} mode The embedding mode. Either 'provided', 'raw', 'preload', 'require', 'bundleInfo'
|
|
59
|
+
* or 'depCache'
|
|
54
60
|
* @property {string[]} filters List of modules declared as glob patterns (resource name patterns) that should be
|
|
55
61
|
* in- or excluded.
|
|
56
62
|
* A pattern ending with a slash '/' will, similarly to the use of a single '*' or double '**' asterisk,
|
|
@@ -95,7 +95,9 @@ export default async function({workspace, taskUtil, options = {}}) {
|
|
|
95
95
|
|
|
96
96
|
log.verbose("Collecting flexibility changes");
|
|
97
97
|
const allResources = await workspace.byGlob(
|
|
98
|
-
|
|
98
|
+
pathPrefix + "/changes/*.{annotation_change,change,variant,ctrl_variant," +
|
|
99
|
+
"ctrl_variant_change,ctrl_variant_management_change}"
|
|
100
|
+
);
|
|
99
101
|
|
|
100
102
|
let bBundleCreated = false;
|
|
101
103
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/builder",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "UI5 CLI - Builder",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -34,15 +34,12 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"test": "npm run lint && npm run jsdoc-generate && npm run coverage",
|
|
37
|
-
"test-azure": "npm run coverage-xunit",
|
|
38
37
|
"lint": "eslint ./",
|
|
39
38
|
"unit": "rimraf test/tmp && ava",
|
|
40
39
|
"unit-verbose": "rimraf test/tmp && cross-env UI5_LOG_LVL=verbose ava --verbose --serial",
|
|
41
40
|
"unit-watch": "rimraf test/tmp && ava --watch",
|
|
42
|
-
"unit-xunit": "rimraf test/tmp && ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\" --tap --timeout=1m | tap-xunit --dontUseCommentsAsTestNames=true > test-results.xml",
|
|
43
41
|
"unit-inspect": "cross-env UI5_LOG_LVL=verbose ava debug --break",
|
|
44
42
|
"coverage": "rimraf test/tmp && nyc ava --node-arguments=\"--experimental-loader=@istanbuljs/esm-loader-hook\"",
|
|
45
|
-
"coverage-xunit": "nyc --reporter=text --reporter=text-summary --reporter=cobertura npm run unit-xunit",
|
|
46
43
|
"jsdoc": "npm run jsdoc-generate && open-cli jsdocs/index.html",
|
|
47
44
|
"jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(npm ls docdash --parseable | head -1) ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
|
|
48
45
|
"jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
|
|
@@ -50,7 +47,8 @@
|
|
|
50
47
|
"version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md v4.0.0.. && git add CHANGELOG.md",
|
|
51
48
|
"prepublishOnly": "git push --follow-tags",
|
|
52
49
|
"release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
|
|
53
|
-
"knip": "knip --config knip.config.js"
|
|
50
|
+
"knip": "knip --config knip.config.js",
|
|
51
|
+
"check-engine": "check-engine-light ."
|
|
54
52
|
},
|
|
55
53
|
"files": [
|
|
56
54
|
"CHANGELOG.md",
|
|
@@ -123,7 +121,7 @@
|
|
|
123
121
|
},
|
|
124
122
|
"dependencies": {
|
|
125
123
|
"@jridgewell/sourcemap-codec": "^1.5.5",
|
|
126
|
-
"@ui5/fs": "^4.0.
|
|
124
|
+
"@ui5/fs": "^4.0.6",
|
|
127
125
|
"@ui5/logger": "^4.0.2",
|
|
128
126
|
"cheerio": "1.0.0",
|
|
129
127
|
"escape-unicode": "^0.3.0",
|
|
@@ -133,17 +131,18 @@
|
|
|
133
131
|
"jsdoc": "^4.0.5",
|
|
134
132
|
"less-openui5": "^0.11.6",
|
|
135
133
|
"pretty-data": "^0.40.0",
|
|
136
|
-
"semver": "^7.
|
|
137
|
-
"terser": "^5.
|
|
138
|
-
"workerpool": "^
|
|
134
|
+
"semver": "^7.8.4",
|
|
135
|
+
"terser": "^5.48.0",
|
|
136
|
+
"workerpool": "^10.0.2",
|
|
139
137
|
"xml2js": "^0.6.2"
|
|
140
138
|
},
|
|
141
139
|
"devDependencies": {
|
|
142
140
|
"@eslint/js": "^9.14.0",
|
|
143
141
|
"@istanbuljs/esm-loader-hook": "^0.3.0",
|
|
144
142
|
"@jridgewell/trace-mapping": "^0.3.31",
|
|
145
|
-
"@ui5/project": "^4.0.
|
|
143
|
+
"@ui5/project": "^4.0.16",
|
|
146
144
|
"ava": "^6.4.1",
|
|
145
|
+
"check-engine-light": "0.4.0",
|
|
147
146
|
"chokidar-cli": "^3.0.0",
|
|
148
147
|
"cross-env": "^10.1.0",
|
|
149
148
|
"docdash": "^2.0.2",
|
|
@@ -151,14 +150,13 @@
|
|
|
151
150
|
"eslint-config-google": "^0.14.0",
|
|
152
151
|
"eslint-plugin-ava": "^15.1.0",
|
|
153
152
|
"eslint-plugin-jsdoc": "61.5.0",
|
|
154
|
-
"esmock": "^2.7.
|
|
153
|
+
"esmock": "^2.7.6",
|
|
155
154
|
"globals": "^16.5.0",
|
|
156
155
|
"knip": "^5.88.1",
|
|
157
156
|
"line-column": "^1.0.2",
|
|
158
157
|
"nyc": "^17.1.0",
|
|
159
158
|
"open-cli": "^8.0.0",
|
|
160
159
|
"rimraf": "^6.1.3",
|
|
161
|
-
"sinon": "^21.1.2"
|
|
162
|
-
"tap-xunit": "^2.4.1"
|
|
160
|
+
"sinon": "^21.1.2"
|
|
163
161
|
}
|
|
164
162
|
}
|