@hubspot/project-parsing-lib 0.2.2-beta.0 → 0.3.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.2.2-beta.0",
3
+ "version": "0.3.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
@@ -1,7 +1,7 @@
1
- import { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, TranslationContext, TranslationOptions, IntermediateRepresentationNodeLocalDev } from './lib/types';
1
+ import { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, TranslationContext, TranslationOptions, IntermediateRepresentationNodeLocalDev, TranslationOptionsLocalDev } from './lib/types';
2
2
  import { ValidateFunction, AnySchema, ErrorObject } from 'ajv/dist/2020';
3
3
  export declare function translate(translationContext: TranslationContext, translationOptions?: TranslationOptions): Promise<IntermediateRepresentation>;
4
- export declare function translateForLocalDev(translationContext: TranslationContext, translationOptions?: Pick<TranslationOptions, 'profile'>): Promise<IntermediateRepresentationLocalDev>;
4
+ export declare function translateForLocalDev(translationContext: TranslationContext, translationOptions?: TranslationOptionsLocalDev): Promise<IntermediateRepresentationLocalDev>;
5
5
  export { isTranslationError } from './lib/errors';
6
6
  export { IntermediateRepresentation, IntermediateRepresentationNode, IntermediateRepresentationLocalDev, IntermediateRepresentationNodeLocalDev, TranslationContext, };
7
7
  export { getHsProfileFilename } from './lib/profiles';
package/src/index.js CHANGED
@@ -43,11 +43,13 @@ async function translateForLocalDev(translationContext, translationOptions) {
43
43
  Object.entries(IR.intermediateNodesIndexedByUid).forEach(([uid, node]) => {
44
44
  const component = IR.intermediateNodesIndexedByUid[uid];
45
45
  const componentConfigPath = path_1.default.join(translationContext.projectSourceDir, component.metaFilePath);
46
+ const configUpdatedSinceLastUpload = Boolean(translationOptions?.configFilesUpdatedSinceLastUpload?.has(componentConfigPath));
46
47
  localDevIr.intermediateNodesIndexedByUid[uid] = {
47
48
  ...node,
48
49
  localDev: {
49
50
  componentRoot: path_1.default.dirname(componentConfigPath),
50
51
  componentConfigPath,
52
+ configUpdatedSinceLastUpload,
51
53
  },
52
54
  };
53
55
  });
@@ -34,6 +34,7 @@ export interface IntermediateRepresentationNodeLocalDev extends IntermediateRepr
34
34
  localDev: {
35
35
  componentRoot: string;
36
36
  componentConfigPath: string;
37
+ configUpdatedSinceLastUpload: boolean;
37
38
  };
38
39
  }
39
40
  export interface IntermediateRepresentationLocalDev {
@@ -58,6 +59,9 @@ export interface TranslationOptions {
58
59
  skipValidation?: boolean;
59
60
  profile?: string;
60
61
  }
62
+ export interface TranslationOptionsLocalDev extends TranslationOptions {
63
+ configFilesUpdatedSinceLastUpload?: Set<string>;
64
+ }
61
65
  export interface HsProfileFile {
62
66
  accountId: number;
63
67
  variables?: {