Skip to content

Publish Nunjucks templates to NPM #265

Open
@james-nash

Description

@james-nash

Is your feature request related to a problem? Please describe.
We maintain a set of HTML templates (written in Nunjucks) for our pattern library. Those same templates could be useful for downstream consumers such as the Buildit website, so we should publish them as an @buildit/gravity-ui-nunjucks NPM package.

A while ago we decided to work towards that by:

  1. Converting to a Lerna monorepo, so that we could have code for multiple NPM packages in one repo
  2. Split out the templates + pattern library code into its own package
  3. Setup the necessary conversions and builds to publish the templates to the NPM package repo

This issue is to cover the last and final step.

Describe the solution you'd like
First off, it's best to wait for the migration to Fractal (#264) to complete, since that affects the structure of the templates.

Once that's in place, we'll need to figure out how to make the templates usable without Fractal (which has it's own @.. shorthand naming scheme for importing/including other templates). Possible options are:

  • Export copies of the templates and find'n'replace the shorthand names with relative file paths. (Fractal's own docs have an example of something like this)
  • Or, write a custom Nunjucks loader, which can "understand" the same @... shorthand.
  • There may be other options, or the above could be combined somehow. In any case, this needs some more research

With a solution to the above in place, we should then get semantic-release enabled and configured properly for the @buildit/gravity-ui-nunjucks package and get it published.

Metadata

Metadata

Assignees

No one assigned

    Labels

    🌟 enhancementTYPE: Indicates new feature requestsbuildit-websiteCONSUMER: Indicates that this is required by the Buildit websiteinfrastructureCATEGORY: Infrastructure related - e.g. updates to build process, tests, tooling, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions