@ui5/builder 3.0.0-alpha.9 → 3.0.0-beta.1
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/.reuse/dep5 +2 -2
- package/CHANGELOG.md +42 -1
- package/CONTRIBUTING.md +1 -1
- package/README.md +4 -4
- package/jsdoc.json +2 -2
- package/lib/lbt/UI5ClientConstants.js +7 -8
- package/lib/lbt/analyzer/ComponentAnalyzer.js +60 -22
- package/lib/lbt/analyzer/FioriElementsAnalyzer.js +31 -20
- package/lib/lbt/analyzer/JSModuleAnalyzer.js +107 -65
- package/lib/lbt/analyzer/SmartTemplateAnalyzer.js +31 -20
- package/lib/lbt/analyzer/XMLCompositeAnalyzer.js +35 -25
- package/lib/lbt/analyzer/XMLTemplateAnalyzer.js +71 -18
- package/lib/lbt/analyzer/analyzeLibraryJS.js +22 -6
- package/lib/lbt/bundle/AutoSplitter.js +10 -11
- package/lib/lbt/bundle/Builder.js +33 -36
- package/lib/lbt/bundle/BundleDefinition.js +1 -5
- package/lib/lbt/bundle/BundleWriter.js +1 -2
- package/lib/lbt/bundle/ResolvedBundleDefinition.js +6 -7
- package/lib/lbt/bundle/Resolver.js +11 -12
- package/lib/lbt/calls/SapUiDefine.js +16 -11
- package/lib/lbt/graph/dependencyGraph.js +3 -4
- package/lib/lbt/graph/dominatorTree.js +3 -3
- package/lib/lbt/graph/topologicalSort.js +3 -3
- package/lib/lbt/resources/LibraryFileAnalyzer.js +5 -8
- package/lib/lbt/resources/LocatorResource.js +2 -2
- package/lib/lbt/resources/LocatorResourcePool.js +3 -3
- package/lib/lbt/resources/ModuleInfo.js +1 -2
- package/lib/lbt/resources/Resource.js +3 -4
- package/lib/lbt/resources/ResourceCollector.js +7 -8
- package/lib/lbt/resources/ResourceFilterList.js +38 -40
- package/lib/lbt/resources/ResourceInfo.js +1 -1
- package/lib/lbt/resources/ResourceInfoList.js +5 -3
- package/lib/lbt/resources/ResourcePool.js +15 -21
- package/lib/lbt/utils/ASTUtils.js +58 -44
- package/lib/lbt/utils/JSTokenizer.js +4 -4
- package/lib/lbt/utils/ModuleName.js +10 -20
- package/lib/lbt/utils/escapePropertiesFile.js +3 -3
- package/lib/lbt/utils/parseUtils.js +4 -10
- package/lib/processors/bootstrapHtmlTransformer.js +15 -7
- package/lib/processors/bundlers/flexChangesBundler.js +16 -8
- package/lib/processors/bundlers/manifestBundler.js +19 -10
- package/lib/processors/bundlers/moduleBundler.js +26 -15
- package/lib/processors/jsdoc/apiIndexGenerator.js +16 -9
- package/lib/processors/jsdoc/jsdocGenerator.js +31 -17
- package/lib/processors/jsdoc/lib/{createIndexFiles.js → createIndexFiles.cjs} +0 -0
- package/lib/processors/jsdoc/lib/{transformApiJson.js → transformApiJson.cjs} +58 -2
- package/lib/processors/jsdoc/lib/ui5/{plugin.js → plugin.cjs} +306 -119
- package/lib/processors/jsdoc/lib/ui5/template/{publish.js → publish.cjs} +1 -1
- package/lib/processors/jsdoc/lib/ui5/template/utils/{versionUtil.js → versionUtil.cjs} +0 -0
- package/lib/processors/jsdoc/sdkTransformer.js +18 -11
- package/lib/processors/libraryLessGenerator.js +28 -16
- package/lib/processors/manifestCreator.js +14 -13
- package/lib/processors/minifier.js +22 -16
- package/lib/processors/nonAsciiEscaper.js +16 -6
- package/lib/processors/resourceListCreator.js +13 -13
- package/lib/processors/stringReplacer.js +13 -6
- package/lib/processors/themeBuilder.js +33 -24
- package/lib/processors/versionInfoGenerator.js +33 -23
- package/lib/tasks/buildThemes.js +18 -11
- package/lib/tasks/bundlers/generateBundle.js +23 -12
- package/lib/tasks/bundlers/generateComponentPreload.js +18 -10
- package/lib/tasks/bundlers/generateFlexChangesBundle.js +16 -8
- package/lib/tasks/bundlers/generateLibraryPreload.js +22 -12
- package/lib/tasks/bundlers/generateManifestBundle.js +15 -6
- package/lib/tasks/bundlers/generateStandaloneAppBundle.js +21 -13
- package/lib/tasks/bundlers/utils/createModuleNameMapping.js +6 -6
- package/lib/tasks/escapeNonAsciiCharacters.js +12 -5
- package/lib/tasks/generateCachebusterInfo.js +16 -8
- package/lib/tasks/generateLibraryManifest.js +14 -8
- package/lib/tasks/generateResourcesJson.js +15 -9
- package/lib/tasks/generateThemeDesignerResources.js +19 -9
- package/lib/tasks/generateVersionInfo.js +12 -5
- package/lib/tasks/jsdoc/executeJsdocSdkTransformation.js +17 -9
- package/lib/tasks/jsdoc/generateApiIndex.js +16 -10
- package/lib/tasks/jsdoc/generateJsdoc.js +131 -119
- package/lib/tasks/minify.js +13 -6
- package/lib/tasks/replaceBuildtime.js +12 -5
- package/lib/tasks/replaceCopyright.js +12 -5
- package/lib/tasks/replaceVersion.js +12 -5
- package/lib/tasks/taskRepository.js +24 -29
- package/lib/tasks/transformBootstrapHtml.js +6 -5
- package/package.json +33 -18
- package/index.js +0 -173
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {MODULE__JQUERY_SAP_GLOBAL, MODULE__SAP_UI_CORE_CORE} from "../UI5ClientConstants.js";
|
|
3
|
+
import ModuleInfo from "../resources/ModuleInfo.js";
|
|
4
|
+
import {SectionType} from "./BundleDefinition.js";
|
|
6
5
|
|
|
7
6
|
class ResolvedBundleDefinition {
|
|
8
7
|
constructor( bundleDefinition /* , vars*/) {
|
|
@@ -18,7 +17,7 @@ class ResolvedBundleDefinition {
|
|
|
18
17
|
return this.sections.some(
|
|
19
18
|
(section) =>
|
|
20
19
|
(section.mode === SectionType.Raw || section.mode === SectionType.Require) &&
|
|
21
|
-
section.modules.some((module) => module ===
|
|
20
|
+
section.modules.some((module) => module === MODULE__SAP_UI_CORE_CORE)
|
|
22
21
|
);
|
|
23
22
|
}
|
|
24
23
|
|
|
@@ -26,7 +25,7 @@ class ResolvedBundleDefinition {
|
|
|
26
25
|
return this.sections.some(
|
|
27
26
|
(section) =>
|
|
28
27
|
section.mode === SectionType.Raw &&
|
|
29
|
-
section.modules.some((module) => module ===
|
|
28
|
+
section.modules.some((module) => module === MODULE__JQUERY_SAP_GLOBAL)
|
|
30
29
|
);
|
|
31
30
|
}
|
|
32
31
|
|
|
@@ -108,4 +107,4 @@ class ResolvedSection {
|
|
|
108
107
|
}
|
|
109
108
|
}
|
|
110
109
|
|
|
111
|
-
|
|
110
|
+
export default ResolvedBundleDefinition;
|
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Takes a bundle definition and resolves it against the given pool.
|
|
3
3
|
*/
|
|
4
|
-
"use strict";
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const log =
|
|
5
|
+
import topologicalSort from "../graph/topologicalSort.js";
|
|
6
|
+
import {getRendererName} from "../UI5ClientConstants.js";
|
|
7
|
+
import ResourceFilterList from "../resources/ResourceFilterList.js";
|
|
8
|
+
import {SectionType} from "./BundleDefinition.js";
|
|
9
|
+
import ResolvedBundleDefinition from "./ResolvedBundleDefinition.js";
|
|
10
|
+
import logger from "@ui5/logger";
|
|
11
|
+
const log = logger.getLogger("lbt:bundle:Resolver");
|
|
13
12
|
|
|
14
13
|
let dependencyTracker;
|
|
15
14
|
|
|
@@ -144,7 +143,7 @@ class BundleResolver {
|
|
|
144
143
|
|
|
145
144
|
// add renderer, if 'renderer' is configured and if it exists
|
|
146
145
|
if ( section.renderer ) {
|
|
147
|
-
const rendererModuleName =
|
|
146
|
+
const rendererModuleName = getRendererName( resourceName );
|
|
148
147
|
promises.push( checkAndAddResource( rendererModuleName, depth + 1) );
|
|
149
148
|
}
|
|
150
149
|
}
|
|
@@ -292,12 +291,12 @@ class BundleResolver {
|
|
|
292
291
|
if ( section.mode == SectionType.Raw && section.sort !== false ) {
|
|
293
292
|
// sort the modules in topological order
|
|
294
293
|
return topologicalSort(pool, modules).then( (modules) => {
|
|
295
|
-
log.
|
|
294
|
+
log.silly(" resolved modules (sorted): %s", modules);
|
|
296
295
|
return modules;
|
|
297
296
|
});
|
|
298
297
|
}
|
|
299
298
|
|
|
300
|
-
log.
|
|
299
|
+
log.silly(" resolved modules: %s", modules);
|
|
301
300
|
return modules;
|
|
302
301
|
}).then( function(modules) {
|
|
303
302
|
resolvedSection.modules = modules;
|
|
@@ -324,5 +323,5 @@ class BundleResolver {
|
|
|
324
323
|
}
|
|
325
324
|
|
|
326
325
|
|
|
327
|
-
|
|
326
|
+
export default BundleResolver;
|
|
328
327
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import {Syntax} from "../utils/parseUtils.js";
|
|
3
|
+
import {resolveRelativeRequireJSName} from "../utils/ModuleName.js";
|
|
4
|
+
import {isBoolean, getStringValue} from "../utils/ASTUtils.js";
|
|
6
5
|
|
|
7
6
|
class SapUiDefineCall {
|
|
8
7
|
constructor(node, moduleName) {
|
|
@@ -11,6 +10,7 @@ class SapUiDefineCall {
|
|
|
11
10
|
this.dependencyArray = null;
|
|
12
11
|
this.factory = null;
|
|
13
12
|
this.exportAsGlobal = false;
|
|
13
|
+
this.paramNames = null;
|
|
14
14
|
|
|
15
15
|
const args = node.arguments;
|
|
16
16
|
if ( args == null ) {
|
|
@@ -27,28 +27,33 @@ class SapUiDefineCall {
|
|
|
27
27
|
let i = 0;
|
|
28
28
|
let params;
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const name = getStringValue(args[i]);
|
|
31
|
+
if ( i < args.length && name ) {
|
|
31
32
|
// assert(String)
|
|
32
|
-
this.name =
|
|
33
|
+
this.name = name;
|
|
34
|
+
i++;
|
|
33
35
|
}
|
|
34
36
|
|
|
35
37
|
if ( i < args.length && args[i].type === Syntax.ArrayExpression ) {
|
|
36
38
|
this.dependencyArray = args[i++];
|
|
37
39
|
this.dependencies = this.dependencyArray.elements.map( (elem) => {
|
|
38
|
-
|
|
40
|
+
const value = getStringValue(elem);
|
|
41
|
+
if ( !value ) {
|
|
39
42
|
throw new TypeError();
|
|
40
43
|
}
|
|
41
|
-
return
|
|
44
|
+
return resolveRelativeRequireJSName(this.name, value);
|
|
42
45
|
});
|
|
43
46
|
this.dependencyInsertionIdx = this.dependencyArray.elements.length;
|
|
44
47
|
}
|
|
45
48
|
|
|
46
|
-
if ( i < args.length &&
|
|
49
|
+
if ( i < args.length && (
|
|
50
|
+
args[i].type === Syntax.FunctionExpression || args[i].type === Syntax.ArrowFunctionExpression)
|
|
51
|
+
) {
|
|
47
52
|
this.factory = args[i++];
|
|
48
53
|
params = this.factory.params;
|
|
49
54
|
this.paramNames = params.map( (param) => {
|
|
50
55
|
if ( param.type !== Syntax.Identifier ) {
|
|
51
|
-
|
|
56
|
+
return null;
|
|
52
57
|
}
|
|
53
58
|
return param.name;
|
|
54
59
|
});
|
|
@@ -88,4 +93,4 @@ class SapUiDefineCall {
|
|
|
88
93
|
}
|
|
89
94
|
}
|
|
90
95
|
|
|
91
|
-
|
|
96
|
+
export default SapUiDefineCall;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
const log = require("@ui5/logger").getLogger("lbt:graph:dependencyGraph");
|
|
1
|
+
import logger from "@ui5/logger";
|
|
2
|
+
const log = logger.getLogger("lbt:graph:dependencyGraph");
|
|
4
3
|
|
|
5
4
|
class Node {
|
|
6
5
|
constructor(name) {
|
|
@@ -64,7 +63,7 @@ async function createDependencyGraph(pool, roots, options) {
|
|
|
64
63
|
});
|
|
65
64
|
}
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
export default createDependencyGraph;
|
|
68
67
|
|
|
69
68
|
// TODO introduce class Graph
|
|
70
69
|
// TODO remove n0 here, only introduce it in dominator tree (using the Graph API)
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
import logger from "@ui5/logger";
|
|
2
|
+
const log = logger.getLogger("lbt:graph:dominatorTree");
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Creates a dependency graph starting from the given set of root modules.
|
|
@@ -16,7 +17,6 @@
|
|
|
16
17
|
* @private
|
|
17
18
|
*/
|
|
18
19
|
function calculateDominatorTree({n0, nodes}) {
|
|
19
|
-
const log = require("@ui5/logger").getLogger("lbt:graph:dominatorTree");
|
|
20
20
|
// initialize set of dominators for each node
|
|
21
21
|
for ( const n of nodes.values() ) {
|
|
22
22
|
if ( n === n0 ) {
|
|
@@ -113,4 +113,4 @@ function calculateDominatorTree({n0, nodes}) {
|
|
|
113
113
|
return n0;
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
|
|
116
|
+
export default calculateDominatorTree;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
import logger from "@ui5/logger";
|
|
3
|
+
const log = logger.getLogger("lbt:graph:topologicalSort");
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Represents a module and its dependencies in a dependency graph.
|
|
@@ -186,4 +186,4 @@ function topologicalSort(pool, moduleNames) {
|
|
|
186
186
|
});
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
|
|
189
|
+
export default topologicalSort;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Used by the ResourcePool to read raw module info as stored in the .
|
|
2
|
+
* Used by the ResourcePool to read raw module info as stored in the .library files.
|
|
3
3
|
* It does not (yet) analyze dependencies of the library and therefore isn't part of the analyzer package (yet).
|
|
4
4
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
const log = require("@ui5/logger").getLogger("lbt:resources:LibraryFileAnalyzer");
|
|
5
|
+
import xml2js from "xml2js";
|
|
6
|
+
import logger from "@ui5/logger";
|
|
7
|
+
const log = logger.getLogger("lbt:resources:LibraryFileAnalyzer");
|
|
9
8
|
|
|
10
9
|
const parser = new xml2js.Parser({
|
|
11
10
|
// explicitChildren: true,
|
|
@@ -49,7 +48,7 @@ function createRawInfo(rawModule) {
|
|
|
49
48
|
}
|
|
50
49
|
}
|
|
51
50
|
|
|
52
|
-
function getDependencyInfos( name, content ) {
|
|
51
|
+
export function getDependencyInfos( name, content ) {
|
|
53
52
|
const infos = {};
|
|
54
53
|
parser.parseString(content, (err, result) => {
|
|
55
54
|
if ( result &&
|
|
@@ -77,5 +76,3 @@ function getDependencyInfos( name, content ) {
|
|
|
77
76
|
// console.log("done", infos);
|
|
78
77
|
return infos;
|
|
79
78
|
}
|
|
80
|
-
|
|
81
|
-
module.exports.getDependencyInfos = getDependencyInfos;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import Resource from "./Resource.js";
|
|
2
2
|
|
|
3
3
|
class LocatorResource extends Resource {
|
|
4
4
|
constructor(pool, resource, moduleName) {
|
|
@@ -19,4 +19,4 @@ class LocatorResource extends Resource {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
export default LocatorResource;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import ResourcePool from "./ResourcePool.js";
|
|
2
|
+
import LocatorResource from "./LocatorResource.js";
|
|
3
3
|
|
|
4
4
|
class LocatorResourcePool extends ResourcePool {
|
|
5
5
|
prepare(resources, moduleNameMapping) {
|
|
@@ -16,4 +16,4 @@ class LocatorResourcePool extends ResourcePool {
|
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
export default LocatorResourcePool;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
import {promisify} from "node:util";
|
|
3
|
+
import fs from "graceful-fs";
|
|
5
4
|
const readFile = promisify(fs.readFile);
|
|
6
5
|
|
|
7
6
|
class Resource {
|
|
@@ -27,4 +26,4 @@ class Resource {
|
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
30
|
-
|
|
29
|
+
export default Resource;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import ResourceInfoList from "./ResourceInfoList.js";
|
|
2
|
+
import ResourceFilterList from "./ResourceFilterList.js";
|
|
3
|
+
import ResourceInfo from "./ResourceInfo.js";
|
|
4
|
+
import logger from "@ui5/logger";
|
|
5
|
+
const log = logger.getLogger("lbt:resources:ResourceCollector");
|
|
5
6
|
|
|
6
7
|
const LOCALE = /^((?:[^/]+\/)*[^/]+?)_([A-Z]{2}(?:_[A-Z]{2}(?:_[A-Z0-9_]+)?)?)(\.properties|\.hdbtextbundle)$/i;
|
|
7
8
|
const THEME = /^((?:[^/]+\/)*)themes\/([^/]+)\//;
|
|
8
9
|
|
|
9
|
-
const log = require("@ui5/logger").getLogger("lbt:resources:ResourceCollector");
|
|
10
|
-
|
|
11
10
|
/**
|
|
12
11
|
* Collects all resources in a set of resource folders or from an archive
|
|
13
12
|
* and writes a 'resources.json' file for each component or library
|
|
@@ -76,7 +75,7 @@ class ResourceCollector {
|
|
|
76
75
|
/**
|
|
77
76
|
* Processes a resource
|
|
78
77
|
*
|
|
79
|
-
* @param {
|
|
78
|
+
* @param {@ui5/fs/Resource} resource
|
|
80
79
|
*/
|
|
81
80
|
async visitResource(resource) {
|
|
82
81
|
const virPath = resource.getPath();
|
|
@@ -400,4 +399,4 @@ class ResourceCollector {
|
|
|
400
399
|
}
|
|
401
400
|
}
|
|
402
401
|
|
|
403
|
-
|
|
402
|
+
export default ResourceCollector;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
|
|
3
|
-
|
|
2
|
+
import logger from "@ui5/logger";
|
|
3
|
+
const log = logger.getLogger("lbt:resources:ResourceFilterList");
|
|
4
4
|
|
|
5
5
|
const FILTER_PREFIXES = /^[-!+]/;
|
|
6
6
|
|
|
@@ -95,7 +95,7 @@ function makeMatcher(globPattern, fileTypesPattern) {
|
|
|
95
95
|
* @since 1.16.2
|
|
96
96
|
* @private
|
|
97
97
|
*/
|
|
98
|
-
class ResourceFilterList {
|
|
98
|
+
export default class ResourceFilterList {
|
|
99
99
|
constructor(filters, fileTypes) {
|
|
100
100
|
this.matchers = [];
|
|
101
101
|
this.matchByDefault = true;
|
|
@@ -127,43 +127,43 @@ class ResourceFilterList {
|
|
|
127
127
|
toString() {
|
|
128
128
|
return this.matchers.map((matcher) => matcher.pattern).join(",");
|
|
129
129
|
}
|
|
130
|
-
}
|
|
131
130
|
|
|
132
|
-
/**
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
131
|
+
/**
|
|
132
|
+
* Each filter entry can be a comma separated list of simple filters. Each simple filter
|
|
133
|
+
* can be a pattern in resource name pattern syntax: A double asterisk '&0x2a;&0x2a;/' denotes an arbitrary
|
|
134
|
+
* number of resource name segments (folders) incl. a trailing slash, whereas a simple asterisk '*'
|
|
135
|
+
* denotes an arbitrary number of resource name characters, but not the segment separator '/'.
|
|
136
|
+
* A dot is interpreted as a dot, all other special regular expression characters keep their
|
|
137
|
+
* special meaning. This is a mixture of ANT-style path patterns and regular expressions.
|
|
138
|
+
*
|
|
139
|
+
* Excludes can be denoted by a leading '-' or '!', includes optionally by a leading '+'.
|
|
140
|
+
* Order of filters is significant, a later exclusion overrides an earlier inclusion
|
|
141
|
+
* and vice versa.
|
|
142
|
+
*
|
|
143
|
+
* Example:
|
|
144
|
+
* <pre>
|
|
145
|
+
* !sap/ui/core/
|
|
146
|
+
* +sap/ui/core/utils/
|
|
147
|
+
* </pre>
|
|
148
|
+
* excludes everything from sap/ui/core, but includes everything from the subpackage sap/ui/core/utils/.
|
|
149
|
+
*
|
|
150
|
+
* Note that the filter operates on the full name of each resource. If a resource name
|
|
151
|
+
* <code>prefix</code> is configured for a resource set, the filter will be applied
|
|
152
|
+
* to the combination of prefix and local file path and not only to the local file path.
|
|
153
|
+
*
|
|
154
|
+
* @param {string} filterStr comma separated list of simple filters
|
|
155
|
+
* @returns {ResourceFilterList}
|
|
156
|
+
*/
|
|
157
|
+
static fromString(filterStr) {
|
|
158
|
+
const result = new ResourceFilterList();
|
|
159
|
+
if ( filterStr != null ) {
|
|
160
|
+
result.addFilters( filterStr.trim().split(/\s*,\s*/).filter(Boolean) );
|
|
161
|
+
}
|
|
162
|
+
return result;
|
|
162
163
|
}
|
|
163
|
-
|
|
164
|
-
};
|
|
164
|
+
}
|
|
165
165
|
|
|
166
|
-
|
|
166
|
+
export function negateFilters(patterns) {
|
|
167
167
|
return patterns.map((pattern) => {
|
|
168
168
|
let include = true;
|
|
169
169
|
|
|
@@ -181,6 +181,4 @@ ResourceFilterList.negateFilters = function(patterns) {
|
|
|
181
181
|
return "+" + pattern;
|
|
182
182
|
}
|
|
183
183
|
});
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
module.exports = ResourceFilterList;
|
|
184
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import ResourceInfo from "./ResourceInfo.js";
|
|
2
2
|
|
|
3
3
|
const DEBUG_RESOURCES_PATTERN = /-dbg((?:\.view|\.fragment|\.controller|\.designtime|\.support)?\.js|\.css)$/;
|
|
4
4
|
|
|
@@ -24,7 +24,9 @@ class ResourceInfoList {
|
|
|
24
24
|
|
|
25
25
|
// --- transient state ---
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* The name of the resource
|
|
28
|
+
*
|
|
29
|
+
* @type {string}
|
|
28
30
|
*/
|
|
29
31
|
this.name = prefix;
|
|
30
32
|
/**
|
|
@@ -114,4 +116,4 @@ class ResourceInfoList {
|
|
|
114
116
|
}
|
|
115
117
|
}
|
|
116
118
|
|
|
117
|
-
|
|
119
|
+
export default ResourceInfoList;
|
|
@@ -1,24 +1,18 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
const
|
|
13
|
-
const XMLTemplateAnalyzer = require("../analyzer/XMLTemplateAnalyzer");
|
|
14
|
-
|
|
15
|
-
const LibraryFileAnalyzer = require("./LibraryFileAnalyzer");
|
|
16
|
-
const ModuleInfo = require("./ModuleInfo");
|
|
17
|
-
const ResourceFilterList = require("./ResourceFilterList");
|
|
1
|
+
import {parseJS} from "../utils/parseUtils.js";
|
|
2
|
+
import ComponentAnalyzer from "../analyzer/ComponentAnalyzer.js";
|
|
3
|
+
import SmartTemplateAnalyzer from "../analyzer/SmartTemplateAnalyzer.js";
|
|
4
|
+
import FioriElementsAnalyzer from "../analyzer/FioriElementsAnalyzer.js";
|
|
5
|
+
import XMLCompositeAnalyzer from "../analyzer/XMLCompositeAnalyzer.js";
|
|
6
|
+
import JSModuleAnalyzer from "../analyzer/JSModuleAnalyzer.js";
|
|
7
|
+
import XMLTemplateAnalyzer from "../analyzer/XMLTemplateAnalyzer.js";
|
|
8
|
+
import {getDependencyInfos} from "./LibraryFileAnalyzer.js";
|
|
9
|
+
import ModuleInfo from "./ModuleInfo.js";
|
|
10
|
+
import ResourceFilterList from "./ResourceFilterList.js";
|
|
11
|
+
import logger from "@ui5/logger";
|
|
12
|
+
const log = logger.getLogger("lbt:resources:ResourcePool");
|
|
18
13
|
/*
|
|
19
|
-
|
|
14
|
+
import Resource from "./Resource";
|
|
20
15
|
*/
|
|
21
|
-
const log = require("@ui5/logger").getLogger("lbt:resources:ResourcePool");
|
|
22
16
|
|
|
23
17
|
const jsAnalyzer = new JSModuleAnalyzer();
|
|
24
18
|
|
|
@@ -165,7 +159,7 @@ class ResourcePool {
|
|
|
165
159
|
if ( /\.library$/.test(resource.name) ) {
|
|
166
160
|
// read raw-module info from .library files
|
|
167
161
|
return resource.buffer().then( (buffer) => {
|
|
168
|
-
const infos =
|
|
162
|
+
const infos = getDependencyInfos( resource.name, buffer );
|
|
169
163
|
for ( const name of Object.keys(infos) ) {
|
|
170
164
|
this._rawModuleInfos.set(name, infos[name]);
|
|
171
165
|
}
|
|
@@ -238,5 +232,5 @@ class ResourcePool {
|
|
|
238
232
|
}
|
|
239
233
|
}
|
|
240
234
|
|
|
241
|
-
|
|
235
|
+
export default ResourcePool;
|
|
242
236
|
|