@komaci/static-analyzer 242.0.0 → 242.1.0

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/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { AnalyzerInput, PrimingDiagnostic } from './types';
2
2
  export declare function generatePrimingDiagnosticsModule(input: AnalyzerInput): PrimingDiagnostic[];
3
- export { AnalyzerInput, PrimingDiagnostic, Range, Position, PrimingAdapterDefinition, } from './types';
4
- export { getPrimingAdapter, isSupportedNamespace, isSupportedWireAdapter, } from './shared';
3
+ export { AnalyzerInput, PrimingDiagnostic, Range, Position } from './types';
4
+ export { isSupportedNamespace, isImageComposition } from './shared';
5
5
  export { diagnosticMessages, getPrimingDiagnostic } from './rules';
6
6
  export * from './validateGetter';
7
7
  //# sourceMappingURL=index.d.ts.map
package/build/index.js CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.getPrimingDiagnostic = exports.diagnosticMessages = exports.isSupportedWireAdapter = exports.isSupportedNamespace = exports.getPrimingAdapter = exports.generatePrimingDiagnosticsModule = void 0;
17
+ exports.getPrimingDiagnostic = exports.diagnosticMessages = exports.isImageComposition = exports.isSupportedNamespace = exports.generatePrimingDiagnosticsModule = void 0;
18
18
  const staticAnalyzer_1 = require("./staticAnalyzer");
19
19
  function generatePrimingDiagnosticsModule(input) {
20
20
  const analyzer = new staticAnalyzer_1.StaticAnalyzer();
@@ -28,9 +28,8 @@ function generatePrimingDiagnosticsModule(input) {
28
28
  }
29
29
  exports.generatePrimingDiagnosticsModule = generatePrimingDiagnosticsModule;
30
30
  var shared_1 = require("./shared");
31
- Object.defineProperty(exports, "getPrimingAdapter", { enumerable: true, get: function () { return shared_1.getPrimingAdapter; } });
32
31
  Object.defineProperty(exports, "isSupportedNamespace", { enumerable: true, get: function () { return shared_1.isSupportedNamespace; } });
33
- Object.defineProperty(exports, "isSupportedWireAdapter", { enumerable: true, get: function () { return shared_1.isSupportedWireAdapter; } });
32
+ Object.defineProperty(exports, "isImageComposition", { enumerable: true, get: function () { return shared_1.isImageComposition; } });
34
33
  var rules_1 = require("./rules");
35
34
  Object.defineProperty(exports, "diagnosticMessages", { enumerable: true, get: function () { return rules_1.diagnosticMessages; } });
36
35
  Object.defineProperty(exports, "getPrimingDiagnostic", { enumerable: true, get: function () { return rules_1.getPrimingDiagnostic; } });
@@ -1,14 +1,14 @@
1
1
  import { NodePath } from '@babel/traverse';
2
2
  import * as t from '@babel/types';
3
3
  import { PrimingDiagnostic } from '../types';
4
- import { ImportDeclarationInfo } from '@komaci/common-shared';
4
+ import { ImportMetadata } from '@komaci/common-shared';
5
5
  /**
6
6
  * Invariant function for checking if call expressions references an unsupported import.
7
7
  * @param path the babel path object for the current call expression.
8
8
  * @param importReferences a set of supported import references.
9
9
  * @returns undefined if a call expression does NOT reference an unspoorted import, locatoin object if a call expression references an unsupported import.
10
10
  */
11
- export declare function checkCallExpressionForNonSupportedNamespaceRefs(path: NodePath<t.CallExpression>, importReferences: Map<string, ImportDeclarationInfo>): PrimingDiagnostic | undefined;
11
+ export declare function checkCallExpressionForNonSupportedNamespaceRefs(path: NodePath<t.CallExpression>, importReferences: Map<string, ImportMetadata>): PrimingDiagnostic | undefined;
12
12
  /**
13
13
  * Validates whether a CallExpression Node on the AST adheres to a portability invariant (whether it doesn't
14
14
  * contain 'eval()' call).
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkForNoReferenceToModuleFunctions = exports.checkForNoReferenceToClassFunctions = exports.checkNoUsageOfEval = exports.checkCallExpressionForNonSupportedNamespaceRefs = void 0;
4
4
  const shared_1 = require("../shared");
5
+ const common_shared_1 = require("@komaci/common-shared");
5
6
  const rules_1 = require("../rules");
6
7
  /**
7
8
  * Invariant function for checking if call expressions references an unsupported import.
@@ -12,11 +13,10 @@ const rules_1 = require("../rules");
12
13
  function checkCallExpressionForNonSupportedNamespaceRefs(path, importReferences) {
13
14
  const callExprNode = path.node;
14
15
  const callee = callExprNode.callee;
15
- if (importReferences.get(callee.name)) {
16
- if (!importReferences.get(callee.name)?.isSupported) {
17
- if (callee.loc != null) {
18
- return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_CALL_EXPRESSION_REFERENCES_UNSUPPORTED_NAMESPACE, shared_1.LLSRange.fromBabelSourceLocation(callee.loc), [callee.name]);
19
- }
16
+ const importRef = importReferences.get(callee.name);
17
+ if (importRef && (0, common_shared_1.isImportInvalid)(importRef)) {
18
+ if (callee.loc != null) {
19
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_CALL_EXPRESSION_REFERENCES_UNSUPPORTED_NAMESPACE, shared_1.LLSRange.fromBabelSourceLocation(callee.loc), [callee.name]);
20
20
  }
21
21
  }
22
22
  return undefined;
@@ -1,6 +1,6 @@
1
1
  import { NodePath } from '@babel/traverse';
2
2
  import * as t from '@babel/types';
3
- import { ImportDeclarationInfo } from '@komaci/common-shared';
3
+ import { ImportMetadata } from '@komaci/common-shared';
4
4
  import { PrimingDiagnostic } from '../types';
5
5
  /**
6
6
  * Invariant function to check for no references to module varaibles.
@@ -24,5 +24,5 @@ export declare function checkForNoReferenceToModuleVariables(path: NodePath<t.Id
24
24
  * @returns undefined if a member expression does NOT reference an unsuppoerted import, PrimingDiagnostic object
25
25
  * if an unsupported import is reference.
26
26
  */
27
- export declare function checkIdentifierForNonSupportedNamespaceRefs(path: NodePath<t.Identifier>, importReferences: Map<string, ImportDeclarationInfo>, declaredVariables: string[]): PrimingDiagnostic | undefined;
27
+ export declare function checkIdentifierForNonSupportedNamespaceRefs(path: NodePath<t.Identifier>, importReferences: Map<string, ImportMetadata>, declaredVariables: string[]): PrimingDiagnostic | undefined;
28
28
  //# sourceMappingURL=identifierInvariantFunctions.d.ts.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkIdentifierForNonSupportedNamespaceRefs = exports.checkForNoReferenceToModuleVariables = void 0;
4
+ const common_shared_1 = require("@komaci/common-shared");
4
5
  const rules_1 = require("../rules");
5
6
  const shared_1 = require("../shared");
6
7
  /**
@@ -38,13 +39,14 @@ exports.checkForNoReferenceToModuleVariables = checkForNoReferenceToModuleVariab
38
39
  */
39
40
  function checkIdentifierForNonSupportedNamespaceRefs(path, importReferences, declaredVariables) {
40
41
  const identifier = path.node;
42
+ const importRef = importReferences.get(identifier.name);
41
43
  if (path.parent.type !== 'Decorator' &&
42
44
  path.parent.type !== 'MemberExpression' &&
43
45
  path.parent.type !== 'CallExpression' &&
44
46
  path.parent.type !== 'TaggedTemplateExpression' &&
45
47
  path.parent.type !== 'ThisExpression' &&
46
- importReferences.get(identifier.name) &&
47
- !importReferences.get(identifier.name)?.isSupported &&
48
+ importRef &&
49
+ (0, common_shared_1.isImportInvalid)(importRef) &&
48
50
  !declaredVariables.includes(identifier.name)) {
49
51
  if (identifier.loc) {
50
52
  return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_REFERENCE_TO_UNSUPPORTED_NAMESPACE_REFERENCE, shared_1.LLSRange.fromBabelSourceLocation(identifier.loc), [identifier.name]);
@@ -1,7 +1,7 @@
1
1
  import { NodePath } from '@babel/traverse';
2
2
  import * as t from '@babel/types';
3
3
  import { PrimingDiagnostic } from '../types';
4
- import { ClassPropertyInfo, ImportDeclarationInfo, AstContext } from '@komaci/common-shared';
4
+ import { AstContext, ClassPropertyContexts, ImportMetadata } from '@komaci/common-shared';
5
5
  /**
6
6
  * Invariant function for checking if a member expression references a non decorated member var.
7
7
  * @param path the babel path object for the current member expressoin
@@ -9,7 +9,7 @@ import { ClassPropertyInfo, ImportDeclarationInfo, AstContext } from '@komaci/co
9
9
  * @returns undefined if the member expression does NOT reference an unsupported member var, PrimingDiagnostic object if an unsuppported
10
10
  * member variable is referenced
11
11
  */
12
- export declare function checkForNonSupportedMemberRefs(path: NodePath<t.MemberExpression>, memberVars: ClassPropertyInfo[]): PrimingDiagnostic | undefined;
12
+ export declare function checkForNonSupportedMemberRefs(path: NodePath<t.MemberExpression>, memberVars: ClassPropertyContexts): PrimingDiagnostic | undefined;
13
13
  /**
14
14
  * Invariant function for checking if a member expression references a non-existent member property variable
15
15
  * @param {NodePath<MemberExpression>} path babel/types path object representing the current member expression
@@ -18,7 +18,7 @@ export declare function checkForNonSupportedMemberRefs(path: NodePath<t.MemberEx
18
18
  * @returns {(PrimingDiagnostic | undefined)} undefined if the member expression does NOT reference a non-existent member property variable. Returns a
19
19
  * PrimingDiagnostic object if a non-existent member property variable is referenced
20
20
  */
21
- export declare function checkForNonExistentMemberRefs(path: NodePath<t.MemberExpression>, memberVars: ClassPropertyInfo[], thisAliases: Set<string>): PrimingDiagnostic | undefined;
21
+ export declare function checkForNonExistentMemberRefs(path: NodePath<t.MemberExpression>, memberVars: ClassPropertyContexts, thisAliases: Set<string>): PrimingDiagnostic | undefined;
22
22
  /**
23
23
  * Invariant function to check if a member expression references an unsupported import.
24
24
  * @param path the babel path object for the current member expression
@@ -26,7 +26,7 @@ export declare function checkForNonExistentMemberRefs(path: NodePath<t.MemberExp
26
26
  * @returns undefined if a member expression does NOT reference an unsuppoerted import, PrimingDiagnostic object
27
27
  * if an unsupported import is reference.
28
28
  */
29
- export declare function checkMemberExpressionForNonSupportedNamespaceRefs(path: NodePath<t.MemberExpression>, importReferences: Map<string, ImportDeclarationInfo>): PrimingDiagnostic | undefined;
29
+ export declare function checkMemberExpressionForNonSupportedNamespaceRefs(path: NodePath<t.MemberExpression>, importReferences: Map<string, ImportMetadata>): PrimingDiagnostic | undefined;
30
30
  /**
31
31
  * Validates whether a MemberExpression Node on the AST adheres to a portability invariant (whether it doesn't
32
32
  * contain 'document', 'window' indentifiers within an expression).
@@ -46,5 +46,5 @@ export declare function checkForNoUseOfSuper(path: NodePath<t.MemberExpression>)
46
46
  * @param astContext the ast context that holds meta data about the scr code.
47
47
  * @returns a Priming Diagnostic if there is a global reference undefined if none
48
48
  */
49
- export declare function checkForUnsupportedGlobalRef(path: NodePath<t.MemberExpression>, astContext: AstContext, declaredGetterVars: string[]): PrimingDiagnostic | undefined;
49
+ export declare function checkForUnsupportedGlobalRef(path: NodePath<t.MemberExpression>, astContext: AstContext, imports: Map<string, ImportMetadata>, properties: ClassPropertyContexts, declaredGetterVars: string[]): PrimingDiagnostic | undefined;
50
50
  //# sourceMappingURL=memberExpressionInvariantFunctions.d.ts.map
@@ -1,30 +1,6 @@
1
1
  "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
2
  Object.defineProperty(exports, "__esModule", { value: true });
26
3
  exports.checkForUnsupportedGlobalRef = exports.checkForNoUseOfSuper = exports.checkNoUsageOfDocumentOrWindow = exports.checkMemberExpressionForNonSupportedNamespaceRefs = exports.checkForNonExistentMemberRefs = exports.checkForNonSupportedMemberRefs = void 0;
27
- const t = __importStar(require("@babel/types"));
28
4
  const shared_1 = require("../shared");
29
5
  const common_shared_1 = require("@komaci/common-shared");
30
6
  const rules_1 = require("../rules");
@@ -39,12 +15,16 @@ function checkForNonSupportedMemberRefs(path, memberVars) {
39
15
  const memberExprNode = path.node;
40
16
  if (memberExprNode.object.type == 'ThisExpression') {
41
17
  const memberExprProperty = memberExprNode.property;
42
- if (memberVars.find((classPropInfo) => classPropInfo.classPropId === memberExprProperty.name &&
43
- !classPropInfo.isDecorated &&
44
- !classPropInfo.hasInitialValue &&
45
- !t.isClassMethod(classPropInfo.classProp))) {
18
+ const memberExprName = (0, common_shared_1.getFromIdentifierOrStringLiteral)(memberExprProperty);
19
+ const prop = memberVars.get(memberExprName);
20
+ if (prop &&
21
+ !prop.inital &&
22
+ !((prop.type === common_shared_1.PropertyTypes.BASE && prop.isPublic) ||
23
+ prop.type === common_shared_1.PropertyTypes.WIRE ||
24
+ prop.type === common_shared_1.PropertyTypes.GETTER ||
25
+ prop.type === common_shared_1.PropertyTypes.TEMPLATE_STRING)) {
46
26
  if (memberExprProperty.loc) {
47
- return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_UNSUPPORTED_MEMBER_VARIABLE_IN_MEMBER_EXPRESSION, shared_1.LLSRange.fromBabelSourceLocation(memberExprProperty.loc), [memberExprProperty.name]);
27
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_UNSUPPORTED_MEMBER_VARIABLE_IN_MEMBER_EXPRESSION, shared_1.LLSRange.fromBabelSourceLocation(memberExprProperty.loc), [memberExprName]);
48
28
  }
49
29
  }
50
30
  }
@@ -67,9 +47,9 @@ function checkForNonExistentMemberRefs(path, memberVars, thisAliases) {
67
47
  parentNode.type !== 'CallExpression' // check that this is not a part of a function call, which is already handled by invariant: `checkForNoReferenceToClassFunctions`
68
48
  ) {
69
49
  const memberExprValue = (0, common_shared_1.getFromIdentifierOrStringLiteral)(memberExprProperty);
70
- if (!memberVars.find((classPropInfo) => classPropInfo.classPropId === memberExprValue)) {
50
+ if (!memberVars.has(memberExprValue)) {
71
51
  const sourceLoc = memberExprProperty.loc;
72
- if (sourceLoc) {
52
+ if (sourceLoc !== null && sourceLoc !== undefined) {
73
53
  return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_NON_EXISTENT_MEMBER_VARIABLE, shared_1.LLSRange.fromBabelSourceLocation(sourceLoc), [memberExprValue]);
74
54
  }
75
55
  }
@@ -87,11 +67,10 @@ exports.checkForNonExistentMemberRefs = checkForNonExistentMemberRefs;
87
67
  function checkMemberExpressionForNonSupportedNamespaceRefs(path, importReferences) {
88
68
  const mememberExprNode = path.node;
89
69
  const objectIdentifier = mememberExprNode.object;
90
- if (importReferences.get(objectIdentifier.name)) {
91
- if (!importReferences.get(objectIdentifier.name)?.isSupported) {
92
- if (objectIdentifier.loc) {
93
- return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_UNSUPPORTED_NAMESPACE_REFERENCE, shared_1.LLSRange.fromBabelSourceLocation(objectIdentifier.loc), [objectIdentifier.name]);
94
- }
70
+ const importRef = importReferences.get(objectIdentifier.name);
71
+ if (importRef && (0, common_shared_1.isImportInvalid)(importRef)) {
72
+ if (objectIdentifier.loc !== null && objectIdentifier.loc !== undefined) {
73
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_UNSUPPORTED_NAMESPACE_REFERENCE, shared_1.LLSRange.fromBabelSourceLocation(objectIdentifier.loc), [objectIdentifier.name]);
95
74
  }
96
75
  }
97
76
  return undefined;
@@ -135,11 +114,11 @@ exports.checkForNoUseOfSuper = checkForNoUseOfSuper;
135
114
  * @param astContext the ast context that holds meta data about the scr code.
136
115
  * @returns a Priming Diagnostic if there is a global reference undefined if none
137
116
  */
138
- function checkForUnsupportedGlobalRef(path, astContext, declaredGetterVars) {
117
+ function checkForUnsupportedGlobalRef(path, astContext, imports, properties, declaredGetterVars) {
139
118
  const memberExpr = path.node;
140
119
  const memberObj = memberExpr.object;
141
120
  if (memberObj.type === 'Identifier' &&
142
- !(0, common_shared_1.isDeclaredInAst)(astContext, declaredGetterVars, memberObj.name) &&
121
+ !(0, common_shared_1.isDeclaredInAst)(astContext, imports, properties, declaredGetterVars, memberObj.name) &&
143
122
  !common_shared_1.allowlistGlobals.globals.has(memberObj.name) &&
144
123
  memberExpr.loc) {
145
124
  return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_MEMBER_EXPRESSION_REFERENCE_TO_UNSUPPORTED_GLOBAL, shared_1.LLSRange.fromBabelSourceLocation(memberExpr.loc), [memberObj.name]);
@@ -1,6 +1,6 @@
1
1
  import { NodePath } from '@babel/traverse';
2
2
  import * as t from '@babel/types';
3
- import { ImportDeclarationInfo } from '@komaci/common-shared';
3
+ import { ImportMetadata } from '@komaci/common-shared';
4
4
  import { PrimingDiagnostic } from '../types';
5
5
  /**
6
6
  * Invariant function for checking if a tagged template expression contains a reference to an unsupported namespace.
@@ -8,5 +8,5 @@ import { PrimingDiagnostic } from '../types';
8
8
  * @param decoratedMemberVars a set of approved member variable names.
9
9
  * @returns undefined if the member expressoin does NOT reference an unsupported member var, a location obj if an unsuppported namespace is referenced.
10
10
  */
11
- export declare function checkTaggedTemplateExprForNonSupportedNamespaceRefs(path: NodePath<t.TaggedTemplateExpression>, importReferences: Map<string, ImportDeclarationInfo>): PrimingDiagnostic | undefined;
11
+ export declare function checkTaggedTemplateExprForNonSupportedNamespaceRefs(path: NodePath<t.TaggedTemplateExpression>, importReferences: Map<string, ImportMetadata>): PrimingDiagnostic | undefined;
12
12
  //# sourceMappingURL=taggedTemplateExpressionInvariantFunctions.d.ts.map
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.checkTaggedTemplateExprForNonSupportedNamespaceRefs = void 0;
4
+ const common_shared_1 = require("@komaci/common-shared");
4
5
  const rules_1 = require("../rules");
5
6
  const shared_1 = require("../shared");
6
7
  /**
@@ -12,11 +13,10 @@ const shared_1 = require("../shared");
12
13
  function checkTaggedTemplateExprForNonSupportedNamespaceRefs(path, importReferences) {
13
14
  const taggedTemplateExpr = path.node;
14
15
  const identifier = taggedTemplateExpr.tag;
15
- if (importReferences.has(identifier.name)) {
16
- if (!importReferences.get(identifier.name)?.isSupported) {
17
- if (identifier.loc) {
18
- return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_TAGGED_TEMPLATE_EXPRESSION_CONTAINS_UNSUPPORTED_NAMESPACE, shared_1.LLSRange.fromBabelSourceLocation(identifier.loc), [identifier.name]);
19
- }
16
+ const importRef = importReferences.get(identifier.name);
17
+ if (importRef && (0, common_shared_1.isImportInvalid)(importRef)) {
18
+ if (identifier.loc) {
19
+ return (0, rules_1.getPrimingDiagnostic)(rules_1.diagnosticMessages.NO_TAGGED_TEMPLATE_EXPRESSION_CONTAINS_UNSUPPORTED_NAMESPACE, shared_1.LLSRange.fromBabelSourceLocation(identifier.loc), [identifier.name]);
20
20
  }
21
21
  }
22
22
  return undefined;
package/build/shared.d.ts CHANGED
@@ -1,27 +1,18 @@
1
1
  import * as t from '@babel/types';
2
- import { ClassPropertyContexts, ModuleLevelConsumption, ModuleContext } from '@komaci/common-shared';
3
- import { GetPrimingAdapter, GetterDiagnosticsContext, TemplateDiagnosticsContext } from './types';
2
+ import { ModuleContext } from '@komaci/common-shared';
3
+ import { GetterDiagnosticsContext, TemplateDiagnosticsContext } from './types';
4
4
  import { SourceLocation } from '@babel/types';
5
5
  import { Range } from '.';
6
- import { SourceLocation as KomaciSourceLocation } from '@komaci/types';
6
+ import { Composition, Image, SourceLocation as KomaciSourceLocation } from '@komaci/types';
7
+ import { ModuleMetadata } from '@komaci/common-shared';
7
8
  export declare const WIRE_FUNCTION = "WireFunction";
8
9
  export declare const ERROR_PREFIX = "[komaci static-analyzer] ";
9
- /**
10
- * Determine whether the wire adapter is supported
11
- * @param resourceName the resource name of the Import, as a string
12
- * @param adapterName the wire adapter variable name (import specifier export name) from a single
13
- * Import statement (which can have more than one of these export names)
14
- * @returns boolean true if the adapterName represents is a supported wire adapter (note that some
15
- * resourceNames allow any adapterName as valid wire adapters)
16
- */
17
- export declare function isSupportedWireAdapter(resourceName: string | undefined, adapterName: string | undefined): boolean;
18
10
  /**
19
11
  * Determine whether the resource name is in a supported namespace
20
12
  * @param resourceName the resource name of the Import, as a string
21
13
  * @returns boolean true if the resource name is in a supported namespace
22
14
  */
23
15
  export declare function isSupportedNamespace(resourceName: string | undefined): boolean;
24
- export declare const getPrimingAdapter: GetPrimingAdapter;
25
16
  export declare const LLSRange: {
26
17
  /**
27
18
  * Converts an lwc-metadata SourceLocation (1-indexed for both line and column) into a Lightning Language
@@ -40,14 +31,26 @@ export declare const LLSRange: {
40
31
  };
41
32
  /**
42
33
  * Function to analyze src code and returns any diagnostics found and valid getter contexts in a GetterDiagnosticContext
43
- * @param srcCode the source code to analyze.
44
- * @param namespace the namespace of src file.
34
+ * @param adgIndex index of the current adg to process
35
+ * @param rootAst the Abstract Syntax Tree for the component
36
+ * @param moduleMetadata metadata about the given component
37
+ * @param moduleContext contextual details about the component, like module level variables, etc
38
+ * @returns diagnostics for the getters
45
39
  */
46
- export declare function analyzeSrcForInvalidGetterFunctions(rootAst: t.File, moduleContext: ModuleContext, moduleLevelConsumption: ModuleLevelConsumption, properties: ClassPropertyContexts): GetterDiagnosticsContext;
40
+ export declare function analyzeSrcForInvalidGetterFunctions(adgIndex: number, rootAst: t.File, moduleMetadata: ModuleMetadata, moduleContext: ModuleContext): GetterDiagnosticsContext;
47
41
  /**
48
42
  * Function to analyze tempplate strings and collect any Priming Diagnostic info for them along with returning valid templates contexts
49
- * @param srcCode the source code to analyze.
50
- * @param namespace the namespace of src file.
43
+ * @param adgIndex index of the current adg to process
44
+ * @param rootAst the Abstract Syntax Tree for the component
45
+ * @param moduleMetadata metadata about the given component
46
+ * @param moduleContext contextual details about the component, like module level variables, etc
47
+ * @returns diagnostics for the template strings
48
+ */
49
+ export declare function analyzeSrcForTemplateStringDiagnostics(adgIndex: number, rootAst: t.File, moduleMetadata: ModuleMetadata, moduleContext: ModuleContext): TemplateDiagnosticsContext;
50
+ /**
51
+ * Type guard for the komaci Image type
52
+ * @param {Composition} composition the komaci Composition object
53
+ * @returns {boolean} true if the Composition is more specifically an Image, false if it is not an Image
51
54
  */
52
- export declare function analyzeSrcForTemplateDiagnostics(rootAst: t.File, moduleContext: ModuleContext, moduleLevelConsumption: ModuleLevelConsumption, properties: ClassPropertyContexts): TemplateDiagnosticsContext;
55
+ export declare function isImageComposition(composition: Composition): composition is Image;
53
56
  //# sourceMappingURL=shared.d.ts.map
package/build/shared.js CHANGED
@@ -1,8 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.analyzeSrcForTemplateDiagnostics = exports.analyzeSrcForInvalidGetterFunctions = exports.LLSRange = exports.getPrimingAdapter = exports.isSupportedNamespace = exports.isSupportedWireAdapter = exports.ERROR_PREFIX = exports.WIRE_FUNCTION = void 0;
4
- const adaptersMapping_1 = require("./adaptersMapping");
5
- const allowlistAdapters_1 = require("./allowlistAdapters");
3
+ exports.isImageComposition = exports.analyzeSrcForTemplateStringDiagnostics = exports.analyzeSrcForInvalidGetterFunctions = exports.LLSRange = exports.isSupportedNamespace = exports.ERROR_PREFIX = exports.WIRE_FUNCTION = void 0;
6
4
  const common_shared_1 = require("@komaci/common-shared");
7
5
  const _1 = require(".");
8
6
  const validateGetter_1 = require("./validateGetter");
@@ -13,44 +11,6 @@ const emptyRange = {
13
11
  start: { line: 0, character: 0 },
14
12
  end: { line: 0, character: 0 },
15
13
  };
16
- /**
17
- * Determine whether the wire adapter is supported
18
- * @param resourceName the resource name of the Import, as a string
19
- * @param adapterName the wire adapter variable name (import specifier export name) from a single
20
- * Import statement (which can have more than one of these export names)
21
- * @returns boolean true if the adapterName represents is a supported wire adapter (note that some
22
- * resourceNames allow any adapterName as valid wire adapters)
23
- */
24
- function isSupportedWireAdapter(resourceName, adapterName) {
25
- if (!resourceName || !adapterName) {
26
- return false;
27
- }
28
- // check if the resourceName is one of the types that can have any wire adapter name. If so, return true.
29
- // allow list of ResourceName that can be a "starsWith" match
30
- for (const allowedResourceNamePrefix of allowlistAdapters_1.allowlistResourceNamesStartsWith) {
31
- if (resourceName.startsWith(allowedResourceNamePrefix)) {
32
- return true;
33
- }
34
- }
35
- // allow list of ResourceNames that need to be an exact match
36
- for (const allowedResourceName of allowlistAdapters_1.allowlistResourceNamesExact) {
37
- if (resourceName === allowedResourceName) {
38
- return true;
39
- }
40
- }
41
- // check the allowlist of wire adapters for certain various resourceNames that all start with "lightning".
42
- for (const [resourceNameKey, adapterList] of Object.entries(allowlistAdapters_1.allowlistAdapters)) {
43
- if (resourceNameKey === resourceName && adapterList.includes(adapterName)) {
44
- return true;
45
- }
46
- }
47
- // check if there's an associated LDS priming adapter.
48
- if ((0, exports.getPrimingAdapter)(resourceName, adapterName)) {
49
- return true;
50
- }
51
- return false;
52
- }
53
- exports.isSupportedWireAdapter = isSupportedWireAdapter;
54
14
  /**
55
15
  * Determine whether the resource name is in a supported namespace
56
16
  * @param resourceName the resource name of the Import, as a string
@@ -71,18 +31,6 @@ function isSupportedNamespace(resourceName) {
71
31
  (0, common_shared_1.isLibraryValid)(resourceName));
72
32
  }
73
33
  exports.isSupportedNamespace = isSupportedNamespace;
74
- const getPrimingAdapter = (importPath, identifier) => {
75
- const adapterMap = adaptersMapping_1.wireAdaptersMap[importPath];
76
- if (adapterMap === undefined) {
77
- return null;
78
- }
79
- const primingAdapter = adapterMap[identifier];
80
- if (primingAdapter === undefined) {
81
- return null;
82
- }
83
- return primingAdapter;
84
- };
85
- exports.getPrimingAdapter = getPrimingAdapter;
86
34
  /* Related utilty functions to convert Locations of various types into a Range format and indexing scheme supported by
87
35
  the Lightning Language Server
88
36
  (0-index based for lines and columns, and a specific format where `column` is called `character`) */
@@ -137,23 +85,27 @@ exports.LLSRange = {
137
85
  };
138
86
  /**
139
87
  * Function to analyze src code and returns any diagnostics found and valid getter contexts in a GetterDiagnosticContext
140
- * @param srcCode the source code to analyze.
141
- * @param namespace the namespace of src file.
88
+ * @param adgIndex index of the current adg to process
89
+ * @param rootAst the Abstract Syntax Tree for the component
90
+ * @param moduleMetadata metadata about the given component
91
+ * @param moduleContext contextual details about the component, like module level variables, etc
92
+ * @returns diagnostics for the getters
142
93
  */
143
- function analyzeSrcForInvalidGetterFunctions(rootAst, moduleContext, moduleLevelConsumption, properties) {
94
+ function analyzeSrcForInvalidGetterFunctions(adgIndex, rootAst, moduleMetadata, moduleContext) {
144
95
  const diagnostics = [];
145
96
  const validGetters = [];
146
97
  const { getters } = (0, common_shared_1.getPropertyMetadataFromAst)(rootAst);
147
- if (getters.length > 0) {
98
+ const adg = moduleMetadata.adgs.get(adgIndex);
99
+ if (getters.length > 0 && adg) {
148
100
  getters.forEach((getterFunc, index) => {
149
- const res = (0, validateGetter_1.validateGetter)(getterFunc, moduleContext, true);
101
+ const res = (0, validateGetter_1.validateGetter)(getterFunc, adgIndex, moduleMetadata, moduleContext, true);
150
102
  const getterDiagnostics = res;
151
103
  //Same thing as passing false into validate getter and getting a boolean back. If there are no diagnostics its valid.
152
104
  if (getterDiagnostics.length == 0) {
153
- const validGetter = generateValidGetterContext(getterFunc, moduleContext, moduleLevelConsumption, properties, index);
105
+ const validGetter = generateValidGetterContext(getterFunc, adgIndex, moduleMetadata, index);
154
106
  validGetters.push(validGetter);
155
107
  const name = (0, common_shared_1.getClassMethodName)(getterFunc);
156
- (0, common_shared_1.updatePropertyUsage)(name, validGetter.memberUsage, properties, common_shared_1.PropertyTypes.GETTER);
108
+ (0, common_shared_1.updatePropertyUsage)(name, validGetter.memberUsage, adg.properties, common_shared_1.PropertyTypes.GETTER);
157
109
  }
158
110
  diagnostics.push(...getterDiagnostics);
159
111
  });
@@ -166,22 +118,26 @@ function analyzeSrcForInvalidGetterFunctions(rootAst, moduleContext, moduleLevel
166
118
  exports.analyzeSrcForInvalidGetterFunctions = analyzeSrcForInvalidGetterFunctions;
167
119
  /**
168
120
  * Function to analyze tempplate strings and collect any Priming Diagnostic info for them along with returning valid templates contexts
169
- * @param srcCode the source code to analyze.
170
- * @param namespace the namespace of src file.
121
+ * @param adgIndex index of the current adg to process
122
+ * @param rootAst the Abstract Syntax Tree for the component
123
+ * @param moduleMetadata metadata about the given component
124
+ * @param moduleContext contextual details about the component, like module level variables, etc
125
+ * @returns diagnostics for the template strings
171
126
  */
172
- function analyzeSrcForTemplateDiagnostics(rootAst, moduleContext, moduleLevelConsumption, properties) {
127
+ function analyzeSrcForTemplateStringDiagnostics(adgIndex, rootAst, moduleMetadata, moduleContext) {
173
128
  const diagnostics = [];
174
129
  const validTemplates = [];
175
130
  const { templateStrings } = (0, common_shared_1.getPropertyMetadataFromAst)(rootAst);
176
- if (templateStrings.length > 0) {
131
+ const adg = moduleMetadata.adgs.get(adgIndex);
132
+ if (templateStrings.length > 0 && adg) {
177
133
  templateStrings.forEach((templateString, index) => {
178
- const res = (0, _1.validateTemplateString)(templateString, moduleContext, true);
134
+ const res = (0, _1.validateTemplateString)(templateString, adgIndex, moduleMetadata, moduleContext, true);
179
135
  const templateDiagnostics = res;
180
136
  //Same thing as passing false into validate getter and getting a boolean back. If there are no diagnostics its valid.
181
137
  if (templateDiagnostics.length == 0) {
182
- const validTemplate = generateValidTemplateContext(templateString, moduleContext, moduleLevelConsumption, properties, index);
138
+ const validTemplate = generateValidTemplateContext(templateString, adgIndex, moduleMetadata, index);
183
139
  validTemplates.push(validTemplate);
184
- (0, common_shared_1.updatePropertyUsage)((0, common_shared_1.getFromIdentifierOrStringLiteral)(templateString.node.key), validTemplate.memberUsage, properties, common_shared_1.PropertyTypes.TEMPLATE_STRING);
140
+ (0, common_shared_1.updatePropertyUsage)((0, common_shared_1.getFromIdentifierOrStringLiteral)(templateString.node.key), validTemplate.memberUsage, adg.properties, common_shared_1.PropertyTypes.TEMPLATE_STRING);
185
141
  }
186
142
  diagnostics.push(...templateDiagnostics);
187
143
  });
@@ -191,7 +147,16 @@ function analyzeSrcForTemplateDiagnostics(rootAst, moduleContext, moduleLevelCon
191
147
  validTemplates: validTemplates,
192
148
  };
193
149
  }
194
- exports.analyzeSrcForTemplateDiagnostics = analyzeSrcForTemplateDiagnostics;
150
+ exports.analyzeSrcForTemplateStringDiagnostics = analyzeSrcForTemplateStringDiagnostics;
151
+ /**
152
+ * Type guard for the komaci Image type
153
+ * @param {Composition} composition the komaci Composition object
154
+ * @returns {boolean} true if the Composition is more specifically an Image, false if it is not an Image
155
+ */
156
+ function isImageComposition(composition) {
157
+ return composition.type === 'Image';
158
+ }
159
+ exports.isImageComposition = isImageComposition;
195
160
  /**
196
161
  * Helper function to generate a validGetterContext
197
162
  * @param getterFunc the valid getter function
@@ -201,10 +166,8 @@ exports.analyzeSrcForTemplateDiagnostics = analyzeSrcForTemplateDiagnostics;
201
166
  * @param index index of the getter function
202
167
  * @returns a valid getter context
203
168
  */
204
- function generateValidGetterContext(getterFunc, moduleContext, moduleLevelConsumption, properties, index) {
205
- const { identifiers } = (0, common_shared_1.implicitConsumptionMetadata)(getterFunc, moduleContext.astContext.classProperties, // info on all class properties
206
- moduleContext.astContext.importDeclarations, // import metadata info
207
- moduleLevelConsumption);
169
+ function generateValidGetterContext(getterFunc, adgIndex, moduleMetadata, index) {
170
+ const { identifiers } = (0, common_shared_1.implicitConsumptionMetadata)(getterFunc, adgIndex, moduleMetadata);
208
171
  const validGetter = {
209
172
  getter: getterFunc,
210
173
  generatedName: `g${index}`,
@@ -221,10 +184,8 @@ function generateValidGetterContext(getterFunc, moduleContext, moduleLevelConsum
221
184
  * @param index index of the template string
222
185
  * @returns a valid template context
223
186
  */
224
- function generateValidTemplateContext(template, moduleContext, moduleLevelConsumption, properties, index) {
225
- const { identifiers } = (0, common_shared_1.implicitConsumptionMetadata)(template, moduleContext.astContext.classProperties, // info on all class properties
226
- moduleContext.astContext.importDeclarations, // import metadata info
227
- moduleLevelConsumption);
187
+ function generateValidTemplateContext(template, adgIndex, moduleMetadata, index) {
188
+ const { identifiers } = (0, common_shared_1.implicitConsumptionMetadata)(template, adgIndex, moduleMetadata);
228
189
  return {
229
190
  template,
230
191
  generatedName: `t${index}`,
@@ -1,3 +1,4 @@
1
+ import { KomaciDocument } from '@komaci/types';
1
2
  import { AnalyzerInput, PrimingDiagnostic, Range, Position, WireInfo } from './types';
2
3
  export declare class StaticAnalyzer {
3
4
  startPos: Position;
@@ -27,7 +28,7 @@ export declare class StaticAnalyzer {
27
28
  * @param scriptKomaciDoc KomaciDoc which provides relevant adg information
28
29
  * @returns array of PrimingDiagnostic, with each element containing the analysis message and location information for IDE syntax underlining.
29
30
  */
30
- private processKomaciTemplateDoc;
31
+ processKomaciTemplateDoc(templateKomaciDoc: KomaciDocument | undefined, scriptKomaciDoc: KomaciDocument | undefined, diagnostics: PrimingDiagnostic[]): PrimingDiagnostic[];
31
32
  private findWireConfigsThatUsePrivateProperty;
32
33
  /**
33
34
  * Traverses direct dependencies of the input wire (represented by a WireInfo) to see if any
@@ -83,22 +83,26 @@ class StaticAnalyzer {
83
83
  }
84
84
  }
85
85
  }
86
- if (sourceFileName && scriptKomaciDoc) {
87
- const properties = (0, common_shared_1.collectPropertyMetadataFromScriptDoc)(scriptKomaciDoc);
88
- if (templateKomaciDoc) {
89
- (0, common_shared_1.updatePropertyMetadataFromTemplateDoc)(templateKomaciDoc, properties);
90
- }
86
+ const adgIndex = scriptKomaciDoc?.exports?.default?.value;
87
+ const defaultAdg = scriptKomaciDoc?.adgs?.[adgIndex || 0];
88
+ if (sourceFileName &&
89
+ scriptKomaciDoc &&
90
+ adgIndex !== undefined &&
91
+ defaultAdg) {
92
+ const moduleMetadata = (0, common_shared_1.initModuleMetadataObject)();
93
+ (0, common_shared_1.initializeImportMetdataFromKomaciDocument)(scriptKomaciDoc, moduleMetadata);
94
+ const adg = (0, common_shared_1.initAdgMetadataObject)('adg0');
95
+ moduleMetadata.adgs.set(adgIndex, adg);
96
+ (0, common_shared_1.initializePropertiesMap)(defaultAdg.properties, defaultAdg.functions, adgIndex, scriptKomaciDoc, moduleMetadata);
91
97
  const srcCode = input.files[sourceFileName];
92
98
  const rootAst = (0, common_shared_1.generateAstFromSrcCode)(srcCode);
99
+ (0, common_shared_1.collectImportMetadataFromAst)(rootAst, moduleMetadata);
93
100
  const moduleContext = {
94
101
  astContext: (0, common_shared_1.getAstContextObject)(rootAst),
95
102
  isExternal: (0, common_shared_1.isExternalModule)(input.namespace),
96
103
  };
97
- const moduleLevelConsumption = {
98
- consumedImports: new Map(),
99
- };
100
- const { getterFunctionDiagnostics, validGetters } = (0, shared_1.analyzeSrcForInvalidGetterFunctions)(rootAst, moduleContext, moduleLevelConsumption, properties);
101
- const { templateDiagnostics, validTemplates } = (0, shared_1.analyzeSrcForTemplateDiagnostics)(rootAst, moduleContext, moduleLevelConsumption, properties);
104
+ const { getterFunctionDiagnostics, validGetters } = (0, shared_1.analyzeSrcForInvalidGetterFunctions)(adgIndex, rootAst, moduleMetadata, moduleContext);
105
+ const { templateDiagnostics, validTemplates } = (0, shared_1.analyzeSrcForTemplateStringDiagnostics)(adgIndex, rootAst, moduleMetadata, moduleContext);
102
106
  const getterAndTemplateDiagnostics = [
103
107
  ...getterFunctionDiagnostics,
104
108
  ...templateDiagnostics,
@@ -139,19 +143,23 @@ class StaticAnalyzer {
139
143
  // get the file name and store for VSCode analysis display purposes
140
144
  const fileName = metadataObj?.files[0].fileName;
141
145
  this.fileNamesMap.set('js', fileName);
142
- if (komaciDoc) {
143
- const properties = (0, common_shared_1.collectPropertyMetadataFromScriptDoc)(komaciDoc);
146
+ const adgIndex = komaciDoc?.exports?.default?.value;
147
+ const defaultAdg = komaciDoc?.adgs?.[adgIndex || 0];
148
+ if (komaciDoc && adgIndex !== undefined && defaultAdg) {
149
+ const moduleMetadata = (0, common_shared_1.initModuleMetadataObject)();
150
+ (0, common_shared_1.initializeImportMetdataFromKomaciDocument)(komaciDoc, moduleMetadata);
151
+ const adg = (0, common_shared_1.initAdgMetadataObject)('adg0');
152
+ moduleMetadata.adgs.set(adgIndex, adg);
153
+ (0, common_shared_1.initializePropertiesMap)(defaultAdg.properties, defaultAdg.functions, adgIndex, komaciDoc, moduleMetadata);
144
154
  const srcCode = input.sourceFile;
145
155
  const rootAst = (0, common_shared_1.generateAstFromSrcCode)(srcCode);
156
+ (0, common_shared_1.collectImportMetadataFromAst)(rootAst, moduleMetadata);
146
157
  const moduleContext = {
147
158
  astContext: (0, common_shared_1.getAstContextObject)(rootAst),
148
159
  isExternal: (0, common_shared_1.isExternalModule)(input.namespace),
149
160
  };
150
- const moduleLevelConsumption = {
151
- consumedImports: new Map(),
152
- };
153
- const { getterFunctionDiagnostics } = (0, shared_1.analyzeSrcForInvalidGetterFunctions)(rootAst, moduleContext, moduleLevelConsumption, properties);
154
- const { templateDiagnostics } = (0, shared_1.analyzeSrcForTemplateDiagnostics)(rootAst, moduleContext, moduleLevelConsumption, properties);
161
+ const { getterFunctionDiagnostics } = (0, shared_1.analyzeSrcForInvalidGetterFunctions)(adgIndex, rootAst, moduleMetadata, moduleContext);
162
+ const { templateDiagnostics } = (0, shared_1.analyzeSrcForTemplateStringDiagnostics)(adgIndex, rootAst, moduleMetadata, moduleContext);
155
163
  const getterAndTemplateDiagnostics = [
156
164
  ...getterFunctionDiagnostics,
157
165
  ...templateDiagnostics,
@@ -349,7 +357,7 @@ class StaticAnalyzer {
349
357
  const komaciImport = imports[importIdx];
350
358
  const importName = komaciImport.names[nameIdx];
351
359
  if (!((0, shared_1.isSupportedNamespace)(komaciImport.resourceName) &&
352
- (0, shared_1.isSupportedWireAdapter)(komaciImport.resourceName, imports[importIdx].names[nameIdx]))) {
360
+ (0, common_shared_1.isSupportedWireAdapter)(komaciImport.resourceName, imports[importIdx].names[nameIdx]))) {
353
361
  unresolvableImport = {
354
362
  name: importName,
355
363
  namespace: imports[importIdx].resourceName,
package/build/types.d.ts CHANGED
@@ -94,11 +94,12 @@ export declare type WireAdaptersMapping = {
94
94
  };
95
95
  };
96
96
  /**
97
- * Contextual info about the given contextual code block
97
+ * Internal type for a composition property
98
98
  */
99
- export declare type FunctionalContext = {
100
- declaredVariables: string[];
101
- thisAliases: Set<string>;
99
+ export declare type CompositionProperty = {
100
+ propertyName: string;
101
+ location?: SourceLocation;
102
+ diagnosticMessageAct: 'iterator iterates upon' | "image's src attribute is bound to" | 'child component references';
102
103
  };
103
104
  export declare type GetterDiagnosticsContext = {
104
105
  getterFunctionDiagnostics: PrimingDiagnostic[];
@@ -109,11 +110,10 @@ export declare type TemplateDiagnosticsContext = {
109
110
  validTemplates: ValidTemplateContext[];
110
111
  };
111
112
  /**
112
- * Internal type for a composition property
113
+ * Contextual info about the given contextual code block
113
114
  */
114
- export declare type CompositionProperty = {
115
- propertyName: string;
116
- location?: SourceLocation;
117
- diagnosticMessageAct: 'iterator iterates upon' | "image's src attribute is bound to" | 'child component references';
115
+ export declare type FunctionalContext = {
116
+ declaredVariables: string[];
117
+ thisAliases: Set<string>;
118
118
  };
119
119
  //# sourceMappingURL=types.d.ts.map
@@ -1,7 +1,7 @@
1
1
  import * as t from '@babel/types';
2
2
  import { NodePath } from '@babel/traverse';
3
3
  import { FunctionalContext, PrimingDiagnostic } from './types';
4
- import { ModuleContext } from '@komaci/common-shared';
4
+ import { ModuleContext, ModuleMetadata } from '@komaci/common-shared';
5
5
  /**
6
6
  * Run a series of checks against a functional node (currently class method or some form of template string) for "purity"
7
7
  *
@@ -12,7 +12,7 @@ import { ModuleContext } from '@komaci/common-shared';
12
12
  * @param functionalContext Contextual information about this functional code block
13
13
  * @returns An array of the problems identified
14
14
  */
15
- export declare function checkFunctionalPurity(path: NodePath<t.ClassMethod | t.ClassProperty>, moduleContext: ModuleContext, functionalContext: FunctionalContext): Array<PrimingDiagnostic>;
15
+ export declare function checkFunctionalPurity(path: NodePath<t.ClassMethod | t.ClassProperty>, adgIndex: number, moduleMetadata: ModuleMetadata, moduleContext: ModuleContext, functionalContext: FunctionalContext): Array<PrimingDiagnostic>;
16
16
  /**
17
17
  * Given a ClassMethod representing a getter method, it will run several invariant checks against its NodePath representation,
18
18
  * in order to determine if it adheres all designated invariants.
@@ -32,7 +32,7 @@ export declare function checkFunctionalPurity(path: NodePath<t.ClassMethod | t.C
32
32
  * Or, if returnSourceLocation is true AND a non-empty Array<InvariantDetail> is returned, that means at
33
33
  * least one invariant check failed. If no invariant checks failed, an empty Array<InvariantDetail> is returned.
34
34
  */
35
- export declare function validateGetter(getterMethodPath: NodePath<t.ClassMethod>, moduleContext: ModuleContext, returnSourceLocation?: boolean): boolean | Array<PrimingDiagnostic>;
35
+ export declare function validateGetter(getterMethodPath: NodePath<t.ClassMethod>, adgIndex: number, moduleMetadata: ModuleMetadata, moduleContext: ModuleContext, returnSourceLocation?: boolean): boolean | Array<PrimingDiagnostic>;
36
36
  /**
37
37
  * Validate template strings for purity. Variable declarations are not valid inside of a template expression so we do not have to support that use case here.
38
38
  * Template string processing is essentially a subset of what we do for getter functions. The only diff is that we don't have to do the extra "only a return statement"
@@ -42,5 +42,5 @@ export declare function validateGetter(getterMethodPath: NodePath<t.ClassMethod>
42
42
  * @param returnSourceLocation if we have to return the priming diagnostics or not
43
43
  * @returns Priming diagnostics or just a true/false if it's valid
44
44
  */
45
- export declare function validateTemplateString(node: NodePath<t.ClassProperty>, moduleContext: ModuleContext, returnSourceLocation?: boolean): boolean | Array<PrimingDiagnostic>;
45
+ export declare function validateTemplateString(node: NodePath<t.ClassProperty>, adgIndex: number, moduleMetadata: ModuleMetadata, moduleContext: ModuleContext, returnSourceLocation?: boolean): boolean | Array<PrimingDiagnostic>;
46
46
  //# sourceMappingURL=validateGetter.d.ts.map
@@ -19,64 +19,68 @@ const taggedTemplateExpressionInvariantFunctions_1 = require("./invariantFunctio
19
19
  * @param functionalContext Contextual information about this functional code block
20
20
  * @returns An array of the problems identified
21
21
  */
22
- function checkFunctionalPurity(path, moduleContext, functionalContext) {
22
+ function checkFunctionalPurity(path, adgIndex, moduleMetadata, moduleContext, functionalContext) {
23
23
  let primingDiagnostics = [];
24
- const Visitors = {
25
- // visitor for each type
26
- MemberExpression(path) {
27
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
28
- (0, memberExpressionInvariantFunctions_1.checkNoUsageOfDocumentOrWindow)(path),
29
- (0, memberExpressionInvariantFunctions_1.checkForNonSupportedMemberRefs)(path, moduleContext.astContext.classProperties),
30
- (0, memberExpressionInvariantFunctions_1.checkForNonExistentMemberRefs)(path, moduleContext.astContext.classProperties, functionalContext.thisAliases),
31
- (0, memberExpressionInvariantFunctions_1.checkMemberExpressionForNonSupportedNamespaceRefs)(path, moduleContext.astContext.importDeclarations),
32
- (0, memberExpressionInvariantFunctions_1.checkForNoUseOfSuper)(path),
33
- (0, memberExpressionInvariantFunctions_1.checkForUnsupportedGlobalRef)(path, moduleContext.astContext, functionalContext.declaredVariables),
34
- ]);
35
- },
36
- CallExpression(path) {
37
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
38
- (0, callExpressionInvariantFunctions_1.checkNoUsageOfEval)(path),
39
- (0, callExpressionInvariantFunctions_1.checkCallExpressionForNonSupportedNamespaceRefs)(path, moduleContext.astContext.importDeclarations),
40
- (0, callExpressionInvariantFunctions_1.checkForNoReferenceToClassFunctions)(path, moduleContext.astContext.classFunctions),
41
- (0, callExpressionInvariantFunctions_1.checkForNoReferenceToModuleFunctions)(path, moduleContext.astContext.moduleFunctions),
42
- ]);
43
- },
44
- AssignmentExpression(path) {
45
- const functionCallArr = [(0, assignmentExpressionInvariantFunctions_1.checkForNoMemberVariableAssignments)(path)];
46
- if (moduleContext.isExternal) {
47
- functionCallArr.push((0, assignmentExpressionInvariantFunctions_1.checkExternalComponentForAssignmentExpr)(path));
48
- }
49
- primingDiagnostics = processLocationInfo(primingDiagnostics, functionCallArr);
50
- },
51
- FunctionExpression(path) {
52
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
53
- (0, functionExpressionInvariantFunctions_1.checkForFunctionExpressionIfExternalComponent)(moduleContext, path),
54
- ]);
55
- },
56
- ArrowFunctionExpression(path) {
57
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
58
- (0, functionExpressionInvariantFunctions_1.checkForFunctionExpressionIfExternalComponent)(moduleContext, path),
59
- ]);
60
- },
61
- ObjectMethod(path) {
62
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
63
- (0, functionExpressionInvariantFunctions_1.checkForObjectMethodFunctionDeclarations)(moduleContext, path),
64
- ]);
65
- },
66
- Identifier(path) {
67
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
68
- (0, identifierInvariantFunctions_1.checkForNoReferenceToModuleVariables)(path, moduleContext.astContext.moduleVariables, functionalContext.declaredVariables),
69
- (0, identifierInvariantFunctions_1.checkIdentifierForNonSupportedNamespaceRefs)(path, moduleContext.astContext.importDeclarations, functionalContext.declaredVariables),
70
- ]);
71
- },
72
- TaggedTemplateExpression(path) {
73
- primingDiagnostics = processLocationInfo(primingDiagnostics, [
74
- (0, taggedTemplateExpressionInvariantFunctions_1.checkTaggedTemplateExprForNonSupportedNamespaceRefs)(path, moduleContext.astContext.importDeclarations),
75
- ]);
76
- },
77
- };
78
- // traverse the getter method NodePath, checking the logic in the visitors for each corresponding type of node to check
79
- path.traverse(Visitors);
24
+ const adg = moduleMetadata.adgs.get(adgIndex);
25
+ if (adg) {
26
+ const properties = adg.properties;
27
+ const Visitors = {
28
+ // visitor for each type
29
+ MemberExpression(path) {
30
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
31
+ (0, memberExpressionInvariantFunctions_1.checkNoUsageOfDocumentOrWindow)(path),
32
+ (0, memberExpressionInvariantFunctions_1.checkForNonSupportedMemberRefs)(path, properties),
33
+ (0, memberExpressionInvariantFunctions_1.checkForNonExistentMemberRefs)(path, properties, functionalContext.thisAliases),
34
+ (0, memberExpressionInvariantFunctions_1.checkMemberExpressionForNonSupportedNamespaceRefs)(path, moduleMetadata.importsByName),
35
+ (0, memberExpressionInvariantFunctions_1.checkForNoUseOfSuper)(path),
36
+ (0, memberExpressionInvariantFunctions_1.checkForUnsupportedGlobalRef)(path, moduleContext.astContext, moduleMetadata.importsByName, adg.properties, functionalContext.declaredVariables),
37
+ ]);
38
+ },
39
+ CallExpression(path) {
40
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
41
+ (0, callExpressionInvariantFunctions_1.checkNoUsageOfEval)(path),
42
+ (0, callExpressionInvariantFunctions_1.checkCallExpressionForNonSupportedNamespaceRefs)(path, moduleMetadata.importsByName),
43
+ (0, callExpressionInvariantFunctions_1.checkForNoReferenceToClassFunctions)(path, moduleContext.astContext.classFunctions),
44
+ (0, callExpressionInvariantFunctions_1.checkForNoReferenceToModuleFunctions)(path, moduleContext.astContext.moduleFunctions),
45
+ ]);
46
+ },
47
+ AssignmentExpression(path) {
48
+ const functionCallArr = [(0, assignmentExpressionInvariantFunctions_1.checkForNoMemberVariableAssignments)(path)];
49
+ if (moduleContext.isExternal) {
50
+ functionCallArr.push((0, assignmentExpressionInvariantFunctions_1.checkExternalComponentForAssignmentExpr)(path));
51
+ }
52
+ primingDiagnostics = processLocationInfo(primingDiagnostics, functionCallArr);
53
+ },
54
+ FunctionExpression(path) {
55
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
56
+ (0, functionExpressionInvariantFunctions_1.checkForFunctionExpressionIfExternalComponent)(moduleContext, path),
57
+ ]);
58
+ },
59
+ ArrowFunctionExpression(path) {
60
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
61
+ (0, functionExpressionInvariantFunctions_1.checkForFunctionExpressionIfExternalComponent)(moduleContext, path),
62
+ ]);
63
+ },
64
+ ObjectMethod(path) {
65
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
66
+ (0, functionExpressionInvariantFunctions_1.checkForObjectMethodFunctionDeclarations)(moduleContext, path),
67
+ ]);
68
+ },
69
+ Identifier(path) {
70
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
71
+ (0, identifierInvariantFunctions_1.checkForNoReferenceToModuleVariables)(path, moduleContext.astContext.moduleVariables, functionalContext.declaredVariables),
72
+ (0, identifierInvariantFunctions_1.checkIdentifierForNonSupportedNamespaceRefs)(path, moduleMetadata.importsByName, functionalContext.declaredVariables),
73
+ ]);
74
+ },
75
+ TaggedTemplateExpression(path) {
76
+ primingDiagnostics = processLocationInfo(primingDiagnostics, [
77
+ (0, taggedTemplateExpressionInvariantFunctions_1.checkTaggedTemplateExprForNonSupportedNamespaceRefs)(path, moduleMetadata.importsByName),
78
+ ]);
79
+ },
80
+ };
81
+ // traverse the getter method NodePath, checking the logic in the visitors for each corresponding type of node to check
82
+ path.traverse(Visitors);
83
+ }
80
84
  return primingDiagnostics;
81
85
  }
82
86
  exports.checkFunctionalPurity = checkFunctionalPurity;
@@ -99,10 +103,10 @@ exports.checkFunctionalPurity = checkFunctionalPurity;
99
103
  * Or, if returnSourceLocation is true AND a non-empty Array<InvariantDetail> is returned, that means at
100
104
  * least one invariant check failed. If no invariant checks failed, an empty Array<InvariantDetail> is returned.
101
105
  */
102
- function validateGetter(getterMethodPath, moduleContext, returnSourceLocation = false) {
106
+ function validateGetter(getterMethodPath, adgIndex, moduleMetadata, moduleContext, returnSourceLocation = false) {
103
107
  const getterDeclaredVars = (0, common_shared_1.getVariablesDeclaredInGetter)(getterMethodPath);
104
108
  const thisAliases = (0, common_shared_1.getThisAliasDeclaredInGetter)(getterMethodPath);
105
- let primingDiagnostics = checkFunctionalPurity(getterMethodPath, moduleContext, {
109
+ let primingDiagnostics = checkFunctionalPurity(getterMethodPath, adgIndex, moduleMetadata, moduleContext, {
106
110
  thisAliases,
107
111
  declaredVariables: getterDeclaredVars,
108
112
  });
@@ -143,8 +147,8 @@ function processLocationInfo(allInvalidLocations, results) {
143
147
  * @param returnSourceLocation if we have to return the priming diagnostics or not
144
148
  * @returns Priming diagnostics or just a true/false if it's valid
145
149
  */
146
- function validateTemplateString(node, moduleContext, returnSourceLocation = false) {
147
- const diagnostics = checkFunctionalPurity(node, moduleContext, {
150
+ function validateTemplateString(node, adgIndex, moduleMetadata, moduleContext, returnSourceLocation = false) {
151
+ const diagnostics = checkFunctionalPurity(node, adgIndex, moduleMetadata, moduleContext, {
148
152
  declaredVariables: [],
149
153
  thisAliases: new Set(),
150
154
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@komaci/static-analyzer",
3
- "version": "242.0.0",
3
+ "version": "242.1.0",
4
4
  "description": "Komaci Diagnostics API",
5
5
  "homepage": "https://komaci.dev/",
6
6
  "repository": {
@@ -23,16 +23,15 @@
23
23
  },
24
24
  "files": [
25
25
  "build/**/*.js",
26
- "build/**/*.d.ts",
27
- "build/komaci-mapping.json"
26
+ "build/**/*.d.ts"
28
27
  ],
29
28
  "dependencies": {
30
- "@komaci/common-shared": "242.0.0",
29
+ "@komaci/common-shared": "242.1.0",
31
30
  "@lwc/metadata": "2.22.0-0",
32
31
  "@lwc/sfdc-compiler-utils": "2.22.0-0"
33
32
  },
34
33
  "devDependencies": {
35
34
  "@babel/types": "^7.9.0",
36
- "@komaci/types": "242.0.0"
35
+ "@komaci/types": "242.1.0"
37
36
  }
38
37
  }
@@ -1,3 +0,0 @@
1
- import { WireAdaptersMapping } from './types';
2
- export declare const wireAdaptersMap: WireAdaptersMapping;
3
- //# sourceMappingURL=adaptersMapping.d.ts.map
@@ -1,29 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || function (mod) {
19
- if (mod && mod.__esModule) return mod;
20
- var result = {};
21
- if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
- __setModuleDefault(result, mod);
23
- return result;
24
- };
25
- Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.wireAdaptersMap = void 0;
27
- const wireAdapterImport = __importStar(require("./komaci-mapping.json"));
28
- exports.wireAdaptersMap = wireAdapterImport;
29
- //# sourceMappingURL=adaptersMapping.js.map
@@ -1,6 +0,0 @@
1
- export declare const allowlistAdapters: {
2
- [key: string]: string[];
3
- };
4
- export declare const allowlistResourceNamesStartsWith: string[];
5
- export declare const allowlistResourceNamesExact: string[];
6
- //# sourceMappingURL=allowlistAdapters.d.ts.map
@@ -1,10 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.allowlistResourceNamesExact = exports.allowlistResourceNamesStartsWith = exports.allowlistAdapters = void 0;
4
- exports.allowlistAdapters = {
5
- 'lightning/navigation': ['CurrentPageReference'],
6
- }; // these must match the resourceName and one or more of the wire adapter names (export names), exactly
7
- // these can have any wire adapter name (export name)
8
- exports.allowlistResourceNamesStartsWith = ['@salesforce/apex']; // resourceName can start with
9
- exports.allowlistResourceNamesExact = ['laf/transformWire']; // resourceName must exactly match this
10
- //# sourceMappingURL=allowlistAdapters.js.map
@@ -1,288 +0,0 @@
1
- {
2
- "lightning/uiRecordActionsApi": {
3
- "getRecordActions": {
4
- "prime": {
5
- "importPath": "lightning/unstable_uiRecordActionsApi",
6
- "identifier": "unstable_getRecordActions_imperative"
7
- }
8
- },
9
- "getRelatedListsActions": {
10
- "prime": {
11
- "importPath": "lightning/unstable_uiRecordActionsApi",
12
- "identifier": "unstable_getRelatedListsActions_imperative"
13
- }
14
- },
15
- "getRelatedListActions": {
16
- "prime": {
17
- "importPath": "lightning/unstable_uiRecordActionsApi",
18
- "identifier": "unstable_getRelatedListActions_imperative"
19
- },
20
- "batch": {
21
- "prime": {
22
- "importPath": "lightning/unstable_uiRecordActionsApi",
23
- "identifier": "unstable_getRelatedListsActions_imperative"
24
- },
25
- "reducer": {
26
- "importPath": "laf/batchingPortable",
27
- "identifier": "RelatedListActionsBatchReducer"
28
- }
29
- }
30
- }
31
- },
32
- "lightning/uiLayoutApi": {
33
- "getLayout": {
34
- "prime": {
35
- "importPath": "lightning/unstable_uiLayoutApi",
36
- "identifier": "unstable_getLayout_imperative"
37
- }
38
- },
39
- "getLayoutUserState": {
40
- "prime": {
41
- "importPath": "lightning/unstable_uiLayoutApi",
42
- "identifier": "unstable_getLayoutUserState_imperative"
43
- }
44
- }
45
- },
46
- "lightning/uiListsApi": {
47
- "getListInfoByName": {
48
- "prime": {
49
- "importPath": "lightning/unstable_uiListsApi",
50
- "identifier": "unstable_getListInfoByName_imperative"
51
- }
52
- }
53
- },
54
- "lightning/uiAppsApi": {
55
- "getNavItems": {
56
- "prime": {
57
- "importPath": "lightning/unstable_uiAppsApi",
58
- "identifier": "unstable_getNavItems_imperative"
59
- }
60
- }
61
- },
62
- "lightning/uiObjectInfoApi": {
63
- "getObjectInfos": {
64
- "prime": {
65
- "importPath": "lightning/unstable_uiObjectInfoApi",
66
- "identifier": "unstable_getObjectInfos_imperative"
67
- },
68
- "batch": {
69
- "prime": {
70
- "importPath": "lightning/unstable_uiObjectInfoApi",
71
- "identifier": "unstable_getObjectInfos_imperative"
72
- },
73
- "reducer": {
74
- "importPath": "laf/batchingPortable",
75
- "identifier": "ObjectInfosBatchReducer"
76
- }
77
- }
78
- },
79
- "getObjectInfo": {
80
- "prime": {
81
- "importPath": "lightning/unstable_uiObjectInfoApi",
82
- "identifier": "unstable_getObjectInfo_imperative"
83
- },
84
- "batch": {
85
- "prime": {
86
- "importPath": "lightning/unstable_uiObjectInfoApi",
87
- "identifier": "unstable_getObjectInfos_imperative"
88
- },
89
- "reducer": {
90
- "importPath": "laf/batchingPortable",
91
- "identifier": "ObjectInfoBatchReducer"
92
- }
93
- }
94
- },
95
- "getPicklistValuesByRecordType": {
96
- "prime": {
97
- "importPath": "lightning/unstable_uiObjectInfoApi",
98
- "identifier": "unstable_getPicklistValuesByRecordType_imperative"
99
- }
100
- },
101
- "getPicklistValues": {
102
- "prime": {
103
- "importPath": "lightning/unstable_uiObjectInfoApi",
104
- "identifier": "unstable_getPicklistValues_imperative"
105
- }
106
- }
107
- },
108
- "lightning/uiRecordAvatarApi": {
109
- "getRecordAvatars": {
110
- "prime": {
111
- "importPath": "lightning/unstable_uiRecordAvatarApi",
112
- "identifier": "unstable_getRecordAvatars_imperative"
113
- },
114
- "batch": {
115
- "prime": {
116
- "importPath": "lightning/unstable_uiRecordAvatarApi",
117
- "identifier": "unstable_getRecordAvatars_imperative"
118
- },
119
- "reducer": {
120
- "importPath": "laf/batchingPortable",
121
- "identifier": "RecordAvatarBatchReducer"
122
- }
123
- }
124
- }
125
- },
126
- "lightning/uiRecordApi": {
127
- "getRecordCreateDefaults": {
128
- "prime": {
129
- "importPath": "lightning/unstable_uiRecordApi",
130
- "identifier": "unstable_getRecordCreateDefaults_imperative"
131
- }
132
- },
133
- "getRecordUi": {
134
- "prime": {
135
- "importPath": "lightning/unstable_uiRecordApi",
136
- "identifier": "unstable_getRecordUi_imperative"
137
- }
138
- },
139
- "getRecords": {
140
- "prime": {
141
- "importPath": "lightning/unstable_uiRecordApi",
142
- "identifier": "unstable_getRecords_imperative"
143
- }
144
- },
145
- "getRecord": {
146
- "prime": {
147
- "importPath": "lightning/unstable_uiRecordApi",
148
- "identifier": "unstable_getRecord_imperative"
149
- },
150
- "batch": {
151
- "prime": {
152
- "importPath": "lightning/unstable_uiRecordApi",
153
- "identifier": "unstable_getRecords_imperative"
154
- },
155
- "reducer": {
156
- "importPath": "laf/batchingPortable",
157
- "identifier": "GetRecordBatchReducer"
158
- }
159
- }
160
- }
161
- },
162
- "lightning/uiRelatedListApi": {
163
- "getRelatedListsCount": {
164
- "prime": {
165
- "importPath": "lightning/unstable_uiRelatedListApi",
166
- "identifier": "unstable_getRelatedListsCount_imperative"
167
- }
168
- },
169
- "getRelatedListCount": {
170
- "prime": {
171
- "importPath": "lightning/unstable_uiRelatedListApi",
172
- "identifier": "unstable_getRelatedListCount_imperative"
173
- }
174
- },
175
- "getRelatedListInfoBatch": {
176
- "prime": {
177
- "importPath": "lightning/unstable_uiRelatedListApi",
178
- "identifier": "unstable_getRelatedListInfoBatch_imperative"
179
- }
180
- },
181
- "getRelatedListsInfo": {
182
- "prime": {
183
- "importPath": "lightning/unstable_uiRelatedListApi",
184
- "identifier": "unstable_getRelatedListsInfo_imperative"
185
- }
186
- },
187
- "getRelatedListInfo": {
188
- "prime": {
189
- "importPath": "lightning/unstable_uiRelatedListApi",
190
- "identifier": "unstable_getRelatedListInfo_imperative"
191
- },
192
- "batch": {
193
- "prime": {
194
- "importPath": "lightning/unstable_uiRelatedListApi",
195
- "identifier": "unstable_getRelatedListInfoBatch_imperative"
196
- },
197
- "reducer": {
198
- "importPath": "laf/batchingPortable",
199
- "identifier": "RelatedListInfoBatchReducer"
200
- }
201
- }
202
- },
203
- "getRelatedListRecordsBatch": {
204
- "prime": {
205
- "importPath": "lightning/unstable_uiRelatedListApi",
206
- "identifier": "unstable_getRelatedListRecordsBatch_imperative"
207
- }
208
- },
209
- "getRelatedListRecords": {
210
- "prime": {
211
- "importPath": "lightning/unstable_uiRelatedListApi",
212
- "identifier": "unstable_getRelatedListRecords_imperative"
213
- },
214
- "batch": {
215
- "prime": {
216
- "importPath": "lightning/unstable_uiRelatedListApi",
217
- "identifier": "unstable_getRelatedListRecordsBatch_imperative"
218
- },
219
- "reducer": {
220
- "importPath": "laf/batchingPortable",
221
- "identifier": "RelatedListRecordsBatchReducer"
222
- }
223
- }
224
- }
225
- },
226
- "lightning/unstable_uiRelatedListApi": {
227
- "unstable_getRelatedListInfoBatch": {
228
- "prime": {
229
- "importPath": "lightning/unstable_uiRelatedListApi",
230
- "identifier": "unstable_getRelatedListInfoBatch_imperative"
231
- }
232
- },
233
- "unstable_getRelatedListRecordsBatch": {
234
- "prime": {
235
- "importPath": "lightning/unstable_uiRelatedListApi",
236
- "identifier": "unstable_getRelatedListRecordsBatch_imperative"
237
- }
238
- }
239
- },
240
- "lightning/uiSearchApi": {
241
- "getSearchFilterOptions": {
242
- "prime": {
243
- "importPath": "lightning/unstable_uiSearchApi",
244
- "identifier": "unstable_getSearchFilterOptions_imperative"
245
- }
246
- },
247
- "getSearchResults": {
248
- "prime": {
249
- "importPath": "lightning/unstable_uiSearchApi",
250
- "identifier": "unstable_getSearchResults_imperative"
251
- }
252
- },
253
- "getKeywordSearchResults": {
254
- "prime": {
255
- "importPath": "lightning/unstable_uiSearchApi",
256
- "identifier": "unstable_getKeywordSearchResults_imperative"
257
- }
258
- }
259
- },
260
- "lightning/unstable_uiSearchApi": {
261
- "unstable_getSearchFilterOptions": {
262
- "prime": {
263
- "importPath": "lightning/unstable_uiSearchApi",
264
- "identifier": "unstable_getSearchFilterOptions_imperative"
265
- }
266
- },
267
- "unstable_getSearchResults": {
268
- "prime": {
269
- "importPath": "lightning/unstable_uiSearchApi",
270
- "identifier": "unstable_getSearchResults_imperative"
271
- }
272
- },
273
- "unstable_getKeywordSearchResults": {
274
- "prime": {
275
- "importPath": "lightning/unstable_uiSearchApi",
276
- "identifier": "unstable_getKeywordSearchResults_imperative"
277
- }
278
- }
279
- },
280
- "lightning/unstable_uiGraphQLApi": {
281
- "graphQL": {
282
- "prime": {
283
- "importPath": "lightning/unstable_uiGraphQLApi",
284
- "identifier": "unstable_graphQL_imperative"
285
- }
286
- }
287
- }
288
- }