@zeesoft/i18n-verify 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/driver/adapters/cypress.js +160 -0
- package/dist/driver/adapters/nightwatch.js +95 -0
- package/dist/driver/adapters/selenium.js +94 -0
- package/dist/driver/adapters/webdriver.io.js +81 -0
- package/dist/driver/baseDriver.js +69 -0
- package/dist/driver/factory.js +27 -0
- package/dist/index.js +47 -0
- package/dist/lib/config.js +99 -0
- package/dist/lib/i18n.js +177 -0
- package/dist/lib/validator/base.js +125 -0
- package/dist/lib/validator/currency.js +94 -0
- package/dist/lib/validator/date.js +72 -0
- package/dist/lib/validator/datetime.js +72 -0
- package/dist/lib/validator/index.js +156 -0
- package/dist/lib/validator/number.js +58 -0
- package/dist/lib/validator/percentage.js +78 -0
- package/dist/lib/validator/string.js +172 -0
- package/dist/lib/validator/time.js +72 -0
- package/dist/utils/2Dgraphic.js +57 -0
- package/dist/utils/cache.js +47 -0
- package/dist/utils/common.js +18 -0
- package/dist/utils/configFile.js +64 -0
- package/dist/utils/constants.js +145 -0
- package/dist/utils/cypress.js +120 -0
- package/dist/utils/dateUtils/chronoNode.js +52 -0
- package/dist/utils/file.js +57 -0
- package/dist/utils/logs.js +61 -0
- package/dist/utils/objects/cacheData.js +91 -0
- package/dist/utils/objects/metaData.js +48 -0
- package/dist/utils/objects/reportData.js +48 -0
- package/dist/utils/objects/statData.js +365 -0
- package/dist/utils/objects/stringData.js +67 -0
- package/dist/utils/objects/stringInfo.js +51 -0
- package/dist/utils/regex.js +8 -0
- package/dist/utils/reportFactory/base.js +51 -0
- package/dist/utils/reportFactory/html/index.js +36 -0
- package/dist/utils/reportFactory/html/template/css.js +133 -0
- package/dist/utils/reportFactory/html/template/html.js +79 -0
- package/dist/utils/reportFactory/html/template/javascript.js +106 -0
- package/dist/utils/reportFactory/index.js +38 -0
- package/dist/utils/reports.js +120 -0
- package/dist/utils/reportsTable.js +71 -0
- package/dist/utils/resource.js +54 -0
- package/dist/utils/runtime.js +16 -0
- package/dist/utils/scripts/genreport.js +1 -0
- package/dist/utils/scripts/postinstall.js +21 -0
- package/package.json +59 -0
- package/readme.md +15 -0
|
@@ -0,0 +1,365 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _constants = require("../constants");
|
|
8
|
+
class StatData {
|
|
9
|
+
/**
|
|
10
|
+
* @type {Number}
|
|
11
|
+
*/
|
|
12
|
+
#localizedStrings;
|
|
13
|
+
/**
|
|
14
|
+
* @type {Number}
|
|
15
|
+
*/
|
|
16
|
+
#notLocalizedStrings;
|
|
17
|
+
/**
|
|
18
|
+
* @type {Number}
|
|
19
|
+
*/
|
|
20
|
+
#untranslatedStrings;
|
|
21
|
+
/**
|
|
22
|
+
* @type {Number}
|
|
23
|
+
*/
|
|
24
|
+
#partialStrings;
|
|
25
|
+
/**
|
|
26
|
+
* @type {Number}
|
|
27
|
+
*/
|
|
28
|
+
#localizedDateTime;
|
|
29
|
+
/**
|
|
30
|
+
* @type {Number}
|
|
31
|
+
*/
|
|
32
|
+
#localizedDate;
|
|
33
|
+
/**
|
|
34
|
+
* @type {Number}
|
|
35
|
+
*/
|
|
36
|
+
#localizedTime;
|
|
37
|
+
/**
|
|
38
|
+
* @type {Number}
|
|
39
|
+
*/
|
|
40
|
+
#notLocalizedDateTime;
|
|
41
|
+
/**
|
|
42
|
+
* @type {Number}
|
|
43
|
+
*/
|
|
44
|
+
#notLocalizedDate;
|
|
45
|
+
/**
|
|
46
|
+
* @type {Number}
|
|
47
|
+
*/
|
|
48
|
+
#notLocalizedTime;
|
|
49
|
+
/**
|
|
50
|
+
* @type {Number}
|
|
51
|
+
*/
|
|
52
|
+
#localizedNumber;
|
|
53
|
+
/**
|
|
54
|
+
* @type {Number}
|
|
55
|
+
*/
|
|
56
|
+
#notLocalizedNumber;
|
|
57
|
+
/**
|
|
58
|
+
* @type {Number}
|
|
59
|
+
*/
|
|
60
|
+
#currency;
|
|
61
|
+
/**
|
|
62
|
+
* @type {Number}
|
|
63
|
+
*/
|
|
64
|
+
#notLocalizedCurrency;
|
|
65
|
+
/**
|
|
66
|
+
* @type {Number}
|
|
67
|
+
*/
|
|
68
|
+
#percentage;
|
|
69
|
+
/**
|
|
70
|
+
* @type {Number}
|
|
71
|
+
*/
|
|
72
|
+
#notLocalizedPercentage;
|
|
73
|
+
/**
|
|
74
|
+
* @type {Number}
|
|
75
|
+
*/
|
|
76
|
+
#ignore;
|
|
77
|
+
/**
|
|
78
|
+
* @type {Number}
|
|
79
|
+
*/
|
|
80
|
+
#dnt;
|
|
81
|
+
/**
|
|
82
|
+
* @type {Number}
|
|
83
|
+
*/
|
|
84
|
+
#autoIgnore;
|
|
85
|
+
/**
|
|
86
|
+
* @type {Number}
|
|
87
|
+
*/
|
|
88
|
+
#encoding;
|
|
89
|
+
/**
|
|
90
|
+
* @type {Number}
|
|
91
|
+
*/
|
|
92
|
+
#truncation;
|
|
93
|
+
/**
|
|
94
|
+
* @type {Number}
|
|
95
|
+
*/
|
|
96
|
+
#overlapping;
|
|
97
|
+
/**
|
|
98
|
+
* @type {Number}
|
|
99
|
+
*/
|
|
100
|
+
#reviewed;
|
|
101
|
+
constructor(data = {}) {
|
|
102
|
+
this.#localizedStrings = data?.localizedStrings || 0;
|
|
103
|
+
this.#notLocalizedStrings = data?.notLocalizedStrings || 0;
|
|
104
|
+
this.#untranslatedStrings = data?.untranslatedStrings || 0;
|
|
105
|
+
this.#partialStrings = data?.partialStrings || 0;
|
|
106
|
+
this.#localizedDateTime = data?.localizedDateTime || 0;
|
|
107
|
+
this.#localizedDate = data?.localizedDate || 0;
|
|
108
|
+
this.#localizedTime = data?.localizedTime || 0;
|
|
109
|
+
this.#notLocalizedDateTime = data?.notLocalizedDateTime || 0;
|
|
110
|
+
this.#notLocalizedDate = data?.notLocalizedDate || 0;
|
|
111
|
+
this.#notLocalizedTime = data?.notLocalizedTime || 0;
|
|
112
|
+
this.#localizedNumber = data?.localizedNumber || 0;
|
|
113
|
+
this.#notLocalizedNumber = data?.notLocalizedNumber || 0;
|
|
114
|
+
this.#currency = data?.currency || 0;
|
|
115
|
+
this.#notLocalizedCurrency = data?.notLocalizedCurrency || 0;
|
|
116
|
+
this.#percentage = data?.percentage || 0;
|
|
117
|
+
this.#notLocalizedPercentage = data?.notLocalizedPercentage || 0;
|
|
118
|
+
this.#ignore = data?.ignore || 0;
|
|
119
|
+
this.#dnt = data?.dnt || 0;
|
|
120
|
+
this.#autoIgnore = data?.autoIgnore || 0;
|
|
121
|
+
this.#encoding = data?.encoding || 0;
|
|
122
|
+
this.#truncation = data?.truncation || 0;
|
|
123
|
+
this.#overlapping = data?.overlapping || 0;
|
|
124
|
+
this.#reviewed = data?.reviewed || 0;
|
|
125
|
+
}
|
|
126
|
+
getLocalizedStrings() {
|
|
127
|
+
return this.#localizedStrings;
|
|
128
|
+
}
|
|
129
|
+
setLocalizedStrings(translatedStrings) {
|
|
130
|
+
this.#localizedStrings = translatedStrings;
|
|
131
|
+
}
|
|
132
|
+
getUntranslatedStrings() {
|
|
133
|
+
return this.#untranslatedStrings;
|
|
134
|
+
}
|
|
135
|
+
setUntranslatedStrings(untranslatedStrings) {
|
|
136
|
+
this.#untranslatedStrings = untranslatedStrings;
|
|
137
|
+
}
|
|
138
|
+
getNotLocalizedStrings() {
|
|
139
|
+
return this.#notLocalizedStrings;
|
|
140
|
+
}
|
|
141
|
+
setNotLocalizedStrings(notLocalizedStrings) {
|
|
142
|
+
this.#notLocalizedStrings = notLocalizedStrings;
|
|
143
|
+
}
|
|
144
|
+
getPartialStrings() {
|
|
145
|
+
return this.#partialStrings;
|
|
146
|
+
}
|
|
147
|
+
setPartialStrings(partialStrings) {
|
|
148
|
+
this.#partialStrings = partialStrings;
|
|
149
|
+
}
|
|
150
|
+
getLocalizedDateTime() {
|
|
151
|
+
return this.#localizedDateTime;
|
|
152
|
+
}
|
|
153
|
+
setLocalizedDateTime(localizedDateTime) {
|
|
154
|
+
this.#localizedDateTime = localizedDateTime;
|
|
155
|
+
}
|
|
156
|
+
getLocalizedDate() {
|
|
157
|
+
return this.#localizedDate;
|
|
158
|
+
}
|
|
159
|
+
setLocalizedDate(localizedDate) {
|
|
160
|
+
this.#localizedDate = localizedDate;
|
|
161
|
+
}
|
|
162
|
+
getLocalizedTime() {
|
|
163
|
+
return this.#localizedTime;
|
|
164
|
+
}
|
|
165
|
+
setLocalizedTime(localizedTime) {
|
|
166
|
+
this.#localizedTime = localizedTime;
|
|
167
|
+
}
|
|
168
|
+
getNotLocalizedDateTime() {
|
|
169
|
+
return this.#notLocalizedDateTime;
|
|
170
|
+
}
|
|
171
|
+
setNotLocalizedDateTime(notLocalizedDateTime) {
|
|
172
|
+
this.#notLocalizedDateTime = notLocalizedDateTime;
|
|
173
|
+
}
|
|
174
|
+
getNotLocalizedDate() {
|
|
175
|
+
return this.#notLocalizedDate;
|
|
176
|
+
}
|
|
177
|
+
setNotLocalizedDate(notLocalizedDate) {
|
|
178
|
+
this.#notLocalizedDate = notLocalizedDate;
|
|
179
|
+
}
|
|
180
|
+
getNotLocalizedTime() {
|
|
181
|
+
return this.#notLocalizedTime;
|
|
182
|
+
}
|
|
183
|
+
setNotLocalizedTime(notLocalizedTime) {
|
|
184
|
+
this.#notLocalizedTime = notLocalizedTime;
|
|
185
|
+
}
|
|
186
|
+
getLocalizedNumber() {
|
|
187
|
+
return this.#localizedNumber;
|
|
188
|
+
}
|
|
189
|
+
setLocalizedNumber(localizedNumber) {
|
|
190
|
+
this.#localizedNumber = localizedNumber;
|
|
191
|
+
}
|
|
192
|
+
getNotLocalizeNumber() {
|
|
193
|
+
return this.#notLocalizedNumber;
|
|
194
|
+
}
|
|
195
|
+
setNotLocalizeNumber(notLocalizedNumber) {
|
|
196
|
+
this.#notLocalizedNumber = notLocalizedNumber;
|
|
197
|
+
}
|
|
198
|
+
getCurrency() {
|
|
199
|
+
return this.#currency;
|
|
200
|
+
}
|
|
201
|
+
setCurrency(currency) {
|
|
202
|
+
this.#currency = currency;
|
|
203
|
+
}
|
|
204
|
+
getNotLocalizeCurrency() {
|
|
205
|
+
return this.#notLocalizedCurrency;
|
|
206
|
+
}
|
|
207
|
+
setNotLocalizeCurrency(notLocalizedCurrency) {
|
|
208
|
+
this.#notLocalizedCurrency = notLocalizedCurrency;
|
|
209
|
+
}
|
|
210
|
+
getPercentage() {
|
|
211
|
+
return this.#percentage;
|
|
212
|
+
}
|
|
213
|
+
setPercentage(percentage) {
|
|
214
|
+
this.#percentage = percentage;
|
|
215
|
+
}
|
|
216
|
+
getNotLocalizePercentage() {
|
|
217
|
+
return this.#notLocalizedPercentage;
|
|
218
|
+
}
|
|
219
|
+
setNotLocalizePercentage(notLocalizedPercentage) {
|
|
220
|
+
this.#notLocalizedPercentage = notLocalizedPercentage;
|
|
221
|
+
}
|
|
222
|
+
getIgnore() {
|
|
223
|
+
return this.#ignore;
|
|
224
|
+
}
|
|
225
|
+
setIgnore(ignore) {
|
|
226
|
+
this.#ignore = ignore;
|
|
227
|
+
}
|
|
228
|
+
getDnt() {
|
|
229
|
+
return this.#dnt;
|
|
230
|
+
}
|
|
231
|
+
setDnt(dnt) {
|
|
232
|
+
this.#dnt = dnt;
|
|
233
|
+
}
|
|
234
|
+
getAutoIgnore() {
|
|
235
|
+
return this.#autoIgnore;
|
|
236
|
+
}
|
|
237
|
+
setAutoIgnore(autoIgnore) {
|
|
238
|
+
this.#autoIgnore = autoIgnore;
|
|
239
|
+
}
|
|
240
|
+
getEncoding() {
|
|
241
|
+
return this.#encoding;
|
|
242
|
+
}
|
|
243
|
+
setEncoding(encoding) {
|
|
244
|
+
this.#encoding = encoding;
|
|
245
|
+
}
|
|
246
|
+
getTruncation() {
|
|
247
|
+
return this.#truncation;
|
|
248
|
+
}
|
|
249
|
+
setTruncation(truncation) {
|
|
250
|
+
this.#truncation = truncation;
|
|
251
|
+
}
|
|
252
|
+
getOverlapping() {
|
|
253
|
+
return this.#overlapping;
|
|
254
|
+
}
|
|
255
|
+
setOverlapping(overlapping) {
|
|
256
|
+
this.#overlapping = overlapping;
|
|
257
|
+
}
|
|
258
|
+
getReviewed() {
|
|
259
|
+
return this.#reviewed;
|
|
260
|
+
}
|
|
261
|
+
setReviewed(reviewed) {
|
|
262
|
+
this.#reviewed = reviewed;
|
|
263
|
+
}
|
|
264
|
+
incrementByType(type) {
|
|
265
|
+
switch (type) {
|
|
266
|
+
case _constants.I18N_STATUS.STRING_LOCALIZED:
|
|
267
|
+
++this.#localizedStrings;
|
|
268
|
+
break;
|
|
269
|
+
case _constants.I18N_STATUS.STRING_NOT_LOCALIZED:
|
|
270
|
+
++this.#notLocalizedStrings;
|
|
271
|
+
break;
|
|
272
|
+
case _constants.I18N_STATUS.UNTRANSLATED:
|
|
273
|
+
++this.#untranslatedStrings;
|
|
274
|
+
break;
|
|
275
|
+
case _constants.I18N_STATUS.STRING_PARTIALLY_LOCALIZED:
|
|
276
|
+
++this.#partialStrings;
|
|
277
|
+
break;
|
|
278
|
+
case _constants.I18N_STATUS.AUTO_IGNORE:
|
|
279
|
+
++this.#autoIgnore;
|
|
280
|
+
break;
|
|
281
|
+
case _constants.I18N_STATUS.IGNORE:
|
|
282
|
+
++this.#ignore;
|
|
283
|
+
break;
|
|
284
|
+
case _constants.I18N_STATUS.DNT:
|
|
285
|
+
++this.#dnt;
|
|
286
|
+
break;
|
|
287
|
+
case _constants.I18N_STATUS.ENCODING_ISSUE:
|
|
288
|
+
++this.#encoding;
|
|
289
|
+
break;
|
|
290
|
+
case _constants.I18N_STATUS.DATE_LOCALIZED:
|
|
291
|
+
++this.#localizedDate;
|
|
292
|
+
break;
|
|
293
|
+
case _constants.I18N_STATUS.TIME_LOCALIZED:
|
|
294
|
+
++this.#localizedTime;
|
|
295
|
+
break;
|
|
296
|
+
case _constants.I18N_STATUS.DATE_TIME_LOCALIZED:
|
|
297
|
+
++this.#localizedDateTime;
|
|
298
|
+
break;
|
|
299
|
+
case _constants.I18N_STATUS.DATE_NOT_LOCALIZED:
|
|
300
|
+
++this.#notLocalizedDate;
|
|
301
|
+
break;
|
|
302
|
+
case _constants.I18N_STATUS.TIME_NOT_LOCALIZED:
|
|
303
|
+
++this.#notLocalizedTime;
|
|
304
|
+
break;
|
|
305
|
+
case _constants.I18N_STATUS.DATE_TIME_NOT_LOCALIZED:
|
|
306
|
+
++this.#notLocalizedDateTime;
|
|
307
|
+
break;
|
|
308
|
+
case _constants.I18N_STATUS.NUMBER_LOCALIZED:
|
|
309
|
+
++this.#localizedNumber;
|
|
310
|
+
break;
|
|
311
|
+
case _constants.I18N_STATUS.NUMBER_NOT_LOCALIZED:
|
|
312
|
+
++this.#notLocalizedNumber;
|
|
313
|
+
break;
|
|
314
|
+
case _constants.I18N_STATUS.CURRENCY_LOCALIZED:
|
|
315
|
+
++this.#currency;
|
|
316
|
+
break;
|
|
317
|
+
case _constants.I18N_STATUS.CURRENCY_NOT_LOCALIZED:
|
|
318
|
+
++this.#notLocalizedCurrency;
|
|
319
|
+
break;
|
|
320
|
+
case _constants.I18N_STATUS.PERCENTAGE_LOCALIZED:
|
|
321
|
+
++this.#percentage;
|
|
322
|
+
break;
|
|
323
|
+
case _constants.I18N_STATUS.PERCENTAGE_NOT_LOCALIZED:
|
|
324
|
+
++this.#notLocalizedPercentage;
|
|
325
|
+
break;
|
|
326
|
+
case _constants.I18N_STATUS.TRUNCATION_ISSUE:
|
|
327
|
+
++this.#truncation;
|
|
328
|
+
break;
|
|
329
|
+
case _constants.I18N_STATUS.OVERLAPPING_ISSUE:
|
|
330
|
+
++this.#overlapping;
|
|
331
|
+
break;
|
|
332
|
+
case _constants.I18N_STATUS.REVIEWED:
|
|
333
|
+
++this.#reviewed;
|
|
334
|
+
break;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
toJSON() {
|
|
338
|
+
return {
|
|
339
|
+
localizedStrings: this.#localizedStrings,
|
|
340
|
+
notLocalizedStrings: this.#notLocalizedStrings,
|
|
341
|
+
untranslatedStrings: this.#untranslatedStrings,
|
|
342
|
+
partialStrings: this.#partialStrings,
|
|
343
|
+
localizedDateTime: this.#localizedDateTime,
|
|
344
|
+
localizedDate: this.#localizedDate,
|
|
345
|
+
localizedTime: this.#localizedTime,
|
|
346
|
+
notLocalizedDateTime: this.#notLocalizedDateTime,
|
|
347
|
+
notLocalizedDate: this.#notLocalizedDate,
|
|
348
|
+
notLocalizedTime: this.#notLocalizedTime,
|
|
349
|
+
localizedNumber: this.#localizedNumber,
|
|
350
|
+
notLocalizedNumber: this.#notLocalizedNumber,
|
|
351
|
+
currency: this.#currency,
|
|
352
|
+
notLocalizedCurrency: this.#notLocalizedCurrency,
|
|
353
|
+
percentage: this.#percentage,
|
|
354
|
+
notLocalizedPercentage: this.#notLocalizedPercentage,
|
|
355
|
+
ignore: this.#ignore,
|
|
356
|
+
dnt: this.#dnt,
|
|
357
|
+
autoIgnore: this.#autoIgnore,
|
|
358
|
+
encoding: this.#encoding,
|
|
359
|
+
truncation: this.#truncation,
|
|
360
|
+
overlapping: this.#overlapping,
|
|
361
|
+
reviewed: this.#reviewed
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
exports.default = StatData;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _stringInfo = _interopRequireDefault(require("./stringInfo.js"));
|
|
8
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
9
|
+
class StringData {
|
|
10
|
+
/**
|
|
11
|
+
* @type {{[key: string]: StringInfo[]}}
|
|
12
|
+
*/
|
|
13
|
+
#data = {};
|
|
14
|
+
constructor(data) {
|
|
15
|
+
if (data?.data) {
|
|
16
|
+
data = data.data;
|
|
17
|
+
for (const string in data) {
|
|
18
|
+
data[string].forEach(info => {
|
|
19
|
+
if (!this.#data[string]) {
|
|
20
|
+
this.#data[string] = [];
|
|
21
|
+
}
|
|
22
|
+
this.#data[string].push(new _stringInfo.default(info));
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
getStringData(string) {
|
|
28
|
+
return this.#data[string];
|
|
29
|
+
}
|
|
30
|
+
setStringData(string, info) {
|
|
31
|
+
!this.#data[string] && (this.#data[string] = []);
|
|
32
|
+
this.#data[string].push(new _stringInfo.default(info));
|
|
33
|
+
return true;
|
|
34
|
+
}
|
|
35
|
+
checkAndAdd(string, info) {
|
|
36
|
+
!this.#data[string] && (this.#data[string] = []);
|
|
37
|
+
const canAdd = this.getStringData(string).some(data => data.getDescription() !== info.getDescription || data.getType() !== info.imagePath || data.getType() !== data.type);
|
|
38
|
+
if (canAdd) {
|
|
39
|
+
this.setStringData(string, info);
|
|
40
|
+
}
|
|
41
|
+
return canAdd;
|
|
42
|
+
}
|
|
43
|
+
hasStringData(string) {
|
|
44
|
+
return string in this.#data;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @param {String} string
|
|
50
|
+
* @param {Object[] | Object} info
|
|
51
|
+
* @returns {StringData}
|
|
52
|
+
*/
|
|
53
|
+
static createNew(string, info) {
|
|
54
|
+
info = Array.isArray(info) ? info : [info];
|
|
55
|
+
return new StringData({
|
|
56
|
+
data: {
|
|
57
|
+
[string]: info
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
toJSON() {
|
|
62
|
+
return {
|
|
63
|
+
data: this.#data
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
exports.default = StringData;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
class StringInfo {
|
|
8
|
+
/**
|
|
9
|
+
* @type {String}
|
|
10
|
+
*/
|
|
11
|
+
#type;
|
|
12
|
+
/**
|
|
13
|
+
* @type {String}
|
|
14
|
+
*/
|
|
15
|
+
#imagePath;
|
|
16
|
+
/**
|
|
17
|
+
* @type {String}
|
|
18
|
+
*/
|
|
19
|
+
#description;
|
|
20
|
+
constructor(data) {
|
|
21
|
+
this.#type = data?.type || '';
|
|
22
|
+
this.#imagePath = data?.imagePath || '';
|
|
23
|
+
this.#description = data?.description || '';
|
|
24
|
+
}
|
|
25
|
+
getType() {
|
|
26
|
+
return this.#type;
|
|
27
|
+
}
|
|
28
|
+
setType(type) {
|
|
29
|
+
this.#type = type;
|
|
30
|
+
}
|
|
31
|
+
getImagePath() {
|
|
32
|
+
return this.#imagePath;
|
|
33
|
+
}
|
|
34
|
+
setImagePath(imagePath) {
|
|
35
|
+
this.#imagePath = imagePath;
|
|
36
|
+
}
|
|
37
|
+
getDescription() {
|
|
38
|
+
return this.#description;
|
|
39
|
+
}
|
|
40
|
+
setDescription(description) {
|
|
41
|
+
this.#description = description;
|
|
42
|
+
}
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
type: this.#type,
|
|
46
|
+
description: this.#description,
|
|
47
|
+
imagePath: this.#imagePath
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = StringInfo;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getSpacePattern = void 0;
|
|
7
|
+
const getSpacePattern = (asStr = true) => asStr ? '(?:\\s|\\t|(?: ))' : /(?:\s|\t|(?: ))/g;
|
|
8
|
+
exports.getSpacePattern = getSpacePattern;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _logs = _interopRequireDefault(require("../logs.js"));
|
|
8
|
+
var _reportData = _interopRequireDefault(require("../objects/reportData.js"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
class BaseReport {
|
|
11
|
+
/**
|
|
12
|
+
* @type {ReportData}
|
|
13
|
+
*/
|
|
14
|
+
#reportData;
|
|
15
|
+
/**
|
|
16
|
+
* @type {String | any}
|
|
17
|
+
*/
|
|
18
|
+
$generatedContent;
|
|
19
|
+
/**
|
|
20
|
+
* @type {String}
|
|
21
|
+
*/
|
|
22
|
+
$type;
|
|
23
|
+
constructor(type) {
|
|
24
|
+
this.$type = type;
|
|
25
|
+
}
|
|
26
|
+
generate(data) {
|
|
27
|
+
this.#reportData = data;
|
|
28
|
+
this.$generatedContent = this.buildContent();
|
|
29
|
+
}
|
|
30
|
+
export(path, name = 'report') {
|
|
31
|
+
this.write(path, name, this.$generatedContent);
|
|
32
|
+
_logs.default.info(`Wrote I18n Verification ${this.$type} report in ${path}/${name}`);
|
|
33
|
+
}
|
|
34
|
+
write(path, name, data) {
|
|
35
|
+
throw new Error('should be implemented by child report classes');
|
|
36
|
+
}
|
|
37
|
+
buildContent() {
|
|
38
|
+
throw new Error('should be implemented by child report classes');
|
|
39
|
+
}
|
|
40
|
+
getMetaInfo() {
|
|
41
|
+
return {
|
|
42
|
+
appName: this.#reportData.getAppName(),
|
|
43
|
+
locales: this.#reportData.getData().getLocales(),
|
|
44
|
+
stats: this.#reportData.getData().getMetaData().getStat(),
|
|
45
|
+
statsByLocale: this.#reportData.getData().getMetaData().getStatByLocale(),
|
|
46
|
+
reportTime: this.#reportData.getReportTime(),
|
|
47
|
+
stringData: this.#reportData.getData().getLocaleStringData()
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.default = BaseReport;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
var _constants = require("../../constants.js");
|
|
8
|
+
var _file = require("../../file.js");
|
|
9
|
+
var _logs = _interopRequireDefault(require("../../logs.js"));
|
|
10
|
+
var _base = _interopRequireDefault(require("../base.js"));
|
|
11
|
+
var _css = require("./template/css.js");
|
|
12
|
+
var _html = require("./template/html.js");
|
|
13
|
+
var _javascript = require("./template/javascript.js");
|
|
14
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
15
|
+
class HtmlReport extends _base.default {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(_constants.SUPPORTED_REPORT_TYPES.HTML);
|
|
18
|
+
}
|
|
19
|
+
buildContent() {
|
|
20
|
+
const metaInfo = this.getMetaInfo();
|
|
21
|
+
const script = (0, _javascript.getJsData)(metaInfo);
|
|
22
|
+
const style = (0, _css.getCssData)();
|
|
23
|
+
const body = (0, _html.getBodyData)(metaInfo);
|
|
24
|
+
return (0, _html.renderHtml)({
|
|
25
|
+
appName: metaInfo.appName,
|
|
26
|
+
reportTime: metaInfo.reportTime,
|
|
27
|
+
body,
|
|
28
|
+
script,
|
|
29
|
+
style
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
write(path, name, data) {
|
|
33
|
+
(0, _file.saveToFile)((0, _file.joinPaths)(path, `${name}.html`), data, 'utf-8');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
exports.default = HtmlReport;
|
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getCssData = void 0;
|
|
7
|
+
const getCssData = () => `
|
|
8
|
+
* {
|
|
9
|
+
user-select: none;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
body {
|
|
13
|
+
margin: 0;
|
|
14
|
+
display: flex;
|
|
15
|
+
flex-direction: column;
|
|
16
|
+
font-family: Arial, sans-serif;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
header {
|
|
20
|
+
background-color: #333;
|
|
21
|
+
height: 5rem;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
main {
|
|
25
|
+
display: flex;
|
|
26
|
+
direction: column;
|
|
27
|
+
width: 100%;
|
|
28
|
+
height: calc(100vh - 5rem);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.sidebar {
|
|
32
|
+
width: 250px;
|
|
33
|
+
height: 100%;
|
|
34
|
+
background-color: #333;
|
|
35
|
+
color: #fff;
|
|
36
|
+
padding: 20px;
|
|
37
|
+
box-sizing: border-box;
|
|
38
|
+
float: left;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.logo {
|
|
42
|
+
font-size: 2rem;
|
|
43
|
+
letter-spacing: 0.1rem;
|
|
44
|
+
color: #14cf96;
|
|
45
|
+
font-weight: bold;
|
|
46
|
+
padding-top: 1.8rem;
|
|
47
|
+
padding-left: 2rem;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.menu {
|
|
51
|
+
list-style-type: none;
|
|
52
|
+
padding: 0;
|
|
53
|
+
margin: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.menu-item {
|
|
57
|
+
margin-bottom: 10px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.menu-item a {
|
|
61
|
+
color: #fff;
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
display: block;
|
|
64
|
+
padding: 10px;
|
|
65
|
+
border-radius: 5px;
|
|
66
|
+
font-size: 1.05rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.menu-item a:hover {
|
|
70
|
+
background-color: #555;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.submenu {
|
|
74
|
+
display: none;
|
|
75
|
+
list-style-type: none;
|
|
76
|
+
padding-left: 20px;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.menu-item.has-submenu > a::after {
|
|
80
|
+
content: '▼';
|
|
81
|
+
float: right;
|
|
82
|
+
margin-left: 5px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.menu-item.selected > a {
|
|
86
|
+
background-color: #555;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
.submenu .sub-menu-item a:hover {
|
|
90
|
+
background-color: #777;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.submenu .sub-menu-item.selected a {
|
|
94
|
+
background-color: #555 !important;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.submenu.active {
|
|
98
|
+
display: block !important;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.content-wrapper {
|
|
102
|
+
padding: 20px;
|
|
103
|
+
float: left;
|
|
104
|
+
width: calc(100% - 250px);
|
|
105
|
+
background-color: #f4f4f4;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.content {
|
|
109
|
+
display: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.content .title {
|
|
113
|
+
font-size: 1rem;
|
|
114
|
+
color: #080404e2;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
.content .title::after {
|
|
118
|
+
content: ':';
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
.content.active {
|
|
122
|
+
display: flex !important;
|
|
123
|
+
flex-direction: column;
|
|
124
|
+
gap: 1rem;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
@media (max-width: 768px) {
|
|
128
|
+
.sidebar {
|
|
129
|
+
width: 100%;
|
|
130
|
+
padding: 10px;
|
|
131
|
+
}
|
|
132
|
+
}`;
|
|
133
|
+
exports.getCssData = getCssData;
|