@hubspot/project-parsing-lib 0.1.4 → 0.1.6-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hubspot/project-parsing-lib",
3
- "version": "0.1.4",
3
+ "version": "0.1.6-beta.0",
4
4
  "description": "Parsing library for converting projects directory structures to their intermediate representation",
5
5
  "license": "Apache-2.0",
6
6
  "main": "src/index.js",
package/src/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export { isTranslationError } from './lib/errors';
5
5
  export { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, IntermediateRepresentationNodeLocalDev, TranslationContext, };
6
6
  export { migrate } from './lib/migrate';
7
7
  export { validateUid } from './lib/uid';
8
+ export { mapToUserFriendlyName } from './lib/transform';
package/src/index.js CHANGED
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
6
+ exports.mapToUserFriendlyName = exports.validateUid = exports.migrate = exports.isTranslationError = void 0;
7
7
  exports.translate = translate;
8
8
  exports.translateForLocalDev = translateForLocalDev;
9
9
  const files_1 = require("./lib/files");
@@ -52,3 +52,5 @@ var migrate_1 = require("./lib/migrate");
52
52
  Object.defineProperty(exports, "migrate", { enumerable: true, get: function () { return migrate_1.migrate; } });
53
53
  var uid_1 = require("./lib/uid");
54
54
  Object.defineProperty(exports, "validateUid", { enumerable: true, get: function () { return uid_1.validateUid; } });
55
+ var transform_2 = require("./lib/transform");
56
+ Object.defineProperty(exports, "mapToUserFriendlyName", { enumerable: true, get: function () { return transform_2.mapToUserFriendlyName; } });
package/src/lang/copy.js CHANGED
@@ -16,7 +16,7 @@ exports.errorMessages = {
16
16
  missingRequiredField: (field) => `Missing required field: '${field}'`,
17
17
  missingUid: `Missing required field: 'uid'`,
18
18
  emptyUid: `'uid' must be at least one character long`,
19
- invalidUid: `'uid' must be lowercase and contain only numbers and underscores`,
19
+ invalidUid: `'uid' should be in lowercase, using only letters, numbers, and underscores. For example: app_id_123`,
20
20
  uidTooLong: `'uid' must be 64 characters or less`,
21
21
  missingType: `Missing required field: 'type'`,
22
22
  missingConfig: `Missing required field: 'config'`,
@@ -1,4 +1,5 @@
1
1
  import { FileParseResult, IntermediateRepresentation, Transformation } from './types';
2
2
  export declare function mapToUserFacingType(type: string): string;
3
+ export declare function mapToUserFriendlyName(internalType: string): string;
3
4
  export declare function transform(fileParseResults: FileParseResult[]): Transformation[];
4
5
  export declare function getIntermediateRepresentation(transformations: Transformation[], skipValidation: boolean | undefined): IntermediateRepresentation;
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.mapToUserFacingType = mapToUserFacingType;
4
+ exports.mapToUserFriendlyName = mapToUserFriendlyName;
4
5
  exports.transform = transform;
5
6
  exports.getIntermediateRepresentation = getIntermediateRepresentation;
6
7
  const constants_1 = require("./constants");
@@ -33,6 +34,9 @@ function mapToUserFacingType(type) {
33
34
  .toLowerCase()
34
35
  .replace(/_/g, '-');
35
36
  }
37
+ function mapToUserFriendlyName(internalType) {
38
+ return constants_1.Components[mapToUserFacingType(internalType)]?.userFriendlyName || '';
39
+ }
36
40
  function transform(fileParseResults) {
37
41
  const parentTypes = Object.keys(constants_1.ProjectStructure);
38
42
  const parentComponents = {};