fable 3.0.100 → 3.0.103
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.
- package/dist/fable.compatible.js +8 -6
- package/dist/fable.compatible.min.js +1 -1
- package/dist/fable.compatible.min.js.map +1 -1
- package/dist/fable.js +8 -6
- package/dist/fable.min.js +1 -1
- package/dist/fable.min.js.map +1 -1
- package/package.json +2 -2
- package/source/Fable.js +2 -0
- package/source/services/Fable-Service-Anticipate.js +2 -2
- package/source/services/Fable-Service-MetaTemplate.js +4 -1
package/dist/fable.compatible.js
CHANGED
|
@@ -2831,7 +2831,8 @@ _this17.serviceTypes=[];// A map of instantiated services
|
|
|
2831
2831
|
_this17.servicesMap={};// A map of the default instantiated service by type
|
|
2832
2832
|
_this17.services={};// A map of class constructors for services
|
|
2833
2833
|
_this17.serviceClasses={};// If we need extra service initialization capabilities
|
|
2834
|
-
_this17.extraServiceInitialization=false;//
|
|
2834
|
+
_this17.extraServiceInitialization=false;// Set how noisy the system is about signaling complexity
|
|
2835
|
+
_this17.LogNoisiness=0;// Initialization Phase 1: Set up the core utility services
|
|
2835
2836
|
// These are things like power, water, and sewage. They are required for fable to run (e.g. logging, settings, etc)
|
|
2836
2837
|
// Instantiate the default Settings Manager
|
|
2837
2838
|
_this17.SettingsManager=new libFableSettings(pSettings);_this17.SettingsManager=_this17.SettingsManager;// Instantiate the UUID generator
|
|
@@ -2875,9 +2876,11 @@ if(this.servicesMap[pServiceType].hasOwnProperty(pServiceHash)){if(!this.hasOwnP
|
|
|
2875
2876
|
function autoConstruct(pSettings){return new Fable(pSettings);}module.exports=Fable;module.exports["new"]=autoConstruct;module.exports.LogProviderBase=libFableLog.LogProviderBase;module.exports.ServiceProviderBase=libFableServiceBase;module.exports.CoreServiceProviderBase=libFableServiceBase.CoreServiceProviderBase;module.exports.precedent=libFableSettings.precedent;},{"./services/Fable-Service-Anticipate.js":120,"./services/Fable-Service-CSVParser.js":121,"./services/Fable-Service-DataFormat.js":122,"./services/Fable-Service-DataGeneration.js":124,"./services/Fable-Service-DateManipulation.js":125,"./services/Fable-Service-EnvironmentData.js":126,"./services/Fable-Service-FilePersistence.js":127,"./services/Fable-Service-MetaTemplate.js":128,"./services/Fable-Service-Operation.js":132,"./services/Fable-Service-RestClient.js":133,"./services/Fable-Service-Template.js":134,"./services/Fable-Service-Utility.js":135,"cachetrax":22,"fable-log":43,"fable-serviceproviderbase":44,"fable-settings":47,"fable-uuid":49,"manyfest":72}],120:[function(require,module,exports){var libFableServiceBase=require('fable-serviceproviderbase');var FableServiceAnticipate=/*#__PURE__*/function(_libFableServiceBase){_inherits(FableServiceAnticipate,_libFableServiceBase);var _super10=_createSuper(FableServiceAnticipate);function FableServiceAnticipate(pFable,pOptions,pServiceHash){var _this18;_classCallCheck2(this,FableServiceAnticipate);_this18=_super10.call(this,pFable,pOptions,pServiceHash);_this18.serviceType='AsyncAnticipate';// The queue of operations waiting to run.
|
|
2876
2877
|
_this18.operationQueue=[];_this18.erroredOperations=[];_this18.executingOperationCount=0;_this18.completedOperationCount=0;_this18.maxOperations=1;_this18.lastError=undefined;_this18.waitingFunctions=[];return _this18;}_createClass2(FableServiceAnticipate,[{key:"checkQueue",value:function checkQueue(){// This checks to see if we need to start any operations.
|
|
2877
2878
|
if(this.operationQueue.length>0&&this.executingOperationCount<this.maxOperations){var tmpOperation=this.operationQueue.shift();this.executingOperationCount+=1;tmpOperation(this.buildAnticipatorCallback());}else if(this.waitingFunctions.length>0&&this.executingOperationCount<1){// If there are no operations left, and we have waiting functions, call them.
|
|
2878
|
-
for(var i=0;i<this.waitingFunctions.length;i++){this.log.trace('Calling waiting function.')
|
|
2879
|
+
for(var i=0;i<this.waitingFunctions.length;i++){//this.log.trace('Calling waiting function.')
|
|
2880
|
+
this.waitingFunctions[i](this.lastError);}// Reset our state
|
|
2879
2881
|
this.lastError=undefined;this.waitingFunctions=[];}}// Expects a function fAsynchronousFunction(fCallback)
|
|
2880
|
-
},{key:"anticipate",value:function anticipate(fAsynchronousFunction){this.log.trace('Adding a function...')
|
|
2882
|
+
},{key:"anticipate",value:function anticipate(fAsynchronousFunction){//this.log.trace('Adding a function...')
|
|
2883
|
+
this.operationQueue.push(fAsynchronousFunction);this.checkQueue();}},{key:"buildAnticipatorCallback",value:function buildAnticipatorCallback(){// This uses closure-scoped state to track the callback state
|
|
2881
2884
|
var tmpCallbackState={Called:false,Error:undefined,OperationSet:this};return hoistedCallback;function hoistedCallback(pError){if(tmpCallbackState.Called){// If they call the callback twice, throw an error
|
|
2882
2885
|
throw new Error("Anticipation async callback called twice...");}tmpCallbackState.Called=true;tmpCallbackState.error=pError;tmpCallbackState.OperationSet.executingOperationCount-=1;tmpCallbackState.OperationSet.completedOperationCount+=1;tmpCallbackState.OperationSet.checkQueue();}}},{key:"wait",value:function wait(fCallback){this.waitingFunctions.push(fCallback);this.checkQueue();}}]);return FableServiceAnticipate;}(libFableServiceBase);module.exports=FableServiceAnticipate;},{"fable-serviceproviderbase":44}],121:[function(require,module,exports){var libFableServiceProviderBase=require('fable-serviceproviderbase');/**
|
|
2883
2886
|
* Parsing CSVs. Why? Because it's a thing that needs to be done.
|
|
@@ -3130,8 +3133,7 @@ return _this25.makeFolderRecursive(tmpParameters,fCallback);}else{console.log(pC
|
|
|
3130
3133
|
* Precedent Meta-Templating
|
|
3131
3134
|
* @author Steven Velozo <steven@velozo.com>
|
|
3132
3135
|
* @description Process text stream trie and postfix tree, parsing out meta-template expression functions.
|
|
3133
|
-
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceMetaTemplate,_libFableServiceBase5);var _super17=_createSuper(FableServiceMetaTemplate);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,FableServiceMetaTemplate);_this26=_super17.call(this,pFable,pOptions,pServiceHash);_this26.serviceType='MetaTemplate';_this26.WordTree=new libWordTree()
|
|
3134
|
-
_this26.StringParser=new libStringParser(_this26.fable);_this26.ParseTree=_this26.WordTree.ParseTree;return _this26;}/**
|
|
3136
|
+
*/var libWordTree=require("./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js");var libStringParser=require("./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js");var FableServiceMetaTemplate=/*#__PURE__*/function(_libFableServiceBase5){_inherits(FableServiceMetaTemplate,_libFableServiceBase5);var _super17=_createSuper(FableServiceMetaTemplate);function FableServiceMetaTemplate(pFable,pOptions,pServiceHash){var _this26;_classCallCheck2(this,FableServiceMetaTemplate);_this26=_super17.call(this,pFable,pOptions,pServiceHash);_this26.serviceType='MetaTemplate';_this26.WordTree=new libWordTree();_this26.StringParser=new libStringParser(_this26.fable);_this26.ParseTree=_this26.WordTree.ParseTree;return _this26;}/**
|
|
3135
3137
|
* Add a Pattern to the Parse Tree
|
|
3136
3138
|
* @method addPattern
|
|
3137
3139
|
* @param {Object} pTree - A node on the parse tree to push the characters into
|
|
@@ -3144,7 +3146,7 @@ _this26.StringParser=new libStringParser(_this26.fable);_this26.ParseTree=_this2
|
|
|
3144
3146
|
* @param {string} pString - The string to parse
|
|
3145
3147
|
* @param {object} pData - Data to pass in as the second argument
|
|
3146
3148
|
* @return {string} The result from the parser
|
|
3147
|
-
*/},{key:"parseString",value:function parseString(pString,pData,fCallback){return this.StringParser.parseString(pString,this.ParseTree,pData,fCallback);}}]);return FableServiceMetaTemplate;}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":129,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":130,"fable-serviceproviderbase":44}],129:[function(require,module,exports){/**
|
|
3149
|
+
*/},{key:"parseString",value:function parseString(pString,pData,fCallback){if(this.LogNoisiness>4){this.fable.log.trace("Metatemplate parsing template string [".concat(pString,"] where the callback is a ").concat(_typeof(fCallback)),{TemplateData:pData});}return this.StringParser.parseString(pString,this.ParseTree,pData,fCallback);}}]);return FableServiceMetaTemplate;}(libFableServiceBase);module.exports=FableServiceMetaTemplate;},{"./Fable-Service-MetaTemplate/MetaTemplate-StringParser.js":129,"./Fable-Service-MetaTemplate/MetaTemplate-WordTree.js":130,"fable-serviceproviderbase":44}],129:[function(require,module,exports){/**
|
|
3148
3150
|
* String Parser
|
|
3149
3151
|
* @author Steven Velozo <steven@velozo.com>
|
|
3150
3152
|
* @description Parse a string, properly processing each matched token in the word tree.
|