##// END OF EJS Templates
typescript strict mode...
cin -
r1:b6ccfccf314f default
parent child
Show More
1 NO CONTENT: new file 100644
NO CONTENT: new file 100644
@@ -0,0 +1,148
1 import { stringify } from "yaml";
2
3 export interface TapWriter {
4 version(): void;
5 plan(n: number): void;
6 fail(e: any): void;
7 ok(msg: string): void;
8 skip(msg: string): void;
9 bailOut(msg: string): void;
10 comment(msg: string): void;
11 yaml(data: any): void;
12 end(): void;
13 }
14
15 enum TapState {
16 Init,
17 VersionWritten,
18 Ready,
19 ReadyWithoutPlan,
20 End
21 }
22
23 export abstract class AbstractTapWriter implements TapWriter {
24 private _state = TapState.Init;
25 private _version = 13;
26 private _testIndex = 1;
27
28 private _moveVersion() {
29 switch (this._state) {
30 case TapState.Init:
31 this._state = TapState.VersionWritten;
32 break;
33 default:
34 throw new Error("Invalid operation");
35 }
36
37 }
38
39 private _movePlan() {
40 switch (this._state) {
41 case TapState.Init:
42 case TapState.VersionWritten:
43 this._state = TapState.Ready;
44 break;
45 case TapState.ReadyWithoutPlan:
46 this._state = TapState.End;
47 break;
48 default:
49 throw new Error("Invalid operation");
50 }
51 }
52
53 private _moveTestResult() {
54 switch (this._state) {
55 case TapState.Init:
56 case TapState.VersionWritten:
57 this._state = TapState.ReadyWithoutPlan;
58 break;
59 case TapState.Ready:
60 case TapState.ReadyWithoutPlan:
61 break;
62 default:
63 throw new Error("Invalid operation");
64 }
65 }
66
67 private _moveEnd() {
68 switch (this._state) {
69 case TapState.End:
70 throw new Error("Invalid operation");
71 default:
72 this._state = TapState.End;
73 }
74 }
75
76 private _moveDiag() {
77 switch (this._state) {
78 case TapState.Init:
79 case TapState.VersionWritten:
80 this._state = TapState.ReadyWithoutPlan;
81 break;
82 case TapState.Ready:
83 case TapState.ReadyWithoutPlan:
84 break;
85 default:
86 throw new Error("Invalid operation");
87 }
88 }
89
90 version() {
91 this._moveVersion();
92
93 this._writeLine(`TAP version ${this._version}`);
94 }
95
96 plan(n: number) {
97 this._movePlan();
98
99 this._writeLine(`1..${n}`);
100 }
101
102 fail(e: any) {
103 this._moveTestResult();
104
105 this._writeText(`not ok ${this._testIndex} ${e}`);
106 this._testIndex++;
107 }
108
109 ok(msg: string) {
110 this._moveTestResult();
111
112 this._writeText(`ok ${this._testIndex} ${msg}`);
113 this._testIndex++;
114 }
115 skip(msg: string) {
116 this._moveTestResult();
117
118 this._writeText(`ok ${this._testIndex} # SKIPPED: ${msg}`);
119 this._testIndex++;
120 }
121 bailOut(msg: string) {
122 this._moveEnd();
123
124 this._writeText(`Bail out! ${msg}`);
125 }
126 comment(msg: string) {
127 this._moveDiag();
128
129 this._writeText(`# ${msg}`);
130 }
131 yaml(data: any) {
132 this._moveDiag();
133
134 this._writeLine(" ---");
135 stringify(data).split("\r\n?").forEach(line => this._writeLine(" " + line));
136 this._writeLine(" ...");
137 }
138 end() {
139 this._moveEnd();
140 }
141
142 private _writeText(text: string) {
143 text.split("\r\n?").forEach((line, i) => this._writeLine(i ? "# " + line : line));
144 }
145
146 abstract _writeLine(text: string): void;
147
148 }
@@ -0,0 +1,18
1 import { AbstractTapWriter } from "./Tap";
2 import { TextWriter } from "@implab/core-amd/interfaces";
3
4 export class TextTapWriter extends AbstractTapWriter {
5
6 private readonly _writer: TextWriter;
7
8 constructor(writer: TextWriter) {
9 super();
10
11 this._writer = writer;
12 }
13
14 _writeLine(text: string) {
15 this._writer.writeLine(text);
16 }
17
18 } No newline at end of file
@@ -8,6 +8,7 typescript {
8 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
8 lib = ["es5", "dom", "scripthost", "es2015.promise", "es2015.symbol", "es2015.iterable"]
9 listFiles = true
9 listFiles = true
10 declaration = true
10 declaration = true
11 strict = true
11 types = []
12 types = []
12 module = "amd"
13 module = "amd"
13 it.target = "es5"
14 it.target = "es5"
This diff has been collapsed as it changes many lines, (511 lines changed) Show them Hide them
@@ -22,6 +22,15
22 "js-tokens": "^4.0.0"
22 "js-tokens": "^4.0.0"
23 }
23 }
24 },
24 },
25 "@babel/runtime": {
26 "version": "7.8.3",
27 "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.8.3.tgz",
28 "integrity": "sha512-fVHx1rzEmwB130VTkLnxR+HmxcTjGzH12LYQcFFoBwakMd3aOMD4OsRN7tGG/UOYE2ektgFrS8uACAoRk1CY0w==",
29 "dev": true,
30 "requires": {
31 "regenerator-runtime": "^0.13.2"
32 }
33 },
25 "@implab/core-amd": {
34 "@implab/core-amd": {
26 "version": "1.3.2",
35 "version": "1.3.2",
27 "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.3.2.tgz",
36 "resolved": "https://registry.npmjs.org/@implab/core-amd/-/core-amd-1.3.2.tgz",
@@ -29,15 +38,9
29 "dev": true
38 "dev": true
30 },
39 },
31 "@types/chai": {
40 "@types/chai": {
32 "version": "4.2.7",
41 "version": "4.1.3",
33 "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.7.tgz",
42 "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.1.3.tgz",
34 "integrity": "sha512-luq8meHGYwvky0O7u0eQZdA7B4Wd9owUCqvbw2m3XCrCU8mplYOujMBbvyS547AxJkC+pGnd0Cm15eNxEUNU8g==",
43 "integrity": "sha512-f5dXGzOJycyzSMdaXVhiBhauL4dYydXwVpavfQ1mVCaGjR56a9QfklXObUxlIY9bGTmCPHEEZ04I16BZ/8w5ww==",
35 "dev": true
36 },
37 "@types/node": {
38 "version": "8.0.0",
39 "resolved": "https://registry.npmjs.org/@types/node/-/node-8.0.0.tgz",
40 "integrity": "sha512-j2tekvJCO7j22cs+LO6i0kRPhmQ9MXaPZ55TzOc1lzkN5b6BWqq4AFjl04s1oRRQ1v5rSe+KEvnLUSTonuls/A==",
41 "dev": true
44 "dev": true
42 },
45 },
43 "@types/requirejs": {
46 "@types/requirejs": {
@@ -46,14 +49,11
46 "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==",
49 "integrity": "sha512-b2soeyuU76rMbcRJ4e0hEl0tbMhFwZeTC0VZnfuWlfGlk6BwWNsev6kFu/twKABPX29wkX84wU2o+cEJoXsiTw==",
47 "dev": true
50 "dev": true
48 },
51 },
49 "@types/tape": {
52 "@types/yaml": {
50 "version": "4.2.33",
53 "version": "1.2.0",
51 "resolved": "https://registry.npmjs.org/@types/tape/-/tape-4.2.33.tgz",
54 "resolved": "https://registry.npmjs.org/@types/yaml/-/yaml-1.2.0.tgz",
52 "integrity": "sha512-ltfyuY5BIkYlGuQfwqzTDT8f0q8Z5DGppvUnWGs39oqDmMd6/UWhNpX3ZMh/VYvfxs3rFGHMrLC/eGRdLiDGuw==",
55 "integrity": "sha512-GW8b9qM+ebgW3/zjzPm0I1NxMvLaz/YKT9Ph6tTb+Fkeyzd9yLTvQ6ciQ2MorTRmb/qXmfjMerRpG4LviixaqQ==",
53 "dev": true,
56 "dev": true
54 "requires": {
55 "@types/node": "*"
56 }
57 },
57 },
58 "acorn": {
58 "acorn": {
59 "version": "7.1.0",
59 "version": "7.1.0",
@@ -80,15 +80,18
80 }
80 }
81 },
81 },
82 "ansi-escapes": {
82 "ansi-escapes": {
83 "version": "3.2.0",
83 "version": "4.3.0",
84 "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz",
84 "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.0.tgz",
85 "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==",
85 "integrity": "sha512-EiYhwo0v255HUL6eDyuLrXEkTi7WwVCLAw+SeOQ7M7qdun1z1pum4DEm/nuqIVbPvi9RPPc9k9LbyBv6H0DwVg==",
86 "dev": true
86 "dev": true,
87 "requires": {
88 "type-fest": "^0.8.1"
89 }
87 },
90 },
88 "ansi-regex": {
91 "ansi-regex": {
89 "version": "3.0.0",
92 "version": "5.0.0",
90 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz",
93 "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz",
91 "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=",
94 "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==",
92 "dev": true
95 "dev": true
93 },
96 },
94 "ansi-styles": {
97 "ansi-styles": {
@@ -109,6 +112,12
109 "sprintf-js": "~1.0.2"
112 "sprintf-js": "~1.0.2"
110 }
113 }
111 },
114 },
115 "assertion-error": {
116 "version": "1.1.0",
117 "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz",
118 "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==",
119 "dev": true
120 },
112 "astral-regex": {
121 "astral-regex": {
113 "version": "1.0.0",
122 "version": "1.0.0",
114 "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
123 "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz",
@@ -143,6 +152,20
143 "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
152 "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==",
144 "dev": true
153 "dev": true
145 },
154 },
155 "chai": {
156 "version": "4.2.0",
157 "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
158 "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
159 "dev": true,
160 "requires": {
161 "assertion-error": "^1.1.0",
162 "check-error": "^1.0.2",
163 "deep-eql": "^3.0.1",
164 "get-func-name": "^2.0.0",
165 "pathval": "^1.1.0",
166 "type-detect": "^4.0.5"
167 }
168 },
146 "chalk": {
169 "chalk": {
147 "version": "2.4.2",
170 "version": "2.4.2",
148 "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
171 "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz",
@@ -160,13 +183,19
160 "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
183 "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==",
161 "dev": true
184 "dev": true
162 },
185 },
186 "check-error": {
187 "version": "1.0.2",
188 "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz",
189 "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=",
190 "dev": true
191 },
163 "cli-cursor": {
192 "cli-cursor": {
164 "version": "2.1.0",
193 "version": "3.1.0",
165 "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz",
194 "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz",
166 "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=",
195 "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==",
167 "dev": true,
196 "dev": true,
168 "requires": {
197 "requires": {
169 "restore-cursor": "^2.0.0"
198 "restore-cursor": "^3.1.0"
170 }
199 }
171 },
200 },
172 "cli-width": {
201 "cli-width": {
@@ -232,11 +261,14
232 "ms": "^2.1.1"
261 "ms": "^2.1.1"
233 }
262 }
234 },
263 },
235 "deep-equal": {
264 "deep-eql": {
236 "version": "1.0.1",
265 "version": "3.0.1",
237 "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz",
266 "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz",
238 "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=",
267 "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==",
239 "dev": true
268 "dev": true,
269 "requires": {
270 "type-detect": "^4.0.0"
271 }
240 },
272 },
241 "deep-is": {
273 "deep-is": {
242 "version": "0.1.3",
274 "version": "0.1.3",
@@ -244,25 +276,10
244 "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
276 "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=",
245 "dev": true
277 "dev": true
246 },
278 },
247 "define-properties": {
248 "version": "1.1.3",
249 "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz",
250 "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==",
251 "dev": true,
252 "requires": {
253 "object-keys": "^1.0.12"
254 }
255 },
256 "defined": {
257 "version": "1.0.0",
258 "resolved": "https://registry.npmjs.org/defined/-/defined-1.0.0.tgz",
259 "integrity": "sha1-yY2bzvdWdBiOEQlpFRGZ45sfppM=",
260 "dev": true
261 },
262 "diff": {
279 "diff": {
263 "version": "3.5.0",
280 "version": "4.0.2",
264 "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz",
281 "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz",
265 "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==",
282 "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==",
266 "dev": true
283 "dev": true
267 },
284 },
268 "doctrine": {
285 "doctrine": {
@@ -275,9 +292,9
275 }
292 }
276 },
293 },
277 "dojo": {
294 "dojo": {
278 "version": "1.10.10",
295 "version": "1.16.0",
279 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.10.10.tgz",
296 "resolved": "https://registry.npmjs.org/dojo/-/dojo-1.16.0.tgz",
280 "integrity": "sha512-kg79C8Yyd317cG3MgXGMH4AeQ8TgNr8H/PpA3BRms7DTfl0CJCRAgGE/C6d9Nw55s1ID/fEsfS+P3bj1s7dWgA==",
297 "integrity": "sha512-DUiXyoLK6vMF5BPr/qiMLTxDMfiM9qlzN1jxfDsVfuvB/CwhYpNxA/M4mbqKN8PCVGLmccXBJbfmFJPP5+zmzw==",
281 "dev": true
298 "dev": true
282 },
299 },
283 "dojo-typings": {
300 "dojo-typings": {
@@ -290,49 +307,11
290 }
307 }
291 },
308 },
292 "emoji-regex": {
309 "emoji-regex": {
293 "version": "7.0.3",
310 "version": "8.0.0",
294 "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
311 "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz",
295 "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
312 "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==",
296 "dev": true
313 "dev": true
297 },
314 },
298 "es-abstract": {
299 "version": "1.17.4",
300 "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.17.4.tgz",
301 "integrity": "sha512-Ae3um/gb8F0mui/jPL+QiqmglkUsaQf7FwBEHYIFkztkneosu9imhqHpBzQ3h1vit8t5iQ74t6PEVvphBZiuiQ==",
302 "dev": true,
303 "requires": {
304 "es-to-primitive": "^1.2.1",
305 "function-bind": "^1.1.1",
306 "has": "^1.0.3",
307 "has-symbols": "^1.0.1",
308 "is-callable": "^1.1.5",
309 "is-regex": "^1.0.5",
310 "object-inspect": "^1.7.0",
311 "object-keys": "^1.1.1",
312 "object.assign": "^4.1.0",
313 "string.prototype.trimleft": "^2.1.1",
314 "string.prototype.trimright": "^2.1.1"
315 },
316 "dependencies": {
317 "object-inspect": {
318 "version": "1.7.0",
319 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.7.0.tgz",
320 "integrity": "sha512-a7pEHdh1xKIAgTySUGgLMx/xwDZskN1Ud6egYYN3EdRW4ZMPNEDUTF+hwy2LUC+Bl+SyLXANnwz/jyh/qutKUw==",
321 "dev": true
322 }
323 }
324 },
325 "es-to-primitive": {
326 "version": "1.2.1",
327 "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz",
328 "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==",
329 "dev": true,
330 "requires": {
331 "is-callable": "^1.1.4",
332 "is-date-object": "^1.0.1",
333 "is-symbol": "^1.0.2"
334 }
335 },
336 "escape-string-regexp": {
315 "escape-string-regexp": {
337 "version": "1.0.5",
316 "version": "1.0.5",
338 "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
317 "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz",
@@ -340,9 +319,9
340 "dev": true
319 "dev": true
341 },
320 },
342 "eslint": {
321 "eslint": {
343 "version": "6.1.0",
322 "version": "6.8.0",
344 "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.1.0.tgz",
323 "resolved": "https://registry.npmjs.org/eslint/-/eslint-6.8.0.tgz",
345 "integrity": "sha512-QhrbdRD7ofuV09IuE2ySWBz0FyXCq0rriLTZXZqaWSI79CVtHVRdkFuFTViiqzZhkCgfOh9USpriuGN2gIpZDQ==",
324 "integrity": "sha512-K+Iayyo2LtyYhDSYwz5D5QdWw0hCacNzyq1Y821Xna2xSJj7cijoLLYmLxTQgcgZ9mC61nryMy9S7GRbYpI5Ig==",
346 "dev": true,
325 "dev": true,
347 "requires": {
326 "requires": {
348 "@babel/code-frame": "^7.0.0",
327 "@babel/code-frame": "^7.0.0",
@@ -352,19 +331,19
352 "debug": "^4.0.1",
331 "debug": "^4.0.1",
353 "doctrine": "^3.0.0",
332 "doctrine": "^3.0.0",
354 "eslint-scope": "^5.0.0",
333 "eslint-scope": "^5.0.0",
355 "eslint-utils": "^1.3.1",
334 "eslint-utils": "^1.4.3",
356 "eslint-visitor-keys": "^1.0.0",
335 "eslint-visitor-keys": "^1.1.0",
357 "espree": "^6.0.0",
336 "espree": "^6.1.2",
358 "esquery": "^1.0.1",
337 "esquery": "^1.0.1",
359 "esutils": "^2.0.2",
338 "esutils": "^2.0.2",
360 "file-entry-cache": "^5.0.1",
339 "file-entry-cache": "^5.0.1",
361 "functional-red-black-tree": "^1.0.1",
340 "functional-red-black-tree": "^1.0.1",
362 "glob-parent": "^5.0.0",
341 "glob-parent": "^5.0.0",
363 "globals": "^11.7.0",
342 "globals": "^12.1.0",
364 "ignore": "^4.0.6",
343 "ignore": "^4.0.6",
365 "import-fresh": "^3.0.0",
344 "import-fresh": "^3.0.0",
366 "imurmurhash": "^0.1.4",
345 "imurmurhash": "^0.1.4",
367 "inquirer": "^6.4.1",
346 "inquirer": "^7.0.0",
368 "is-glob": "^4.0.0",
347 "is-glob": "^4.0.0",
369 "js-yaml": "^3.13.1",
348 "js-yaml": "^3.13.1",
370 "json-stable-stringify-without-jsonify": "^1.0.1",
349 "json-stable-stringify-without-jsonify": "^1.0.1",
@@ -373,7 +352,7
373 "minimatch": "^3.0.4",
352 "minimatch": "^3.0.4",
374 "mkdirp": "^0.5.1",
353 "mkdirp": "^0.5.1",
375 "natural-compare": "^1.4.0",
354 "natural-compare": "^1.4.0",
376 "optionator": "^0.8.2",
355 "optionator": "^0.8.3",
377 "progress": "^2.0.0",
356 "progress": "^2.0.0",
378 "regexpp": "^2.0.1",
357 "regexpp": "^2.0.1",
379 "semver": "^6.1.2",
358 "semver": "^6.1.2",
@@ -486,9 +465,9
486 "dev": true
465 "dev": true
487 },
466 },
488 "figures": {
467 "figures": {
489 "version": "2.0.0",
468 "version": "3.1.0",
490 "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz",
469 "resolved": "https://registry.npmjs.org/figures/-/figures-3.1.0.tgz",
491 "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=",
470 "integrity": "sha512-ravh8VRXqHuMvZt/d8GblBeqDMkdJMBdv/2KntFH+ra5MXkO7nxNKpzQ3n6QD/2da1kH0aWmNISdvhM7gl2gVg==",
492 "dev": true,
471 "dev": true,
493 "requires": {
472 "requires": {
494 "escape-string-regexp": "^1.0.5"
473 "escape-string-regexp": "^1.0.5"
@@ -520,33 +499,24
520 "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
499 "integrity": "sha512-a1hQMktqW9Nmqr5aktAux3JMNqaucxGcjtjWnZLHX7yyPCmlSV3M54nGYbqT8K+0GhF3NBgmJCc3ma+WOgX8Jg==",
521 "dev": true
500 "dev": true
522 },
501 },
523 "for-each": {
524 "version": "0.3.3",
525 "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz",
526 "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==",
527 "dev": true,
528 "requires": {
529 "is-callable": "^1.1.3"
530 }
531 },
532 "fs.realpath": {
502 "fs.realpath": {
533 "version": "1.0.0",
503 "version": "1.0.0",
534 "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
504 "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz",
535 "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
505 "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=",
536 "dev": true
506 "dev": true
537 },
507 },
538 "function-bind": {
539 "version": "1.1.1",
540 "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz",
541 "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==",
542 "dev": true
543 },
544 "functional-red-black-tree": {
508 "functional-red-black-tree": {
545 "version": "1.0.1",
509 "version": "1.0.1",
546 "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
510 "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz",
547 "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
511 "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=",
548 "dev": true
512 "dev": true
549 },
513 },
514 "get-func-name": {
515 "version": "2.0.0",
516 "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz",
517 "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=",
518 "dev": true
519 },
550 "glob": {
520 "glob": {
551 "version": "7.1.6",
521 "version": "7.1.6",
552 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
522 "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz",
@@ -571,18 +541,12
571 }
541 }
572 },
542 },
573 "globals": {
543 "globals": {
574 "version": "11.12.0",
544 "version": "12.3.0",
575 "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz",
545 "resolved": "https://registry.npmjs.org/globals/-/globals-12.3.0.tgz",
576 "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==",
546 "integrity": "sha512-wAfjdLgFsPZsklLJvOBUBmzYE8/CwhEqSBEMRXA3qxIiNtyqvjYurAtIfDh6chlEPUfmTY3MnZh5Hfh4q0UlIw==",
577 "dev": true
578 },
579 "has": {
580 "version": "1.0.3",
581 "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz",
582 "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==",
583 "dev": true,
547 "dev": true,
584 "requires": {
548 "requires": {
585 "function-bind": "^1.1.1"
549 "type-fest": "^0.8.1"
586 }
550 }
587 },
551 },
588 "has-flag": {
552 "has-flag": {
@@ -591,12 +555,6
591 "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
555 "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=",
592 "dev": true
556 "dev": true
593 },
557 },
594 "has-symbols": {
595 "version": "1.0.1",
596 "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz",
597 "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==",
598 "dev": true
599 },
600 "iconv-lite": {
558 "iconv-lite": {
601 "version": "0.4.24",
559 "version": "0.4.24",
602 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
560 "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz",
@@ -645,38 +603,26
645 "dev": true
603 "dev": true
646 },
604 },
647 "inquirer": {
605 "inquirer": {
648 "version": "6.5.2",
606 "version": "7.0.3",
649 "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.5.2.tgz",
607 "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-7.0.3.tgz",
650 "integrity": "sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ==",
608 "integrity": "sha512-+OiOVeVydu4hnCGLCSX+wedovR/Yzskv9BFqUNNKq9uU2qg7LCcCo3R86S2E7WLo0y/x2pnEZfZe1CoYnORUAw==",
651 "dev": true,
609 "dev": true,
652 "requires": {
610 "requires": {
653 "ansi-escapes": "^3.2.0",
611 "ansi-escapes": "^4.2.1",
654 "chalk": "^2.4.2",
612 "chalk": "^2.4.2",
655 "cli-cursor": "^2.1.0",
613 "cli-cursor": "^3.1.0",
656 "cli-width": "^2.0.0",
614 "cli-width": "^2.0.0",
657 "external-editor": "^3.0.3",
615 "external-editor": "^3.0.3",
658 "figures": "^2.0.0",
616 "figures": "^3.0.0",
659 "lodash": "^4.17.12",
617 "lodash": "^4.17.15",
660 "mute-stream": "0.0.7",
618 "mute-stream": "0.0.8",
661 "run-async": "^2.2.0",
619 "run-async": "^2.2.0",
662 "rxjs": "^6.4.0",
620 "rxjs": "^6.5.3",
663 "string-width": "^2.1.0",
621 "string-width": "^4.1.0",
664 "strip-ansi": "^5.1.0",
622 "strip-ansi": "^5.1.0",
665 "through": "^2.3.6"
623 "through": "^2.3.6"
666 }
624 }
667 },
625 },
668 "is-callable": {
669 "version": "1.1.5",
670 "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.5.tgz",
671 "integrity": "sha512-ESKv5sMCJB2jnHTWZ3O5itG+O128Hsus4K4Qh1h2/cgn2vbgnLSVqfV46AeJA9D5EeeLa9w81KUXMtn34zhX+Q==",
672 "dev": true
673 },
674 "is-date-object": {
675 "version": "1.0.2",
676 "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz",
677 "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==",
678 "dev": true
679 },
680 "is-extglob": {
626 "is-extglob": {
681 "version": "2.1.1",
627 "version": "2.1.1",
682 "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
628 "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
@@ -684,9 +630,9
684 "dev": true
630 "dev": true
685 },
631 },
686 "is-fullwidth-code-point": {
632 "is-fullwidth-code-point": {
687 "version": "2.0.0",
633 "version": "3.0.0",
688 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
634 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz",
689 "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
635 "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==",
690 "dev": true
636 "dev": true
691 },
637 },
692 "is-glob": {
638 "is-glob": {
@@ -704,24 +650,6
704 "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
650 "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=",
705 "dev": true
651 "dev": true
706 },
652 },
707 "is-regex": {
708 "version": "1.0.5",
709 "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.5.tgz",
710 "integrity": "sha512-vlKW17SNq44owv5AQR3Cq0bQPEb8+kF3UKZ2fiZNOWtztYE5i0CzCZxFDwO58qAOWtxdBRVO/V5Qin1wjCqFYQ==",
711 "dev": true,
712 "requires": {
713 "has": "^1.0.3"
714 }
715 },
716 "is-symbol": {
717 "version": "1.0.3",
718 "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.3.tgz",
719 "integrity": "sha512-OwijhaRSgqvhm/0ZdAcXNZt9lYdKFpcRDT5ULUuYXPoT794UNOdU+gpT6Rzo7b4V2HUl/op6GqY894AZwv9faQ==",
720 "dev": true,
721 "requires": {
722 "has-symbols": "^1.0.1"
723 }
724 },
725 "isexe": {
653 "isexe": {
726 "version": "2.0.0",
654 "version": "2.0.0",
727 "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
655 "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
@@ -773,9 +701,9
773 "dev": true
701 "dev": true
774 },
702 },
775 "mimic-fn": {
703 "mimic-fn": {
776 "version": "1.2.0",
704 "version": "2.1.0",
777 "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz",
705 "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz",
778 "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==",
706 "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==",
779 "dev": true
707 "dev": true
780 },
708 },
781 "minimatch": {
709 "minimatch": {
@@ -809,9 +737,9
809 "dev": true
737 "dev": true
810 },
738 },
811 "mute-stream": {
739 "mute-stream": {
812 "version": "0.0.7",
740 "version": "0.0.8",
813 "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz",
741 "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz",
814 "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=",
742 "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==",
815 "dev": true
743 "dev": true
816 },
744 },
817 "natural-compare": {
745 "natural-compare": {
@@ -826,30 +754,6
826 "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
754 "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==",
827 "dev": true
755 "dev": true
828 },
756 },
829 "object-inspect": {
830 "version": "1.6.0",
831 "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.6.0.tgz",
832 "integrity": "sha512-GJzfBZ6DgDAmnuaM3104jR4s1Myxr3Y3zfIyN4z3UdqN69oSRacNK8UhnobDdC+7J2AHCjGwxQubNJfE70SXXQ==",
833 "dev": true
834 },
835 "object-keys": {
836 "version": "1.1.1",
837 "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz",
838 "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==",
839 "dev": true
840 },
841 "object.assign": {
842 "version": "4.1.0",
843 "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz",
844 "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==",
845 "dev": true,
846 "requires": {
847 "define-properties": "^1.1.2",
848 "function-bind": "^1.1.1",
849 "has-symbols": "^1.0.0",
850 "object-keys": "^1.0.11"
851 }
852 },
853 "once": {
757 "once": {
854 "version": "1.4.0",
758 "version": "1.4.0",
855 "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
759 "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz",
@@ -860,12 +764,12
860 }
764 }
861 },
765 },
862 "onetime": {
766 "onetime": {
863 "version": "2.0.1",
767 "version": "5.1.0",
864 "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz",
768 "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz",
865 "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=",
769 "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==",
866 "dev": true,
770 "dev": true,
867 "requires": {
771 "requires": {
868 "mimic-fn": "^1.0.0"
772 "mimic-fn": "^2.1.0"
869 }
773 }
870 },
774 },
871 "optionator": {
775 "optionator": {
@@ -915,6 +819,12
915 "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
819 "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==",
916 "dev": true
820 "dev": true
917 },
821 },
822 "pathval": {
823 "version": "1.1.0",
824 "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.0.tgz",
825 "integrity": "sha1-uULm1L3mUwBe9rcTYd74cn0GReA=",
826 "dev": true
827 },
918 "prelude-ls": {
828 "prelude-ls": {
919 "version": "1.1.2",
829 "version": "1.1.2",
920 "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
830 "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz",
@@ -933,22 +843,22
933 "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
843 "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==",
934 "dev": true
844 "dev": true
935 },
845 },
846 "regenerator-runtime": {
847 "version": "0.13.3",
848 "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz",
849 "integrity": "sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw==",
850 "dev": true
851 },
936 "regexpp": {
852 "regexpp": {
937 "version": "2.0.1",
853 "version": "2.0.1",
938 "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
854 "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz",
939 "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
855 "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
940 "dev": true
856 "dev": true
941 },
857 },
942 "requirejs": {
943 "version": "2.3.6",
944 "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz",
945 "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==",
946 "dev": true
947 },
948 "resolve": {
858 "resolve": {
949 "version": "1.11.1",
859 "version": "1.15.0",
950 "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.1.tgz",
860 "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.15.0.tgz",
951 "integrity": "sha512-vIpgF6wfuJOZI7KKKSP+HmiKggadPQAdsp5HiC1mvqnfp0gF1vdwgBWZIdrVft9pgqoMFQN+R7BSWZiBxx+BBw==",
861 "integrity": "sha512-+hTmAldEGE80U2wJJDC1lebb5jWqvTYAfm3YZ1ckk1gBr0MnCqUKlwK1e+anaFljIl+F5tR5IoZcm4ZDA1zMQw==",
952 "dev": true,
862 "dev": true,
953 "requires": {
863 "requires": {
954 "path-parse": "^1.0.6"
864 "path-parse": "^1.0.6"
@@ -961,24 +871,15
961 "dev": true
871 "dev": true
962 },
872 },
963 "restore-cursor": {
873 "restore-cursor": {
964 "version": "2.0.0",
874 "version": "3.1.0",
965 "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz",
875 "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz",
966 "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=",
876 "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==",
967 "dev": true,
877 "dev": true,
968 "requires": {
878 "requires": {
969 "onetime": "^2.0.0",
879 "onetime": "^5.1.0",
970 "signal-exit": "^3.0.2"
880 "signal-exit": "^3.0.2"
971 }
881 }
972 },
882 },
973 "resumer": {
974 "version": "0.0.0",
975 "resolved": "https://registry.npmjs.org/resumer/-/resumer-0.0.0.tgz",
976 "integrity": "sha1-8ej0YeQGS6Oegq883CqMiT0HZ1k=",
977 "dev": true,
978 "requires": {
979 "through": "~2.3.4"
980 }
981 },
982 "rimraf": {
883 "rimraf": {
983 "version": "2.6.3",
884 "version": "2.6.3",
984 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
885 "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz",
@@ -1048,6 +949,14
1048 "ansi-styles": "^3.2.0",
949 "ansi-styles": "^3.2.0",
1049 "astral-regex": "^1.0.0",
950 "astral-regex": "^1.0.0",
1050 "is-fullwidth-code-point": "^2.0.0"
951 "is-fullwidth-code-point": "^2.0.0"
952 },
953 "dependencies": {
954 "is-fullwidth-code-point": {
955 "version": "2.0.0",
956 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
957 "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
958 "dev": true
959 }
1051 }
960 }
1052 },
961 },
1053 "sprintf-js": {
962 "sprintf-js": {
@@ -1057,57 +966,27
1057 "dev": true
966 "dev": true
1058 },
967 },
1059 "string-width": {
968 "string-width": {
1060 "version": "2.1.1",
969 "version": "4.2.0",
1061 "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz",
970 "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz",
1062 "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==",
971 "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==",
1063 "dev": true,
972 "dev": true,
1064 "requires": {
973 "requires": {
1065 "is-fullwidth-code-point": "^2.0.0",
974 "emoji-regex": "^8.0.0",
1066 "strip-ansi": "^4.0.0"
975 "is-fullwidth-code-point": "^3.0.0",
976 "strip-ansi": "^6.0.0"
1067 },
977 },
1068 "dependencies": {
978 "dependencies": {
1069 "strip-ansi": {
979 "strip-ansi": {
1070 "version": "4.0.0",
980 "version": "6.0.0",
1071 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz",
981 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz",
1072 "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=",
982 "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==",
1073 "dev": true,
983 "dev": true,
1074 "requires": {
984 "requires": {
1075 "ansi-regex": "^3.0.0"
985 "ansi-regex": "^5.0.0"
1076 }
986 }
1077 }
987 }
1078 }
988 }
1079 },
989 },
1080 "string.prototype.trim": {
1081 "version": "1.1.2",
1082 "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz",
1083 "integrity": "sha1-0E3iyJ4Tf019IG8Ia17S+ua+jOo=",
1084 "dev": true,
1085 "requires": {
1086 "define-properties": "^1.1.2",
1087 "es-abstract": "^1.5.0",
1088 "function-bind": "^1.0.2"
1089 }
1090 },
1091 "string.prototype.trimleft": {
1092 "version": "2.1.1",
1093 "resolved": "https://registry.npmjs.org/string.prototype.trimleft/-/string.prototype.trimleft-2.1.1.tgz",
1094 "integrity": "sha512-iu2AGd3PuP5Rp7x2kEZCrB2Nf41ehzh+goo8TV7z8/XDBbsvc6HQIlUl9RjkZ4oyrW1XM5UwlGl1oVEaDjg6Ag==",
1095 "dev": true,
1096 "requires": {
1097 "define-properties": "^1.1.3",
1098 "function-bind": "^1.1.1"
1099 }
1100 },
1101 "string.prototype.trimright": {
1102 "version": "2.1.1",
1103 "resolved": "https://registry.npmjs.org/string.prototype.trimright/-/string.prototype.trimright-2.1.1.tgz",
1104 "integrity": "sha512-qFvWL3/+QIgZXVmJBfpHmxLB7xsUXz6HsUmP8+5dRaC3Q7oKUv9Vo6aMCRZC1smrtyECFsIT30PqBJ1gTjAs+g==",
1105 "dev": true,
1106 "requires": {
1107 "define-properties": "^1.1.3",
1108 "function-bind": "^1.1.1"
1109 }
1110 },
1111 "strip-ansi": {
990 "strip-ansi": {
1112 "version": "5.2.0",
991 "version": "5.2.0",
1113 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
992 "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz",
@@ -1152,6 +1031,18
1152 "string-width": "^3.0.0"
1031 "string-width": "^3.0.0"
1153 },
1032 },
1154 "dependencies": {
1033 "dependencies": {
1034 "emoji-regex": {
1035 "version": "7.0.3",
1036 "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz",
1037 "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==",
1038 "dev": true
1039 },
1040 "is-fullwidth-code-point": {
1041 "version": "2.0.0",
1042 "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz",
1043 "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=",
1044 "dev": true
1045 },
1155 "string-width": {
1046 "string-width": {
1156 "version": "3.1.0",
1047 "version": "3.1.0",
1157 "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
1048 "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz",
@@ -1165,35 +1056,6
1165 }
1056 }
1166 }
1057 }
1167 },
1058 },
1168 "tape": {
1169 "version": "4.11.0",
1170 "resolved": "https://registry.npmjs.org/tape/-/tape-4.11.0.tgz",
1171 "integrity": "sha512-yixvDMX7q7JIs/omJSzSZrqulOV51EC9dK8dM0TzImTIkHWfe2/kFyL5v+d9C+SrCMaICk59ujsqFAVidDqDaA==",
1172 "dev": true,
1173 "requires": {
1174 "deep-equal": "~1.0.1",
1175 "defined": "~1.0.0",
1176 "for-each": "~0.3.3",
1177 "function-bind": "~1.1.1",
1178 "glob": "~7.1.4",
1179 "has": "~1.0.3",
1180 "inherits": "~2.0.4",
1181 "minimist": "~1.2.0",
1182 "object-inspect": "~1.6.0",
1183 "resolve": "~1.11.1",
1184 "resumer": "~0.0.0",
1185 "string.prototype.trim": "~1.1.2",
1186 "through": "~2.3.8"
1187 },
1188 "dependencies": {
1189 "minimist": {
1190 "version": "1.2.0",
1191 "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz",
1192 "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=",
1193 "dev": true
1194 }
1195 }
1196 },
1197 "text-table": {
1059 "text-table": {
1198 "version": "0.2.0",
1060 "version": "0.2.0",
1199 "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
1061 "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz",
@@ -1222,23 +1084,23
1222 "dev": true
1084 "dev": true
1223 },
1085 },
1224 "tslint": {
1086 "tslint": {
1225 "version": "5.18.0",
1087 "version": "6.0.0",
1226 "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.18.0.tgz",
1088 "resolved": "https://registry.npmjs.org/tslint/-/tslint-6.0.0.tgz",
1227 "integrity": "sha512-Q3kXkuDEijQ37nXZZLKErssQVnwCV/+23gFEMROi8IlbaBG6tXqLPQJ5Wjcyt/yHPKBC+hD5SzuGaMora+ZS6w==",
1089 "integrity": "sha512-9nLya8GBtlFmmFMW7oXXwoXS1NkrccqTqAtwXzdPV9e2mqSEvCki6iHL/Fbzi5oqbugshzgGPk7KBb2qNP1DSA==",
1228 "dev": true,
1090 "dev": true,
1229 "requires": {
1091 "requires": {
1230 "@babel/code-frame": "^7.0.0",
1092 "@babel/code-frame": "^7.0.0",
1231 "builtin-modules": "^1.1.1",
1093 "builtin-modules": "^1.1.1",
1232 "chalk": "^2.3.0",
1094 "chalk": "^2.3.0",
1233 "commander": "^2.12.1",
1095 "commander": "^2.12.1",
1234 "diff": "^3.2.0",
1096 "diff": "^4.0.1",
1235 "glob": "^7.1.1",
1097 "glob": "^7.1.1",
1236 "js-yaml": "^3.13.1",
1098 "js-yaml": "^3.13.1",
1237 "minimatch": "^3.0.4",
1099 "minimatch": "^3.0.4",
1238 "mkdirp": "^0.5.1",
1100 "mkdirp": "^0.5.1",
1239 "resolve": "^1.3.2",
1101 "resolve": "^1.3.2",
1240 "semver": "^5.3.0",
1102 "semver": "^5.3.0",
1241 "tslib": "^1.8.0",
1103 "tslib": "^1.10.0",
1242 "tsutils": "^2.29.0"
1104 "tsutils": "^2.29.0"
1243 },
1105 },
1244 "dependencies": {
1106 "dependencies": {
@@ -1268,10 +1130,22
1268 "prelude-ls": "~1.1.2"
1130 "prelude-ls": "~1.1.2"
1269 }
1131 }
1270 },
1132 },
1133 "type-detect": {
1134 "version": "4.0.8",
1135 "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz",
1136 "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==",
1137 "dev": true
1138 },
1139 "type-fest": {
1140 "version": "0.8.1",
1141 "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz",
1142 "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==",
1143 "dev": true
1144 },
1271 "typescript": {
1145 "typescript": {
1272 "version": "3.6.5",
1146 "version": "3.7.5",
1273 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.5.tgz",
1147 "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.7.5.tgz",
1274 "integrity": "sha512-BEjlc0Z06ORZKbtcxGrIvvwYs5hAnuo6TKdNFL55frVDlB+na3z5bsLhFaIxmT+dPWgBIjMo6aNnTOgHHmHgiQ==",
1148 "integrity": "sha512-/P5lkRXkWHNAbcJIiHPfRoKqyd7bsyCma1hZNUGfn20qm64T6ZBlrzprymeu918H+mB/0rIg2gGK/BXkhhYgBw==",
1275 "dev": true
1149 "dev": true
1276 },
1150 },
1277 "uri-js": {
1151 "uri-js": {
@@ -1318,6 +1192,15
1318 "requires": {
1192 "requires": {
1319 "mkdirp": "^0.5.1"
1193 "mkdirp": "^0.5.1"
1320 }
1194 }
1195 },
1196 "yaml": {
1197 "version": "1.7.2",
1198 "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.7.2.tgz",
1199 "integrity": "sha512-qXROVp90sb83XtAoqE8bP9RwAkTTZbugRUTm5YeFCBfNRPEp2YzTeqWiz7m5OORHzEvrA/qcGS8hp/E+MMROYw==",
1200 "dev": true,
1201 "requires": {
1202 "@babel/runtime": "^7.6.3"
1203 }
1321 }
1204 }
1322 }
1205 }
1323 }
1206 }
@@ -1,14 +1,15
1 {
1 {
2 "devDependencies": {
2 "devDependencies": {
3 "@types/node": "8.0.0",
4 "@types/tape": "~4.2.33",
5 "@types/requirejs": "2.1.31",
3 "@types/requirejs": "2.1.31",
6 "dojo": "1.16.0",
4 "dojo": "1.16.0",
7 "dojo-typings": "1.11.9",
5 "dojo-typings": "1.11.9",
8 "tape": "~4.13.0",
9 "typescript": "~3.7.5",
6 "typescript": "~3.7.5",
10 "eslint": "6.8.0",
7 "eslint": "6.8.0",
11 "tslint": "6.0.0",
8 "tslint": "6.0.0",
12 "@implab/core-amd": "^1.3.2"
9 "@implab/core-amd": "^1.3.2",
10 "yaml": "~1.7.2",
11 "@types/yaml": "1.2.0",
12 "chai": "4.2.0",
13 "@types/chai": "4.1.3"
13 }
14 }
14 }
15 }
@@ -36,7 +36,7 export class NlsBundle<T extends object>
36
36
37 _cache: MapOf<PromiseOrValue<T>>;
37 _cache: MapOf<PromiseOrValue<T>>;
38
38
39 constructor(defNls: T, locales: MapOf<any>) {
39 constructor(defNls: T, locales?: MapOf<any>) {
40 this.default = defNls;
40 this.default = defNls;
41 this._locales = locales || {};
41 this._locales = locales || {};
42 this._cache = {};
42 this._cache = {};
@@ -51,17 +51,20 export class NlsBundle<T extends object>
51 a.push(x);
51 a.push(x);
52 locales.unshift(a.join("-"));
52 locales.unshift(a.join("-"));
53 return a;
53 return a;
54 }, []);
54 }, new Array<string>());
55
55
56 return this._resolveLocale(locales);
56 return this._resolveLocale(locales);
57 }
57 }
58
58
59 _resolveLocale(locales: string[]): PromiseOrValue<T> {
59 _resolveLocale(locales: string[]): PromiseOrValue<T> {
60 if (!locales.length)
60 if (!locales.length)
61 return;
61 return this.default;
62
62
63 const locale = locales.shift();
63 const locale = locales.shift();
64
64
65 if (!locale)
66 return this._resolveLocale(locales);
67
65 if (this._cache[locale])
68 if (this._cache[locale])
66 return this._cache[locale];
69 return this._cache[locale];
67
70
@@ -69,7 +72,7 export class NlsBundle<T extends object>
69 if (isCallback(data))
72 if (isCallback(data))
70 data = data();
73 data = data();
71
74
72 const parent = locales.length ? this._resolveLocale(locales) : this.default;
75 const parent = this._resolveLocale(locales);
73
76
74 return this._cache[locale] = when(data, x => {
77 return this._cache[locale] = when(data, x => {
75 return when(parent, y => this._cache[locale] = chainObjects(y, x));
78 return when(parent, y => this._cache[locale] = chainObjects(y, x));
@@ -132,7 +132,7 export function djclass<T extends Abstra
132
132
133 // proxy - фабрика для создания прокси-методов, которые внутри
133 // proxy - фабрика для создания прокси-методов, которые внутри
134 // себя вызовут this.inherited с правильными параметрами.
134 // себя вызовут this.inherited с правильными параметрами.
135 const proxy = (m: (...args: any[]) => any) => function () {
135 const proxy = (m: (...args: any[]) => any) => function (this: any) {
136 return this.inherited(m, arguments);
136 return this.inherited(m, arguments);
137 };
137 };
138
138
@@ -199,11 +199,11 interface MemberBindSpec {
199 getter?: boolean;
199 getter?: boolean;
200 }
200 }
201
201
202 function isNodeBindSpec(v): v is NodeBindSpec {
202 function isNodeBindSpec(v: any): v is NodeBindSpec {
203 return "node" in v;
203 return "node" in v;
204 }
204 }
205
205
206 function isMemberBindSpec(v): v is MemberBindSpec {
206 function isMemberBindSpec(v: any): v is MemberBindSpec {
207 return "member" in v;
207 return "member" in v;
208 }
208 }
209
209
@@ -220,7 +220,7 export function bind(params: NodeBindSpe
220 else if (isMemberBindSpec(params)) {
220 else if (isMemberBindSpec(params)) {
221 return (target: any, name: string) => {
221 return (target: any, name: string) => {
222 target[name] = null;
222 target[name] = null;
223 target[makeSetterName(name)] = function (v) {
223 target[makeSetterName(name)] = function (v: any) {
224 this._set(name, v);
224 this._set(name, v);
225 this[params.member].set(params.property, v);
225 this[params.member].set(params.property, v);
226 };
226 };
@@ -1,12 +1,12
1 import { isNull, mixin } from "@implab/core-amd/safe";
1 import { isNull, mixin, argumentNotNull } from "@implab/core-amd/safe";
2 import { isPlainObject, isNode, isBuildContext } from "./traits";
2 import { isPlainObject, isNode, isBuildContext } from "./traits";
3
3
4 export abstract class BuildContextBase {
4 export abstract class BuildContextBase {
5 _attrs = {};
5 _attrs = {};
6
6
7 _children = [];
7 _children = new Array();
8
8
9 _created: boolean;
9 _created: boolean = false;
10
10
11 visitNext(v: any) {
11 visitNext(v: any) {
12 if (isNull(v))
12 if (isNull(v))
@@ -28,9 +28,6 export abstract class BuildContextBase {
28 }
28 }
29
29
30 getChildDom(v: any) {
30 getChildDom(v: any) {
31 if (isNull(v))
32 return;
33
34 const tv = typeof v;
31 const tv = typeof v;
35 if (tv === "string" || tv === "number" || tv === "boolean" || v instanceof RegExp || v instanceof Date) {
32 if (tv === "string" || tv === "number" || tv === "boolean" || v instanceof RegExp || v instanceof Date) {
36 return document.createTextNode(v.toString());
33 return document.createTextNode(v.toString());
@@ -48,8 +45,8 export abstract class BuildContextBase {
48 ensureCreated() {
45 ensureCreated() {
49 if (!this._created) {
46 if (!this._created) {
50 this._create(this._attrs, this._children);
47 this._create(this._attrs, this._children);
51 this._children = null;
48 this._children = [];
52 this._attrs = null;
49 this._attrs = {};
53 this._created = true;
50 this._created = true;
54 }
51 }
55 }
52 }
@@ -17,23 +17,28 export abstract class DjxWidgetBase exte
17 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
17 _processTemplateNode<T extends (Element | Node | _WidgetBase)>(
18 baseNode: T,
18 baseNode: T,
19 getAttrFunc: (baseNode: T, attr: string) => string,
19 getAttrFunc: (baseNode: T, attr: string) => string,
20 attachFunc: (node: T, type: string, func?: (...args: any[]) => any) => dojo.Handle
20 // tslint:disable-next-line: ban-types
21 attachFunc: (node: T, type: string, func?: Function) => dojo.Handle
21 ): boolean {
22 ): boolean {
22 if (isNode(baseNode)) {
23 if (isNode(baseNode)) {
23 const w = registry.byNode(baseNode);
24 const w = registry.byNode(baseNode);
24 if (w) {
25 if (w) {
25 // from dijit/_WidgetsInTemplateMixin
26 // from dijit/_WidgetsInTemplateMixin
26 this._processTemplateNode(w,
27 this._processTemplateNode(w,
27 (n, p) => n[p], // callback to get a property of a widget
28 (n, p) => n.get(p), // callback to get a property of a widget
28 (widget, type, callback) => {
29 (widget, type, callback) => {
30 if (!callback)
31 throw new Error("The callback must be specified");
32
29 // callback to do data-dojo-attach-event to a widget
33 // callback to do data-dojo-attach-event to a widget
30 if (type in widget) {
34 if (type in widget) {
31 // back-compat, remove for 2.0
35 // back-compat, remove for 2.0
32 return widget.connect(widget, type, callback);
36 return widget.connect(widget, type, callback as EventListener);
33 } else {
37 } else {
34 // 1.x may never hit this branch, but it's the default for 2.0
38 // 1.x may never hit this branch, but it's the default for 2.0
35 return widget.on(type, callback);
39 return widget.on(type, callback);
36 }
40 }
41
37 });
42 });
38 // don't process widgets internals
43 // don't process widgets internals
39 return false;
44 return false;
@@ -6,7 +6,7 import { BuildContextBase } from "./Buil
6 export class HtmlElementContext extends BuildContextBase {
6 export class HtmlElementContext extends BuildContextBase {
7 elementType: string;
7 elementType: string;
8
8
9 _element: HTMLElement;
9 _element: HTMLElement | undefined;
10
10
11 constructor(elementType: string) {
11 constructor(elementType: string) {
12 argumentNotEmptyString(elementType, "elementType");
12 argumentNotEmptyString(elementType, "elementType");
@@ -16,10 +16,15 export class HtmlElementContext extends
16 }
16 }
17
17
18 _addChild(child: any): void {
18 _addChild(child: any): void {
19 if (!this._element)
20 throw new Error("The HTML element isn't created");
19 dom.place(this.getChildDom(child), this._element);
21 dom.place(this.getChildDom(child), this._element);
20 }
22 }
21
23
22 _setAttrs(attrs: object): void {
24 _setAttrs(attrs: object): void {
25 if (!this._element)
26 throw new Error("The HTML element isn't created");
27
23 attr.set(this._element, attrs);
28 attr.set(this._element, attrs);
24 }
29 }
25
30
@@ -31,6 +36,9 export class HtmlElementContext extends
31 }
36 }
32
37
33 _getDomElement() {
38 _getDomElement() {
39 if (!this._element)
40 throw new Error("The HTML element isn't created");
41
34 return this._element;
42 return this._element;
35 }
43 }
36
44
@@ -7,7 +7,7 import { BuildContextBase } from "./Buil
7 export class WidgetContext extends BuildContextBase {
7 export class WidgetContext extends BuildContextBase {
8 widgetClass: _WidgetBaseConstructor;
8 widgetClass: _WidgetBaseConstructor;
9
9
10 _instance: _WidgetBase;
10 _instance: _WidgetBase | undefined;
11
11
12 constructor(widgetClass: _WidgetBaseConstructor) {
12 constructor(widgetClass: _WidgetBaseConstructor) {
13 super();
13 super();
@@ -17,14 +17,14 export class WidgetContext extends Build
17 }
17 }
18
18
19 _addChild(child: any): void {
19 _addChild(child: any): void {
20 if (!this._instance.containerNode)
20 if (!this._instance || !this._instance.containerNode)
21 throw new Error("Widget doesn't support adding children");
21 throw new Error("Widget doesn't support adding children");
22
22
23 dom.place(this.getChildDom(child), this._instance.containerNode);
23 dom.place(this.getChildDom(child), this._instance.containerNode);
24 }
24 }
25
25
26 _setAttrs(attrs: object): void {
26 _setAttrs(attrs: object): void {
27 this._instance.set(attrs);
27 this._instance?.set(attrs);
28 }
28 }
29
29
30 _create(attrs: object, children: any[]) {
30 _create(attrs: object, children: any[]) {
@@ -34,6 +34,8 export class WidgetContext extends Build
34 }
34 }
35
35
36 _getDomElement() {
36 _getDomElement() {
37 if (!this._instance)
38 throw new Error("The instance of the widget isn't created");
37 return this._instance.domNode;
39 return this._instance.domNode;
38 }
40 }
39
41
@@ -1,18 +1,21
1 import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces";
1 import { IObservable, ICancellation, IDestroyable } from "@implab/core-amd/interfaces";
2 import { Cancellation } from "@implab/core-amd/Cancellation";
2 import { Cancellation } from "@implab/core-amd/Cancellation";
3 import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource";
3 import { TraceEvent, LogLevel, WarnLevel, DebugLevel, TraceSource } from "@implab/core-amd/log/TraceSource";
4 import * as tape from "tape";
5 import { argumentNotNull, destroy } from "@implab/core-amd/safe";
4 import { argumentNotNull, destroy } from "@implab/core-amd/safe";
5 import { TapWriter } from "./Tap";
6
7
6
8
7 export class TapeWriter implements IDestroyable {
9 export class TapeWriter implements IDestroyable {
8 private readonly _tape: tape.Test;
10
11 private readonly _t: TapWriter;
9
12
10 private readonly _subscriptions = new Array<IDestroyable>();
13 private readonly _subscriptions = new Array<IDestroyable>();
11 private _destroyed;
14 private _destroyed;
12
15
13 constructor(t: tape.Test) {
16 constructor(t: TapWriter) {
14 argumentNotNull(t, "tape");
17 argumentNotNull(t, "test");
15 this._tape = t;
18
16 }
19 }
17
20
18 writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) {
21 writeEvents(source: IObservable<TraceEvent>, ct: ICancellation = Cancellation.none) {
@@ -27,13 +30,13 export class TapeWriter implements IDest
27
30
28 writeEvent(next: TraceEvent) {
31 writeEvent(next: TraceEvent) {
29 if (next.level >= DebugLevel) {
32 if (next.level >= DebugLevel) {
30 this._tape.comment(`DEBUG ${next.source.id} ${next}`);
33 this._t.comment(`DEBUG ${next.source.id} ${next}`);
31 } else if (next.level >= LogLevel) {
34 } else if (next.level >= LogLevel) {
32 this._tape.comment(`LOG ${next.source.id} ${next}`);
35 this._t.comment(`LOG ${next.source.id} ${next}`);
33 } else if (next.level >= WarnLevel) {
36 } else if (next.level >= WarnLevel) {
34 this._tape.comment(`WARN ${next.source.id} ${next}`);
37 this._t.comment(`WARN ${next.source.id} ${next}`);
35 } else {
38 } else {
36 this._tape.comment(`ERROR ${next.source.id} ${next}`);
39 this._t.comment(`ERROR ${next.source.id} ${next}`);
37 }
40 }
38 }
41 }
39
42
@@ -42,33 +45,13 export class TapeWriter implements IDest
42 }
45 }
43 }
46 }
44
47
45 export function test(name: string, cb: (t: tape.Test, trace: TraceSource) => any) {
48 type TestCallback = (ok: (msg:string) => void, fail: (msg:string) => void, trace: TraceSource) => void;
46 tape(name, async t => {
49 type AsyncTestCallback = (trace: TraceSource) => PromiseLike<void> | void;
47 const writer = new TapeWriter(t);
48
49 // this trace is not announced through the TraceSource global registry
50 const trace = new TraceSource(name);
51 trace.level = DebugLevel;
52 writer.writeEvents(trace.events);
53
54 const h = TraceSource.on(ts => {
55 ts.level = DebugLevel;
56 writer.writeEvents(ts.events);
57 });
58
50
59 try {
51 export function test(name: string, cb: TestCallback | AsyncTestCallback) {
60 await cb(t, trace);
52
61 } catch (e) {
53 }
62
54
63 // verbose error information
55 export function run() {
64 // tslint:disable-next-line
65 console.error(e);
66 t.fail(e);
67
56
68 } finally {
69 t.end();
70 destroy(writer);
71 destroy(h);
72 }
73 });
74 }
57 }
@@ -1,10 +1,16
1 import * as tape from "tape";
1 import { test } from "./TestTraits";
2 import { delay } from "@implab/core-amd/safe";
3 import { assert } from "chai";
2
4
3 tape("simple", t => {
5 test("simple", (ok, fail, log) => {
4 t.pass("sync assert");
5 setTimeout(() => {
6 setTimeout(() => {
6 t.pass("async assert");
7 // end should be called after the last assertion
7 // end should be called after the last assertion
8 t.end();
8 ok("async assert");
9 }, 100);
9 }, 100);
10 });
10 });
11
12 test("simple", async log => {
13 await delay(0);
14
15 assert.ok(true); // everything is fine
16 });
@@ -2,6 +2,7
2 "compilerOptions": {
2 "compilerOptions": {
3 "moduleResolution": "node",
3 "moduleResolution": "node",
4 "noEmitOnError": true,
4 "noEmitOnError": true,
5 "strict": true,
5 "types": [],
6 "types": [],
6 "experimentalDecorators": true,
7 "experimentalDecorators": true,
7 "jsxFactory": "createElement",
8 "jsxFactory": "createElement",
General Comments 0
You need to be logged in to leave comments. Login now