@o3r/components 11.6.0-prerelease.4 → 11.6.0-prerelease.40
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/README.md +1 -5
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts +3 -9
- package/builders/component-extractor/helpers/component/component-class.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component-class.extractor.js +34 -37
- package/builders/component-extractor/helpers/component/component-class.extractor.js.map +1 -0
- package/builders/component-extractor/helpers/component/component-config.extractor.d.ts +2 -15
- package/builders/component-extractor/helpers/component/component-config.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component-config.extractor.js +41 -48
- package/builders/component-extractor/helpers/component/component-config.extractor.js.map +1 -0
- package/builders/component-extractor/helpers/component/component-module.extractor.d.ts +51 -0
- package/builders/component-extractor/helpers/component/component-module.extractor.d.ts.map +1 -0
- package/builders/component-extractor/helpers/component/component-module.extractor.js +77 -0
- package/builders/component-extractor/helpers/component/component-module.extractor.js.map +1 -0
- package/builders/component-extractor/helpers/component/component.extractor.d.ts +2 -10
- package/builders/component-extractor/helpers/component/component.extractor.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component.extractor.js +20 -25
- package/builders/component-extractor/helpers/component/component.extractor.js.map +1 -0
- package/builders/component-extractor/helpers/component/component.parser.d.ts +2 -3
- package/builders/component-extractor/helpers/component/component.parser.d.ts.map +1 -1
- package/builders/component-extractor/helpers/component/component.parser.js +11 -14
- package/builders/component-extractor/helpers/component/component.parser.js.map +1 -0
- package/builders/component-extractor/helpers/component/index.js.map +1 -0
- package/builders/component-extractor/helpers/index.js.map +1 -0
- package/builders/component-extractor/index.d.ts.map +1 -1
- package/builders/component-extractor/index.js +25 -27
- package/builders/component-extractor/index.js.map +1 -0
- package/builders/component-extractor/schema.d.ts.map +1 -1
- package/builders/component-extractor/schema.js.map +1 -0
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts +2 -2
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.d.ts.map +1 -1
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.js +1 -1
- package/builders/metadata-check/helpers/config-metadata-comparison.helper.js.map +1 -0
- package/builders/metadata-check/helpers/index.js.map +1 -0
- package/builders/metadata-check/index.d.ts.map +1 -1
- package/builders/metadata-check/index.js.map +1 -0
- package/builders/metadata-check/schema.d.ts.map +1 -1
- package/builders/metadata-check/schema.js.map +1 -0
- package/core/component.output.d.ts.map +1 -1
- package/core/rendering/helpers.d.ts +0 -1
- package/core/rendering/helpers.d.ts.map +1 -1
- package/devkit/components-devkit.interface.d.ts.map +1 -1
- package/devkit/components-devtools.message.service.d.ts +4 -8
- package/devkit/components-devtools.message.service.d.ts.map +1 -1
- package/devkit/components-devtools.module.d.ts.map +1 -1
- package/devkit/components-devtools.token.d.ts +1 -1
- package/devkit/components-devtools.token.d.ts.map +1 -1
- package/devkit/inspector/ng/ng.d.ts +3 -1
- package/devkit/inspector/ng/ng.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.helpers.d.ts.map +1 -1
- package/devkit/inspector/otter-inspector.service.d.ts.map +1 -1
- package/esm2022/core/component.output.mjs +1 -1
- package/esm2022/core/rendering/helpers.mjs +3 -4
- package/esm2022/devkit/components-devkit.interface.mjs +7 -7
- package/esm2022/devkit/components-devtools.message.service.mjs +20 -24
- package/esm2022/devkit/components-devtools.module.mjs +10 -10
- package/esm2022/devkit/components-devtools.token.mjs +2 -2
- package/esm2022/devkit/index.mjs +1 -1
- package/esm2022/devkit/inspector/index.mjs +1 -1
- package/esm2022/devkit/inspector/ng/ng.mjs +1 -1
- package/esm2022/devkit/inspector/otter-inspector.helpers.mjs +8 -8
- package/esm2022/devkit/inspector/otter-inspector.service.mjs +8 -8
- package/esm2022/rules-engine/placeholder.action-handler.mjs +26 -28
- package/esm2022/rules-engine/placeholder.interfaces.mjs +1 -1
- package/esm2022/rules-engine/placeholder.rules-engine.effect.mjs +28 -25
- package/esm2022/rules-engine/placeholder.rules-engine.module.mjs +10 -10
- package/esm2022/rules-engine/public_api.mjs +2 -2
- package/esm2022/stores/index.mjs +2 -2
- package/esm2022/stores/placeholder-request/index.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.actions.mjs +3 -3
- package/esm2022/stores/placeholder-request/placeholder-request.module.mjs +9 -9
- package/esm2022/stores/placeholder-request/placeholder-request.reducer.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.selectors.mjs +4 -4
- package/esm2022/stores/placeholder-request/placeholder-request.state.mjs +1 -1
- package/esm2022/stores/placeholder-request/placeholder-request.sync.mjs +3 -3
- package/esm2022/stores/placeholder-template/index.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.actions.mjs +2 -2
- package/esm2022/stores/placeholder-template/placeholder-template.module.mjs +9 -9
- package/esm2022/stores/placeholder-template/placeholder-template.reducer.mjs +3 -3
- package/esm2022/stores/placeholder-template/placeholder-template.selectors.mjs +8 -8
- package/esm2022/stores/placeholder-template/placeholder-template.state.mjs +1 -1
- package/esm2022/stores/placeholder-template/placeholder-template.sync.mjs +2 -2
- package/esm2022/tools/component-replacement/c11n.directive.mjs +9 -8
- package/esm2022/tools/component-replacement/c11n.helpers.mjs +1 -1
- package/esm2022/tools/component-replacement/c11n.mock.module.mjs +15 -15
- package/esm2022/tools/component-replacement/c11n.module.mjs +10 -9
- package/esm2022/tools/component-replacement/c11n.service.mjs +7 -7
- package/esm2022/tools/component-replacement/c11n.token.mjs +2 -2
- package/esm2022/tools/component-replacement/index.mjs +3 -3
- package/esm2022/tools/pipes/capitalize/capitalize.module.mjs +7 -7
- package/esm2022/tools/pipes/capitalize/capitalize.pipe.mjs +8 -8
- package/esm2022/tools/pipes/duration/duration.module.mjs +7 -7
- package/esm2022/tools/pipes/duration/duration.pipe.mjs +10 -9
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.module.mjs +7 -7
- package/esm2022/tools/pipes/keep-white-space/keep-white-space.pipe.mjs +8 -8
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.module.mjs +7 -7
- package/esm2022/tools/pipes/replace-with-bold/replace-with-bold.pipe.mjs +9 -9
- package/esm2022/tools/placeholder/placeholder.component.mjs +24 -27
- package/esm2022/tools/placeholder/placeholder.interface.mjs +1 -1
- package/esm2022/tools/placeholder/placeholder.module.mjs +11 -11
- package/fesm2022/o3r-components-rules-engine.mjs +45 -44
- package/fesm2022/o3r-components-rules-engine.mjs.map +1 -1
- package/fesm2022/o3r-components.mjs +253 -259
- package/fesm2022/o3r-components.mjs.map +1 -1
- package/package.json +25 -25
- package/rules-engine/placeholder.action-handler.d.ts +4 -7
- package/rules-engine/placeholder.action-handler.d.ts.map +1 -1
- package/rules-engine/placeholder.interfaces.d.ts.map +1 -1
- package/rules-engine/placeholder.rules-engine.effect.d.ts +2 -2
- package/rules-engine/placeholder.rules-engine.effect.d.ts.map +1 -1
- package/rules-engine/placeholder.rules-engine.module.d.ts.map +1 -1
- package/rules-engine/public_api.d.ts +1 -1
- package/rules-engine/public_api.d.ts.map +1 -1
- package/schematics/cms-adapter/index.d.ts.map +1 -1
- package/schematics/cms-adapter/index.js +1 -1
- package/schematics/cms-adapter/index.js.map +1 -0
- package/schematics/ng-add/helpers/devtools-registration.d.ts +0 -2
- package/schematics/ng-add/helpers/devtools-registration.d.ts.map +1 -1
- package/schematics/ng-add/helpers/devtools-registration.js +1 -3
- package/schematics/ng-add/helpers/devtools-registration.js.map +1 -0
- package/schematics/ng-add/index.d.ts.map +1 -1
- package/schematics/ng-add/index.js +3 -4
- package/schematics/ng-add/index.js.map +1 -0
- package/schematics/ng-add/schema.d.ts.map +1 -1
- package/schematics/ng-add/schema.js.map +1 -0
- package/schematics/ng-update/v10-0/index.d.ts.map +1 -1
- package/schematics/ng-update/v10-0/index.js +2 -1
- package/schematics/ng-update/v10-0/index.js.map +1 -0
- package/stores/index.d.ts +1 -1
- package/stores/index.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.actions.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.module.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.reducer.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.selectors.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.state.d.ts.map +1 -1
- package/stores/placeholder-request/placeholder-request.sync.d.ts +1 -1
- package/stores/placeholder-request/placeholder-request.sync.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.actions.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.module.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.reducer.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.selectors.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.state.d.ts.map +1 -1
- package/stores/placeholder-template/placeholder-template.sync.d.ts +2 -2
- package/stores/placeholder-template/placeholder-template.sync.d.ts.map +1 -1
- package/tools/component-replacement/c11n.directive.d.ts.map +1 -1
- package/tools/component-replacement/c11n.helpers.d.ts.map +1 -1
- package/tools/component-replacement/c11n.mock.module.d.ts.map +1 -1
- package/tools/component-replacement/c11n.module.d.ts +1 -0
- package/tools/component-replacement/c11n.module.d.ts.map +1 -1
- package/tools/component-replacement/c11n.service.d.ts.map +1 -1
- package/tools/component-replacement/c11n.token.d.ts.map +1 -1
- package/tools/component-replacement/index.d.ts +2 -2
- package/tools/component-replacement/index.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.module.d.ts.map +1 -1
- package/tools/pipes/capitalize/capitalize.pipe.d.ts.map +1 -1
- package/tools/pipes/duration/duration.module.d.ts.map +1 -1
- package/tools/pipes/duration/duration.pipe.d.ts +1 -0
- package/tools/pipes/duration/duration.pipe.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.module.d.ts.map +1 -1
- package/tools/pipes/keep-white-space/keep-white-space.pipe.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.module.d.ts.map +1 -1
- package/tools/pipes/replace-with-bold/replace-with-bold.pipe.d.ts.map +1 -1
- package/tools/placeholder/placeholder.component.d.ts +1 -1
- package/tools/placeholder/placeholder.component.d.ts.map +1 -1
- package/tools/placeholder/placeholder.interface.d.ts.map +1 -1
- package/tools/placeholder/placeholder.module.d.ts.map +1 -1
|
@@ -2,13 +2,14 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ComponentConfigExtractor = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
+
const node_fs_1 = require("node:fs");
|
|
5
6
|
const extractors_1 = require("@o3r/extractors");
|
|
6
7
|
const schematics_1 = require("@o3r/schematics");
|
|
7
|
-
const node_fs_1 = require("node:fs");
|
|
8
8
|
const ts = tslib_1.__importStar(require("typescript"));
|
|
9
9
|
/** Configuration file extractor */
|
|
10
10
|
class ComponentConfigExtractor {
|
|
11
11
|
/**
|
|
12
|
+
* Configuration file extractor constructor
|
|
12
13
|
* @param libraryName
|
|
13
14
|
* @param strictMode
|
|
14
15
|
* @param source Typescript SourceFile node of the file
|
|
@@ -35,21 +36,19 @@ class ComponentConfigExtractor {
|
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Handle error cases depending on the mode: throwing errors or logging warnings
|
|
38
|
-
*
|
|
39
39
|
* @param message the warning message to be logged
|
|
40
40
|
* @param errorMessage the error message to be thrown. If not provided, the warning one will be used
|
|
41
41
|
*/
|
|
42
42
|
handleErrorCases(message, errorMessage) {
|
|
43
|
-
if (
|
|
44
|
-
|
|
43
|
+
if (this.strictMode) {
|
|
44
|
+
throw new schematics_1.O3rCliError(errorMessage || message);
|
|
45
45
|
}
|
|
46
46
|
else {
|
|
47
|
-
throw
|
|
47
|
+
this.logger.warn(`${message.replace(/([^.])$/, '$1.')} Will throw in strict mode.`);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
/**
|
|
51
51
|
* Verifies if an UnionType has strings elements.
|
|
52
|
-
*
|
|
53
52
|
* @param node Typescript node to be checked
|
|
54
53
|
*/
|
|
55
54
|
hasStringElements(node) {
|
|
@@ -57,7 +56,6 @@ class ComponentConfigExtractor {
|
|
|
57
56
|
}
|
|
58
57
|
/**
|
|
59
58
|
* Returns the name of the symbol
|
|
60
|
-
*
|
|
61
59
|
* @param symbol
|
|
62
60
|
*/
|
|
63
61
|
getSymbolName(symbol) {
|
|
@@ -67,7 +65,6 @@ class ComponentConfigExtractor {
|
|
|
67
65
|
* Get the type from a property
|
|
68
66
|
* If the type refers to a NestedConfiguration type, then it will be replaced with element
|
|
69
67
|
* and a reference to the object will be returned
|
|
70
|
-
*
|
|
71
68
|
* @param node Typescript node to extract the data from
|
|
72
69
|
* @param configurationWrapper the configuration wrapper containing nestedConfig and union type strings
|
|
73
70
|
* @param source
|
|
@@ -89,9 +86,9 @@ class ComponentConfigExtractor {
|
|
|
89
86
|
&& this.libraries.includes(statement.moduleSpecifier.text)
|
|
90
87
|
&& !!statement.importClause?.namedBindings
|
|
91
88
|
&& ts.isNamedImports(statement.importClause.namedBindings)
|
|
92
|
-
&& !!statement.importClause.namedBindings.elements.
|
|
89
|
+
&& !!statement.importClause.namedBindings.elements.some((nameBinding) => ts.isImportSpecifier(nameBinding)
|
|
93
90
|
&& ts.isIdentifier(nameBinding.name)
|
|
94
|
-
&& nameBinding.name.escapedText === typeNode.typeName.getText()));
|
|
91
|
+
&& nameBinding.name.escapedText.toString() === typeNode.typeName.getText()));
|
|
95
92
|
if (importFromLibraries) {
|
|
96
93
|
return {
|
|
97
94
|
type: 'element[]',
|
|
@@ -105,7 +102,7 @@ class ComponentConfigExtractor {
|
|
|
105
102
|
const type = this.checker.getTypeFromTypeNode(typeNode);
|
|
106
103
|
const baseTypes = type.getBaseTypes();
|
|
107
104
|
const symbolName = this.getSymbolName(type.symbol || type.aliasSymbol);
|
|
108
|
-
const alreadyExtracted =
|
|
105
|
+
const alreadyExtracted = configurationWrapper.nestedConfiguration.some((c) => c.name === symbolName);
|
|
109
106
|
const extendsNested = !!baseTypes?.some((baseType) => this.getSymbolName(baseType.symbol).match(/^NestedConfiguration$/));
|
|
110
107
|
if (extendsNested && !alreadyExtracted) {
|
|
111
108
|
const nestedFilePath = type.symbol.parent.declarations[0].fileName;
|
|
@@ -139,7 +136,7 @@ class ComponentConfigExtractor {
|
|
|
139
136
|
if (nodeType.isUnion()) {
|
|
140
137
|
return {
|
|
141
138
|
type: 'enum',
|
|
142
|
-
choices: nodeType.types.map((type) => type.isLiteral() && type.isStringLiteral() && type.value || '')
|
|
139
|
+
choices: nodeType.types.map((type) => (type.isLiteral() && type.isStringLiteral() && type.value) || '')
|
|
143
140
|
};
|
|
144
141
|
}
|
|
145
142
|
return { type: this.DEFAULT_UNKNOWN_TYPE };
|
|
@@ -168,7 +165,6 @@ class ComponentConfigExtractor {
|
|
|
168
165
|
}
|
|
169
166
|
/**
|
|
170
167
|
* Extract the property data from an interface property signature
|
|
171
|
-
*
|
|
172
168
|
* @param propertyNode Node to extract the data from
|
|
173
169
|
* @param configurationWrapper the configuration wrapper containing nestedConfig and union type strings
|
|
174
170
|
* @param source
|
|
@@ -179,7 +175,7 @@ class ComponentConfigExtractor {
|
|
|
179
175
|
const res = {
|
|
180
176
|
description: configDocInfo?.description || '',
|
|
181
177
|
category: configDocInfo?.category,
|
|
182
|
-
label: configDocInfo?.label
|
|
178
|
+
label: configDocInfo?.label || name.replace(/([A-Z])/g, ' $1'),
|
|
183
179
|
name,
|
|
184
180
|
type: 'unknown',
|
|
185
181
|
widget: configDocInfo?.widget,
|
|
@@ -200,7 +196,6 @@ class ComponentConfigExtractor {
|
|
|
200
196
|
}
|
|
201
197
|
/**
|
|
202
198
|
* Extract the possible options in case of an enum node
|
|
203
|
-
*
|
|
204
199
|
* @param node Node to extract the data from
|
|
205
200
|
* @param source
|
|
206
201
|
*/
|
|
@@ -218,7 +213,6 @@ class ComponentConfigExtractor {
|
|
|
218
213
|
}
|
|
219
214
|
/**
|
|
220
215
|
* Get the configuration properties from a given interface node
|
|
221
|
-
*
|
|
222
216
|
* @param interfaceNode Node of a typescript interface
|
|
223
217
|
* @param configurationWrapper
|
|
224
218
|
* @param source
|
|
@@ -238,19 +232,14 @@ class ComponentConfigExtractor {
|
|
|
238
232
|
const content = extendedInterfaceNode.getText(source);
|
|
239
233
|
isConfiguration = isConfiguration || this.CONFIGURATION_INTERFACES.some((r) => r.test(content));
|
|
240
234
|
if (typeof runtime === 'undefined') {
|
|
241
|
-
|
|
242
|
-
runtime = false;
|
|
243
|
-
}
|
|
244
|
-
else {
|
|
245
|
-
runtime = new RegExp('AppRuntimeConfiguration').test(content) || undefined;
|
|
246
|
-
}
|
|
235
|
+
runtime = new RegExp('AppBuildConfiguration').test(content) ? false : new RegExp('AppRuntimeConfiguration').test(content) || undefined;
|
|
247
236
|
}
|
|
248
237
|
});
|
|
249
238
|
}
|
|
250
239
|
else if (isConfiguration && ts.isPropertySignature(node)) {
|
|
251
240
|
const property = this.extractPropertySignatureData(node, configurationWrapper, source);
|
|
252
241
|
properties.push(property);
|
|
253
|
-
if (property.category && categoriesOnProps.
|
|
242
|
+
if (property.category && !categoriesOnProps.includes(property.category)) {
|
|
254
243
|
categoriesOnProps.push(property.category);
|
|
255
244
|
}
|
|
256
245
|
}
|
|
@@ -265,7 +254,7 @@ class ComponentConfigExtractor {
|
|
|
265
254
|
const configDocInfo = this.configDocParser.parseConfigDocFromNode(source, interfaceNode);
|
|
266
255
|
if (configDocInfo && configDocInfo.categories) {
|
|
267
256
|
for (const describedCategory of configDocInfo.categories) {
|
|
268
|
-
if (categoriesOnProps.
|
|
257
|
+
if (!categoriesOnProps.includes(describedCategory.name)) {
|
|
269
258
|
this.handleErrorCases(`Description found for category "${describedCategory.name}" but no property has this category.`);
|
|
270
259
|
}
|
|
271
260
|
}
|
|
@@ -274,7 +263,6 @@ class ComponentConfigExtractor {
|
|
|
274
263
|
}
|
|
275
264
|
/**
|
|
276
265
|
* Extract the default value of a configuration interface
|
|
277
|
-
*
|
|
278
266
|
* @param variableNode Typescript node of the default constant implementing the interface
|
|
279
267
|
* @param configurationInformationWrapper Configuration object extracted from the interface
|
|
280
268
|
*/
|
|
@@ -285,11 +273,25 @@ class ComponentConfigExtractor {
|
|
|
285
273
|
if (ts.isVariableDeclaration(declarationNode)) {
|
|
286
274
|
let isConfigImplementation = false;
|
|
287
275
|
declarationNode.forEachChild((vNode) => {
|
|
288
|
-
if (ts.isTypeReferenceNode(vNode)
|
|
276
|
+
if (ts.isTypeReferenceNode(vNode)
|
|
277
|
+
&& ts.isIdentifier(vNode.typeName)
|
|
278
|
+
&& (vNode.typeName.escapedText.toString() === configurationInformationWrapper.configurationInformation.name
|
|
279
|
+
|| (vNode.typeName.escapedText.toString() === 'Readonly'
|
|
280
|
+
&& vNode.typeArguments?.[0]
|
|
281
|
+
&& ts.isTypeReferenceNode(vNode.typeArguments?.[0])
|
|
282
|
+
&& ts.isIdentifier(vNode.typeArguments?.[0].typeName)
|
|
283
|
+
&& vNode.typeArguments[0].typeName.escapedText.toString() === configurationInformationWrapper.configurationInformation.name))) {
|
|
289
284
|
isConfigImplementation = true;
|
|
290
285
|
}
|
|
291
|
-
else if (isConfigImplementation
|
|
292
|
-
|
|
286
|
+
else if (isConfigImplementation
|
|
287
|
+
&& (ts.isObjectLiteralExpression(vNode)
|
|
288
|
+
|| (ts.isAsExpression(vNode)
|
|
289
|
+
&& ts.isTypeReferenceNode(vNode.type)
|
|
290
|
+
&& ts.isIdentifier(vNode.type.typeName)
|
|
291
|
+
&& vNode.type.typeName.escapedText.toString() === 'const'
|
|
292
|
+
&& ts.isObjectLiteralExpression(vNode.expression)))) {
|
|
293
|
+
const objectExpression = ts.isObjectLiteralExpression(vNode) ? vNode : vNode.expression;
|
|
294
|
+
objectExpression.forEachChild((propertyNode) => {
|
|
293
295
|
if (ts.isPropertyAssignment(propertyNode)) {
|
|
294
296
|
let identifier;
|
|
295
297
|
propertyNode.forEachChild((fieldNode) => {
|
|
@@ -312,10 +314,8 @@ class ComponentConfigExtractor {
|
|
|
312
314
|
&& this.isTypedNestedConfiguration(property.reference.name, configurationInformationWrapper, this.libraries)) {
|
|
313
315
|
let defaultValuesMapArrayItem = {};
|
|
314
316
|
arrayItem.forEachChild((arrayItemProperty) => {
|
|
315
|
-
if (ts.isPropertyAssignment(arrayItemProperty)) {
|
|
316
|
-
|
|
317
|
-
arrayItemProperty.name.getText(this.source);
|
|
318
|
-
}
|
|
317
|
+
if (ts.isPropertyAssignment(arrayItemProperty) && ts.isStringLiteral(arrayItemProperty.name)) {
|
|
318
|
+
arrayItemProperty.name.getText(this.source);
|
|
319
319
|
}
|
|
320
320
|
// Build the property map pushing all the key/value from the default config
|
|
321
321
|
// getChildAt(0, this.source) is the key, getChildAt(1, this.source) the ":" and getChildAt(2, this.source) the value
|
|
@@ -327,7 +327,7 @@ class ComponentConfigExtractor {
|
|
|
327
327
|
property.values.push(defaultValuesMapArrayItem);
|
|
328
328
|
}
|
|
329
329
|
else {
|
|
330
|
-
|
|
330
|
+
this.logger.warn(`Unsupported type found will be ignored with kind = ${arrayItem.kind} and value = ${arrayItem.getText(this.source)}`);
|
|
331
331
|
}
|
|
332
332
|
});
|
|
333
333
|
if (typeReplacement) {
|
|
@@ -352,15 +352,13 @@ class ComponentConfigExtractor {
|
|
|
352
352
|
}
|
|
353
353
|
/**
|
|
354
354
|
* Remove all quotation marks from the input string to prevent any ""my_string"" and "'my_string'" in the metadata file
|
|
355
|
-
*
|
|
356
355
|
* @param inputString that needs to be format
|
|
357
356
|
*/
|
|
358
357
|
removeQuotationMarks(inputString) {
|
|
359
|
-
return inputString.replace(/^['
|
|
358
|
+
return inputString.replace(/^["'](.*)["']$/, '$1');
|
|
360
359
|
}
|
|
361
360
|
/**
|
|
362
361
|
* Check is name is typed as a known nested configuration
|
|
363
|
-
*
|
|
364
362
|
* @param propertyName
|
|
365
363
|
* @param nestedConfiguration List of nested configuration
|
|
366
364
|
* @param libraries
|
|
@@ -388,7 +386,6 @@ class ComponentConfigExtractor {
|
|
|
388
386
|
}
|
|
389
387
|
/**
|
|
390
388
|
* This function checks if the interface name given as parameter is extended by the interface node
|
|
391
|
-
*
|
|
392
389
|
* @param interfaceDeclaration
|
|
393
390
|
* @param extendedInterfaceNames
|
|
394
391
|
* @param source
|
|
@@ -405,7 +402,6 @@ class ComponentConfigExtractor {
|
|
|
405
402
|
}
|
|
406
403
|
/**
|
|
407
404
|
* Fill the nested configuration with default values
|
|
408
|
-
*
|
|
409
405
|
* @param nestedConfigurationInformation
|
|
410
406
|
*/
|
|
411
407
|
fillNestedConfigurationDefaultValues(nestedConfigurationInformation) {
|
|
@@ -436,7 +432,6 @@ class ComponentConfigExtractor {
|
|
|
436
432
|
}
|
|
437
433
|
/**
|
|
438
434
|
* Collect nested configuration information
|
|
439
|
-
*
|
|
440
435
|
* @param source
|
|
441
436
|
*/
|
|
442
437
|
collectNestedConfiguration(source) {
|
|
@@ -448,15 +443,13 @@ class ComponentConfigExtractor {
|
|
|
448
443
|
choices: this.extractOptionsForEnum(node.type, source)
|
|
449
444
|
});
|
|
450
445
|
}
|
|
451
|
-
if (ts.isInterfaceDeclaration(node)
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
if
|
|
457
|
-
|
|
458
|
-
configurationInformationWrapper.nestedConfiguration.push(nestedConfigurationInformation);
|
|
459
|
-
}
|
|
446
|
+
if (ts.isInterfaceDeclaration(node) // If it extends NestedConfiguration, we consider it as an independent NestedConfig
|
|
447
|
+
&& this.isExtending(node, [/NestedConfiguration/], source)) {
|
|
448
|
+
let nestedConfigurationInformation = this.getPropertiesFromConfigurationInterface(node, configurationInformationWrapper, source);
|
|
449
|
+
nestedConfigurationInformation = this.fillNestedConfigurationDefaultValues(nestedConfigurationInformation);
|
|
450
|
+
if (nestedConfigurationInformation) {
|
|
451
|
+
// We add it to the list of Nested config if the result is not undefined
|
|
452
|
+
configurationInformationWrapper.nestedConfiguration.push(nestedConfigurationInformation);
|
|
460
453
|
}
|
|
461
454
|
}
|
|
462
455
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-config.extractor.js","sourceRoot":"","sources":["../../../../../builders/component-extractor/helpers/component/component-config.extractor.ts"],"names":[],"mappings":";;;;AAAA,qCAEiB;AAcjB,gDAEyB;AACzB,gDAEyB;AACzB,uDAAiC;AA8CjC,mCAAmC;AACnC,MAAa,wBAAwB;IAanC;;;;;;;;;OASG;IACH,YACmB,WAAmB,EACnB,UAAmB,EAC7B,MAAqB,EACX,MAAyB,EACnC,QAAgB,EAChB,OAAuB,EACvB,YAAsB,EAAE;QANd,gBAAW,GAAX,WAAW,CAAQ;QACnB,eAAU,GAAV,UAAU,CAAS;QAC7B,WAAM,GAAN,MAAM,CAAe;QACX,WAAM,GAAN,MAAM,CAAmB;QACnC,aAAQ,GAAR,QAAQ,CAAQ;QAChB,YAAO,GAAP,OAAO,CAAgB;QACvB,cAAS,GAAT,SAAS,CAAe;QA7BjC,+FAA+F;QAC/E,uCAAkC,GAAa,CAAC,qBAAqB,EAAE,IAAI,MAAM,CAAC,uBAAqC,CAAC,EAAE,IAAI,MAAM,CAAC,yBAAuC,CAAC,CAAC,CAAC;QAE/L,6CAA6C;QAC7B,6BAAwB,GAAa,CAAC,GAAG,IAAI,CAAC,kCAAkC,EAAE,uBAAuB,CAAC,CAAC;QAE3H,gDAAgD;QAChC,yBAAoB,GAAG,SAAS,CAAC;QAwB/C,IAAI,CAAC,eAAe,GAAG,IAAI,4BAAe,EAAE,CAAC;IAC/C,CAAC;IAED;;;;OAIG;IACK,gBAAgB,CAAC,OAAe,EAAE,YAAqB;QAC7D,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACpB,MAAM,IAAI,wBAAW,CAAC,YAAY,IAAI,OAAO,CAAC,CAAC;QACjD,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,6BAA6B,CAAC,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;IACzC,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,8BAA8B,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAEjE,IAAI,oBAAoB,GAAG,KAAK,CAAC;QACjC,iEAAiE;QACjE,MAAM,+BAA+B,GAAG,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAErF,qFAAqF;QACrF,kEAAkE;QAClE,wHAAwH;QACxH,wIAAwI;QACxI,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YAChC,IAAI,EAAE,CAAC,sBAAsB,CAAC,IAAI,CAAC,EAAE,CAAC;gBACpC,0EAA0E;gBAC1E,IAAI,CAAC,+BAA+B,CAAC,wBAAwB,IAAI,IAAI,CAAC,WAAW,CAAC,IAAI,EAAE,IAAI,CAAC,kCAAkC,CAAC,EAAE,CAAC;oBACjI,oBAAoB,GAAG,IAAI,CAAC;oBAC5B,yGAAyG;oBACzG,+BAA+B,CAAC,wBAAwB,GAAG,IAAI,CAAC,uCAAuC,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;gBACjJ,CAAC;gBACD,mGAAmG;YACrG,CAAC;iBAAM,IAAI,oBAAoB,IAAI,+BAA+B,CAAC,wBAAwB,IAAI,EAAE,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,CAAC;gBAC5H,+BAA+B,CAAC,wBAAwB,GAAG,IAAI,CAAC,yCAAyC,CAAC,IAAI,EAAE,+BAA+B,CAAC,CAAC;YACnJ,CAAC;QACH,CAAC,CAAC,CAAC;QACH,OAAO,+BAA+B,CAAC;IACzC,CAAC;CACF;AAzfD,4DAyfC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { logging } from '@angular-devkit/core';
|
|
2
|
+
import * as ts from 'typescript';
|
|
3
|
+
/**
|
|
4
|
+
* Information extracted from a module file
|
|
5
|
+
* @deprecated will be removed in v10
|
|
6
|
+
*/
|
|
7
|
+
export interface ModuleInformation {
|
|
8
|
+
/** Name of the module */
|
|
9
|
+
name: string;
|
|
10
|
+
/** List of exported items */
|
|
11
|
+
exportedItems: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Component module extractor.
|
|
15
|
+
* @deprecated will be removed in v10
|
|
16
|
+
*/
|
|
17
|
+
export declare class ComponentModuleExtractor {
|
|
18
|
+
source: ts.SourceFile;
|
|
19
|
+
private logger;
|
|
20
|
+
filePath: string;
|
|
21
|
+
/**
|
|
22
|
+
* @param source Typescript SourceFile node of the file
|
|
23
|
+
* @param logger Logger
|
|
24
|
+
* @param filePath Path to the file to extract the data from
|
|
25
|
+
* @param cwd Current Working Directory
|
|
26
|
+
*/
|
|
27
|
+
constructor(source: ts.SourceFile, logger: logging.LoggerApi, filePath: string);
|
|
28
|
+
/**
|
|
29
|
+
* Indicates if the given decorator is a module decorator.
|
|
30
|
+
*
|
|
31
|
+
* @param decoratorNode The decorator node to test
|
|
32
|
+
*/
|
|
33
|
+
private isModuleDecorator;
|
|
34
|
+
/**
|
|
35
|
+
* Get the exported items from the given decorator.
|
|
36
|
+
*
|
|
37
|
+
* @param decoratorNode The decorator node to get the exported items from
|
|
38
|
+
*/
|
|
39
|
+
private getExportedItems;
|
|
40
|
+
/**
|
|
41
|
+
* Extract module information of a given class node
|
|
42
|
+
*
|
|
43
|
+
* @param classNode Typescript node of a class
|
|
44
|
+
*/
|
|
45
|
+
private getModuleInformation;
|
|
46
|
+
/**
|
|
47
|
+
* Extract the module data of a typescript file
|
|
48
|
+
*/
|
|
49
|
+
extract(): ModuleInformation | undefined;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=component-module.extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-module.extractor.d.ts","sourceRoot":"","sources":["../../../../../builders/component-extractor/helpers/component/component-module.extractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,OAAO,EAAC,MAAM,sBAAsB,CAAC;AAC7C,OAAO,KAAK,EAAE,MAAM,YAAY,CAAC;AAEjC;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,6BAA6B;IAC7B,aAAa,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;;GAGG;AACH,qBAAa,wBAAwB;IAQhB,MAAM,EAAE,EAAE,CAAC,UAAU;IAAE,OAAO,CAAC,MAAM;IAA4B,QAAQ,EAAE,MAAM;IANpG;;;;;OAKG;gBACgB,MAAM,EAAE,EAAE,CAAC,UAAU,EAAU,MAAM,EAAE,OAAO,CAAC,SAAS,EAAS,QAAQ,EAAE,MAAM;IAEpG;;;;OAIG;IACH,OAAO,CAAC,iBAAiB;IAIzB;;;;OAIG;IACH,OAAO,CAAC,gBAAgB;IAUxB;;;;OAIG;IACH,OAAO,CAAC,oBAAoB;IAiB5B;;OAEG;IACI,OAAO;CAaf"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentModuleExtractor = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const ts = tslib_1.__importStar(require("typescript"));
|
|
6
|
+
/**
|
|
7
|
+
* Component module extractor.
|
|
8
|
+
* @deprecated will be removed in v10
|
|
9
|
+
*/
|
|
10
|
+
class ComponentModuleExtractor {
|
|
11
|
+
/**
|
|
12
|
+
* @param source Typescript SourceFile node of the file
|
|
13
|
+
* @param logger Logger
|
|
14
|
+
* @param filePath Path to the file to extract the data from
|
|
15
|
+
* @param cwd Current Working Directory
|
|
16
|
+
*/
|
|
17
|
+
constructor(source, logger, filePath) {
|
|
18
|
+
this.source = source;
|
|
19
|
+
this.logger = logger;
|
|
20
|
+
this.filePath = filePath;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Indicates if the given decorator is a module decorator.
|
|
24
|
+
*
|
|
25
|
+
* @param decoratorNode The decorator node to test
|
|
26
|
+
*/
|
|
27
|
+
isModuleDecorator(decoratorNode) {
|
|
28
|
+
return new RegExp('^(@NgModule).*').test(decoratorNode.getText(this.source));
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Get the exported items from the given decorator.
|
|
32
|
+
*
|
|
33
|
+
* @param decoratorNode The decorator node to get the exported items from
|
|
34
|
+
*/
|
|
35
|
+
getExportedItems(decoratorNode) {
|
|
36
|
+
const exportMatches = /exports:\s*\[([^\]]*)\]/i.exec(decoratorNode.getText(this.source));
|
|
37
|
+
if (!exportMatches) {
|
|
38
|
+
return [];
|
|
39
|
+
}
|
|
40
|
+
return exportMatches[1].split(',');
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Extract module information of a given class node
|
|
44
|
+
*
|
|
45
|
+
* @param classNode Typescript node of a class
|
|
46
|
+
*/
|
|
47
|
+
getModuleInformation(classNode) {
|
|
48
|
+
let name;
|
|
49
|
+
let exportedItems;
|
|
50
|
+
classNode.forEachChild((node) => {
|
|
51
|
+
if (ts.isDecorator(node)) {
|
|
52
|
+
if (this.isModuleDecorator(node)) {
|
|
53
|
+
exportedItems = this.getExportedItems(node);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
else if (ts.isIdentifier(node)) {
|
|
57
|
+
name = node.getText(this.source);
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
return name && exportedItems ? { name, exportedItems } : undefined;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Extract the module data of a typescript file
|
|
64
|
+
*/
|
|
65
|
+
extract() {
|
|
66
|
+
this.logger.debug(`Parsing module from ${this.filePath}`);
|
|
67
|
+
let moduleInfo;
|
|
68
|
+
this.source.forEachChild((node) => {
|
|
69
|
+
if (!moduleInfo && ts.isClassDeclaration(node)) {
|
|
70
|
+
moduleInfo = this.getModuleInformation(node);
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
return moduleInfo;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
exports.ComponentModuleExtractor = ComponentModuleExtractor;
|
|
77
|
+
//# sourceMappingURL=component-module.extractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"component-module.extractor.js","sourceRoot":"","sources":["../../../../../builders/component-extractor/helpers/component/component-module.extractor.ts"],"names":[],"mappings":";;;;AACA,uDAAiC;AAajC;;;GAGG;AACH,MAAa,wBAAwB;IAEnC;;;;;OAKG;IACH,YAAmB,MAAqB,EAAU,MAAyB,EAAS,QAAgB;QAAjF,WAAM,GAAN,MAAM,CAAe;QAAU,WAAM,GAAN,MAAM,CAAmB;QAAS,aAAQ,GAAR,QAAQ,CAAQ;IAAI,CAAC;IAEzG;;;;OAIG;IACK,iBAAiB,CAAC,aAA2B;QACnD,OAAO,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC/E,CAAC;IAED;;;;OAIG;IACK,gBAAgB,CAAC,aAA2B;QAClD,MAAM,aAAa,GAAG,0BAA0B,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;QAE1F,IAAI,CAAC,aAAa,EAAE;YAClB,OAAO,EAAE,CAAC;SACX;QAED,OAAO,aAAa,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACK,oBAAoB,CAAC,SAA8B;QACzD,IAAI,IAAwB,CAAC;QAC7B,IAAI,aAAmC,CAAC;QAExC,SAAS,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YAC9B,IAAI,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,EAAE;gBACxB,IAAI,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,EAAE;oBAChC,aAAa,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC,CAAC;iBAC7C;aACF;iBAAM,IAAI,EAAE,CAAC,YAAY,CAAC,IAAI,CAAC,EAAE;gBAChC,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aAClC;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,IAAI,IAAI,aAAa,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,aAAa,EAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IACnE,CAAC;IAED;;OAEG;IACI,OAAO;QACZ,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC1D,IAAI,UAAyC,CAAC;QAE9C,IAAI,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,EAAE;YAChC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,kBAAkB,CAAC,IAAI,CAAC,EAAE;gBAC9C,UAAU,GAAG,IAAI,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;aAC9C;QACH,CAAC,CAAC,CAAC;QAEH,OAAO,UAAU,CAAC;IACpB,CAAC;CAEF;AAxED,4DAwEC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { logging } from '@angular-devkit/core';
|
|
2
|
-
import type { ComponentOutput } from '@o3r/components';
|
|
3
2
|
import type { ComponentExtractorBuilderSchema } from '../../index';
|
|
4
3
|
import { ParserOutput } from './component.parser';
|
|
4
|
+
import type { ComponentOutput } from '@o3r/components';
|
|
5
5
|
/**
|
|
6
6
|
* Extracts components metadata
|
|
7
7
|
*/
|
|
@@ -17,6 +17,7 @@ export declare class ComponentExtractor {
|
|
|
17
17
|
/** List of the loaded libraries component outputs*/
|
|
18
18
|
private libComponentClassOutputs?;
|
|
19
19
|
/**
|
|
20
|
+
* Extracts components metadata constructor
|
|
20
21
|
* @param libraryName The name of the library/app on which the extractor is run
|
|
21
22
|
* @param libraries List of libraries to extract metadata from
|
|
22
23
|
* @param logger
|
|
@@ -36,13 +37,11 @@ export declare class ComponentExtractor {
|
|
|
36
37
|
private loadLibraryComponentClassOutputs;
|
|
37
38
|
/**
|
|
38
39
|
* Indicates if the given component is referencing configuration from a library.
|
|
39
|
-
*
|
|
40
40
|
* @param component
|
|
41
41
|
*/
|
|
42
42
|
private isLibConfigRef;
|
|
43
43
|
/**
|
|
44
44
|
* Returns a ComponentConfigOutput model built using the given ConfigurationInformation, filePath and type as well as the library being processed.
|
|
45
|
-
*
|
|
46
45
|
* @param configuration
|
|
47
46
|
* @param filePath
|
|
48
47
|
* @param type
|
|
@@ -50,13 +49,11 @@ export declare class ComponentExtractor {
|
|
|
50
49
|
private createComponentConfigOutput;
|
|
51
50
|
/**
|
|
52
51
|
* Return a hash of the config output without the path
|
|
53
|
-
*
|
|
54
52
|
* @param config
|
|
55
53
|
*/
|
|
56
54
|
private hashConfiguration;
|
|
57
55
|
/**
|
|
58
56
|
* Add NestedConfiguration to map
|
|
59
|
-
*
|
|
60
57
|
* @param nestedConfigurations Map
|
|
61
58
|
* @param configurationInformationWrapper configurations to be added
|
|
62
59
|
* @param filePath
|
|
@@ -64,20 +61,17 @@ export declare class ComponentExtractor {
|
|
|
64
61
|
private addNestedConfigToMap;
|
|
65
62
|
/**
|
|
66
63
|
* Consolidate the configuration data to the final format.
|
|
67
|
-
*
|
|
68
64
|
* @param parsedData Data extracted from the source code
|
|
69
65
|
*/
|
|
70
66
|
private consolidateConfig;
|
|
71
67
|
/**
|
|
72
68
|
* Consolidate the components data to the final format
|
|
73
|
-
*
|
|
74
69
|
* @param parsedData Data extracted from the source code
|
|
75
70
|
* @param placeholdersMetadataFile
|
|
76
71
|
*/
|
|
77
72
|
private consolidateComponents;
|
|
78
73
|
/**
|
|
79
74
|
* Merge placeholders metadata information into the components metadata
|
|
80
|
-
*
|
|
81
75
|
* @param componentClassOutputs
|
|
82
76
|
* @param placeholdersMetadata
|
|
83
77
|
* @private
|
|
@@ -85,7 +79,6 @@ export declare class ComponentExtractor {
|
|
|
85
79
|
private addPlaceholdersToComponent;
|
|
86
80
|
/**
|
|
87
81
|
* Filters out config not supported by CMS
|
|
88
|
-
*
|
|
89
82
|
* @param configs
|
|
90
83
|
* @param options
|
|
91
84
|
* @private
|
|
@@ -93,7 +86,6 @@ export declare class ComponentExtractor {
|
|
|
93
86
|
private filterIncompatibleConfig;
|
|
94
87
|
/**
|
|
95
88
|
* Extract components metadata from a parser output
|
|
96
|
-
*
|
|
97
89
|
* @param parserOutput Data extracted from the source code
|
|
98
90
|
* @param options
|
|
99
91
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"component.extractor.d.ts","sourceRoot":"","sources":["../../../../../builders/component-extractor/helpers/component/component.extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"component.extractor.d.ts","sourceRoot":"","sources":["../../../../../builders/component-extractor/helpers/component/component.extractor.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,OAAO,EACR,MAAM,sBAAsB,CAAC;AAQ9B,OAAO,KAAK,EACV,+BAA+B,EAChC,MAAM,aAAa,CAAC;AAQrB,OAAO,EACL,YAAY,EACb,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAK,EAGV,eAAe,EAIhB,MAAM,iBAAiB,CAAC;AAEzB;;GAEG;AACH,qBAAa,kBAAkB;IAkBjB,OAAO,CAAC,QAAQ,CAAC,WAAW;IAA+B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAqB,OAAO,CAAC,QAAQ,CAAC,aAAa;IAAU,OAAO,CAAC,QAAQ,CAAC,UAAU;IAjBtL,2DAA2D;IAC3D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAE9C,8CAA8C;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAA4B;IAEtD,oDAAoD;IACpD,OAAO,CAAC,wBAAwB,CAAC,CAA2B;IAE5D;;;;;;;OAOG;gBAC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