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.
I can't seem to get any custom plugins to show up in the Admin console.
I followed the "Writing Your First NodeBB Plugin" tutorial, but no matter how many times I restart / reload the server it still doesn't even show up in the Extend -> Plugins page.
I'm also getting no results when I try to change the theme, I click 'Use' button, get the prompt to restart, and no changes have happened on restart.
Does anyone have any suggestions to what I could be doing wrong / broken config?
Thanks!
Is there any errors in your browser's console?
The only error I'm getting occasionally in the console is:
Uncaught IndexSizeError: Failed to execute 'arc' on 'CanvasRenderingContext2D': The radius provided (-0.5) is negative. :: chart.min.js?v=v0.6.1-15-ga1f49f6:10
All I have in the plugin folder is the library.js file (with the console.log statement) and the plugin.json file (with 5 items).
I can download and install external plugins through the dashboard without problems.
I've resolved the issue with the theme being applied - I had been running the app with 'node app.js' which was not allowing the server to restart correctly. Once I started the server with the ./nodebb start command, it could restart correctly and apply the theme / skin.
I've also updated to the 0.7.x build as I need to use the write api, this hasn't resolved the issue.
I have just noticed that in the nodebb logs I'm seeing:
18/5 11:11 [4464] - ←[36mverbose←[39m: * using themes stored in: C:\NodeBB\node_modules
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
{ [Error: Cannot find module '../build/Release/bson'] code: 'MODULE_NOT_FOUND' }
I really want to get my teeth into developing plugins for the forum, but seem to be stumbling at the first hurdle!
In the documentation it mentions:
As of v0.0.5, “installing” a plugin by placing it in the /plugins folder is still supported, but keep in mind that the package id and its folder name must match exactly, or else NodeBB will not be able to load the plugin. This feature may be deprecated in later versions of NodeBB.
Has this been deprecated now? Would this explain why it isn't showing up in the admin console?
@snodejoke got exactly same problem, thx for the answer. it is enough to specify name and version in package.json, but version should always have x.y.z format