@steedos/service-package-loader 2.5.3-beta.21 → 2.5.3-beta.23

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.
Files changed (2) hide show
  1. package/index.js +12 -29
  2. package/package.json +5 -5
package/index.js CHANGED
@@ -8,7 +8,7 @@ const path = require('path');
8
8
  const _ = require('lodash');
9
9
  const fs = require("fs");
10
10
  const metaDataCore = require('@steedos/metadata-core');
11
- const { registerMetadataConfigs, loadStandardMetadata, loadRouters, canLoadMetadata } = require('@steedos/metadata-registrar');
11
+ const { registerMetadataConfigs, loadStandardMetadata, loadRouters } = require('@steedos/metadata-registrar');
12
12
  const loadFlowFile = new metaDataCore.LoadFlowFile();
13
13
 
14
14
  /**
@@ -106,9 +106,6 @@ module.exports = {
106
106
  }
107
107
  },
108
108
  sendPackageFlowToDb: async function(packagePath, name) {
109
- if(!canLoadMetadata('Flow')){
110
- return ;
111
- }
112
109
  const flows = loadFlowFile.load(path.join(packagePath, '**'));
113
110
  for (const apiName in flows) {
114
111
  const flow = flows[apiName];
@@ -131,12 +128,11 @@ module.exports = {
131
128
  return;
132
129
  }
133
130
  const { path : _path } = packageInfo;
131
+
134
132
  this.loadPackagePublicFiles(_path);
135
133
  if(_path){
136
134
  this.sendPackageFlowToDb(_path)
137
- if(canLoadMetadata('Process')){
138
- processLoader.sendPackageProcessToDb(_path);
139
- }
135
+ processLoader.sendPackageProcessToDb(_path);
140
136
  }
141
137
  },
142
138
  loadPackageMetadataFiles: async function (packagePath, name, datasourceName) {
@@ -146,27 +142,17 @@ module.exports = {
146
142
  datasourceName = 'default';
147
143
  }
148
144
  if(this.objectql){
149
- await loadStandardMetadata(name, datasourceName);
150
145
  await this.initDataSource(packagePath, datasourceName);
146
+ await loadStandardMetadata(name, datasourceName);
151
147
  }
152
148
  await registerMetadataConfigs(packagePath, datasourceName, name);
153
- if(canLoadMetadata('Trigger')){
154
- await triggerLoader.load(this.broker, packagePath, name);
155
- }
156
- if(canLoadMetadata('ProcessTrigger')){
157
- await processTriggerLoader.load(this.broker, packagePath, name);
158
- }
159
- if(canLoadMetadata('TriggerYml')){
160
- await triggerYmlLoader.load(this.broker, packagePath, name);
161
- }
149
+ await triggerLoader.load(this.broker, packagePath, name);
150
+ await processTriggerLoader.load(this.broker, packagePath, name);
151
+ await triggerYmlLoader.load(this.broker, packagePath, name);
162
152
  if(this.core){
163
- if(canLoadMetadata('ClientJS')){
164
- this.core.loadClientScripts();
165
- }
166
- if(canLoadMetadata('Router')){
167
- const routersInfo = await this.loadPackageRouters(packagePath, name);
168
- await this.broker.call(`@steedos/service-packages.setPackageRoutersInfo`, {packageName: name, data: routersInfo});
169
- }
153
+ this.core.loadClientScripts();
154
+ const routersInfo = await this.loadPackageRouters(packagePath, name);
155
+ await this.broker.call(`@steedos/service-packages.setPackageRoutersInfo`, {packageName: name, data: routersInfo});
170
156
  }
171
157
  await this.broker.emit(`translations.object.change`, {});
172
158
  return;
@@ -192,9 +178,6 @@ module.exports = {
192
178
  },
193
179
  loadPackagePublicFiles: {
194
180
  handler(packagePath) {
195
- if(!canLoadMetadata('PublicFolder')){
196
- return ;
197
- }
198
181
  if (!this.settings.packageInfo.loadPublicFolder) {
199
182
  return;
200
183
  }
@@ -206,6 +189,7 @@ module.exports = {
206
189
  } catch (error) {
207
190
  return
208
191
  }
192
+
209
193
  try {
210
194
  const express = require('express');
211
195
  this.settings.loadedPackagePublicFiles = true;
@@ -216,7 +200,6 @@ module.exports = {
216
200
  routerPath = __meteor_runtime_config__.ROOT_URL_PATH_PREFIX;
217
201
  }
218
202
  const cacheTime = 86400000 * 1; // one day
219
- // console.log(`static router`, routerPath, publicPath)
220
203
  router.use(routerPath, express.static(publicPath, { maxAge: cacheTime }));
221
204
  // WebApp.connectHandlers.use(router);
222
205
  } catch (error) {
@@ -271,7 +254,7 @@ module.exports = {
271
254
 
272
255
  }
273
256
  }
274
-
257
+
275
258
  await this.loadPackageMetadataServices(_path);
276
259
 
277
260
  // await this.loadPackagePublicFiles(_path);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@steedos/service-package-loader",
3
- "version": "2.5.3-beta.21",
3
+ "version": "2.5.3-beta.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -10,9 +10,9 @@
10
10
  "author": "",
11
11
  "license": "MIT",
12
12
  "dependencies": {
13
- "@steedos/metadata-core": "2.5.3-beta.21",
14
- "@steedos/metadata-registrar": "2.5.3-beta.21",
15
- "@steedos/router": "2.5.3-beta.21",
13
+ "@steedos/metadata-core": "2.5.3-beta.23",
14
+ "@steedos/metadata-registrar": "2.5.3-beta.23",
15
+ "@steedos/router": "2.5.3-beta.23",
16
16
  "clone": "^2.1.2",
17
17
  "moleculer": "^0.14.25",
18
18
  "underscore": "^1.12.0"
@@ -24,5 +24,5 @@
24
24
  "publishConfig": {
25
25
  "access": "public"
26
26
  },
27
- "gitHead": "b4313a2ef5d18ef1cf9271bd3c89b2d6fe52d65b"
27
+ "gitHead": "8fd9cf35d29f8f71e11790bd010bf5b045e7ebc4"
28
28
  }