@steedos/service-package-registry 2.2.21 → 2.2.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,6 +100,18 @@ const getPackageInfo = (packageName, packagePath)=>{
100
100
  }
101
101
  }
102
102
 
103
+ const destroyExistThePackageService = async (packageInfo)=>{
104
+ let schema = objectql.getSteedosSchema();
105
+ let broker = schema.broker;
106
+ let svc = broker.getLocalService({
107
+ name: `~packages-${packageInfo.name}`
108
+ });
109
+ if (svc) {
110
+ broker.logger.info(`Destroy previous '${schema.name}' service...`);
111
+ await broker.destroyService(svc);
112
+ }
113
+ }
114
+
103
115
  const loadPackage = async (packageName, packagePath)=>{
104
116
  try {
105
117
  if(!packagePath){
@@ -108,6 +120,7 @@ const loadPackage = async (packageName, packagePath)=>{
108
120
  }))
109
121
  }
110
122
  const packageInfo = require(path.join(packagePath, 'package.json'));
123
+ await destroyExistThePackageService(packageInfo);
111
124
  await steedos.loadPackage(packagePath)
112
125
  return Object.assign({packagePath: packagePath}, packageInfo);
113
126
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-package-registry",
3
- "version": "2.2.21",
3
+ "version": "2.2.22",
4
4
  "description": "",
5
5
  "main": "package.service.js",
6
6
  "scripts": {
@@ -9,8 +9,8 @@
9
9
  "author": "",
10
10
  "license": "ISC",
11
11
  "dependencies": {
12
- "@steedos/service-package-license": "2.2.21",
13
- "@steedos/service-package-loader": "2.2.21",
12
+ "@steedos/service-package-license": "2.2.22",
13
+ "@steedos/service-package-loader": "2.2.22",
14
14
  "fs-extra": "8.1.0",
15
15
  "i18next": "20.3.2",
16
16
  "json-stringify-safe": "5.0.1",
@@ -27,5 +27,5 @@
27
27
  "publishConfig": {
28
28
  "access": "public"
29
29
  },
30
- "gitHead": "39204e6e65ded584d76363cebfdcbcb061238d38"
30
+ "gitHead": "af4ea8ed034854c8de1ff8b9d5db241183524417"
31
31
  }