s1seven / schema-tools

Tools to create, validate and render certificates using Material Identity JSON schemas
https://materialidentity.org/
Apache License 2.0
1 stars 1 forks source link

feat: add hbs partials support #168

Closed eamon0989 closed 2 years ago

eamon0989 commented 2 years ago

Description

Add helper getPartials to load and compile partials from a partialsMap. Add tests for getPartials. Fix all failing tests. Deprecate e-coc v0.0.2 and remove tests/fixtures. Fix broken inspection.hbs partial rendering. Update example_partial script. Update README.md to indicate that e-coc v0.0.2 has been deprecated. Update README.md with instructions on how to use partials with generate-html and versioning. Replace castCertificate with new function getCertificateType in generate-html and generate-pdf, add tests for getCertificateType. Add check before mapping over externalStandards to ensure compatibility with closed source schemas such as tkr in generate-html and generate-pdf. Error logging has been implemented in 2 functions, getPartials and getTranslations. To see the errors, run your command with the environment variable DEBUG=utils. Errors are thrown when an invalid language is passed to generateHtml or when using generateHtml with a schema that does not have a partials-map.json published yet.

Type of change

Checklist:

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

88.9% 88.9% Coverage
0.0% 0.0% Duplication