|
| 1 | +--- |
| 2 | +layout: blog |
| 3 | +title: Introducing the Node Scorecard |
| 4 | +author: nick |
| 5 | +description: Checking the quality of nodes in the ecosystem |
| 6 | +--- |
| 7 | + |
| 8 | +Last year we asked the community what frustrations they were experiencing as both |
| 9 | +users and creators of 3rd party nodes. One of the common themes was that it was |
| 10 | +hard to judge the quality of a node just from looking at its page on the [Flow Library](flows.nodered.org). |
| 11 | + |
| 12 | +Based on that feedback, we're now introducing Node Scorecards. |
| 13 | + |
| 14 | +The scorecard provides a summary of a Node across a range of things such as whether |
| 15 | +it follows our naming guidelines, does it have a valid license applied and does it |
| 16 | +clash with other packages in the library. |
| 17 | + |
| 18 | +When we first introduced the Flow Library, we chose not to act as gatekeepers to |
| 19 | +what can be shared, beyond some very basic checks on the nodes. The scorecard |
| 20 | +doesn't change that, but it does help start to highlight where a node may need some additional work to meet the recommended best practices. |
| 21 | + |
| 22 | +We’ve been running the tool against new submissions to the Flow Library for a |
| 23 | +couple months now so there are scorecards for many of the recently updated nodes. |
| 24 | +You'll now see a link to 'View scorecard' in the sidebar of a node's page on the |
| 25 | +library, along with a summary of the scorecard. |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | +Click through gives you a more detailed view of the scorecard - listing out all |
| 30 | +of the checks made. You can find out more about the purpose of each check by clicking |
| 31 | +on the i link on the right hand side. |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | +### Changing our recommended naming convention |
| 37 | + |
| 38 | +As part of the work to improve the overall quality of the Flow Libary, we're making |
| 39 | +a change to our naming guidelines for node modules. |
| 40 | + |
| 41 | +Previously, we asked that if a module's name started with `node-red-`, that it |
| 42 | +use `node-red-contrib-` to distinguish it from modules maintained by the core project. |
| 43 | + |
| 44 | +We now recommend that *newly published* modules use a [scoped name](https://docs.npmjs.com/cli/v8/using-npm/scope) - such as `@myScope/node-red-sample`. That can be your own user scope, or an organisation scope. |
| 45 | + |
| 46 | +If you use a scoped name, there are no further requirements on the name. You could |
| 47 | +use `@myScope/node-red-sample` or just `@myScope/sample` - although having `node-red` |
| 48 | +in the name does help to associate the module with the project. |
| 49 | + |
| 50 | +If you are forking an existing package to provide a fix, you can keep the same name but |
| 51 | +released under your own scope. But please keep in mind, forking should always be a |
| 52 | +last resort if the original maintainer is not responsive to your contributions. |
| 53 | + |
| 54 | +We won't be asking anyone to republish their existing modules under this new |
| 55 | +naming convention, but the scorecard will flag up any newly added modules |
| 56 | +that don't follow this new convention from today. |
| 57 | + |
| 58 | +### Node Developers |
| 59 | + |
| 60 | +The tool underlying the scorecard is [`node-red-dev`](https://www.npmjs.com/package/node-red-dev) - a new command-line tool that |
| 61 | +developers can run locally against their own code to check for any possible issues |
| 62 | +before publishing to npm. Many of the checks are quick and easy to fix - much better |
| 63 | +to do so before sharing with the community. |
| 64 | + |
| 65 | +You can run the tool either against a path on your local machine or against a package already published to npm using the appropriate flags, and you’ll get the results in the console |
| 66 | + |
| 67 | + |
| 68 | + |
| 69 | +### The Future |
| 70 | + |
| 71 | +This is the first step in improving the quality of our node ecosystem, over time |
| 72 | +we will add more checks to the scorecard. It doesn't currently examine the code |
| 73 | +of a node, but that is certainly something that could be explored. |
| 74 | + |
| 75 | +There's also a lot more that `node-red-dev` could do for Node Developers beyond |
| 76 | +the scorecard check. For example, using it to bootstrap development of a new |
| 77 | +node module, with all of the best practices pre-applied. |
| 78 | + |
| 79 | +If that's something you're interested in contributing to, please do come talk to |
| 80 | +us in the [forum](https://discourse.nodered.org). |
0 commit comments