10up / actions-wordpress

GitHub Actions for WordPress!
MIT License
426 stars 37 forks source link

wp-hookdoc Not installable because of Dependency hell #42

Open carstingaxion opened 1 year ago

carstingaxion commented 1 year ago

Thank you for sharing this repos code and its ideas! I really appreciate your open-source contributions.


I followed your instrations on how to do this, but was not able to finish the steps due to a vulnerable dependency.

Describe the bug

The console says:

FATAL: Unable to load template: Cannot find module 'taffydb'
Require stack:
- [...]/node_modules/wp-hookdoc/template/publish.js
- [...]/node_modules/jsdoc/cli.js
- [...]/node_modules/jsdoc/jsdoc.js

The taffydb is marked as vulnerable in https://github.com/advisories/GHSA-mxhp-79qh-mcx6 why it (propably) was not or can not be installed. Thanks to pure dependency hell, because this is our desired stack.

Steps to Reproduce

  1. Open folder with hookdoc dependencies installed in a terminal and run ...

    $ npm run build:docs
  2. See error

$ npm run build:docs

> build:docs
> rm -rf ./docs/dev/hooks && jsdoc -c hookdoc-conf.json plugin.php inc

FATAL: Unable to load template: Cannot find module 'taffydb'
Require stack:
- [...]/node_modules/wp-hookdoc/template/publish.js
- [...]/node_modules/jsdoc/cli.js
- [...]/node_modules/jsdoc/jsdoc.js

Expected behavior

I would love to have my hooks documented.

Additional context

I wrote the little I found at: https://github.com/figuren-theater/ft-admin-ui/issues/17 but I'm unsure this helps.

faisal-alvi commented 1 year ago

@carstingaxion Thank you for reaching out.

We are already looking at better alternatives. The following tools have recently undergone testing (and some are still being examined).

1. MK Docs (does not meet our needs)

https://www.mkdocs.org/

Because it does not automatically pick the data from inline coding, MKDocs does not meet our needs.

2. WP Parser (not working with JS files)

https://github.com/WordPress/phpdoc-parser

It appears to only function with PHP code and not the JS code because it parses the inline documentation from PHP files and creates special post type entries in WordPress.

3. WP Hooks Generator (better option so far)

https://github.com/wp-hooks/generator

It seems like (from a quick view) it generates the hooks list from PHP and JS, both types of files, this one appears to be a better choice. It creates a JSON representation of the actions and filters used by WordPress in the code. It is compatible with WordPress core, themes, and plugins. Additionally offers code for using the PHP or JS files' generated hook files.

We'll keep posting new updates here.

carstingaxion commented 1 year ago

Thank you for reaching out.

Thank you @faisal-alvi for putting this together and pardon me for being a little late.

We'll keep posting new updates here.

:eyes: Looking forward reading your updates!