-
Notifications
You must be signed in to change notification settings - Fork 144
Hook Reference: Automate a reference resource #6454
Conversation
@psealock I've tested running
I suspected this was because Not a hard requirement, but would it be better to use the one that's supported by node v12 and above? |
This is awesome @psealock! 🎉 Thank you for putting it together. I especially love the way the |
const { resolve } = require( 'path' ); | ||
const createData = require( './data' ); | ||
|
||
async function getFilePaths( dir ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Promise.all
, map
, reduce
, and recursion all in a ~10 line async function. 👏🏻
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣 There was significant help from stack overflow
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️ this @psealock . Tested and works well.
Do we have any expectations on how the generated json
will be utilized? Would it useful to integrate this script into any part of the ci/build/release process?
Totally optional, but I like it when a script gives some kind of output to assure me that in executed correctly. Something like Hook reference generated at ${path/file}
8301464
to
3974476
Compare
Thanks for the review @joelclimbsthings
Great idea! I added some fancy logs in 3f2354b.
Since you can easily make a
Eventually, I think so. |
💯 Those are 🌶️ . 🚢 |
3f2354b
to
1b2c88a
Compare
…e-admin#6454) * read sample doc * npm cli * work with arrays * Its happening * better naming * cleanup * moar cleanup * new line * better * save * fixup rebase error * package lock update * node 12 usage * add changelog * fancy logs * update package lock * changelog in right place
Fixes #2924
Process all document blocks and compile those that describe hooks into a JSON file for easy data source. This data source can be used to populate a page in the WooCommerce Developer Portal so that extension developers can easily find documentation about available hooks. cc @loranallensmith
Next Steps
@hook
document blocks to remaining hooks in JavaScript.Detailed test instructions:
bin/hook-reference/data.json