fable 3.0.27 → 3.0.29

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.
@@ -5,7 +5,7 @@
5
5
 
6
6
  "LibraryOutputFolder": "./dist/",
7
7
 
8
- "LibraryUniminifiedFileName": "fable.js",
8
+ "LibraryUniminifiedFileName": "fable.compatible.js",
9
9
 
10
- "LibraryMinifiedFileName": "fable.min.js"
10
+ "LibraryMinifiedFileName": "fable.compatible.min.js"
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fable",
3
- "version": "3.0.27",
3
+ "version": "3.0.29",
4
4
  "description": "An entity behavior management and API bundling library.",
5
5
  "main": "source/Fable.js",
6
6
  "scripts": {
@@ -65,6 +65,7 @@
65
65
  "async.waterfall": "^0.5.2",
66
66
  "data-arithmatic": "^1.0.4",
67
67
  "fable-log": "^3.0.7",
68
+ "fable-serviceproviderbase": "^3.0.2",
68
69
  "fable-settings": "^3.0.3",
69
70
  "fable-uuid": "^3.0.2",
70
71
  "precedent": "^1.0.10",
@@ -4,7 +4,7 @@
4
4
  * @author <steven@velozo.com>
5
5
  */
6
6
 
7
- const libFableServiceBase = require('./Fable-ServiceProviderBase.js');
7
+ const libFableServiceBase = require('fable-serviceproviderbase');
8
8
 
9
9
  class FableService
10
10
  {
@@ -32,7 +32,8 @@ class FableService
32
32
  // Add the container for instantiated services to go in
33
33
  this.services[pServiceType] = {};
34
34
 
35
- if ((typeof(pServiceClass) == 'function') && (pServiceClass.prototype instanceof libFableServiceBase))
35
+ // Using the static member of the class is a much more reliable way to check if it is a service class than instanceof
36
+ if ((typeof(pServiceClass) == 'function') && (pServiceClass.isFableService))
36
37
  {
37
38
  // Add the class to the list of classes
38
39
  this.serviceClasses[pServiceType] = pServiceClass;
@@ -40,6 +41,7 @@ class FableService
40
41
  else
41
42
  {
42
43
  // Add the base class to the list of classes
44
+ this.fable.log.error(`Attempted to add service type [${pServiceType}] with an invalid class. Using base service class, which will not crash but won't provide meaningful services.`);
43
45
  this.serviceClasses[pServiceType] = libFableServiceBase;
44
46
  }
45
47
  }
@@ -110,4 +112,5 @@ class FableService
110
112
 
111
113
  module.exports = FableService;
112
114
 
113
- module.exports.ServiceProviderBase = libFableServiceBase;
115
+ module.exports.ServiceProviderBase = libFableServiceBase;
116
+ module.exports.CoreServiceProviderBase = libFableServiceBase.CoreServiceProviderBase;
package/source/Fable.js CHANGED
@@ -8,7 +8,6 @@ const libFableSettings = require('fable-settings');
8
8
  const libFableUUID = require('fable-uuid');
9
9
  const libFableLog = require('fable-log');
10
10
 
11
- const libFablePreinitServiceProviderBase = require('./Fable-PreinitServiceProviderBase.js');
12
11
  const libFableServiceManager = require('./Fable-ServiceManager.js');
13
12
 
14
13
  // Services
@@ -125,6 +124,6 @@ module.exports.new = autoConstruct;
125
124
 
126
125
  module.exports.LogProviderBase = libFableLog.LogProviderBase;
127
126
  module.exports.ServiceProviderBase = libFableServiceManager.ServiceProviderBase;
128
- module.exports.PreinitServiceProviderBase = libFablePreinitServiceProviderBase;
127
+ module.exports.CoreServiceProviderBase = libFableServiceManager.CoreServiceProviderBase;
129
128
 
130
129
  module.exports.precedent = libFableSettings.precedent;
@@ -1,4 +1,4 @@
1
- const libFableServiceBase = require('../Fable-ServiceProviderBase.js');
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
2
 
3
3
  const libDataArithmatic = require('data-arithmatic');
4
4
 
@@ -1,4 +1,4 @@
1
- const libFableServiceBase = require('../Fable-ServiceProviderBase.js');
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
2
 
3
3
  const libPrecedent = require('precedent');
4
4
 
@@ -1,4 +1,4 @@
1
- const libFableServiceBase = require('../Fable-ServiceProviderBase.js');
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
2
 
3
3
  const libSimpleGet = require('simple-get');
4
4
 
@@ -1,4 +1,4 @@
1
- const libFableServiceBase = require('../Fable-ServiceProviderBase.js');
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
2
2
 
3
3
  class FableServiceTemplate extends libFableServiceBase
4
4
  {
@@ -1,5 +1,4 @@
1
- const libFableServiceBase = require('../Fable-ServiceProviderBase.js');
2
-
1
+ const libFableServiceBase = require('../Fable-ServiceManager.js').ServiceProviderBase;
3
2
 
4
3
  // TODO: These are still pretty big -- consider the smaller polyfills
5
4
  const libAsyncWaterfall = require('async.waterfall');
@@ -46,7 +46,7 @@ class MockDatabaseService extends libFable.ServiceProviderBase
46
46
  }
47
47
  }
48
48
 
49
- class MockCoreService extends libFable.PreinitServiceProviderBase
49
+ class MockCoreService extends libFable.CoreServiceProviderBase
50
50
  {
51
51
  constructor(pOptions, pServiceHash)
52
52
  {
@@ -1,36 +0,0 @@
1
- /**
2
- * Fable Core Pre-initialization Service Base
3
- *
4
- * For a couple services, we need to be able to instantiate them before the Fable object is fully initialized.
5
- * This is a base class for those services.
6
- *
7
- * @license MIT
8
- * @author <steven@velozo.com>
9
- */
10
-
11
- class FablePreinitServiceProviderBase
12
- {
13
- constructor(pOptions, pServiceHash)
14
- {
15
- this.fable = false;
16
-
17
- this.options = (typeof(pOptions) === 'object') ? pOptions : {};
18
-
19
- this.serviceType = 'Unknown';
20
-
21
- // The hash will be a non-standard UUID ... the UUID service uses this base class!
22
- this.UUID = `CORESVC-${Math.floor((Math.random() * (99999 - 10000)) + 10000)}`;
23
-
24
- this.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;
25
- }
26
-
27
- // After fable is initialized, it would be expected to be wired in as a normal service.
28
- connectFable(pFable)
29
- {
30
- this.fable = pFable;
31
-
32
- return true;
33
- }
34
- }
35
-
36
- module.exports = FablePreinitServiceProviderBase;
@@ -1,23 +0,0 @@
1
- /**
2
- * Fable Service Base
3
- * @license MIT
4
- * @author <steven@velozo.com>
5
- */
6
-
7
- class FableServiceProviderBase
8
- {
9
- constructor(pFable, pOptions, pServiceHash)
10
- {
11
- this.fable = pFable;
12
-
13
- this.options = (typeof(pOptions) === 'object') ? pOptions : {};
14
-
15
- this.serviceType = 'Unknown';
16
-
17
- this.UUID = pFable.getUUID();
18
-
19
- this.Hash = (typeof(pServiceHash) === 'string') ? pServiceHash : `${this.UUID}`;
20
- }
21
- }
22
-
23
- module.exports = FableServiceProviderBase;