Workflow
This is an example workflow for any custom module (plugin/theme/widget/etc.).
The fast way is to use the ./g
bash script for simplicity.
- Create a new module if needed by
./g m
- Remove sample data that is not needed by your purpose.
- Run
./g my-module d
for starting development watchers and NodeBB. - Do your work on my-module.
Run ./g my-module b
to build and ./g my-module p
to publish your module.
However it is recommended to use the alias ./g my-module e
for both in series (to prevent you from publishing without preceding distribution build).
If you either have no bash to use or prefer to use grunt for whatever reason, you can use the plain grunt tasks.
- Create a new module if needed by
grunt init
. - Remove sample data that is not needed by your purpose.
- Start
grunt
within NodeBB-root within separated terminal (since it's blocking). - Start
grunt dev:my-module
orgrunt dev_skip:my-module
(the former if there have been any changes since last workflow within that module).
Do your work on the module, for some changes NodeBB needs to get restarted (hook-changes, etc.).
Once a new version is ready to get published you need to stop the grunt dev[_skip]:my-module
process.
Now run grunt deploy:my-module
. This triggers a git commit and push if needed (you'll be asked for commit message) and npm publish.
If you rather want to check your plugin once more before publishing you may call grunt dist:my-module
and afterwards grunt publish:my-module
.