starting with systems

master
Theunis J. Botha 2021-07-05 10:21:36 +02:00
parent 3835bbe9fa
commit 3c955fe495
26 changed files with 578 additions and 820 deletions

2
dist/index.html vendored
View File

@ -18,6 +18,6 @@
}
})();
</script>
<script src="test.js"></script>
<script src="r3.js"></script>
</body>
</html>

849
dist/r3.js vendored

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@
{
"name": "r3",
"version" : "2.0.18",
"version" : "2.0.25",
"description": "",
"private": true,
"dependencies": {

View File

@ -3,16 +3,17 @@ const R3 = require('r3-r3.js');
//GENERATE_IMPORTS_END
//GENERATE_INDEX_BODY_START
R3.System.Linking.Start()
R3.System.Socket.Start()
R3.System.Test.Start()
console.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);
R3.System.Linking.Start()
R3.System.Socket.Start()
R3.System.Test.Start()
//GENERATE_INDEX_BODY_END
module.exports = {
//GENERATE_EXPORTS_START
R3
//GENERATE_EXPORTS_END
}
}

View File

@ -11,4 +11,4 @@ module.exports = {
Component,
Image
//GENERATE_EXPORTS_END
}
}

View File

@ -15,28 +15,28 @@ const R3Object = require('.././r3-r3-object.js');
Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Simply calls 'Subscribe()' passing it the arguments
Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
@ -63,27 +63,27 @@ const R3Object = require('.././r3-r3-object.js');
Methods:
- createInstance()
Creates an instance of this object based on the runtime.
Creates an instance of this object based on the runtime.
- updateInstance(property)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
- updateFromInstance(property)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
- dispose()
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
- disposeInstance()
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
- toApiObject()
Transforms the current object into JSON ready to be stored to the back-end.
Transforms the current object into JSON ready to be stored to the back-end.
Static Methods:
@ -349,4 +349,4 @@ class Component extends R3Object {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = Component;
module.exports = Component;

View File

@ -15,28 +15,28 @@ const Component = require('.././r3-component.js');
Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Simply calls 'Subscribe()' passing it the arguments
Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
@ -63,27 +63,27 @@ const Component = require('.././r3-component.js');
Methods:
- createInstance()
Creates an instance of this object based on the runtime.
Creates an instance of this object based on the runtime.
- updateInstance(property)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
- updateFromInstance(property)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
- dispose()
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
- disposeInstance()
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
- toApiObject()
Transforms the current object into JSON ready to be stored to the back-end.
Transforms the current object into JSON ready to be stored to the back-end.
Static Methods:
@ -98,27 +98,27 @@ const Component = require('.././r3-component.js');
Methods:
- createInstance()
Creates an instance of this object based on the runtime.
Creates an instance of this object based on the runtime.
- updateInstance(property)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
Updates the instance property, ex. 'x', or specify 'all' to update all properties based on the current object
property(ies)
- updateFromInstance(property)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
Updates the object property, ex. 'x', or specify 'all' to update all properties of this object based on the
value of the instance property(ies)
- dispose()
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
Sends out a notification that this object wants to be deleted. It will first send out a message to delete it's
instance, because an object instance should not exist without an object parent (except maybe for particles)
- disposeInstance()
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
This will signal all systems that an instance wants to be deleted. Once it has been deleted, another event
will be triggered to notify listeners of the deletion of this instance. This can give 'dispose()' a chance to
dispose the object parent this instance.
- toApiObject()
Transforms the current object into JSON ready to be stored to the back-end.
Transforms the current object into JSON ready to be stored to the back-end.
Static Methods:
@ -324,4 +324,4 @@ class Image extends Component {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = Image;
module.exports = Image;

View File

@ -10,15 +10,15 @@ const Utils = require('./r3-utils');
CUSTOM_OPTIONS_END
CUSTOM_METHODS_START
async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments
emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments
subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments
async(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Async()' passing it the arguments
emit(eventId, data, clientCallback, clientErrorCallback) - Simply calls 'Emit()' passing it the arguments
subscribe(eventId, callback) - Simply calls 'Subscribe()' passing it the arguments
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the error as argument.
Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after the event result is obtained, passing it the result. If an exception occurs during execution, the clientErrorCallback is called with the error as argument.
Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised @return {Object} - A handle to the subscription which can be removed by calling handle.remove()
Async(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the error as argument.
Emit(eventId, data, clientCallback, clientErrorCallback) - Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after the event result is obtained, passing it the result. If an exception occurs during execution, the clientErrorCallback is called with the error as argument.
Subscribe(eventId, callback) - Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised @return {Object} - A handle to the subscription which can be removed by calling handle.remove()
CUSTOM_STATIC_METHODS_END
**/
@ -298,7 +298,7 @@ class Event {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//EVENT_GENERATED_START
//GENERATE_EVENT_START
Event.COMPONENT_INITIALIZED = 0x1;
Event.CREATE_INSTANCE_BEFORE = 0x2;
Event.DISPOSE_INSTANCE = 0x3;
@ -343,8 +343,8 @@ Event.GetEventName = function(eventId) {
}
};
//EVENT_GENERATED_END
//GENERATE_EVENT_END
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = Event;
module.exports = Event;

View File

@ -15,28 +15,28 @@ const R3Object = require('./r3-r3-object.js');
Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Simply calls 'Subscribe()' passing it the arguments
Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Inherited from R3Object]
@ -143,4 +143,4 @@ Project.RENDERER_INDEX_MAIN = 0x0;
Project.RENDER_TARGET_INDEX_NONE = -0x1;
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = Project;
module.exports = Project;

View File

@ -14,28 +14,28 @@ const Event = require('./r3-event.js');
Methods:
- async(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Async()' passing it the arguments
Simply calls 'Async()' passing it the arguments
- emit(eventId, data, clientCallback, clientErrorCallback)
Simply calls 'Emit()' passing it the arguments
Simply calls 'Emit()' passing it the arguments
- subscribe(eventId, callback)
Simply calls 'Subscribe()' passing it the arguments
Simply calls 'Subscribe()' passing it the arguments
Static Methods:
- Async(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
Calls all subscription functions registered to eventId with data, clientCallback and clientErrorCallback as
arguments. If an error occurs during clientCallback it additionally will execute clientErrorCallback with the
error as argument.
- Emit(eventId, data, clientCallback, clientErrorCallback)
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
Calls all subscription functions registered to eventId with data as arg. Calls clientCallback directly after
the event result is obtained, passing it the result. If an exception occurs during execution, the
clientErrorCallback is called with the error as argument.
- Subscribe(eventId, callback)
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
Subscribes to 'eventName', ex. Event.BEFORE_RENDER and executes 'callback()' when eventName is raised
[Belonging to R3Object]
@ -126,4 +126,4 @@ class R3Object extends Event {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = R3Object;
module.exports = R3Object;

View File

@ -1,6 +1,6 @@
class R3 {
static version = '2.0.18';
static compileDate = '2021 Jul 04 - 16:34:09 pm';
static version = '2.0.25';
static compileDate = '2021 Jul 05 - 10:20:49 am';
}
//GENERATE_IMPORTS_START

View File

@ -15,4 +15,4 @@ module.exports = {
SystemSocket,
SystemTest
//GENERATE_EXPORTS_END
}
}

View File

@ -15,18 +15,18 @@ const System = require('./r3-system.js');
Methods:
- start(options)
Just calls System.Start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Just calls System.Stop(options)
Static Methods:
- Start(options)
Starts the system by registering subscriptions to events
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
Stops the system by removing these subscriptions to events
[Belonging to SystemLinking]
@ -36,19 +36,34 @@ const System = require('./r3-system.js');
Methods:
<no methods>
- start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Static Methods:
<no static methods>
- Start(options)
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
GENERATE_INHERITED_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_EVENT_LISTENERS_START
CUSTOM_EVENT_LISTENERS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -83,8 +98,41 @@ class SystemLinking extends System {
}
//GENERATE_CONSTRUCTOR_EXTENDS_END
//GENERATE_EVENT_LISTENERS_START
//GENERATE_EVENT_LISTENERS_END
//GENERATE_METHODS_START
/**
* start()
* - Just calls System.Start(options)
* @param options
*/
start(options) {
//GENERATE_START_METHOD_START
//GENERATE_START_METHOD_END
//CUSTOM_START_METHOD_START
//CUSTOM_START_METHOD_END
}
/**
* stop()
* - Just calls System.Stop(options)
* @param options
*/
stop(options) {
//GENERATE_STOP_METHOD_START
//GENERATE_STOP_METHOD_END
//CUSTOM_STOP_METHOD_START
//CUSTOM_STOP_METHOD_END
}
//GENERATE_METHODS_END
//GENERATE_STATIC_METHODS_START
//GENERATE_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
@ -94,4 +142,4 @@ class SystemLinking extends System {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = SystemLinking;
module.exports = SystemLinking;

View File

@ -15,18 +15,18 @@ const System = require('./r3-system.js');
Methods:
- start(options)
Just calls System.Start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Just calls System.Stop(options)
Static Methods:
- Start(options)
Starts the system by registering subscriptions to events
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
Stops the system by removing these subscriptions to events
[Belonging to SystemSocket]
@ -36,19 +36,34 @@ const System = require('./r3-system.js');
Methods:
<no methods>
- start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Static Methods:
<no static methods>
- Start(options)
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
GENERATE_INHERITED_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_EVENT_LISTENERS_START
CUSTOM_EVENT_LISTENERS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -83,8 +98,41 @@ class SystemSocket extends System {
}
//GENERATE_CONSTRUCTOR_EXTENDS_END
//GENERATE_EVENT_LISTENERS_START
//GENERATE_EVENT_LISTENERS_END
//GENERATE_METHODS_START
/**
* start()
* - Just calls System.Start(options)
* @param options
*/
start(options) {
//GENERATE_START_METHOD_START
//GENERATE_START_METHOD_END
//CUSTOM_START_METHOD_START
//CUSTOM_START_METHOD_END
}
/**
* stop()
* - Just calls System.Stop(options)
* @param options
*/
stop(options) {
//GENERATE_STOP_METHOD_START
//GENERATE_STOP_METHOD_END
//CUSTOM_STOP_METHOD_START
//CUSTOM_STOP_METHOD_END
}
//GENERATE_METHODS_END
//GENERATE_STATIC_METHODS_START
//GENERATE_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
@ -94,4 +142,4 @@ class SystemSocket extends System {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = SystemSocket;
module.exports = SystemSocket;

View File

@ -15,18 +15,18 @@ const System = require('./r3-system.js');
Methods:
- start(options)
Just calls System.Start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Just calls System.Stop(options)
Static Methods:
- Start(options)
Starts the system by registering subscriptions to events
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
Stops the system by removing these subscriptions to events
[Belonging to SystemTest]
@ -36,19 +36,34 @@ const System = require('./r3-system.js');
Methods:
<no methods>
- start(options)
Just calls System.Start(options)
- stop(options)
Just calls System.Stop(options)
Static Methods:
<no static methods>
- Start(options)
Starts the system by registering subscriptions to events
- Stop(options)
Stops the system by removing these subscriptions to events
GENERATE_INHERITED_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_EVENT_LISTENERS_START
CUSTOM_EVENT_LISTENERS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -83,8 +98,41 @@ class SystemTest extends System {
}
//GENERATE_CONSTRUCTOR_EXTENDS_END
//GENERATE_EVENT_LISTENERS_START
//GENERATE_EVENT_LISTENERS_END
//GENERATE_METHODS_START
/**
* start()
* - Just calls System.Start(options)
* @param options
*/
start(options) {
//GENERATE_START_METHOD_START
//GENERATE_START_METHOD_END
//CUSTOM_START_METHOD_START
//CUSTOM_START_METHOD_END
}
/**
* stop()
* - Just calls System.Stop(options)
* @param options
*/
stop(options) {
//GENERATE_STOP_METHOD_START
//GENERATE_STOP_METHOD_END
//CUSTOM_STOP_METHOD_START
//CUSTOM_STOP_METHOD_END
}
//GENERATE_METHODS_END
//GENERATE_STATIC_METHODS_START
//GENERATE_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
@ -94,4 +142,4 @@ class SystemTest extends System {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = SystemTest;
module.exports = SystemTest;

View File

@ -8,13 +8,13 @@ const Utils = require('.././r3-utils');
CUSTOM_OPTIONS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -134,4 +134,4 @@ class System {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = System;
module.exports = System;

View File

@ -1288,4 +1288,4 @@ class Utils {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = Utils;
module.exports = Utils;

View File

@ -48,4 +48,4 @@ class CLASS_NAME extends EXTEND_CLASS {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = CLASS_NAME;
module.exports = CLASS_NAME;

View File

@ -7,4 +7,4 @@
module.exports = {
//GENERATE_EXPORTS_START
//GENERATE_EXPORTS_END
}
}

View File

@ -37,4 +37,4 @@ class CLASS_NAME {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = CLASS_NAME;
module.exports = CLASS_NAME;

View File

@ -21,4 +21,4 @@ class CLASS_NAME {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = CLASS_NAME;
module.exports = CLASS_NAME;

View File

@ -7,9 +7,13 @@ const Utils = require('INCLUDE_PATH/r3-utils');
CUSTOM_OPTIONS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -33,4 +37,4 @@ class CLASS_NAME {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = CLASS_NAME;
module.exports = CLASS_NAME;

View File

@ -5,13 +5,21 @@ const EXTEND_CLASS = require('./EXTEND_CLASS_FILE_NAME');
/**
GENERATE_INHERITED_START
GENERATE_INHERITED_END
CUSTOM_OPTIONS_START
CUSTOM_OPTIONS_END
CUSTOM_EVENT_LISTENERS_START
CUSTOM_EVENT_LISTENERS_END
CUSTOM_METHODS_START
start(options) - Just calls System.Start(options)
stop(options) - Just calls System.Stop(options)
CUSTOM_METHODS_END
CUSTOM_STATIC_METHODS_START
Start(options) - Starts the system by registering subscriptions to events
Stop(options) - Stops the system by removing these subscriptions to events
CUSTOM_STATIC_METHODS_END
**/
@ -20,8 +28,11 @@ class CLASS_NAME extends EXTEND_CLASS {
//GENERATE_CONSTRUCTOR_EXTENDS_START
//GENERATE_CONSTRUCTOR_EXTENDS_END
//GENERATE_EVENT_LISTENERS_START
//GENERATE_EVENT_LISTENERS_END
//GENERATE_METHODS_START
//GENERATE_METHODS_END
//GENERATE_STATIC_METHODS_START
//GENERATE_STATIC_METHODS_END
//CUSTOM_IMPLEMENTATION_START
//CUSTOM_IMPLEMENTATION_END
@ -31,4 +42,4 @@ class CLASS_NAME extends EXTEND_CLASS {
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_START
//CUSTOM_OUT_OF_CLASS_IMPLEMENTATION_END
module.exports = CLASS_NAME;
module.exports = CLASS_NAME;

View File

@ -8,7 +8,7 @@ GENERATE_DEFINES
GENERATE_DISPOSE_INSTANCE_METHOD
GENERATE_DISPOSE_METHOD
GENERATE_EMIT_METHOD
GENERATE_EVENT_LISTENERS
GENERATE_EVENT
GENERATE_EXPORTS
GENERATE_IMPORTS
GENERATE_INDEX_BODY
@ -39,7 +39,6 @@ CUSTOM_CREATE_INSTANCE_METHOD
CUSTOM_DISPOSE_INSTANCE_METHOD
CUSTOM_DISPOSE_METHOD
CUSTOM_EMIT_METHOD
CUSTOM_EVENT_LISTENERS
CUSTOM_EXCLUDED_FROM_INSTANCE_OPTIONS
CUSTOM_IMPLEMENTATION
CUSTOM_INSTANCE_OPTIONS_MAPPING

View File

@ -251,7 +251,7 @@ function getMethodListItems($store)
foreach ($store as $item) {
$details = getMethodDetails($item);
$methodListItem = '- ' . $details['methodName'] . '(' . $details['args'] .")\n";
$methodListItem .= "\t\t\t\t" . wordwrap($details['comment'], 110, "\n\t\t\t\t") . "\n";
$methodListItem .= " " . wordwrap($details['comment'], 110, "\n ") . "\n";
array_push($methodListItems, $methodListItem);
}
@ -886,7 +886,7 @@ foreach ($files as $file) {
deleteSavedFile($saveFile);
exit(0);
}
} else if ($argv[2] == 'build-graph') {
} else if ($argv[2] == 'build-dist') {
buildNodeList($file);
}
}
@ -996,6 +996,8 @@ function generateR3($nodes)
$exports = ' R3';
$indexBody = [];
array_push($indexBody, "\nconsole.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);\n\n");
foreach ($nodes as $node) {
/**
* Node $node
@ -1005,25 +1007,104 @@ function generateR3($nodes)
}
}
array_push($indexBody, "\nconsole.log('r3.js - version ' + R3.version + ' compiled ' + R3.compileDate);\n\n");
updateSection($indexFile, 'GENERATE_IMPORTS', implode("\n", $imports));
updateSection($indexFile, 'GENERATE_INDEX_BODY', implode("\n", $indexBody));
updateSection($indexFile, 'GENERATE_EXPORTS', $exports);
$r3js = fopen('dist/r3.js', "w");
}
function generateR3Dist($nodes)
{
$r3jsFile = 'dist/r3.js';
$r3jsSource = 'src/r3/r3-r3.js';
$r3jsBaseTemplate = 'src/templates/r3-base.template';
$r3js = fopen($r3jsFile, "w");
ftruncate($r3js, 0);
// $version = file_get_contents('version');
// $packageJson = file_get_contents('package.json');
// $packageJson = preg_replace('/(.*version.*: ").*(".*)/', '${1}' . $version . '${2}', $packageJson);
// file_put_contents('package.json', $packageJson);
$version = file_get_contents('version');
$template = file_get_contents($r3jsBaseTemplate);
$template = str_replace('DATE', date("Y M d - H:i:s a"), $template);
$template = str_replace('VERSION', $version, $template);
fwrite($r3js, $template);
$generateTokens = getTokens('GENERATE');
$customTokens = getTokens('CUSTOM');
$savedGenerate = save($r3jsSource, $generateTokens)[1];
$savedCustom = save($r3jsSource, $customTokens)[1];
foreach ($nodes as $node) {
$contents = file_get_contents($node->file);
fwrite($r3js, $contents);
}
foreach ($savedGenerate as $key => $store)
{
if ($key === 'GENERATE_IMPORTS') {
continue;
}
foreach ($store as $line) {
fwrite($r3js, $line);
}
}
foreach ($savedCustom as $key => $store)
{
foreach ($store as $line) {
fwrite($r3js, $line);
}
}
$contents = file_get_contents('src/r3/index.js');
fwrite($r3js, $contents);
fclose($r3js);
/**
* Now start cleaning up the file
*/
$contents = file_get_contents($r3jsFile);
$contents = preg_replace('/\n^\/\/\bGENERATE_IMPORTS_START\b.*?\bGENERATE_IMPORTS_END.*?\n$/sm', '', $contents);
$contents = preg_replace('/\n^\s+\/\/\bGENERATE_EXPORTS_START\b.*?\bGENERATE_EXPORTS_END.*?$/sm', '', $contents);
$contents = preg_replace('/\n^\s+\bCUSTOM_OPTIONS_START\b.*?\bCUSTOM_OPTIONS_END.*?$/sm', '', $contents);
$contents = preg_replace('/\n^\s+\bCUSTOM_METHODS_START\b.*?\bCUSTOM_METHODS_END.*?$/sm', '', $contents);
$contents = preg_replace('/\n^\s+\bCUSTOM_STATIC_METHODS_START\b.*?\bCUSTOM_STATIC_METHODS_END.*?$/sm', '', $contents);
$contents = preg_replace('/\n^\bmodule\.exports\s+=\s+{.*?}$/sm', '', $contents);
$contents = preg_replace('/\n^\bmodule\.exports\s+=.*?$/sm', '', $contents);
$contents = preg_replace('/\n^\bconst.*?= require.*?$/sm', '', $contents);
foreach ($generateTokens as $generateTokenKey => $generateTokenValue) {
/**
* Remove generate tokens
*/
$contents = preg_replace('/.*\b' . $generateTokenKey . '(_START|_END)\b.*?\n/m', '', $contents );
}
foreach ($customTokens as $customTokenKey => $customTokenValue) {
/**
* Remove generate tokens
*/
$contents = preg_replace('/.*\b' . $customTokenKey . '(_START|_END)\b.*?\n/m', '', $contents );
}
$contents = preg_replace('/\n^\/\*\*\s+\*\*\/\s*?$/sm', '', $contents);
$contents = preg_replace('/\n\n\n+/sm', "\n\n", $contents);
file_put_contents($r3jsFile, $contents);
}
if ($argv[2] == 'build-graph') {
if ($argv[2] == 'build-dist') {
global $nodeList;
@ -1058,6 +1139,7 @@ if ($argv[2] == 'build-graph') {
// Remove R3 (first node) from the list
array_shift($nodes);
generateR3($nodes);
generateR3Dist($nodes);
foreach ($files as $file) {

View File

@ -1 +1 @@
2.0.18
2.0.25