Skip to content

Commit ee23608

Browse files
author
Erwan Carriou
committed
work for 0.6.5 version
- remove monoco.find API, - by default core objects are injected on behaviors (so you can use $db.[Collection].find and $component.get instead of monoco.find, - add $state in dependency injection, - remove $log object on dependency injection, - fix a bug on $component.inheritFrom API and - update unit test.
1 parent 8f4bbf4 commit ee23608

Some content is hidden

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

56 files changed

+478
-551
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.6.1",
3+
"version": "0.6.5",
44
"description": "A Model and a NoSQL Database for Components",
55
"license": "GPL-3.0",
66
"homepage": "https://github.com/monocojs/monoco.git",

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: 75 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/monoco.json

Lines changed: 47 additions & 71 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "monoco",
3-
"version": "0.6.1",
3+
"version": "0.6.5",
44
"description": "A Model and a NoSQL Database for Components",
55
"_id": "e89c617b6b15d24",
66
"schemas": {
@@ -13,7 +13,6 @@
1313
],
1414
"_core": true,
1515
"version": "property",
16-
"find": "method",
1716
"load": "method",
1817
"system": "method",
1918
"warning": "event"
@@ -33,21 +32,6 @@
3332
"mandatory": true,
3433
"default": "0.0.0"
3534
},
36-
"find": {
37-
"params": [
38-
{
39-
"name": "Class",
40-
"type": "string"
41-
},
42-
{
43-
"name": "query",
44-
"type": "object",
45-
"mandatory": false,
46-
"default": {}
47-
}
48-
],
49-
"result": "array"
50-
},
5135
"load": {
5236
"params": [
5337
{
@@ -99,7 +83,7 @@
9983
"type": "boolean",
10084
"readOnly": false,
10185
"mandatory": false,
102-
"default": false
86+
"default": true
10387
},
10488
"component": {
10589
"type": "string",
@@ -778,173 +762,165 @@
778762
"action": "function main() { 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]; if (system.getAttribute('async') === 'true') { this.require('monoco').load(system.href, true); } else { this.require('monoco').load(system.href, false); } } if (length === 0) { this.require('monoco').ready(); } }}",
779763
"core": true
780764
},
781-
"17d9b1cafc1f081": {
782-
"_id": "17d9b1cafc1f081",
765+
"19abc1e8061bf6a": {
766+
"_id": "19abc1e8061bf6a",
783767
"component": "Monoco",
784768
"state": "error",
785769
"action": "function error(data) { console.error('monoco: ' + data.message, data.error); }",
786770
"core": true
787771
},
788-
"1207911fe8177f6": {
789-
"_id": "1207911fe8177f6",
790-
"component": "Monoco",
791-
"state": "find",
792-
"action": "function find(Class, query) { return $component.find(Class, query);}",
793-
"core": true,
794-
"useCoreAPI": true
795-
},
796-
"1b71b1ffad10e9a": {
797-
"_id": "1b71b1ffad10e9a",
772+
"12ddb1525a136e3": {
773+
"_id": "12ddb1525a136e3",
798774
"component": "Monoco",
799775
"state": "system",
800776
"action": "function system(name) { var System = null, system = {}, result = [], conf = {}; if (name) { conf.master = true; conf.name = name; System = this.require('MonocoSystem'); system = new System(conf); } else { result = this.find('MonocoSystem', {'master': true}); if (result.length) { system = result[0]; } } return system; }",
801777
"core": true
802778
},
803-
"185a412336176b9": {
804-
"_id": "185a412336176b9",
779+
"1d7f91f3a61981d": {
780+
"_id": "1d7f91f3a61981d",
805781
"component": "Monoco",
806782
"state": "warning",
807783
"action": "function warning(message) { console.warn('monoco: ' + message); }",
808784
"core": true
809785
},
810-
"154ea133c4110f1": {
811-
"_id": "154ea133c4110f1",
786+
"1f1ec148d51ef29": {
787+
"_id": "1f1ec148d51ef29",
812788
"component": "MonocoChannel",
813789
"state": "listen",
814790
"action": "function listen(event, action) { $channel.listen(event, action); }",
815791
"core": true,
816792
"useCoreAPI": true
817793
},
818-
"150c01dd791905c": {
819-
"_id": "150c01dd791905c",
794+
"111d71a6261835f": {
795+
"_id": "111d71a6261835f",
820796
"component": "MonocoChannel",
821797
"state": "send",
822798
"action": "function send(message) { return $channel.send(message); }",
823799
"core": true,
824800
"useCoreAPI": true
825801
},
826-
"1749c19b5c1825f": {
827-
"_id": "1749c19b5c1825f",
802+
"14e5218fb312da9": {
803+
"_id": "14e5218fb312da9",
828804
"component": "MonocoClassInfo",
829805
"state": "collection",
830806
"action": "function collection(name) { var result = {}; if (this.metamodel()[name] === 'collection') { result = this.model()[name]; } return result; }",
831807
"core": true
832808
},
833-
"1ea5011ca91fc5e": {
834-
"_id": "1ea5011ca91fc5e",
809+
"1541a120951c2e8": {
810+
"_id": "1541a120951c2e8",
835811
"component": "MonocoClassInfo",
836812
"state": "collections",
837813
"action": "function collections() { 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] === 'collection') { result.push(item); } } return result; }",
838814
"core": true
839815
},
840-
"1b99b1971811bd8": {
841-
"_id": "1b99b1971811bd8",
816+
"13afd1bb351b287": {
817+
"_id": "13afd1bb351b287",
842818
"component": "MonocoClassInfo",
843819
"state": "event",
844820
"action": "function event(name) { var result = {}; if (this.metamodel()[name] === 'event') { result = this.model()[name]; } return result; }",
845821
"core": true
846822
},
847-
"19ef91531c16def": {
848-
"_id": "19ef91531c16def",
823+
"14a5910c801513b": {
824+
"_id": "14a5910c801513b",
849825
"component": "MonocoClassInfo",
850826
"state": "events",
851827
"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; }",
852828
"core": true
853829
},
854-
"107bb1e98218a69": {
855-
"_id": "107bb1e98218a69",
830+
"127d71d01d1f118": {
831+
"_id": "127d71d01d1f118",
856832
"component": "MonocoClassInfo",
857833
"state": "method",
858834
"action": "function method(name) { var result = {}; if (this.metamodel()[name] === 'method') { result = this.model()[name]; } return result; }",
859835
"core": true
860836
},
861-
"1d1e41e9fb17fa0": {
862-
"_id": "1d1e41e9fb17fa0",
837+
"13c1e15c97106fa": {
838+
"_id": "13c1e15c97106fa",
863839
"component": "MonocoClassInfo",
864840
"state": "methods",
865841
"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; }",
866842
"core": true
867843
},
868-
"1fcdd13e521a193": {
869-
"_id": "1fcdd13e521a193",
844+
"1148b1579d1c337": {
845+
"_id": "1148b1579d1c337",
870846
"component": "MonocoClassInfo",
871847
"state": "properties",
872848
"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; }",
873849
"core": true
874850
},
875-
"10f131284010474": {
876-
"_id": "10f131284010474",
851+
"151441dd321c49a": {
852+
"_id": "151441dd321c49a",
877853
"component": "MonocoClassInfo",
878854
"state": "property",
879855
"action": "function property(name) { var result = {}; if (this.metamodel()[name] === 'property') { result = this.model()[name]; } return result; }",
880856
"core": true
881857
},
882-
"1e72d1144a1767f": {
883-
"_id": "1e72d1144a1767f",
858+
"172061151717e82": {
859+
"_id": "172061151717e82",
884860
"component": "MonocoComponent",
885861
"state": "destroy",
886862
"action": "function destroy() { $component.destroy(this.id()); }",
887863
"core": true,
888864
"useCoreAPI": true
889865
},
890-
"124c71417112d12": {
891-
"_id": "124c71417112d12",
866+
"103231088913bc9": {
867+
"_id": "103231088913bc9",
892868
"component": "MonocoComponent",
893869
"state": "off",
894870
"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 + \"'\"}); } } }",
895871
"core": true,
896872
"useCoreAPI": true
897873
},
898-
"1241116e02146d0": {
899-
"_id": "1241116e02146d0",
874+
"1688a1f2f511efa": {
875+
"_id": "1688a1f2f511efa",
900876
"component": "MonocoComponent",
901877
"state": "require",
902878
"action": "function require(id) { return $component.get(id); }",
903879
"core": true,
904880
"useCoreAPI": true
905881
},
906-
"1a37c169ba1d30f": {
907-
"_id": "1a37c169ba1d30f",
882+
"156781141b13357": {
883+
"_id": "156781141b13357",
908884
"component": "MonocoDatabase",
909885
"state": "subsystem",
910886
"action": "function subsystem(params) { return $db.subsystem(params); }",
911887
"core": true,
912888
"useCoreAPI": true
913889
},
914-
"13f29188621ecbe": {
915-
"_id": "13f29188621ecbe",
890+
"19a9211da21537b": {
891+
"_id": "19a9211da21537b",
916892
"component": "MonocoDatabase",
917893
"state": "system",
918894
"action": "function system(system) { return $db.system(system); }",
919895
"core": true,
920896
"useCoreAPI": true
921897
},
922-
"18c0416b8610ed0": {
923-
"_id": "18c0416b8610ed0",
898+
"1c6de1036413c57": {
899+
"_id": "1c6de1036413c57",
924900
"component": "MonocoMetamodel",
925901
"state": "create",
926902
"action": "function create() { $metamodel.create(); }",
927903
"core": true,
928904
"useCoreAPI": true
929905
},
930-
"16acb1c80c13e52": {
931-
"_id": "16acb1c80c13e52",
906+
"1fee91461b1544e": {
907+
"_id": "1fee91461b1544e",
932908
"component": "MonocoMetamodel",
933909
"state": "schema",
934910
"action": "function schema(schema) { $metamodel.schema(schema); }",
935911
"core": true,
936912
"useCoreAPI": true
937913
},
938-
"192d91e499135ea": {
939-
"_id": "192d91e499135ea",
914+
"1a71a19e5b16c12": {
915+
"_id": "1a71a19e5b16c12",
940916
"component": "MonocoMetamodel",
941917
"state": "type",
942918
"action": "function type(type) { $metamodel.type(type); }",
943919
"core": true,
944920
"useCoreAPI": true
945921
},
946-
"1936717a0f191c8": {
947-
"_id": "1936717a0f191c8",
922+
"11cf91277b11aaf": {
923+
"_id": "11cf91277b11aaf",
948924
"component": "MonocoSystem",
949925
"state": "sync",
950926
"action": "function sync() { var dump = $db.dump(); this.schemas(dump.schemas); this.types(dump.types); this.behaviors(dump.behaviors); this.components(dump.components); }",
@@ -956,7 +932,7 @@
956932
"Monoco": {
957933
"monoco": {
958934
"_id": "monoco",
959-
"version": "0.6.1"
935+
"version": "0.6.5"
960936
}
961937
},
962938
"MonocoChannel": {

0 commit comments

Comments
 (0)