@komaci/common-shared 242.1.4 → 242.1.6
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/build/internal-namespaces.json +26 -0
- package/build/komaci-mapping.json +63 -3
- package/build/moduleMetadata.d.ts +1 -1
- package/build/moduleMetadata.js +2 -2
- package/build/types.d.ts +7 -2
- package/build/types.js +2 -0
- package/build/utils.d.ts +6 -6
- package/build/utils.js +14 -9
- package/package.json +2 -2
|
@@ -266,6 +266,7 @@
|
|
|
266
266
|
"builder_industries_insurance",
|
|
267
267
|
"builder_industries_interaction_rule",
|
|
268
268
|
"builder_industries_publicsector",
|
|
269
|
+
"builder_industries_serviceprocess",
|
|
269
270
|
"builder_industries_utilizationmanagement",
|
|
270
271
|
"builder_industries_visit",
|
|
271
272
|
"builder_payments",
|
|
@@ -324,6 +325,8 @@
|
|
|
324
325
|
"commercetax",
|
|
325
326
|
"commonserviceexcellence",
|
|
326
327
|
"commpay_mp",
|
|
328
|
+
"comms_msm",
|
|
329
|
+
"comms_msm_cmp",
|
|
327
330
|
"community_article",
|
|
328
331
|
"community_builder",
|
|
329
332
|
"community_builder_test",
|
|
@@ -403,6 +406,7 @@
|
|
|
403
406
|
"devopsimpkg7",
|
|
404
407
|
"devopsimpkg8",
|
|
405
408
|
"devopsimpkg9",
|
|
409
|
+
"discoveryframework",
|
|
406
410
|
"dmvr",
|
|
407
411
|
"dxp",
|
|
408
412
|
"dxp_base",
|
|
@@ -423,6 +427,7 @@
|
|
|
423
427
|
"educationcloud",
|
|
424
428
|
"educationcloud_scheduler",
|
|
425
429
|
"eduint",
|
|
430
|
+
"edurfi",
|
|
426
431
|
"eduscheduler",
|
|
427
432
|
"einstein_assistant",
|
|
428
433
|
"einstein_discovery",
|
|
@@ -530,12 +535,17 @@
|
|
|
530
535
|
"hc8",
|
|
531
536
|
"hc9",
|
|
532
537
|
"hc9gs0",
|
|
538
|
+
"hc_contact_center",
|
|
539
|
+
"hc_crisis_center",
|
|
533
540
|
"hc_slack_flows",
|
|
534
541
|
"hcmainstgpu",
|
|
535
542
|
"hcmainstguat",
|
|
543
|
+
"hcumprovider",
|
|
536
544
|
"healthcare_crisis_center",
|
|
537
545
|
"healthcloud",
|
|
546
|
+
"healthcloud_crisis_center",
|
|
538
547
|
"healthcloud_iam_flows",
|
|
548
|
+
"healthcloud_icm_flows",
|
|
539
549
|
"healthcloud_patientcard",
|
|
540
550
|
"healthcloud_pm_flows",
|
|
541
551
|
"healthcloud_um_flows",
|
|
@@ -592,6 +602,7 @@
|
|
|
592
602
|
"jsonxform",
|
|
593
603
|
"k12",
|
|
594
604
|
"kc_na46",
|
|
605
|
+
"knowledge_lightning",
|
|
595
606
|
"komaci",
|
|
596
607
|
"laftest",
|
|
597
608
|
"lbpm",
|
|
@@ -608,6 +619,7 @@
|
|
|
608
619
|
"lightningsnapin",
|
|
609
620
|
"lmrdebug",
|
|
610
621
|
"loyalty_member_engagement",
|
|
622
|
+
"loyalty_se",
|
|
611
623
|
"lsttest",
|
|
612
624
|
"ltngtools",
|
|
613
625
|
"lwc",
|
|
@@ -727,6 +739,8 @@
|
|
|
727
739
|
"runtime_industries_loyalty",
|
|
728
740
|
"runtime_industries_omnistudio",
|
|
729
741
|
"runtime_industries_orderforecasting",
|
|
742
|
+
"runtime_industries_ordermanagement",
|
|
743
|
+
"runtime_industries_program_mgmt",
|
|
730
744
|
"runtime_industries_publicsector",
|
|
731
745
|
"runtime_industries_recurrence",
|
|
732
746
|
"runtime_industries_recurrence_impl",
|
|
@@ -758,6 +772,7 @@
|
|
|
758
772
|
"runtime_platform_employee",
|
|
759
773
|
"runtime_platform_leap",
|
|
760
774
|
"runtime_platform_longnamespacetest",
|
|
775
|
+
"runtime_platform_notifications",
|
|
761
776
|
"runtime_platform_optimizer",
|
|
762
777
|
"runtime_platform_prefcenter",
|
|
763
778
|
"runtime_platform_privacy_analytics",
|
|
@@ -775,6 +790,8 @@
|
|
|
775
790
|
"runtime_revenue_billingbatchpayments",
|
|
776
791
|
"runtime_revenue_billingbatchschedulers",
|
|
777
792
|
"runtime_revenue_insights",
|
|
793
|
+
"runtime_revenue_intelligence",
|
|
794
|
+
"runtime_revenue_products",
|
|
778
795
|
"runtime_sales_activities",
|
|
779
796
|
"runtime_sales_activities_test",
|
|
780
797
|
"runtime_sales_ade",
|
|
@@ -795,6 +812,8 @@
|
|
|
795
812
|
"runtime_sales_linkedin",
|
|
796
813
|
"runtime_sales_merge",
|
|
797
814
|
"runtime_sales_multiaddedit",
|
|
815
|
+
"runtime_sales_opportunitysplit",
|
|
816
|
+
"runtime_sales_opportunitysplittest",
|
|
798
817
|
"runtime_sales_pathassistant",
|
|
799
818
|
"runtime_sales_pathassistanttest",
|
|
800
819
|
"runtime_sales_pipelineboard",
|
|
@@ -873,15 +892,18 @@
|
|
|
873
892
|
"setup_industries_docgen",
|
|
874
893
|
"setup_industries_documentreader",
|
|
875
894
|
"setup_industries_insurance",
|
|
895
|
+
"setup_industries_mfg_common",
|
|
876
896
|
"setup_industries_mfg_service",
|
|
877
897
|
"setup_industries_mfgprogram",
|
|
878
898
|
"setup_industries_objectdetection",
|
|
879
899
|
"setup_industries_referralscoring",
|
|
900
|
+
"setup_industries_rfm",
|
|
880
901
|
"setup_industries_scoringframework",
|
|
881
902
|
"setup_industries_smartselling",
|
|
882
903
|
"setup_industries_smarttags",
|
|
883
904
|
"setup_industries_tpm",
|
|
884
905
|
"setup_industries_vertical_integration",
|
|
906
|
+
"setup_integration_services",
|
|
885
907
|
"setup_lightning_visualforce",
|
|
886
908
|
"setup_marketing_unifiedmarketing",
|
|
887
909
|
"setup_mc2",
|
|
@@ -899,6 +921,7 @@
|
|
|
899
921
|
"setup_platform_cdc",
|
|
900
922
|
"setup_platform_connectcenter",
|
|
901
923
|
"setup_platform_dsar",
|
|
924
|
+
"setup_platform_dynamodbsetupwizard",
|
|
902
925
|
"setup_platform_externalconnection",
|
|
903
926
|
"setup_platform_externaldatasource",
|
|
904
927
|
"setup_platform_integration",
|
|
@@ -909,6 +932,7 @@
|
|
|
909
932
|
"setup_platform_sfdx",
|
|
910
933
|
"setup_release_update",
|
|
911
934
|
"setup_revenue_insights",
|
|
935
|
+
"setup_revenue_intelligence",
|
|
912
936
|
"setup_sales_bot",
|
|
913
937
|
"setup_sales_einstein",
|
|
914
938
|
"setup_sales_einsteinForecasting",
|
|
@@ -976,6 +1000,8 @@
|
|
|
976
1000
|
"stmpahins01",
|
|
977
1001
|
"studioauratest",
|
|
978
1002
|
"studiobrandingtest",
|
|
1003
|
+
"subledger_flow",
|
|
1004
|
+
"subledger_s_flow",
|
|
979
1005
|
"supporttest",
|
|
980
1006
|
"survey",
|
|
981
1007
|
"survey_sentiment",
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"lightning/uiRecordActionsApi": {
|
|
3
|
+
"getActionOverrides": {
|
|
4
|
+
"prime": {
|
|
5
|
+
"importPath": "lightning/unstable_uiRecordActionsApi",
|
|
6
|
+
"identifier": "unstable_getActionOverrides_imperative"
|
|
7
|
+
}
|
|
8
|
+
},
|
|
3
9
|
"getRecordActions": {
|
|
4
10
|
"prime": {
|
|
5
11
|
"importPath": "lightning/unstable_uiRecordActionsApi",
|
|
@@ -24,7 +30,13 @@
|
|
|
24
30
|
},
|
|
25
31
|
"reducer": {
|
|
26
32
|
"importPath": "laf/batchingPortable",
|
|
27
|
-
"identifier": "RelatedListActionsBatchReducer"
|
|
33
|
+
"identifier": "RelatedListActionsBatchReducer",
|
|
34
|
+
"functions": {
|
|
35
|
+
"afterReduce": {
|
|
36
|
+
"name": "relatedListActionsBatchAfterReduce",
|
|
37
|
+
"filePath": "./scripts/reducer-codegen/after-reduce/relatedListActionsBatchAfterReduce.js"
|
|
38
|
+
}
|
|
39
|
+
}
|
|
28
40
|
}
|
|
29
41
|
}
|
|
30
42
|
}
|
|
@@ -154,7 +166,21 @@
|
|
|
154
166
|
},
|
|
155
167
|
"reducer": {
|
|
156
168
|
"importPath": "laf/batchingPortable",
|
|
157
|
-
"identifier": "GetRecordBatchReducer"
|
|
169
|
+
"identifier": "GetRecordBatchReducer",
|
|
170
|
+
"functions": {
|
|
171
|
+
"afterReduce": {
|
|
172
|
+
"name": "getRecordBatchAfterReduce",
|
|
173
|
+
"filePath": "./scripts/reducer-codegen/after-reduce/getRecordBatchAfterReduce.js"
|
|
174
|
+
},
|
|
175
|
+
"groupByKey": {
|
|
176
|
+
"name": "getRecordBatchGroupByKey",
|
|
177
|
+
"filePath": "./scripts/reducer-codegen/group-by-key-function/getRecordBatchGroupByKey.js"
|
|
178
|
+
},
|
|
179
|
+
"isConfigBatchable": {
|
|
180
|
+
"name": "getRecordIsConfigBatchable",
|
|
181
|
+
"filePath": "./scripts/reducer-codegen/is-config-batchable/getRecordIsConfigBatchable.js"
|
|
182
|
+
}
|
|
183
|
+
}
|
|
158
184
|
}
|
|
159
185
|
}
|
|
160
186
|
}
|
|
@@ -196,7 +222,13 @@
|
|
|
196
222
|
},
|
|
197
223
|
"reducer": {
|
|
198
224
|
"importPath": "laf/batchingPortable",
|
|
199
|
-
"identifier": "RelatedListInfoBatchReducer"
|
|
225
|
+
"identifier": "RelatedListInfoBatchReducer",
|
|
226
|
+
"functions": {
|
|
227
|
+
"groupByKey": {
|
|
228
|
+
"name": "relatedListInfoBatchGroupByKey",
|
|
229
|
+
"filePath": "./scripts/reducer-codegen/group-by-key-function/relatedListInfoBatchGroupByKey.js"
|
|
230
|
+
}
|
|
231
|
+
}
|
|
200
232
|
}
|
|
201
233
|
}
|
|
202
234
|
},
|
|
@@ -238,6 +270,12 @@
|
|
|
238
270
|
}
|
|
239
271
|
},
|
|
240
272
|
"lightning/uiSearchApi": {
|
|
273
|
+
"getSearchFilterMetadata": {
|
|
274
|
+
"prime": {
|
|
275
|
+
"importPath": "lightning/unstable_uiSearchApi",
|
|
276
|
+
"identifier": "unstable_getSearchFilterMetadata_imperative"
|
|
277
|
+
}
|
|
278
|
+
},
|
|
241
279
|
"getSearchFilterOptions": {
|
|
242
280
|
"prime": {
|
|
243
281
|
"importPath": "lightning/unstable_uiSearchApi",
|
|
@@ -258,6 +296,12 @@
|
|
|
258
296
|
}
|
|
259
297
|
},
|
|
260
298
|
"lightning/unstable_uiSearchApi": {
|
|
299
|
+
"unstable_getSearchFilterMetadata": {
|
|
300
|
+
"prime": {
|
|
301
|
+
"importPath": "lightning/unstable_uiSearchApi",
|
|
302
|
+
"identifier": "unstable_getSearchFilterMetadata_imperative"
|
|
303
|
+
}
|
|
304
|
+
},
|
|
261
305
|
"unstable_getSearchFilterOptions": {
|
|
262
306
|
"prime": {
|
|
263
307
|
"importPath": "lightning/unstable_uiSearchApi",
|
|
@@ -277,6 +321,14 @@
|
|
|
277
321
|
}
|
|
278
322
|
}
|
|
279
323
|
},
|
|
324
|
+
"lightning/uiLookupsApi": {
|
|
325
|
+
"getLookupMetadata": {
|
|
326
|
+
"prime": {
|
|
327
|
+
"importPath": "lightning/unstable_uiLookupsApi",
|
|
328
|
+
"identifier": "unstable_getLookupMetadata_imperative"
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
},
|
|
280
332
|
"lightning/unstable_uiGraphQLApi": {
|
|
281
333
|
"graphQL": {
|
|
282
334
|
"prime": {
|
|
@@ -284,5 +336,13 @@
|
|
|
284
336
|
"identifier": "unstable_graphQL_imperative"
|
|
285
337
|
}
|
|
286
338
|
}
|
|
339
|
+
},
|
|
340
|
+
"lightning/uiGraphQLApi": {
|
|
341
|
+
"unstable_graphql": {
|
|
342
|
+
"prime": {
|
|
343
|
+
"importPath": "force/ldsAdaptersUiapiGraphql",
|
|
344
|
+
"identifier": "graphql_imperative"
|
|
345
|
+
}
|
|
346
|
+
}
|
|
287
347
|
}
|
|
288
348
|
}
|
|
@@ -73,7 +73,7 @@ export declare const addNewImportFromAst: (referencedName: string, namespace: Im
|
|
|
73
73
|
*/
|
|
74
74
|
export declare const updateAliasForImport: (lookupName: string, referencedName: string, namespace: ImportDetail, moduleMetadata: ModuleMetadata, originalImportName?: string) => void;
|
|
75
75
|
/**
|
|
76
|
-
* Searches the provided
|
|
76
|
+
* Searches the provided template komaci doc map for a document that corresponds to the provided namesapce.
|
|
77
77
|
* @param resourceName am imports resource name
|
|
78
78
|
* @param templateKomaciDocMap a map of template komaci docs.
|
|
79
79
|
*/
|
package/build/moduleMetadata.js
CHANGED
|
@@ -33,7 +33,7 @@ const initAdgMetadataObject = (defaultGeneratedName) => ({
|
|
|
33
33
|
properties: new Map(),
|
|
34
34
|
functions: [],
|
|
35
35
|
propertiesUsedInTemplate: new Set(),
|
|
36
|
-
requiredAdgFactoryFunctions: new Set(),
|
|
36
|
+
requiredAdgFactoryFunctions: new Set([types_1.IdKeys.ADG_FUNC]),
|
|
37
37
|
requiredCompositionFactoryFunctions: new Set(),
|
|
38
38
|
hasSourceFile: false,
|
|
39
39
|
});
|
|
@@ -277,7 +277,7 @@ const updateAliasForImport = (lookupName, referencedName, namespace, moduleMetad
|
|
|
277
277
|
};
|
|
278
278
|
exports.updateAliasForImport = updateAliasForImport;
|
|
279
279
|
/**
|
|
280
|
-
* Searches the provided
|
|
280
|
+
* Searches the provided template komaci doc map for a document that corresponds to the provided namesapce.
|
|
281
281
|
* @param resourceName am imports resource name
|
|
282
282
|
* @param templateKomaciDocMap a map of template komaci docs.
|
|
283
283
|
*/
|
package/build/types.d.ts
CHANGED
|
@@ -77,7 +77,8 @@ export declare enum PropertyTypes {
|
|
|
77
77
|
GETTER = "getter",
|
|
78
78
|
BASE = "base",
|
|
79
79
|
IMPORT_REFERENCE = "importReference",
|
|
80
|
-
TEMPLATE_STRING = "templateString"
|
|
80
|
+
TEMPLATE_STRING = "templateString",
|
|
81
|
+
RENDER_FUNCTION = "render"
|
|
81
82
|
}
|
|
82
83
|
/**
|
|
83
84
|
* Contextual information about a property and who consumes it
|
|
@@ -148,6 +149,7 @@ export declare type BasicImportMetadata = {
|
|
|
148
149
|
*/
|
|
149
150
|
export declare type TemplateImportMetadata = BasicImportMetadata & {
|
|
150
151
|
templateKomaciDoc: KomaciDocument;
|
|
152
|
+
adgReference?: string;
|
|
151
153
|
};
|
|
152
154
|
/**
|
|
153
155
|
* Main type for import meta data.
|
|
@@ -181,6 +183,8 @@ export declare type ClassPropertyNodes = {
|
|
|
181
183
|
getters: NodePath<t.ClassMethod>[];
|
|
182
184
|
/** nodes representative of Template strings */
|
|
183
185
|
templateStrings: NodePath<t.ClassProperty>[];
|
|
186
|
+
/**node to represent the render function */
|
|
187
|
+
renderFunction?: NodePath<t.ClassMethod>;
|
|
184
188
|
};
|
|
185
189
|
/** Contextual info about class and overarching module */
|
|
186
190
|
export declare type ModuleContext = {
|
|
@@ -193,6 +197,7 @@ export declare enum FunctionTypes {
|
|
|
193
197
|
PRIMING_FUNCTION = "PrimingFunction",
|
|
194
198
|
GETTER_FUNCTION = "GetterFunction",
|
|
195
199
|
TEMPLATE_STRING = "TemplateStringFunction",
|
|
200
|
+
RENDER_FUNCTION = "RenderFunction",
|
|
196
201
|
ERROR = "ErrorFunction"
|
|
197
202
|
}
|
|
198
203
|
/**
|
|
@@ -226,7 +231,7 @@ export declare type WireFunctionMetadata = BaseFunctionMetadata & {
|
|
|
226
231
|
* Metadata for a hoisted function type. Currently this is Getter functions and Template String Functions.
|
|
227
232
|
*/
|
|
228
233
|
export declare type HoistedFunctionMetadata = BaseFunctionMetadata & {
|
|
229
|
-
type: FunctionTypes.GETTER_FUNCTION | FunctionTypes.TEMPLATE_STRING;
|
|
234
|
+
type: FunctionTypes.GETTER_FUNCTION | FunctionTypes.TEMPLATE_STRING | FunctionTypes.RENDER_FUNCTION;
|
|
230
235
|
/** ast node from the original component source */
|
|
231
236
|
componentAstNode?: NodePath<t.ClassProperty | t.ClassMethod>;
|
|
232
237
|
generatedName?: string;
|
package/build/types.js
CHANGED
|
@@ -46,6 +46,7 @@ var PropertyTypes;
|
|
|
46
46
|
PropertyTypes["BASE"] = "base";
|
|
47
47
|
PropertyTypes["IMPORT_REFERENCE"] = "importReference";
|
|
48
48
|
PropertyTypes["TEMPLATE_STRING"] = "templateString";
|
|
49
|
+
PropertyTypes["RENDER_FUNCTION"] = "render";
|
|
49
50
|
})(PropertyTypes = exports.PropertyTypes || (exports.PropertyTypes = {}));
|
|
50
51
|
/**
|
|
51
52
|
* When a function is considered unsupported i.e.:
|
|
@@ -62,6 +63,7 @@ var FunctionTypes;
|
|
|
62
63
|
FunctionTypes["PRIMING_FUNCTION"] = "PrimingFunction";
|
|
63
64
|
FunctionTypes["GETTER_FUNCTION"] = "GetterFunction";
|
|
64
65
|
FunctionTypes["TEMPLATE_STRING"] = "TemplateStringFunction";
|
|
66
|
+
FunctionTypes["RENDER_FUNCTION"] = "RenderFunction";
|
|
65
67
|
FunctionTypes["ERROR"] = "ErrorFunction";
|
|
66
68
|
})(FunctionTypes = exports.FunctionTypes || (exports.FunctionTypes = {}));
|
|
67
69
|
//# sourceMappingURL=types.js.map
|
package/build/utils.d.ts
CHANGED
|
@@ -16,7 +16,7 @@ export declare const TEMPLATED_STRING_FUNCTION = "TemplatedStringFunction";
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function getPropertyMetadataFromAst(ast: t.File): ClassPropertyNodes;
|
|
18
18
|
/**
|
|
19
|
-
* Given a valid functional node (
|
|
19
|
+
* Given a valid functional node (template string or getter function), collect information that we may not have been able to collect via KomaciDocument
|
|
20
20
|
* and return a list of class member variables that are properly used in the method body.
|
|
21
21
|
* "properly" = i.e. used in the right-hand side of a member expression.
|
|
22
22
|
* @param getter NodePath<ClassMethod | Class Property> path that represents class member-level getter method or template string
|
|
@@ -77,11 +77,11 @@ export declare function getAstContextObject(ast: t.File): AstContext;
|
|
|
77
77
|
*/
|
|
78
78
|
export declare function isExternalModule(namespace: string): boolean;
|
|
79
79
|
/**
|
|
80
|
-
* Helper function to collect all variables declared within a
|
|
81
|
-
* @param getterMethodPath the babel path object of the
|
|
82
|
-
* @returns an array of variable names that were declared in the
|
|
80
|
+
* Helper function to collect all variables declared within a function method.
|
|
81
|
+
* @param getterMethodPath the babel path object of the function method.
|
|
82
|
+
* @returns an array of variable names that were declared in the function method.
|
|
83
83
|
*/
|
|
84
|
-
export declare function
|
|
84
|
+
export declare function getVariablesDeclaredInFunction(getterMethodPath: NodePath<t.ClassMethod>): string[];
|
|
85
85
|
/**
|
|
86
86
|
* Helper to get the name of a method
|
|
87
87
|
* @param node The method node
|
|
@@ -115,7 +115,7 @@ export declare function isPropertyNodeUsed(prop: NodePath<t.ClassProperty>, prop
|
|
|
115
115
|
* @param getterMethodPath the babel path object of the getter method.
|
|
116
116
|
* @returns a {Set<string>} of variable names that were declared as alias of 'this'.
|
|
117
117
|
*/
|
|
118
|
-
export declare function
|
|
118
|
+
export declare function getThisAliasDeclaredInFunction(getterMethodPath: NodePath<t.ClassMethod>): Set<string>;
|
|
119
119
|
/**
|
|
120
120
|
* @author xiaoxugu
|
|
121
121
|
* Determines whether the passed in {Expression} is a `this` or whether it is an equivalent alias to `this`
|
package/build/utils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getFilepathSegments = exports.addPropertyFunction = exports.updateKomaciDocumentWithValidTemplatedStrings = exports.updateKomaciDocumentWithValidGetters = exports.isDeclaredInAst = exports.isExpressionThisOrAlias = exports.
|
|
3
|
+
exports.getFilepathSegments = exports.addPropertyFunction = exports.updateKomaciDocumentWithValidTemplatedStrings = exports.updateKomaciDocumentWithValidGetters = exports.isDeclaredInAst = exports.isExpressionThisOrAlias = exports.getThisAliasDeclaredInFunction = exports.isPropertyNodeUsed = exports.isGetterNodeUsed = exports.isPropertyUsed = exports.getClassMethodName = exports.getVariablesDeclaredInFunction = exports.isExternalModule = exports.getAstContextObject = exports.getAllClassMethods = exports.getAllModuleVaraibles = exports.getAllModuleFunctions = exports.getFromIdentifierOrStringLiteral = exports.collectImportUsage = exports.getMemberVarsFromGetter = exports.implicitConsumptionMetadata = exports.getPropertyMetadataFromAst = exports.TEMPLATED_STRING_FUNCTION = exports.GETTER_FUNCTION = exports.ONE_NS = exports.FORCE_NS = exports.LIGHTNING_NS = void 0;
|
|
4
4
|
const core_1 = require("@babel/core");
|
|
5
5
|
const types_1 = require("./types");
|
|
6
6
|
exports.LIGHTNING_NS = 'lightning';
|
|
@@ -19,6 +19,7 @@ function getPropertyMetadataFromAst(ast) {
|
|
|
19
19
|
const nodes = {
|
|
20
20
|
getters: [],
|
|
21
21
|
templateStrings: [],
|
|
22
|
+
renderFunction: undefined,
|
|
22
23
|
};
|
|
23
24
|
const Visitor = {
|
|
24
25
|
Program(path) {
|
|
@@ -44,6 +45,10 @@ function getPropertyMetadataFromAst(ast) {
|
|
|
44
45
|
(path.node.value.type === 'TemplateLiteral' ||
|
|
45
46
|
path.node.value.type ===
|
|
46
47
|
'TaggedTemplateExpression'));
|
|
48
|
+
nodes.renderFunction = classBody
|
|
49
|
+
.get('body')
|
|
50
|
+
.filter((path) => path.node.type === 'ClassMethod' &&
|
|
51
|
+
path.node.key.name === 'render')[0];
|
|
47
52
|
}
|
|
48
53
|
}
|
|
49
54
|
}
|
|
@@ -54,7 +59,7 @@ function getPropertyMetadataFromAst(ast) {
|
|
|
54
59
|
}
|
|
55
60
|
exports.getPropertyMetadataFromAst = getPropertyMetadataFromAst;
|
|
56
61
|
/**
|
|
57
|
-
* Given a valid functional node (
|
|
62
|
+
* Given a valid functional node (template string or getter function), collect information that we may not have been able to collect via KomaciDocument
|
|
58
63
|
* and return a list of class member variables that are properly used in the method body.
|
|
59
64
|
* "properly" = i.e. used in the right-hand side of a member expression.
|
|
60
65
|
* @param getter NodePath<ClassMethod | Class Property> path that represents class member-level getter method or template string
|
|
@@ -267,11 +272,11 @@ function isExternalModule(namespace) {
|
|
|
267
272
|
}
|
|
268
273
|
exports.isExternalModule = isExternalModule;
|
|
269
274
|
/**
|
|
270
|
-
* Helper function to collect all variables declared within a
|
|
271
|
-
* @param getterMethodPath the babel path object of the
|
|
272
|
-
* @returns an array of variable names that were declared in the
|
|
275
|
+
* Helper function to collect all variables declared within a function method.
|
|
276
|
+
* @param getterMethodPath the babel path object of the function method.
|
|
277
|
+
* @returns an array of variable names that were declared in the function method.
|
|
273
278
|
*/
|
|
274
|
-
function
|
|
279
|
+
function getVariablesDeclaredInFunction(getterMethodPath) {
|
|
275
280
|
const variables = [];
|
|
276
281
|
const getterMethodNode = getterMethodPath.node;
|
|
277
282
|
const declarations = getterMethodNode.body.body.filter((dec) => dec.type === 'VariableDeclaration');
|
|
@@ -282,7 +287,7 @@ function getVariablesDeclaredInGetter(getterMethodPath) {
|
|
|
282
287
|
});
|
|
283
288
|
return variables;
|
|
284
289
|
}
|
|
285
|
-
exports.
|
|
290
|
+
exports.getVariablesDeclaredInFunction = getVariablesDeclaredInFunction;
|
|
286
291
|
/**
|
|
287
292
|
* Helper to get the name of a method
|
|
288
293
|
* @param node The method node
|
|
@@ -338,7 +343,7 @@ exports.isPropertyNodeUsed = isPropertyNodeUsed;
|
|
|
338
343
|
* @param getterMethodPath the babel path object of the getter method.
|
|
339
344
|
* @returns a {Set<string>} of variable names that were declared as alias of 'this'.
|
|
340
345
|
*/
|
|
341
|
-
function
|
|
346
|
+
function getThisAliasDeclaredInFunction(getterMethodPath) {
|
|
342
347
|
const variables = new Set();
|
|
343
348
|
const getterMethodNode = getterMethodPath.node;
|
|
344
349
|
const declarations = getterMethodNode.body.body.filter((dec) => dec.type === 'VariableDeclaration');
|
|
@@ -351,7 +356,7 @@ function getThisAliasDeclaredInGetter(getterMethodPath) {
|
|
|
351
356
|
});
|
|
352
357
|
return variables;
|
|
353
358
|
}
|
|
354
|
-
exports.
|
|
359
|
+
exports.getThisAliasDeclaredInFunction = getThisAliasDeclaredInFunction;
|
|
355
360
|
/**
|
|
356
361
|
* @author xiaoxugu
|
|
357
362
|
* Determines whether the passed in {Expression} is a `this` or whether it is an equivalent alias to `this`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@komaci/common-shared",
|
|
3
|
-
"version": "242.1.
|
|
3
|
+
"version": "242.1.6",
|
|
4
4
|
"description": "Assets that are shared across Komaci commonjs packages",
|
|
5
5
|
"homepage": "https://komaci.dev/",
|
|
6
6
|
"repository": {
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
"build/komaci-mapping.json"
|
|
30
30
|
],
|
|
31
31
|
"devDependencies": {
|
|
32
|
-
"@komaci/types": "242.1.
|
|
32
|
+
"@komaci/types": "242.1.6"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@babel/core": "^7.9.0",
|