@hubspot/project-parsing-lib
v0.0.1
Published
Parsing library for converting projects directory structures to their intermediate representation
Downloads
63
Maintainers
Keywords
Readme
project-translation-layer
Description
This project is a translation layer that can be used to translate a project to its immediate representation prior to being uploaded to the project v2 service.
Flow Chart
sequenceDiagram
autonumber
actor dev as External Developer
participant cli as HS CLI
participant ppl as Project Parsing Library
participant pv3 as Projects v3
dev ->> cli: Developer runs `hs project upload`
cli ->> cli: Loads project config
cli ->> ppl: CLI calls `translate` function with the values required from the project config
ppl ->> ppl: Walks the project directory looking for the hsmeta files
loop For each hsmeta file
ppl ->> ppl: Checks if file is valid JSON
ppl ->> ppl: Checks if the file is in a valid location
ppl ->> ppl: Generates the IR
end
ppl ->> pv3: Fetch the schemas used to validate the generated IR
loop For each hsmeta file
ppl ->> ppl: Validate the IR config block against the schema
end
alt Validation successful for all schemas
ppl ->> cli: Pass the IR back to the CLI
cli ->> cli: Zip the project contents
cli ->> pv3: Upload the project and the IR
else Validation failed for 1+ schema(s)
ppl ->> cli: Log the error and exit the upload
end