@komaci/common-shared 246.0.3 → 246.0.5

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/utils.d.ts CHANGED
@@ -165,4 +165,11 @@ export declare function getFilepathSegments(fullFilename: string): string[];
165
165
  * @param name the filename
166
166
  */
167
167
  export declare function getComponentId(namespace: string, name: string): string;
168
+ /**
169
+ * Function to set the property types in the module metadata before processing and validating the properties.
170
+ * @param properties an array of properties, can contain either getters or template strings;
171
+ * @param adgIndex the index of the adg we want to get the properties for
172
+ * @param moduleMetadata the module metadata object.
173
+ */
174
+ export declare function setGetterPropertyTypeBeforeProcessing(properties: NodePath<t.ClassMethod>[], adgIndex: number, moduleMetadata: ModuleMetadata): void;
168
175
  //# sourceMappingURL=utils.d.ts.map
package/build/utils.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getComponentId = 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;
3
+ exports.setGetterPropertyTypeBeforeProcessing = exports.getComponentId = 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
  const allowlistNamespaces_1 = require("./allowlistNamespaces");
@@ -534,4 +534,24 @@ function getComponentId(namespace, name) {
534
534
  .toLocaleLowerCase();
535
535
  }
536
536
  exports.getComponentId = getComponentId;
537
+ /**
538
+ * Function to set the property types in the module metadata before processing and validating the properties.
539
+ * @param properties an array of properties, can contain either getters or template strings;
540
+ * @param adgIndex the index of the adg we want to get the properties for
541
+ * @param moduleMetadata the module metadata object.
542
+ */
543
+ function setGetterPropertyTypeBeforeProcessing(properties, adgIndex, moduleMetadata) {
544
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
545
+ const adg = moduleMetadata.adgs.get(adgIndex);
546
+ properties.forEach((prop) => {
547
+ if (prop.type === 'ClassMethod') {
548
+ const getterName = getClassMethodName(prop);
549
+ const property = adg.properties.get(getterName);
550
+ if (property) {
551
+ property.type = types_1.PropertyTypes.GETTER;
552
+ }
553
+ }
554
+ });
555
+ }
556
+ exports.setGetterPropertyTypeBeforeProcessing = setGetterPropertyTypeBeforeProcessing;
537
557
  //# sourceMappingURL=utils.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@komaci/common-shared",
3
- "version": "246.0.3",
3
+ "version": "246.0.5",
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": "246.0.3"
32
+ "@komaci/types": "246.0.5"
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/core": "^7.9.0",