Skip to content
This repository has been archived by the owner on Jun 4, 2018. It is now read-only.

Workflow

Ole R edited this page Nov 17, 2015 · 6 revisions

This is an example workflow for any custom module (plugin/theme/widget/etc.).

Bash script

The fast way is to use the ./g bash script for simplicity.

Creation

  • Create a new module if needed by ./g m
  • Remove sample data that is not needed by your purpose.

Working cylce

  • Run ./g my-module d for starting development watchers and NodeBB.
  • Do your work on my-module.

Publishing

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).

Grunt tasks

If you either have no bash to use or prefer to use grunt for whatever reason, you can use the plain grunt tasks.

Creation

  • Create a new module if needed by grunt init.
  • Remove sample data that is not needed by your purpose.

Working cycle

Start file watchers

  • Start grunt within NodeBB-root within separated terminal (since it's blocking).
  • Start grunt dev:my-module or grunt dev_skip:my-module (the former if there have been any changes since last workflow within that module).

Do your work

Do your work on the module, for some changes NodeBB needs to get restarted (hook-changes, etc.).

Publishing

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.