From 236d437430620603bcbea58f205f1f61b7b39fd0 Mon Sep 17 00:00:00 2001 From: Nick O'Leary Date: Thu, 28 Feb 2019 22:21:22 +0000 Subject: [PATCH] Add api docs landing content --- API.md | 15 +++++++++++++++ Gruntfile.js | 5 +++-- .../@node-red/runtime/lib/api/comms.js | 1 + packages/node_modules/@node-red/util/lib/util.js | 4 ++-- packages/node_modules/node-red/lib/red.js | 9 ++++++++- 5 files changed, 29 insertions(+), 5 deletions(-) create mode 100644 API.md diff --git a/API.md b/API.md new file mode 100644 index 000000000..f349ea8fe --- /dev/null +++ b/API.md @@ -0,0 +1,15 @@ +Node-RED Modules +--- + +Node-RED provides a set of node modules that implement different parts of the +application. + +Module | Description +-------|------- +[node-red](node-red.html) | the main module that pulls together all of the internal modules and provides the executable version of Node-RED +[@node-red/editor-api](@node-red_editor-api.html) | an Express application that serves the Node-RED editor and provides the Admin HTTP API +[@node-red/runtime](@node-red_runtime.html) | the core runtime of Node-RED +[@node-red/util](@node-red_util.html) | common utilities for the Node-RED runtime and editor modules +@node-red/registry | the internal node registry +@node-red/nodes | the default set of core nodes +@node-red/editor-client | the client-side resources of the Node-RED editor application diff --git a/Gruntfile.js b/Gruntfile.js index 3e8740e7d..e11caabbc 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -438,6 +438,7 @@ module.exports = function(grunt) { jsdoc : { modules: { src: [ + 'API.md', 'packages/node_modules/node-red/lib/red.js', 'packages/node_modules/@node-red/runtime/lib/index.js', 'packages/node_modules/@node-red/runtime/lib/api/*.js', @@ -451,7 +452,7 @@ module.exports = function(grunt) { configure: './jsdoc.json' } }, - editor: { + _editor: { src: [ 'packages/node_modules/@node-red/editor-client/src/js' ], @@ -612,5 +613,5 @@ module.exports = function(grunt) { grunt.registerTask('docs', 'Generates API documentation', - ['jsdoc','jsdoc2md']); + ['jsdoc']); }; diff --git a/packages/node_modules/@node-red/runtime/lib/api/comms.js b/packages/node_modules/@node-red/runtime/lib/api/comms.js index 079f75c14..6c0d5a97a 100644 --- a/packages/node_modules/@node-red/runtime/lib/api/comms.js +++ b/packages/node_modules/@node-red/runtime/lib/api/comms.js @@ -20,6 +20,7 @@ */ /** + * A WebSocket connection between the runtime and the editor. * @typedef CommsConnection * @type {object} * @property {string} session - a unique session identifier diff --git a/packages/node_modules/@node-red/util/lib/util.js b/packages/node_modules/@node-red/util/lib/util.js index 3283a621b..b4512f1ea 100644 --- a/packages/node_modules/@node-red/util/lib/util.js +++ b/packages/node_modules/@node-red/util/lib/util.js @@ -413,7 +413,7 @@ function setObjectProperty(msg,prop,value,createMissing) { } } -/** +/*! * Get value of environment variable. * @param {Node} node - accessing node * @param {String} name - name of variable @@ -439,7 +439,7 @@ function getSetting(node, name) { * @param {String} value - the string to parse * @param {Node} node - the node evaluating the property * @return {String} The parsed string -* @memberof @node-red/util_util + * @memberof @node-red/util_util */ function evaluateEnvProperty(value, node) { var result; diff --git a/packages/node_modules/node-red/lib/red.js b/packages/node_modules/node-red/lib/red.js index b679ad138..2a04df578 100644 --- a/packages/node_modules/node-red/lib/red.js +++ b/packages/node_modules/node-red/lib/red.js @@ -39,6 +39,9 @@ function checkVersion(userSettings) { * This module provides the full Node-RED application, with both the runtime * and editor components built in. * + * The API this module exposes allows it to be embedded within another node.js + * application. + * * @namespace node-red */ module.exports = { @@ -125,7 +128,11 @@ module.exports = { /** * This provides access to the internal nodes module of the - * runtime. + * runtime. The details of this API remain undocumented as they should not + * be used directly. + * + * Most administrative actions should be performed use the runtime api + * under [node-red.runtime]{@link node-red.runtime}. * * @memberof node-red */