@ui5/builder 2.11.0 → 2.11.4
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 +31 -2
- package/lib/builder/ProjectBuildContext.js +2 -0
- package/lib/lbt/bundle/Builder.js +6 -0
- package/lib/processors/manifestCreator.js +1 -1
- package/lib/tasks/TaskUtil.js +2 -0
- package/lib/tasks/buildThemes.js +6 -2
- package/lib/tasks/bundlers/generateFlexChangesBundle.js +3 -2
- package/lib/tasks/bundlers/generateLibraryPreload.js +49 -49
- package/lib/types/application/ApplicationBuilder.js +3 -1
- package/lib/types/library/LibraryBuilder.js +1 -1
- package/lib/types/themeLibrary/ThemeLibraryBuilder.js +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -2,10 +2,35 @@
|
|
|
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/v2.11.
|
|
5
|
+
A list of unreleased changes can be found [here](https://github.com/SAP/ui5-builder/compare/v2.11.4...HEAD).
|
|
6
|
+
|
|
7
|
+
<a name="v2.11.4"></a>
|
|
8
|
+
## [v2.11.4] - 2022-02-21
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
- **generateFlexChangesBundle:** Fix minUI5Version check for UI5 v1.100.0+ ([#706](https://github.com/SAP/ui5-builder/issues/706)) [`fb1217a`](https://github.com/SAP/ui5-builder/commit/fb1217ac536c20da81526f82f2ecb03686815942)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
<a name="v2.11.3"></a>
|
|
14
|
+
## [v2.11.3] - 2021-12-14
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
- Enable buildThemes for libraries without .library [`7b941a7`](https://github.com/SAP/ui5-builder/commit/7b941a797210463a9fa8ca50753662c5db373aa6)
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
<a name="v2.11.2"></a>
|
|
20
|
+
## [v2.11.2] - 2021-11-17
|
|
21
|
+
### Bug Fixes
|
|
22
|
+
- **Builder:** Emit warning on bundleInfo name without extension [`ed0da12`](https://github.com/SAP/ui5-builder/commit/ed0da123ac084d126a28f0f34d9740c310d91902)
|
|
23
|
+
- **manifestCreator:** Trim whitespace/new-lines for sap.app/title [`019cfd7`](https://github.com/SAP/ui5-builder/commit/019cfd7031a2bd63ce93801ad027413151a3b060)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
<a name="v2.11.1"></a>
|
|
27
|
+
## [v2.11.1] - 2021-10-19
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
- Minification excludes for application projects [`7f6fd68`](https://github.com/SAP/ui5-builder/commit/7f6fd68e1aed9131896723f1231816287eaf2fce)
|
|
30
|
+
|
|
6
31
|
|
|
7
32
|
<a name="v2.11.0"></a>
|
|
8
|
-
## [v2.11.0] - 2021-10-
|
|
33
|
+
## [v2.11.0] - 2021-10-19
|
|
9
34
|
### Bug Fixes
|
|
10
35
|
- **manifestCreator:** supportedThemes should only list relevant themes [`01f3859`](https://github.com/SAP/ui5-builder/commit/01f3859070b6955b9824b0949e633c6d40244633)
|
|
11
36
|
|
|
@@ -620,6 +645,10 @@ to load the custom bundle file instead.
|
|
|
620
645
|
- Add ability to configure component preloads and custom bundles [`2241e5f`](https://github.com/SAP/ui5-builder/commit/2241e5ff98fd95f1f80cc74959655ae7a9c660e7)
|
|
621
646
|
|
|
622
647
|
|
|
648
|
+
[v2.11.4]: https://github.com/SAP/ui5-builder/compare/v2.11.3...v2.11.4
|
|
649
|
+
[v2.11.3]: https://github.com/SAP/ui5-builder/compare/v2.11.2...v2.11.3
|
|
650
|
+
[v2.11.2]: https://github.com/SAP/ui5-builder/compare/v2.11.1...v2.11.2
|
|
651
|
+
[v2.11.1]: https://github.com/SAP/ui5-builder/compare/v2.11.0...v2.11.1
|
|
623
652
|
[v2.11.0]: https://github.com/SAP/ui5-builder/compare/v2.10.0...v2.11.0
|
|
624
653
|
[v2.10.0]: https://github.com/SAP/ui5-builder/compare/v2.9.5...v2.10.0
|
|
625
654
|
[v2.9.5]: https://github.com/SAP/ui5-builder/compare/v2.9.4...v2.9.5
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
const ResourceTagCollection = require("@ui5/fs").ResourceTagCollection;
|
|
2
2
|
|
|
3
|
+
// Note: When adding standard tags, always update the public documentation in TaskUtil
|
|
4
|
+
// (Type "module:@ui5/builder.tasks.TaskUtil~StandardBuildTags")
|
|
3
5
|
const STANDARD_TAGS = Object.freeze({
|
|
4
6
|
OmitFromBuildResult: "ui5:OmitFromBuildResult",
|
|
5
7
|
IsBundle: "ui5:IsBundle"
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// for consistency of write calls, we generally allow template literals
|
|
3
3
|
"use strict";
|
|
4
4
|
|
|
5
|
+
const path = require("path");
|
|
5
6
|
const terser = require("terser");
|
|
6
7
|
const {pd} = require("pretty-data");
|
|
7
8
|
const {parseJS, Syntax} = require("../utils/parseUtils");
|
|
@@ -486,6 +487,11 @@ class BundleBuilder {
|
|
|
486
487
|
if (!section.name) {
|
|
487
488
|
throw new Error(`A 'bundleInfo' section is missing the mandatory 'name' property.` );
|
|
488
489
|
}
|
|
490
|
+
if (!path.extname(section.name)) {
|
|
491
|
+
log.warn(`bundleInfo section name '${section.name}' is missing a file extension. ` +
|
|
492
|
+
`The info might not work as expected. ` +
|
|
493
|
+
`The name must match the bundle filename (incl. extension such as '.js')`);
|
|
494
|
+
}
|
|
489
495
|
this.outW.write(`"${section.name}":[${section.modules.map(makeStringLiteral).join(",")}]`);
|
|
490
496
|
});
|
|
491
497
|
this.outW.writeln();
|
|
@@ -237,7 +237,7 @@ async function createManifest(libraryResource, libBundle, descriptorVersion, _in
|
|
|
237
237
|
if ( library.getDocumentation() ) {
|
|
238
238
|
let desc = library.getDocumentation();
|
|
239
239
|
// remove all tags
|
|
240
|
-
desc = desc.replace(
|
|
240
|
+
desc = desc.replace(/\s+/g, " ").replace(/<\/?[a-zA-Z][a-zA-Z0-9_$.]*(\s[^>]*)>/g, "");
|
|
241
241
|
// extract summary (first sentence)
|
|
242
242
|
const m = /^([\w\W]+?[.;!?])[^a-zA-Z0-9_$]/.exec(desc);
|
|
243
243
|
return m ? m[1] : desc;
|
package/lib/tasks/TaskUtil.js
CHANGED
|
@@ -20,6 +20,8 @@ class TaskUtil {
|
|
|
20
20
|
* @typedef {object} module:@ui5/builder.tasks.TaskUtil~StandardBuildTags
|
|
21
21
|
* @property {string} OmitFromBuildResult
|
|
22
22
|
* Setting this tag to true for a resource will prevent it from being written to the build target
|
|
23
|
+
* @property {string} IsBundle
|
|
24
|
+
* This tag identifies resources that contain (i.e. bundle) multiple other resources
|
|
23
25
|
*/
|
|
24
26
|
|
|
25
27
|
/**
|
package/lib/tasks/buildThemes.js
CHANGED
|
@@ -54,8 +54,12 @@ module.exports = async function({
|
|
|
54
54
|
*/
|
|
55
55
|
let availableLibraries;
|
|
56
56
|
if (pAvailableLibraries) {
|
|
57
|
-
availableLibraries =
|
|
58
|
-
|
|
57
|
+
availableLibraries = [];
|
|
58
|
+
(await pAvailableLibraries).forEach((resource) => {
|
|
59
|
+
const library = path.dirname(resource.getPath());
|
|
60
|
+
if (!availableLibraries.includes(library)) {
|
|
61
|
+
availableLibraries.push(library);
|
|
62
|
+
}
|
|
59
63
|
});
|
|
60
64
|
}
|
|
61
65
|
let availableThemes;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
const log = require("@ui5/logger").getLogger("builder:tasks:bundlers:generateFlexChangesBundle");
|
|
2
2
|
const flexChangesBundler = require("../../processors/bundlers/flexChangesBundler");
|
|
3
|
+
const semver = require("semver");
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Task to create changesBundle.json file containing all changes stored in the /changes folder for easier consumption
|
|
@@ -68,9 +69,9 @@ module.exports = async function({workspace, taskUtil, options: {namespace}}) {
|
|
|
68
69
|
const allResources = await workspace.byGlob(
|
|
69
70
|
`${pathPrefix}/changes/*.{change,variant,ctrl_variant,ctrl_variant_change,ctrl_variant_management_change}`);
|
|
70
71
|
if (allResources.length > 0) {
|
|
71
|
-
const version = await readManifestMinUI5Version();
|
|
72
|
+
const version = semver.coerce(await readManifestMinUI5Version());
|
|
72
73
|
let hasFlexBundleVersion = false;
|
|
73
|
-
if (
|
|
74
|
+
if (semver.compare(version, "1.73.0") >= 0) {
|
|
74
75
|
hasFlexBundleVersion = true;
|
|
75
76
|
}
|
|
76
77
|
const processedResources = await flexChangesBundler({
|
|
@@ -280,59 +280,59 @@ module.exports = function({workspace, dependencies, taskUtil, options: {projectN
|
|
|
280
280
|
return combo.byGlob("/**/*.{js,json,xml,html,properties,library}").then((resources) => {
|
|
281
281
|
// Find all libraries and create a library-preload.js bundle
|
|
282
282
|
|
|
283
|
-
let p;
|
|
283
|
+
let p = Promise.resolve();
|
|
284
284
|
|
|
285
|
-
// Create
|
|
286
|
-
//
|
|
285
|
+
// Create core bundles for older versions (<1.97.0) which don't define bundle configuration in the ui5.yaml
|
|
286
|
+
// See: https://github.com/SAP/openui5/commit/ff127fd2d009162ea43ad312dec99d759ebc23a0
|
|
287
287
|
if (projectName === "sap.ui.core") {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
filters
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
moduleBundler({
|
|
310
|
-
options: getModuleBundlerOptions({name: "sap-ui-core-dbg.js", filters, preload: false}),
|
|
311
|
-
resources
|
|
312
|
-
}),
|
|
313
|
-
moduleBundler({
|
|
314
|
-
options: getModuleBundlerOptions({
|
|
315
|
-
name: "sap-ui-core-nojQuery.js", filters, preload: true, provided: true
|
|
288
|
+
const coreProject = resources[0]._project;
|
|
289
|
+
const coreSpecVersion = coreProject && coreProject.specVersion;
|
|
290
|
+
// Instead of checking the sap.ui.core library version, the specVersion is checked against all versions
|
|
291
|
+
// that have been defined for sap.ui.core before the bundle configuration has been introduced.
|
|
292
|
+
// This is mainly to have an easier check without version parsing or using semver.
|
|
293
|
+
// If no project/specVersion is available, the bundles should also be created to not break potential
|
|
294
|
+
// existing use cases without a properly formed/formatted project tree.
|
|
295
|
+
if (!coreSpecVersion || ["0.1", "1.1", "2.0"].includes(coreSpecVersion)) {
|
|
296
|
+
const isEvo = resources.find((resource) => {
|
|
297
|
+
return resource.getPath() === "/resources/ui5loader.js";
|
|
298
|
+
});
|
|
299
|
+
let filters;
|
|
300
|
+
if (isEvo) {
|
|
301
|
+
filters = ["ui5loader-autoconfig.js"];
|
|
302
|
+
} else {
|
|
303
|
+
filters = ["jquery.sap.global.js"];
|
|
304
|
+
}
|
|
305
|
+
p = Promise.all([
|
|
306
|
+
moduleBundler({
|
|
307
|
+
options: getModuleBundlerOptions({name: "sap-ui-core.js", filters, preload: true}),
|
|
308
|
+
resources
|
|
316
309
|
}),
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
options: getModuleBundlerOptions({
|
|
321
|
-
name: "sap-ui-core-nojQuery-dbg.js", filters, preload: false, provided: true
|
|
310
|
+
moduleBundler({
|
|
311
|
+
options: getModuleBundlerOptions({name: "sap-ui-core-dbg.js", filters, preload: false}),
|
|
312
|
+
resources
|
|
322
313
|
}),
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
314
|
+
moduleBundler({
|
|
315
|
+
options: getModuleBundlerOptions({
|
|
316
|
+
name: "sap-ui-core-nojQuery.js", filters, preload: true, provided: true
|
|
317
|
+
}),
|
|
318
|
+
resources
|
|
319
|
+
}),
|
|
320
|
+
moduleBundler({
|
|
321
|
+
options: getModuleBundlerOptions({
|
|
322
|
+
name: "sap-ui-core-nojQuery-dbg.js", filters, preload: false, provided: true
|
|
323
|
+
}),
|
|
324
|
+
resources
|
|
325
|
+
}),
|
|
326
|
+
]).then((results) => {
|
|
327
|
+
const bundles = Array.prototype.concat.apply([], results);
|
|
328
|
+
return Promise.all(bundles.map((bundle) => {
|
|
329
|
+
if (taskUtil) {
|
|
330
|
+
taskUtil.setTag(bundle, taskUtil.STANDARD_TAGS.IsBundle);
|
|
331
|
+
}
|
|
332
|
+
return workspace.write(bundle);
|
|
333
|
+
}));
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
336
|
}
|
|
337
337
|
|
|
338
338
|
return p.then(() => {
|
|
@@ -143,7 +143,9 @@ class ApplicationBuilder extends AbstractBuilder {
|
|
|
143
143
|
const minificationExcludes = project.builder && project.builder.minification &&
|
|
144
144
|
project.builder.minification.excludes;
|
|
145
145
|
if (minificationExcludes) {
|
|
146
|
-
|
|
146
|
+
// TODO 3.0: namespaces should become mandatory, see existing check above
|
|
147
|
+
const patternPrefix = project.metadata.namespace ? "/resources/" : "/";
|
|
148
|
+
this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, patternPrefix);
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
this.addTask("createDebugFiles", async () => {
|
|
@@ -176,7 +176,7 @@ class LibraryBuilder extends AbstractBuilder {
|
|
|
176
176
|
dependencies: resourceCollections.dependencies,
|
|
177
177
|
options: {
|
|
178
178
|
projectName: project.metadata.name,
|
|
179
|
-
librariesPattern: !taskUtil.isRootProject() ? "/resources
|
|
179
|
+
librariesPattern: !taskUtil.isRootProject() ? "/resources/**/(*.library|library.js)" : undefined,
|
|
180
180
|
themesPattern: !taskUtil.isRootProject() ? "/resources/sap/ui/core/themes/*" : undefined,
|
|
181
181
|
inputPattern
|
|
182
182
|
}
|
|
@@ -29,7 +29,7 @@ class ThemeLibraryBuilder extends AbstractBuilder {
|
|
|
29
29
|
dependencies: resourceCollections.dependencies,
|
|
30
30
|
options: {
|
|
31
31
|
projectName: project.metadata.name,
|
|
32
|
-
librariesPattern: !taskUtil.isRootProject() ? "/resources
|
|
32
|
+
librariesPattern: !taskUtil.isRootProject() ? "/resources/**/(*.library|library.js)" : undefined,
|
|
33
33
|
themesPattern: !taskUtil.isRootProject() ? "/resources/sap/ui/core/themes/*" : undefined,
|
|
34
34
|
inputPattern: "/resources/**/themes/*/library.source.less"
|
|
35
35
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/builder",
|
|
3
|
-
"version": "2.11.
|
|
3
|
+
"version": "2.11.4",
|
|
4
4
|
"description": "UI5 Tooling - Builder",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -110,9 +110,9 @@
|
|
|
110
110
|
"escape-unicode": "^0.2.0",
|
|
111
111
|
"escope": "^3.6.0",
|
|
112
112
|
"espree": "^6.2.1",
|
|
113
|
-
"globby": "^11.0
|
|
114
|
-
"graceful-fs": "^4.2.
|
|
115
|
-
"jsdoc": "^3.6.
|
|
113
|
+
"globby": "^11.1.0",
|
|
114
|
+
"graceful-fs": "^4.2.9",
|
|
115
|
+
"jsdoc": "^3.6.10",
|
|
116
116
|
"less-openui5": "^0.11.2",
|
|
117
117
|
"make-dir": "^3.1.0",
|
|
118
118
|
"pretty-data": "^0.40.0",
|
|
@@ -120,21 +120,21 @@
|
|
|
120
120
|
"replacestream": "^4.0.3",
|
|
121
121
|
"rimraf": "^3.0.2",
|
|
122
122
|
"semver": "^7.3.5",
|
|
123
|
-
"terser": "^5.
|
|
123
|
+
"terser": "^5.10.0",
|
|
124
124
|
"xml2js": "^0.4.23",
|
|
125
125
|
"yazl": "^2.5.1"
|
|
126
126
|
},
|
|
127
127
|
"devDependencies": {
|
|
128
128
|
"ava": "^3.15.0",
|
|
129
|
-
"chai": "^4.3.
|
|
129
|
+
"chai": "^4.3.6",
|
|
130
130
|
"chai-fs": "^2.0.0",
|
|
131
131
|
"chokidar-cli": "^3.0.0",
|
|
132
132
|
"cross-env": "^7.0.3",
|
|
133
|
-
"depcheck": "^1.4.
|
|
133
|
+
"depcheck": "^1.4.3",
|
|
134
134
|
"docdash": "^1.2.0",
|
|
135
135
|
"eslint": "^7.32.0",
|
|
136
136
|
"eslint-config-google": "^0.14.0",
|
|
137
|
-
"eslint-plugin-jsdoc": "^
|
|
137
|
+
"eslint-plugin-jsdoc": "^37.9.4",
|
|
138
138
|
"extract-zip": "^2.0.1",
|
|
139
139
|
"mock-require": "^3.0.3",
|
|
140
140
|
"nyc": "^15.1.0",
|