docs-i18n 0.2.2 → 0.2.4
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/{assemble-ZHDLGVTL.js → assemble-IOHQYYHI.js} +4 -3
- package/dist/build-4EQEL4NI.js +12 -0
- package/dist/build2-3W5WMFHZ.js +4901 -0
- package/dist/chunk-3YNFMSJH.js +30 -0
- package/dist/chunk-55MBYBVK.js +368 -0
- package/dist/{chunk-PHDMD6EM.js → chunk-AKLW2MUS.js} +7 -29
- package/dist/chunk-FYDB7MZX.js +38944 -0
- package/dist/chunk-O35QHRY6.js +6 -0
- package/dist/chunk-PTIH4GGE.js +44 -0
- package/dist/{chunk-OSMPWXSQ.js → chunk-QSVWLTGQ.js} +1 -1
- package/dist/chunk-SUIDX6IZ.js +122 -0
- package/dist/chunk-VKKNQBDN.js +6487 -0
- package/dist/cli.js +7 -6
- package/dist/dist-6C32URTL.js +19 -0
- package/dist/dist-HOWMMQFV.js +6677 -0
- package/dist/false-JGP4AGWN.js +7 -0
- package/dist/main-QVE5TVA3.js +2505 -0
- package/dist/node-4GLCLDJ6.js +875 -0
- package/dist/node-NUDVMOF2.js +129 -0
- package/dist/postcss-3SK7VUC2.js +5886 -0
- package/dist/postcss-import-JD46KA2Z.js +458 -0
- package/dist/prompt-BYQIwEjg-TG7DLENB.js +915 -0
- package/dist/{rescan-OJTVWDAP.js → rescan-VB2PILB2.js} +3 -2
- package/dist/server-HUXOPTUA.js +550 -0
- package/dist/{status-ZG7F3FRT.js → status-EWQEACVF.js} +2 -1
- package/dist/translate-F3AQFN6X.js +707 -0
- package/package.json +3 -1
- package/src/admin/server/services/job-manager.ts +4 -3
- package/dist/chunk-I74LIORX.js +0 -11211
- package/dist/server-DPAACODY.js +0 -2744
- package/dist/translate-2PCYIWIG.js +0 -14531
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/config.ts
|
|
2
|
+
async function loadConfig(path) {
|
|
3
|
+
const configPath = path ?? "docs-i18n.config.ts";
|
|
4
|
+
try {
|
|
5
|
+
const mod = await import(
|
|
6
|
+
/* @vite-ignore */
|
|
7
|
+
`${process.cwd()}/${configPath}`
|
|
8
|
+
);
|
|
9
|
+
return mod.default ?? mod;
|
|
10
|
+
} catch {
|
|
11
|
+
throw new Error(`Cannot load config from ${configPath}. Create a docs-i18n.config.ts file.`);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
function flattenSources(config) {
|
|
15
|
+
const projects = Object.entries(config.projects);
|
|
16
|
+
const singleProject = projects.length === 1;
|
|
17
|
+
return projects.flatMap(
|
|
18
|
+
([projectId, project]) => Object.entries(project.sources).map(([version, sourcePath]) => ({
|
|
19
|
+
project: projectId,
|
|
20
|
+
version,
|
|
21
|
+
sourcePath,
|
|
22
|
+
versionKey: singleProject ? version : `${projectId}/${version}`
|
|
23
|
+
}))
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export {
|
|
28
|
+
loadConfig,
|
|
29
|
+
flattenSources
|
|
30
|
+
};
|
|
@@ -0,0 +1,368 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJSMin
|
|
3
|
+
} from "./chunk-PTIH4GGE.js";
|
|
4
|
+
|
|
5
|
+
// node_modules/vite/dist/node/chunks/lib.js
|
|
6
|
+
var require_parse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
7
|
+
var openParentheses = "(".charCodeAt(0);
|
|
8
|
+
var closeParentheses = ")".charCodeAt(0);
|
|
9
|
+
var singleQuote = "'".charCodeAt(0);
|
|
10
|
+
var doubleQuote = '"'.charCodeAt(0);
|
|
11
|
+
var backslash = "\\".charCodeAt(0);
|
|
12
|
+
var slash = "/".charCodeAt(0);
|
|
13
|
+
var comma = ",".charCodeAt(0);
|
|
14
|
+
var colon = ":".charCodeAt(0);
|
|
15
|
+
var star = "*".charCodeAt(0);
|
|
16
|
+
var uLower = "u".charCodeAt(0);
|
|
17
|
+
var uUpper = "U".charCodeAt(0);
|
|
18
|
+
var plus = "+".charCodeAt(0);
|
|
19
|
+
var isUnicodeRange = /^[a-f0-9?-]+$/i;
|
|
20
|
+
module.exports = function(input) {
|
|
21
|
+
var tokens = [];
|
|
22
|
+
var value = input;
|
|
23
|
+
var next, quote, prev, token, escape, escapePos, whitespacePos, parenthesesOpenPos;
|
|
24
|
+
var pos = 0;
|
|
25
|
+
var code = value.charCodeAt(pos);
|
|
26
|
+
var max = value.length;
|
|
27
|
+
var stack = [{ nodes: tokens }];
|
|
28
|
+
var balanced = 0;
|
|
29
|
+
var parent;
|
|
30
|
+
var name = "";
|
|
31
|
+
var before = "";
|
|
32
|
+
var after = "";
|
|
33
|
+
while (pos < max) if (code <= 32) {
|
|
34
|
+
next = pos;
|
|
35
|
+
do {
|
|
36
|
+
next += 1;
|
|
37
|
+
code = value.charCodeAt(next);
|
|
38
|
+
} while (code <= 32);
|
|
39
|
+
token = value.slice(pos, next);
|
|
40
|
+
prev = tokens[tokens.length - 1];
|
|
41
|
+
if (code === closeParentheses && balanced) after = token;
|
|
42
|
+
else if (prev && prev.type === "div") {
|
|
43
|
+
prev.after = token;
|
|
44
|
+
prev.sourceEndIndex += token.length;
|
|
45
|
+
} else if (code === comma || code === colon || code === slash && value.charCodeAt(next + 1) !== star && (!parent || parent && parent.type === "function" && parent.value !== "calc")) before = token;
|
|
46
|
+
else tokens.push({
|
|
47
|
+
type: "space",
|
|
48
|
+
sourceIndex: pos,
|
|
49
|
+
sourceEndIndex: next,
|
|
50
|
+
value: token
|
|
51
|
+
});
|
|
52
|
+
pos = next;
|
|
53
|
+
} else if (code === singleQuote || code === doubleQuote) {
|
|
54
|
+
next = pos;
|
|
55
|
+
quote = code === singleQuote ? "'" : '"';
|
|
56
|
+
token = {
|
|
57
|
+
type: "string",
|
|
58
|
+
sourceIndex: pos,
|
|
59
|
+
quote
|
|
60
|
+
};
|
|
61
|
+
do {
|
|
62
|
+
escape = false;
|
|
63
|
+
next = value.indexOf(quote, next + 1);
|
|
64
|
+
if (~next) {
|
|
65
|
+
escapePos = next;
|
|
66
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
67
|
+
escapePos -= 1;
|
|
68
|
+
escape = !escape;
|
|
69
|
+
}
|
|
70
|
+
} else {
|
|
71
|
+
value += quote;
|
|
72
|
+
next = value.length - 1;
|
|
73
|
+
token.unclosed = true;
|
|
74
|
+
}
|
|
75
|
+
} while (escape);
|
|
76
|
+
token.value = value.slice(pos + 1, next);
|
|
77
|
+
token.sourceEndIndex = token.unclosed ? next : next + 1;
|
|
78
|
+
tokens.push(token);
|
|
79
|
+
pos = next + 1;
|
|
80
|
+
code = value.charCodeAt(pos);
|
|
81
|
+
} else if (code === slash && value.charCodeAt(pos + 1) === star) {
|
|
82
|
+
next = value.indexOf("*/", pos);
|
|
83
|
+
token = {
|
|
84
|
+
type: "comment",
|
|
85
|
+
sourceIndex: pos,
|
|
86
|
+
sourceEndIndex: next + 2
|
|
87
|
+
};
|
|
88
|
+
if (next === -1) {
|
|
89
|
+
token.unclosed = true;
|
|
90
|
+
next = value.length;
|
|
91
|
+
token.sourceEndIndex = next;
|
|
92
|
+
}
|
|
93
|
+
token.value = value.slice(pos + 2, next);
|
|
94
|
+
tokens.push(token);
|
|
95
|
+
pos = next + 2;
|
|
96
|
+
code = value.charCodeAt(pos);
|
|
97
|
+
} else if ((code === slash || code === star) && parent && parent.type === "function" && parent.value === "calc") {
|
|
98
|
+
token = value[pos];
|
|
99
|
+
tokens.push({
|
|
100
|
+
type: "word",
|
|
101
|
+
sourceIndex: pos - before.length,
|
|
102
|
+
sourceEndIndex: pos + token.length,
|
|
103
|
+
value: token
|
|
104
|
+
});
|
|
105
|
+
pos += 1;
|
|
106
|
+
code = value.charCodeAt(pos);
|
|
107
|
+
} else if (code === slash || code === comma || code === colon) {
|
|
108
|
+
token = value[pos];
|
|
109
|
+
tokens.push({
|
|
110
|
+
type: "div",
|
|
111
|
+
sourceIndex: pos - before.length,
|
|
112
|
+
sourceEndIndex: pos + token.length,
|
|
113
|
+
value: token,
|
|
114
|
+
before,
|
|
115
|
+
after: ""
|
|
116
|
+
});
|
|
117
|
+
before = "";
|
|
118
|
+
pos += 1;
|
|
119
|
+
code = value.charCodeAt(pos);
|
|
120
|
+
} else if (openParentheses === code) {
|
|
121
|
+
next = pos;
|
|
122
|
+
do {
|
|
123
|
+
next += 1;
|
|
124
|
+
code = value.charCodeAt(next);
|
|
125
|
+
} while (code <= 32);
|
|
126
|
+
parenthesesOpenPos = pos;
|
|
127
|
+
token = {
|
|
128
|
+
type: "function",
|
|
129
|
+
sourceIndex: pos - name.length,
|
|
130
|
+
value: name,
|
|
131
|
+
before: value.slice(parenthesesOpenPos + 1, next)
|
|
132
|
+
};
|
|
133
|
+
pos = next;
|
|
134
|
+
if (name === "url" && code !== singleQuote && code !== doubleQuote) {
|
|
135
|
+
next -= 1;
|
|
136
|
+
do {
|
|
137
|
+
escape = false;
|
|
138
|
+
next = value.indexOf(")", next + 1);
|
|
139
|
+
if (~next) {
|
|
140
|
+
escapePos = next;
|
|
141
|
+
while (value.charCodeAt(escapePos - 1) === backslash) {
|
|
142
|
+
escapePos -= 1;
|
|
143
|
+
escape = !escape;
|
|
144
|
+
}
|
|
145
|
+
} else {
|
|
146
|
+
value += ")";
|
|
147
|
+
next = value.length - 1;
|
|
148
|
+
token.unclosed = true;
|
|
149
|
+
}
|
|
150
|
+
} while (escape);
|
|
151
|
+
whitespacePos = next;
|
|
152
|
+
do {
|
|
153
|
+
whitespacePos -= 1;
|
|
154
|
+
code = value.charCodeAt(whitespacePos);
|
|
155
|
+
} while (code <= 32);
|
|
156
|
+
if (parenthesesOpenPos < whitespacePos) {
|
|
157
|
+
if (pos !== whitespacePos + 1) token.nodes = [{
|
|
158
|
+
type: "word",
|
|
159
|
+
sourceIndex: pos,
|
|
160
|
+
sourceEndIndex: whitespacePos + 1,
|
|
161
|
+
value: value.slice(pos, whitespacePos + 1)
|
|
162
|
+
}];
|
|
163
|
+
else token.nodes = [];
|
|
164
|
+
if (token.unclosed && whitespacePos + 1 !== next) {
|
|
165
|
+
token.after = "";
|
|
166
|
+
token.nodes.push({
|
|
167
|
+
type: "space",
|
|
168
|
+
sourceIndex: whitespacePos + 1,
|
|
169
|
+
sourceEndIndex: next,
|
|
170
|
+
value: value.slice(whitespacePos + 1, next)
|
|
171
|
+
});
|
|
172
|
+
} else {
|
|
173
|
+
token.after = value.slice(whitespacePos + 1, next);
|
|
174
|
+
token.sourceEndIndex = next;
|
|
175
|
+
}
|
|
176
|
+
} else {
|
|
177
|
+
token.after = "";
|
|
178
|
+
token.nodes = [];
|
|
179
|
+
}
|
|
180
|
+
pos = next + 1;
|
|
181
|
+
token.sourceEndIndex = token.unclosed ? next : pos;
|
|
182
|
+
code = value.charCodeAt(pos);
|
|
183
|
+
tokens.push(token);
|
|
184
|
+
} else {
|
|
185
|
+
balanced += 1;
|
|
186
|
+
token.after = "";
|
|
187
|
+
token.sourceEndIndex = pos + 1;
|
|
188
|
+
tokens.push(token);
|
|
189
|
+
stack.push(token);
|
|
190
|
+
tokens = token.nodes = [];
|
|
191
|
+
parent = token;
|
|
192
|
+
}
|
|
193
|
+
name = "";
|
|
194
|
+
} else if (closeParentheses === code && balanced) {
|
|
195
|
+
pos += 1;
|
|
196
|
+
code = value.charCodeAt(pos);
|
|
197
|
+
parent.after = after;
|
|
198
|
+
parent.sourceEndIndex += after.length;
|
|
199
|
+
after = "";
|
|
200
|
+
balanced -= 1;
|
|
201
|
+
stack[stack.length - 1].sourceEndIndex = pos;
|
|
202
|
+
stack.pop();
|
|
203
|
+
parent = stack[balanced];
|
|
204
|
+
tokens = parent.nodes;
|
|
205
|
+
} else {
|
|
206
|
+
next = pos;
|
|
207
|
+
do {
|
|
208
|
+
if (code === backslash) next += 1;
|
|
209
|
+
next += 1;
|
|
210
|
+
code = value.charCodeAt(next);
|
|
211
|
+
} while (next < max && !(code <= 32 || code === singleQuote || code === doubleQuote || code === comma || code === colon || code === slash || code === openParentheses || code === star && parent && parent.type === "function" && parent.value === "calc" || code === slash && parent.type === "function" && parent.value === "calc" || code === closeParentheses && balanced));
|
|
212
|
+
token = value.slice(pos, next);
|
|
213
|
+
if (openParentheses === code) name = token;
|
|
214
|
+
else if ((uLower === token.charCodeAt(0) || uUpper === token.charCodeAt(0)) && plus === token.charCodeAt(1) && isUnicodeRange.test(token.slice(2))) tokens.push({
|
|
215
|
+
type: "unicode-range",
|
|
216
|
+
sourceIndex: pos,
|
|
217
|
+
sourceEndIndex: next,
|
|
218
|
+
value: token
|
|
219
|
+
});
|
|
220
|
+
else tokens.push({
|
|
221
|
+
type: "word",
|
|
222
|
+
sourceIndex: pos,
|
|
223
|
+
sourceEndIndex: next,
|
|
224
|
+
value: token
|
|
225
|
+
});
|
|
226
|
+
pos = next;
|
|
227
|
+
}
|
|
228
|
+
for (pos = stack.length - 1; pos; pos -= 1) {
|
|
229
|
+
stack[pos].unclosed = true;
|
|
230
|
+
stack[pos].sourceEndIndex = value.length;
|
|
231
|
+
}
|
|
232
|
+
return stack[0].nodes;
|
|
233
|
+
};
|
|
234
|
+
}));
|
|
235
|
+
var require_walk = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
236
|
+
module.exports = function walk(nodes, cb, bubble) {
|
|
237
|
+
var i, max, node, result;
|
|
238
|
+
for (i = 0, max = nodes.length; i < max; i += 1) {
|
|
239
|
+
node = nodes[i];
|
|
240
|
+
if (!bubble) result = cb(node, i, nodes);
|
|
241
|
+
if (result !== false && node.type === "function" && Array.isArray(node.nodes)) walk(node.nodes, cb, bubble);
|
|
242
|
+
if (bubble) cb(node, i, nodes);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
}));
|
|
246
|
+
var require_stringify = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
247
|
+
function stringifyNode(node, custom) {
|
|
248
|
+
var type = node.type;
|
|
249
|
+
var value = node.value;
|
|
250
|
+
var buf;
|
|
251
|
+
var customResult;
|
|
252
|
+
if (custom && (customResult = custom(node)) !== void 0) return customResult;
|
|
253
|
+
else if (type === "word" || type === "space") return value;
|
|
254
|
+
else if (type === "string") {
|
|
255
|
+
buf = node.quote || "";
|
|
256
|
+
return buf + value + (node.unclosed ? "" : buf);
|
|
257
|
+
} else if (type === "comment") return "/*" + value + (node.unclosed ? "" : "*/");
|
|
258
|
+
else if (type === "div") return (node.before || "") + value + (node.after || "");
|
|
259
|
+
else if (Array.isArray(node.nodes)) {
|
|
260
|
+
buf = stringify(node.nodes, custom);
|
|
261
|
+
if (type !== "function") return buf;
|
|
262
|
+
return value + "(" + (node.before || "") + buf + (node.after || "") + (node.unclosed ? "" : ")");
|
|
263
|
+
}
|
|
264
|
+
return value;
|
|
265
|
+
}
|
|
266
|
+
function stringify(nodes, custom) {
|
|
267
|
+
var result, i;
|
|
268
|
+
if (Array.isArray(nodes)) {
|
|
269
|
+
result = "";
|
|
270
|
+
for (i = nodes.length - 1; ~i; i -= 1) result = stringifyNode(nodes[i], custom) + result;
|
|
271
|
+
return result;
|
|
272
|
+
}
|
|
273
|
+
return stringifyNode(nodes, custom);
|
|
274
|
+
}
|
|
275
|
+
module.exports = stringify;
|
|
276
|
+
}));
|
|
277
|
+
var require_unit = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
278
|
+
var minus = "-".charCodeAt(0);
|
|
279
|
+
var plus = "+".charCodeAt(0);
|
|
280
|
+
var dot = ".".charCodeAt(0);
|
|
281
|
+
var exp = "e".charCodeAt(0);
|
|
282
|
+
var EXP = "E".charCodeAt(0);
|
|
283
|
+
function likeNumber(value) {
|
|
284
|
+
var code = value.charCodeAt(0);
|
|
285
|
+
var nextCode;
|
|
286
|
+
if (code === plus || code === minus) {
|
|
287
|
+
nextCode = value.charCodeAt(1);
|
|
288
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
|
289
|
+
var nextNextCode = value.charCodeAt(2);
|
|
290
|
+
if (nextCode === dot && nextNextCode >= 48 && nextNextCode <= 57) return true;
|
|
291
|
+
return false;
|
|
292
|
+
}
|
|
293
|
+
if (code === dot) {
|
|
294
|
+
nextCode = value.charCodeAt(1);
|
|
295
|
+
if (nextCode >= 48 && nextCode <= 57) return true;
|
|
296
|
+
return false;
|
|
297
|
+
}
|
|
298
|
+
if (code >= 48 && code <= 57) return true;
|
|
299
|
+
return false;
|
|
300
|
+
}
|
|
301
|
+
module.exports = function(value) {
|
|
302
|
+
var pos = 0;
|
|
303
|
+
var length = value.length;
|
|
304
|
+
var code;
|
|
305
|
+
var nextCode;
|
|
306
|
+
var nextNextCode;
|
|
307
|
+
if (length === 0 || !likeNumber(value)) return false;
|
|
308
|
+
code = value.charCodeAt(pos);
|
|
309
|
+
if (code === plus || code === minus) pos++;
|
|
310
|
+
while (pos < length) {
|
|
311
|
+
code = value.charCodeAt(pos);
|
|
312
|
+
if (code < 48 || code > 57) break;
|
|
313
|
+
pos += 1;
|
|
314
|
+
}
|
|
315
|
+
code = value.charCodeAt(pos);
|
|
316
|
+
nextCode = value.charCodeAt(pos + 1);
|
|
317
|
+
if (code === dot && nextCode >= 48 && nextCode <= 57) {
|
|
318
|
+
pos += 2;
|
|
319
|
+
while (pos < length) {
|
|
320
|
+
code = value.charCodeAt(pos);
|
|
321
|
+
if (code < 48 || code > 57) break;
|
|
322
|
+
pos += 1;
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
code = value.charCodeAt(pos);
|
|
326
|
+
nextCode = value.charCodeAt(pos + 1);
|
|
327
|
+
nextNextCode = value.charCodeAt(pos + 2);
|
|
328
|
+
if ((code === exp || code === EXP) && (nextCode >= 48 && nextCode <= 57 || (nextCode === plus || nextCode === minus) && nextNextCode >= 48 && nextNextCode <= 57)) {
|
|
329
|
+
pos += nextCode === plus || nextCode === minus ? 3 : 2;
|
|
330
|
+
while (pos < length) {
|
|
331
|
+
code = value.charCodeAt(pos);
|
|
332
|
+
if (code < 48 || code > 57) break;
|
|
333
|
+
pos += 1;
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return {
|
|
337
|
+
number: value.slice(0, pos),
|
|
338
|
+
unit: value.slice(pos)
|
|
339
|
+
};
|
|
340
|
+
};
|
|
341
|
+
}));
|
|
342
|
+
var require_lib = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
343
|
+
var parse = require_parse();
|
|
344
|
+
var walk = require_walk();
|
|
345
|
+
var stringify = require_stringify();
|
|
346
|
+
function ValueParser(value) {
|
|
347
|
+
if (this instanceof ValueParser) {
|
|
348
|
+
this.nodes = parse(value);
|
|
349
|
+
return this;
|
|
350
|
+
}
|
|
351
|
+
return new ValueParser(value);
|
|
352
|
+
}
|
|
353
|
+
ValueParser.prototype.toString = function() {
|
|
354
|
+
return Array.isArray(this.nodes) ? stringify(this.nodes) : "";
|
|
355
|
+
};
|
|
356
|
+
ValueParser.prototype.walk = function(cb, bubble) {
|
|
357
|
+
walk(this.nodes, cb, bubble);
|
|
358
|
+
return this;
|
|
359
|
+
};
|
|
360
|
+
ValueParser.unit = require_unit();
|
|
361
|
+
ValueParser.walk = walk;
|
|
362
|
+
ValueParser.stringify = stringify;
|
|
363
|
+
module.exports = ValueParser;
|
|
364
|
+
}));
|
|
365
|
+
|
|
366
|
+
export {
|
|
367
|
+
require_lib
|
|
368
|
+
};
|
|
@@ -10,6 +10,11 @@ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require
|
|
|
10
10
|
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
11
11
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
12
12
|
});
|
|
13
|
+
var __glob = (map) => (path) => {
|
|
14
|
+
var fn = map[path];
|
|
15
|
+
if (fn) return fn();
|
|
16
|
+
throw new Error("Module not found in bundle: " + path);
|
|
17
|
+
};
|
|
13
18
|
var __esm = (fn, res) => function __init() {
|
|
14
19
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
15
20
|
};
|
|
@@ -38,39 +43,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
38
43
|
));
|
|
39
44
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
40
45
|
|
|
41
|
-
// src/config.ts
|
|
42
|
-
async function loadConfig(path) {
|
|
43
|
-
const configPath = path ?? "docs-i18n.config.ts";
|
|
44
|
-
try {
|
|
45
|
-
const mod = await import(
|
|
46
|
-
/* @vite-ignore */
|
|
47
|
-
`${process.cwd()}/${configPath}`
|
|
48
|
-
);
|
|
49
|
-
return mod.default ?? mod;
|
|
50
|
-
} catch {
|
|
51
|
-
throw new Error(`Cannot load config from ${configPath}. Create a docs-i18n.config.ts file.`);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
function flattenSources(config) {
|
|
55
|
-
const projects = Object.entries(config.projects);
|
|
56
|
-
const singleProject = projects.length === 1;
|
|
57
|
-
return projects.flatMap(
|
|
58
|
-
([projectId, project]) => Object.entries(project.sources).map(([version, sourcePath]) => ({
|
|
59
|
-
project: projectId,
|
|
60
|
-
version,
|
|
61
|
-
sourcePath,
|
|
62
|
-
versionKey: singleProject ? version : `${projectId}/${version}`
|
|
63
|
-
}))
|
|
64
|
-
);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
46
|
export {
|
|
68
47
|
__require,
|
|
48
|
+
__glob,
|
|
69
49
|
__esm,
|
|
70
50
|
__commonJS,
|
|
71
51
|
__export,
|
|
72
52
|
__toESM,
|
|
73
|
-
__toCommonJS
|
|
74
|
-
loadConfig,
|
|
75
|
-
flattenSources
|
|
53
|
+
__toCommonJS
|
|
76
54
|
};
|