@ui5/builder 3.5.0 → 4.0.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 +44 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +6 -6
- package/jsdoc.json +7 -2
- package/lib/lbt/bundle/Builder.js +155 -113
- package/lib/lbt/bundle/ResolvedBundleDefinition.js +11 -17
- package/lib/processors/bundlers/moduleBundler.js +19 -8
- package/lib/processors/jsdoc/apiIndexGenerator.js +1 -1
- package/lib/processors/jsdoc/jsdocGenerator.js +4 -11
- package/lib/processors/jsdoc/lib/package.json +3 -0
- package/lib/processors/jsdoc/lib/{transformApiJson.cjs → transformApiJson.js} +1 -1
- package/lib/processors/jsdoc/lib/ui5/{plugin.cjs → plugin.js} +26 -6
- package/lib/processors/jsdoc/lib/ui5/template/{publish.cjs → publish.js} +2 -2
- package/lib/processors/jsdoc/sdkTransformer.js +1 -1
- package/lib/processors/manifestEnhancer.js +420 -0
- package/lib/processors/minifier.js +5 -1
- package/lib/tasks/buildThemes.js +4 -0
- package/lib/tasks/bundlers/generateBundle.js +11 -2
- package/lib/tasks/bundlers/generateComponentPreload.js +15 -8
- package/lib/tasks/bundlers/generateFlexChangesBundle.js +1 -2
- package/lib/tasks/bundlers/generateLibraryPreload.js +11 -8
- package/lib/tasks/bundlers/generateStandaloneAppBundle.js +40 -21
- package/lib/tasks/bundlers/utils/applyDefaultsToBundleDefinition.js +35 -0
- package/lib/tasks/enhanceManifest.js +32 -0
- package/lib/tasks/generateCachebusterInfo.js +1 -2
- package/lib/tasks/generateThemeDesignerResources.js +33 -8
- package/lib/tasks/generateVersionInfo.js +3 -1
- package/lib/tasks/taskRepository.js +2 -1
- package/lib/tasks/transformBootstrapHtml.js +2 -3
- package/lib/tasks/utils/dotTheming.js +33 -0
- package/package.json +25 -25
- /package/lib/processors/jsdoc/lib/{createIndexFiles.cjs → createIndexFiles.js} +0 -0
- /package/lib/processors/jsdoc/lib/ui5/template/utils/{versionUtil.cjs → versionUtil.js} +0 -0
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import moduleBundler from "../../processors/bundlers/moduleBundler.js";
|
|
2
|
+
import {applyDefaultsToBundleDefinition} from "./utils/applyDefaultsToBundleDefinition.js";
|
|
2
3
|
import createModuleNameMapping from "./utils/createModuleNameMapping.js";
|
|
3
4
|
import ReaderCollectionPrioritized from "@ui5/fs/ReaderCollectionPrioritized";
|
|
4
5
|
|
|
@@ -94,12 +95,20 @@ export default async function({
|
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
97
|
}
|
|
97
|
-
|
|
98
|
+
const coreVersion = taskUtil?.getProject("sap.ui.core")?.getVersion();
|
|
99
|
+
const allowStringBundling = taskUtil?.getProject().getSpecVersion().lt("4.0");
|
|
98
100
|
return combo.byGlob("/resources/**/*.{js,json,xml,html,properties,library,js.map}").then((resources) => {
|
|
99
|
-
const options = {
|
|
101
|
+
const options = {
|
|
102
|
+
bundleDefinition: applyDefaultsToBundleDefinition(bundleDefinition, taskUtil),
|
|
103
|
+
bundleOptions,
|
|
104
|
+
allowStringBundling
|
|
105
|
+
};
|
|
100
106
|
if (!optimize && taskUtil) {
|
|
101
107
|
options.moduleNameMapping = createModuleNameMapping({resources, taskUtil});
|
|
102
108
|
}
|
|
109
|
+
if (coreVersion) {
|
|
110
|
+
options.targetUi5CoreVersion = coreVersion;
|
|
111
|
+
}
|
|
103
112
|
return moduleBundler({options, resources}).then((bundles) => {
|
|
104
113
|
return Promise.all(bundles.map(({bundle, sourceMap} = {}) => {
|
|
105
114
|
if (!bundle) {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
2
|
import moduleBundler from "../../processors/bundlers/moduleBundler.js";
|
|
3
|
+
import {applyDefaultsToBundleDefinition} from "./utils/applyDefaultsToBundleDefinition.js";
|
|
3
4
|
import {getLogger} from "@ui5/logger";
|
|
4
5
|
const log = getLogger("builder:tasks:bundlers:generateComponentPreload");
|
|
5
6
|
import {negateFilters} from "../../lbt/resources/ResourceFilterList.js";
|
|
@@ -144,18 +145,24 @@ export default async function({
|
|
|
144
145
|
);
|
|
145
146
|
});
|
|
146
147
|
}
|
|
147
|
-
|
|
148
|
+
const coreVersion = taskUtil?.getProject("sap.ui.core")?.getVersion();
|
|
149
|
+
const allowStringBundling = taskUtil?.getProject().getSpecVersion().lt("4.0");
|
|
148
150
|
return Promise.all(bundleDefinitions.filter(Boolean).map((bundleDefinition) => {
|
|
149
151
|
log.verbose(`Generating ${bundleDefinition.name}...`);
|
|
152
|
+
const options = {
|
|
153
|
+
bundleDefinition: applyDefaultsToBundleDefinition(bundleDefinition, taskUtil),
|
|
154
|
+
bundleOptions: {
|
|
155
|
+
ignoreMissingModules: true,
|
|
156
|
+
optimize: true
|
|
157
|
+
},
|
|
158
|
+
allowStringBundling
|
|
159
|
+
};
|
|
160
|
+
if (coreVersion) {
|
|
161
|
+
options.targetUi5CoreVersion = coreVersion;
|
|
162
|
+
}
|
|
150
163
|
return moduleBundler({
|
|
151
164
|
resources,
|
|
152
|
-
options
|
|
153
|
-
bundleDefinition,
|
|
154
|
-
bundleOptions: {
|
|
155
|
-
ignoreMissingModules: true,
|
|
156
|
-
optimize: true
|
|
157
|
-
}
|
|
158
|
-
}
|
|
165
|
+
options
|
|
159
166
|
});
|
|
160
167
|
}));
|
|
161
168
|
})
|
|
@@ -29,8 +29,7 @@ import semver from "semver";
|
|
|
29
29
|
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
|
|
30
30
|
*/
|
|
31
31
|
export default async function({workspace, taskUtil, options = {}}) {
|
|
32
|
-
|
|
33
|
-
const namespace = options.projectNamespace || options.namespace;
|
|
32
|
+
const namespace = options.projectNamespace;
|
|
34
33
|
|
|
35
34
|
// Use the given namespace if available, otherwise use no namespace
|
|
36
35
|
// (e.g. in case no manifest.json is present)
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {getLogger} from "@ui5/logger";
|
|
2
2
|
const log = getLogger("builder:tasks:bundlers:generateLibraryPreload");
|
|
3
3
|
import moduleBundler from "../../processors/bundlers/moduleBundler.js";
|
|
4
|
+
import {applyDefaultsToBundleDefinition} from "./utils/applyDefaultsToBundleDefinition.js";
|
|
4
5
|
import {negateFilters} from "../../lbt/resources/ResourceFilterList.js";
|
|
5
6
|
import createModuleNameMapping from "./utils/createModuleNameMapping.js";
|
|
6
7
|
|
|
@@ -34,9 +35,9 @@ function getDefaultLibraryPreloadFilters(namespace, excludes) {
|
|
|
34
35
|
function getBundleDefinition(namespace, excludes) {
|
|
35
36
|
// Note: This configuration is only used when no bundle definition in ui5.yaml exists (see "skipBundles" parameter)
|
|
36
37
|
|
|
37
|
-
// TODO: Remove this hardcoded bundle definition.
|
|
38
|
+
// TODO: Remove this hardcoded bundle definition once support for relevant versions has ended.
|
|
38
39
|
// sap.ui.core ui5.yaml contains a configuration since UI5 1.103.0 (specVersion 2.4)
|
|
39
|
-
// so this is still required to build UI5 versions <= 1.102.0.
|
|
40
|
+
// so this is still required to build UI5 versions <= 1.102.0 (such as 1.84 and 1.96)
|
|
40
41
|
if (namespace === "sap/ui/core") {
|
|
41
42
|
return {
|
|
42
43
|
name: `${namespace}/library-preload.js`,
|
|
@@ -164,8 +165,7 @@ function getModuleBundlerOptions(config) {
|
|
|
164
165
|
moduleBundlerOptions.bundleOptions = {
|
|
165
166
|
optimize: config.preload,
|
|
166
167
|
decorateBootstrapModule: config.preload,
|
|
167
|
-
addTryCatchRestartWrapper: config.preload
|
|
168
|
-
usePredefineCalls: config.preload
|
|
168
|
+
addTryCatchRestartWrapper: config.preload
|
|
169
169
|
};
|
|
170
170
|
|
|
171
171
|
moduleBundlerOptions.bundleDefinition = getSapUiCoreBunDef(config.name, config.filters, config.preload);
|
|
@@ -256,12 +256,18 @@ export default async function({workspace, taskUtil, options: {skipBundles = [],
|
|
|
256
256
|
}
|
|
257
257
|
});
|
|
258
258
|
}
|
|
259
|
-
|
|
259
|
+
const coreVersion = taskUtil?.getProject("sap.ui.core")?.getVersion();
|
|
260
|
+
const allowStringBundling = taskUtil?.getProject().getSpecVersion().lt("4.0");
|
|
260
261
|
const execModuleBundlerIfNeeded = ({options, resources}) => {
|
|
261
262
|
if (skipBundles.includes(options.bundleDefinition.name)) {
|
|
262
263
|
log.verbose(`Skipping generation of bundle ${options.bundleDefinition.name}`);
|
|
263
264
|
return null;
|
|
264
265
|
}
|
|
266
|
+
if (coreVersion) {
|
|
267
|
+
options.targetUi5CoreVersion = coreVersion;
|
|
268
|
+
}
|
|
269
|
+
options.bundleDefinition = applyDefaultsToBundleDefinition(options.bundleDefinition, taskUtil);
|
|
270
|
+
options.allowStringBundling = allowStringBundling;
|
|
265
271
|
return moduleBundler({options, resources});
|
|
266
272
|
};
|
|
267
273
|
|
|
@@ -390,7 +396,6 @@ export default async function({workspace, taskUtil, options: {skipBundles = [],
|
|
|
390
396
|
bundleDefinition: getBundleDefinition(libraryNamespace, excludes),
|
|
391
397
|
bundleOptions: {
|
|
392
398
|
optimize: true,
|
|
393
|
-
usePredefineCalls: true,
|
|
394
399
|
ignoreMissingModules: true
|
|
395
400
|
}
|
|
396
401
|
},
|
|
@@ -401,7 +406,6 @@ export default async function({workspace, taskUtil, options: {skipBundles = [],
|
|
|
401
406
|
bundleDefinition: getDesigntimeBundleDefinition(libraryNamespace),
|
|
402
407
|
bundleOptions: {
|
|
403
408
|
optimize: true,
|
|
404
|
-
usePredefineCalls: true,
|
|
405
409
|
ignoreMissingModules: true,
|
|
406
410
|
skipIfEmpty: true
|
|
407
411
|
}
|
|
@@ -413,7 +417,6 @@ export default async function({workspace, taskUtil, options: {skipBundles = [],
|
|
|
413
417
|
bundleDefinition: getSupportFilesBundleDefinition(libraryNamespace),
|
|
414
418
|
bundleOptions: {
|
|
415
419
|
optimize: false,
|
|
416
|
-
usePredefineCalls: true,
|
|
417
420
|
ignoreMissingModules: true,
|
|
418
421
|
skipIfEmpty: true
|
|
419
422
|
}
|
|
@@ -2,6 +2,7 @@ import {getLogger} from "@ui5/logger";
|
|
|
2
2
|
const log = getLogger("builder:tasks:bundlers:generateStandaloneAppBundle");
|
|
3
3
|
import ReaderCollectionPrioritized from "@ui5/fs/ReaderCollectionPrioritized";
|
|
4
4
|
import moduleBundler from "../../processors/bundlers/moduleBundler.js";
|
|
5
|
+
import {applyDefaultsToBundleDefinition} from "./utils/applyDefaultsToBundleDefinition.js";
|
|
5
6
|
import createModuleNameMapping from "./utils/createModuleNameMapping.js";
|
|
6
7
|
|
|
7
8
|
function getBundleDefinition(config) {
|
|
@@ -83,8 +84,8 @@ function getBundleDefinition(config) {
|
|
|
83
84
|
*/
|
|
84
85
|
export default async function({workspace, dependencies, taskUtil, options}) {
|
|
85
86
|
const {projectName} = options;
|
|
86
|
-
|
|
87
|
-
const
|
|
87
|
+
const namespace = options.projectNamespace;
|
|
88
|
+
const coreVersion = taskUtil?.getProject("sap.ui.core")?.getVersion();
|
|
88
89
|
|
|
89
90
|
if (!namespace) {
|
|
90
91
|
log.warn(`Namespace of project ${projectName} is not known. Self contained bundling is currently ` +
|
|
@@ -138,31 +139,49 @@ export default async function({workspace, dependencies, taskUtil, options}) {
|
|
|
138
139
|
});
|
|
139
140
|
}
|
|
140
141
|
|
|
142
|
+
const allowStringBundling = taskUtil?.getProject().getSpecVersion().lt("4.0");
|
|
143
|
+
const bundleOptions = {
|
|
144
|
+
bundleDefinition: applyDefaultsToBundleDefinition(
|
|
145
|
+
getBundleDefinition({
|
|
146
|
+
name: "sap-ui-custom.js",
|
|
147
|
+
filters,
|
|
148
|
+
namespace,
|
|
149
|
+
preloadSection: true,
|
|
150
|
+
}),
|
|
151
|
+
taskUtil
|
|
152
|
+
),
|
|
153
|
+
allowStringBundling
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const bundleDbgOptions = {
|
|
157
|
+
bundleDefinition: applyDefaultsToBundleDefinition(
|
|
158
|
+
getBundleDefinition({
|
|
159
|
+
name: "sap-ui-custom-dbg.js",
|
|
160
|
+
filters,
|
|
161
|
+
namespace,
|
|
162
|
+
}),
|
|
163
|
+
taskUtil
|
|
164
|
+
),
|
|
165
|
+
bundleOptions: {
|
|
166
|
+
optimize: false,
|
|
167
|
+
},
|
|
168
|
+
moduleNameMapping: unoptimizedModuleNameMapping,
|
|
169
|
+
allowStringBundling
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
if (coreVersion) {
|
|
173
|
+
bundleOptions.targetUi5CoreVersion = coreVersion;
|
|
174
|
+
bundleDbgOptions.targetUi5CoreVersion = coreVersion;
|
|
175
|
+
}
|
|
176
|
+
|
|
141
177
|
await Promise.all([
|
|
142
178
|
moduleBundler({
|
|
143
179
|
resources,
|
|
144
|
-
options:
|
|
145
|
-
bundleDefinition: getBundleDefinition({
|
|
146
|
-
name: "sap-ui-custom.js",
|
|
147
|
-
filters,
|
|
148
|
-
namespace,
|
|
149
|
-
preloadSection: true
|
|
150
|
-
})
|
|
151
|
-
}
|
|
180
|
+
options: bundleOptions
|
|
152
181
|
}),
|
|
153
182
|
moduleBundler({
|
|
154
183
|
resources: unoptimizedResources,
|
|
155
|
-
options:
|
|
156
|
-
bundleDefinition: getBundleDefinition({
|
|
157
|
-
name: "sap-ui-custom-dbg.js",
|
|
158
|
-
filters,
|
|
159
|
-
namespace
|
|
160
|
-
}),
|
|
161
|
-
bundleOptions: {
|
|
162
|
-
optimize: false
|
|
163
|
-
},
|
|
164
|
-
moduleNameMapping: unoptimizedModuleNameMapping
|
|
165
|
-
}
|
|
184
|
+
options: bundleDbgOptions
|
|
166
185
|
})
|
|
167
186
|
]).then((results) => {
|
|
168
187
|
const bundles = Array.prototype.concat.apply([], results);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Applies default values to bundleDefinitions
|
|
3
|
+
*
|
|
4
|
+
* @param {module:@ui5/builder/processors/bundlers/moduleBundler~ModuleBundleDefinition} bundleDefinition Module
|
|
5
|
+
* bundle definition
|
|
6
|
+
* @param {@ui5/project/build/helpers/TaskUtil|object} [taskUtil] TaskUtil
|
|
7
|
+
*
|
|
8
|
+
* @returns {module:@ui5/builder/processors/bundlers/moduleBundler~ModuleBundleDefinition}
|
|
9
|
+
*/
|
|
10
|
+
export function applyDefaultsToBundleDefinition(bundleDefinition, taskUtil) {
|
|
11
|
+
bundleDefinition.sections = bundleDefinition?.sections?.map((section) => {
|
|
12
|
+
const defaultValues = {
|
|
13
|
+
resolve: false,
|
|
14
|
+
resolveConditional: false,
|
|
15
|
+
renderer: false,
|
|
16
|
+
sort: true,
|
|
17
|
+
declareRawModules: false,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
// Since specVersion: 4.0 "require" section starts loading asynchronously.
|
|
21
|
+
// If specVersion cannot be determined, the latest spec is taken into account.
|
|
22
|
+
// This is a breaking change in specVersion: 4.0
|
|
23
|
+
if (section.mode === "require") {
|
|
24
|
+
// Builder.js already treats missing async flag as truthy value and builds asynchronously by default
|
|
25
|
+
|
|
26
|
+
if (taskUtil && taskUtil.getProject().getSpecVersion().lt("4.0")) {
|
|
27
|
+
defaultValues.async = false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return Object.assign(defaultValues, section);
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
return bundleDefinition;
|
|
35
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import manifestEnhancer from "../processors/manifestEnhancer.js";
|
|
2
|
+
import fsInterface from "@ui5/fs/fsInterface";
|
|
3
|
+
|
|
4
|
+
/* eslint "jsdoc/check-param-names": ["error", {"disableExtraPropertyReporting":true}] */
|
|
5
|
+
/**
|
|
6
|
+
* Task for transforming the manifest.json file.
|
|
7
|
+
* Adds missing information based on the available project resources,
|
|
8
|
+
* for example the locales supported by the present i18n resources.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
* @function default
|
|
12
|
+
* @static
|
|
13
|
+
*
|
|
14
|
+
* @param {object} parameters Parameters
|
|
15
|
+
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
|
|
16
|
+
* @param {object} parameters.options Options
|
|
17
|
+
* @param {string} parameters.options.projectNamespace Namespace of the application
|
|
18
|
+
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
|
|
19
|
+
*/
|
|
20
|
+
export default async function({workspace, options}) {
|
|
21
|
+
const {projectNamespace} = options;
|
|
22
|
+
|
|
23
|
+
// Note: all "manifest.json" files in the given namespace
|
|
24
|
+
const resources = await workspace.byGlob(`/resources/${projectNamespace}/**/manifest.json`);
|
|
25
|
+
|
|
26
|
+
const processedResources = await manifestEnhancer({
|
|
27
|
+
resources,
|
|
28
|
+
fs: fsInterface(workspace),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
await Promise.all(processedResources.map((resource) => workspace.write(resource)));
|
|
32
|
+
}
|
|
@@ -51,8 +51,7 @@ function getSigner(type) {
|
|
|
51
51
|
*/
|
|
52
52
|
export default function({workspace, options}) {
|
|
53
53
|
const {signatureType} = options;
|
|
54
|
-
|
|
55
|
-
const namespace = options.projectNamespace || options.namespace;
|
|
54
|
+
const namespace = options.projectNamespace;
|
|
56
55
|
|
|
57
56
|
const basePath = `/resources/${namespace}/`;
|
|
58
57
|
return workspace.byGlob(`/resources/${namespace}/**/*`)
|
|
@@ -2,6 +2,7 @@ import posixPath from "node:path/posix";
|
|
|
2
2
|
import {getLogger} from "@ui5/logger";
|
|
3
3
|
const log = getLogger("builder:tasks:generateThemeDesignerResources");
|
|
4
4
|
import libraryLessGenerator from "../processors/libraryLessGenerator.js";
|
|
5
|
+
import {updateLibraryDotTheming} from "./utils/dotTheming.js";
|
|
5
6
|
import ReaderCollectionPrioritized from "@ui5/fs/ReaderCollectionPrioritized";
|
|
6
7
|
import Resource from "@ui5/fs/Resource";
|
|
7
8
|
import fsInterface from "@ui5/fs/fsInterface";
|
|
@@ -44,6 +45,10 @@ function generateLibraryDotTheming({namespace, version, hasThemes}) {
|
|
|
44
45
|
sVersion: version
|
|
45
46
|
};
|
|
46
47
|
|
|
48
|
+
// Note that with sap.ui.core version 1.127.0 the .theming file has been put into
|
|
49
|
+
// the library sources so that "aFiles" can be maintained from there.
|
|
50
|
+
// The below configuration is still needed for older versions of sap.ui.core which do not
|
|
51
|
+
// contain the file.
|
|
47
52
|
if (namespace === "sap/ui/core") {
|
|
48
53
|
dotTheming.aFiles = [
|
|
49
54
|
"library",
|
|
@@ -216,8 +221,7 @@ async function generateCssVariablesLess({workspace, combo, namespace}) {
|
|
|
216
221
|
*/
|
|
217
222
|
export default async function({workspace, dependencies, options}) {
|
|
218
223
|
const {projectName, version} = options;
|
|
219
|
-
|
|
220
|
-
const namespace = options.projectNamespace || options.namespace;
|
|
224
|
+
const namespace = options.projectNamespace;
|
|
221
225
|
|
|
222
226
|
// Skip sap.ui.documentation since it is not intended to be available in SAP Theme Designer to create custom themes
|
|
223
227
|
if (namespace === "sap/ui/documentation") {
|
|
@@ -241,12 +245,33 @@ export default async function({workspace, dependencies, options}) {
|
|
|
241
245
|
// Only for type "library". Type "theme-library" does not provide a namespace
|
|
242
246
|
// Also needs to be created in case a library does not have any themes (see bIgnore flag)
|
|
243
247
|
if (namespace) {
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
248
|
+
let libraryDotThemingResource;
|
|
249
|
+
|
|
250
|
+
// Do not generate a .theming file for the sap.ui.core library
|
|
251
|
+
if (namespace === "sap/ui/core") {
|
|
252
|
+
// Check if the .theming file already exists
|
|
253
|
+
libraryDotThemingResource = await workspace.byPath(`/resources/${namespace}/.theming`);
|
|
254
|
+
if (libraryDotThemingResource) {
|
|
255
|
+
// Update the existing .theming resource
|
|
256
|
+
log.verbose(`Updating .theming for namespace ${namespace}`);
|
|
257
|
+
await updateLibraryDotTheming({
|
|
258
|
+
resource: libraryDotThemingResource,
|
|
259
|
+
namespace,
|
|
260
|
+
version,
|
|
261
|
+
hasThemes
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
if (!libraryDotThemingResource) {
|
|
267
|
+
log.verbose(`Generating .theming for namespace ${namespace}`);
|
|
268
|
+
libraryDotThemingResource = generateLibraryDotTheming({
|
|
269
|
+
namespace,
|
|
270
|
+
version,
|
|
271
|
+
hasThemes
|
|
272
|
+
});
|
|
273
|
+
}
|
|
274
|
+
|
|
250
275
|
await workspace.write(libraryDotThemingResource);
|
|
251
276
|
}
|
|
252
277
|
|
|
@@ -23,7 +23,9 @@ const MANIFEST_JSON = "manifest.json";
|
|
|
23
23
|
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
|
|
24
24
|
*/
|
|
25
25
|
export default async ({workspace, dependencies, options: {rootProject, pattern}}) => {
|
|
26
|
-
|
|
26
|
+
let resources = await dependencies.byGlob(pattern);
|
|
27
|
+
|
|
28
|
+
resources = resources.filter((res) => res.getProject()?.getType() === "library");
|
|
27
29
|
|
|
28
30
|
const libraryInfosPromises = resources.map((dotLibResource) => {
|
|
29
31
|
const namespace = dotLibResource.getProject().getNamespace();
|
|
@@ -17,6 +17,7 @@ const taskInfos = {
|
|
|
17
17
|
replaceCopyright: {path: "./replaceCopyright.js"},
|
|
18
18
|
replaceVersion: {path: "./replaceVersion.js"},
|
|
19
19
|
replaceBuildtime: {path: "./replaceBuildtime.js"},
|
|
20
|
+
enhanceManifest: {path: "./enhanceManifest.js"},
|
|
20
21
|
escapeNonAsciiCharacters: {path: "./escapeNonAsciiCharacters.js"},
|
|
21
22
|
executeJsdocSdkTransformation: {path: "./jsdoc/executeJsdocSdkTransformation.js"},
|
|
22
23
|
generateApiIndex: {path: "./jsdoc/generateApiIndex.js"},
|
|
@@ -98,7 +99,7 @@ export function getRemovedTaskNames() {
|
|
|
98
99
|
return ["createDebugFiles", "uglify", "generateManifestBundle"];
|
|
99
100
|
}
|
|
100
101
|
|
|
101
|
-
// Using CommonsJS require
|
|
102
|
+
// Using CommonsJS require since JSON module imports are still experimental
|
|
102
103
|
const require = createRequire(import.meta.url);
|
|
103
104
|
function getVersion(pkg) {
|
|
104
105
|
return require(`${pkg}/package.json`).version;
|
|
@@ -11,13 +11,12 @@ import bootstrapHtmlTransformer from "../processors/bootstrapHtmlTransformer.js"
|
|
|
11
11
|
* @param {@ui5/fs/DuplexCollection} parameters.workspace DuplexCollection to read and write files
|
|
12
12
|
* @param {object} parameters.options Options
|
|
13
13
|
* @param {string} parameters.options.projectName Project name
|
|
14
|
-
* @param {string} [parameters.options.
|
|
14
|
+
* @param {string} [parameters.options.projectNamespace] Project namespace
|
|
15
15
|
* @returns {Promise<undefined>} Promise resolving with <code>undefined</code> once data has been written
|
|
16
16
|
*/
|
|
17
17
|
export default async function({workspace, options}) {
|
|
18
18
|
const {projectName} = options;
|
|
19
|
-
|
|
20
|
-
const namespace = options.projectNamespace || options.namespace;
|
|
19
|
+
const namespace = options.projectNamespace;
|
|
21
20
|
|
|
22
21
|
let indexPath;
|
|
23
22
|
if (namespace) {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export async function updateLibraryDotTheming({resource, namespace, version, hasThemes}) {
|
|
2
|
+
const dotTheming = JSON.parse(await resource.getString());
|
|
3
|
+
|
|
4
|
+
if (!dotTheming.sEntity) {
|
|
5
|
+
throw new Error(`Missing 'sEntity' property in ${resource.getPath()}`);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (dotTheming.sEntity !== "Library") {
|
|
9
|
+
throw new Error(
|
|
10
|
+
`Incorrect 'sEntity' value '${dotTheming.sEntity}' in ${resource.getPath()}: ` +
|
|
11
|
+
`Expected 'Library'`
|
|
12
|
+
);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if (!dotTheming.sId) {
|
|
16
|
+
throw new Error(`Missing 'sId' property in ${resource.getPath()}`);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
if (dotTheming.sId !== namespace) {
|
|
20
|
+
throw new Error(`Incorrect 'sId' value '${dotTheming.sId}' in ${resource.getPath()}: Expected '${namespace}'`);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
dotTheming.sVersion = version;
|
|
24
|
+
|
|
25
|
+
if (!hasThemes) {
|
|
26
|
+
// Set ignore flag when there are no themes at all
|
|
27
|
+
// This is important in case a library used to contain themes that have been removed
|
|
28
|
+
// in a later version of the library.
|
|
29
|
+
dotTheming.bIgnore = true;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
resource.setString(JSON.stringify(dotTheming, null, 2));
|
|
33
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ui5/builder",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "4.0.0",
|
|
4
4
|
"description": "UI5 Tooling - Builder",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "SAP SE",
|
|
@@ -22,13 +22,14 @@
|
|
|
22
22
|
"./processors/jsdoc/lib/*": null,
|
|
23
23
|
"./tasks/*": "./lib/tasks/*.js",
|
|
24
24
|
"./tasks/taskRepository": null,
|
|
25
|
+
"./tasks/utils/*": null,
|
|
25
26
|
"./tasks/bundlers/utils/*": null,
|
|
26
27
|
"./package.json": "./package.json",
|
|
27
28
|
"./internal/taskRepository": "./lib/tasks/taskRepository.js",
|
|
28
|
-
"./internal/jsdoc/template/publish": "./lib/processors/jsdoc/lib/ui5/template/publish.
|
|
29
|
+
"./internal/jsdoc/template/publish": "./lib/processors/jsdoc/lib/ui5/template/publish.js"
|
|
29
30
|
},
|
|
30
31
|
"engines": {
|
|
31
|
-
"node": "^
|
|
32
|
+
"node": "^20.11.0 || >=22.0.0",
|
|
32
33
|
"npm": ">= 8"
|
|
33
34
|
},
|
|
34
35
|
"scripts": {
|
|
@@ -46,7 +47,7 @@
|
|
|
46
47
|
"jsdoc-generate": "jsdoc -c ./jsdoc.json -t $(node -p 'path.dirname(require.resolve(\"docdash\"))') ./lib/ || (echo 'Error during JSDoc generation! Check log.' && exit 1)",
|
|
47
48
|
"jsdoc-watch": "npm run jsdoc && chokidar \"./lib/**/*.js\" -c \"npm run jsdoc-generate\"",
|
|
48
49
|
"preversion": "npm test",
|
|
49
|
-
"version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md
|
|
50
|
+
"version": "git-chglog --sort semver --next-tag v$npm_package_version -o CHANGELOG.md v4.0.0.. && git add CHANGELOG.md",
|
|
50
51
|
"prepublishOnly": "git push --follow-tags",
|
|
51
52
|
"release-note": "git-chglog --sort semver -c .chglog/release-config.yml v$npm_package_version",
|
|
52
53
|
"depcheck": "depcheck --ignores @ui5/builder,docdash,@istanbuljs/esm-loader-hook,catharsis --parsers='**/*.js:es6,**/*.cjs:es6'"
|
|
@@ -63,9 +64,11 @@
|
|
|
63
64
|
"files": [
|
|
64
65
|
"test/lib/**/*.js"
|
|
65
66
|
],
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
67
|
+
"watchMode": {
|
|
68
|
+
"ignoreChanges": [
|
|
69
|
+
"test/tmp/**"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
69
72
|
"nodeArguments": [
|
|
70
73
|
"--loader=esmock",
|
|
71
74
|
"--no-warnings"
|
|
@@ -118,30 +121,28 @@
|
|
|
118
121
|
"url": "git@github.com:SAP/ui5-builder.git"
|
|
119
122
|
},
|
|
120
123
|
"dependencies": {
|
|
121
|
-
"@jridgewell/sourcemap-codec": "^1.
|
|
122
|
-
"@ui5/fs": "^
|
|
123
|
-
"@ui5/logger": "^
|
|
124
|
+
"@jridgewell/sourcemap-codec": "^1.5.0",
|
|
125
|
+
"@ui5/fs": "^4.0.0",
|
|
126
|
+
"@ui5/logger": "^4.0.1",
|
|
124
127
|
"cheerio": "1.0.0-rc.12",
|
|
125
128
|
"escape-unicode": "^0.2.0",
|
|
126
129
|
"escope": "^4.0.0",
|
|
127
|
-
"espree": "^
|
|
130
|
+
"espree": "^10.1.0",
|
|
128
131
|
"graceful-fs": "^4.2.11",
|
|
129
132
|
"jsdoc": "^4.0.3",
|
|
130
133
|
"less-openui5": "^0.11.6",
|
|
131
134
|
"pretty-data": "^0.40.0",
|
|
132
|
-
"rimraf": "^
|
|
133
|
-
"semver": "^7.6.
|
|
134
|
-
"terser": "^5.31.
|
|
135
|
-
"workerpool": "^
|
|
135
|
+
"rimraf": "^6.0.1",
|
|
136
|
+
"semver": "^7.6.3",
|
|
137
|
+
"terser": "^5.31.3",
|
|
138
|
+
"workerpool": "^9.1.3",
|
|
136
139
|
"xml2js": "^0.6.2"
|
|
137
140
|
},
|
|
138
141
|
"devDependencies": {
|
|
139
142
|
"@istanbuljs/esm-loader-hook": "^0.2.0",
|
|
140
143
|
"@jridgewell/trace-mapping": "^0.3.25",
|
|
141
|
-
"@ui5/project": "^
|
|
142
|
-
"ava": "^
|
|
143
|
-
"chai": "^4.4.1",
|
|
144
|
-
"chai-fs": "^2.0.0",
|
|
144
|
+
"@ui5/project": "^4.0.0",
|
|
145
|
+
"ava": "^6.1.3",
|
|
145
146
|
"chokidar-cli": "^3.0.0",
|
|
146
147
|
"cross-env": "^7.0.3",
|
|
147
148
|
"depcheck": "^1.4.7",
|
|
@@ -149,13 +150,12 @@
|
|
|
149
150
|
"eslint": "^8.57.0",
|
|
150
151
|
"eslint-config-google": "^0.14.0",
|
|
151
152
|
"eslint-plugin-ava": "^14.0.0",
|
|
152
|
-
"eslint-plugin-jsdoc": "^
|
|
153
|
-
"esmock": "^2.6.
|
|
153
|
+
"eslint-plugin-jsdoc": "^48.8.3",
|
|
154
|
+
"esmock": "^2.6.7",
|
|
154
155
|
"line-column": "^1.0.2",
|
|
155
|
-
"nyc": "^
|
|
156
|
-
"open-cli": "^
|
|
157
|
-
"
|
|
158
|
-
"sinon": "^16.1.3",
|
|
156
|
+
"nyc": "^17.0.0",
|
|
157
|
+
"open-cli": "^8.0.0",
|
|
158
|
+
"sinon": "^18.0.0",
|
|
159
159
|
"tap-xunit": "^2.4.1"
|
|
160
160
|
}
|
|
161
161
|
}
|
|
File without changes
|
|
File without changes
|