hapipal / boilerplate

A friendly, proven starting place for your next hapi plugin or deployment
https://hapipal.com
183 stars 27 forks source link

What is the use of .hc file in lib/ #63

Closed renjurajt closed 6 years ago

devinivy commented 6 years ago

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.

renjurajt commented 6 years ago

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

devinivy commented 6 years ago

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.

renjurajt commented 6 years ago

Thanks Again 👍