From e2aff8e7a6175a9ea9cdf2191cc2a8ee6734fcca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sun, 17 Sep 2023 19:54:24 +0200 Subject: [PATCH 1/6] Add .ackrc file --- .ackrc | 1 + 1 file changed, 1 insertion(+) create mode 100644 .ackrc diff --git a/.ackrc b/.ackrc new file mode 100644 index 000000000..d03e6a542 --- /dev/null +++ b/.ackrc @@ -0,0 +1 @@ +--noignore-dir=packages/node_modules From 06c3ff01fdfcde422a97bfb4e5068b2143d252ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sat, 16 Sep 2023 19:44:09 +0200 Subject: [PATCH 2/6] Remove dead else --- packages/node_modules/@node-red/registry/lib/loader.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/node_modules/@node-red/registry/lib/loader.js b/packages/node_modules/@node-red/registry/lib/loader.js index eb27d9411..3aab8d893 100644 --- a/packages/node_modules/@node-red/registry/lib/loader.js +++ b/packages/node_modules/@node-red/registry/lib/loader.js @@ -347,7 +347,6 @@ async function loadPluginConfig(fileInfo) { function loadNodeSet(node) { if (!node.enabled) { return Promise.resolve(node); - } else { } try { var loadPromise = null; From 7727e227ee0334ad7a10915e2de729f21dbc9ef8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sun, 17 Sep 2023 17:30:28 +0200 Subject: [PATCH 3/6] Remove unused variable --- packages/node_modules/@node-red/registry/lib/loader.js | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/node_modules/@node-red/registry/lib/loader.js b/packages/node_modules/@node-red/registry/lib/loader.js index 3aab8d893..fb60932f7 100644 --- a/packages/node_modules/@node-red/registry/lib/loader.js +++ b/packages/node_modules/@node-red/registry/lib/loader.js @@ -376,7 +376,6 @@ function loadNodeSet(node) { } catch(err) { node.err = err; var stack = err.stack; - var message; if (stack) { var filePath = node.file; try { From ffbfcc2bae872efca7ac296327564112600709f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sun, 17 Sep 2023 18:16:33 +0200 Subject: [PATCH 4/6] Remove unused function Usage was removed in commit da0ce9fe (Simplify flow api implementation and add logging messages) in 2015. --- .../@node-red/runtime/lib/flows/index.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/packages/node_modules/@node-red/runtime/lib/flows/index.js b/packages/node_modules/@node-red/runtime/lib/flows/index.js index f21bd56f9..592d7f8d1 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/index.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/index.js @@ -539,25 +539,6 @@ function checkTypeInUse(id) { } } -function updateMissingTypes() { - var subflowInstanceRE = /^subflow:(.+)$/; - activeFlowConfig.missingTypes = []; - - for (var id in activeFlowConfig.allNodes) { - if (activeFlowConfig.allNodes.hasOwnProperty(id)) { - var node = activeFlowConfig.allNodes[id]; - if (node.type !== 'tab' && node.type !== 'subflow') { - var subflowDetails = subflowInstanceRE.exec(node.type); - if ( (subflowDetails && !activeFlowConfig.subflows[subflowDetails[1]]) || (!subflowDetails && !typeRegistry.get(node.type)) ) { - if (activeFlowConfig.missingTypes.indexOf(node.type) === -1) { - activeFlowConfig.missingTypes.push(node.type); - } - } - } - } - } -} - async function addFlow(flow, user) { var i,node; if (!flow.hasOwnProperty('nodes')) { From 51cda2197def0aead3a38cb2d399f3fef49a2ffd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Sat, 16 Sep 2023 19:44:20 +0200 Subject: [PATCH 5/6] Whitespace fixes --- packages/node_modules/@node-red/registry/lib/loader.js | 2 +- .../@node-red/registry/lib/localfilesystem.js | 8 ++++---- .../node_modules/@node-red/runtime/lib/flows/index.js | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/node_modules/@node-red/registry/lib/loader.js b/packages/node_modules/@node-red/registry/lib/loader.js index fb60932f7..5cc7826d0 100644 --- a/packages/node_modules/@node-red/registry/lib/loader.js +++ b/packages/node_modules/@node-red/registry/lib/loader.js @@ -65,7 +65,7 @@ function loadModuleTypeFiles(module, type) { moduleFn = parts.slice(0,nmi+2).join(path.sep); } if (!moduleFn) { - // shortcut - skip calling statSync on empty string + // shortcut - skip calling statSync on empty string break; // Module not found, don't attempt to load its nodes } try { diff --git a/packages/node_modules/@node-red/registry/lib/localfilesystem.js b/packages/node_modules/@node-red/registry/lib/localfilesystem.js index 0c231552f..acc77b97d 100644 --- a/packages/node_modules/@node-red/registry/lib/localfilesystem.js +++ b/packages/node_modules/@node-red/registry/lib/localfilesystem.js @@ -250,7 +250,7 @@ function scanDirForNodesModules(dir,moduleName,packageDetails) { /* 1. if !exist(package.json) || !package.json.has(node-red) => look for node_modules 2. exist(package.json) && package.json.has(node-red) => load this only - 3. in original scan of nodesDir, ignore if:(exist(package.json) && package.json.has(node-red)) + 3. in original scan of nodesDir, ignore if:(exist(package.json) && package.json.has(node-red)) */ if (nodesDir) { for (let dirIndex = 0; dirIndex < nodesDir.length; dirIndex++) { @@ -542,7 +542,7 @@ function getPackageList() { return list; } /** - * Gets the package json object for the supplied `dir`. + * Gets the package json object for the supplied `dir`. * If there is no package.json or the `node-red` section is missing, `result.isNodeRedModule` will be `false`. * If there is no package.json `isPackage` will be `false`. * If an error occurs, `result.error` will contain the error. @@ -550,7 +550,7 @@ function getPackageList() { */ function getPackageDetails(dir) { const result = { - /** @type {string} The package directory */ + /** @type {string} The package directory */ moduleDir: dir, /** @type {string} The full file path of package.json for this package */ packageFile: null, @@ -579,7 +579,7 @@ function getPackageList() { result.isNodeRedModule = typeof result.package['node-red'] === 'object' if(result.isNodeRedModule) { result.isNodeRedModule = true; - result.allowed = registryUtil.checkModuleAllowed(pkg.name,pkg.version,loadAllowList,loadDenyList) + result.allowed = registryUtil.checkModuleAllowed(pkg.name,pkg.version,loadAllowList,loadDenyList) } } } catch(err) { diff --git a/packages/node_modules/@node-red/runtime/lib/flows/index.js b/packages/node_modules/@node-red/runtime/lib/flows/index.js index 592d7f8d1..aee1f25c0 100644 --- a/packages/node_modules/@node-red/runtime/lib/flows/index.js +++ b/packages/node_modules/@node-red/runtime/lib/flows/index.js @@ -811,7 +811,7 @@ module.exports = { get:getNode, eachNode: eachNode, - + /** * Gets the current flow configuration */ From 9a04693c2fa9cf6bdde752c7a7cb1aef53f08136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20L=C3=B8vdal?= Date: Wed, 20 Sep 2023 00:02:54 +0200 Subject: [PATCH 6/6] Add CLA link --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f8fb04304..0153e3ee3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -46,7 +46,8 @@ If you've got a bug-fix or similar for us, then you are most welcome to get it raised - just make sure you link back to the issue it's fixing and try to include some tests! -All contributors need to sign the OpenJS Foundation's Contributor License Agreement. +All contributors need to sign the OpenJS Foundation's +[Contributor License Agreement](https://openjsf.org/about/the-openjs-foundation-cla/). It is an online process and quick to do. If you raise a pull-request without having signed the CLA, you will be prompted to do so automatically.