@breadstone-tools/localizator-core 0.0.31 → 0.0.33

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.
Files changed (105) hide show
  1. package/_tests/AngularHTMLParser.Test.d.ts +1 -0
  2. package/_tests/AngularHTMLParser.Test.d.ts.map +1 -0
  3. package/_tests/AngularHTMLParser.Test.js +99 -0
  4. package/_tests/AngularHTMLParser.Test.js.map +1 -0
  5. package/_tests/AngularPreset.Test.d.ts +1 -0
  6. package/_tests/AngularPreset.Test.d.ts.map +1 -0
  7. package/_tests/AngularPreset.Test.js +14 -0
  8. package/_tests/AngularPreset.Test.js.map +1 -0
  9. package/_tests/DuplicateKeysTask.Test.d.ts +1 -0
  10. package/_tests/DuplicateKeysTask.Test.d.ts.map +1 -0
  11. package/_tests/DuplicateKeysTask.Test.js +97 -0
  12. package/_tests/DuplicateKeysTask.Test.js.map +1 -0
  13. package/_tests/EmptyValuesTask.Test.d.ts +1 -0
  14. package/_tests/EmptyValuesTask.Test.d.ts.map +1 -0
  15. package/_tests/EmptyValuesTask.Test.js +87 -0
  16. package/_tests/EmptyValuesTask.Test.js.map +1 -0
  17. package/_tests/JSXParser.Test.d.ts +1 -0
  18. package/_tests/JSXParser.Test.d.ts.map +1 -0
  19. package/_tests/JSXParser.Test.js +94 -0
  20. package/_tests/JSXParser.Test.js.map +1 -0
  21. package/_tests/JavaScriptParser.Test.d.ts +1 -0
  22. package/_tests/JavaScriptParser.Test.d.ts.map +1 -0
  23. package/_tests/JavaScriptParser.Test.js +231 -0
  24. package/_tests/JavaScriptParser.Test.js.map +1 -0
  25. package/_tests/JsonFormatter.Test.d.ts +1 -0
  26. package/_tests/JsonFormatter.Test.d.ts.map +1 -0
  27. package/_tests/JsonFormatter.Test.js +36 -0
  28. package/_tests/JsonFormatter.Test.js.map +1 -0
  29. package/_tests/JsonResourceSerializer.Test.d.ts +1 -0
  30. package/_tests/JsonResourceSerializer.Test.d.ts.map +1 -0
  31. package/_tests/JsonResourceSerializer.Test.js +105 -0
  32. package/_tests/JsonResourceSerializer.Test.js.map +1 -0
  33. package/_tests/JsonResourceTransformerAdapter.Test.d.ts +1 -0
  34. package/_tests/JsonResourceTransformerAdapter.Test.d.ts.map +1 -0
  35. package/_tests/JsonResourceTransformerAdapter.Test.js +126 -0
  36. package/_tests/JsonResourceTransformerAdapter.Test.js.map +1 -0
  37. package/_tests/KeyConsistencyTask.Test.d.ts +1 -0
  38. package/_tests/KeyConsistencyTask.Test.d.ts.map +1 -0
  39. package/_tests/KeyConsistencyTask.Test.js +160 -0
  40. package/_tests/KeyConsistencyTask.Test.js.map +1 -0
  41. package/_tests/KeyGenerator.Test.d.ts +1 -0
  42. package/_tests/KeyGenerator.Test.d.ts.map +1 -0
  43. package/_tests/KeyGenerator.Test.js +70 -0
  44. package/_tests/KeyGenerator.Test.js.map +1 -0
  45. package/_tests/LitPreset.Test.d.ts +1 -0
  46. package/_tests/LitPreset.Test.d.ts.map +1 -0
  47. package/_tests/LitPreset.Test.js +16 -0
  48. package/_tests/LitPreset.Test.js.map +1 -0
  49. package/_tests/LocalizationProcessor.Test.d.ts +1 -0
  50. package/_tests/LocalizationProcessor.Test.d.ts.map +1 -0
  51. package/_tests/LocalizationProcessor.Test.js +121 -0
  52. package/_tests/LocalizationProcessor.Test.js.map +1 -0
  53. package/_tests/MissingTranslationsTask.Test.d.ts +1 -0
  54. package/_tests/MissingTranslationsTask.Test.d.ts.map +1 -0
  55. package/_tests/MissingTranslationsTask.Test.js +132 -0
  56. package/_tests/MissingTranslationsTask.Test.js.map +1 -0
  57. package/_tests/ReactPreset.Test.d.ts +1 -0
  58. package/_tests/ReactPreset.Test.d.ts.map +1 -0
  59. package/_tests/ReactPreset.Test.js +16 -0
  60. package/_tests/ReactPreset.Test.js.map +1 -0
  61. package/_tests/ResourceProcessor.Test.d.ts +1 -0
  62. package/_tests/ResourceProcessor.Test.d.ts.map +1 -0
  63. package/_tests/ResourceProcessor.Test.js +31 -0
  64. package/_tests/ResourceProcessor.Test.js.map +1 -0
  65. package/_tests/ResxFormatter.Test.d.ts +1 -0
  66. package/_tests/ResxFormatter.Test.d.ts.map +1 -0
  67. package/_tests/ResxFormatter.Test.js +46 -0
  68. package/_tests/ResxFormatter.Test.js.map +1 -0
  69. package/_tests/ResxResourceSerializer.Test.d.ts +1 -0
  70. package/_tests/ResxResourceSerializer.Test.d.ts.map +1 -0
  71. package/_tests/ResxResourceSerializer.Test.js +119 -0
  72. package/_tests/ResxResourceSerializer.Test.js.map +1 -0
  73. package/_tests/ResxResourceTransformerAdapter.Test.d.ts +1 -0
  74. package/_tests/ResxResourceTransformerAdapter.Test.d.ts.map +1 -0
  75. package/_tests/ResxResourceTransformerAdapter.Test.js +118 -0
  76. package/_tests/ResxResourceTransformerAdapter.Test.js.map +1 -0
  77. package/_tests/StencilPreset.Test.d.ts +1 -0
  78. package/_tests/StencilPreset.Test.d.ts.map +1 -0
  79. package/_tests/StencilPreset.Test.js +14 -0
  80. package/_tests/StencilPreset.Test.js.map +1 -0
  81. package/_tests/TSXParser.Test.d.ts +1 -0
  82. package/_tests/TSXParser.Test.d.ts.map +1 -0
  83. package/_tests/TSXParser.Test.js +76 -0
  84. package/_tests/TSXParser.Test.js.map +1 -0
  85. package/_tests/TypeScriptParser.Test.d.ts +1 -0
  86. package/_tests/TypeScriptParser.Test.d.ts.map +1 -0
  87. package/_tests/TypeScriptParser.Test.js +277 -0
  88. package/_tests/TypeScriptParser.Test.js.map +1 -0
  89. package/_tests/TypescriptResourceSerializer.Test.d.ts +1 -0
  90. package/_tests/TypescriptResourceSerializer.Test.d.ts.map +1 -0
  91. package/_tests/TypescriptResourceSerializer.Test.js +143 -0
  92. package/_tests/TypescriptResourceSerializer.Test.js.map +1 -0
  93. package/_tests/UnusedKeysTask.Test.d.ts +1 -0
  94. package/_tests/UnusedKeysTask.Test.d.ts.map +1 -0
  95. package/_tests/UnusedKeysTask.Test.js +93 -0
  96. package/_tests/UnusedKeysTask.Test.js.map +1 -0
  97. package/_tests/VueParser.Test.d.ts +1 -0
  98. package/_tests/VueParser.Test.d.ts.map +1 -0
  99. package/_tests/VueParser.Test.js +164 -0
  100. package/_tests/VueParser.Test.js.map +1 -0
  101. package/_tests/VuePreset.Test.d.ts +1 -0
  102. package/_tests/VuePreset.Test.d.ts.map +1 -0
  103. package/_tests/VuePreset.Test.js +15 -0
  104. package/_tests/VuePreset.Test.js.map +1 -0
  105. package/package.json +3 -3
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+ // // #region Imports
3
+ // import { describe, it, expect } from 'vitest';
4
+ // import { TypeScriptParser } from '../src/Parsers/TypeScriptParser.js';
5
+ // // #endregion
6
+ // describe('TypeScriptParser', () => {
7
+ // it('should parse simple translations', () => {
8
+ // const parser = new TypeScriptParser(console);
9
+ // const content = 't("Simple string"); translate(\'Another string\'); new Date(Number.parseInt(\'@@BUILDDATE\'))';
10
+ // const result = parser.parse(content);
11
+ // expect(result).toEqual([
12
+ // {
13
+ // columnNumber: 0,
14
+ // context: 't("Simple string"); translate(\'Another string\'); new Date(Number.parseInt(\'@@BUILDDATE\'))',
15
+ // isStatic: true,
16
+ // lineNumber: 1,
17
+ // match: {
18
+ // function: 't',
19
+ // quote: '"',
20
+ // value: 'Simple string'
21
+ // }
22
+ // },
23
+ // {
24
+ // columnNumber: 20,
25
+ // context: 't("Simple string"); translate(\'Another string\'); new Date(Number.parseInt(\'@@BUILDDATE\'))',
26
+ // isStatic: true,
27
+ // lineNumber: 1,
28
+ // match: {
29
+ // function: 'translate',
30
+ // quote: "'",
31
+ // value: 'Another string'
32
+ // }
33
+ // }
34
+ // ]);
35
+ // });
36
+ // it('should parse template literals', () => {
37
+ // const parser = new TypeScriptParser(console);
38
+ // const content = 't(`Template literal string`);';
39
+ // const result = parser.parse(content);
40
+ // expect(result).toEqual([
41
+ // {
42
+ // columnNumber: 0,
43
+ // context: 't(`Template literal string`);',
44
+ // isStatic: true,
45
+ // lineNumber: 1,
46
+ // match: {
47
+ // function: 't',
48
+ // quote: '`',
49
+ // value: 'Template literal string'
50
+ // }
51
+ // }
52
+ // ]);
53
+ // });
54
+ // it('should normalize multiline strings', () => {
55
+ // const parser = new TypeScriptParser(console);
56
+ // const content = 't("This is a multiline string");';
57
+ // const result = parser.parse(content);
58
+ // expect(result).toEqual([
59
+ // {
60
+ // columnNumber: 0,
61
+ // context: 't("This is a multiline string");',
62
+ // isStatic: true,
63
+ // lineNumber: 1,
64
+ // match: {
65
+ // function: 't',
66
+ // quote: '"',
67
+ // value: 'This is a multiline string'
68
+ // }
69
+ // }
70
+ // ]);
71
+ // });
72
+ // it('should parse translations with context', () => {
73
+ // const parser = new TypeScriptParser(console);
74
+ // const content = 't("This is translatable", { context: "example" });';
75
+ // const result = parser.parse(content);
76
+ // expect(result).toEqual([
77
+ // {
78
+ // columnNumber: 0,
79
+ // context: 't("This is translatable", { context: "example" });',
80
+ // isStatic: true,
81
+ // lineNumber: 1,
82
+ // match: {
83
+ // function: 't',
84
+ // quote: '"',
85
+ // value: 'This is translatable'
86
+ // }
87
+ // }
88
+ // ]);
89
+ // });
90
+ // it('should handle custom markers as strings', () => {
91
+ // const parser = new TypeScriptParser(console, { marker: 'customTranslate' });
92
+ // const content = 'customTranslate("Custom string");';
93
+ // const result = parser.parse(content);
94
+ // expect(result).toEqual([
95
+ // {
96
+ // columnNumber: 0,
97
+ // context: 'customTranslate("Custom string");',
98
+ // isStatic: true,
99
+ // lineNumber: 1,
100
+ // match: {
101
+ // function: 'customTranslate',
102
+ // quote: '"',
103
+ // value: 'Custom string'
104
+ // }
105
+ // }
106
+ // ]);
107
+ // });
108
+ // it('should handle custom markers as regex', () => {
109
+ // const parser = new TypeScriptParser(console, { marker: /custom|translate/ });
110
+ // const content = `
111
+ // custom("Custom function");
112
+ // translate("Translated string");
113
+ // `;
114
+ // const result = parser.parse(content);
115
+ // expect(result).toEqual([
116
+ // {
117
+ // columnNumber: 12,
118
+ // context: 'custom("Custom function");',
119
+ // isStatic: true,
120
+ // lineNumber: 2,
121
+ // match: {
122
+ // function: 'custom',
123
+ // quote: '"',
124
+ // value: 'Custom function'
125
+ // }
126
+ // },
127
+ // {
128
+ // columnNumber: 12,
129
+ // context: 'translate("Translated string");',
130
+ // isStatic: true,
131
+ // lineNumber: 3,
132
+ // match: {
133
+ // function: 'translate',
134
+ // quote: '"',
135
+ // value: 'Translated string'
136
+ // }
137
+ // }
138
+ // ]);
139
+ // });
140
+ // it('should handle escaped quotes', () => {
141
+ // const parser = new TypeScriptParser(console);
142
+ // const content = 't("Escaped \\"quote\\""); translate(\'Escaped \\\'quote\\\'\');';
143
+ // const result = parser.parse(content);
144
+ // expect(result).toEqual([
145
+ // {
146
+ // columnNumber: 0,
147
+ // context: 't("Escaped \\"quote\\""); translate(\'Escaped \\\'quote\\\'\');',
148
+ // isStatic: true,
149
+ // lineNumber: 1,
150
+ // match: {
151
+ // function: 't',
152
+ // quote: '"',
153
+ // value: 'Escaped "quote"'
154
+ // }
155
+ // },
156
+ // {
157
+ // columnNumber: 24,
158
+ // context: 't("Escaped \\"quote\\""); translate(\'Escaped \\\'quote\\\'\');',
159
+ // isStatic: true,
160
+ // lineNumber: 1,
161
+ // match: {
162
+ // function: 'translate',
163
+ // quote: "'",
164
+ // value: "Escaped 'quote'"
165
+ // }
166
+ // }
167
+ // ]);
168
+ // });
169
+ // it('should handle methods with a context', () => {
170
+ // const parser = new TypeScriptParser(console);
171
+ // const content = 't("This is translatable", { context: "example" });';
172
+ // const result = parser.parse(content);
173
+ // expect(result).toEqual([
174
+ // {
175
+ // columnNumber: 0,
176
+ // context: 't("This is translatable", { context: "example" });',
177
+ // isStatic: true,
178
+ // lineNumber: 1,
179
+ // match: {
180
+ // function: 't',
181
+ // quote: '"',
182
+ // value: 'This is translatable'
183
+ // }
184
+ // }
185
+ // ]);
186
+ // });
187
+ // it('should match on possible resource strings', () => {
188
+ // const parser = new TypeScriptParser(console);
189
+ // const content = 't("This.Is.A.Translatable.string")';
190
+ // const result = parser.parse(content);
191
+ // expect(result).toEqual([{
192
+ // columnNumber: 0,
193
+ // lineNumber: 1,
194
+ // context: 't("This.Is.A.Translatable.string")',
195
+ // isStatic: false,
196
+ // match: {
197
+ // function: 't',
198
+ // quote: '"',
199
+ // value: 'This.Is.A.Translatable.string'
200
+ // }
201
+ // }]);
202
+ // });
203
+ // it('should not match invalid function calls', () => {
204
+ // const parser = new TypeScriptParser(console);
205
+ // const content = 't(); t("Valid string"); translate();';
206
+ // const result = parser.parse(content);
207
+ // expect(result).toEqual([
208
+ // {
209
+ // columnNumber: 5,
210
+ // context: 't(); t("Valid string"); translate();',
211
+ // isStatic: true,
212
+ // lineNumber: 1,
213
+ // match: {
214
+ // function: 't',
215
+ // quote: '"',
216
+ // value: 'Valid string'
217
+ // }
218
+ // }
219
+ // ]);
220
+ // });
221
+ // it('should not match on comments', () => {
222
+ // const parser = new TypeScriptParser(console);
223
+ // const content = '// t("This is a comment");';
224
+ // const result = parser.parse(content);
225
+ // expect(result).toEqual([{
226
+ // columnNumber: 3,
227
+ // lineNumber: 1,
228
+ // isStatic: true,
229
+ // context: '// t("This is a comment");',
230
+ // match: {
231
+ // function: 't',
232
+ // quote: '"',
233
+ // value: 'This is a comment'
234
+ // }
235
+ // }]);
236
+ // });
237
+ // it('should not match on comments with quotes', () => {
238
+ // const parser = new TypeScriptParser(console);
239
+ // const content = '// "This is a comment"';
240
+ // const result = parser.parse(content);
241
+ // expect(result).toEqual([]);
242
+ // });
243
+ // it('should not match on comments with function calls', () => {
244
+ // const parser = new TypeScriptParser(console);
245
+ // const content = 't("This.is.a.comment")';
246
+ // const result = parser.parse(content);
247
+ // expect(result).toEqual([{
248
+ // columnNumber: 0,
249
+ // lineNumber: 1,
250
+ // context: 't("This.is.a.comment")',
251
+ // isStatic: false,
252
+ // match: {
253
+ // function: 't',
254
+ // quote: '"',
255
+ // value: 'This.is.a.comment'
256
+ // }
257
+ // }]);
258
+ // });
259
+ // it('should handle dynamic strings', () => {
260
+ // const parser = new TypeScriptParser(console);
261
+ // // eslint-disable-next-line @stylistic/quotes
262
+ // const content = `"\${translate(\`loc.formatting.\${x.type}.description\`)}"`;
263
+ // const result = parser.parse(content);
264
+ // expect(result).toEqual([{
265
+ // columnNumber: 0,
266
+ // lineNumber: 1,
267
+ // context: 't("This.is.a.comment")',
268
+ // isStatic: false,
269
+ // match: {
270
+ // function: 't',
271
+ // quote: '"',
272
+ // value: 'This.is.a.comment'
273
+ // }
274
+ // }]);
275
+ // });
276
+ // });
277
+ //# sourceMappingURL=TypeScriptParser.Test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypeScriptParser.Test.js","sourceRoot":"","sources":["../../src/_tests/TypeScriptParser.Test.ts"],"names":[],"mappings":";AAAA,qBAAqB;AAErB,iDAAiD;AACjD,yEAAyE;AAEzE,gBAAgB;AAEhB,uCAAuC;AACvC,qDAAqD;AACrD,wDAAwD;AACxD,2HAA2H;AAC3H,gDAAgD;AAEhD,mCAAmC;AACnC,gBAAgB;AAChB,mCAAmC;AACnC,4HAA4H;AAC5H,kCAAkC;AAClC,iCAAiC;AACjC,2BAA2B;AAC3B,qCAAqC;AACrC,kCAAkC;AAClC,6CAA6C;AAC7C,oBAAoB;AACpB,iBAAiB;AACjB,gBAAgB;AAChB,oCAAoC;AACpC,4HAA4H;AAC5H,kCAAkC;AAClC,iCAAiC;AACjC,2BAA2B;AAC3B,6CAA6C;AAC7C,kCAAkC;AAClC,8CAA8C;AAC9C,oBAAoB;AACpB,gBAAgB;AAChB,cAAc;AACd,UAAU;AAEV,mDAAmD;AACnD,wDAAwD;AACxD,2DAA2D;AAC3D,gDAAgD;AAEhD,mCAAmC;AACnC,gBAAgB;AAChB,mCAAmC;AACnC,4DAA4D;AAC5D,kCAAkC;AAClC,iCAAiC;AACjC,2BAA2B;AAC3B,qCAAqC;AACrC,kCAAkC;AAClC,uDAAuD;AACvD,oBAAoB;AACpB,gBAAgB;AAChB,cAAc;AACd,UAAU;AAEV,uDAAuD;A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CAAoC;AACpC,+BAA+B;AAC/B,6BAA6B;AAC7B,8BAA8B;AAC9B,qDAAqD;AACrD,uBAAuB;AACvB,iCAAiC;AACjC,8BAA8B;AAC9B,6CAA6C;AAC7C,gBAAgB;AAChB,eAAe;AACf,UAAU;AAEV,6DAA6D;AAC7D,wDAAwD;AACxD,oDAAoD;AACpD,gDAAgD;AAEhD,sCAAsC;AACtC,UAAU;AAEV,qEAAqE;AACrE,wDAAwD;AACxD,oDAAoD;AACpD,gDAAgD;AAEhD,oCAAoC;AACpC,+BAA+B;AAC/B,6BAA6B;AAC7B,iDAAiD;AACjD,+BAA+B;AAC/B,uBAAuB;AACvB,iCAAiC;AACjC,8BAA8B;AAC9B,6CAA6C;AAC7C,gBAAgB;AAChB,eAAe;AACf,UAAU;AAEV,kDAAkD;AAClD,wDAAwD;AACxD,wDAAwD;AACxD,wFAAwF;AACxF,gDAAgD;AAEhD,oCAAoC;AACpC,+BAA+B;AAC/B,6BAA6B;AAC7B,iDAAiD;AACjD,+BAA+B;AAC/B,uBAAuB;AACvB,iCAAiC;AACjC,8BAA8B;AAC9B,6CAA6C;AAC7C,gBAAgB;AAChB,eAAe;AACf,UAAU;AACV,MAAM"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=TypescriptResourceSerializer.Test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypescriptResourceSerializer.Test.d.ts","sourceRoot":"","sources":["../../src/_tests/TypescriptResourceSerializer.Test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,143 @@
1
+ "use strict";
2
+ // // #region Imports
3
+ // import { describe, it, expect } from 'vitest';
4
+ // import { TypescriptResourceSerializer } from '../src/Resources/Transformers/Serializers/TypescriptResourceSerializer';
5
+ // import type { ITransformModel } from '../src/Resources/Models/Interfaces/ITransformModel';
6
+ // import { TypeScriptResourceInfo } from '../src/Resources/Models/TypeScriptResourceInfo';
7
+ // // #endregion
8
+ // describe('TypeScriptResourceSerializer', () => {
9
+ // it('should serialize a flat array of transform models into a TypeScript resource', () => {
10
+ // const models: Array<ITransformModel> = [
11
+ // {
12
+ // key: 'key1',
13
+ // value: 'value1',
14
+ // comment: ''
15
+ // },
16
+ // {
17
+ // key: 'key2',
18
+ // value: 'value2',
19
+ // comment: ''
20
+ // }
21
+ // ];
22
+ // const serializer = new TypescriptResourceSerializer();
23
+ // const result = serializer.serialize(models);
24
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
25
+ // expect(result.locale).toBe('en');
26
+ // expect(result.data).toEqual({
27
+ // key1: 'value1',
28
+ // key2: 'value2'
29
+ // });
30
+ // });
31
+ // it('should serialize a nested array of transform models into a nested TypeScript resource', () => {
32
+ // const models: Array<ITransformModel> = [
33
+ // {
34
+ // key: 'key1.subKey1',
35
+ // value: 'value1',
36
+ // comment: ''
37
+ // },
38
+ // {
39
+ // key: 'key1.subKey2',
40
+ // value: 'value2',
41
+ // comment: ''
42
+ // },
43
+ // {
44
+ // key: 'key2',
45
+ // value: 'value3',
46
+ // comment: ''
47
+ // }
48
+ // ];
49
+ // const serializer = new TypescriptResourceSerializer();
50
+ // const result = serializer.serialize(models);
51
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
52
+ // expect(result.locale).toBe('en');
53
+ // expect(result.data).toEqual({
54
+ // key1: {
55
+ // subKey1: 'value1',
56
+ // subKey2: 'value2'
57
+ // },
58
+ // key2: 'value3'
59
+ // });
60
+ // });
61
+ // it('should handle an empty array of transform models', () => {
62
+ // const models: Array<ITransformModel> = [];
63
+ // const serializer = new TypescriptResourceSerializer();
64
+ // const result = serializer.serialize(models);
65
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
66
+ // expect(result.locale).toBe('en');
67
+ // expect(result.data).toEqual({});
68
+ // });
69
+ // it('should handle transform models with special characters in keys', () => {
70
+ // const models: Array<ITransformModel> = [
71
+ // {
72
+ // key: 'key.with.dot',
73
+ // value: 'value1',
74
+ // comment: ''
75
+ // },
76
+ // {
77
+ // key: 'key.with.dash-key',
78
+ // value: 'value2',
79
+ // comment: ''
80
+ // },
81
+ // {
82
+ // key: 'key_with_underscore',
83
+ // value: 'value3',
84
+ // comment: ''
85
+ // }
86
+ // ];
87
+ // const serializer = new TypescriptResourceSerializer();
88
+ // const result = serializer.serialize(models);
89
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
90
+ // expect(result.locale).toBe('en');
91
+ // expect(result.data).toEqual({
92
+ // key: {
93
+ // with: {
94
+ // 'dot': 'value1',
95
+ // 'dash-key': 'value2'
96
+ // }
97
+ // },
98
+ // // eslint-disable-next-line camelcase
99
+ // key_with_underscore: 'value3'
100
+ // });
101
+ // });
102
+ // it('should preserve comments in transform models', () => {
103
+ // const models: Array<ITransformModel> = [
104
+ // {
105
+ // key: 'key1',
106
+ // value: 'value1',
107
+ // comment: 'This is a comment'
108
+ // }
109
+ // ];
110
+ // const serializer = new TypescriptResourceSerializer();
111
+ // const result = serializer.serialize(models);
112
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
113
+ // expect(result.locale).toBe('en');
114
+ // expect(result.data).toEqual({
115
+ // key1: 'value1'
116
+ // });
117
+ // // Note: Comments are not part of the `data` property but could be extended later if needed.
118
+ // });
119
+ // it('should create a TypeScript resource is the correct format', () => {
120
+ // const models: Array<ITransformModel> = [
121
+ // {
122
+ // key: 'key1',
123
+ // value: 'value1',
124
+ // comment: ''
125
+ // },
126
+ // {
127
+ // key: 'key2',
128
+ // value: 'value2',
129
+ // comment: ''
130
+ // }
131
+ // ];
132
+ // const serializer = new TypescriptResourceSerializer();
133
+ // const result = serializer.serialize(models);
134
+ // expect(result).toBeInstanceOf(TypeScriptResourceInfo);
135
+ // expect(result.locale).toBe('en');
136
+ // expect(result.data).toEqual({
137
+ // key1: 'value1',
138
+ // key2: 'value2'
139
+ // });
140
+ // expect(result.toString()).includes('static readonly key1: string = \'value1\';');
141
+ // });
142
+ // });
143
+ //# sourceMappingURL=TypescriptResourceSerializer.Test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TypescriptResourceSerializer.Test.js","sourceRoot":"","sources":["../../src/_tests/TypescriptResourceSerializer.Test.ts"],"names":[],"mappings":";AAAA,qBAAqB;AAErB,iDAAiD;AACjD,yHAAyH;AACzH,6FAA6F;AAC7F,2FAA2F;AAE3F,gBAAgB;AAEhB,mDAAmD;AACnD,iGAAiG;AACjG,mDAAmD;AACnD,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,8BAA8B;AAC9B,gBAAgB;AAChB,aAAa;AAEb,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,wCAAwC;AACxC,8BAA8B;AAC9B,6BAA6B;AAC7B,cAAc;AACd,UAAU;AAEV,0GAA0G;AAC1G,mDAAmD;AACnD,gBAAgB;AAChB,uCAAuC;AACvC,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,uCAAuC;AACvC,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,8BAA8B;AAC9B,gBAAgB;AAChB,aAAa;AAEb,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,wCAAwC;AACxC,sBAAsB;AACtB,qCAAqC;AACrC,oCAAoC;AACpC,iBAAiB;AACjB,6BAA6B;AAC7B,cAAc;AACd,UAAU;AAEV,qEAAqE;AACrE,qDAAqD;AAErD,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,2CAA2C;AAC3C,UAAU;AAEV,mFAAmF;AACnF,mDAAmD;AACnD,gBAAgB;AAChB,uCAAuC;AACvC,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,4CAA4C;AAC5C,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,8CAA8C;AAC9C,mCAAmC;AACnC,8BAA8B;AAC9B,gBAAgB;AAChB,aAAa;AAEb,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,wCAAwC;AACxC,qBAAqB;AACrB,0BAA0B;AAC1B,uCAAuC;AACvC,2CAA2C;AAC3C,oBAAoB;AACpB,iBAAiB;AACjB,oDAAoD;AACpD,4CAA4C;AAC5C,cAAc;AACd,UAAU;AAEV,iEAAiE;AACjE,mDAAmD;AACnD,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,+CAA+C;AAC/C,gBAAgB;AAChB,aAAa;AAEb,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,wCAAwC;AACxC,6BAA6B;AAC7B,cAAc;AAEd,uGAAuG;AACvG,UAAU;AAEV,8EAA8E;AAC9E,mDAAmD;AACnD,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,8BAA8B;AAC9B,iBAAiB;AACjB,gBAAgB;AAChB,+BAA+B;AAC/B,mCAAmC;AACnC,8BAA8B;AAC9B,gBAAgB;AAChB,aAAa;AAEb,iEAAiE;AACjE,uDAAuD;AAEvD,iEAAiE;AACjE,4CAA4C;AAC5C,wCAAwC;AACxC,8BAA8B;AAC9B,6BAA6B;AAC7B,cAAc;AACd,4FAA4F;AAC5F,UAAU;AACV,MAAM"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=UnusedKeysTask.Test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnusedKeysTask.Test.d.ts","sourceRoot":"","sources":["../../src/_tests/UnusedKeysTask.Test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,93 @@
1
+ "use strict";
2
+ // // #region Imports
3
+ // import { describe, it, expect } from 'vitest';
4
+ // import { UnusedKeysTask } from '../src/Resources/Analyzers/Tasks/UnusedKeysTask';
5
+ // import { JsonResourceInfo } from '../src/Resources/Models/JsonResourceInfo';
6
+ // import type { IAnalyzerTaskExecutionContext, IAnalyzerTaskResult } from '../src/Resources/Analyzers/Tasks/Interfaces/IAnalyzerTask';
7
+ // // #endregion
8
+ // describe('UnusedKeysTask', () => {
9
+ // it('should identify unused keys in resources', () => {
10
+ // const task = new UnusedKeysTask(console);
11
+ // const context: IAnalyzerTaskExecutionContext = {
12
+ // resources: [
13
+ // new JsonResourceInfo({
14
+ // locale: 'en',
15
+ // data: {
16
+ // key1: 'value1',
17
+ // key2: 'value2',
18
+ // key3: 'value3'
19
+ // }
20
+ // }),
21
+ // new JsonResourceInfo({
22
+ // locale: 'de',
23
+ // data: {
24
+ // keyA: 'wertA',
25
+ // keyB: 'wertB',
26
+ // keyC: 'wertC'
27
+ // }
28
+ // })
29
+ // ],
30
+ // parameters: {
31
+ // usedKeys: new Set(['key1', 'keyA', 'keyB'])
32
+ // }
33
+ // };
34
+ // const result: IAnalyzerTaskResult<any> = task.execute(context);
35
+ // expect(result.success).toBe(false);
36
+ // expect(result.message).toBe('Unused keys found in one or more resources.');
37
+ // expect(result.data).toEqual([
38
+ // {
39
+ // locale: 'en',
40
+ // unusedKeys: ['key2', 'key3']
41
+ // },
42
+ // {
43
+ // locale: 'de',
44
+ // unusedKeys: ['keyC']
45
+ // }
46
+ // ]);
47
+ // });
48
+ // it('should return success when all keys are used', () => {
49
+ // const task = new UnusedKeysTask(console);
50
+ // const context: IAnalyzerTaskExecutionContext = {
51
+ // resources: [
52
+ // new JsonResourceInfo({
53
+ // locale: 'en',
54
+ // data: {
55
+ // key1: 'value1',
56
+ // key2: 'value2'
57
+ // }
58
+ // }),
59
+ // new JsonResourceInfo({
60
+ // locale: 'de',
61
+ // data: {
62
+ // keyA: 'wertA',
63
+ // keyB: 'wertB'
64
+ // }
65
+ // })
66
+ // ],
67
+ // parameters: {
68
+ // usedKeys: new Set(['key1', 'key2', 'keyA', 'keyB'])
69
+ // }
70
+ // };
71
+ // const result: IAnalyzerTaskResult<any> = task.execute(context);
72
+ // expect(result.success).toBe(true);
73
+ // expect(result.message).toBe('No unused keys found in resources.');
74
+ // expect(result.data).toEqual([]);
75
+ // });
76
+ // it('should throw an error when "usedKeys" parameter is missing', () => {
77
+ // const task = new UnusedKeysTask(console);
78
+ // const context: IAnalyzerTaskExecutionContext = {
79
+ // resources: [
80
+ // new JsonResourceInfo({
81
+ // locale: 'en',
82
+ // data: {
83
+ // key1: 'value1',
84
+ // key2: 'value2'
85
+ // }
86
+ // })
87
+ // ],
88
+ // parameters: {}
89
+ // };
90
+ // expect(() => task.execute(context)).toThrowError('Missing "usedKeys" parameter in execution context.');
91
+ // });
92
+ // });
93
+ //# sourceMappingURL=UnusedKeysTask.Test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UnusedKeysTask.Test.js","sourceRoot":"","sources":["../../src/_tests/UnusedKeysTask.Test.ts"],"names":[],"mappings":";AAAA,qBAAqB;AAErB,iDAAiD;AACjD,oFAAoF;AACpF,+EAA+E;AAC/E,uIAAuI;AAEvI,gBAAgB;AAEhB,qCAAqC;AACrC,6DAA6D;AAC7D,oDAAoD;AACpD,2DAA2D;AAC3D,2BAA2B;AAC3B,yCAAyC;AACzC,oCAAoC;AACpC,8BAA8B;AAC9B,0CAA0C;AAC1C,0CAA0C;AAC1C,yCAAyC;AACzC,wBAAwB;AACxB,sBAAsB;AACtB,yCAAyC;AACzC,oCAAoC;AACpC,8BAA8B;AAC9B,yCAAyC;AACzC,yCAAyC;AACzC,wCAAwC;AACxC,wBAAwB;AACxB,qBAAqB;AACrB,iBAAiB;AACjB,4BAA4B;AAC5B,8DAA8D;AAC9D,gBAAgB;AAChB,aAAa;AAEb,0EAA0E;AAE1E,8CAA8C;AAC9C,sFAAsF;AACtF,wCAAwC;AACxC,gBAAgB;AAChB,gCAAgC;AAChC,+CAA+C;AAC/C,iBAAiB;AACjB,gBAAgB;AAChB,gCAAgC;AAChC,uCAAuC;AACvC,gBAAgB;AAChB,cAAc;AACd,UAAU;AAEV,iEAAiE;AACjE,oDAAoD;AACpD,2DAA2D;AAC3D,2BAA2B;AAC3B,yCAAyC;AACzC,oCAAoC;AACpC,8BAA8B;AAC9B,0CAA0C;AAC1C,yCAAyC;AACzC,wBAAwB;AACxB,sBAAsB;AACtB,yCAAyC;AACzC,oCAAoC;AACpC,8BAA8B;AAC9B,yCAAyC;AACzC,wCAAwC;AACxC,wBAAwB;AACxB,qBAAqB;AACrB,iBAAiB;AACjB,4BAA4B;AAC5B,sEAAsE;AACtE,gBAAgB;AAChB,aAAa;AAEb,0EAA0E;AAE1E,6CAA6C;AAC7C,6EAA6E;AAC7E,2CAA2C;AAC3C,UAAU;AAEV,+EAA+E;AAC/E,oDAAoD;AACpD,2DAA2D;AAC3D,2BAA2B;AAC3B,yCAAyC;AACzC,oCAAoC;AACpC,8BAA8B;AAC9B,0CAA0C;AAC1C,yCAAyC;AACzC,wBAAwB;AACxB,qBAAqB;AACrB,iBAAiB;AACjB,6BAA6B;AAC7B,aAAa;AAEb,kHAAkH;AAClH,UAAU;AACV,MAAM"}
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=VueParser.Test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"VueParser.Test.d.ts","sourceRoot":"","sources":["../../src/_tests/VueParser.Test.ts"],"names":[],"mappings":""}