Skip to content

Commit f30d2d1

Browse files
committed
Merge branch 'pr_255'
2 parents 7d98480 + 691c9c6 commit f30d2d1

File tree

5 files changed

+93
-5
lines changed

5 files changed

+93
-5
lines changed
Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
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+
![](/blog/content/images/2022/01/node-page.png)
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+
![](/blog/content/images/2022/01/node-scorecard.png)
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+
![](/blog/content/images/2022/01/node-red-dev.png)
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).
106 KB
Loading
188 KB
Loading
112 KB
Loading

docs/creating-nodes/packaging.md

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,15 @@ them easy to install along with any dependencies they may have.
1010

1111
### Naming
1212

13-
If you wish to use **node-red** in the name of your node please use `node-red-contrib-` as a prefix to their name to make it clear they are not maintained by the Node-RED project. Alternatively, any name
14-
that doesn't use `node-red` as a prefix can be used.
13+
**We [updated our naming requirements](/blog/2022/01/31/introducing-scorecard) on 31st January 2022. The following applies to newly creating modules after that date.**
14+
15+
Packages should use a [scoped name](https://docs.npmjs.com/cli/v8/using-npm/scope) - such as `@myScope/node-red-sample`. That can be under a user scope or an organisation scope.
16+
17+
Nodes published under a scoped name have no further requirements on their name.
18+
They could use `@myScope/node-red-sample` or just `@myScope/sample` - although
19+
having `node-red` in the name does help to associate the module with the project.
20+
21+
If you are forking an existing package to provide a fix, you can keep the same name but released under your own scope. But please keep in mind, forking should always be a last resort if the original maintainer is not responsive to your contributions.
1522

1623
### Directory structure
1724

@@ -21,10 +28,10 @@ Here is a typical directory structure for a node package:
2128
├── LICENSE
2229
├── README.md
2330
├── package.json
24-
└── sample
25-
├── examples
31+
├── examples
2632
│   ├── example-1.json
2733
│   └── example-2.json
34+
└── sample
2835
├── icons
2936
│   └── my-icon.svg
3037
├── sample.html
@@ -34,6 +41,7 @@ Here is a typical directory structure for a node package:
3441
There are no strict requirements over the directory structure used within the
3542
package. If a package contains multiple nodes, they could all exist in the same
3643
directory, or they could each be placed in their own sub-directory.
44+
The examples folder must be in the root of the package.
3745

3846
### Testing a node module locally
3947

@@ -68,7 +76,7 @@ for others to be able to use it.</div>
6876

6977
{% highlight json %}
7078
{
71-
"name" : "node-red-contrib-samplenode",
79+
"name" : "@myScope/node-red-sample",
7280
"version" : "0.0.1",
7381
"description" : "A sample node for node-red",
7482
"dependencies": {

0 commit comments

Comments
 (0)