do I have to read the source for each object to learns its methods?
Yes, you will have to read the source code to see what methods are available.
Here's how I do it:
npm i [email protected]4
so it doesn't use [email protected]
, cuz that breaks nodebbdev
directory in home foldergit clone https://github.com/nodebb/nodebb
, clones into ~/dev/nodebb
git clone https://github.com/nodebb/nodebb-plugin-emoji
, clones into ~/dev/nodebb-plugin-emoji
cd nodebb-plugin-emoji
, npm link
cd ../nodebb
, npm install
, ./nodebb setup
npm link nodebb-plugin-emoji
, this "links" the plugin into node_modules, which is better than having the git repo directly inside node_modules@pitaj Wow, thanks for the exhaustive instructions.
Do you really have to rebuild after every change though? In my limited experience developing Node apps, I'm usually been able to use vagrant + synced folders so that I could make a change on my desktop, sync it over to my vagrant box automatically, and the change taking effect immediately.
Is that kind of workflow not possible with nodeBB?
Some things you do, some things you don't. It's complicated.
@wfsaxton We use grunt
to listen for file changes and rebuild automatically. You could consider that as well
The reason why re-building is necessary is because some items are built once before you start NodeBB, and used from then onwards. This blog post goes into more detail about why we use a build system now.
@PitaJ are these instructions still accurate?
@GarrettBryan mostly. Updated instructions:
Here's how I do it:
cd ~
, mkdir dev
, cd dev
git clone https://github.com/nodebb/nodebb
, clones into ~/dev/nodebb
git clone https://github.com/nodebb/nodebb-plugin-emoji
, clones into ~/dev/nodebb-plugin-emoji
cd nodebb-plugin-emoji
, npm link
cd ../nodebb
, ./nodebb setup
npm link nodebb-plugin-emoji
, this "links" the plugin into node_modules, which is better than having the git repo directly inside node_modulesThanks @PitaJ ! I use Atom and Sublime Text2. Any suggestions for debugging?
@GarrettBryan well I strongly suggest VS Code as it's essentially Atom but better in every way. It has a built in debugger and everything.
Beyond that, can't help you. I suggest you Google it.
@PitaJ I just started with VS Code, thanks for the motivation to try something new.