| @@ -0,0 +1,11 | |||||
|
|
1 | { | |||
|
|
2 | "extends": "../tsconfig.json", | |||
|
|
3 | "compilerOptions": { | |||
|
|
4 | "types": [ | |||
|
|
5 | "@types/requirejs" | |||
|
|
6 | ] | |||
|
|
7 | }, | |||
|
|
8 | "include": [ | |||
|
|
9 | "ts/**/*.ts" | |||
|
|
10 | ] | |||
|
|
11 | } No newline at end of file | |||
| @@ -0,0 +1,6 | |||||
|
|
1 | { | |||
|
|
2 | "extends": "../tsconfig.json", | |||
|
|
3 | "include": [ | |||
|
|
4 | "ts/**/*.ts" | |||
|
|
5 | ] | |||
|
|
6 | } No newline at end of file | |||
| @@ -1,111 +1,110 | |||||
| 1 | if (release != 'rtm') { |
|
1 | if (release != 'rtm') { | |
| 2 | version += "-$release" |
|
2 | version += "-$release" | |
| 3 | } |
|
3 | } | |
| 4 |
|
4 | |||
| 5 | if(!npmName) |
|
5 | if(!npmName) | |
| 6 | npmName = name; |
|
6 | npmName = name; | |
| 7 |
|
7 | |||
| 8 | ext.packageName="$npmScope/$npmName"; |
|
8 | ext.packageName="$npmScope/$npmName"; | |
| 9 |
|
9 | |||
| 10 | def packageDir = "$buildDir/dist" |
|
10 | def packageDir = "$buildDir/dist" | |
| 11 | def distDir = "$packageDir/$platform" |
|
11 | def distDir = "$packageDir/$platform" | |
| 12 | def testDir = "$packageDir/$platform" |
|
12 | def testDir = "$packageDir/$platform" | |
| 13 |
|
13 | |||
| 14 | task printVersion { |
|
14 | task printVersion { | |
| 15 | doLast { |
|
15 | doLast { | |
| 16 | println "version: $version" |
|
16 | println "version: $version" | |
| 17 | println "packageName: $packageName" |
|
17 | println "packageName: $packageName" | |
| 18 | println "platform: $platform" |
|
18 | println "platform: $platform" | |
| 19 | } |
|
19 | } | |
| 20 | } |
|
20 | } | |
| 21 |
|
21 | |||
| 22 |
|
22 | |||
| 23 | task clean { |
|
23 | task clean { | |
| 24 | doLast { |
|
24 | doLast { | |
| 25 | delete buildDir |
|
25 | delete buildDir | |
| 26 | delete "node_modules/$packageName" |
|
26 | delete "node_modules/$packageName" | |
| 27 | } |
|
27 | } | |
| 28 | } |
|
28 | } | |
| 29 |
|
29 | |||
| 30 | task cleanNpm { |
|
30 | task cleanNpm { | |
| 31 | doLast { |
|
31 | doLast { | |
| 32 | delete 'node_modules' |
|
32 | delete 'node_modules' | |
| 33 | } |
|
33 | } | |
| 34 | } |
|
34 | } | |
| 35 |
|
35 | |||
| 36 | task _npmInstall() { |
|
36 | task _npmInstall() { | |
| 37 | inputs.file("package.json") |
|
37 | inputs.file("package.json") | |
| 38 | outputs.dir("node_modules") |
|
38 | outputs.dir("node_modules") | |
| 39 | doLast { |
|
39 | doLast { | |
| 40 | exec { |
|
40 | exec { | |
| 41 | commandLine 'npm', 'install' |
|
41 | commandLine 'npm', 'install' | |
| 42 | } |
|
42 | } | |
| 43 | } |
|
43 | } | |
| 44 | } |
|
44 | } | |
| 45 |
|
45 | |||
| 46 | task _legacyJs(type:Copy) { |
|
46 | task _legacyJs(type:Copy) { | |
| 47 | from 'src/js/' |
|
47 | from 'src/main/js/' | |
| 48 | into distDir |
|
48 | into distDir | |
| 49 | } |
|
49 | } | |
| 50 |
|
50 | |||
| 51 | task _buildTs(dependsOn: _npmInstall, type:Exec) { |
|
51 | task _buildTs(dependsOn: _npmInstall, type:Exec) { | |
| 52 | inputs.dir('src/ts') |
|
52 | inputs.dir('src/main/ts') | |
| 53 | inputs.file('src/tsconfig.json') |
|
53 | inputs.file('src/tsconfig.json') | |
|
|
54 | inputs.file('src/main/tsconfig.json') | |||
| 54 | outputs.dir(distDir) |
|
55 | outputs.dir(distDir) | |
| 55 |
|
56 | |||
| 56 | commandLine 'node_modules/.bin/tsc', |
|
57 | commandLine 'node_modules/.bin/tsc', | |
| 57 | '-p', 'src/tsconfig.json', |
|
58 | '-p', 'src/main/tsconfig.json', | |
| 58 |
'--outDir', distDir |
|
59 | '--outDir', distDir | |
| 59 | '--listFiles', |
|
|||
| 60 | '--traceResolution' |
|
|||
| 61 | } |
|
60 | } | |
| 62 |
|
61 | |||
| 63 | task _packageMeta(type: Copy) { |
|
62 | task _packageMeta(type: Copy) { | |
| 64 | inputs.property("version", version) |
|
63 | inputs.property("version", version) | |
| 65 | from('.') { |
|
64 | from('.') { | |
| 66 | include 'package.json', '.npmignore', 'readme.md', 'license', 'history.md' |
|
65 | include 'package.json', '.npmignore', 'readme.md', 'license', 'history.md' | |
| 67 | } |
|
66 | } | |
| 68 | into distDir |
|
67 | into distDir | |
| 69 | doLast { |
|
68 | doLast { | |
| 70 | exec { |
|
69 | exec { | |
| 71 | workingDir distDir |
|
70 | workingDir distDir | |
| 72 | commandLine 'npm', 'version', version |
|
71 | commandLine 'npm', 'version', version | |
| 73 | } |
|
72 | } | |
| 74 | } |
|
73 | } | |
| 75 | } |
|
74 | } | |
| 76 |
|
75 | |||
| 77 | task build(dependsOn: [_legacyJs, _npmInstall, _buildTs, _packageMeta]) { |
|
76 | task build(dependsOn: [_legacyJs, _npmInstall, _buildTs, _packageMeta]) { | |
| 78 |
|
77 | |||
| 79 | } |
|
78 | } | |
| 80 |
|
79 | |||
| 81 | task _localInstall(dependsOn: build, type: Exec) { |
|
80 | task _localInstall(dependsOn: build, type: Exec) { | |
| 82 | inputs.file("$distDir/package.json") |
|
81 | inputs.file("$distDir/package.json") | |
| 83 | outputs.upToDateWhen { |
|
82 | outputs.upToDateWhen { | |
| 84 | new File("$projectDir/node_modules/$packageName").exists() |
|
83 | new File("$projectDir/node_modules/$packageName").exists() | |
| 85 | } |
|
84 | } | |
| 86 |
|
85 | |||
| 87 | commandLine 'npm', 'install', '--no-save', '--force', distDir |
|
86 | commandLine 'npm', 'install', '--no-save', '--force', distDir | |
| 88 | } |
|
87 | } | |
| 89 |
|
88 | |||
| 90 | task copyJsTests(type: Copy) { |
|
89 | task copyJsTests(type: Copy) { | |
| 91 | from 'test/js' |
|
90 | from 'test/js' | |
| 92 | into testDir |
|
91 | into testDir | |
| 93 | } |
|
92 | } | |
| 94 |
|
93 | |||
| 95 | task buildTests(dependsOn: _localInstall, type: Exec) { |
|
94 | task buildTests(dependsOn: _localInstall, type: Exec) { | |
| 96 | inputs.dir('test/ts') |
|
95 | inputs.dir('test/ts') | |
| 97 | inputs.file('test/tsconfig.json') |
|
96 | inputs.file('test/tsconfig.json') | |
| 98 | outputs.dir(testDir) |
|
97 | outputs.dir(testDir) | |
| 99 |
|
98 | |||
| 100 | commandLine 'node_modules/.bin/tsc', '-p', 'test/tsconfig.json', '--outDir', distDir |
|
99 | commandLine 'node_modules/.bin/tsc', '-p', 'test/tsconfig.json', '--outDir', distDir | |
| 101 | } |
|
100 | } | |
| 102 |
|
101 | |||
| 103 | task test(dependsOn: [copyJsTests, buildTests], type: Exec) { |
|
102 | task test(dependsOn: [copyJsTests, buildTests], type: Exec) { | |
| 104 | commandLine 'node', 'run-amd-tests.js' |
|
103 | commandLine 'node', 'run-amd-tests.js' | |
| 105 | } |
|
104 | } | |
| 106 |
|
105 | |||
| 107 | task pack(dependsOn: build, type: Exec) { |
|
106 | task pack(dependsOn: build, type: Exec) { | |
| 108 | workingDir = distDir |
|
107 | workingDir = distDir | |
| 109 |
|
108 | |||
| 110 | commandLine 'npm', 'pack' |
|
109 | commandLine 'npm', 'pack' | |
| 111 | } No newline at end of file |
|
110 | } | |
| @@ -1,450 +1,456 | |||||
| 1 | { |
|
1 | { | |
| 2 | "name": "@implab/core", |
|
2 | "name": "@implab/core", | |
| 3 | "version": "0.0.1-dev", |
|
3 | "version": "0.0.1-dev", | |
| 4 | "lockfileVersion": 1, |
|
4 | "lockfileVersion": 1, | |
| 5 | "requires": true, |
|
5 | "requires": true, | |
| 6 | "dependencies": { |
|
6 | "dependencies": { | |
| 7 | "@types/node": { |
|
7 | "@types/node": { | |
| 8 | "version": "10.12.12", |
|
8 | "version": "10.12.12", | |
| 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.12.tgz", |
|
9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.12.tgz", | |
| 10 | "integrity": "sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A==", |
|
10 | "integrity": "sha512-Pr+6JRiKkfsFvmU/LK68oBRCQeEg36TyAbPhc2xpez24OOZZCuoIhWGTd39VZy6nGafSbxzGouFPTFD/rR1A0A==", | |
| 11 | "dev": true |
|
11 | "dev": true | |
| 12 | }, |
|
12 | }, | |
|
|
13 | "@types/requirejs": { | |||
|
|
14 | "version": "2.1.31", | |||
|
|
15 | "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz", | |||
|
|
16 | "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==", | |||
|
|
17 | "dev": true | |||
|
|
18 | }, | |||
| 13 | "@types/tape": { |
|
19 | "@types/tape": { | |
| 14 | "version": "4.2.32", |
|
20 | "version": "4.2.32", | |
| 15 | "resolved": "http://registry.npmjs.org/@types/tape/-/tape-4.2.32.tgz", |
|
21 | "resolved": "http://registry.npmjs.org/@types/tape/-/tape-4.2.32.tgz", | |
| 16 | "integrity": "sha512-xil0KO5wkPoixdBWGIGolPv9dekf6dVkjjJLAFYchfKcd4DICou67rgGCIO7wAh3i5Ff/6j9IDgZz+GU9cMaqQ==", |
|
22 | "integrity": "sha512-xil0KO5wkPoixdBWGIGolPv9dekf6dVkjjJLAFYchfKcd4DICou67rgGCIO7wAh3i5Ff/6j9IDgZz+GU9cMaqQ==", | |
| 17 | "dev": true, |
|
23 | "dev": true, | |
| 18 | "requires": { |
|
24 | "requires": { | |
| 19 | "@types/node": "*" |
|
25 | "@types/node": "*" | |
| 20 | } |
|
26 | } | |
| 21 | }, |
|
27 | }, | |
| 22 | "balanced-match": { |
|
28 | "balanced-match": { | |
| 23 | "version": "1.0.0", |
|
29 | "version": "1.0.0", | |
| 24 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", |
|
30 | "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", | |
| 25 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", |
|
31 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", | |
| 26 | "dev": true |
|
32 | "dev": true | |
| 27 | }, |
|
33 | }, | |
| 28 | "brace-expansion": { |
|
34 | "brace-expansion": { | |
| 29 | "version": "1.1.11", |
|
35 | "version": "1.1.11", | |
| 30 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", |
|
36 | "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", | |
| 31 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", |
|
37 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", | |
| 32 | "dev": true, |
|
38 | "dev": true, | |
| 33 | "requires": { |
|
39 | "requires": { | |
| 34 | "balanced-match": "^1.0.0", |
|
40 | "balanced-match": "^1.0.0", | |
| 35 | "concat-map": "0.0.1" |
|
41 | "concat-map": "0.0.1" | |
| 36 | } |
|
42 | } | |
| 37 | }, |
|
43 | }, | |
| 38 | "concat-map": { |
|
44 | "concat-map": { | |
| 39 | "version": "0.0.1", |
|
45 | "version": "0.0.1", | |
| 40 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", |
|
46 | "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", | |
| 41 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", |
|
47 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", | |
| 42 | "dev": true |
|
48 | "dev": true | |
| 43 | }, |
|
49 | }, | |
| 44 | "core-util-is": { |
|
50 | "core-util-is": { | |
| 45 | "version": "1.0.2", |
|
51 | "version": "1.0.2", | |
| 46 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", |
|
52 | "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", | |
| 47 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", |
|
53 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", | |
| 48 | "dev": true |
|
54 | "dev": true | |
| 49 | }, |
|
55 | }, | |
| 50 | "deep-equal": { |
|
56 | "deep-equal": { | |
| 51 | "version": "0.1.2", |
|
57 | "version": "0.1.2", | |
| 52 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.1.2.tgz", |
|
58 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-0.1.2.tgz", | |
| 53 | "integrity": "sha1-skbCuApXCkfBG+HZvRBw7IeLh84=", |
|
59 | "integrity": "sha1-skbCuApXCkfBG+HZvRBw7IeLh84=", | |
| 54 | "dev": true |
|
60 | "dev": true | |
| 55 | }, |
|
61 | }, | |
| 56 | "define-properties": { |
|
62 | "define-properties": { | |
| 57 | "version": "1.1.3", |
|
63 | "version": "1.1.3", | |
| 58 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", |
|
64 | "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", | |
| 59 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", |
|
65 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", | |
| 60 | "dev": true, |
|
66 | "dev": true, | |
| 61 | "requires": { |
|
67 | "requires": { | |
| 62 | "object-keys": "^1.0.12" |
|
68 | "object-keys": "^1.0.12" | |
| 63 | }, |
|
69 | }, | |
| 64 | "dependencies": { |
|
70 | "dependencies": { | |
| 65 | "object-keys": { |
|
71 | "object-keys": { | |
| 66 | "version": "1.0.12", |
|
72 | "version": "1.0.12", | |
| 67 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", |
|
73 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", | |
| 68 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", |
|
74 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", | |
| 69 | "dev": true |
|
75 | "dev": true | |
| 70 | } |
|
76 | } | |
| 71 | } |
|
77 | } | |
| 72 | }, |
|
78 | }, | |
| 73 | "defined": { |
|
79 | "defined": { | |
| 74 | "version": "0.0.0", |
|
80 | "version": "0.0.0", | |
| 75 | "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", |
|
81 | "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", | |
| 76 | "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", |
|
82 | "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", | |
| 77 | "dev": true |
|
83 | "dev": true | |
| 78 | }, |
|
84 | }, | |
| 79 | "dojo": { |
|
85 | "dojo": { | |
| 80 | "version": "1.14.2", |
|
86 | "version": "1.14.2", | |
| 81 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.14.2.tgz", |
|
87 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.14.2.tgz", | |
| 82 | "integrity": "sha512-TI+Ytgfh/VfmHWERp45Jte6NFMdoJTPsvUP/uzJUvAXET8FP2h442LePWWJ/q/xZ4V0V8OtdJhx8It/GB+Zbxg==", |
|
88 | "integrity": "sha512-TI+Ytgfh/VfmHWERp45Jte6NFMdoJTPsvUP/uzJUvAXET8FP2h442LePWWJ/q/xZ4V0V8OtdJhx8It/GB+Zbxg==", | |
| 83 | "dev": true |
|
89 | "dev": true | |
| 84 | }, |
|
90 | }, | |
| 85 | "duplexer": { |
|
91 | "duplexer": { | |
| 86 | "version": "0.1.1", |
|
92 | "version": "0.1.1", | |
| 87 |
"resolved": "http |
|
93 | "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", | |
| 88 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", |
|
94 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", | |
| 89 | "dev": true |
|
95 | "dev": true | |
| 90 | }, |
|
96 | }, | |
| 91 | "es-abstract": { |
|
97 | "es-abstract": { | |
| 92 | "version": "1.12.0", |
|
98 | "version": "1.12.0", | |
| 93 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", |
|
99 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.12.0.tgz", | |
| 94 | "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", |
|
100 | "integrity": "sha512-C8Fx/0jFmV5IPoMOFPA9P9G5NtqW+4cOPit3MIuvR2t7Ag2K15EJTpxnHAYTzL+aYQJIESYeXZmDBfOBE1HcpA==", | |
| 95 | "dev": true, |
|
101 | "dev": true, | |
| 96 | "requires": { |
|
102 | "requires": { | |
| 97 | "es-to-primitive": "^1.1.1", |
|
103 | "es-to-primitive": "^1.1.1", | |
| 98 | "function-bind": "^1.1.1", |
|
104 | "function-bind": "^1.1.1", | |
| 99 | "has": "^1.0.1", |
|
105 | "has": "^1.0.1", | |
| 100 | "is-callable": "^1.1.3", |
|
106 | "is-callable": "^1.1.3", | |
| 101 | "is-regex": "^1.0.4" |
|
107 | "is-regex": "^1.0.4" | |
| 102 | } |
|
108 | } | |
| 103 | }, |
|
109 | }, | |
| 104 | "es-to-primitive": { |
|
110 | "es-to-primitive": { | |
| 105 | "version": "1.2.0", |
|
111 | "version": "1.2.0", | |
| 106 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", |
|
112 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", | |
| 107 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", |
|
113 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", | |
| 108 | "dev": true, |
|
114 | "dev": true, | |
| 109 | "requires": { |
|
115 | "requires": { | |
| 110 | "is-callable": "^1.1.4", |
|
116 | "is-callable": "^1.1.4", | |
| 111 | "is-date-object": "^1.0.1", |
|
117 | "is-date-object": "^1.0.1", | |
| 112 | "is-symbol": "^1.0.2" |
|
118 | "is-symbol": "^1.0.2" | |
| 113 | } |
|
119 | } | |
| 114 | }, |
|
120 | }, | |
| 115 | "faucet": { |
|
121 | "faucet": { | |
| 116 | "version": "0.0.1", |
|
122 | "version": "0.0.1", | |
| 117 | "resolved": "https://registry.npmjs.org/faucet/-/faucet-0.0.1.tgz", |
|
123 | "resolved": "https://registry.npmjs.org/faucet/-/faucet-0.0.1.tgz", | |
| 118 | "integrity": "sha1-WX3PHSGJosBiMhtZHo8VHtIDnZw=", |
|
124 | "integrity": "sha1-WX3PHSGJosBiMhtZHo8VHtIDnZw=", | |
| 119 | "dev": true, |
|
125 | "dev": true, | |
| 120 | "requires": { |
|
126 | "requires": { | |
| 121 | "defined": "0.0.0", |
|
127 | "defined": "0.0.0", | |
| 122 | "duplexer": "~0.1.1", |
|
128 | "duplexer": "~0.1.1", | |
| 123 | "minimist": "0.0.5", |
|
129 | "minimist": "0.0.5", | |
| 124 | "sprintf": "~0.1.3", |
|
130 | "sprintf": "~0.1.3", | |
| 125 | "tap-parser": "~0.4.0", |
|
131 | "tap-parser": "~0.4.0", | |
| 126 | "tape": "~2.3.2", |
|
132 | "tape": "~2.3.2", | |
| 127 | "through2": "~0.2.3" |
|
133 | "through2": "~0.2.3" | |
| 128 | }, |
|
134 | }, | |
| 129 | "dependencies": { |
|
135 | "dependencies": { | |
| 130 | "tape": { |
|
136 | "tape": { | |
| 131 | "version": "2.3.3", |
|
137 | "version": "2.3.3", | |
| 132 |
"resolved": "http |
|
138 | "resolved": "http://registry.npmjs.org/tape/-/tape-2.3.3.tgz", | |
| 133 | "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=", |
|
139 | "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=", | |
| 134 | "dev": true, |
|
140 | "dev": true, | |
| 135 | "requires": { |
|
141 | "requires": { | |
| 136 | "deep-equal": "~0.1.0", |
|
142 | "deep-equal": "~0.1.0", | |
| 137 | "defined": "~0.0.0", |
|
143 | "defined": "~0.0.0", | |
| 138 | "inherits": "~2.0.1", |
|
144 | "inherits": "~2.0.1", | |
| 139 | "jsonify": "~0.0.0", |
|
145 | "jsonify": "~0.0.0", | |
| 140 | "resumer": "~0.0.0", |
|
146 | "resumer": "~0.0.0", | |
| 141 | "through": "~2.3.4" |
|
147 | "through": "~2.3.4" | |
| 142 | } |
|
148 | } | |
| 143 | } |
|
149 | } | |
| 144 | } |
|
150 | } | |
| 145 | }, |
|
151 | }, | |
| 146 | "for-each": { |
|
152 | "for-each": { | |
| 147 | "version": "0.3.3", |
|
153 | "version": "0.3.3", | |
| 148 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", |
|
154 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", | |
| 149 | "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", |
|
155 | "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", | |
| 150 | "dev": true, |
|
156 | "dev": true, | |
| 151 | "requires": { |
|
157 | "requires": { | |
| 152 | "is-callable": "^1.1.3" |
|
158 | "is-callable": "^1.1.3" | |
| 153 | } |
|
159 | } | |
| 154 | }, |
|
160 | }, | |
| 155 | "fs.realpath": { |
|
161 | "fs.realpath": { | |
| 156 | "version": "1.0.0", |
|
162 | "version": "1.0.0", | |
| 157 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", |
|
163 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", | |
| 158 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", |
|
164 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", | |
| 159 | "dev": true |
|
165 | "dev": true | |
| 160 | }, |
|
166 | }, | |
| 161 | "function-bind": { |
|
167 | "function-bind": { | |
| 162 | "version": "1.1.1", |
|
168 | "version": "1.1.1", | |
| 163 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", |
|
169 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", | |
| 164 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", |
|
170 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", | |
| 165 | "dev": true |
|
171 | "dev": true | |
| 166 | }, |
|
172 | }, | |
| 167 | "glob": { |
|
173 | "glob": { | |
| 168 | "version": "7.1.3", |
|
174 | "version": "7.1.3", | |
| 169 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", |
|
175 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", | |
| 170 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", |
|
176 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", | |
| 171 | "dev": true, |
|
177 | "dev": true, | |
| 172 | "requires": { |
|
178 | "requires": { | |
| 173 | "fs.realpath": "^1.0.0", |
|
179 | "fs.realpath": "^1.0.0", | |
| 174 | "inflight": "^1.0.4", |
|
180 | "inflight": "^1.0.4", | |
| 175 | "inherits": "2", |
|
181 | "inherits": "2", | |
| 176 | "minimatch": "^3.0.4", |
|
182 | "minimatch": "^3.0.4", | |
| 177 | "once": "^1.3.0", |
|
183 | "once": "^1.3.0", | |
| 178 | "path-is-absolute": "^1.0.0" |
|
184 | "path-is-absolute": "^1.0.0" | |
| 179 | } |
|
185 | } | |
| 180 | }, |
|
186 | }, | |
| 181 | "has": { |
|
187 | "has": { | |
| 182 | "version": "1.0.3", |
|
188 | "version": "1.0.3", | |
| 183 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", |
|
189 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", | |
| 184 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", |
|
190 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", | |
| 185 | "dev": true, |
|
191 | "dev": true, | |
| 186 | "requires": { |
|
192 | "requires": { | |
| 187 | "function-bind": "^1.1.1" |
|
193 | "function-bind": "^1.1.1" | |
| 188 | } |
|
194 | } | |
| 189 | }, |
|
195 | }, | |
| 190 | "has-symbols": { |
|
196 | "has-symbols": { | |
| 191 | "version": "1.0.0", |
|
197 | "version": "1.0.0", | |
| 192 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", |
|
198 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", | |
| 193 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", |
|
199 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", | |
| 194 | "dev": true |
|
200 | "dev": true | |
| 195 | }, |
|
201 | }, | |
| 196 | "inflight": { |
|
202 | "inflight": { | |
| 197 | "version": "1.0.6", |
|
203 | "version": "1.0.6", | |
| 198 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", |
|
204 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", | |
| 199 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", |
|
205 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", | |
| 200 | "dev": true, |
|
206 | "dev": true, | |
| 201 | "requires": { |
|
207 | "requires": { | |
| 202 | "once": "^1.3.0", |
|
208 | "once": "^1.3.0", | |
| 203 | "wrappy": "1" |
|
209 | "wrappy": "1" | |
| 204 | } |
|
210 | } | |
| 205 | }, |
|
211 | }, | |
| 206 | "inherits": { |
|
212 | "inherits": { | |
| 207 | "version": "2.0.3", |
|
213 | "version": "2.0.3", | |
| 208 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", |
|
214 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", | |
| 209 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", |
|
215 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", | |
| 210 | "dev": true |
|
216 | "dev": true | |
| 211 | }, |
|
217 | }, | |
| 212 | "is-callable": { |
|
218 | "is-callable": { | |
| 213 | "version": "1.1.4", |
|
219 | "version": "1.1.4", | |
| 214 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", |
|
220 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", | |
| 215 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", |
|
221 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", | |
| 216 | "dev": true |
|
222 | "dev": true | |
| 217 | }, |
|
223 | }, | |
| 218 | "is-date-object": { |
|
224 | "is-date-object": { | |
| 219 | "version": "1.0.1", |
|
225 | "version": "1.0.1", | |
| 220 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", |
|
226 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", | |
| 221 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", |
|
227 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", | |
| 222 | "dev": true |
|
228 | "dev": true | |
| 223 | }, |
|
229 | }, | |
| 224 | "is-regex": { |
|
230 | "is-regex": { | |
| 225 | "version": "1.0.4", |
|
231 | "version": "1.0.4", | |
| 226 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", |
|
232 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", | |
| 227 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", |
|
233 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", | |
| 228 | "dev": true, |
|
234 | "dev": true, | |
| 229 | "requires": { |
|
235 | "requires": { | |
| 230 | "has": "^1.0.1" |
|
236 | "has": "^1.0.1" | |
| 231 | } |
|
237 | } | |
| 232 | }, |
|
238 | }, | |
| 233 | "is-symbol": { |
|
239 | "is-symbol": { | |
| 234 | "version": "1.0.2", |
|
240 | "version": "1.0.2", | |
| 235 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", |
|
241 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", | |
| 236 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", |
|
242 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", | |
| 237 | "dev": true, |
|
243 | "dev": true, | |
| 238 | "requires": { |
|
244 | "requires": { | |
| 239 | "has-symbols": "^1.0.0" |
|
245 | "has-symbols": "^1.0.0" | |
| 240 | } |
|
246 | } | |
| 241 | }, |
|
247 | }, | |
| 242 | "isarray": { |
|
248 | "isarray": { | |
| 243 | "version": "0.0.1", |
|
249 | "version": "0.0.1", | |
| 244 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", |
|
250 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", | |
| 245 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", |
|
251 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", | |
| 246 | "dev": true |
|
252 | "dev": true | |
| 247 | }, |
|
253 | }, | |
| 248 | "jsonify": { |
|
254 | "jsonify": { | |
| 249 | "version": "0.0.0", |
|
255 | "version": "0.0.0", | |
| 250 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", |
|
256 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", | |
| 251 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", |
|
257 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", | |
| 252 | "dev": true |
|
258 | "dev": true | |
| 253 | }, |
|
259 | }, | |
| 254 | "minimatch": { |
|
260 | "minimatch": { | |
| 255 | "version": "3.0.4", |
|
261 | "version": "3.0.4", | |
| 256 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", |
|
262 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", | |
| 257 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", |
|
263 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", | |
| 258 | "dev": true, |
|
264 | "dev": true, | |
| 259 | "requires": { |
|
265 | "requires": { | |
| 260 | "brace-expansion": "^1.1.7" |
|
266 | "brace-expansion": "^1.1.7" | |
| 261 | } |
|
267 | } | |
| 262 | }, |
|
268 | }, | |
| 263 | "minimist": { |
|
269 | "minimist": { | |
| 264 | "version": "0.0.5", |
|
270 | "version": "0.0.5", | |
| 265 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", |
|
271 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", | |
| 266 | "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", |
|
272 | "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", | |
| 267 | "dev": true |
|
273 | "dev": true | |
| 268 | }, |
|
274 | }, | |
| 269 | "object-inspect": { |
|
275 | "object-inspect": { | |
| 270 | "version": "1.6.0", |
|
276 | "version": "1.6.0", | |
| 271 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", |
|
277 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", | |
| 272 | "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", |
|
278 | "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", | |
| 273 | "dev": true |
|
279 | "dev": true | |
| 274 | }, |
|
280 | }, | |
| 275 | "object-keys": { |
|
281 | "object-keys": { | |
| 276 | "version": "0.4.0", |
|
282 | "version": "0.4.0", | |
| 277 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", |
|
283 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", | |
| 278 | "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", |
|
284 | "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", | |
| 279 | "dev": true |
|
285 | "dev": true | |
| 280 | }, |
|
286 | }, | |
| 281 | "once": { |
|
287 | "once": { | |
| 282 | "version": "1.4.0", |
|
288 | "version": "1.4.0", | |
| 283 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
|
289 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", | |
| 284 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", |
|
290 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", | |
| 285 | "dev": true, |
|
291 | "dev": true, | |
| 286 | "requires": { |
|
292 | "requires": { | |
| 287 | "wrappy": "1" |
|
293 | "wrappy": "1" | |
| 288 | } |
|
294 | } | |
| 289 | }, |
|
295 | }, | |
| 290 | "path-is-absolute": { |
|
296 | "path-is-absolute": { | |
| 291 | "version": "1.0.1", |
|
297 | "version": "1.0.1", | |
| 292 |
"resolved": "http |
|
298 | "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", | |
| 293 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |
|
299 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", | |
| 294 | "dev": true |
|
300 | "dev": true | |
| 295 | }, |
|
301 | }, | |
| 296 | "path-parse": { |
|
302 | "path-parse": { | |
| 297 | "version": "1.0.6", |
|
303 | "version": "1.0.6", | |
| 298 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", |
|
304 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", | |
| 299 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", |
|
305 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", | |
| 300 | "dev": true |
|
306 | "dev": true | |
| 301 | }, |
|
307 | }, | |
| 302 | "readable-stream": { |
|
308 | "readable-stream": { | |
| 303 | "version": "1.1.14", |
|
309 | "version": "1.1.14", | |
| 304 |
"resolved": "http |
|
310 | "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", | |
| 305 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", |
|
311 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", | |
| 306 | "dev": true, |
|
312 | "dev": true, | |
| 307 | "requires": { |
|
313 | "requires": { | |
| 308 | "core-util-is": "~1.0.0", |
|
314 | "core-util-is": "~1.0.0", | |
| 309 | "inherits": "~2.0.1", |
|
315 | "inherits": "~2.0.1", | |
| 310 | "isarray": "0.0.1", |
|
316 | "isarray": "0.0.1", | |
| 311 | "string_decoder": "~0.10.x" |
|
317 | "string_decoder": "~0.10.x" | |
| 312 | } |
|
318 | } | |
| 313 | }, |
|
319 | }, | |
| 314 | "requirejs": { |
|
320 | "requirejs": { | |
| 315 | "version": "2.3.6", |
|
321 | "version": "2.3.6", | |
| 316 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", |
|
322 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", | |
| 317 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", |
|
323 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", | |
| 318 | "dev": true |
|
324 | "dev": true | |
| 319 | }, |
|
325 | }, | |
| 320 | "resolve": { |
|
326 | "resolve": { | |
| 321 | "version": "1.7.1", |
|
327 | "version": "1.7.1", | |
| 322 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", |
|
328 | "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", | |
| 323 | "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", |
|
329 | "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", | |
| 324 | "dev": true, |
|
330 | "dev": true, | |
| 325 | "requires": { |
|
331 | "requires": { | |
| 326 | "path-parse": "^1.0.5" |
|
332 | "path-parse": "^1.0.5" | |
| 327 | } |
|
333 | } | |
| 328 | }, |
|
334 | }, | |
| 329 | "resumer": { |
|
335 | "resumer": { | |
| 330 | "version": "0.0.0", |
|
336 | "version": "0.0.0", | |
| 331 | "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", |
|
337 | "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", | |
| 332 | "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", |
|
338 | "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", | |
| 333 | "dev": true, |
|
339 | "dev": true, | |
| 334 | "requires": { |
|
340 | "requires": { | |
| 335 | "through": "~2.3.4" |
|
341 | "through": "~2.3.4" | |
| 336 | } |
|
342 | } | |
| 337 | }, |
|
343 | }, | |
| 338 | "sprintf": { |
|
344 | "sprintf": { | |
| 339 | "version": "0.1.5", |
|
345 | "version": "0.1.5", | |
| 340 | "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz", |
|
346 | "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz", | |
| 341 | "integrity": "sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8=", |
|
347 | "integrity": "sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8=", | |
| 342 | "dev": true |
|
348 | "dev": true | |
| 343 | }, |
|
349 | }, | |
| 344 | "string.prototype.trim": { |
|
350 | "string.prototype.trim": { | |
| 345 | "version": "1.1.2", |
|
351 | "version": "1.1.2", | |
| 346 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", |
|
352 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", | |
| 347 | "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", |
|
353 | "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", | |
| 348 | "dev": true, |
|
354 | "dev": true, | |
| 349 | "requires": { |
|
355 | "requires": { | |
| 350 | "define-properties": "^1.1.2", |
|
356 | "define-properties": "^1.1.2", | |
| 351 | "es-abstract": "^1.5.0", |
|
357 | "es-abstract": "^1.5.0", | |
| 352 | "function-bind": "^1.0.2" |
|
358 | "function-bind": "^1.0.2" | |
| 353 | } |
|
359 | } | |
| 354 | }, |
|
360 | }, | |
| 355 | "string_decoder": { |
|
361 | "string_decoder": { | |
| 356 | "version": "0.10.31", |
|
362 | "version": "0.10.31", | |
| 357 |
"resolved": "http |
|
363 | "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", | |
| 358 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", |
|
364 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", | |
| 359 | "dev": true |
|
365 | "dev": true | |
| 360 | }, |
|
366 | }, | |
| 361 | "tap-parser": { |
|
367 | "tap-parser": { | |
| 362 | "version": "0.4.3", |
|
368 | "version": "0.4.3", | |
| 363 | "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.4.3.tgz", |
|
369 | "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.4.3.tgz", | |
| 364 | "integrity": "sha1-pOrhkMENdsehEZIf84u+TVjwnuo=", |
|
370 | "integrity": "sha1-pOrhkMENdsehEZIf84u+TVjwnuo=", | |
| 365 | "dev": true, |
|
371 | "dev": true, | |
| 366 | "requires": { |
|
372 | "requires": { | |
| 367 | "inherits": "~2.0.1", |
|
373 | "inherits": "~2.0.1", | |
| 368 | "readable-stream": "~1.1.11" |
|
374 | "readable-stream": "~1.1.11" | |
| 369 | } |
|
375 | } | |
| 370 | }, |
|
376 | }, | |
| 371 | "tape": { |
|
377 | "tape": { | |
| 372 | "version": "4.9.1", |
|
378 | "version": "4.9.1", | |
| 373 | "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", |
|
379 | "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.1.tgz", | |
| 374 | "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", |
|
380 | "integrity": "sha512-6fKIXknLpoe/Jp4rzHKFPpJUHDHDqn8jus99IfPnHIjyz78HYlefTGD3b5EkbQzuLfaEvmfPK3IolLgq2xT3kw==", | |
| 375 | "dev": true, |
|
381 | "dev": true, | |
| 376 | "requires": { |
|
382 | "requires": { | |
| 377 | "deep-equal": "~1.0.1", |
|
383 | "deep-equal": "~1.0.1", | |
| 378 | "defined": "~1.0.0", |
|
384 | "defined": "~1.0.0", | |
| 379 | "for-each": "~0.3.3", |
|
385 | "for-each": "~0.3.3", | |
| 380 | "function-bind": "~1.1.1", |
|
386 | "function-bind": "~1.1.1", | |
| 381 | "glob": "~7.1.2", |
|
387 | "glob": "~7.1.2", | |
| 382 | "has": "~1.0.3", |
|
388 | "has": "~1.0.3", | |
| 383 | "inherits": "~2.0.3", |
|
389 | "inherits": "~2.0.3", | |
| 384 | "minimist": "~1.2.0", |
|
390 | "minimist": "~1.2.0", | |
| 385 | "object-inspect": "~1.6.0", |
|
391 | "object-inspect": "~1.6.0", | |
| 386 | "resolve": "~1.7.1", |
|
392 | "resolve": "~1.7.1", | |
| 387 | "resumer": "~0.0.0", |
|
393 | "resumer": "~0.0.0", | |
| 388 | "string.prototype.trim": "~1.1.2", |
|
394 | "string.prototype.trim": "~1.1.2", | |
| 389 | "through": "~2.3.8" |
|
395 | "through": "~2.3.8" | |
| 390 | }, |
|
396 | }, | |
| 391 | "dependencies": { |
|
397 | "dependencies": { | |
| 392 | "deep-equal": { |
|
398 | "deep-equal": { | |
| 393 | "version": "1.0.1", |
|
399 | "version": "1.0.1", | |
| 394 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", |
|
400 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", | |
| 395 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", |
|
401 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", | |
| 396 | "dev": true |
|
402 | "dev": true | |
| 397 | }, |
|
403 | }, | |
| 398 | "defined": { |
|
404 | "defined": { | |
| 399 | "version": "1.0.0", |
|
405 | "version": "1.0.0", | |
| 400 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", |
|
406 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", | |
| 401 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", |
|
407 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", | |
| 402 | "dev": true |
|
408 | "dev": true | |
| 403 | }, |
|
409 | }, | |
| 404 | "minimist": { |
|
410 | "minimist": { | |
| 405 | "version": "1.2.0", |
|
411 | "version": "1.2.0", | |
| 406 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", |
|
412 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", | |
| 407 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", |
|
413 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", | |
| 408 | "dev": true |
|
414 | "dev": true | |
| 409 | } |
|
415 | } | |
| 410 | } |
|
416 | } | |
| 411 | }, |
|
417 | }, | |
| 412 | "through": { |
|
418 | "through": { | |
| 413 | "version": "2.3.8", |
|
419 | "version": "2.3.8", | |
| 414 |
"resolved": "http |
|
420 | "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", | |
| 415 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", |
|
421 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", | |
| 416 | "dev": true |
|
422 | "dev": true | |
| 417 | }, |
|
423 | }, | |
| 418 | "through2": { |
|
424 | "through2": { | |
| 419 | "version": "0.2.3", |
|
425 | "version": "0.2.3", | |
| 420 |
"resolved": "http |
|
426 | "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", | |
| 421 | "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", |
|
427 | "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", | |
| 422 | "dev": true, |
|
428 | "dev": true, | |
| 423 | "requires": { |
|
429 | "requires": { | |
| 424 | "readable-stream": "~1.1.9", |
|
430 | "readable-stream": "~1.1.9", | |
| 425 | "xtend": "~2.1.1" |
|
431 | "xtend": "~2.1.1" | |
| 426 | } |
|
432 | } | |
| 427 | }, |
|
433 | }, | |
| 428 | "typescript": { |
|
434 | "typescript": { | |
| 429 | "version": "3.2.1", |
|
435 | "version": "3.2.1", | |
| 430 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.1.tgz", |
|
436 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.1.tgz", | |
| 431 | "integrity": "sha512-jw7P2z/h6aPT4AENXDGjcfHTu5CSqzsbZc6YlUIebTyBAq8XaKp78x7VcSh30xwSCcsu5irZkYZUSFP1MrAMbg==", |
|
437 | "integrity": "sha512-jw7P2z/h6aPT4AENXDGjcfHTu5CSqzsbZc6YlUIebTyBAq8XaKp78x7VcSh30xwSCcsu5irZkYZUSFP1MrAMbg==", | |
| 432 | "dev": true |
|
438 | "dev": true | |
| 433 | }, |
|
439 | }, | |
| 434 | "wrappy": { |
|
440 | "wrappy": { | |
| 435 | "version": "1.0.2", |
|
441 | "version": "1.0.2", | |
| 436 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
|
442 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", | |
| 437 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", |
|
443 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", | |
| 438 | "dev": true |
|
444 | "dev": true | |
| 439 | }, |
|
445 | }, | |
| 440 | "xtend": { |
|
446 | "xtend": { | |
| 441 | "version": "2.1.2", |
|
447 | "version": "2.1.2", | |
| 442 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", |
|
448 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", | |
| 443 | "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", |
|
449 | "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", | |
| 444 | "dev": true, |
|
450 | "dev": true, | |
| 445 | "requires": { |
|
451 | "requires": { | |
| 446 | "object-keys": "~0.4.0" |
|
452 | "object-keys": "~0.4.0" | |
| 447 | } |
|
453 | } | |
| 448 | } |
|
454 | } | |
| 449 | } |
|
455 | } | |
| 450 | } |
|
456 | } | |
| @@ -1,31 +1,32 | |||||
| 1 | { |
|
1 | { | |
| 2 | "name": "@implab/core", |
|
2 | "name": "@implab/core", | |
| 3 | "version": "0.0.1-dev", |
|
3 | "version": "0.0.1-dev", | |
| 4 | "description": "Dependency injection, logging, simple and fast text template engine", |
|
4 | "description": "Dependency injection, logging, simple and fast text template engine", | |
| 5 | "main": "main.js", |
|
5 | "main": "main.js", | |
| 6 | "keywords": [ |
|
6 | "keywords": [ | |
| 7 | "di", |
|
7 | "di", | |
| 8 | "ioc", |
|
8 | "ioc", | |
| 9 | "logging", |
|
9 | "logging", | |
| 10 | "template engine", |
|
10 | "template engine", | |
| 11 | "dependency injection" |
|
11 | "dependency injection" | |
| 12 | ], |
|
12 | ], | |
| 13 | "author": "Implab team", |
|
13 | "author": "Implab team", | |
| 14 | "license": "BSD-2-Clause", |
|
14 | "license": "BSD-2-Clause", | |
| 15 | "repository": "https://bitbucket.org/implab/implabjs", |
|
15 | "repository": "https://bitbucket.org/implab/implabjs", | |
| 16 | "publishConfig": { |
|
16 | "publishConfig": { | |
| 17 | "access": "public" |
|
17 | "access": "public" | |
| 18 | }, |
|
18 | }, | |
| 19 | "peerDependencies": { |
|
19 | "peerDependencies": { | |
| 20 | "dojo": "^1.10.0" |
|
20 | "dojo": "^1.10.0" | |
| 21 | }, |
|
21 | }, | |
| 22 | "devDependencies": { |
|
22 | "devDependencies": { | |
| 23 | "typescript": "latest", |
|
23 | "typescript": "latest", | |
| 24 | "tape": "latest", |
|
24 | "tape": "latest", | |
| 25 | "@types/tape": "latest", |
|
25 | "@types/tape": "latest", | |
|
|
26 | "@types/requirejs": "latest", | |||
| 26 | "requirejs": "latest", |
|
27 | "requirejs": "latest", | |
| 27 | "faucet": "latest", |
|
28 | "faucet": "latest", | |
| 28 | "dojo": "^1.10.0" |
|
29 | "dojo": "^1.10.0" | |
| 29 | }, |
|
30 | }, | |
| 30 | "types": "main.d.ts" |
|
31 | "types": "main.d.ts" | |
| 31 | } |
|
32 | } | |
| @@ -1,46 +1,35 | |||||
| 1 | import { Uuid } from "../Uuid"; |
|
1 | import { Uuid } from "../Uuid"; | |
| 2 | import { argumentNotEmptyString } from "../safe"; |
|
2 | import { argumentNotEmptyString } from "../safe"; | |
| 3 | import { TraceSource } from "../log/TraceSource"; |
|
3 | import { TraceSource } from "../log/TraceSource"; | |
| 4 |
|
4 | |||
| 5 | export interface RequireFn { |
|
|||
| 6 | (module: string): any; |
|
|||
| 7 | (modules: string[], cb?: (...args: any[]) => any): void; |
|
|||
| 8 | } |
|
|||
| 9 |
|
||||
| 10 | declare const require: RequireFn; |
|
|||
| 11 |
|
||||
| 12 | export const rjs = require; |
|
5 | export const rjs = require; | |
| 13 |
|
6 | |||
| 14 | declare function define(name: string, modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void; |
|
7 | declare function define(name: string, modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void; | |
| 15 | declare function define(modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void; |
|
8 | declare function define(modules: string[], cb?: (...args: any[]) => any, eb?: (e) => any): void; | |
| 16 |
|
9 | |||
| 17 | interface RequireJsResolverParams { |
|
|||
| 18 | contextRequire: RequireFn; |
|
|||
| 19 | } |
|
|||
| 20 |
|
||||
| 21 | const trace = TraceSource.get("@implab/core/di/RequireJsHelper"); |
|
10 | const trace = TraceSource.get("@implab/core/di/RequireJsHelper"); | |
| 22 |
|
11 | |||
| 23 |
export async function createContextRequire(moduleName: string): Promise<Require |
|
12 | export async function createContextRequire(moduleName: string): Promise<Require> { | |
| 24 | argumentNotEmptyString(moduleName, "moduleName"); |
|
13 | argumentNotEmptyString(moduleName, "moduleName"); | |
| 25 |
|
14 | |||
| 26 | const parts = moduleName.split("/"); |
|
15 | const parts = moduleName.split("/"); | |
| 27 | if (parts[0] === ".") |
|
16 | if (parts[0] === ".") | |
| 28 | throw new Error("An absolute module path is required"); |
|
17 | throw new Error("An absolute module path is required"); | |
| 29 |
|
18 | |||
| 30 | if (parts.length > 1) |
|
19 | if (parts.length > 1) | |
| 31 | parts.splice(-1, 1, Uuid()); |
|
20 | parts.splice(-1, 1, Uuid()); | |
| 32 | else |
|
21 | else | |
| 33 | parts.push(Uuid()); |
|
22 | parts.push(Uuid()); | |
| 34 |
|
23 | |||
| 35 | const shim = parts.join("/"); |
|
24 | const shim = parts.join("/"); | |
| 36 |
|
25 | |||
| 37 | trace.debug(`define shim ${shim}`); |
|
26 | trace.debug(`define shim ${shim}`); | |
| 38 |
|
27 | |||
| 39 |
return new Promise<Require |
|
28 | return new Promise<Require>(fulfill => { | |
| 40 | define(shim, ["require"], r => { |
|
29 | define(shim, ["require"], r => { | |
| 41 | trace.debug("shim resolved"); |
|
30 | trace.debug("shim resolved"); | |
| 42 | return r; |
|
31 | return r; | |
| 43 | }); |
|
32 | }); | |
| 44 | require([shim], fulfill); |
|
33 | require([shim], fulfill); | |
| 45 | }); |
|
34 | }); | |
| 46 | } |
|
35 | } | |
| 1 | NO CONTENT: file renamed from src/js/Uri.js to src/main/js/Uri.js |
|
NO CONTENT: file renamed from src/js/Uri.js to src/main/js/Uri.js |
| 1 | NO CONTENT: file renamed from src/js/data/DataContext.js to src/main/js/data/DataContext.js |
|
NO CONTENT: file renamed from src/js/data/DataContext.js to src/main/js/data/DataContext.js |
| 1 | NO CONTENT: file renamed from src/js/data/MapSchema.js to src/main/js/data/MapSchema.js |
|
NO CONTENT: file renamed from src/js/data/MapSchema.js to src/main/js/data/MapSchema.js |
| 1 | NO CONTENT: file renamed from src/js/data/ObjectStore.js to src/main/js/data/ObjectStore.js |
|
NO CONTENT: file renamed from src/js/data/ObjectStore.js to src/main/js/data/ObjectStore.js |
| 1 | NO CONTENT: file renamed from src/js/data/RestStore.js to src/main/js/data/RestStore.js |
|
NO CONTENT: file renamed from src/js/data/RestStore.js to src/main/js/data/RestStore.js |
| 1 | NO CONTENT: file renamed from src/js/data/StatefullStoreAdapter.js to src/main/js/data/StatefullStoreAdapter.js |
|
NO CONTENT: file renamed from src/js/data/StatefullStoreAdapter.js to src/main/js/data/StatefullStoreAdapter.js |
| 1 | NO CONTENT: file renamed from src/js/data/StoreAdapter.js to src/main/js/data/StoreAdapter.js |
|
NO CONTENT: file renamed from src/js/data/StoreAdapter.js to src/main/js/data/StoreAdapter.js |
| 1 | NO CONTENT: file renamed from src/js/data/_ModelBase.js to src/main/js/data/_ModelBase.js |
|
NO CONTENT: file renamed from src/js/data/_ModelBase.js to src/main/js/data/_ModelBase.js |
| 1 | NO CONTENT: file renamed from src/js/data/_StatefulModelMixin.js to src/main/js/data/_StatefulModelMixin.js |
|
NO CONTENT: file renamed from src/js/data/_StatefulModelMixin.js to src/main/js/data/_StatefulModelMixin.js |
| 1 | NO CONTENT: file renamed from src/js/data/declare-model.js to src/main/js/data/declare-model.js |
|
NO CONTENT: file renamed from src/js/data/declare-model.js to src/main/js/data/declare-model.js |
| 1 | NO CONTENT: file renamed from src/js/declare/_load.js to src/main/js/declare/_load.js |
|
NO CONTENT: file renamed from src/js/declare/_load.js to src/main/js/declare/_load.js |
| 1 | NO CONTENT: file renamed from src/js/declare/override.js to src/main/js/declare/override.js |
|
NO CONTENT: file renamed from src/js/declare/override.js to src/main/js/declare/override.js |
| 1 | NO CONTENT: file renamed from src/js/log/trace.js to src/main/js/log/trace.js |
|
NO CONTENT: file renamed from src/js/log/trace.js to src/main/js/log/trace.js |
| 1 | NO CONTENT: file renamed from src/js/messaging/Client.js to src/main/js/messaging/Client.js |
|
NO CONTENT: file renamed from src/js/messaging/Client.js to src/main/js/messaging/Client.js |
| 1 | NO CONTENT: file renamed from src/js/messaging/Destination.js to src/main/js/messaging/Destination.js |
|
NO CONTENT: file renamed from src/js/messaging/Destination.js to src/main/js/messaging/Destination.js |
| 1 | NO CONTENT: file renamed from src/js/messaging/Listener.js to src/main/js/messaging/Listener.js |
|
NO CONTENT: file renamed from src/js/messaging/Listener.js to src/main/js/messaging/Listener.js |
| 1 | NO CONTENT: file renamed from src/js/messaging/Session.js to src/main/js/messaging/Session.js |
|
NO CONTENT: file renamed from src/js/messaging/Session.js to src/main/js/messaging/Session.js |
| 1 | NO CONTENT: file renamed from src/js/text/format-compile.js to src/main/js/text/format-compile.js |
|
NO CONTENT: file renamed from src/js/text/format-compile.js to src/main/js/text/format-compile.js |
| 1 | NO CONTENT: file renamed from src/js/text/format.js to src/main/js/text/format.js |
|
NO CONTENT: file renamed from src/js/text/format.js to src/main/js/text/format.js |
| 1 | NO CONTENT: file renamed from src/js/text/template-compile.js to src/main/js/text/template-compile.js |
|
NO CONTENT: file renamed from src/js/text/template-compile.js to src/main/js/text/template-compile.js |
| 1 | NO CONTENT: file renamed from src/ts/Cancellation.ts to src/main/ts/Cancellation.ts |
|
NO CONTENT: file renamed from src/ts/Cancellation.ts to src/main/ts/Cancellation.ts |
| 1 | NO CONTENT: file renamed from src/ts/Observable.ts to src/main/ts/Observable.ts |
|
NO CONTENT: file renamed from src/ts/Observable.ts to src/main/ts/Observable.ts |
| 1 | NO CONTENT: file renamed from src/ts/Uuid.ts to src/main/ts/Uuid.ts |
|
NO CONTENT: file renamed from src/ts/Uuid.ts to src/main/ts/Uuid.ts |
| 1 | NO CONTENT: file renamed from src/ts/components/ActivatableMixin.ts to src/main/ts/components/ActivatableMixin.ts |
|
NO CONTENT: file renamed from src/ts/components/ActivatableMixin.ts to src/main/ts/components/ActivatableMixin.ts |
| 1 | NO CONTENT: file renamed from src/ts/components/AsyncComponent.ts to src/main/ts/components/AsyncComponent.ts |
|
NO CONTENT: file renamed from src/ts/components/AsyncComponent.ts to src/main/ts/components/AsyncComponent.ts |
| 1 | NO CONTENT: file renamed from src/ts/di.ts to src/main/ts/di.ts |
|
NO CONTENT: file renamed from src/ts/di.ts to src/main/ts/di.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ActivationContext.ts to src/main/ts/di/ActivationContext.ts |
|
NO CONTENT: file renamed from src/ts/di/ActivationContext.ts to src/main/ts/di/ActivationContext.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ActivationError.ts to src/main/ts/di/ActivationError.ts |
|
NO CONTENT: file renamed from src/ts/di/ActivationError.ts to src/main/ts/di/ActivationError.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/AggregateDescriptor.ts to src/main/ts/di/AggregateDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/AggregateDescriptor.ts to src/main/ts/di/AggregateDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ConfigError.ts to src/main/ts/di/ConfigError.ts |
|
NO CONTENT: file renamed from src/ts/di/ConfigError.ts to src/main/ts/di/ConfigError.ts |
| @@ -1,353 +1,353 | |||||
| 1 | import { |
|
1 | import { | |
| 2 | ServiceRegistration, |
|
2 | ServiceRegistration, | |
| 3 | TypeRegistration, |
|
3 | TypeRegistration, | |
| 4 | FactoryRegistration, |
|
4 | FactoryRegistration, | |
| 5 | ServiceMap, |
|
5 | ServiceMap, | |
| 6 | isDescriptor, |
|
6 | isDescriptor, | |
| 7 | isDependencyRegistration, |
|
7 | isDependencyRegistration, | |
| 8 | DependencyRegistration, |
|
8 | DependencyRegistration, | |
| 9 | ValueRegistration, |
|
9 | ValueRegistration, | |
| 10 | ActivationType, |
|
10 | ActivationType, | |
| 11 | isValueRegistration, |
|
11 | isValueRegistration, | |
| 12 | isTypeRegistration, |
|
12 | isTypeRegistration, | |
| 13 | isFactoryRegistration |
|
13 | isFactoryRegistration | |
| 14 | } from "./interfaces"; |
|
14 | } from "./interfaces"; | |
| 15 |
|
15 | |||
| 16 | import { argumentNotEmptyString, isPrimitive, isPromise, delegate, argumentOfType, argumentNotNull, get } from "../safe"; |
|
16 | import { argumentNotEmptyString, isPrimitive, isPromise, delegate, argumentOfType, argumentNotNull, get } from "../safe"; | |
| 17 | import { AggregateDescriptor } from "./AggregateDescriptor"; |
|
17 | import { AggregateDescriptor } from "./AggregateDescriptor"; | |
| 18 | import { ValueDescriptor } from "./ValueDescriptor"; |
|
18 | import { ValueDescriptor } from "./ValueDescriptor"; | |
| 19 | import { Container } from "./Container"; |
|
19 | import { Container } from "./Container"; | |
| 20 | import { ReferenceDescriptor } from "./ReferenceDescriptor"; |
|
20 | import { ReferenceDescriptor } from "./ReferenceDescriptor"; | |
| 21 | import { TypeServiceDescriptor } from "./TypeServiceDescriptor"; |
|
21 | import { TypeServiceDescriptor } from "./TypeServiceDescriptor"; | |
| 22 | import { FactoryServiceDescriptor } from "./FactoryServiceDescriptor"; |
|
22 | import { FactoryServiceDescriptor } from "./FactoryServiceDescriptor"; | |
| 23 |
import { rjs, createContextRequire |
|
23 | import { rjs, createContextRequire } from "./RequireJsHelper"; | |
| 24 | import { TraceSource } from "../log/TraceSource"; |
|
24 | import { TraceSource } from "../log/TraceSource"; | |
| 25 | import { ConfigError } from "./ConfigError"; |
|
25 | import { ConfigError } from "./ConfigError"; | |
| 26 | import { Cancellation } from "../Cancellation"; |
|
26 | import { Cancellation } from "../Cancellation"; | |
| 27 |
|
27 | |||
| 28 | const trace = TraceSource.get("@implab/core/di/Configuration"); |
|
28 | const trace = TraceSource.get("@implab/core/di/Configuration"); | |
| 29 |
|
29 | |||
| 30 | async function mapAll(data: object | any[], map?: (v, k) => any): Promise<any> { |
|
30 | async function mapAll(data: object | any[], map?: (v, k) => any): Promise<any> { | |
| 31 | if (data instanceof Array) { |
|
31 | if (data instanceof Array) { | |
| 32 | return Promise.all(map ? data.map(map) : data); |
|
32 | return Promise.all(map ? data.map(map) : data); | |
| 33 | } else { |
|
33 | } else { | |
| 34 | const keys = Object.keys(data); |
|
34 | const keys = Object.keys(data); | |
| 35 |
|
35 | |||
| 36 | const o: any = {}; |
|
36 | const o: any = {}; | |
| 37 |
|
37 | |||
| 38 | await Promise.all(keys.map(async k => { |
|
38 | await Promise.all(keys.map(async k => { | |
| 39 | const v = map ? map(data[k], k) : data[k]; |
|
39 | const v = map ? map(data[k], k) : data[k]; | |
| 40 | o[k] = isPromise(v) ? await v : v; |
|
40 | o[k] = isPromise(v) ? await v : v; | |
| 41 | })); |
|
41 | })); | |
| 42 |
|
42 | |||
| 43 | return o; |
|
43 | return o; | |
| 44 | } |
|
44 | } | |
| 45 | } |
|
45 | } | |
| 46 |
|
46 | |||
| 47 | interface MapOf<T> { |
|
47 | interface MapOf<T> { | |
| 48 | [key: string]: T; |
|
48 | [key: string]: T; | |
| 49 | } |
|
49 | } | |
| 50 |
|
50 | |||
| 51 | type _key = string | number; |
|
51 | type _key = string | number; | |
| 52 |
|
52 | |||
| 53 | export class Configuration { |
|
53 | export class Configuration { | |
| 54 |
|
54 | |||
| 55 | _hasInnerDescriptors = false; |
|
55 | _hasInnerDescriptors = false; | |
| 56 |
|
56 | |||
| 57 | _container: Container; |
|
57 | _container: Container; | |
| 58 |
|
58 | |||
| 59 | _path: Array<_key>; |
|
59 | _path: Array<_key>; | |
| 60 |
|
60 | |||
| 61 | _configName: string; |
|
61 | _configName: string; | |
| 62 |
|
62 | |||
| 63 | _require = rjs; |
|
63 | _require = rjs; | |
| 64 |
|
64 | |||
| 65 | constructor(container: Container) { |
|
65 | constructor(container: Container) { | |
| 66 | argumentNotNull(container, container); |
|
66 | argumentNotNull(container, container); | |
| 67 | this._container = container; |
|
67 | this._container = container; | |
| 68 | this._path = []; |
|
68 | this._path = []; | |
| 69 | } |
|
69 | } | |
| 70 |
|
70 | |||
| 71 | async loadConfiguration(moduleName: string, ct = Cancellation.none) { |
|
71 | async loadConfiguration(moduleName: string, ct = Cancellation.none) { | |
| 72 | argumentNotEmptyString(moduleName, "moduleName"); |
|
72 | argumentNotEmptyString(moduleName, "moduleName"); | |
| 73 |
|
73 | |||
| 74 | trace.log("loadConfiguration {0}", moduleName); |
|
74 | trace.log("loadConfiguration {0}", moduleName); | |
| 75 |
|
75 | |||
| 76 | this._configName = moduleName; |
|
76 | this._configName = moduleName; | |
| 77 |
|
77 | |||
| 78 | const config = await this._loadModule(moduleName); |
|
78 | const config = await this._loadModule(moduleName); | |
| 79 |
|
79 | |||
| 80 | this._require = await this._createContextRequire(moduleName); |
|
80 | this._require = await this._createContextRequire(moduleName); | |
| 81 |
|
81 | |||
| 82 | let services: ServiceMap; |
|
82 | let services: ServiceMap; | |
| 83 |
|
83 | |||
| 84 | try { |
|
84 | try { | |
| 85 | services = await this._visitRegistrations(config, moduleName); |
|
85 | services = await this._visitRegistrations(config, moduleName); | |
| 86 | } catch (e) { |
|
86 | } catch (e) { | |
| 87 | throw this._makeError(e); |
|
87 | throw this._makeError(e); | |
| 88 | } |
|
88 | } | |
| 89 |
|
89 | |||
| 90 | this._container.register(services); |
|
90 | this._container.register(services); | |
| 91 | } |
|
91 | } | |
| 92 |
|
92 | |||
| 93 |
async applyConfiguration(data: object, contextRequire?: Require |
|
93 | async applyConfiguration(data: object, contextRequire?: Require, ct = Cancellation.none) { | |
| 94 | argumentNotNull(data, "data"); |
|
94 | argumentNotNull(data, "data"); | |
| 95 |
|
95 | |||
| 96 | trace.log("applyConfiguration"); |
|
96 | trace.log("applyConfiguration"); | |
| 97 |
|
97 | |||
| 98 | this._configName = "$"; |
|
98 | this._configName = "$"; | |
| 99 |
|
99 | |||
| 100 | if (contextRequire) |
|
100 | if (contextRequire) | |
| 101 | this._require = contextRequire; |
|
101 | this._require = contextRequire; | |
| 102 |
|
102 | |||
| 103 | let services: ServiceMap; |
|
103 | let services: ServiceMap; | |
| 104 |
|
104 | |||
| 105 | try { |
|
105 | try { | |
| 106 | services = await this._visitRegistrations(data, "$"); |
|
106 | services = await this._visitRegistrations(data, "$"); | |
| 107 | } catch (e) { |
|
107 | } catch (e) { | |
| 108 | throw this._makeError(e); |
|
108 | throw this._makeError(e); | |
| 109 | } |
|
109 | } | |
| 110 |
|
110 | |||
| 111 | this._container.register(services); |
|
111 | this._container.register(services); | |
| 112 | } |
|
112 | } | |
| 113 |
|
113 | |||
| 114 | _makeError(inner) { |
|
114 | _makeError(inner) { | |
| 115 | const e = new ConfigError("Failed to load configuration", inner); |
|
115 | const e = new ConfigError("Failed to load configuration", inner); | |
| 116 | e.configName = this._configName; |
|
116 | e.configName = this._configName; | |
| 117 | e.path = this._makePath(); |
|
117 | e.path = this._makePath(); | |
| 118 | return e; |
|
118 | return e; | |
| 119 | } |
|
119 | } | |
| 120 |
|
120 | |||
| 121 | _makePath() { |
|
121 | _makePath() { | |
| 122 | return this._path |
|
122 | return this._path | |
| 123 | .reduce( |
|
123 | .reduce( | |
| 124 | (prev, cur) => typeof cur === "number" ? |
|
124 | (prev, cur) => typeof cur === "number" ? | |
| 125 | `${prev}[${cur}]` : |
|
125 | `${prev}[${cur}]` : | |
| 126 | `${prev}.${cur}` |
|
126 | `${prev}.${cur}` | |
| 127 | ) |
|
127 | ) | |
| 128 | .toString(); |
|
128 | .toString(); | |
| 129 | } |
|
129 | } | |
| 130 |
|
130 | |||
| 131 | async _resolveType(moduleName: string, localName: string) { |
|
131 | async _resolveType(moduleName: string, localName: string) { | |
| 132 | trace.log("resolveType moduleName={0}, localName={1}", moduleName, localName); |
|
132 | trace.log("resolveType moduleName={0}, localName={1}", moduleName, localName); | |
| 133 | try { |
|
133 | try { | |
| 134 | const m = await this._loadModule(moduleName); |
|
134 | const m = await this._loadModule(moduleName); | |
| 135 | return localName ? get(localName, m) : m; |
|
135 | return localName ? get(localName, m) : m; | |
| 136 | } catch (e) { |
|
136 | } catch (e) { | |
| 137 | trace.error("Failed to resolve type moduleName={0}, localName={1}", moduleName, localName); |
|
137 | trace.error("Failed to resolve type moduleName={0}, localName={1}", moduleName, localName); | |
| 138 | throw e; |
|
138 | throw e; | |
| 139 | } |
|
139 | } | |
| 140 | } |
|
140 | } | |
| 141 |
|
141 | |||
| 142 | async _loadModule(moduleName: string) { |
|
142 | async _loadModule(moduleName: string) { | |
| 143 | trace.debug("loadModule {0}", moduleName); |
|
143 | trace.debug("loadModule {0}", moduleName); | |
| 144 |
|
144 | |||
| 145 | const m = await new Promise(fulfill => { |
|
145 | const m = await new Promise(fulfill => { | |
| 146 | this._require([moduleName], fulfill); |
|
146 | this._require([moduleName], fulfill); | |
| 147 | }); |
|
147 | }); | |
| 148 |
|
148 | |||
| 149 | return m; |
|
149 | return m; | |
| 150 | } |
|
150 | } | |
| 151 |
|
151 | |||
| 152 | _createContextRequire(moduleName: string) { |
|
152 | _createContextRequire(moduleName: string) { | |
| 153 | return createContextRequire(moduleName); |
|
153 | return createContextRequire(moduleName); | |
| 154 | } |
|
154 | } | |
| 155 |
|
155 | |||
| 156 | async _visitRegistrations(data, name: _key) { |
|
156 | async _visitRegistrations(data, name: _key) { | |
| 157 | this._enter(name); |
|
157 | this._enter(name); | |
| 158 |
|
158 | |||
| 159 | if (data.constructor && |
|
159 | if (data.constructor && | |
| 160 | data.constructor.prototype !== Object.prototype) |
|
160 | data.constructor.prototype !== Object.prototype) | |
| 161 | throw new Error("Configuration must be a simple object"); |
|
161 | throw new Error("Configuration must be a simple object"); | |
| 162 |
|
162 | |||
| 163 | const o: ServiceMap = {}; |
|
163 | const o: ServiceMap = {}; | |
| 164 | const keys = Object.keys(data); |
|
164 | const keys = Object.keys(data); | |
| 165 |
|
165 | |||
| 166 | const services = await mapAll(data, async (v, k) => { |
|
166 | const services = await mapAll(data, async (v, k) => { | |
| 167 | const d = await this._visit(v, k); |
|
167 | const d = await this._visit(v, k); | |
| 168 | return isDescriptor(d) ? d : new AggregateDescriptor(d); |
|
168 | return isDescriptor(d) ? d : new AggregateDescriptor(d); | |
| 169 | }) as ServiceMap; |
|
169 | }) as ServiceMap; | |
| 170 |
|
170 | |||
| 171 | this._leave(); |
|
171 | this._leave(); | |
| 172 |
|
172 | |||
| 173 | return services; |
|
173 | return services; | |
| 174 | } |
|
174 | } | |
| 175 |
|
175 | |||
| 176 | _enter(name: _key) { |
|
176 | _enter(name: _key) { | |
| 177 | this._path.push(name); |
|
177 | this._path.push(name); | |
| 178 | trace.debug(">{0}", name); |
|
178 | trace.debug(">{0}", name); | |
| 179 | } |
|
179 | } | |
| 180 |
|
180 | |||
| 181 | _leave() { |
|
181 | _leave() { | |
| 182 | const name = this._path.pop(); |
|
182 | const name = this._path.pop(); | |
| 183 | trace.debug("<{0}", name); |
|
183 | trace.debug("<{0}", name); | |
| 184 | } |
|
184 | } | |
| 185 |
|
185 | |||
| 186 | async _visit(data, name: string): Promise<any> { |
|
186 | async _visit(data, name: string): Promise<any> { | |
| 187 | if (isPrimitive(data) || isDescriptor(data)) |
|
187 | if (isPrimitive(data) || isDescriptor(data)) | |
| 188 | return data; |
|
188 | return data; | |
| 189 |
|
189 | |||
| 190 | if (isDependencyRegistration(data)) { |
|
190 | if (isDependencyRegistration(data)) { | |
| 191 | return this._visitDependencyRegistration(data, name); |
|
191 | return this._visitDependencyRegistration(data, name); | |
| 192 | } else if (isValueRegistration(data)) { |
|
192 | } else if (isValueRegistration(data)) { | |
| 193 | return this._visitValueRegistration(data, name); |
|
193 | return this._visitValueRegistration(data, name); | |
| 194 | } else if (isTypeRegistration(data)) { |
|
194 | } else if (isTypeRegistration(data)) { | |
| 195 | return this._visitTypeRegistration(data, name); |
|
195 | return this._visitTypeRegistration(data, name); | |
| 196 | } else if (isFactoryRegistration(data)) { |
|
196 | } else if (isFactoryRegistration(data)) { | |
| 197 | return this._visitFactoryRegistration(data, name); |
|
197 | return this._visitFactoryRegistration(data, name); | |
| 198 | } else if (data instanceof Array) { |
|
198 | } else if (data instanceof Array) { | |
| 199 | return this._visitArray(data, name); |
|
199 | return this._visitArray(data, name); | |
| 200 | } |
|
200 | } | |
| 201 |
|
201 | |||
| 202 | return this._visitObject(data, name); |
|
202 | return this._visitObject(data, name); | |
| 203 | } |
|
203 | } | |
| 204 |
|
204 | |||
| 205 | async _visitObject(data: object, name: _key) { |
|
205 | async _visitObject(data: object, name: _key) { | |
| 206 | if (data.constructor && |
|
206 | if (data.constructor && | |
| 207 | data.constructor.prototype !== Object.prototype) |
|
207 | data.constructor.prototype !== Object.prototype) | |
| 208 | return new ValueDescriptor(data); |
|
208 | return new ValueDescriptor(data); | |
| 209 |
|
209 | |||
| 210 | this._enter(name); |
|
210 | this._enter(name); | |
| 211 |
|
211 | |||
| 212 | const v = await mapAll(data, delegate(this, "_visit")); |
|
212 | const v = await mapAll(data, delegate(this, "_visit")); | |
| 213 |
|
213 | |||
| 214 | // TODO: handle inline descriptors properly |
|
214 | // TODO: handle inline descriptors properly | |
| 215 | // const ex = { |
|
215 | // const ex = { | |
| 216 | // activate(ctx) { |
|
216 | // activate(ctx) { | |
| 217 | // const value = ctx.activate(this.prop, "prop"); |
|
217 | // const value = ctx.activate(this.prop, "prop"); | |
| 218 | // // some code |
|
218 | // // some code | |
| 219 | // }, |
|
219 | // }, | |
| 220 | // // will be turned to ReferenceDescriptor |
|
220 | // // will be turned to ReferenceDescriptor | |
| 221 | // prop: { $dependency: "depName" } |
|
221 | // prop: { $dependency: "depName" } | |
| 222 | // }; |
|
222 | // }; | |
| 223 |
|
223 | |||
| 224 | this._leave(); |
|
224 | this._leave(); | |
| 225 | return v; |
|
225 | return v; | |
| 226 | } |
|
226 | } | |
| 227 |
|
227 | |||
| 228 | async _visitArray(data: any[], name: _key) { |
|
228 | async _visitArray(data: any[], name: _key) { | |
| 229 | if (data.constructor && |
|
229 | if (data.constructor && | |
| 230 | data.constructor.prototype !== Array.prototype) |
|
230 | data.constructor.prototype !== Array.prototype) | |
| 231 | return new ValueDescriptor(data); |
|
231 | return new ValueDescriptor(data); | |
| 232 |
|
232 | |||
| 233 | this._enter(name); |
|
233 | this._enter(name); | |
| 234 |
|
234 | |||
| 235 | const v = await mapAll(data, delegate(this, "_visit")); |
|
235 | const v = await mapAll(data, delegate(this, "_visit")); | |
| 236 | this._leave(); |
|
236 | this._leave(); | |
| 237 |
|
237 | |||
| 238 | return v; |
|
238 | return v; | |
| 239 | } |
|
239 | } | |
| 240 |
|
240 | |||
| 241 | _makeServiceParams(data: ServiceRegistration) { |
|
241 | _makeServiceParams(data: ServiceRegistration) { | |
| 242 | const opts: any = { |
|
242 | const opts: any = { | |
| 243 | owner: this._container |
|
243 | owner: this._container | |
| 244 | }; |
|
244 | }; | |
| 245 | if (data.services) |
|
245 | if (data.services) | |
| 246 | opts.services = this._visitRegistrations(data.services, "services"); |
|
246 | opts.services = this._visitRegistrations(data.services, "services"); | |
| 247 |
|
247 | |||
| 248 | if (data.inject) { |
|
248 | if (data.inject) { | |
| 249 | this._path.push("inject"); |
|
249 | this._path.push("inject"); | |
| 250 | opts.inject = mapAll( |
|
250 | opts.inject = mapAll( | |
| 251 | data.inject instanceof Array ? |
|
251 | data.inject instanceof Array ? | |
| 252 | data.inject : |
|
252 | data.inject : | |
| 253 | [data.inject], |
|
253 | [data.inject], | |
| 254 | delegate(this, "_visitObject") |
|
254 | delegate(this, "_visitObject") | |
| 255 | ); |
|
255 | ); | |
| 256 | this._leave(); |
|
256 | this._leave(); | |
| 257 | } |
|
257 | } | |
| 258 |
|
258 | |||
| 259 | if ("params" in data) |
|
259 | if ("params" in data) | |
| 260 | opts.params = data.params instanceof Array ? |
|
260 | opts.params = data.params instanceof Array ? | |
| 261 | this._visitArray(data.params, "params") : |
|
261 | this._visitArray(data.params, "params") : | |
| 262 | this._visit(data.params, "params"); |
|
262 | this._visit(data.params, "params"); | |
| 263 |
|
263 | |||
| 264 | if (data.activation) { |
|
264 | if (data.activation) { | |
| 265 | if (typeof (data.activation) === "string") { |
|
265 | if (typeof (data.activation) === "string") { | |
| 266 | switch (data.activation.toLowerCase()) { |
|
266 | switch (data.activation.toLowerCase()) { | |
| 267 | case "singleton": |
|
267 | case "singleton": | |
| 268 | opts.activation = ActivationType.Singleton; |
|
268 | opts.activation = ActivationType.Singleton; | |
| 269 | break; |
|
269 | break; | |
| 270 | case "container": |
|
270 | case "container": | |
| 271 | opts.activation = ActivationType.Container; |
|
271 | opts.activation = ActivationType.Container; | |
| 272 | break; |
|
272 | break; | |
| 273 | case "hierarchy": |
|
273 | case "hierarchy": | |
| 274 | opts.activation = ActivationType.Hierarchy; |
|
274 | opts.activation = ActivationType.Hierarchy; | |
| 275 | break; |
|
275 | break; | |
| 276 | case "context": |
|
276 | case "context": | |
| 277 | opts.activation = ActivationType.Context; |
|
277 | opts.activation = ActivationType.Context; | |
| 278 | break; |
|
278 | break; | |
| 279 | case "call": |
|
279 | case "call": | |
| 280 | opts.activation = ActivationType.Call; |
|
280 | opts.activation = ActivationType.Call; | |
| 281 | break; |
|
281 | break; | |
| 282 | default: |
|
282 | default: | |
| 283 | throw new Error("Unknown activation type: " + |
|
283 | throw new Error("Unknown activation type: " + | |
| 284 | data.activation); |
|
284 | data.activation); | |
| 285 | } |
|
285 | } | |
| 286 | } else { |
|
286 | } else { | |
| 287 | opts.activation = Number(data.activation); |
|
287 | opts.activation = Number(data.activation); | |
| 288 | } |
|
288 | } | |
| 289 | } |
|
289 | } | |
| 290 |
|
290 | |||
| 291 | if (data.cleanup) |
|
291 | if (data.cleanup) | |
| 292 | opts.cleanup = data.cleanup; |
|
292 | opts.cleanup = data.cleanup; | |
| 293 |
|
293 | |||
| 294 | return opts; |
|
294 | return opts; | |
| 295 | } |
|
295 | } | |
| 296 |
|
296 | |||
| 297 | async _visitValueRegistration(data: ValueRegistration, name: _key) { |
|
297 | async _visitValueRegistration(data: ValueRegistration, name: _key) { | |
| 298 | this._enter(name); |
|
298 | this._enter(name); | |
| 299 | const d = data.parse ? new AggregateDescriptor(data.$value) : new ValueDescriptor(data.$value); |
|
299 | const d = data.parse ? new AggregateDescriptor(data.$value) : new ValueDescriptor(data.$value); | |
| 300 | this._leave(); |
|
300 | this._leave(); | |
| 301 | return d; |
|
301 | return d; | |
| 302 | } |
|
302 | } | |
| 303 |
|
303 | |||
| 304 | async _visitDependencyRegistration(data: DependencyRegistration, name: _key) { |
|
304 | async _visitDependencyRegistration(data: DependencyRegistration, name: _key) { | |
| 305 | argumentNotEmptyString(data && data.$dependency, "data.$dependency"); |
|
305 | argumentNotEmptyString(data && data.$dependency, "data.$dependency"); | |
| 306 | this._enter(name); |
|
306 | this._enter(name); | |
| 307 | const d = new ReferenceDescriptor({ |
|
307 | const d = new ReferenceDescriptor({ | |
| 308 | name: data.$dependency, |
|
308 | name: data.$dependency, | |
| 309 | lazy: data.lazy, |
|
309 | lazy: data.lazy, | |
| 310 | optional: data.optional, |
|
310 | optional: data.optional, | |
| 311 | default: data.default, |
|
311 | default: data.default, | |
| 312 | services: data.services && await this._visitRegistrations(data.services, "services") |
|
312 | services: data.services && await this._visitRegistrations(data.services, "services") | |
| 313 | }); |
|
313 | }); | |
| 314 | this._leave(); |
|
314 | this._leave(); | |
| 315 | return d; |
|
315 | return d; | |
| 316 | } |
|
316 | } | |
| 317 |
|
317 | |||
| 318 | async _visitTypeRegistration(data: TypeRegistration, name: _key) { |
|
318 | async _visitTypeRegistration(data: TypeRegistration, name: _key) { | |
| 319 | argumentNotNull(data.$type, "data.$type"); |
|
319 | argumentNotNull(data.$type, "data.$type"); | |
| 320 | this._enter(name); |
|
320 | this._enter(name); | |
| 321 |
|
321 | |||
| 322 | const opts = this._makeServiceParams(data); |
|
322 | const opts = this._makeServiceParams(data); | |
| 323 | if (data.$type instanceof Function) { |
|
323 | if (data.$type instanceof Function) { | |
| 324 | opts.type = data.$type; |
|
324 | opts.type = data.$type; | |
| 325 | } else { |
|
325 | } else { | |
| 326 | const [moduleName, typeName] = data.$type.split(":", 2); |
|
326 | const [moduleName, typeName] = data.$type.split(":", 2); | |
| 327 | opts.type = this._resolveType(moduleName, typeName); |
|
327 | opts.type = this._resolveType(moduleName, typeName); | |
| 328 | } |
|
328 | } | |
| 329 |
|
329 | |||
| 330 | const d = new TypeServiceDescriptor( |
|
330 | const d = new TypeServiceDescriptor( | |
| 331 | await mapAll(opts) |
|
331 | await mapAll(opts) | |
| 332 | ); |
|
332 | ); | |
| 333 |
|
333 | |||
| 334 | this._leave(); |
|
334 | this._leave(); | |
| 335 |
|
335 | |||
| 336 | return d; |
|
336 | return d; | |
| 337 | } |
|
337 | } | |
| 338 |
|
338 | |||
| 339 | async _visitFactoryRegistration(data: FactoryRegistration, name: _key) { |
|
339 | async _visitFactoryRegistration(data: FactoryRegistration, name: _key) { | |
| 340 | argumentOfType(data.$factory, Function, "data.$type"); |
|
340 | argumentOfType(data.$factory, Function, "data.$type"); | |
| 341 | this._enter(name); |
|
341 | this._enter(name); | |
| 342 |
|
342 | |||
| 343 | const opts = this._makeServiceParams(data); |
|
343 | const opts = this._makeServiceParams(data); | |
| 344 | opts.factory = opts.$factory; |
|
344 | opts.factory = opts.$factory; | |
| 345 |
|
345 | |||
| 346 | const d = new FactoryServiceDescriptor( |
|
346 | const d = new FactoryServiceDescriptor( | |
| 347 | await mapAll(opts) |
|
347 | await mapAll(opts) | |
| 348 | ); |
|
348 | ); | |
| 349 |
|
349 | |||
| 350 | this._leave(); |
|
350 | this._leave(); | |
| 351 | return d; |
|
351 | return d; | |
| 352 | } |
|
352 | } | |
| 353 | } |
|
353 | } | |
| 1 | NO CONTENT: file renamed from src/ts/di/Container.ts to src/main/ts/di/Container.ts |
|
NO CONTENT: file renamed from src/ts/di/Container.ts to src/main/ts/di/Container.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/FactoryServiceDescriptor.ts to src/main/ts/di/FactoryServiceDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/FactoryServiceDescriptor.ts to src/main/ts/di/FactoryServiceDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ReferenceDescriptor.ts to src/main/ts/di/ReferenceDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/ReferenceDescriptor.ts to src/main/ts/di/ReferenceDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ServiceDescriptor.ts to src/main/ts/di/ServiceDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/ServiceDescriptor.ts to src/main/ts/di/ServiceDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/TypeServiceDescriptor.ts to src/main/ts/di/TypeServiceDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/TypeServiceDescriptor.ts to src/main/ts/di/TypeServiceDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/ValueDescriptor.ts to src/main/ts/di/ValueDescriptor.ts |
|
NO CONTENT: file renamed from src/ts/di/ValueDescriptor.ts to src/main/ts/di/ValueDescriptor.ts |
| 1 | NO CONTENT: file renamed from src/ts/di/interfaces.ts to src/main/ts/di/interfaces.ts |
|
NO CONTENT: file renamed from src/ts/di/interfaces.ts to src/main/ts/di/interfaces.ts |
| 1 | NO CONTENT: file renamed from src/ts/interfaces.ts to src/main/ts/interfaces.ts |
|
NO CONTENT: file renamed from src/ts/interfaces.ts to src/main/ts/interfaces.ts |
| 1 | NO CONTENT: file renamed from src/ts/log/TraceSource.ts to src/main/ts/log/TraceSource.ts |
|
NO CONTENT: file renamed from src/ts/log/TraceSource.ts to src/main/ts/log/TraceSource.ts |
| 1 | NO CONTENT: file renamed from src/ts/log/writers/ConsoleWriter.ts to src/main/ts/log/writers/ConsoleWriter.ts |
|
NO CONTENT: file renamed from src/ts/log/writers/ConsoleWriter.ts to src/main/ts/log/writers/ConsoleWriter.ts |
| 1 | NO CONTENT: file renamed from src/ts/main.ts to src/main/ts/main.ts |
|
NO CONTENT: file renamed from src/ts/main.ts to src/main/ts/main.ts |
| 1 | NO CONTENT: file renamed from src/ts/safe.ts to src/main/ts/safe.ts |
|
NO CONTENT: file renamed from src/ts/safe.ts to src/main/ts/safe.ts |
| 1 | NO CONTENT: file renamed from src/ts/text/format.d.ts to src/main/ts/text/format.d.ts |
|
NO CONTENT: file renamed from src/ts/text/format.d.ts to src/main/ts/text/format.d.ts |
| @@ -1,22 +1,21 | |||||
| 1 | { |
|
1 | { | |
| 2 | "compilerOptions": { |
|
2 | "compilerOptions": { | |
| 3 | "target": "es3", |
|
3 | "target": "es3", | |
| 4 | "module": "amd", |
|
4 | "module": "amd", | |
| 5 | "sourceMap": true, |
|
5 | "sourceMap": true, | |
| 6 | "declaration": true, |
|
6 | "declaration": true, | |
|
|
7 | "moduleResolution": "node", | |||
|
|
8 | "listFiles": true, | |||
| 7 | "lib": [ |
|
9 | "lib": [ | |
| 8 | "es5", |
|
10 | "es5", | |
| 9 | "es2015.promise", |
|
11 | "es2015.promise", | |
| 10 | "es2015.symbol", |
|
12 | "es2015.symbol", | |
| 11 | "dom" |
|
13 | "dom" | |
| 12 | ], |
|
14 | ], | |
| 13 | "rootDirs": [ |
|
15 | "rootDirs": [ | |
| 14 | "ts", |
|
16 | "main/ts", | |
| 15 | "amd/ts" |
|
17 | "amd/ts" | |
| 16 | ], |
|
18 | ], | |
| 17 | "types": [] |
|
19 | "types": [] | |
| 18 |
} |
|
20 | } | |
| 19 | "include" : [ |
|
|||
| 20 | "ts/**/*.ts", "amd/ts/**/*.ts" |
|
|||
| 21 | ] |
|
|||
| 22 | } No newline at end of file |
|
21 | } | |
General Comments 0
You need to be logged in to leave comments.
Login now
