Skip to content

Commit 306cf49

Browse files
committed
- alpha version
1 parent d8616a3 commit 306cf49

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+291
-260
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,17 @@
55
#### What is monoco ?
66

77
* monoco is a **JavaScript library to design, create and store JavaScript components**,
8-
* monoco is an **isomorphic** library: your components will work on both client and server side,
9-
* monoco can create **composed components** thanks to its modulary system and
10-
* monoco is made on **pure vanilla JavaScript**, there is no dependency on other libraries.
8+
* monoco is an **isomorphic** library: the components will work on both client and server side,
9+
* monoco **dynamically checks the signature of all the methods of the components at runtime**,
10+
* monoco creates **persistant components** that are stored on a tiny NoSQL Dabatase and
11+
* monoco creates **composed components** thanks to its modulary system.
1112

1213
#### What monoco contains ?
1314

14-
* a **metamodel** based on a JSON format to create your model,
15-
* a **component factory** that creates simple JavaScript classes based on your model,
16-
* a **micro NoSQL Database** to store your components and to export/import your system,
17-
* a **worflow engine** that checks if the change of the state of a component is compliant with your model and
15+
* a **metamodel** based on a JSON format to create a model,
16+
* a **component factory** that creates stateful JavaScript classes based on a model,
17+
* a **micro NoSQL Database** to store components and to export/import them,
18+
* a **worflow engine** that checks at runtime if the signature of all methods are compliant with the model and
1819
* a **channel** in which components can exchange typed messages.
1920

2021
#### How monoco works ?

bower.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"description": "A Model and a NoSQL Database for Componentsk",
55
"license": "GPLv3",
66
"homepage": "https://github.com/monocojs/monoco.git",
@@ -32,6 +32,9 @@
3232
"Gruntfile.js",
3333
"karma.conf.js",
3434
"package.json",
35-
".jshintrc"
35+
".jshintrc",
36+
".travis.yml",
37+
".bowser.json",
38+
"bower.json"
3639
]
3740
}

build/monoco-min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.js

Lines changed: 61 additions & 52 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.json

Lines changed: 46 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.2.2",
3+
"version": "0.3.0",
44
"description": "A Model and a NoSQL Database for Components",
55
"_id": "e89c617b6b15d24",
66
"schemas": {
@@ -737,167 +737,167 @@
737737
"action": "function ready() { var systems = [], system = null, i = 0, length = 0; if (typeof document !== 'undefined') { systems = document.querySelectorAll('link[rel=system]'); length = systems.length; for (i = 0; i < length; i++) { system = systems[i]; this.load(system.href, false); } } }",
738738
"core": true
739739
},
740-
"1c7ed181d8143d6": {
741-
"_id": "1c7ed181d8143d6",
740+
"14cf31b6ed1470a": {
741+
"_id": "14cf31b6ed1470a",
742742
"component": "Monoco",
743743
"state": "error",
744744
"action": "function error(data) { console.error('monoco: ' + data.message, data.error); }",
745745
"core": true
746746
},
747-
"151b21611113189": {
748-
"_id": "151b21611113189",
747+
"1cda91b4c51c924": {
748+
"_id": "1cda91b4c51c924",
749749
"component": "Monoco",
750750
"state": "find",
751751
"action": "function find(Class, query) { return $component.find(Class, query);}",
752752
"core": true,
753753
"useCoreAPI": true
754754
},
755-
"13e60108ce18975": {
756-
"_id": "13e60108ce18975",
755+
"1815c1b1311be0b": {
756+
"_id": "1815c1b1311be0b",
757757
"component": "Monoco",
758758
"state": "system",
759759
"action": "function system(name) { var System = null, system = {}, result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = monoco.require('MonocoSystem'); system = new System(conf); } else { result = monoco.find('MonocoSystem', {'master': true}); if (result.length) { system = result[0]; } } return system; }",
760760
"core": true
761761
},
762-
"134a9123381129a": {
763-
"_id": "134a9123381129a",
762+
"1b4e81f84c1d6f1": {
763+
"_id": "1b4e81f84c1d6f1",
764764
"component": "Monoco",
765765
"state": "warning",
766766
"action": "function warning(message) { console.warn('monoco: ' + message); }",
767767
"core": true
768768
},
769-
"1d25a184391f0ce": {
770-
"_id": "1d25a184391f0ce",
769+
"1bbb615c1315840": {
770+
"_id": "1bbb615c1315840",
771771
"component": "MonocoChannel",
772772
"state": "listen",
773773
"action": "function listen(event, action) { $channel.listen(event, action); }",
774774
"core": true,
775775
"useCoreAPI": true
776776
},
777-
"14803180b012cf2": {
778-
"_id": "14803180b012cf2",
777+
"169511374b1efa2": {
778+
"_id": "169511374b1efa2",
779779
"component": "MonocoChannel",
780780
"state": "send",
781781
"action": "function send(message) { return $channel.send(message); }",
782782
"core": true,
783783
"useCoreAPI": true
784784
},
785-
"1a8fb16c5912eec": {
786-
"_id": "1a8fb16c5912eec",
785+
"19ebb1a0fd112d6": {
786+
"_id": "19ebb1a0fd112d6",
787787
"component": "MonocoClassInfo",
788788
"state": "event",
789789
"action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }",
790790
"core": true
791791
},
792-
"147cc1bf3f13c84": {
793-
"_id": "147cc1bf3f13c84",
792+
"1095e1b5ba1e86d": {
793+
"_id": "1095e1b5ba1e86d",
794794
"component": "MonocoClassInfo",
795795
"state": "events",
796796
"action": "function events() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'event') { result.push(item); } } return result; }",
797797
"core": true
798798
},
799-
"1fb0f1b2921db7b": {
800-
"_id": "1fb0f1b2921db7b",
799+
"1faad11e241b3b8": {
800+
"_id": "1faad11e241b3b8",
801801
"component": "MonocoClassInfo",
802802
"state": "method",
803803
"action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }",
804804
"core": true
805805
},
806-
"105f619be61bd34": {
807-
"_id": "105f619be61bd34",
806+
"1e4d41bce910b1b": {
807+
"_id": "1e4d41bce910b1b",
808808
"component": "MonocoClassInfo",
809809
"state": "methods",
810810
"action": "function methods() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'method') { result.push(item); } } return result; }",
811811
"core": true
812812
},
813-
"1b655199ad147cb": {
814-
"_id": "1b655199ad147cb",
813+
"1c3371348f1823c": {
814+
"_id": "1c3371348f1823c",
815815
"component": "MonocoClassInfo",
816816
"state": "properties",
817817
"action": "function properties() { var keys = Object.keys(this.metamodel()), item = '', result = [], i = 0, length = 0; length = keys.length; for (i = 0; i < length; i++) { item = keys[i]; if (this.metamodel()[item] === 'property') { result.push(item); } } return result; }",
818818
"core": true
819819
},
820-
"1a77b1860619237": {
821-
"_id": "1a77b1860619237",
820+
"1798b16d241bba0": {
821+
"_id": "1798b16d241bba0",
822822
"component": "MonocoClassInfo",
823823
"state": "property",
824824
"action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }",
825825
"core": true
826826
},
827-
"1e2261cd081fc04": {
828-
"_id": "1e2261cd081fc04",
827+
"1639c19d3311b93": {
828+
"_id": "1639c19d3311b93",
829829
"component": "MonocoComponent",
830830
"state": "destroy",
831831
"action": "function destroy() { $component.destroy(this.id()); }",
832832
"core": true,
833833
"useCoreAPI": true
834834
},
835-
"1dd271944b11a7b": {
836-
"_id": "1dd271944b11a7b",
835+
"169b61c0e41687f": {
836+
"_id": "169b61c0e41687f",
837837
"component": "MonocoComponent",
838838
"state": "off",
839839
"action": "function off(state, behaviorId) { var args = [], i = 0, length = 0; length = arguments.length; for (i = 0; i < length - 7; i++) { args.push(arguments[i]); } if ($workflow.checkParams({\"component\": this, \"methodName\": \"off\", \"args\": args})) { if ($metamodel.isValidState(state, this.constructor.name)) {$behavior.remove({\"behaviorId\": behaviorId, \"componentId\": this.id(), \"state\": state}); } else { $helper.getMonoco().warning({ \"message\":\"invoke 'off' method of component '\" + this.id() + \"' with an invalid state '\" + state + \"'\"}); } } }",
840840
"core": true,
841841
"useCoreAPI": true
842842
},
843-
"1e3e214e06163b0": {
844-
"_id": "1e3e214e06163b0",
843+
"1bb3b1eb7d1240c": {
844+
"_id": "1bb3b1eb7d1240c",
845845
"component": "MonocoComponent",
846846
"state": "require",
847847
"action": "function require(id) { return $component.get(id); }",
848848
"core": true,
849849
"useCoreAPI": true
850850
},
851-
"183781de2013941": {
852-
"_id": "183781de2013941",
851+
"10eda1b595180eb": {
852+
"_id": "10eda1b595180eb",
853853
"component": "MonocoDatabase",
854854
"state": "subsystem",
855855
"action": "function subsystem(params) { return $db.subsystem(params); }",
856856
"core": true,
857857
"useCoreAPI": true
858858
},
859-
"10e951c5bd1e93e": {
860-
"_id": "10e951c5bd1e93e",
859+
"1beda1dbca157b0": {
860+
"_id": "1beda1dbca157b0",
861861
"component": "MonocoDatabase",
862862
"state": "system",
863863
"action": "function system(system) { return $db.system(system); }",
864864
"core": true,
865865
"useCoreAPI": true
866866
},
867-
"10fcd19bcc1d955": {
868-
"_id": "10fcd19bcc1d955",
867+
"1783614d1218496": {
868+
"_id": "1783614d1218496",
869869
"component": "MonocoMetamodel",
870870
"state": "create",
871871
"action": "function create() { $metamodel.create(); }",
872872
"core": true,
873873
"useCoreAPI": true
874874
},
875-
"181841b92c13d7d": {
876-
"_id": "181841b92c13d7d",
875+
"1ef6c1171212871": {
876+
"_id": "1ef6c1171212871",
877877
"component": "MonocoMetamodel",
878878
"state": "schema",
879879
"action": "function schema(schema) { $metamodel.schema(schema); }",
880880
"core": true,
881881
"useCoreAPI": true
882882
},
883-
"119251ed051b49e": {
884-
"_id": "119251ed051b49e",
883+
"1570715cb71d2a2": {
884+
"_id": "1570715cb71d2a2",
885885
"component": "MonocoMetamodel",
886886
"state": "type",
887887
"action": "function type(type) { $metamodel.type(type); }",
888888
"core": true,
889889
"useCoreAPI": true
890890
},
891-
"1870c15bc812a9c": {
892-
"_id": "1870c15bc812a9c",
891+
"1411911749123d1": {
892+
"_id": "1411911749123d1",
893893
"component": "MonocoSystem",
894894
"state": "sync",
895895
"action": "function sync() { var dump = $db.dump(); this.schemas(dump.schemas); this.types(dump.types); this.behaviors(dump.behaviors); this.components(dump.components); }",
896896
"core": true,
897897
"useCoreAPI": true
898898
},
899-
"13b5210e6e1fe8f": {
900-
"_id": "13b5210e6e1fe8f",
899+
"112c61db7d10eef": {
900+
"_id": "112c61db7d10eef",
901901
"component": "e89c617b6b15d24",
902902
"state": "main",
903903
"action": "function main() { var monoco = $component.get('monoco'); monoco.ready(); }",
@@ -909,7 +909,7 @@
909909
"Monoco": {
910910
"monoco": {
911911
"_id": "monoco",
912-
"version": "0.2.2"
912+
"version": "0.3.0"
913913
}
914914
},
915915
"MonocoChannel": {

0 commit comments

Comments
 (0)