hapipal/boilerplate

What is the use of .hc file in lib/

renjurajt opened this issue · 4 comments

What is the use of .hc file in lib/

This file has two purposes,

  1. It can export amendments for haute-couture, pal's file-based hapi plugin composer. This can be used to change the meaning of certain directories, skip over directories, and add meaning for new directories.
  2. It marks where a haute-couture plugin exists so that the hpal CLI knows where to write scaffolding files when using the hpal make command.

If you have further questions, I'm happy to clarify.

Thanks @devinivy , can you please give some examples for your 1st point.

Sure! I think the best examples that are out there are currently in the test suite.

Here's a project folder with an .hc.js file: https://github.com/hapipal/haute-couture/tree/master/test/closet/hc-file

Here's a test that uses that project folder: https://github.com/hapipal/haute-couture/blob/master/test/index.js#L689-L704

Here's documentation of the amendments you see in .hc.js: https://github.com/hapipal/haute-couture/blob/master/API.md#hautecoutureusingdirname-amendments

Here's the base manifest used by haute-couture, which shows what some complex (and some simple) amendment items look like: https://github.com/hapipal/haute-couture/blob/master/lib/manifest.js#L112. Amendments are essentially used to update this manifest.

Thanks Again 👍