feat(config): add file property for notes#614
Conversation
| if (typeof val.file === 'string') { | ||
| var filename = path.join(process.cwd(), val.file); | ||
| try { | ||
| val.description = fs.readFileSync(filename).toString(); |
There was a problem hiding this comment.
This is currently sync because this pipeline is currently all sync. I can also move it to the async version if that's preferred but that would mean changing more in this file and the interface to sort.
| return typeof val === 'object' && val.name; | ||
| }).map(function (val) { | ||
| if (typeof val.file === 'string') { | ||
| var filename = path.join(process.cwd(), val.file); |
There was a problem hiding this comment.
Thinking about this more, in a case like
documentation build --config=some/directory/documentation.yml index.js
The paths in documentation.yml should be relative to some/directory rather than to ./. In that case, we might want to add the config path when we go through configParser (docs for that on yargs), so that sort can use it as a relative path if it's present.
There was a problem hiding this comment.
I've changed it so that
- if loading through the config, the file is resolved by that path.
- sort.js checks for absolute paths and uses them if found, otherwise it resolves against
process.cwd()
|
👍 Awesome, thanks! This is great work. Out of curiosity: the naming convention that you're using for the commit message (like |
|
@tmcw yes long ingrained habit those commit messages :) I've been using the conventional-changelog family of tooling for some time in all my projects and are pretty happy with it. If you want some details and infos on tooling around this I collected some info recently here: ipfs/aegir#30 |
Fixes #609