@hubspot/project-parsing-lib 0.6.0 → 0.6.1-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,11 +1,11 @@
1
1
  {
2
2
  "name": "@hubspot/project-parsing-lib",
3
- "version": "0.6.0",
3
+ "version": "0.6.1-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",
7
7
  "devDependencies": {
8
- "@hubspot/local-dev-lib": "^3.1.0",
8
+ "@hubspot/local-dev-lib": "^3.16.0",
9
9
  "@inquirer/prompts": "^7.1.0",
10
10
  "@types/jest": "^29.5.14",
11
11
  "@types/semver": "^7.5.8",
@@ -27,7 +27,7 @@
27
27
  "ajv-formats": "3.0.1"
28
28
  },
29
29
  "peerDependencies": {
30
- "@hubspot/local-dev-lib": "^3.1.0"
30
+ "@hubspot/local-dev-lib": "^3.16.0"
31
31
  },
32
32
  "scripts": {
33
33
  "build": "ts-node ./scripts/build.ts",
package/src/index.js CHANGED
@@ -40,6 +40,7 @@ async function translateForLocalDev(translationContext, translationOptions) {
40
40
  });
41
41
  const localDevIr = {
42
42
  intermediateNodesIndexedByUid: {},
43
+ profileData: {},
43
44
  };
44
45
  Object.entries(IR.intermediateNodesIndexedByUid).forEach(([uid, node]) => {
45
46
  const component = IR.intermediateNodesIndexedByUid[uid];
@@ -64,6 +65,11 @@ async function translateForLocalDev(translationContext, translationOptions) {
64
65
  },
65
66
  };
66
67
  });
68
+ if (IR.profileData?.vars.profileVariables) {
69
+ Object.entries(IR.profileData.vars.profileVariables).forEach(([key, value]) => {
70
+ localDevIr.profileData[key] = value.value;
71
+ });
72
+ }
67
73
  return localDevIr;
68
74
  }
69
75
  var errors_1 = require("./lib/errors");
@@ -171,15 +171,7 @@ function getProfileData(hsProfileContents) {
171
171
  }
172
172
  });
173
173
  }
174
- let profileData = {};
175
- if (Object.keys(profileVariablesForBE).length > 0) {
176
- profileData = {
177
- vars: {
178
- profileVariables: profileVariablesForBE,
179
- },
180
- };
181
- }
182
- return profileData;
174
+ return { vars: { profileVariables: profileVariablesForBE } };
183
175
  }
184
176
  function generateServerlessPackageComponent(appFunctionsDirectory, translationContext, componentDeps) {
185
177
  const packageFile = path_1.default.join(appFunctionsDirectory, constants_1.packageJson);
@@ -37,7 +37,7 @@ export interface IntermediateRepresentation {
37
37
  [key: string]: IntermediateRepresentationNode;
38
38
  };
39
39
  profileData?: {
40
- vars?: {
40
+ vars: {
41
41
  profileVariables: BEProfileVariables;
42
42
  };
43
43
  };
@@ -53,6 +53,7 @@ export interface IntermediateRepresentationLocalDev {
53
53
  intermediateNodesIndexedByUid: {
54
54
  [key: string]: IntermediateRepresentationNodeLocalDev;
55
55
  };
56
+ profileData: HSProfileVariables;
56
57
  }
57
58
  export type Transformation = {
58
59
  intermediateRepresentation?: IntermediateRepresentationNode | null;