| @@ -0,0 +1,22 | |||||
|
|
1 | var rjs = require('requirejs'); | |||
|
|
2 | ||||
|
|
3 | rjs.config({ | |||
|
|
4 | baseUrl: '.', | |||
|
|
5 | packages: [{ | |||
|
|
6 | name: "@implab/core", | |||
|
|
7 | location: "build/dist" | |||
|
|
8 | }, | |||
|
|
9 | { | |||
|
|
10 | name: "test", | |||
|
|
11 | location: "build/test" | |||
|
|
12 | }, | |||
|
|
13 | { | |||
|
|
14 | name: "dojo", | |||
|
|
15 | location: "node_modules/dojo" | |||
|
|
16 | } | |||
|
|
17 | ], | |||
|
|
18 | nodeRequire: require | |||
|
|
19 | }); | |||
|
|
20 | ||||
|
|
21 | ||||
|
|
22 | rjs(['test/plan']); No newline at end of file | |||
| @@ -0,0 +1,20 | |||||
|
|
1 | module.exports = { | |||
|
|
2 | foo: { | |||
|
|
3 | $type: "./Foo:Foo" | |||
|
|
4 | }, | |||
|
|
5 | ||||
|
|
6 | bar: { | |||
|
|
7 | $type: "./Bar:Bar", | |||
|
|
8 | params: { | |||
|
|
9 | db: { | |||
|
|
10 | provider: { | |||
|
|
11 | $dependency: "db" | |||
|
|
12 | } | |||
|
|
13 | }, | |||
|
|
14 | foo: { | |||
|
|
15 | $type: "./Foo:Foo" | |||
|
|
16 | } | |||
|
|
17 | } | |||
|
|
18 | }, | |||
|
|
19 | db: "db://localhost" | |||
|
|
20 | }; | |||
| @@ -0,0 +1,11 | |||||
|
|
1 | { | |||
|
|
2 | "name": "@implab/core-test", | |||
|
|
3 | "version": "0.0.1-dev", | |||
|
|
4 | "main": "main.js", | |||
|
|
5 | "author": "Implab team", | |||
|
|
6 | "license": "BSD-2-Clause", | |||
|
|
7 | "repository": "https://bitbucket.org/implab/implabjs", | |||
|
|
8 | "publishConfig": { | |||
|
|
9 | "access": "public" | |||
|
|
10 | } | |||
|
|
11 | } | |||
| @@ -0,0 +1,5 | |||||
|
|
1 | import "./ActivatableTests"; | |||
|
|
2 | import "./TraceSourceTests"; | |||
|
|
3 | import "./CancellationTests"; | |||
|
|
4 | import "./ObservableTests"; | |||
|
|
5 | import "./ContainerTests"; | |||
| @@ -0,0 +1,1 | |||||
|
|
1 | import "./plan"; | |||
| @@ -0,0 +1,22 | |||||
|
|
1 | { | |||
|
|
2 | "extends": "../tsconfig", | |||
|
|
3 | "compilerOptions": { | |||
|
|
4 | "rootDir": "ts", | |||
|
|
5 | "baseUrl": ".", | |||
|
|
6 | "paths": { | |||
|
|
7 | "@implab/core/*": [ | |||
|
|
8 | "../../build/dist/*" | |||
|
|
9 | ] | |||
|
|
10 | }, | |||
|
|
11 | "types": [ | |||
|
|
12 | "node" | |||
|
|
13 | ], | |||
|
|
14 | "rootDirs": [ | |||
|
|
15 | "ts", | |||
|
|
16 | "../typings/test" | |||
|
|
17 | ] | |||
|
|
18 | }, | |||
|
|
19 | "include" : [ | |||
|
|
20 | "ts/**/*.ts" | |||
|
|
21 | ] | |||
|
|
22 | } No newline at end of file | |||
| @@ -1,198 +1,207 | |||||
| 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 | if(!["amd", "commonjs", "system", "umd", "es6", "esnext"].contains(jsmodule)) |
|
8 | if(!["amd", "commonjs", "system", "umd", "es6", "esnext"].contains(jsmodule)) | |
| 9 | throw new Exception("Invalid jsmodule specified: $jsmodule"); |
|
9 | throw new Exception("Invalid jsmodule specified: $jsmodule"); | |
| 10 | if(!["es3", "es5", "es6", "es2016", "es2017", "esnext"].contains(target)) |
|
10 | if(!["es3", "es5", "es6", "es2016", "es2017", "esnext"].contains(target)) | |
| 11 | throw new Exception("Invalid target specified: $target") |
|
11 | throw new Exception("Invalid target specified: $target") | |
| 12 |
|
12 | |||
| 13 | def targetLibs = [ |
|
13 | def targetLibs = [ | |
| 14 | "es3" : "es5,es2015.promise,es2015.symbol,dom,scripthost", |
|
14 | "es3" : "es5,es2015.promise,es2015.symbol,dom,scripthost", | |
| 15 | "es5" : "es5,es2015.promise,es2015.symbol,dom,scripthost" |
|
15 | "es5" : "es5,es2015.promise,es2015.symbol,dom,scripthost" | |
| 16 | ]; |
|
16 | ]; | |
| 17 |
|
17 | |||
| 18 | ext.packageName="$npmScope/$npmName"; |
|
18 | ext.packageName="$npmScope/$npmName"; | |
| 19 |
|
19 | |||
| 20 | def srcDir = "$projectDir/src" |
|
20 | def srcDir = "$projectDir/src" | |
| 21 | def typingsDir = "$srcDir/typings" |
|
21 | def typingsDir = "$srcDir/typings" | |
| 22 | def distDir = "$buildDir/dist" |
|
22 | def distDir = "$buildDir/dist" | |
| 23 | def testDir = "$buildDir/test" |
|
23 | def testDir = "$buildDir/test" | |
| 24 | def lib = targetLibs[target] ?: "${target},dom"; |
|
24 | def lib = targetLibs[target] ?: "${target},dom"; | |
| 25 |
|
25 | |||
| 26 | println "lib: $lib"; |
|
26 | println "lib: $lib"; | |
| 27 |
|
27 | |||
| 28 | def sourceSets = ["main", "amd", "cjs"]; |
|
28 | def sourceSets = ["main", "amd", "cjs"]; | |
| 29 | def testSets = ["test", "testAmd", "testCjs"]; |
|
29 | def testSets = ["test", "testAmd", "testCjs"]; | |
| 30 |
|
30 | |||
| 31 | task beforeBuild { |
|
31 | task beforeBuild { | |
| 32 | } |
|
32 | } | |
| 33 |
|
33 | |||
| 34 | def createSoursetTasks = { String name, String outDir -> |
|
34 | def createSoursetTasks = { String name, String outDir -> | |
| 35 | def setName = name.capitalize(); |
|
35 | def setName = name.capitalize(); | |
| 36 |
|
36 | |||
| 37 | def destDir = "$buildDir/compile/$name" |
|
37 | def destDir = "$buildDir/compile/$name" | |
| 38 | def declDir = "$typingsDir/$name" |
|
38 | def declDir = "$typingsDir/$name" | |
| 39 | def setDir = "$projectDir/src/$name" |
|
39 | def setDir = "$projectDir/src/$name" | |
| 40 |
|
40 | |||
| 41 | def beforeBuildTask = task "beforeBuild$setName"(dependsOn: beforeBuild) { |
|
41 | def beforeBuildTask = task "beforeBuild$setName"(dependsOn: beforeBuild) { | |
| 42 | } |
|
42 | } | |
| 43 |
|
43 | |||
| 44 | def copyJsTask = task "copyJs$setName"(dependsOn: beforeBuildTask, type: Copy) { |
|
44 | def copyJsTask = task "copyJs$setName"(dependsOn: beforeBuildTask, type: Copy) { | |
| 45 | from "$setDir/js" |
|
45 | from "$setDir/js" | |
| 46 | into outDir |
|
46 | into outDir | |
| 47 | } |
|
47 | } | |
| 48 |
|
48 | |||
| 49 |
def compileT |
|
49 | def compileTsTask = task "compileTs$setName"(dependsOn: beforeBuildTask, type: Exec) { | |
| 50 | inputs.dir("$setDir/ts") |
|
50 | inputs.dir("$setDir/ts") | |
| 51 | inputs.file("$srcDir/tsconfig.json") |
|
51 | inputs.file("$srcDir/tsconfig.json") | |
| 52 | inputs.file("$setDir/tsconfig.json") |
|
52 | inputs.file("$setDir/tsconfig.json") | |
|
|
53 | outputs.dir(destDir) | |||
| 53 | outputs.dir(declDir) |
|
54 | outputs.dir(declDir) | |
| 54 |
|
55 | |||
| 55 | commandLine 'node_modules/.bin/tsc', |
|
56 | commandLine 'node_modules/.bin/tsc', | |
| 56 | '-p', "$setDir/tsconfig.json", |
|
57 | '-p', "$setDir/tsconfig.json", | |
| 57 | '-t', target, |
|
58 | '-t', target, | |
| 58 | '-m', jsmodule, |
|
59 | '-m', jsmodule, | |
| 59 | '-d', |
|
60 | '-d', | |
| 60 | '--emitDeclarationOnly', |
|
61 | '--outDir', destDir, | |
| 61 | '--declarationDir', declDir |
|
62 | '--declarationDir', declDir | |
| 62 |
|
63 | |||
| 63 | if (lib) |
|
64 | if (lib) | |
| 64 | args '--lib', lib |
|
65 | args '--lib', lib | |
| 65 | } |
|
66 | } | |
| 66 |
|
67 | |||
| 67 | def compileTsTask = task "compileTs$setName"(dependsOn: beforeBuildTask, type: Exec) { |
|
|||
| 68 | inputs.dir("$setDir/ts") |
|
|||
| 69 | inputs.file("$srcDir/tsconfig.json") |
|
|||
| 70 | inputs.file("$setDir/tsconfig.json") |
|
|||
| 71 | outputs.dir(destDir) |
|
|||
| 72 |
|
||||
| 73 | commandLine 'node_modules/.bin/tsc', |
|
|||
| 74 | '-p', "$setDir/tsconfig.json", |
|
|||
| 75 | '-t', target, |
|
|||
| 76 | '-m', jsmodule, |
|
|||
| 77 | '--outDir', destDir |
|
|||
| 78 |
|
||||
| 79 | if (lib) |
|
|||
| 80 | args '--lib', lib |
|
|||
| 81 | } |
|
|||
| 82 |
|
||||
| 83 | def copyTsOutputTask = task "copyTsOutput$setName"(dependsOn: compileTsTask, type: Copy) { |
|
68 | def copyTsOutputTask = task "copyTsOutput$setName"(dependsOn: compileTsTask, type: Copy) { | |
| 84 |
from |
|
69 | from destDir | |
| 85 | into outDir |
|
70 | into outDir | |
| 86 | } |
|
71 | } | |
| 87 |
|
72 | |||
| 88 |
def copyTypingsTask = task "copyTypings$setName"(dependsOn: compileT |
|
73 | def copyTypingsTask = task "copyTypings$setName"(dependsOn: compileTsTask, type: Copy) { | |
| 89 | from compileTypingsTask |
|
74 | from declDir | |
| 90 | into outDir |
|
75 | into outDir | |
| 91 | } |
|
76 | } | |
| 92 |
|
77 | |||
| 93 | task "build$setName"(dependsOn: [copyTypingsTask, copyTsOutputTask, copyJsTask]) { |
|
78 | task "build$setName"(dependsOn: [copyTypingsTask, copyTsOutputTask, copyJsTask]) { | |
| 94 | } |
|
79 | } | |
| 95 | } |
|
80 | } | |
| 96 |
|
81 | |||
| 97 | task printVersion { |
|
82 | task printVersion { | |
| 98 | doLast { |
|
83 | doLast { | |
| 99 | println "version: $version" |
|
84 | println "version: $version" | |
| 100 | println "packageName: $packageName" |
|
85 | println "packageName: $packageName" | |
| 101 | println "target: $target" |
|
86 | println "target: $target" | |
| 102 | println "module: $jsmodule" |
|
87 | println "module: $jsmodule" | |
| 103 | } |
|
88 | } | |
| 104 | } |
|
89 | } | |
| 105 |
|
90 | |||
| 106 | task clean { |
|
91 | task clean { | |
| 107 | doLast { |
|
92 | doLast { | |
| 108 | delete buildDir |
|
93 | delete buildDir | |
| 109 | delete typingsDir |
|
94 | delete typingsDir | |
| 110 | } |
|
95 | } | |
| 111 | } |
|
96 | } | |
| 112 |
|
97 | |||
| 113 | task _initBuild { |
|
98 | task _initBuild { | |
| 114 | mustRunAfter clean |
|
99 | mustRunAfter clean | |
| 115 |
|
100 | |||
| 116 | def buildInfoFile = "$buildDir/platform"; |
|
101 | def buildInfoFile = "$buildDir/platform"; | |
| 117 | inputs.property('target',target); |
|
102 | inputs.property('target',target); | |
| 118 | inputs.property('jsmodule',jsmodule); |
|
103 | inputs.property('jsmodule',jsmodule); | |
| 119 | outputs.file(buildInfoFile); |
|
104 | outputs.file(buildInfoFile); | |
| 120 |
|
105 | |||
| 121 | doLast { |
|
106 | doLast { | |
| 122 | delete buildDir |
|
107 | delete buildDir | |
| 123 | mkdir buildDir |
|
108 | mkdir buildDir | |
| 124 |
|
109 | |||
| 125 | def f = new File(buildInfoFile); |
|
110 | def f = new File(buildInfoFile); | |
| 126 | f << "$target-$jsmodule"; |
|
111 | f << "$target-$jsmodule"; | |
| 127 | } |
|
112 | } | |
| 128 | } |
|
113 | } | |
| 129 |
|
114 | |||
| 130 | task cleanNpm { |
|
115 | task cleanNpm { | |
| 131 | doLast { |
|
116 | doLast { | |
| 132 | delete 'node_modules' |
|
117 | delete 'node_modules' | |
| 133 | } |
|
118 | } | |
| 134 | } |
|
119 | } | |
| 135 |
|
120 | |||
| 136 | task _npmInstall() { |
|
121 | task _npmInstall() { | |
| 137 | inputs.file("package.json") |
|
122 | inputs.file("package.json") | |
| 138 | outputs.dir("node_modules") |
|
123 | outputs.dir("node_modules") | |
| 139 | doLast { |
|
124 | doLast { | |
| 140 | exec { |
|
125 | exec { | |
| 141 | commandLine 'npm', 'install' |
|
126 | commandLine 'npm', 'install' | |
| 142 | } |
|
127 | } | |
| 143 | } |
|
128 | } | |
| 144 | } |
|
129 | } | |
| 145 |
|
130 | |||
| 146 | beforeBuild { |
|
131 | beforeBuild { | |
| 147 | dependsOn _initBuild |
|
132 | dependsOn _initBuild | |
| 148 | dependsOn _npmInstall |
|
133 | dependsOn _npmInstall | |
| 149 | } |
|
134 | } | |
| 150 |
|
135 | |||
| 151 | sourceSets.each { createSoursetTasks(it, distDir) } |
|
136 | sourceSets.each { createSoursetTasks(it, distDir) } | |
| 152 |
|
137 | |||
| 153 | testSets.each { createSoursetTasks(it, testDir) } |
|
138 | testSets.each { createSoursetTasks(it, testDir) } | |
| 154 |
|
139 | |||
| 155 | compileTsAmd { |
|
140 | compileTsAmd { | |
| 156 |
dependsOn compileT |
|
141 | dependsOn compileTsMain | |
| 157 | } |
|
142 | } | |
| 158 |
|
143 | |||
| 159 |
compileT |
|
144 | compileTsCjs { | |
| 160 |
dependsOn compileT |
|
145 | dependsOn compileTsMain | |
| 161 | } |
|
146 | } | |
| 162 |
|
147 | |||
| 163 | task build(dependsOn: buildMain) { |
|
148 | task build(dependsOn: buildMain) { | |
| 164 | if (jsmodule == "amd") |
|
149 | if (jsmodule == "amd") | |
| 165 | dependsOn buildAmd |
|
150 | dependsOn buildAmd | |
|
|
151 | if (jsmodule == "commonjs") | |||
|
|
152 | dependsOn buildCjs | |||
| 166 | } |
|
153 | } | |
| 167 |
|
154 | |||
| 168 | compileTsTest { |
|
155 | compileTsTest { | |
| 169 | dependsOn build |
|
156 | dependsOn build | |
| 170 | } |
|
157 | } | |
| 171 |
|
158 | |||
| 172 | compileTsTestAmd { |
|
159 | compileTsTestAmd { | |
| 173 |
dependsOn compileT |
|
160 | dependsOn compileTsTest | |
|
|
161 | } | |||
|
|
162 | ||||
|
|
163 | compileTsTestCjs { | |||
|
|
164 | dependsOn compileTsTest | |||
| 174 | } |
|
165 | } | |
| 175 |
|
166 | |||
| 176 |
task |
|
167 | task _installLocalCjsDependency(dependsOn: [buildTestCjs, "_packageMeta"], type: Exec) { | |
| 177 | commandLine 'node', "$testDir/run-amd-tests.js" |
|
168 | inputs.file("$distDir/package.json") | |
|
|
169 | outputs.upToDateWhen { | |||
|
|
170 | new File("$testDir/$packageName").exists() | |||
|
|
171 | } | |||
|
|
172 | ||||
|
|
173 | workingDir testDir | |||
|
|
174 | ||||
|
|
175 | commandLine 'npm', 'install', '--no-save', '--force', distDir | |||
|
|
176 | } | |||
|
|
177 | ||||
|
|
178 | task test(dependsOn: [buildTest], type: Exec) { | |||
|
|
179 | if (jsmodule == "amd") | |||
|
|
180 | dependsOn buildTestAmd | |||
|
|
181 | if (jsmodule == "commonjs") { | |||
|
|
182 | dependsOn buildTestCjs | |||
|
|
183 | dependsOn _installLocalCjsDependency | |||
|
|
184 | } | |||
|
|
185 | ||||
|
|
186 | commandLine 'node', "$testDir/run-tests.js" | |||
| 178 | } |
|
187 | } | |
| 179 |
|
188 | |||
| 180 | task _packageMeta(type: Copy) { |
|
189 | task _packageMeta(type: Copy) { | |
| 181 | mustRunAfter build |
|
190 | mustRunAfter build | |
| 182 |
|
191 | |||
| 183 | inputs.property("version", version) |
|
192 | inputs.property("version", version) | |
| 184 | from('.') { |
|
193 | from('.') { | |
| 185 | include '.npmignore', 'readme.md', 'license', 'history.md' |
|
194 | include '.npmignore', 'readme.md', 'license', 'history.md' | |
| 186 | } |
|
195 | } | |
| 187 | from("$srcDir/package.${jsmodule}.tmpl.json") { |
|
196 | from("$srcDir/package.${jsmodule}.tmpl.json") { | |
| 188 | expand project.properties |
|
197 | expand project.properties | |
| 189 | rename { "package.json" } |
|
198 | rename { "package.json" } | |
| 190 | } |
|
199 | } | |
| 191 | into distDir |
|
200 | into distDir | |
| 192 | } |
|
201 | } | |
| 193 |
|
202 | |||
| 194 | task pack(dependsOn: [build, _packageMeta], type: Exec) { |
|
203 | task pack(dependsOn: [build, _packageMeta], type: Exec) { | |
| 195 | workingDir distDir |
|
204 | workingDir distDir | |
| 196 |
|
205 | |||
| 197 | commandLine 'npm', 'pack' |
|
206 | commandLine 'npm', 'pack' | |
| 198 | } No newline at end of file |
|
207 | } | |
| @@ -1,471 +1,471 | |||||
| 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.18", |
|
8 | "version": "10.12.18", | |
| 9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", |
|
9 | "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.18.tgz", | |
| 10 | "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", |
|
10 | "integrity": "sha512-fh+pAqt4xRzPfqA6eh3Z2y6fyZavRIumvjhaCL753+TVkGKGhpPeyrJG2JftD0T9q4GF00KjefsQ+PQNDdWQaQ==", | |
| 11 | "dev": true |
|
11 | "dev": true | |
| 12 | }, |
|
12 | }, | |
| 13 | "@types/requirejs": { |
|
13 | "@types/requirejs": { | |
| 14 | "version": "2.1.31", |
|
14 | "version": "2.1.31", | |
| 15 | "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz", |
|
15 | "resolved": "https://registry.npmjs.org/@types/requirejs/-/requirejs-2.1.31.tgz", | |
| 16 | "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==", |
|
16 | "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==", | |
| 17 | "dev": true |
|
17 | "dev": true | |
| 18 | }, |
|
18 | }, | |
| 19 | "@types/tape": { |
|
19 | "@types/tape": { | |
| 20 | "version": "4.2.33", |
|
20 | "version": "4.2.33", | |
| 21 | "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.2.33.tgz", |
|
21 | "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.2.33.tgz", | |
| 22 | "integrity": "sha512-ltfyuY5BIkYlGuQfwqzTDT8f0q8Z5DGppvUnWGs39oqDmMd6/UWhNpX3ZMh/VYvfxs3rFGHMrLC/eGRdLiDGuw==", |
|
22 | "integrity": "sha512-ltfyuY5BIkYlGuQfwqzTDT8f0q8Z5DGppvUnWGs39oqDmMd6/UWhNpX3ZMh/VYvfxs3rFGHMrLC/eGRdLiDGuw==", | |
| 23 | "dev": true, |
|
23 | "dev": true, | |
| 24 | "requires": { |
|
24 | "requires": { | |
| 25 | "@types/node": "*" |
|
25 | "@types/node": "*" | |
| 26 | } |
|
26 | } | |
| 27 | }, |
|
27 | }, | |
| 28 | "balanced-match": { |
|
28 | "balanced-match": { | |
| 29 | "version": "1.0.0", |
|
29 | "version": "1.0.0", | |
| 30 | "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", | |
| 31 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", |
|
31 | "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", | |
| 32 | "dev": true |
|
32 | "dev": true | |
| 33 | }, |
|
33 | }, | |
| 34 | "brace-expansion": { |
|
34 | "brace-expansion": { | |
| 35 | "version": "1.1.11", |
|
35 | "version": "1.1.11", | |
| 36 | "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", | |
| 37 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", |
|
37 | "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", | |
| 38 | "dev": true, |
|
38 | "dev": true, | |
| 39 | "requires": { |
|
39 | "requires": { | |
| 40 | "balanced-match": "^1.0.0", |
|
40 | "balanced-match": "^1.0.0", | |
| 41 | "concat-map": "0.0.1" |
|
41 | "concat-map": "0.0.1" | |
| 42 | } |
|
42 | } | |
| 43 | }, |
|
43 | }, | |
| 44 | "concat-map": { |
|
44 | "concat-map": { | |
| 45 | "version": "0.0.1", |
|
45 | "version": "0.0.1", | |
| 46 | "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", | |
| 47 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", |
|
47 | "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", | |
| 48 | "dev": true |
|
48 | "dev": true | |
| 49 | }, |
|
49 | }, | |
| 50 | "core-util-is": { |
|
50 | "core-util-is": { | |
| 51 | "version": "1.0.2", |
|
51 | "version": "1.0.2", | |
| 52 | "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", | |
| 53 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", |
|
53 | "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", | |
| 54 | "dev": true |
|
54 | "dev": true | |
| 55 | }, |
|
55 | }, | |
| 56 | "deep-equal": { |
|
56 | "deep-equal": { | |
| 57 | "version": "0.1.2", |
|
57 | "version": "0.1.2", | |
| 58 | "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", | |
| 59 | "integrity": "sha1-skbCuApXCkfBG+HZvRBw7IeLh84=", |
|
59 | "integrity": "sha1-skbCuApXCkfBG+HZvRBw7IeLh84=", | |
| 60 | "dev": true |
|
60 | "dev": true | |
| 61 | }, |
|
61 | }, | |
| 62 | "define-properties": { |
|
62 | "define-properties": { | |
| 63 | "version": "1.1.3", |
|
63 | "version": "1.1.3", | |
| 64 | "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", | |
| 65 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", |
|
65 | "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", | |
| 66 | "dev": true, |
|
66 | "dev": true, | |
| 67 | "requires": { |
|
67 | "requires": { | |
| 68 | "object-keys": "^1.0.12" |
|
68 | "object-keys": "^1.0.12" | |
| 69 | }, |
|
69 | }, | |
| 70 | "dependencies": { |
|
70 | "dependencies": { | |
| 71 | "object-keys": { |
|
71 | "object-keys": { | |
| 72 | "version": "1.0.12", |
|
72 | "version": "1.0.12", | |
| 73 | "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", | |
| 74 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", |
|
74 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", | |
| 75 | "dev": true |
|
75 | "dev": true | |
| 76 | } |
|
76 | } | |
| 77 | } |
|
77 | } | |
| 78 | }, |
|
78 | }, | |
| 79 | "defined": { |
|
79 | "defined": { | |
| 80 | "version": "0.0.0", |
|
80 | "version": "0.0.0", | |
| 81 | "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", |
|
81 | "resolved": "https://registry.npmjs.org/defined/-/defined-0.0.0.tgz", | |
| 82 | "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", |
|
82 | "integrity": "sha1-817qfXBekzuvE7LwOz+D2SFAOz4=", | |
| 83 | "dev": true |
|
83 | "dev": true | |
| 84 | }, |
|
84 | }, | |
| 85 | "dojo": { |
|
85 | "dojo": { | |
| 86 | "version": "1.14.2", |
|
86 | "version": "1.14.2", | |
| 87 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.14.2.tgz", |
|
87 | "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.14.2.tgz", | |
| 88 | "integrity": "sha512-TI+Ytgfh/VfmHWERp45Jte6NFMdoJTPsvUP/uzJUvAXET8FP2h442LePWWJ/q/xZ4V0V8OtdJhx8It/GB+Zbxg==", |
|
88 | "integrity": "sha512-TI+Ytgfh/VfmHWERp45Jte6NFMdoJTPsvUP/uzJUvAXET8FP2h442LePWWJ/q/xZ4V0V8OtdJhx8It/GB+Zbxg==", | |
| 89 | "dev": true |
|
89 | "dev": true | |
| 90 | }, |
|
90 | }, | |
| 91 | "duplexer": { |
|
91 | "duplexer": { | |
| 92 | "version": "0.1.1", |
|
92 | "version": "0.1.1", | |
| 93 | "resolved": "http://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", |
|
93 | "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.1.tgz", | |
| 94 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", |
|
94 | "integrity": "sha1-rOb/gIwc5mtX0ev5eXessCM0z8E=", | |
| 95 | "dev": true |
|
95 | "dev": true | |
| 96 | }, |
|
96 | }, | |
| 97 | "es-abstract": { |
|
97 | "es-abstract": { | |
| 98 | "version": "1.13.0", |
|
98 | "version": "1.13.0", | |
| 99 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", |
|
99 | "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", | |
| 100 | "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", |
|
100 | "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", | |
| 101 | "dev": true, |
|
101 | "dev": true, | |
| 102 | "requires": { |
|
102 | "requires": { | |
| 103 | "es-to-primitive": "^1.2.0", |
|
103 | "es-to-primitive": "^1.2.0", | |
| 104 | "function-bind": "^1.1.1", |
|
104 | "function-bind": "^1.1.1", | |
| 105 | "has": "^1.0.3", |
|
105 | "has": "^1.0.3", | |
| 106 | "is-callable": "^1.1.4", |
|
106 | "is-callable": "^1.1.4", | |
| 107 | "is-regex": "^1.0.4", |
|
107 | "is-regex": "^1.0.4", | |
| 108 | "object-keys": "^1.0.12" |
|
108 | "object-keys": "^1.0.12" | |
| 109 | }, |
|
109 | }, | |
| 110 | "dependencies": { |
|
110 | "dependencies": { | |
| 111 | "object-keys": { |
|
111 | "object-keys": { | |
| 112 | "version": "1.0.12", |
|
112 | "version": "1.0.12", | |
| 113 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", |
|
113 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", | |
| 114 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", |
|
114 | "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", | |
| 115 | "dev": true |
|
115 | "dev": true | |
| 116 | } |
|
116 | } | |
| 117 | } |
|
117 | } | |
| 118 | }, |
|
118 | }, | |
| 119 | "es-to-primitive": { |
|
119 | "es-to-primitive": { | |
| 120 | "version": "1.2.0", |
|
120 | "version": "1.2.0", | |
| 121 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", |
|
121 | "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", | |
| 122 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", |
|
122 | "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", | |
| 123 | "dev": true, |
|
123 | "dev": true, | |
| 124 | "requires": { |
|
124 | "requires": { | |
| 125 | "is-callable": "^1.1.4", |
|
125 | "is-callable": "^1.1.4", | |
| 126 | "is-date-object": "^1.0.1", |
|
126 | "is-date-object": "^1.0.1", | |
| 127 | "is-symbol": "^1.0.2" |
|
127 | "is-symbol": "^1.0.2" | |
| 128 | } |
|
128 | } | |
| 129 | }, |
|
129 | }, | |
| 130 | "faucet": { |
|
130 | "faucet": { | |
| 131 | "version": "0.0.1", |
|
131 | "version": "0.0.1", | |
| 132 | "resolved": "https://registry.npmjs.org/faucet/-/faucet-0.0.1.tgz", |
|
132 | "resolved": "https://registry.npmjs.org/faucet/-/faucet-0.0.1.tgz", | |
| 133 | "integrity": "sha1-WX3PHSGJosBiMhtZHo8VHtIDnZw=", |
|
133 | "integrity": "sha1-WX3PHSGJosBiMhtZHo8VHtIDnZw=", | |
| 134 | "dev": true, |
|
134 | "dev": true, | |
| 135 | "requires": { |
|
135 | "requires": { | |
| 136 | "defined": "0.0.0", |
|
136 | "defined": "0.0.0", | |
| 137 | "duplexer": "~0.1.1", |
|
137 | "duplexer": "~0.1.1", | |
| 138 | "minimist": "0.0.5", |
|
138 | "minimist": "0.0.5", | |
| 139 | "sprintf": "~0.1.3", |
|
139 | "sprintf": "~0.1.3", | |
| 140 | "tap-parser": "~0.4.0", |
|
140 | "tap-parser": "~0.4.0", | |
| 141 | "tape": "~2.3.2", |
|
141 | "tape": "~2.3.2", | |
| 142 | "through2": "~0.2.3" |
|
142 | "through2": "~0.2.3" | |
| 143 | }, |
|
143 | }, | |
| 144 | "dependencies": { |
|
144 | "dependencies": { | |
| 145 | "tape": { |
|
145 | "tape": { | |
| 146 | "version": "2.3.3", |
|
146 | "version": "2.3.3", | |
| 147 | "resolved": "http://registry.npmjs.org/tape/-/tape-2.3.3.tgz", |
|
147 | "resolved": "https://registry.npmjs.org/tape/-/tape-2.3.3.tgz", | |
| 148 | "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=", |
|
148 | "integrity": "sha1-Lnzgox3wn41oUWZKcYQuDKUFevc=", | |
| 149 | "dev": true, |
|
149 | "dev": true, | |
| 150 | "requires": { |
|
150 | "requires": { | |
| 151 | "deep-equal": "~0.1.0", |
|
151 | "deep-equal": "~0.1.0", | |
| 152 | "defined": "~0.0.0", |
|
152 | "defined": "~0.0.0", | |
| 153 | "inherits": "~2.0.1", |
|
153 | "inherits": "~2.0.1", | |
| 154 | "jsonify": "~0.0.0", |
|
154 | "jsonify": "~0.0.0", | |
| 155 | "resumer": "~0.0.0", |
|
155 | "resumer": "~0.0.0", | |
| 156 | "through": "~2.3.4" |
|
156 | "through": "~2.3.4" | |
| 157 | } |
|
157 | } | |
| 158 | } |
|
158 | } | |
| 159 | } |
|
159 | } | |
| 160 | }, |
|
160 | }, | |
| 161 | "for-each": { |
|
161 | "for-each": { | |
| 162 | "version": "0.3.3", |
|
162 | "version": "0.3.3", | |
| 163 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", |
|
163 | "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", | |
| 164 | "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", |
|
164 | "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", | |
| 165 | "dev": true, |
|
165 | "dev": true, | |
| 166 | "requires": { |
|
166 | "requires": { | |
| 167 | "is-callable": "^1.1.3" |
|
167 | "is-callable": "^1.1.3" | |
| 168 | } |
|
168 | } | |
| 169 | }, |
|
169 | }, | |
| 170 | "fs.realpath": { |
|
170 | "fs.realpath": { | |
| 171 | "version": "1.0.0", |
|
171 | "version": "1.0.0", | |
| 172 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", |
|
172 | "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", | |
| 173 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", |
|
173 | "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", | |
| 174 | "dev": true |
|
174 | "dev": true | |
| 175 | }, |
|
175 | }, | |
| 176 | "function-bind": { |
|
176 | "function-bind": { | |
| 177 | "version": "1.1.1", |
|
177 | "version": "1.1.1", | |
| 178 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", |
|
178 | "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", | |
| 179 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", |
|
179 | "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", | |
| 180 | "dev": true |
|
180 | "dev": true | |
| 181 | }, |
|
181 | }, | |
| 182 | "glob": { |
|
182 | "glob": { | |
| 183 | "version": "7.1.3", |
|
183 | "version": "7.1.3", | |
| 184 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", |
|
184 | "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", | |
| 185 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", |
|
185 | "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", | |
| 186 | "dev": true, |
|
186 | "dev": true, | |
| 187 | "requires": { |
|
187 | "requires": { | |
| 188 | "fs.realpath": "^1.0.0", |
|
188 | "fs.realpath": "^1.0.0", | |
| 189 | "inflight": "^1.0.4", |
|
189 | "inflight": "^1.0.4", | |
| 190 | "inherits": "2", |
|
190 | "inherits": "2", | |
| 191 | "minimatch": "^3.0.4", |
|
191 | "minimatch": "^3.0.4", | |
| 192 | "once": "^1.3.0", |
|
192 | "once": "^1.3.0", | |
| 193 | "path-is-absolute": "^1.0.0" |
|
193 | "path-is-absolute": "^1.0.0" | |
| 194 | } |
|
194 | } | |
| 195 | }, |
|
195 | }, | |
| 196 | "has": { |
|
196 | "has": { | |
| 197 | "version": "1.0.3", |
|
197 | "version": "1.0.3", | |
| 198 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", |
|
198 | "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", | |
| 199 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", |
|
199 | "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", | |
| 200 | "dev": true, |
|
200 | "dev": true, | |
| 201 | "requires": { |
|
201 | "requires": { | |
| 202 | "function-bind": "^1.1.1" |
|
202 | "function-bind": "^1.1.1" | |
| 203 | } |
|
203 | } | |
| 204 | }, |
|
204 | }, | |
| 205 | "has-symbols": { |
|
205 | "has-symbols": { | |
| 206 | "version": "1.0.0", |
|
206 | "version": "1.0.0", | |
| 207 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", |
|
207 | "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", | |
| 208 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", |
|
208 | "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", | |
| 209 | "dev": true |
|
209 | "dev": true | |
| 210 | }, |
|
210 | }, | |
| 211 | "inflight": { |
|
211 | "inflight": { | |
| 212 | "version": "1.0.6", |
|
212 | "version": "1.0.6", | |
| 213 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", |
|
213 | "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", | |
| 214 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", |
|
214 | "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", | |
| 215 | "dev": true, |
|
215 | "dev": true, | |
| 216 | "requires": { |
|
216 | "requires": { | |
| 217 | "once": "^1.3.0", |
|
217 | "once": "^1.3.0", | |
| 218 | "wrappy": "1" |
|
218 | "wrappy": "1" | |
| 219 | } |
|
219 | } | |
| 220 | }, |
|
220 | }, | |
| 221 | "inherits": { |
|
221 | "inherits": { | |
| 222 | "version": "2.0.3", |
|
222 | "version": "2.0.3", | |
| 223 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", |
|
223 | "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", | |
| 224 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", |
|
224 | "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", | |
| 225 | "dev": true |
|
225 | "dev": true | |
| 226 | }, |
|
226 | }, | |
| 227 | "is-callable": { |
|
227 | "is-callable": { | |
| 228 | "version": "1.1.4", |
|
228 | "version": "1.1.4", | |
| 229 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", |
|
229 | "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", | |
| 230 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", |
|
230 | "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", | |
| 231 | "dev": true |
|
231 | "dev": true | |
| 232 | }, |
|
232 | }, | |
| 233 | "is-date-object": { |
|
233 | "is-date-object": { | |
| 234 | "version": "1.0.1", |
|
234 | "version": "1.0.1", | |
| 235 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", |
|
235 | "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", | |
| 236 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", |
|
236 | "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", | |
| 237 | "dev": true |
|
237 | "dev": true | |
| 238 | }, |
|
238 | }, | |
| 239 | "is-regex": { |
|
239 | "is-regex": { | |
| 240 | "version": "1.0.4", |
|
240 | "version": "1.0.4", | |
| 241 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", |
|
241 | "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", | |
| 242 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", |
|
242 | "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", | |
| 243 | "dev": true, |
|
243 | "dev": true, | |
| 244 | "requires": { |
|
244 | "requires": { | |
| 245 | "has": "^1.0.1" |
|
245 | "has": "^1.0.1" | |
| 246 | } |
|
246 | } | |
| 247 | }, |
|
247 | }, | |
| 248 | "is-symbol": { |
|
248 | "is-symbol": { | |
| 249 | "version": "1.0.2", |
|
249 | "version": "1.0.2", | |
| 250 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", |
|
250 | "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", | |
| 251 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", |
|
251 | "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", | |
| 252 | "dev": true, |
|
252 | "dev": true, | |
| 253 | "requires": { |
|
253 | "requires": { | |
| 254 | "has-symbols": "^1.0.0" |
|
254 | "has-symbols": "^1.0.0" | |
| 255 | } |
|
255 | } | |
| 256 | }, |
|
256 | }, | |
| 257 | "isarray": { |
|
257 | "isarray": { | |
| 258 | "version": "0.0.1", |
|
258 | "version": "0.0.1", | |
| 259 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", |
|
259 | "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", | |
| 260 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", |
|
260 | "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", | |
| 261 | "dev": true |
|
261 | "dev": true | |
| 262 | }, |
|
262 | }, | |
| 263 | "jsonify": { |
|
263 | "jsonify": { | |
| 264 | "version": "0.0.0", |
|
264 | "version": "0.0.0", | |
| 265 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", |
|
265 | "resolved": "https://registry.npmjs.org/jsonify/-/jsonify-0.0.0.tgz", | |
| 266 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", |
|
266 | "integrity": "sha1-LHS27kHZPKUbe1qu6PUDYx0lKnM=", | |
| 267 | "dev": true |
|
267 | "dev": true | |
| 268 | }, |
|
268 | }, | |
| 269 | "minimatch": { |
|
269 | "minimatch": { | |
| 270 | "version": "3.0.4", |
|
270 | "version": "3.0.4", | |
| 271 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", |
|
271 | "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", | |
| 272 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", |
|
272 | "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", | |
| 273 | "dev": true, |
|
273 | "dev": true, | |
| 274 | "requires": { |
|
274 | "requires": { | |
| 275 | "brace-expansion": "^1.1.7" |
|
275 | "brace-expansion": "^1.1.7" | |
| 276 | } |
|
276 | } | |
| 277 | }, |
|
277 | }, | |
| 278 | "minimist": { |
|
278 | "minimist": { | |
| 279 | "version": "0.0.5", |
|
279 | "version": "0.0.5", | |
| 280 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", |
|
280 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.5.tgz", | |
| 281 | "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", |
|
281 | "integrity": "sha1-16oye87PUY+RBqxrjwA/o7zqhWY=", | |
| 282 | "dev": true |
|
282 | "dev": true | |
| 283 | }, |
|
283 | }, | |
| 284 | "object-inspect": { |
|
284 | "object-inspect": { | |
| 285 | "version": "1.6.0", |
|
285 | "version": "1.6.0", | |
| 286 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", |
|
286 | "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz", | |
| 287 | "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", |
|
287 | "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==", | |
| 288 | "dev": true |
|
288 | "dev": true | |
| 289 | }, |
|
289 | }, | |
| 290 | "object-keys": { |
|
290 | "object-keys": { | |
| 291 | "version": "0.4.0", |
|
291 | "version": "0.4.0", | |
| 292 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", |
|
292 | "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-0.4.0.tgz", | |
| 293 | "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", |
|
293 | "integrity": "sha1-KKaq50KN0sOpLz2V8hM13SBOAzY=", | |
| 294 | "dev": true |
|
294 | "dev": true | |
| 295 | }, |
|
295 | }, | |
| 296 | "once": { |
|
296 | "once": { | |
| 297 | "version": "1.4.0", |
|
297 | "version": "1.4.0", | |
| 298 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", |
|
298 | "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", | |
| 299 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", |
|
299 | "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", | |
| 300 | "dev": true, |
|
300 | "dev": true, | |
| 301 | "requires": { |
|
301 | "requires": { | |
| 302 | "wrappy": "1" |
|
302 | "wrappy": "1" | |
| 303 | } |
|
303 | } | |
| 304 | }, |
|
304 | }, | |
| 305 | "path-is-absolute": { |
|
305 | "path-is-absolute": { | |
| 306 | "version": "1.0.1", |
|
306 | "version": "1.0.1", | |
| 307 | "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", |
|
307 | "resolved": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", | |
| 308 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", |
|
308 | "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", | |
| 309 | "dev": true |
|
309 | "dev": true | |
| 310 | }, |
|
310 | }, | |
| 311 | "path-parse": { |
|
311 | "path-parse": { | |
| 312 | "version": "1.0.6", |
|
312 | "version": "1.0.6", | |
| 313 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", |
|
313 | "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", | |
| 314 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", |
|
314 | "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", | |
| 315 | "dev": true |
|
315 | "dev": true | |
| 316 | }, |
|
316 | }, | |
| 317 | "readable-stream": { |
|
317 | "readable-stream": { | |
| 318 | "version": "1.1.14", |
|
318 | "version": "1.1.14", | |
| 319 | "resolved": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", |
|
319 | "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.1.14.tgz", | |
| 320 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", |
|
320 | "integrity": "sha1-fPTFTvZI44EwhMY23SB54WbAgdk=", | |
| 321 | "dev": true, |
|
321 | "dev": true, | |
| 322 | "requires": { |
|
322 | "requires": { | |
| 323 | "core-util-is": "~1.0.0", |
|
323 | "core-util-is": "~1.0.0", | |
| 324 | "inherits": "~2.0.1", |
|
324 | "inherits": "~2.0.1", | |
| 325 | "isarray": "0.0.1", |
|
325 | "isarray": "0.0.1", | |
| 326 | "string_decoder": "~0.10.x" |
|
326 | "string_decoder": "~0.10.x" | |
| 327 | } |
|
327 | } | |
| 328 | }, |
|
328 | }, | |
| 329 | "requirejs": { |
|
329 | "requirejs": { | |
| 330 | "version": "2.3.6", |
|
330 | "version": "2.3.6", | |
| 331 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", |
|
331 | "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", | |
| 332 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", |
|
332 | "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", | |
| 333 | "dev": true |
|
333 | "dev": true | |
| 334 | }, |
|
334 | }, | |
| 335 | "resolve": { |
|
335 | "resolve": { | |
| 336 | "version": "1.7.1", |
|
336 | "version": "1.7.1", | |
| 337 | "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", |
|
337 | "resolved": "http://registry.npmjs.org/resolve/-/resolve-1.7.1.tgz", | |
| 338 | "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", |
|
338 | "integrity": "sha512-c7rwLofp8g1U+h1KNyHL/jicrKg1Ek4q+Lr33AL65uZTinUZHe30D5HlyN5V9NW0JX1D5dXQ4jqW5l7Sy/kGfw==", | |
| 339 | "dev": true, |
|
339 | "dev": true, | |
| 340 | "requires": { |
|
340 | "requires": { | |
| 341 | "path-parse": "^1.0.5" |
|
341 | "path-parse": "^1.0.5" | |
| 342 | } |
|
342 | } | |
| 343 | }, |
|
343 | }, | |
| 344 | "resumer": { |
|
344 | "resumer": { | |
| 345 | "version": "0.0.0", |
|
345 | "version": "0.0.0", | |
| 346 | "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", |
|
346 | "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz", | |
| 347 | "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", |
|
347 | "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=", | |
| 348 | "dev": true, |
|
348 | "dev": true, | |
| 349 | "requires": { |
|
349 | "requires": { | |
| 350 | "through": "~2.3.4" |
|
350 | "through": "~2.3.4" | |
| 351 | } |
|
351 | } | |
| 352 | }, |
|
352 | }, | |
| 353 | "sprintf": { |
|
353 | "sprintf": { | |
| 354 | "version": "0.1.5", |
|
354 | "version": "0.1.5", | |
| 355 | "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz", |
|
355 | "resolved": "https://registry.npmjs.org/sprintf/-/sprintf-0.1.5.tgz", | |
| 356 | "integrity": "sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8=", |
|
356 | "integrity": "sha1-j4PjmpMXwaUCy324BQ5Rxnn27c8=", | |
| 357 | "dev": true |
|
357 | "dev": true | |
| 358 | }, |
|
358 | }, | |
| 359 | "string.prototype.trim": { |
|
359 | "string.prototype.trim": { | |
| 360 | "version": "1.1.2", |
|
360 | "version": "1.1.2", | |
| 361 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", |
|
361 | "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz", | |
| 362 | "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", |
|
362 | "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=", | |
| 363 | "dev": true, |
|
363 | "dev": true, | |
| 364 | "requires": { |
|
364 | "requires": { | |
| 365 | "define-properties": "^1.1.2", |
|
365 | "define-properties": "^1.1.2", | |
| 366 | "es-abstract": "^1.5.0", |
|
366 | "es-abstract": "^1.5.0", | |
| 367 | "function-bind": "^1.0.2" |
|
367 | "function-bind": "^1.0.2" | |
| 368 | } |
|
368 | } | |
| 369 | }, |
|
369 | }, | |
| 370 | "string_decoder": { |
|
370 | "string_decoder": { | |
| 371 | "version": "0.10.31", |
|
371 | "version": "0.10.31", | |
| 372 | "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", |
|
372 | "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", | |
| 373 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", |
|
373 | "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", | |
| 374 | "dev": true |
|
374 | "dev": true | |
| 375 | }, |
|
375 | }, | |
| 376 | "tap-parser": { |
|
376 | "tap-parser": { | |
| 377 | "version": "0.4.3", |
|
377 | "version": "0.4.3", | |
| 378 | "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.4.3.tgz", |
|
378 | "resolved": "https://registry.npmjs.org/tap-parser/-/tap-parser-0.4.3.tgz", | |
| 379 | "integrity": "sha1-pOrhkMENdsehEZIf84u+TVjwnuo=", |
|
379 | "integrity": "sha1-pOrhkMENdsehEZIf84u+TVjwnuo=", | |
| 380 | "dev": true, |
|
380 | "dev": true, | |
| 381 | "requires": { |
|
381 | "requires": { | |
| 382 | "inherits": "~2.0.1", |
|
382 | "inherits": "~2.0.1", | |
| 383 | "readable-stream": "~1.1.11" |
|
383 | "readable-stream": "~1.1.11" | |
| 384 | } |
|
384 | } | |
| 385 | }, |
|
385 | }, | |
| 386 | "tape": { |
|
386 | "tape": { | |
| 387 | "version": "4.9.2", |
|
387 | "version": "4.9.2", | |
| 388 | "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.2.tgz", |
|
388 | "resolved": "https://registry.npmjs.org/tape/-/tape-4.9.2.tgz", | |
| 389 | "integrity": "sha512-lPXKRKILZ1kZaUy5ynWKs8ATGSUO7HAFHCFnBam6FaGSqPdOwMWbxXHq4EXFLE8WRTleo/YOMXkaUTRmTB1Fiw==", |
|
389 | "integrity": "sha512-lPXKRKILZ1kZaUy5ynWKs8ATGSUO7HAFHCFnBam6FaGSqPdOwMWbxXHq4EXFLE8WRTleo/YOMXkaUTRmTB1Fiw==", | |
| 390 | "dev": true, |
|
390 | "dev": true, | |
| 391 | "requires": { |
|
391 | "requires": { | |
| 392 | "deep-equal": "~1.0.1", |
|
392 | "deep-equal": "~1.0.1", | |
| 393 | "defined": "~1.0.0", |
|
393 | "defined": "~1.0.0", | |
| 394 | "for-each": "~0.3.3", |
|
394 | "for-each": "~0.3.3", | |
| 395 | "function-bind": "~1.1.1", |
|
395 | "function-bind": "~1.1.1", | |
| 396 | "glob": "~7.1.2", |
|
396 | "glob": "~7.1.2", | |
| 397 | "has": "~1.0.3", |
|
397 | "has": "~1.0.3", | |
| 398 | "inherits": "~2.0.3", |
|
398 | "inherits": "~2.0.3", | |
| 399 | "minimist": "~1.2.0", |
|
399 | "minimist": "~1.2.0", | |
| 400 | "object-inspect": "~1.6.0", |
|
400 | "object-inspect": "~1.6.0", | |
| 401 | "resolve": "~1.7.1", |
|
401 | "resolve": "~1.7.1", | |
| 402 | "resumer": "~0.0.0", |
|
402 | "resumer": "~0.0.0", | |
| 403 | "string.prototype.trim": "~1.1.2", |
|
403 | "string.prototype.trim": "~1.1.2", | |
| 404 | "through": "~2.3.8" |
|
404 | "through": "~2.3.8" | |
| 405 | }, |
|
405 | }, | |
| 406 | "dependencies": { |
|
406 | "dependencies": { | |
| 407 | "deep-equal": { |
|
407 | "deep-equal": { | |
| 408 | "version": "1.0.1", |
|
408 | "version": "1.0.1", | |
| 409 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", |
|
409 | "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", | |
| 410 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", |
|
410 | "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=", | |
| 411 | "dev": true |
|
411 | "dev": true | |
| 412 | }, |
|
412 | }, | |
| 413 | "defined": { |
|
413 | "defined": { | |
| 414 | "version": "1.0.0", |
|
414 | "version": "1.0.0", | |
| 415 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", |
|
415 | "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz", | |
| 416 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", |
|
416 | "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=", | |
| 417 | "dev": true |
|
417 | "dev": true | |
| 418 | }, |
|
418 | }, | |
| 419 | "minimist": { |
|
419 | "minimist": { | |
| 420 | "version": "1.2.0", |
|
420 | "version": "1.2.0", | |
| 421 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", |
|
421 | "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", | |
| 422 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", |
|
422 | "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", | |
| 423 | "dev": true |
|
423 | "dev": true | |
| 424 | } |
|
424 | } | |
| 425 | } |
|
425 | } | |
| 426 | }, |
|
426 | }, | |
| 427 | "through": { |
|
427 | "through": { | |
| 428 | "version": "2.3.8", |
|
428 | "version": "2.3.8", | |
| 429 | "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", |
|
429 | "resolved": "http://registry.npmjs.org/through/-/through-2.3.8.tgz", | |
| 430 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", |
|
430 | "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", | |
| 431 | "dev": true |
|
431 | "dev": true | |
| 432 | }, |
|
432 | }, | |
| 433 | "through2": { |
|
433 | "through2": { | |
| 434 | "version": "0.2.3", |
|
434 | "version": "0.2.3", | |
| 435 | "resolved": "http://registry.npmjs.org/through2/-/through2-0.2.3.tgz", |
|
435 | "resolved": "https://registry.npmjs.org/through2/-/through2-0.2.3.tgz", | |
| 436 | "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", |
|
436 | "integrity": "sha1-6zKE2k6jEbbMis42U3SKUqvyWj8=", | |
| 437 | "dev": true, |
|
437 | "dev": true, | |
| 438 | "requires": { |
|
438 | "requires": { | |
| 439 | "readable-stream": "~1.1.9", |
|
439 | "readable-stream": "~1.1.9", | |
| 440 | "xtend": "~2.1.1" |
|
440 | "xtend": "~2.1.1" | |
| 441 | } |
|
441 | } | |
| 442 | }, |
|
442 | }, | |
| 443 | "tslib": { |
|
443 | "tslib": { | |
| 444 | "version": "1.9.3", |
|
444 | "version": "1.9.3", | |
| 445 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", |
|
445 | "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", | |
| 446 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", |
|
446 | "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", | |
| 447 | "dev": true |
|
447 | "dev": true | |
| 448 | }, |
|
448 | }, | |
| 449 | "typescript": { |
|
449 | "typescript": { | |
| 450 | "version": "3.2.2", |
|
450 | "version": "3.2.2", | |
| 451 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", |
|
451 | "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", | |
| 452 | "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", |
|
452 | "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", | |
| 453 | "dev": true |
|
453 | "dev": true | |
| 454 | }, |
|
454 | }, | |
| 455 | "wrappy": { |
|
455 | "wrappy": { | |
| 456 | "version": "1.0.2", |
|
456 | "version": "1.0.2", | |
| 457 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", |
|
457 | "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", | |
| 458 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", |
|
458 | "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", | |
| 459 | "dev": true |
|
459 | "dev": true | |
| 460 | }, |
|
460 | }, | |
| 461 | "xtend": { |
|
461 | "xtend": { | |
| 462 | "version": "2.1.2", |
|
462 | "version": "2.1.2", | |
| 463 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", |
|
463 | "resolved": "https://registry.npmjs.org/xtend/-/xtend-2.1.2.tgz", | |
| 464 | "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", |
|
464 | "integrity": "sha1-bv7MKk2tjmlixJAbM3znuoe10os=", | |
| 465 | "dev": true, |
|
465 | "dev": true, | |
| 466 | "requires": { |
|
466 | "requires": { | |
| 467 | "object-keys": "~0.4.0" |
|
467 | "object-keys": "~0.4.0" | |
| 468 | } |
|
468 | } | |
| 469 | } |
|
469 | } | |
| 470 | } |
|
470 | } | |
| 471 | } |
|
471 | } | |
| @@ -1,66 +1,72 | |||||
| 1 | import { Uuid } from "../Uuid"; |
|
1 | import { Uuid } from "../Uuid"; | |
| 2 | import { argumentNotEmptyString, getGlobal } from "../safe"; |
|
2 | import { argumentNotEmptyString, getGlobal } from "../safe"; | |
| 3 | import { TraceSource, DebugLevel } from "../log/TraceSource"; |
|
3 | import { TraceSource, DebugLevel } from "../log/TraceSource"; | |
| 4 | import m = require("module"); |
|
4 | import m = require("module"); | |
| 5 |
|
5 | |||
| 6 | const sandboxId = Uuid(); |
|
6 | const sandboxId = Uuid(); | |
| 7 | define(sandboxId, ["require"], r => r); |
|
7 | define(sandboxId, ["require"], r => r); | |
| 8 |
|
8 | |||
| 9 | // tslint:disable-next-line:no-var-requires |
|
9 | // tslint:disable-next-line:no-var-requires | |
| 10 | const globalRequire = require(sandboxId); |
|
10 | const globalRequire = require(sandboxId); | |
| 11 |
|
11 | |||
| 12 | const trace = TraceSource.get(m.id); |
|
12 | const trace = TraceSource.get(m.id); | |
| 13 |
|
13 | |||
| 14 | export async function createContextRequire(moduleName: string): Promise<Require> { |
|
14 | export async function createContextRequire(moduleName: string): Promise<Require> { | |
| 15 | argumentNotEmptyString(moduleName, "moduleName"); |
|
15 | argumentNotEmptyString(moduleName, "moduleName"); | |
| 16 |
|
16 | |||
| 17 | const parts = moduleName.split("/"); |
|
17 | const parts = moduleName.split("/"); | |
| 18 | if (parts[0] === ".") |
|
18 | if (parts[0] === ".") | |
| 19 | throw new Error("An absolute module path is required"); |
|
19 | throw new Error("An absolute module path is required"); | |
| 20 |
|
20 | |||
| 21 | if (parts.length > 1) |
|
21 | if (parts.length > 1) | |
| 22 | parts.splice(-1, 1, Uuid()); |
|
22 | parts.splice(-1, 1, Uuid()); | |
| 23 | else |
|
23 | else | |
| 24 | parts.push(Uuid()); |
|
24 | parts.push(Uuid()); | |
| 25 |
|
25 | |||
| 26 | const shim = parts.join("/"); |
|
26 | const shim = parts.join("/"); | |
| 27 |
|
27 | |||
| 28 | trace.debug(`define shim ${shim}`); |
|
28 | trace.debug(`define shim ${shim}`); | |
| 29 |
|
29 | |||
| 30 | return new Promise<Require>(cb => { |
|
30 | return new Promise<Require>(cb => { | |
| 31 | define(shim, ["require"], r => { |
|
31 | define(shim, ["require"], r => { | |
| 32 | trace.debug("shim resolved"); |
|
32 | trace.debug("shim resolved"); | |
| 33 | return r; |
|
33 | return r; | |
| 34 | }); |
|
34 | }); | |
| 35 | require([shim], cb); |
|
35 | require([shim], cb); | |
| 36 | }); |
|
36 | }); | |
| 37 | } |
|
37 | } | |
| 38 |
|
38 | |||
| 39 | class ModuleResolver { |
|
39 | class ModuleResolver { | |
| 40 | _base: string; |
|
40 | _base: string; | |
| 41 | _require: Require; |
|
41 | _require: Require; | |
| 42 |
|
42 | |||
| 43 | constructor(req: Require, base?: string) { |
|
43 | constructor(req: Require, base?: string) { | |
| 44 | this._base = base; |
|
44 | this._base = base; | |
| 45 | this._require = req || globalRequire; |
|
45 | this._require = req || globalRequire; | |
| 46 | } |
|
46 | } | |
| 47 |
|
47 | |||
| 48 | resolve(moduleName: string) { |
|
48 | resolve(moduleName: string) { | |
| 49 | argumentNotEmptyString(moduleName, "moduleName"); |
|
49 | argumentNotEmptyString(moduleName, "moduleName"); | |
| 50 | const resolvedName = moduleName[0] === "." && this._base ? [this._base, moduleName].join("/") : moduleName; |
|
50 | const resolvedName = moduleName[0] === "." && this._base ? [this._base, moduleName].join("/") : moduleName; | |
| 51 | trace.debug(`${moduleName} -> ${resolvedName}`); |
|
51 | trace.debug(`${moduleName} -> ${resolvedName}`); | |
| 52 |
|
52 | |||
| 53 | const req = this._require; |
|
53 | const req = this._require; | |
| 54 |
|
54 | |||
| 55 | return new Promise<any>((cb, eb) => { |
|
55 | return new Promise<any>((cb, eb) => { | |
| 56 | req([resolvedName], cb, eb); |
|
56 | req([resolvedName], cb, eb); | |
| 57 | }); |
|
57 | }); | |
| 58 | } |
|
58 | } | |
| 59 | } |
|
59 | } | |
| 60 |
|
60 | |||
| 61 | export function makeResolver(moduleName: string, contextRequire: Require) { |
|
61 | export function makeResolver(moduleName: string, contextRequire: Require) { | |
|
|
62 | trace.debug( | |||
|
|
63 | "makeResolver moduleName={0}, contextRequire={1}", | |||
|
|
64 | moduleName || "<nil>", | |||
|
|
65 | contextRequire ? typeof (contextRequire) : "<nil>" | |||
|
|
66 | ); | |||
|
|
67 | ||||
| 62 | const base = moduleName && moduleName.split("/").slice(0, -1).join("/"); |
|
68 | const base = moduleName && moduleName.split("/").slice(0, -1).join("/"); | |
| 63 |
|
69 | |||
| 64 | const resolver = new ModuleResolver(contextRequire, base); |
|
70 | const resolver = new ModuleResolver(contextRequire, base); | |
| 65 | return (id: string) => resolver.resolve(id); |
|
71 | return (id: string) => resolver.resolve(id); | |
| 66 | } |
|
72 | } | |
| @@ -1,365 +1,369 | |||||
| 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 { TraceSource } from "../log/TraceSource"; |
|
23 | import { TraceSource } from "../log/TraceSource"; | |
| 24 | import { ConfigError } from "./ConfigError"; |
|
24 | import { ConfigError } from "./ConfigError"; | |
| 25 | import { Cancellation } from "../Cancellation"; |
|
25 | import { Cancellation } from "../Cancellation"; | |
| 26 | import { makeResolver } from "./ResolverHelper"; |
|
26 | import { makeResolver } from "./ResolverHelper"; | |
| 27 | import { ICancellation } from "../interfaces"; |
|
27 | import { ICancellation } from "../interfaces"; | |
| 28 |
|
28 | |||
| 29 | const trace = TraceSource.get("@implab/core/di/Configuration"); |
|
29 | const trace = TraceSource.get("@implab/core/di/Configuration"); | |
| 30 |
|
30 | |||
| 31 | declare const define; |
|
31 | declare const define; | |
| 32 | declare const require; |
|
32 | declare const require; | |
| 33 | declare const module; |
|
33 | declare const module; | |
| 34 |
|
34 | |||
| 35 | function hasAmdLoader() { |
|
35 | function hasAmdLoader() { | |
| 36 | try { |
|
36 | try { | |
| 37 | // es6 may throw the exception |
|
37 | // es6 may throw the exception | |
| 38 | return (typeof define === "function" && define.amd); |
|
38 | return (typeof define === "function" && define.amd); | |
| 39 | } catch { |
|
39 | } catch { | |
| 40 | return false; |
|
40 | return false; | |
| 41 | } |
|
41 | } | |
| 42 | } |
|
42 | } | |
| 43 |
|
43 | |||
| 44 | function hasNodeJs() { |
|
44 | function hasNodeJs() { | |
| 45 | try { |
|
45 | try { | |
| 46 | return (typeof module !== "undefined" && module.exports); |
|
46 | return (typeof module !== "undefined" && module.exports); | |
| 47 | } catch { |
|
47 | } catch { | |
| 48 | return false; |
|
48 | return false; | |
| 49 | } |
|
49 | } | |
| 50 | } |
|
50 | } | |
| 51 |
|
51 | |||
| 52 | async function mapAll(data: object | any[], map?: (v, k) => any): Promise<any> { |
|
52 | async function mapAll(data: object | any[], map?: (v, k) => any): Promise<any> { | |
| 53 | if (data instanceof Array) { |
|
53 | if (data instanceof Array) { | |
| 54 | return Promise.all(map ? data.map(map) : data); |
|
54 | return Promise.all(map ? data.map(map) : data); | |
| 55 | } else { |
|
55 | } else { | |
| 56 | const keys = Object.keys(data); |
|
56 | const keys = Object.keys(data); | |
| 57 |
|
57 | |||
| 58 | const o: any = {}; |
|
58 | const o: any = {}; | |
| 59 |
|
59 | |||
| 60 | await Promise.all(keys.map(async k => { |
|
60 | await Promise.all(keys.map(async k => { | |
| 61 | const v = map ? map(data[k], k) : data[k]; |
|
61 | const v = map ? map(data[k], k) : data[k]; | |
| 62 | o[k] = isPromise(v) ? await v : v; |
|
62 | o[k] = isPromise(v) ? await v : v; | |
| 63 | })); |
|
63 | })); | |
| 64 |
|
64 | |||
| 65 | return o; |
|
65 | return o; | |
| 66 | } |
|
66 | } | |
| 67 | } |
|
67 | } | |
| 68 |
|
68 | |||
| 69 | export type ModuleResolver = (moduleName: string, ct?: ICancellation) => any; |
|
69 | export type ModuleResolver = (moduleName: string, ct?: ICancellation) => any; | |
| 70 |
|
70 | |||
| 71 | type _key = string | number; |
|
71 | type _key = string | number; | |
| 72 |
|
72 | |||
| 73 | export class Configuration { |
|
73 | export class Configuration { | |
| 74 |
|
74 | |||
| 75 | _hasInnerDescriptors = false; |
|
75 | _hasInnerDescriptors = false; | |
| 76 |
|
76 | |||
| 77 | _container: Container; |
|
77 | _container: Container; | |
| 78 |
|
78 | |||
| 79 | _path: Array<_key>; |
|
79 | _path: Array<_key>; | |
| 80 |
|
80 | |||
| 81 | _configName: string; |
|
81 | _configName: string; | |
| 82 |
|
82 | |||
| 83 | _require: ModuleResolver; |
|
83 | _require: ModuleResolver; | |
| 84 |
|
84 | |||
| 85 | constructor(container: Container) { |
|
85 | constructor(container: Container) { | |
| 86 | argumentNotNull(container, container); |
|
86 | argumentNotNull(container, container); | |
| 87 | this._container = container; |
|
87 | this._container = container; | |
| 88 | this._path = []; |
|
88 | this._path = []; | |
| 89 | } |
|
89 | } | |
| 90 |
|
90 | |||
| 91 | async loadConfiguration(moduleName: string, contextRequire?: any, ct = Cancellation.none) { |
|
91 | async loadConfiguration(moduleName: string, contextRequire?: any, ct = Cancellation.none) { | |
| 92 | argumentNotEmptyString(moduleName, "moduleName"); |
|
92 | argumentNotEmptyString(moduleName, "moduleName"); | |
| 93 |
|
93 | |||
| 94 | trace.log("loadConfiguration moduleName={0}", moduleName); |
|
94 | trace.log( | |
|
|
95 | "loadConfiguration moduleName={0}, contextRequire={1}", | |||
|
|
96 | moduleName, | |||
|
|
97 | contextRequire ? typeof (contextRequire) : "<nil>" | |||
|
|
98 | ); | |||
| 95 |
|
99 | |||
| 96 | this._configName = moduleName; |
|
100 | this._configName = moduleName; | |
| 97 |
|
101 | |||
| 98 | const r = makeResolver(null, contextRequire); |
|
102 | const r = makeResolver(null, contextRequire); | |
| 99 |
|
103 | |||
| 100 | const config = await r(moduleName, ct); |
|
104 | const config = await r(moduleName, ct); | |
| 101 |
|
105 | |||
| 102 | await this._applyConfiguration( |
|
106 | await this._applyConfiguration( | |
| 103 | config, |
|
107 | config, | |
| 104 | makeResolver(moduleName, contextRequire), |
|
108 | makeResolver(moduleName, contextRequire), | |
| 105 | ct |
|
109 | ct | |
| 106 | ); |
|
110 | ); | |
| 107 | } |
|
111 | } | |
| 108 |
|
112 | |||
| 109 | applyConfiguration(data: object, contextRequire?: any, ct = Cancellation.none) { |
|
113 | applyConfiguration(data: object, contextRequire?: any, ct = Cancellation.none) { | |
| 110 | argumentNotNull(data, "data"); |
|
114 | argumentNotNull(data, "data"); | |
| 111 |
|
115 | |||
| 112 | return this._applyConfiguration(data, makeResolver(void(0), contextRequire), ct); |
|
116 | return this._applyConfiguration(data, makeResolver(void (0), contextRequire), ct); | |
| 113 | } |
|
117 | } | |
| 114 |
|
118 | |||
| 115 | async _applyConfiguration(data: object, resolver?: ModuleResolver, ct = Cancellation.none) { |
|
119 | async _applyConfiguration(data: object, resolver?: ModuleResolver, ct = Cancellation.none) { | |
| 116 | trace.log("applyConfiguration"); |
|
120 | trace.log("applyConfiguration"); | |
| 117 |
|
121 | |||
| 118 | this._configName = "$"; |
|
122 | this._configName = "$"; | |
| 119 |
|
123 | |||
| 120 | if (resolver) |
|
124 | if (resolver) | |
| 121 | this._require = resolver; |
|
125 | this._require = resolver; | |
| 122 |
|
126 | |||
| 123 | let services: ServiceMap; |
|
127 | let services: ServiceMap; | |
| 124 |
|
128 | |||
| 125 | try { |
|
129 | try { | |
| 126 | services = await this._visitRegistrations(data, "$"); |
|
130 | services = await this._visitRegistrations(data, "$"); | |
| 127 | } catch (e) { |
|
131 | } catch (e) { | |
| 128 | throw this._makeError(e); |
|
132 | throw this._makeError(e); | |
| 129 | } |
|
133 | } | |
| 130 |
|
134 | |||
| 131 | this._container.register(services); |
|
135 | this._container.register(services); | |
| 132 | } |
|
136 | } | |
| 133 |
|
137 | |||
| 134 | _makeError(inner) { |
|
138 | _makeError(inner) { | |
| 135 | const e = new ConfigError("Failed to load configuration", inner); |
|
139 | const e = new ConfigError("Failed to load configuration", inner); | |
| 136 | e.configName = this._configName; |
|
140 | e.configName = this._configName; | |
| 137 | e.path = this._makePath(); |
|
141 | e.path = this._makePath(); | |
| 138 | return e; |
|
142 | return e; | |
| 139 | } |
|
143 | } | |
| 140 |
|
144 | |||
| 141 | _makePath() { |
|
145 | _makePath() { | |
| 142 | return this._path |
|
146 | return this._path | |
| 143 | .reduce( |
|
147 | .reduce( | |
| 144 | (prev, cur) => typeof cur === "number" ? |
|
148 | (prev, cur) => typeof cur === "number" ? | |
| 145 | `${prev}[${cur}]` : |
|
149 | `${prev}[${cur}]` : | |
| 146 | `${prev}.${cur}` |
|
150 | `${prev}.${cur}` | |
| 147 | ) |
|
151 | ) | |
| 148 | .toString(); |
|
152 | .toString(); | |
| 149 | } |
|
153 | } | |
| 150 |
|
154 | |||
| 151 | async _resolveType(moduleName: string, localName: string) { |
|
155 | async _resolveType(moduleName: string, localName: string) { | |
| 152 | trace.log("resolveType moduleName={0}, localName={1}", moduleName, localName); |
|
156 | trace.log("resolveType moduleName={0}, localName={1}", moduleName, localName); | |
| 153 | try { |
|
157 | try { | |
| 154 | const m = await this._loadModule(moduleName); |
|
158 | const m = await this._loadModule(moduleName); | |
| 155 | return localName ? get(localName, m) : m; |
|
159 | return localName ? get(localName, m) : m; | |
| 156 | } catch (e) { |
|
160 | } catch (e) { | |
| 157 | trace.error("Failed to resolve type moduleName={0}, localName={1}", moduleName, localName); |
|
161 | trace.error("Failed to resolve type moduleName={0}, localName={1}", moduleName, localName); | |
| 158 | throw e; |
|
162 | throw e; | |
| 159 | } |
|
163 | } | |
| 160 | } |
|
164 | } | |
| 161 |
|
165 | |||
| 162 | _loadModule(moduleName: string) { |
|
166 | _loadModule(moduleName: string) { | |
| 163 | trace.debug("loadModule {0}", moduleName); |
|
167 | trace.debug("loadModule {0}", moduleName); | |
| 164 |
|
168 | |||
| 165 | return this._require(moduleName); |
|
169 | return this._require(moduleName); | |
| 166 | } |
|
170 | } | |
| 167 |
|
171 | |||
| 168 | async _visitRegistrations(data, name: _key) { |
|
172 | async _visitRegistrations(data, name: _key) { | |
| 169 | this._enter(name); |
|
173 | this._enter(name); | |
| 170 |
|
174 | |||
| 171 | if (data.constructor && |
|
175 | if (data.constructor && | |
| 172 | data.constructor.prototype !== Object.prototype) |
|
176 | data.constructor.prototype !== Object.prototype) | |
| 173 | throw new Error("Configuration must be a simple object"); |
|
177 | throw new Error("Configuration must be a simple object"); | |
| 174 |
|
178 | |||
| 175 | const o: ServiceMap = {}; |
|
179 | const o: ServiceMap = {}; | |
| 176 | const keys = Object.keys(data); |
|
180 | const keys = Object.keys(data); | |
| 177 |
|
181 | |||
| 178 | const services = await mapAll(data, async (v, k) => { |
|
182 | const services = await mapAll(data, async (v, k) => { | |
| 179 | const d = await this._visit(v, k); |
|
183 | const d = await this._visit(v, k); | |
| 180 | return isDescriptor(d) ? d : new AggregateDescriptor(d); |
|
184 | return isDescriptor(d) ? d : new AggregateDescriptor(d); | |
| 181 | }) as ServiceMap; |
|
185 | }) as ServiceMap; | |
| 182 |
|
186 | |||
| 183 | this._leave(); |
|
187 | this._leave(); | |
| 184 |
|
188 | |||
| 185 | return services; |
|
189 | return services; | |
| 186 | } |
|
190 | } | |
| 187 |
|
191 | |||
| 188 | _enter(name: _key) { |
|
192 | _enter(name: _key) { | |
| 189 | this._path.push(name); |
|
193 | this._path.push(name); | |
| 190 | trace.debug(">{0}", name); |
|
194 | trace.debug(">{0}", name); | |
| 191 | } |
|
195 | } | |
| 192 |
|
196 | |||
| 193 | _leave() { |
|
197 | _leave() { | |
| 194 | const name = this._path.pop(); |
|
198 | const name = this._path.pop(); | |
| 195 | trace.debug("<{0}", name); |
|
199 | trace.debug("<{0}", name); | |
| 196 | } |
|
200 | } | |
| 197 |
|
201 | |||
| 198 | _visit(data, name: string): Promise<any> { |
|
202 | _visit(data, name: string): Promise<any> { | |
| 199 | if (isPrimitive(data) || isDescriptor(data)) |
|
203 | if (isPrimitive(data) || isDescriptor(data)) | |
| 200 | return data; |
|
204 | return data; | |
| 201 |
|
205 | |||
| 202 | if (isDependencyRegistration(data)) { |
|
206 | if (isDependencyRegistration(data)) { | |
| 203 | return this._visitDependencyRegistration(data, name); |
|
207 | return this._visitDependencyRegistration(data, name); | |
| 204 | } else if (isValueRegistration(data)) { |
|
208 | } else if (isValueRegistration(data)) { | |
| 205 | return this._visitValueRegistration(data, name); |
|
209 | return this._visitValueRegistration(data, name); | |
| 206 | } else if (isTypeRegistration(data)) { |
|
210 | } else if (isTypeRegistration(data)) { | |
| 207 | return this._visitTypeRegistration(data, name); |
|
211 | return this._visitTypeRegistration(data, name); | |
| 208 | } else if (isFactoryRegistration(data)) { |
|
212 | } else if (isFactoryRegistration(data)) { | |
| 209 | return this._visitFactoryRegistration(data, name); |
|
213 | return this._visitFactoryRegistration(data, name); | |
| 210 | } else if (data instanceof Array) { |
|
214 | } else if (data instanceof Array) { | |
| 211 | return this._visitArray(data, name); |
|
215 | return this._visitArray(data, name); | |
| 212 | } |
|
216 | } | |
| 213 |
|
217 | |||
| 214 | return this._visitObject(data, name); |
|
218 | return this._visitObject(data, name); | |
| 215 | } |
|
219 | } | |
| 216 |
|
220 | |||
| 217 | async _visitObject(data: object, name: _key) { |
|
221 | async _visitObject(data: object, name: _key) { | |
| 218 | if (data.constructor && |
|
222 | if (data.constructor && | |
| 219 | data.constructor.prototype !== Object.prototype) |
|
223 | data.constructor.prototype !== Object.prototype) | |
| 220 | return new ValueDescriptor(data); |
|
224 | return new ValueDescriptor(data); | |
| 221 |
|
225 | |||
| 222 | this._enter(name); |
|
226 | this._enter(name); | |
| 223 |
|
227 | |||
| 224 | const v = await mapAll(data, delegate(this, "_visit")); |
|
228 | const v = await mapAll(data, delegate(this, "_visit")); | |
| 225 |
|
229 | |||
| 226 | // TODO: handle inline descriptors properly |
|
230 | // TODO: handle inline descriptors properly | |
| 227 | // const ex = { |
|
231 | // const ex = { | |
| 228 | // activate(ctx) { |
|
232 | // activate(ctx) { | |
| 229 | // const value = ctx.activate(this.prop, "prop"); |
|
233 | // const value = ctx.activate(this.prop, "prop"); | |
| 230 | // // some code |
|
234 | // // some code | |
| 231 | // }, |
|
235 | // }, | |
| 232 | // // will be turned to ReferenceDescriptor |
|
236 | // // will be turned to ReferenceDescriptor | |
| 233 | // prop: { $dependency: "depName" } |
|
237 | // prop: { $dependency: "depName" } | |
| 234 | // }; |
|
238 | // }; | |
| 235 |
|
239 | |||
| 236 | this._leave(); |
|
240 | this._leave(); | |
| 237 | return v; |
|
241 | return v; | |
| 238 | } |
|
242 | } | |
| 239 |
|
243 | |||
| 240 | async _visitArray(data: any[], name: _key) { |
|
244 | async _visitArray(data: any[], name: _key) { | |
| 241 | if (data.constructor && |
|
245 | if (data.constructor && | |
| 242 | data.constructor.prototype !== Array.prototype) |
|
246 | data.constructor.prototype !== Array.prototype) | |
| 243 | return new ValueDescriptor(data); |
|
247 | return new ValueDescriptor(data); | |
| 244 |
|
248 | |||
| 245 | this._enter(name); |
|
249 | this._enter(name); | |
| 246 |
|
250 | |||
| 247 | const v = await mapAll(data, delegate(this, "_visit")); |
|
251 | const v = await mapAll(data, delegate(this, "_visit")); | |
| 248 | this._leave(); |
|
252 | this._leave(); | |
| 249 |
|
253 | |||
| 250 | return v; |
|
254 | return v; | |
| 251 | } |
|
255 | } | |
| 252 |
|
256 | |||
| 253 | _makeServiceParams(data: ServiceRegistration) { |
|
257 | _makeServiceParams(data: ServiceRegistration) { | |
| 254 | const opts: any = { |
|
258 | const opts: any = { | |
| 255 | owner: this._container |
|
259 | owner: this._container | |
| 256 | }; |
|
260 | }; | |
| 257 | if (data.services) |
|
261 | if (data.services) | |
| 258 | opts.services = this._visitRegistrations(data.services, "services"); |
|
262 | opts.services = this._visitRegistrations(data.services, "services"); | |
| 259 |
|
263 | |||
| 260 | if (data.inject) { |
|
264 | if (data.inject) { | |
| 261 | this._path.push("inject"); |
|
265 | this._path.push("inject"); | |
| 262 | opts.inject = mapAll( |
|
266 | opts.inject = mapAll( | |
| 263 | data.inject instanceof Array ? |
|
267 | data.inject instanceof Array ? | |
| 264 | data.inject : |
|
268 | data.inject : | |
| 265 | [data.inject], |
|
269 | [data.inject], | |
| 266 | delegate(this, "_visitObject") |
|
270 | delegate(this, "_visitObject") | |
| 267 | ); |
|
271 | ); | |
| 268 | this._leave(); |
|
272 | this._leave(); | |
| 269 | } |
|
273 | } | |
| 270 |
|
274 | |||
| 271 | if ("params" in data) |
|
275 | if ("params" in data) | |
| 272 | opts.params = data.params instanceof Array ? |
|
276 | opts.params = data.params instanceof Array ? | |
| 273 | this._visitArray(data.params, "params") : |
|
277 | this._visitArray(data.params, "params") : | |
| 274 | this._visit(data.params, "params"); |
|
278 | this._visit(data.params, "params"); | |
| 275 |
|
279 | |||
| 276 | if (data.activation) { |
|
280 | if (data.activation) { | |
| 277 | if (typeof (data.activation) === "string") { |
|
281 | if (typeof (data.activation) === "string") { | |
| 278 | switch (data.activation.toLowerCase()) { |
|
282 | switch (data.activation.toLowerCase()) { | |
| 279 | case "singleton": |
|
283 | case "singleton": | |
| 280 | opts.activation = ActivationType.Singleton; |
|
284 | opts.activation = ActivationType.Singleton; | |
| 281 | break; |
|
285 | break; | |
| 282 | case "container": |
|
286 | case "container": | |
| 283 | opts.activation = ActivationType.Container; |
|
287 | opts.activation = ActivationType.Container; | |
| 284 | break; |
|
288 | break; | |
| 285 | case "hierarchy": |
|
289 | case "hierarchy": | |
| 286 | opts.activation = ActivationType.Hierarchy; |
|
290 | opts.activation = ActivationType.Hierarchy; | |
| 287 | break; |
|
291 | break; | |
| 288 | case "context": |
|
292 | case "context": | |
| 289 | opts.activation = ActivationType.Context; |
|
293 | opts.activation = ActivationType.Context; | |
| 290 | break; |
|
294 | break; | |
| 291 | case "call": |
|
295 | case "call": | |
| 292 | opts.activation = ActivationType.Call; |
|
296 | opts.activation = ActivationType.Call; | |
| 293 | break; |
|
297 | break; | |
| 294 | default: |
|
298 | default: | |
| 295 | throw new Error("Unknown activation type: " + |
|
299 | throw new Error("Unknown activation type: " + | |
| 296 | data.activation); |
|
300 | data.activation); | |
| 297 | } |
|
301 | } | |
| 298 | } else { |
|
302 | } else { | |
| 299 | opts.activation = Number(data.activation); |
|
303 | opts.activation = Number(data.activation); | |
| 300 | } |
|
304 | } | |
| 301 | } |
|
305 | } | |
| 302 |
|
306 | |||
| 303 | if (data.cleanup) |
|
307 | if (data.cleanup) | |
| 304 | opts.cleanup = data.cleanup; |
|
308 | opts.cleanup = data.cleanup; | |
| 305 |
|
309 | |||
| 306 | return opts; |
|
310 | return opts; | |
| 307 | } |
|
311 | } | |
| 308 |
|
312 | |||
| 309 | async _visitValueRegistration(data: ValueRegistration, name: _key) { |
|
313 | async _visitValueRegistration(data: ValueRegistration, name: _key) { | |
| 310 | this._enter(name); |
|
314 | this._enter(name); | |
| 311 | const d = data.parse ? new AggregateDescriptor(data.$value) : new ValueDescriptor(data.$value); |
|
315 | const d = data.parse ? new AggregateDescriptor(data.$value) : new ValueDescriptor(data.$value); | |
| 312 | this._leave(); |
|
316 | this._leave(); | |
| 313 | return d; |
|
317 | return d; | |
| 314 | } |
|
318 | } | |
| 315 |
|
319 | |||
| 316 | async _visitDependencyRegistration(data: DependencyRegistration, name: _key) { |
|
320 | async _visitDependencyRegistration(data: DependencyRegistration, name: _key) { | |
| 317 | argumentNotEmptyString(data && data.$dependency, "data.$dependency"); |
|
321 | argumentNotEmptyString(data && data.$dependency, "data.$dependency"); | |
| 318 | this._enter(name); |
|
322 | this._enter(name); | |
| 319 | const d = new ReferenceDescriptor({ |
|
323 | const d = new ReferenceDescriptor({ | |
| 320 | name: data.$dependency, |
|
324 | name: data.$dependency, | |
| 321 | lazy: data.lazy, |
|
325 | lazy: data.lazy, | |
| 322 | optional: data.optional, |
|
326 | optional: data.optional, | |
| 323 | default: data.default, |
|
327 | default: data.default, | |
| 324 | services: data.services && await this._visitRegistrations(data.services, "services") |
|
328 | services: data.services && await this._visitRegistrations(data.services, "services") | |
| 325 | }); |
|
329 | }); | |
| 326 | this._leave(); |
|
330 | this._leave(); | |
| 327 | return d; |
|
331 | return d; | |
| 328 | } |
|
332 | } | |
| 329 |
|
333 | |||
| 330 | async _visitTypeRegistration(data: TypeRegistration, name: _key) { |
|
334 | async _visitTypeRegistration(data: TypeRegistration, name: _key) { | |
| 331 | argumentNotNull(data.$type, "data.$type"); |
|
335 | argumentNotNull(data.$type, "data.$type"); | |
| 332 | this._enter(name); |
|
336 | this._enter(name); | |
| 333 |
|
337 | |||
| 334 | const opts = this._makeServiceParams(data); |
|
338 | const opts = this._makeServiceParams(data); | |
| 335 | if (data.$type instanceof Function) { |
|
339 | if (data.$type instanceof Function) { | |
| 336 | opts.type = data.$type; |
|
340 | opts.type = data.$type; | |
| 337 | } else { |
|
341 | } else { | |
| 338 | const [moduleName, typeName] = data.$type.split(":", 2); |
|
342 | const [moduleName, typeName] = data.$type.split(":", 2); | |
| 339 | opts.type = this._resolveType(moduleName, typeName); |
|
343 | opts.type = this._resolveType(moduleName, typeName); | |
| 340 | } |
|
344 | } | |
| 341 |
|
345 | |||
| 342 | const d = new TypeServiceDescriptor( |
|
346 | const d = new TypeServiceDescriptor( | |
| 343 | await mapAll(opts) |
|
347 | await mapAll(opts) | |
| 344 | ); |
|
348 | ); | |
| 345 |
|
349 | |||
| 346 | this._leave(); |
|
350 | this._leave(); | |
| 347 |
|
351 | |||
| 348 | return d; |
|
352 | return d; | |
| 349 | } |
|
353 | } | |
| 350 |
|
354 | |||
| 351 | async _visitFactoryRegistration(data: FactoryRegistration, name: _key) { |
|
355 | async _visitFactoryRegistration(data: FactoryRegistration, name: _key) { | |
| 352 | argumentOfType(data.$factory, Function, "data.$type"); |
|
356 | argumentOfType(data.$factory, Function, "data.$type"); | |
| 353 | this._enter(name); |
|
357 | this._enter(name); | |
| 354 |
|
358 | |||
| 355 | const opts = this._makeServiceParams(data); |
|
359 | const opts = this._makeServiceParams(data); | |
| 356 | opts.factory = opts.$factory; |
|
360 | opts.factory = opts.$factory; | |
| 357 |
|
361 | |||
| 358 | const d = new FactoryServiceDescriptor( |
|
362 | const d = new FactoryServiceDescriptor( | |
| 359 | await mapAll(opts) |
|
363 | await mapAll(opts) | |
| 360 | ); |
|
364 | ); | |
| 361 |
|
365 | |||
| 362 | this._leave(); |
|
366 | this._leave(); | |
| 363 | return d; |
|
367 | return d; | |
| 364 | } |
|
368 | } | |
| 365 | } |
|
369 | } | |
| @@ -1,93 +1,93 | |||||
| 1 | import { test } from "./TestTraits"; |
|
1 | import { test } from "./TestTraits"; | |
| 2 | import { Container } from "@implab/core/di/Container"; |
|
2 | import { Container } from "@implab/core/di/Container"; | |
| 3 | import { ReferenceDescriptor } from "@implab/core/di/ReferenceDescriptor"; |
|
3 | import { ReferenceDescriptor } from "@implab/core/di/ReferenceDescriptor"; | |
| 4 | import { AggregateDescriptor } from "@implab/core/di/AggregateDescriptor"; |
|
4 | import { AggregateDescriptor } from "@implab/core/di/AggregateDescriptor"; | |
| 5 | import { ValueDescriptor } from "@implab/core/di/ValueDescriptor"; |
|
5 | import { ValueDescriptor } from "@implab/core/di/ValueDescriptor"; | |
| 6 | import { Foo } from "./mock/Foo"; |
|
6 | import { Foo } from "./mock/Foo"; | |
| 7 | import { Bar } from "./mock/Bar"; |
|
7 | import { Bar } from "./mock/Bar"; | |
| 8 | import { isNull } from "@implab/core/safe"; |
|
8 | import { isNull } from "@implab/core/safe"; | |
| 9 |
|
9 | |||
| 10 | test("Container register/resolve tests", async t => { |
|
10 | test("Container register/resolve tests", async t => { | |
| 11 | const container = new Container(); |
|
11 | const container = new Container(); | |
| 12 |
|
12 | |||
| 13 | const connection1 = "db://localhost"; |
|
13 | const connection1 = "db://localhost"; | |
| 14 |
|
14 | |||
| 15 | t.throws( |
|
15 | t.throws( | |
| 16 | () => container.register("bla-bla", "bla-bla"), |
|
16 | () => container.register("bla-bla", "bla-bla"), | |
| 17 | "Do not allow to register anything other than descriptors" |
|
17 | "Do not allow to register anything other than descriptors" | |
| 18 | ); |
|
18 | ); | |
| 19 |
|
19 | |||
| 20 | t.doesNotThrow( |
|
20 | t.doesNotThrow( | |
| 21 | () => container.register("connection", new ValueDescriptor(connection1)), |
|
21 | () => container.register("connection", new ValueDescriptor(connection1)), | |
| 22 | "register ValueDescriptor" |
|
22 | "register ValueDescriptor" | |
| 23 | ); |
|
23 | ); | |
| 24 |
|
24 | |||
| 25 | t.equals(container.resolve("connection"), connection1, "resolve string value"); |
|
25 | t.equals(container.resolve("connection"), connection1, "resolve string value"); | |
| 26 |
|
26 | |||
| 27 | t.doesNotThrow( |
|
27 | t.doesNotThrow( | |
| 28 | () => container.register( |
|
28 | () => container.register( | |
| 29 | "dbParams", |
|
29 | "dbParams", | |
| 30 | new AggregateDescriptor({ |
|
30 | new AggregateDescriptor({ | |
| 31 | timeout: 10, |
|
31 | timeout: 10, | |
| 32 | connection: new ReferenceDescriptor({ name: "connection" }) |
|
32 | connection: new ReferenceDescriptor({ name: "connection" }) | |
| 33 | }) |
|
33 | }) | |
| 34 | ), |
|
34 | ), | |
| 35 | "register AggregateDescriptor" |
|
35 | "register AggregateDescriptor" | |
| 36 | ); |
|
36 | ); | |
| 37 |
|
37 | |||
| 38 | const dbParams = container.resolve("dbParams"); |
|
38 | const dbParams = container.resolve("dbParams"); | |
| 39 | t.equals(dbParams.connection, connection1, "should get string value 'dbParams.connection'"); |
|
39 | t.equals(dbParams.connection, connection1, "should get string value 'dbParams.connection'"); | |
| 40 | }); |
|
40 | }); | |
| 41 |
|
41 | |||
| 42 | test("Container configure/resolve tests", async t => { |
|
42 | test("Container configure/resolve tests", async t => { | |
| 43 |
|
43 | |||
| 44 | const container = new Container(); |
|
44 | const container = new Container(); | |
| 45 |
|
45 | |||
| 46 | await container.configure({ |
|
46 | await container.configure({ | |
| 47 | foo: { |
|
47 | foo: { | |
| 48 | $type: Foo |
|
48 | $type: Foo | |
| 49 | }, |
|
49 | }, | |
| 50 |
|
50 | |||
| 51 | box: { |
|
51 | box: { | |
| 52 | $type: Bar, |
|
52 | $type: Bar, | |
| 53 | params: { |
|
53 | params: { | |
| 54 | $dependency: "foo" |
|
54 | $dependency: "foo" | |
| 55 | } |
|
55 | } | |
| 56 | }, |
|
56 | }, | |
| 57 |
|
57 | |||
| 58 | bar: { |
|
58 | bar: { | |
| 59 | $type: Bar, |
|
59 | $type: Bar, | |
| 60 | params: { |
|
60 | params: { | |
| 61 | db: { |
|
61 | db: { | |
| 62 | provider: { |
|
62 | provider: { | |
| 63 | $dependency: "db" |
|
63 | $dependency: "db" | |
| 64 | } |
|
64 | } | |
| 65 | } |
|
65 | } | |
| 66 | } |
|
66 | } | |
| 67 | } |
|
67 | } | |
| 68 | }); |
|
68 | }); | |
| 69 | t.pass("should configure from js object"); |
|
69 | t.pass("should configure from js object"); | |
| 70 |
|
70 | |||
| 71 | const f1 = container.resolve("foo"); |
|
71 | const f1 = container.resolve("foo"); | |
| 72 |
|
72 | |||
| 73 | t.assert(!isNull(f1), "foo should be not null"); |
|
73 | t.assert(!isNull(f1), "foo should be not null"); | |
| 74 |
|
74 | |||
| 75 | t.throws(() => container.resolve("bar"), "should not resolve dependency 'db'"); |
|
75 | t.throws(() => container.resolve("bar"), "should not resolve dependency 'db'"); | |
| 76 |
|
76 | |||
| 77 | }); |
|
77 | }); | |
| 78 |
|
78 | |||
| 79 | test("Load configuration from module", async t => { |
|
79 | test("Load configuration from module", async t => { | |
| 80 | const container = new Container(); |
|
80 | const container = new Container(); | |
| 81 |
|
81 | |||
| 82 |
await container.configure(" |
|
82 | await container.configure("./mock/config1", { contextRequire: require }); | |
| 83 | t.pass("The configuration should load"); |
|
83 | t.pass("The configuration should load"); | |
| 84 |
|
84 | |||
| 85 | const f1 = container.resolve("foo"); |
|
85 | const f1 = container.resolve("foo"); | |
| 86 |
|
86 | |||
| 87 | t.assert(!isNull(f1), "foo should be not null"); |
|
87 | t.assert(!isNull(f1), "foo should be not null"); | |
| 88 |
|
88 | |||
| 89 | const b1 = container.resolve("bar") as Bar; |
|
89 | const b1 = container.resolve("bar") as Bar; | |
| 90 |
|
90 | |||
| 91 | t.assert(!isNull(b1), "bar should not be null"); |
|
91 | t.assert(!isNull(b1), "bar should not be null"); | |
| 92 | t.assert(!isNull(b1.foo), "bar.foo should not be null"); |
|
92 | t.assert(!isNull(b1.foo), "bar.foo should not be null"); | |
| 93 | }); |
|
93 | }); | |
| 1 | NO CONTENT: file was removed |
|
NO CONTENT: file was removed |
General Comments 0
You need to be logged in to leave comments.
Login now
