Skip to content

Commit

Permalink
Merge pull request #78 from node-red/update-deps
Browse files Browse the repository at this point in the history
Update dependencies for 0.3.4
  • Loading branch information
knolleary authored May 3, 2024
2 parents 560a3f1 + 8d54e02 commit fc1d059
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#### 0.3.4

- Update dependencies

#### 0.3.3

- Add plugin stub to runtime (#73) @joepavitt
Expand Down
23 changes: 21 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
'use strict';

const path = require("path");
const process = require("process")
const sinon = require("sinon");
const should = require('should');
const fs = require('fs');
Expand All @@ -25,17 +26,35 @@ var bodyParser = require("body-parser");
const express = require("express");
const http = require('http');
const stoppable = require('stoppable');
const readPkgUp = require('read-pkg-up');
const semver = require('semver');
const EventEmitter = require('events').EventEmitter;

const PROXY_METHODS = ['log', 'status', 'warn', 'error', 'debug', 'trace', 'send'];


// Find the nearest package.json
function findPackageJson(dir) {
dir = path.resolve(dir || process.cwd())
const { root } = path.parse(dir)
if (dir === root) {
return null
}
const packagePath = path.join(dir, 'package.json')
if (fs.existsSync(packagePath)) {
return {
path: packagePath,
packageJson: JSON.parse(fs.readFileSync(packagePath, 'utf-8'))
}
} else {
return findPackageJson(path.resolve(path.join(dir, '..')))
}
}

/**
* Finds the NR runtime path by inspecting environment
*/
function findRuntimePath() {
const upPkg = readPkgUp.sync();
const upPkg = findPackageJson()
// case 1: we're in NR itself
if (upPkg.packageJson.name === 'node-red') {
if (checkSemver(upPkg.packageJson.version,"<0.20.0")) {
Expand Down
3 changes: 1 addition & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
},
"dependencies": {
"body-parser": "^1.20.2",
"express": "^4.18.2",
"read-pkg-up": "^7.0.1",
"express": "^4.19.2",
"semver": "^7.5.4",
"should": "^13.2.3",
"should-sinon": "^0.0.6",
Expand Down

0 comments on commit fc1d059

Please sign in to comment.