@ui5/builder 3.0.0-alpha.5 → 3.0.0-alpha.8
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 +34 -1
- package/index.js +0 -39
- package/lib/lbt/analyzer/JSModuleAnalyzer.js +13 -2
- package/lib/lbt/bundle/Builder.js +19 -49
- package/lib/lbt/resources/LocatorResource.js +1 -1
- package/lib/lbt/resources/ResourceCollector.js +22 -15
- package/lib/lbt/resources/ResourceInfoList.js +0 -1
- package/lib/lbt/resources/ResourcePool.js +7 -6
- package/lib/lbt/utils/escapePropertiesFile.js +3 -6
- package/lib/processors/bundlers/moduleBundler.js +2 -3
- package/lib/processors/jsdoc/lib/createIndexFiles.js +1 -1
- package/lib/processors/jsdoc/lib/transformApiJson.js +20 -20
- package/lib/processors/jsdoc/lib/ui5/plugin.js +111 -6
- package/lib/processors/jsdoc/lib/ui5/template/publish.js +112 -91
- package/lib/processors/jsdoc/lib/ui5/template/utils/versionUtil.js +1 -1
- package/lib/processors/manifestCreator.js +8 -45
- package/lib/tasks/TaskUtil.js +82 -17
- package/lib/tasks/bundlers/generateComponentPreload.js +14 -14
- package/lib/tasks/bundlers/generateFlexChangesBundle.js +6 -2
- package/lib/tasks/bundlers/generateLibraryPreload.js +84 -91
- package/lib/tasks/bundlers/generateManifestBundle.js +8 -10
- package/lib/tasks/bundlers/generateStandaloneAppBundle.js +7 -2
- package/lib/tasks/bundlers/utils/createModuleNameMapping.js +3 -2
- package/lib/tasks/generateCachebusterInfo.js +7 -3
- package/lib/tasks/generateLibraryManifest.js +6 -8
- package/lib/tasks/generateResourcesJson.js +1 -1
- package/lib/tasks/generateThemeDesignerResources.js +8 -2
- package/lib/tasks/generateVersionInfo.js +5 -5
- package/lib/tasks/taskRepository.js +1 -13
- package/lib/tasks/transformBootstrapHtml.js +6 -1
- package/package.json +6 -7
- package/lib/builder/BuildContext.js +0 -60
- package/lib/builder/ProjectBuildContext.js +0 -61
- package/lib/builder/builder.js +0 -425
- package/lib/types/AbstractBuilder.js +0 -270
- package/lib/types/AbstractFormatter.js +0 -66
- package/lib/types/AbstractUi5Formatter.js +0 -95
- package/lib/types/application/ApplicationBuilder.js +0 -211
- package/lib/types/application/ApplicationFormatter.js +0 -227
- package/lib/types/application/applicationType.js +0 -15
- package/lib/types/library/LibraryBuilder.js +0 -232
- package/lib/types/library/LibraryFormatter.js +0 -519
- package/lib/types/library/libraryType.js +0 -15
- package/lib/types/module/ModuleBuilder.js +0 -7
- package/lib/types/module/ModuleFormatter.js +0 -54
- package/lib/types/module/moduleType.js +0 -15
- package/lib/types/themeLibrary/ThemeLibraryBuilder.js +0 -64
- package/lib/types/themeLibrary/ThemeLibraryFormatter.js +0 -90
- package/lib/types/themeLibrary/themeLibraryType.js +0 -15
- package/lib/types/typeRepository.js +0 -46
|
@@ -1,232 +0,0 @@
|
|
|
1
|
-
const AbstractBuilder = require("../AbstractBuilder");
|
|
2
|
-
const {getTask} = require("../../tasks/taskRepository");
|
|
3
|
-
|
|
4
|
-
class LibraryBuilder extends AbstractBuilder {
|
|
5
|
-
addStandardTasks({resourceCollections, project, log, taskUtil}) {
|
|
6
|
-
if (!project.metadata.namespace) {
|
|
7
|
-
// TODO 3.0: Throw here
|
|
8
|
-
log.info("Skipping some tasks due to missing library namespace information. Your project " +
|
|
9
|
-
"might be missing a manifest.json or .library file. " +
|
|
10
|
-
"Also see: https://sap.github.io/ui5-tooling/pages/Builder/#library");
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
this.addTask("escapeNonAsciiCharacters", async () => {
|
|
14
|
-
const propertiesFileSourceEncoding = project.resources &&
|
|
15
|
-
project.resources.configuration &&
|
|
16
|
-
project.resources.configuration.propertiesFileSourceEncoding;
|
|
17
|
-
return getTask("escapeNonAsciiCharacters").task({
|
|
18
|
-
workspace: resourceCollections.workspace,
|
|
19
|
-
options: {
|
|
20
|
-
encoding: propertiesFileSourceEncoding,
|
|
21
|
-
pattern: "/**/*.properties"
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
this.addTask("replaceCopyright", async () => {
|
|
27
|
-
return getTask("replaceCopyright").task({
|
|
28
|
-
workspace: resourceCollections.workspace,
|
|
29
|
-
options: {
|
|
30
|
-
copyright: project.metadata.copyright,
|
|
31
|
-
pattern: "/**/*.{js,library,css,less,theme,html}"
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
this.addTask("replaceVersion", async () => {
|
|
37
|
-
return getTask("replaceVersion").task({
|
|
38
|
-
workspace: resourceCollections.workspace,
|
|
39
|
-
options: {
|
|
40
|
-
version: project.version,
|
|
41
|
-
pattern: "/**/*.{js,json,library,css,less,theme,html}"
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
this.addTask("replaceBuildtime", async () => {
|
|
47
|
-
return getTask("replaceBuildtime").task({
|
|
48
|
-
workspace: resourceCollections.workspace,
|
|
49
|
-
options: {
|
|
50
|
-
pattern: "/resources/sap/ui/Global.js"
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
if (project.metadata.namespace) {
|
|
56
|
-
this.addTask("generateJsdoc", async () => {
|
|
57
|
-
const patterns = ["/resources/**/*.js"];
|
|
58
|
-
// Add excludes
|
|
59
|
-
if (project.builder && project.builder.jsdoc && project.builder.jsdoc.excludes) {
|
|
60
|
-
const excludes = project.builder.jsdoc.excludes.map((pattern) => {
|
|
61
|
-
return `!/resources/${pattern}`;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
patterns.push(...excludes);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
return getTask("generateJsdoc").task({
|
|
68
|
-
workspace: resourceCollections.workspace,
|
|
69
|
-
dependencies: resourceCollections.dependencies,
|
|
70
|
-
taskUtil,
|
|
71
|
-
options: {
|
|
72
|
-
projectName: project.metadata.name,
|
|
73
|
-
namespace: project.metadata.namespace,
|
|
74
|
-
version: project.version,
|
|
75
|
-
pattern: patterns
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
this.addTask("executeJsdocSdkTransformation", async () => {
|
|
81
|
-
return getTask("executeJsdocSdkTransformation").task({
|
|
82
|
-
workspace: resourceCollections.workspace,
|
|
83
|
-
dependencies: resourceCollections.dependencies,
|
|
84
|
-
options: {
|
|
85
|
-
projectName: project.metadata.name,
|
|
86
|
-
dotLibraryPattern: "/resources/**/*.library",
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
});
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// Support rules should not be minified to have readable code in the Support Assistant
|
|
93
|
-
const minificationPattern = ["/resources/**/*.js", "!**/*.support.js"];
|
|
94
|
-
if (["2.6"].includes(project.specVersion)) {
|
|
95
|
-
const minificationExcludes = project.builder && project.builder.minification &&
|
|
96
|
-
project.builder.minification.excludes;
|
|
97
|
-
if (minificationExcludes) {
|
|
98
|
-
this.enhancePatternWithExcludes(minificationPattern, minificationExcludes, "/resources/");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
this.addTask("minify", async () => {
|
|
103
|
-
return getTask("minify").task({
|
|
104
|
-
workspace: resourceCollections.workspace,
|
|
105
|
-
taskUtil,
|
|
106
|
-
options: {
|
|
107
|
-
pattern: minificationPattern
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
this.addTask("generateLibraryManifest", async () => {
|
|
113
|
-
return getTask("generateLibraryManifest").task({
|
|
114
|
-
workspace: resourceCollections.workspace,
|
|
115
|
-
dependencies: resourceCollections.dependencies,
|
|
116
|
-
taskUtil,
|
|
117
|
-
options: {
|
|
118
|
-
projectName: project.metadata.name
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
if (project.metadata.namespace) {
|
|
125
|
-
this.addTask("generateManifestBundle", async () => {
|
|
126
|
-
return getTask("generateManifestBundle").task({
|
|
127
|
-
workspace: resourceCollections.workspace,
|
|
128
|
-
options: {
|
|
129
|
-
projectName: project.metadata.name,
|
|
130
|
-
namespace: project.metadata.namespace
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
const componentPreload = project.builder && project.builder.componentPreload;
|
|
137
|
-
if (componentPreload) {
|
|
138
|
-
this.addTask("generateComponentPreload", async () => {
|
|
139
|
-
return getTask("generateComponentPreload").task({
|
|
140
|
-
workspace: resourceCollections.workspace,
|
|
141
|
-
dependencies: resourceCollections.dependencies,
|
|
142
|
-
taskUtil,
|
|
143
|
-
options: {
|
|
144
|
-
projectName: project.metadata.name,
|
|
145
|
-
paths: componentPreload.paths,
|
|
146
|
-
namespaces: componentPreload.namespaces,
|
|
147
|
-
excludes: componentPreload.excludes
|
|
148
|
-
}
|
|
149
|
-
});
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
this.addTask("generateLibraryPreload", async () => {
|
|
154
|
-
return getTask("generateLibraryPreload").task({
|
|
155
|
-
workspace: resourceCollections.workspace,
|
|
156
|
-
dependencies: resourceCollections.dependencies,
|
|
157
|
-
taskUtil,
|
|
158
|
-
options: {
|
|
159
|
-
projectName: project.metadata.name,
|
|
160
|
-
excludes:
|
|
161
|
-
project.builder &&
|
|
162
|
-
project.builder.libraryPreload &&
|
|
163
|
-
project.builder.libraryPreload.excludes
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
const bundles = project.builder && project.builder.bundles;
|
|
169
|
-
if (bundles) {
|
|
170
|
-
this.addTask("generateBundle", async () => {
|
|
171
|
-
return bundles.reduce(function(sequence, bundle) {
|
|
172
|
-
return sequence.then(function() {
|
|
173
|
-
return getTask("generateBundle").task({
|
|
174
|
-
workspace: resourceCollections.workspace,
|
|
175
|
-
dependencies: resourceCollections.dependencies,
|
|
176
|
-
taskUtil,
|
|
177
|
-
options: {
|
|
178
|
-
projectName: project.metadata.name,
|
|
179
|
-
bundleDefinition: bundle.bundleDefinition,
|
|
180
|
-
bundleOptions: bundle.bundleOptions
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
});
|
|
184
|
-
}, Promise.resolve());
|
|
185
|
-
});
|
|
186
|
-
}
|
|
187
|
-
|
|
188
|
-
this.addTask("buildThemes", async () => {
|
|
189
|
-
// Only compile themes directly below the lib namespace to be in sync with the theme support at runtime
|
|
190
|
-
// which only loads themes from that folder.
|
|
191
|
-
// TODO 3.0: Remove fallback in case of missing namespace
|
|
192
|
-
const inputPattern = `/resources/${project.metadata.namespace || "**"}/themes/*/library.source.less`;
|
|
193
|
-
|
|
194
|
-
return getTask("buildThemes").task({
|
|
195
|
-
workspace: resourceCollections.workspace,
|
|
196
|
-
dependencies: resourceCollections.dependencies,
|
|
197
|
-
options: {
|
|
198
|
-
projectName: project.metadata.name,
|
|
199
|
-
librariesPattern: !taskUtil.isRootProject() ? "/resources/**/(*.library|library.js)" : undefined,
|
|
200
|
-
themesPattern: !taskUtil.isRootProject() ? "/resources/sap/ui/core/themes/*" : undefined,
|
|
201
|
-
inputPattern,
|
|
202
|
-
cssVariables: taskUtil.getBuildOption("cssVariables")
|
|
203
|
-
}
|
|
204
|
-
});
|
|
205
|
-
});
|
|
206
|
-
|
|
207
|
-
this.addTask("generateThemeDesignerResources", async () => {
|
|
208
|
-
return getTask("generateThemeDesignerResources").task({
|
|
209
|
-
workspace: resourceCollections.workspace,
|
|
210
|
-
dependencies: resourceCollections.dependencies,
|
|
211
|
-
options: {
|
|
212
|
-
projectName: project.metadata.name,
|
|
213
|
-
version: project.version,
|
|
214
|
-
namespace: project.metadata.namespace
|
|
215
|
-
}
|
|
216
|
-
});
|
|
217
|
-
});
|
|
218
|
-
|
|
219
|
-
this.addTask("generateResourcesJson", () => {
|
|
220
|
-
return getTask("generateResourcesJson").task({
|
|
221
|
-
workspace: resourceCollections.workspace,
|
|
222
|
-
dependencies: resourceCollections.dependencies,
|
|
223
|
-
taskUtil,
|
|
224
|
-
options: {
|
|
225
|
-
projectName: project.metadata.name
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
module.exports = LibraryBuilder;
|