vbss-translator 1.1.1 → 2.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/generator.js CHANGED
@@ -1,360 +1,477 @@
1
- import { glob as y } from "glob";
2
- import { mkdir as v, writeFile as $, readFile as j } from "fs/promises";
3
- import { dirname as p, resolve as F, normalize as d, relative as P } from "path";
4
- async function T(n) {
1
+ import { readdir as S, stat as x, mkdir as E, writeFile as O, readFile as D } from "fs/promises";
2
+ import { isAbsolute as L, parse as C, resolve as w, join as d, dirname as b, normalize as j, relative as N } from "path";
3
+ const R = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR", "EACCES", "EPERM"]), A = /* @__PURE__ */ new Set(["win32", "darwin"]), P = (t) => typeof t == "object" && t !== null && "code" in t && typeof t.code == "string" && R.has(t.code), v = async (t) => {
5
4
  try {
6
- const r = await y(n, { cwd: process.cwd(), absolute: !1 }), t = process.cwd();
7
- return r.map((e) => ({
8
- path: F(t, e),
9
- relativePath: d(e).replace(/\\/g, "/"),
5
+ return await S(t, { withFileTypes: !0 });
6
+ } catch (n) {
7
+ if (P(n)) return [];
8
+ throw n;
9
+ }
10
+ }, F = async (t) => {
11
+ try {
12
+ return await x(t);
13
+ } catch (n) {
14
+ if (P(n)) return null;
15
+ throw n;
16
+ }
17
+ }, I = (t) => t.replace(/[.*+?^${}()|[\]\\/-]/g, "\\$&"), G = (t) => t.replace(/[\\\][^]/g, "\\$&"), _ = (t, n) => {
18
+ const e = [];
19
+ let s = 0, a = n + 1;
20
+ for (let r = n; r < t.length; r++) {
21
+ const o = t[r];
22
+ if (o === "{")
23
+ s++;
24
+ else if (o === "}") {
25
+ if (s--, s === 0)
26
+ return e.push(t.slice(a, r)), { alternatives: e, end: r };
27
+ } else o === "," && s === 1 && (e.push(t.slice(a, r)), a = r + 1);
28
+ }
29
+ return { alternatives: e, end: -1 };
30
+ }, $ = (t) => {
31
+ const n = t.indexOf("{");
32
+ if (n === -1) return [t];
33
+ const { alternatives: e, end: s } = _(t, n);
34
+ if (s === -1) return [t];
35
+ const a = t.slice(0, n), r = t.slice(s + 1);
36
+ if (e.length < 2) {
37
+ const o = t.slice(n, s + 1);
38
+ return $(r).map((u) => a + o + u);
39
+ }
40
+ return e.flatMap(
41
+ (o) => $(a + o + r)
42
+ );
43
+ }, J = (t, n) => {
44
+ let e = "";
45
+ for (let s = 0; s < t.length; s++) {
46
+ const a = t[s];
47
+ if (a === "*")
48
+ e += "[^/]*";
49
+ else if (a === "?")
50
+ e += "[^/]";
51
+ else if (a === "[") {
52
+ const r = t.indexOf("]", s + 2);
53
+ if (r === -1)
54
+ e += "\\[";
55
+ else {
56
+ const o = t.slice(s + 1, r), u = o.startsWith("!") || o.startsWith("^");
57
+ e += `[${u ? "^" : ""}${G(
58
+ u ? o.slice(1) : o
59
+ )}]`, s = r;
60
+ }
61
+ } else
62
+ e += I(a);
63
+ }
64
+ return new RegExp(`^${e}$`, n ? "i" : "");
65
+ }, M = (t, n) => {
66
+ var s;
67
+ const e = [];
68
+ for (const a of t)
69
+ a === "**" ? ((s = e[e.length - 1]) == null ? void 0 : s.kind) !== "globstar" && e.push({ kind: "globstar" }) : /[*?[]/.test(a) ? e.push({
70
+ kind: "pattern",
71
+ regexp: J(a, n),
72
+ matchesDotfiles: a.startsWith(".")
73
+ }) : e.push({ kind: "literal", text: a });
74
+ return e;
75
+ }, T = async (t, n) => {
76
+ var e;
77
+ return n.isFile() ? !0 : n.isSymbolicLink() ? ((e = await F(d(t, n.name))) == null ? void 0 : e.isFile()) ?? !1 : !1;
78
+ }, W = async (t, n) => {
79
+ var e;
80
+ return n.isDirectory() ? !0 : n.isSymbolicLink() ? ((e = await F(d(t, n.name))) == null ? void 0 : e.isDirectory()) ?? !1 : !1;
81
+ };
82
+ async function q(t, n) {
83
+ const e = A.has(process.platform), s = /* @__PURE__ */ new Set();
84
+ for (const a of $(t.replace(/\\/g, "/"))) {
85
+ const r = L(a) ? C(a).root : "", o = a.slice(r.length).split("/").filter((i) => i !== "" && i !== ".");
86
+ if (o.length === 0) continue;
87
+ const u = M(o, e), f = (i, h, c) => {
88
+ s.add(
89
+ r || n.absolute ? w(i, c) : [...h, c].join("/")
90
+ );
91
+ }, l = async (i, h, c) => {
92
+ const p = u[c], m = c === u.length - 1;
93
+ if (p.kind === "globstar") {
94
+ m || await l(i, h, c + 1);
95
+ for (const g of await v(i))
96
+ g.name.startsWith(".") || (g.isDirectory() ? await l(
97
+ d(i, g.name),
98
+ [...h, g.name],
99
+ c
100
+ ) : m && await T(i, g) && f(i, h, g.name));
101
+ return;
102
+ }
103
+ if (p.kind === "literal") {
104
+ const g = d(i, p.text), y = await F(g);
105
+ if (!y) return;
106
+ m ? y.isFile() && f(i, h, p.text) : y.isDirectory() && await l(g, [...h, p.text], c + 1);
107
+ return;
108
+ }
109
+ for (const g of await v(i))
110
+ p.regexp.test(g.name) && (g.name.startsWith(".") && !p.matchesDotfiles || (m ? await T(i, g) && f(i, h, g.name) : await W(i, g) && await l(
111
+ d(i, g.name),
112
+ [...h, g.name],
113
+ c + 1
114
+ )));
115
+ };
116
+ await l(r || w(n.cwd), [], 0);
117
+ }
118
+ return [...s].sort();
119
+ }
120
+ async function U(t) {
121
+ try {
122
+ const n = await q(t, {
123
+ cwd: process.cwd(),
124
+ absolute: !1
125
+ }), e = process.cwd();
126
+ return n.map((s) => ({
127
+ path: w(e, s),
128
+ relativePath: j(s).replace(/\\/g, "/"),
10
129
  translations: []
11
130
  }));
12
- } catch (r) {
13
- const t = r instanceof Error ? r.message : "Unknown error";
131
+ } catch (n) {
132
+ const e = n instanceof Error ? n.message : "Unknown error";
14
133
  return [
15
134
  {
16
135
  path: "",
17
136
  relativePath: "",
18
137
  translations: [],
19
138
  error: {
20
- file: n,
21
- message: `Failed to discover files: ${t}`,
139
+ file: t,
140
+ message: `Failed to discover files: ${e}`,
22
141
  type: "file_system"
23
142
  }
24
143
  }
25
144
  ];
26
145
  }
27
146
  }
28
- async function b(n) {
29
- const r = n.map(async (t) => {
30
- if (t.error)
31
- return t;
147
+ async function B(t) {
148
+ const n = t.map(async (e) => {
149
+ if (e.error)
150
+ return e;
32
151
  try {
33
- const e = await j(t.path, "utf-8"), a = JSON.parse(e), o = [];
152
+ const s = await D(e.path, "utf-8"), a = JSON.parse(s), r = [];
34
153
  if (Array.isArray(a))
35
- for (const s of a) {
36
- if (typeof s != "object" || s === null)
154
+ for (const o of a) {
155
+ if (typeof o != "object" || o === null)
37
156
  return {
38
- ...t,
157
+ ...e,
39
158
  translations: [],
40
159
  error: {
41
- file: t.path,
160
+ file: e.path,
42
161
  message: "Translation array must contain objects only",
43
162
  type: "validation"
44
163
  }
45
164
  };
46
- const c = {};
47
- for (const [u, i] of Object.entries(s)) {
48
- if (typeof i != "string")
165
+ const u = {};
166
+ for (const [f, l] of Object.entries(o)) {
167
+ if (typeof l != "string")
49
168
  return {
50
- ...t,
169
+ ...e,
51
170
  translations: [],
52
171
  error: {
53
- file: t.path,
54
- message: `Translation value for key "${u}" must be a string, got ${typeof i}`,
172
+ file: e.path,
173
+ message: `Translation value for key "${f}" must be a string, got ${typeof l}`,
55
174
  type: "validation"
56
175
  }
57
176
  };
58
- c[u] = i;
177
+ u[f] = l;
59
178
  }
60
- o.push(c);
179
+ r.push(u);
61
180
  }
62
181
  else if (typeof a == "object" && a !== null) {
63
- const s = {};
64
- for (const [c, u] of Object.entries(a)) {
65
- if (typeof u != "string")
182
+ const o = {};
183
+ for (const [u, f] of Object.entries(a)) {
184
+ if (typeof f != "string")
66
185
  return {
67
- ...t,
186
+ ...e,
68
187
  translations: [],
69
188
  error: {
70
- file: t.path,
71
- message: `Translation value for key "${c}" must be a string, got ${typeof u}`,
189
+ file: e.path,
190
+ message: `Translation value for key "${u}" must be a string, got ${typeof f}`,
72
191
  type: "validation"
73
192
  }
74
193
  };
75
- s[c] = u;
194
+ o[u] = f;
76
195
  }
77
- return o.push(s), {
78
- ...t,
79
- translations: o,
196
+ return r.push(o), {
197
+ ...e,
198
+ translations: r,
80
199
  wasSingleObject: !0
81
200
  };
82
201
  } else
83
202
  return {
84
- ...t,
203
+ ...e,
85
204
  translations: [],
86
205
  error: {
87
- file: t.path,
206
+ file: e.path,
88
207
  message: "Translation file must contain a JSON object or array of objects",
89
208
  type: "validation"
90
209
  }
91
210
  };
92
211
  return {
93
- ...t,
94
- translations: o
212
+ ...e,
213
+ translations: r
95
214
  };
96
- } catch (e) {
97
- if (e instanceof SyntaxError)
215
+ } catch (s) {
216
+ if (s instanceof SyntaxError)
98
217
  return {
99
- ...t,
218
+ ...e,
100
219
  translations: [],
101
220
  error: {
102
- file: t.path,
103
- message: `Invalid JSON: ${e.message}`,
221
+ file: e.path,
222
+ message: `Invalid JSON: ${s.message}`,
104
223
  type: "invalid_json"
105
224
  }
106
225
  };
107
- const a = e instanceof Error ? e.message : "Unknown error";
226
+ const a = s instanceof Error ? s.message : "Unknown error";
108
227
  return {
109
- ...t,
228
+ ...e,
110
229
  translations: [],
111
230
  error: {
112
- file: t.path,
231
+ file: e.path,
113
232
  message: `Failed to read file: ${a}`,
114
233
  type: "file_system"
115
234
  }
116
235
  };
117
236
  }
118
237
  });
119
- return Promise.all(r);
238
+ return Promise.all(n);
120
239
  }
121
- function w(n) {
122
- for (const r of n)
123
- if (!r.error && r.translations.length > 0)
124
- return Object.keys(r.translations[0]);
240
+ function V(t) {
241
+ for (const n of t)
242
+ if (!n.error && n.translations.length > 0)
243
+ return Object.keys(n.translations[0]);
125
244
  return null;
126
245
  }
127
- function k(n, r) {
128
- const t = [];
129
- for (const e of n) {
130
- if (e.error)
246
+ function z(t, n) {
247
+ const e = [];
248
+ for (const s of t) {
249
+ if (s.error)
131
250
  continue;
132
- if (e.translations.length === 0) {
133
- t.push({
134
- file: e.path,
251
+ if (s.translations.length === 0) {
252
+ e.push({
253
+ file: s.path,
135
254
  message: "File has no translations",
136
255
  type: "validation"
137
256
  });
138
257
  continue;
139
258
  }
140
- const a = Object.keys(e.translations[0]);
141
- for (let i = 1; i < e.translations.length; i++) {
142
- const f = Object.keys(e.translations[i]);
143
- if (JSON.stringify([...f].sort()) !== JSON.stringify([...a].sort())) {
144
- t.push({
145
- file: e.path,
146
- message: `Translation ${i + 1} in file has different language keys`,
259
+ const a = Object.keys(s.translations[0]);
260
+ for (let l = 1; l < s.translations.length; l++) {
261
+ const i = Object.keys(s.translations[l]);
262
+ if (JSON.stringify([...i].sort()) !== JSON.stringify([...a].sort())) {
263
+ e.push({
264
+ file: s.path,
265
+ message: `Translation ${l + 1} in file has different language keys`,
147
266
  type: "validation"
148
267
  });
149
268
  continue;
150
269
  }
151
270
  }
152
- const o = [...a].sort(), s = [...r].sort(), c = s.filter(
153
- (i) => !o.includes(i)
154
- ), u = o.filter(
155
- (i) => !s.includes(i)
271
+ const r = [...a].sort(), o = [...n].sort(), u = o.filter(
272
+ (l) => !r.includes(l)
273
+ ), f = r.filter(
274
+ (l) => !o.includes(l)
156
275
  );
157
- if (c.length > 0 || u.length > 0) {
158
- const i = [];
159
- c.length > 0 && i.push(`missing languages: ${c.join(", ")}`), u.length > 0 && i.push(`extra languages: ${u.join(", ")}`), t.push({
160
- file: e.path,
161
- message: `Language mismatch: ${i.join(
276
+ if (u.length > 0 || f.length > 0) {
277
+ const l = [];
278
+ u.length > 0 && l.push(`missing languages: ${u.join(", ")}`), f.length > 0 && l.push(`extra languages: ${f.join(", ")}`), e.push({
279
+ file: s.path,
280
+ message: `Language mismatch: ${l.join(
162
281
  ", "
163
- )}. Expected: ${r.join(", ")}`,
282
+ )}. Expected: ${n.join(", ")}`,
164
283
  type: "missing_languages"
165
284
  });
166
285
  }
167
286
  }
168
- return t;
287
+ return e;
169
288
  }
170
- function O(n, r) {
171
- const t = /* @__PURE__ */ new Set(), e = [];
172
- for (const a of n) {
173
- const o = a[r];
174
- if (o === void 0) {
175
- e.push(a);
289
+ function X(t, n) {
290
+ const e = /* @__PURE__ */ new Set(), s = [];
291
+ for (const a of t) {
292
+ const r = a[n];
293
+ if (r === void 0) {
294
+ s.push(a);
176
295
  continue;
177
296
  }
178
- const s = o;
179
- t.has(s) || (t.add(s), e.push(a));
297
+ const o = r;
298
+ e.has(o) || (e.add(o), s.push(a));
180
299
  }
181
- return e;
300
+ return s;
182
301
  }
183
- function S(n, r) {
184
- const t = p(n);
185
- let a = P(t, r);
186
- return a = d(a).replace(/\\/g, "/"), a.startsWith(".") || (a = "./" + a), a;
302
+ function H(t, n) {
303
+ const e = b(t);
304
+ let a = N(e, n);
305
+ return a = j(a).replace(/\\/g, "/"), a.startsWith(".") || (a = "./" + a), a;
187
306
  }
188
- function m(n, r, t) {
189
- const e = n.filter((f) => !f.error && f.translations.length > 0).sort((f, g) => f.path.localeCompare(g.path));
190
- if (e.length === 0)
307
+ function k(t, n, e) {
308
+ const s = t.filter((i) => !i.error && i.translations.length > 0).sort((i, h) => i.path.localeCompare(h.path));
309
+ if (s.length === 0)
191
310
  return `export default []
192
311
  `;
193
- const a = e.map((f, g) => {
194
- const l = S(r, f.path);
195
- return `import translations${g} from '${l}' assert { type: 'json' };`;
312
+ const a = s.map((i, h) => {
313
+ const c = H(n, i.path);
314
+ return `import translations${h} from '${c}' assert { type: 'json' };`;
196
315
  }).join(`
197
- `), o = e.map((f, g) => f.wasSingleObject ? ` ...(Array.isArray(translations${g}) ? translations${g} : [translations${g}])` : ` ...translations${g}`).join(`,
198
- `), c = `export interface Translation {
199
- ${t.map((f) => ` ${f}: string;`).join(`
316
+ `), r = s.map((i, h) => i.wasSingleObject ? ` ...(Array.isArray(translations${h}) ? translations${h} : [translations${h}])` : ` ...translations${h}`).join(`,
317
+ `), u = `export interface Translation {
318
+ ${e.map((i) => ` ${i}: string;`).join(`
200
319
  `)}
201
320
  [key: string]: string;
202
- }`, u = t[0] || "en", i = e.length > 0 ? `
321
+ }`, f = e[0] || "en", l = s.length > 0 ? `
203
322
  const uniqueTranslations = allTranslations.filter(
204
- (translation, index, self) => index === self.findIndex((t) => t.${u} === translation.${u})
323
+ (translation, index, self) => index === self.findIndex((t) => t.${f} === translation.${f})
205
324
  );` : "";
206
325
  return `${a}
207
326
 
208
- ${c}
327
+ ${u}
209
328
 
210
329
  const allTranslations: Translation[] = [
211
- ${o}
212
- ];${i}
330
+ ${r}
331
+ ];${l}
213
332
 
214
333
  export default uniqueTranslations;
215
334
  `;
216
335
  }
217
- function x(n) {
218
- const r = n.filter((s) => !s.error && s.translations.length > 0).sort((s, c) => s.path.localeCompare(c.path));
219
- if (r.length === 0)
336
+ function K(t) {
337
+ const n = t.filter((o) => !o.error && o.translations.length > 0).sort((o, u) => o.path.localeCompare(u.path));
338
+ if (n.length === 0)
220
339
  return `export default []
221
340
  `;
222
- const t = [];
223
- for (const s of r)
224
- s.wasSingleObject && s.translations.length === 1 ? t.push(s.translations[0]) : t.push(...s.translations);
225
- const e = t.length > 0 ? Object.keys(t[0])[0] : "en", a = t.map((s) => JSON.stringify(s, null, 2).split(`
226
- `).map((i) => ` ${i}`).join(`
341
+ const e = [];
342
+ for (const o of n)
343
+ o.wasSingleObject && o.translations.length === 1 ? e.push(o.translations[0]) : e.push(...o.translations);
344
+ const s = e.length > 0 ? Object.keys(e[0])[0] : "en", a = e.map((o) => JSON.stringify(o, null, 2).split(`
345
+ `).map((l) => ` ${l}`).join(`
227
346
  `)).join(`,
228
- `), o = `
347
+ `), r = `
229
348
  const uniqueTranslations = allTranslations.filter(
230
- (translation, index, self) => index === self.findIndex((t) => t.${e} === translation.${e})
349
+ (translation, index, self) => index === self.findIndex((t) => t.${s} === translation.${s})
231
350
  );`;
232
351
  return `const allTranslations = [
233
352
  ${a}
234
- ];${o}
353
+ ];${r}
235
354
 
236
355
  export default uniqueTranslations;
237
356
  `;
238
357
  }
239
- function L(n, r, t) {
240
- return m(n, r, t);
358
+ function Q(t, n, e) {
359
+ return k(t, n, e);
241
360
  }
242
- async function N(n) {
243
- const r = [], t = Date.now(), e = await T(n.pattern);
244
- if (e.length === 0)
361
+ async function tt(t) {
362
+ const n = [], e = Date.now(), s = await U(t.pattern);
363
+ if (s.length === 0)
245
364
  return {
246
365
  success: !0,
247
366
  filesFound: 0,
248
367
  translationsGenerated: 0,
249
368
  errors: [],
250
- outputPath: n.outputPath
369
+ outputPath: t.outputPath
251
370
  };
252
- for (const l of e)
253
- l.error && r.push(l.error);
254
- const a = await b(e);
255
- for (const l of a)
256
- l.error && r.push(l.error);
257
- const o = w(a);
258
- if ((!o || o.length === 0) && a.filter(
259
- (h) => !h.error && h.translations.length > 0
371
+ const a = await B(s);
372
+ for (const c of a)
373
+ c.error && n.push(c.error);
374
+ const r = V(a);
375
+ if ((!r || r.length === 0) && a.filter(
376
+ (p) => !p.error && p.translations.length > 0
260
377
  ).length === 0)
261
378
  return {
262
379
  success: !1,
263
- filesFound: e.length,
380
+ filesFound: s.length,
264
381
  translationsGenerated: 0,
265
- errors: r.length > 0 ? r : [
382
+ errors: n.length > 0 ? n : [
266
383
  {
267
- file: n.pattern,
384
+ file: t.pattern,
268
385
  message: "No valid translation files found",
269
386
  type: "validation"
270
387
  }
271
388
  ],
272
- outputPath: n.outputPath
389
+ outputPath: t.outputPath
273
390
  };
274
- if (o && o.length > 0) {
275
- const l = k(a, o);
276
- if (r.push(...l), l.length > 0)
391
+ if (r && r.length > 0) {
392
+ const c = z(a, r);
393
+ if (n.push(...c), c.length > 0)
277
394
  return {
278
395
  success: !1,
279
- filesFound: e.length,
396
+ filesFound: s.length,
280
397
  translationsGenerated: 0,
281
- errors: r,
282
- outputPath: n.outputPath
398
+ errors: n,
399
+ outputPath: t.outputPath
283
400
  };
284
401
  }
285
- const s = [];
286
- for (const l of a)
287
- !l.error && l.translations.length > 0 && s.push(...l.translations);
288
- const c = n.referenceLanguage || (o == null ? void 0 : o[0]) || "en", u = O(
289
- s,
290
- c
402
+ const o = [];
403
+ for (const c of a)
404
+ !c.error && c.translations.length > 0 && o.push(...c.translations);
405
+ const u = t.referenceLanguage || (r == null ? void 0 : r[0]) || "en", f = X(
406
+ o,
407
+ u
291
408
  );
292
- let i;
293
- const f = a.filter(
294
- (l) => !l.error && l.translations.length > 0
409
+ let l;
410
+ const i = a.filter(
411
+ (c) => !c.error && c.translations.length > 0
295
412
  );
296
- switch (n.outputFormat) {
413
+ switch (t.outputFormat) {
297
414
  case "ts":
298
- i = m(
299
- f,
300
- n.outputPath,
301
- o || []
415
+ l = k(
416
+ i,
417
+ t.outputPath,
418
+ r || []
302
419
  );
303
420
  break;
304
421
  case "tsx":
305
- i = L(
306
- f,
307
- n.outputPath,
308
- o || []
422
+ l = Q(
423
+ i,
424
+ t.outputPath,
425
+ r || []
309
426
  );
310
427
  break;
311
428
  case "js":
312
- i = x(f);
429
+ l = K(i);
313
430
  break;
314
431
  default:
315
432
  return {
316
433
  success: !1,
317
- filesFound: e.length,
434
+ filesFound: s.length,
318
435
  translationsGenerated: 0,
319
436
  errors: [
320
- ...r,
437
+ ...n,
321
438
  {
322
- file: n.outputPath,
323
- message: `Unsupported output format: ${n.outputFormat}`,
439
+ file: t.outputPath,
440
+ message: `Unsupported output format: ${t.outputFormat}`,
324
441
  type: "validation"
325
442
  }
326
443
  ],
327
- outputPath: n.outputPath
444
+ outputPath: t.outputPath
328
445
  };
329
446
  }
330
447
  try {
331
- const l = p(n.outputPath);
332
- await v(l, { recursive: !0 }), await $(n.outputPath, i, "utf-8");
333
- } catch (l) {
334
- const h = l instanceof Error ? l.message : "Unknown error";
335
- return r.push({
336
- file: n.outputPath,
337
- message: `Failed to write output file: ${h}`,
448
+ const c = b(t.outputPath);
449
+ await E(c, { recursive: !0 }), await O(t.outputPath, l, "utf-8");
450
+ } catch (c) {
451
+ const p = c instanceof Error ? c.message : "Unknown error";
452
+ return n.push({
453
+ file: t.outputPath,
454
+ message: `Failed to write output file: ${p}`,
338
455
  type: "file_system"
339
456
  }), {
340
457
  success: !1,
341
- filesFound: e.length,
342
- translationsGenerated: u.length,
343
- errors: r,
344
- outputPath: n.outputPath
458
+ filesFound: s.length,
459
+ translationsGenerated: f.length,
460
+ errors: n,
461
+ outputPath: t.outputPath
345
462
  };
346
463
  }
347
- const g = Date.now() - t;
348
- return g > 1e3 && e.length < 100 && console.warn(
349
- `⚠️ Generation took ${g}ms for ${e.length} files`
464
+ const h = Date.now() - e;
465
+ return h > 1e3 && s.length < 100 && console.warn(
466
+ `⚠️ Generation took ${h}ms for ${s.length} files`
350
467
  ), {
351
- success: r.length === 0,
352
- filesFound: e.length,
353
- translationsGenerated: u.length,
354
- errors: r,
355
- outputPath: n.outputPath
468
+ success: n.length === 0,
469
+ filesFound: s.length,
470
+ translationsGenerated: f.length,
471
+ errors: n,
472
+ outputPath: t.outputPath
356
473
  };
357
474
  }
358
475
  export {
359
- N as generate
476
+ tt as generate
360
477
  };