@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,90 +0,0 @@
|
|
|
1
|
-
const log = require("@ui5/logger").getLogger("types:themeLibrary:ThemeLibraryFormatter");
|
|
2
|
-
const path = require("path");
|
|
3
|
-
const AbstractUi5Formatter = require("../AbstractUi5Formatter");
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
class ThemeLibraryFormatter extends AbstractUi5Formatter {
|
|
7
|
-
/**
|
|
8
|
-
* Formats and validates the project
|
|
9
|
-
*
|
|
10
|
-
* @returns {Promise}
|
|
11
|
-
*/
|
|
12
|
-
async format() {
|
|
13
|
-
const project = this._project;
|
|
14
|
-
await this.validate();
|
|
15
|
-
|
|
16
|
-
log.verbose("Formatting theme-library project %s...", project.metadata.name);
|
|
17
|
-
project.resources.pathMappings = {
|
|
18
|
-
"/resources/": project.resources.configuration.paths.src
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
if (project.resources.configuration.paths.test) {
|
|
22
|
-
// Directory 'test' is somewhat optional for theme-libraries
|
|
23
|
-
project.resources.pathMappings["/test-resources/"] = project.resources.configuration.paths.test;
|
|
24
|
-
} else {
|
|
25
|
-
log.verbose(`Ignoring 'test' directory for project ${project.metadata.name}. ` +
|
|
26
|
-
"Either no setting was provided or the path not found.");
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Validates the project
|
|
32
|
-
*
|
|
33
|
-
* @returns {Promise} resolves if successfully validated
|
|
34
|
-
* @throws {Error} if validation fails
|
|
35
|
-
*/
|
|
36
|
-
validate() {
|
|
37
|
-
const project = this._project;
|
|
38
|
-
return Promise.resolve().then(() => {
|
|
39
|
-
if (!project) {
|
|
40
|
-
throw new Error("Project is undefined");
|
|
41
|
-
} else if (project.specVersion === "0.1" || project.specVersion === "1.0") {
|
|
42
|
-
throw new Error(
|
|
43
|
-
`theme-library type requires "specVersion" 1.1 or higher. ` +
|
|
44
|
-
`Project "specVersion" is: ${project.specVersion}`);
|
|
45
|
-
} else if (!project.metadata || !project.metadata.name) {
|
|
46
|
-
throw new Error(`"metadata.name" configuration is missing for project ${project.id}`);
|
|
47
|
-
} else if (!project.type) {
|
|
48
|
-
throw new Error(`"type" configuration is missing for project ${project.id}`);
|
|
49
|
-
} else if (project.version === undefined) {
|
|
50
|
-
throw new Error(`"version" is missing for project ${project.id}`);
|
|
51
|
-
}
|
|
52
|
-
if (!project.resources) {
|
|
53
|
-
project.resources = {};
|
|
54
|
-
}
|
|
55
|
-
if (!project.resources.configuration) {
|
|
56
|
-
project.resources.configuration = {};
|
|
57
|
-
}
|
|
58
|
-
if (!project.resources.configuration.paths) {
|
|
59
|
-
project.resources.configuration.paths = {};
|
|
60
|
-
}
|
|
61
|
-
if (!project.resources.configuration.paths.src) {
|
|
62
|
-
project.resources.configuration.paths.src = "src";
|
|
63
|
-
}
|
|
64
|
-
if (!project.resources.configuration.paths.test) {
|
|
65
|
-
project.resources.configuration.paths.test = "test";
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
const absoluteSrcPath = path.join(project.path, project.resources.configuration.paths.src);
|
|
69
|
-
const absoluteTestPath = path.join(project.path, project.resources.configuration.paths.test);
|
|
70
|
-
return Promise.all([
|
|
71
|
-
this.dirExists(absoluteSrcPath).then(function(bExists) {
|
|
72
|
-
if (!bExists) {
|
|
73
|
-
throw new Error(`Could not find source directory of project ${project.id}: ` +
|
|
74
|
-
`${absoluteSrcPath}`);
|
|
75
|
-
}
|
|
76
|
-
}),
|
|
77
|
-
this.dirExists(absoluteTestPath).then(function(bExists) {
|
|
78
|
-
if (!bExists) {
|
|
79
|
-
log.verbose(`Could not find (optional) test directory of project ${project.id}: ` +
|
|
80
|
-
`${absoluteTestPath}`);
|
|
81
|
-
// Current signal to following consumers that "test" is not available is null
|
|
82
|
-
project.resources.configuration.paths.test = null;
|
|
83
|
-
}
|
|
84
|
-
})
|
|
85
|
-
]);
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
module.exports = ThemeLibraryFormatter;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const ThemeLibraryFormatter = require("./ThemeLibraryFormatter");
|
|
2
|
-
const ThemeLibraryBuilder = require("./ThemeLibraryBuilder");
|
|
3
|
-
|
|
4
|
-
module.exports = {
|
|
5
|
-
format: function(project) {
|
|
6
|
-
return new ThemeLibraryFormatter({project}).format();
|
|
7
|
-
},
|
|
8
|
-
build: function({resourceCollections, tasks, project, parentLogger, taskUtil}) {
|
|
9
|
-
return new ThemeLibraryBuilder({resourceCollections, project, parentLogger, taskUtil}).build(tasks);
|
|
10
|
-
},
|
|
11
|
-
|
|
12
|
-
// Export type classes for extensibility
|
|
13
|
-
Builder: ThemeLibraryBuilder,
|
|
14
|
-
Formatter: ThemeLibraryFormatter
|
|
15
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
const applicationType = require("./application/applicationType");
|
|
2
|
-
const libraryType = require("./library/libraryType");
|
|
3
|
-
const themeLibraryType = require("./themeLibrary/themeLibraryType");
|
|
4
|
-
const moduleType = require("./module/moduleType");
|
|
5
|
-
|
|
6
|
-
const types = {
|
|
7
|
-
"application": applicationType,
|
|
8
|
-
"library": libraryType,
|
|
9
|
-
"theme-library": themeLibraryType,
|
|
10
|
-
"module": moduleType
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Gets a type
|
|
15
|
-
*
|
|
16
|
-
* @param {string} typeName unique identifier for the type
|
|
17
|
-
* @returns {object} type identified by name
|
|
18
|
-
* @throws {Error} if not found
|
|
19
|
-
*/
|
|
20
|
-
function getType(typeName) {
|
|
21
|
-
const type = types[typeName];
|
|
22
|
-
|
|
23
|
-
if (!type) {
|
|
24
|
-
throw new Error("Unknown type '" + typeName + "'");
|
|
25
|
-
}
|
|
26
|
-
return type;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* Adds a type
|
|
31
|
-
*
|
|
32
|
-
* @param {string} typeName unique identifier for the type
|
|
33
|
-
* @param {object} type
|
|
34
|
-
* @throws {Error} if duplicate with same name was found
|
|
35
|
-
*/
|
|
36
|
-
function addType(typeName, type) {
|
|
37
|
-
if (types[typeName]) {
|
|
38
|
-
throw new Error("Type already registered '" + typeName + "'");
|
|
39
|
-
}
|
|
40
|
-
types[typeName] = type;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
module.exports = {
|
|
44
|
-
getType: getType,
|
|
45
|
-
addType: addType
|
|
46
|
-
};
|