Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ npm install -g node-red-dev
$ node-red-dev COMMAND
running command...
$ node-red-dev (-v|--version|version)
node-red-dev/0.1.1 darwin-arm64 node-v16.13.0
node-red-dev/0.1.2 darwin-arm64 node-v16.13.0
$ node-red-dev --help [COMMAND]
USAGE
$ node-red-dev COMMAND
Expand All @@ -47,7 +47,6 @@ OPTIONS
--all see all commands in CLI
```

_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.2.3/src/commands/help.ts)_

## `node-red-dev validate`

Expand All @@ -69,5 +68,4 @@ DESCRIPTION
you can also specify a path with --path or a published npm package with --npm.
```

_See code: [src/commands/validate.js](https://github.com/node-red/node-red-dev-cli/blob/v0.1.1/src/commands/validate.js)_
<!-- commandsstop -->
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "node-red-dev",
"description": "Node-RED Node Developer Tools",
"version": "0.1.1",
"version": "0.1.2",
"author": "Sam Machin @sammachin",
"bin": {
"node-red-dev": "./bin/run"
Expand Down Expand Up @@ -56,7 +56,6 @@
"postpack": "rm -f oclif.manifest.json",
"posttest": "eslint .",
"prepack": "oclif-dev manifest && oclif-dev readme",
"test": "nyc mocha --forbid-only \"test/**/*.test.js\"",
"version": "oclif-dev readme && git add README.md"
"test": "nyc mocha --forbid-only \"test/**/*.test.js\""
}
}
5 changes: 3 additions & 2 deletions src/libs/checknodes.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,8 @@ function checknodes(path, cli, scorecard, npm_metadata) {
cli.warn(`Duplicate nodename ${nodename} found in package ${m.id}`)
}
})
})
})
scorecard.N01.nodes = scorecard.N01.nodes.filter((x, i) => i === scorecard.N01.nodes.indexOf(x))
})
.then(() => {
if (scorecard.N01.test){
Expand All @@ -178,7 +179,7 @@ function checknodes(path, cli, scorecard, npm_metadata) {
new Promise((resolve, reject) => {
files = []
if (fs.existsSync(path+'/examples')){
files = getAllFiles(path+'/examples')
files = getAllFiles(path+'/examples').filter(x => {if (pth.extname(x) == '.json') {return x}} )
}
resolve(files)
})
Expand Down
9 changes: 5 additions & 4 deletions src/libs/checkpackage.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ function checkpackage(path, cli, scorecard, npm_metadata) {
cli.log(`✅ Package is ${package.license} licensed`)
scorecard.P01 = {'test' : true, 'license' : package.license}
} else {
cli.error('No License Specified')
cli.warn('No License Specified')
scorecard.P01 = {'test' : false}
}
})
Expand Down Expand Up @@ -110,16 +110,17 @@ function checkpackage(path, cli, scorecard, npm_metadata) {
}
}
if (!scopedRegex.test(package.name)) {
const contribRegex = new RegExp('/^(node-red|nodered)(?!-contrib-).*/ig')
const contribRegex = new RegExp('^(node-red|nodered)(?!-contrib-).*', 'i')
if (contribRegex.test(package.name)){
cli.warn('P04 Packages using the node-red prefix in their name must use node-red-contrib')
scorecard.P04 = { 'test' : false}
} else {
cli.log('✅ Package uses a valid name')
scorecard.P04 = { 'test' : true}
}


} else {
cli.log('✅ Package uses a Scoped Name')
scorecard.P04 = { 'test' : true}
}
})
.then(() => {
Expand Down