Repository: opencomponents/oc
Pull request #1205 (2021-09-03 14:37:47)

update packages
Updating a lot of packages so I will go one by one:

**async**: [no breaking changes](https://github.com/caolan/async/blob/master/CHANGELOG.md#v321) from 3.1.1 to 3.2.1

**colors**: [no breaking changes](https://github.com/Marak/colors.js/blob/master/ROADMAP.md#140-92219) from 1.3.3 to 1.4.0

**cross-spawn**: [no breaking changes](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md#703-2020-05-25) from 7.0.1 to 7.0.3

**dependency-graph**: [no breaking changes](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md#703-2020-05-25) from 0.8.0 to 0.11.0

**form-data**

- 3.0 has a [breaking change](https://github.com/form-data/form-data/releases/tag/v3.0.0) to bump node requirement to 6, so it does not affect us.
- 4.0 has [no breaking changes](https://github.com/form-data/form-data/releases/tag/v4.0.0)

**fs-extra**

- 9.0 has a [breaking change](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md#900--2020-03-19) to bump node requirement to 10, so it does not affect us.
- 10.0 has a [breaking change](https://github.com/jprichardson/node-fs-extra/blob/master/CHANGELOG.md#1000--2021-05-03) to bump node requirement to 12, so it does not affect us.

**livereload**: [no breaking changes](https://github.com/caolan/async/blob/master/CHANGELOG.md#v321) from 0.8.2 to 0.9.3

**morgan**: [no breaking changes](https://github.com/expressjs/morgan/blob/master/HISTORY.md#1100--2020-03-20) from 1.9.1 to 1.10.0

**oc-client**: [no breaking changes](https://github.com/opencomponents/oc-client-node/compare/v3.2.12...master) from 3.2.11 to 3.2.12

**opn**

- 6.0 has a [breaking change](https://github.com/sindresorhus/open/releases/tag/v6.0.0) where they rename the library from `opn` to `open`. This change has been reflected on this PR. Also requiring Node 8, which does not affect us.
- 7.0 has a [breaking change](https://github.com/sindresorhus/open/releases/tag/v7.0.0) about using a new parameter for urls, but it will later be reverted. Nothing here.
- 8.0 has a [breaking change](https://github.com/sindresorhus/open/releases/tag/v8.0.0) about reverting the parameter for url and requiring node 12. Also changes on the app option that we don't use. Nothing.

**node-semver**

- 7.0 has a [breaking change](https://github.com/npm/node-semver/blob/master/CHANGELOG.md#700) about dropping support for "very old node versions", so it does not affect us.

**serialize-error**

- 5.0 has [breaking change](https://github.com/sindresorhus/serialize-error/releases/tag/v5.0.0) where the default export is now a named export. This change is reflected on this PR.
- 6.0 has [breaking change](https://github.com/sindresorhus/serialize-error/releases/tag/v6.0.0) they drop support for Node < 10. Does not affect us.
- 7.0 has [no breaking changes](https://github.com/sindresorhus/serialize-error/releases/tag/v7.0.0), just a bug fix.
- 8.0 has [no breaking changes](https://github.com/sindresorhus/serialize-error/releases/tag/v8.0.0) that affects us (we dont do serialize/deserialize pairing operations).

**yargs**

- 14.0 has [breaking change](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md#1400-2019-07-30) about not using `yargs.parsed` but we do not use it. Has another breaking change on `.strict()` mode but also we don't use it. Neither we use the `getOptions()` method.
- 15.0 has [breaking change](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md#1500-2019-11-10) about dropping support for Node 6, so nothing.
- 16.0 has [breaking change](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md#1500-2019-11-10) about dropping support for Node 8, so nothing.
- 17.0 has [breaking change](https://github.com/yargs/yargs/blob/master/docs/CHANGELOG-historical.md#1500-2019-11-10) about dropping support for Node 10, so nothing. We don't use the `reset` method nor the `positional`.

**sinon** and **mocha**

A lot of breaking changes, but all the test passes, so we are ok.



Patch:
diff --git a/package.json b/package.json
index f04c186d..c76b8d89 100644
--- a/package.json
+++ b/package.json
@@ -51,36 +51,36 @@
     "injectr": "0.5.1",
     "lint-staged": "11.1.2",
     "minimist": "1.2.5",
-    "mocha": "7.0.1",
+    "mocha": "9.1.1",
     "node-emoji": "1.11.0",
     "oc-template-es6-compiler": "1.1.8",
     "prettier-eslint-cli": "5.0.1",
     "semver-sort": "0.0.4",
-    "simple-git": "^1.77.0",
-    "sinon": "7.5.0"
+    "simple-git": "2.45.0",
+    "sinon": "11.1.2"
   },
   "dependencies": {
     "accept-language-parser": "1.5.0",
-    "async": "3.1.1",
+    "async": "3.2.1",
     "basic-auth-connect": "^1.0.0",
     "body-parser": "1.19.0",
     "builtin-modules": "^3.0.0",
     "chokidar": "^3.5.2",
-    "colors": "1.3.3",
-    "cross-spawn": "7.0.1",
-    "dependency-graph": "0.8.0",
+    "colors": "1.4.0",
+    "cross-spawn": "7.0.3",
+    "dependency-graph": "0.11.0",
     "errorhandler": "^1.5.0",
     "express": "4.17.1",
-    "form-data": "2.5.1",
-    "fs-extra": "8.1.0",
+    "form-data": "4.0.0",
+    "fs-extra": "10.0.0",
     "getport": "^0.1.0",
-    "livereload": "0.8.2",
+    "livereload": "0.9.3",
     "lodash": "^4.17.15",
     "minimal-request": "3.0.0",
-    "morgan": "1.9.1",
+    "morgan": "1.10.0",
     "multer": "^1.3.0",
     "nice-cache": "0.0.5",
-    "oc-client": "3.2.11",
+    "oc-client": "3.2.12",
     "oc-client-browser": "1.4.2",
     "oc-empty-response-handler": "1.0.0",
     "oc-get-unix-utc-timestamp": "1.0.2",
@@ -91,16 +91,16 @@
     "oc-template-handlebars-compiler": "6.2.13",
     "oc-template-jade": "7.0.0",
     "oc-template-jade-compiler": "7.0.1",
-    "opn": "5.5.0",
+    "open": "8.2.1",
     "parse-author": "2.0.0",
     "read": "1.0.7",
     "require-package-name": "2.0.1",
     "response-time": "^2.3.2",
-    "semver": "6.3.0",
+    "semver": "7.3.5",
     "semver-extra": "3.0.0",
-    "serialize-error": "4.1.0",
+    "serialize-error": "8.1.0",
     "targz": "1.0.1",
     "try-require": "^1.2.1",
-    "yargs": "13.3.0"
+    "yargs": "17.1.1"
   }
 }
diff --git a/src/cli/facade/preview.js b/src/cli/facade/preview.js
index 73af2940..f1217089 100644
--- a/src/cli/facade/preview.js
+++ b/src/cli/facade/preview.js
@@ -1,6 +1,6 @@
 'use strict';
 
-const opn = require('opn');
+const open = require('open');
 
 const strings = require('../../resources/index');
 const wrapCliCallback = require('../wrap-cli-callback');
@@ -17,7 +17,7 @@ module.exports = function(dependencies) {
         logger.err(strings.errors.cli.COMPONENT_HREF_NOT_FOUND);
         return callback(strings.errors.cli.COMPONENT_HREF_NOT_FOUND);
       }
-      opn(href);
+      open(href);
       callback(null, href);
     });
   };
diff --git a/src/registry/domain/options-sanitiser.js b/src/registry/domain/options-sanitiser.js
index 9a752d32..7fa511ae 100644
--- a/src/registry/domain/options-sanitiser.js
+++ b/src/registry/domain/options-sanitiser.js
@@ -7,7 +7,7 @@ const auth = require('./authentication');
 
 const DEFAULT_NODE_KEEPALIVE_MS = 5000;
 
-module.exports = function (input) {
+module.exports = function(input) {
   const options = _.clone(input);
 
   if (!options.publishAuth) {
diff --git a/src/registry/routes/component.js b/src/registry/routes/component.js
index 74e260c3..a79a47e4 100644
--- a/src/registry/routes/component.js
+++ b/src/registry/routes/component.js
@@ -1,6 +1,6 @@
 'use strict';
 
-const serializeError = require('serialize-error');
+const { serializeError } = require('serialize-error');
 const _ = require('lodash');
 
 const GetComponentHelper = require('./helpers/get-component');


Test patch:
diff --git a/test/unit/cli-facade-preview.js b/test/unit/cli-facade-preview.js
index 5139478c..109c42ed 100644
--- a/test/unit/cli-facade-preview.js
+++ b/test/unit/cli-facade-preview.js
@@ -5,17 +5,17 @@ const injectr = require('injectr');
 const sinon = require('sinon');
 
 describe('cli : facade : preview', () => {
-  let opnSpy, logSpy, registryStub;
+  let openSpy, logSpy, registryStub;
 
   const execute = function(error, url) {
-    opnSpy = sinon.spy();
+    openSpy = sinon.spy();
     registryStub = {
       getComponentPreviewUrlByUrl: sinon.stub().yields(error, url)
     };
     logSpy = { err: sinon.spy() };
 
     const PreviewFacade = injectr('../../src/cli/facade/preview.js', {
-        opn: opnSpy
+        open: openSpy
       }),
       previewFacade = new PreviewFacade({
         logger: logSpy,
@@ -34,7 +34,7 @@ describe('cli : facade : preview', () => {
     });
 
     it('should not open any preview', () => {
-      expect(opnSpy.called).to.be.false;
+      expect(openSpy.called).to.be.false;
     });
 
     it('should show error message', () => {
@@ -50,7 +50,7 @@ describe('cli : facade : preview', () => {
     });
 
     it('should open /component/~preview/', () => {
-      expect(opnSpy.args[0][0]).to.equal(
+      expect(openSpy.args[0][0]).to.equal(
         'http://registry.com/component/~preview/'
       );
     });
diff --git a/test/unit/registry.js b/test/unit/registry.js
index f83a72b9..0de10bda 100644
--- a/test/unit/registry.js
+++ b/test/unit/registry.js
@@ -19,7 +19,7 @@ describe('registry', () => {
     './domain/repository': sinon.stub().returns({
       init: repositoryInitStub
     }),
-    './router': sinon.stub(),
+    './router': { create: sinon.stub() },
     './domain/options-sanitiser': sinon.stub(),
     './domain/validators': {
       validateRegistryConfiguration: sinon.stub()