@lukoweb/apitogo 0.1.49 → 0.1.51
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/cli/cli.js +1124 -892
- package/dist/declarations/config/apitogo-config-loader.d.ts +7 -0
- package/dist/declarations/config/build-apitogo-config.d.ts +7 -0
- package/dist/declarations/config/loader.d.ts +2 -0
- package/dist/declarations/config/local-manifest.d.ts +8 -1
- package/dist/declarations/config/validators/HeaderNavigationSchema.d.ts +24 -24
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +9 -9
- package/dist/declarations/index.d.ts +2 -1
- package/dist/declarations/lib/authentication/auth-header-nav.d.ts +10 -0
- package/dist/declarations/lib/ui/Button.d.ts +1 -1
- package/dist/declarations/lib/ui/Item.d.ts +1 -1
- package/docs/configuration/authentication.md +6 -5
- package/docs/configuration/manifest.md +60 -71
- package/package.json +17 -1
- package/src/config/apitogo-config-loader.ts +224 -0
- package/src/config/build-apitogo-config.ts +43 -0
- package/src/config/loader.ts +40 -1
- package/src/config/local-manifest.ts +60 -8
- package/src/index.ts +8 -1
- package/src/lib/authentication/auth-header-nav.ts +56 -0
- package/src/lib/components/Header.tsx +48 -60
- package/src/lib/components/MobileTopNavigation.tsx +29 -40
package/dist/cli/cli.js
CHANGED
|
@@ -52,6 +52,54 @@ var init_logger = __esm({
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
+
// src/lib/authentication/auth-header-nav.ts
|
|
56
|
+
function withoutLoginNavigation(navigation) {
|
|
57
|
+
return navigation.filter(
|
|
58
|
+
(item) => !("to" in item && item.to === LOGIN_NAV_PATH)
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
function applyAuthenticationHeaderNav(config2) {
|
|
62
|
+
if (!config2.authentication) {
|
|
63
|
+
return config2;
|
|
64
|
+
}
|
|
65
|
+
const authNavEnabled = config2.__meta?.authenticationEnabled === true;
|
|
66
|
+
const navigation = config2.header?.navigation ?? [];
|
|
67
|
+
if (!authNavEnabled) {
|
|
68
|
+
const filtered = withoutLoginNavigation(navigation);
|
|
69
|
+
if (filtered.length === navigation.length) {
|
|
70
|
+
return config2;
|
|
71
|
+
}
|
|
72
|
+
return {
|
|
73
|
+
...config2,
|
|
74
|
+
header: {
|
|
75
|
+
...config2.header,
|
|
76
|
+
navigation: filtered
|
|
77
|
+
}
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
if (navigation.some((item) => "to" in item && item.to === LOGIN_NAV_PATH)) {
|
|
81
|
+
return config2;
|
|
82
|
+
}
|
|
83
|
+
return {
|
|
84
|
+
...config2,
|
|
85
|
+
header: {
|
|
86
|
+
...config2.header,
|
|
87
|
+
navigation: [...navigation, LOGIN_HEADER_NAV_ITEM]
|
|
88
|
+
}
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
var LOGIN_NAV_PATH, LOGIN_HEADER_NAV_ITEM;
|
|
92
|
+
var init_auth_header_nav = __esm({
|
|
93
|
+
"src/lib/authentication/auth-header-nav.ts"() {
|
|
94
|
+
LOGIN_NAV_PATH = "/signin";
|
|
95
|
+
LOGIN_HEADER_NAV_ITEM = {
|
|
96
|
+
label: "Login",
|
|
97
|
+
to: LOGIN_NAV_PATH,
|
|
98
|
+
display: "anon"
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
|
|
55
103
|
// src/lib/core/plugins.ts
|
|
56
104
|
var isTransformConfigPlugin;
|
|
57
105
|
var init_plugins = __esm({
|
|
@@ -131,90 +179,440 @@ import { stat } from "node:fs/promises";
|
|
|
131
179
|
var fileExists;
|
|
132
180
|
var init_file_exists = __esm({
|
|
133
181
|
"src/config/file-exists.ts"() {
|
|
134
|
-
fileExists = (
|
|
182
|
+
fileExists = (path39) => stat(path39).then(() => true).catch(() => false);
|
|
135
183
|
}
|
|
136
184
|
});
|
|
137
185
|
|
|
138
|
-
// src/config/
|
|
186
|
+
// src/config/apitogo-config-loader.ts
|
|
187
|
+
import { existsSync, readFileSync as readFileSync2 } from "node:fs";
|
|
188
|
+
import path2 from "node:path";
|
|
189
|
+
function parseEnvValue(raw) {
|
|
190
|
+
if (raw === void 0) {
|
|
191
|
+
return raw;
|
|
192
|
+
}
|
|
193
|
+
const trimmed = raw.trim();
|
|
194
|
+
if (trimmed === "true") {
|
|
195
|
+
return true;
|
|
196
|
+
}
|
|
197
|
+
if (trimmed === "false") {
|
|
198
|
+
return false;
|
|
199
|
+
}
|
|
200
|
+
if (trimmed === "null") {
|
|
201
|
+
return null;
|
|
202
|
+
}
|
|
203
|
+
if (/^-?\d+(\.\d+)?$/.test(trimmed)) {
|
|
204
|
+
return Number(trimmed);
|
|
205
|
+
}
|
|
206
|
+
if (trimmed.startsWith("{") && trimmed.endsWith("}") || trimmed.startsWith("[") && trimmed.endsWith("]")) {
|
|
207
|
+
try {
|
|
208
|
+
return JSON.parse(trimmed);
|
|
209
|
+
} catch {
|
|
210
|
+
return trimmed;
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
return trimmed;
|
|
214
|
+
}
|
|
215
|
+
function setNestedValue(target, pathParts, value) {
|
|
216
|
+
if (pathParts.length === 0) {
|
|
217
|
+
return;
|
|
218
|
+
}
|
|
219
|
+
let current = target;
|
|
220
|
+
for (let index = 0; index < pathParts.length - 1; index += 1) {
|
|
221
|
+
const key = pathParts[index];
|
|
222
|
+
if (!key) {
|
|
223
|
+
return;
|
|
224
|
+
}
|
|
225
|
+
const next = current[key];
|
|
226
|
+
if (next === void 0 || next === null || typeof next !== "object" || Array.isArray(next)) {
|
|
227
|
+
current[key] = {};
|
|
228
|
+
}
|
|
229
|
+
current = current[key];
|
|
230
|
+
}
|
|
231
|
+
const leafKey = pathParts[pathParts.length - 1];
|
|
232
|
+
if (!leafKey) {
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
current[leafKey] = value;
|
|
236
|
+
}
|
|
237
|
+
function applyEnvOverrides(config2, env = process.env) {
|
|
238
|
+
const result = structuredClone(config2);
|
|
239
|
+
for (const [key, value] of Object.entries(env)) {
|
|
240
|
+
if (!key.startsWith(ENV_PREFIX) || value === void 0) {
|
|
241
|
+
continue;
|
|
242
|
+
}
|
|
243
|
+
const pathParts = key.slice(ENV_PREFIX.length).split("__").filter(Boolean);
|
|
244
|
+
if (pathParts.length === 0) {
|
|
245
|
+
continue;
|
|
246
|
+
}
|
|
247
|
+
setNestedValue(result, pathParts, parseEnvValue(value));
|
|
248
|
+
}
|
|
249
|
+
return result;
|
|
250
|
+
}
|
|
251
|
+
function loadApitogoConfig(rootDir = process.cwd()) {
|
|
252
|
+
const configPath = path2.join(path2.resolve(rootDir), APITOGO_CONFIG_FILENAME);
|
|
253
|
+
if (!existsSync(configPath)) {
|
|
254
|
+
throw new Error(
|
|
255
|
+
`Missing ${APITOGO_CONFIG_FILENAME} in ${path2.resolve(rootDir)}`
|
|
256
|
+
);
|
|
257
|
+
}
|
|
258
|
+
const raw = readFileSync2(configPath, "utf8");
|
|
259
|
+
const parsed = JSON.parse(raw);
|
|
260
|
+
return applyEnvOverrides(parsed, process.env);
|
|
261
|
+
}
|
|
262
|
+
function extractManifest(config2) {
|
|
263
|
+
if (!config2 || typeof config2 !== "object") {
|
|
264
|
+
return null;
|
|
265
|
+
}
|
|
266
|
+
const manifest = {};
|
|
267
|
+
for (const key of MANIFEST_KEYS) {
|
|
268
|
+
if (config2[key] !== void 0) {
|
|
269
|
+
manifest[key] = config2[key];
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
const authentication = manifest.authentication;
|
|
273
|
+
if (authentication && typeof authentication === "object") {
|
|
274
|
+
const { enabled } = authentication;
|
|
275
|
+
manifest.authentication = enabled === void 0 ? void 0 : { enabled };
|
|
276
|
+
}
|
|
277
|
+
return Object.keys(manifest).length > 0 ? manifest : null;
|
|
278
|
+
}
|
|
279
|
+
var APITOGO_CONFIG_FILENAME, ENV_PREFIX, MANIFEST_KEYS;
|
|
280
|
+
var init_apitogo_config_loader = __esm({
|
|
281
|
+
"src/config/apitogo-config-loader.ts"() {
|
|
282
|
+
APITOGO_CONFIG_FILENAME = "apitogo.config.json";
|
|
283
|
+
ENV_PREFIX = "APITOGO_CONFIG_";
|
|
284
|
+
MANIFEST_KEYS = [
|
|
285
|
+
"siteName",
|
|
286
|
+
"branding",
|
|
287
|
+
"pricing",
|
|
288
|
+
"authentication",
|
|
289
|
+
"plans",
|
|
290
|
+
"backend",
|
|
291
|
+
"gateway",
|
|
292
|
+
"projectId",
|
|
293
|
+
"projectName"
|
|
294
|
+
];
|
|
295
|
+
}
|
|
296
|
+
});
|
|
297
|
+
|
|
298
|
+
// src/config/local-manifest.ts
|
|
299
|
+
import { access, readFile } from "node:fs/promises";
|
|
300
|
+
import path3 from "node:path";
|
|
139
301
|
import { z as z3 } from "zod";
|
|
302
|
+
function isPricingEnabled(manifest) {
|
|
303
|
+
return manifest?.pricing?.enabled === true;
|
|
304
|
+
}
|
|
305
|
+
function isAuthenticationEnabled(manifest) {
|
|
306
|
+
return manifest?.authentication?.enabled === true;
|
|
307
|
+
}
|
|
308
|
+
function manifestToPreviewCatalog(manifest) {
|
|
309
|
+
const plans = manifest?.plans;
|
|
310
|
+
const catalog = plansToPreviewCatalog(plans);
|
|
311
|
+
return {
|
|
312
|
+
pricingEnabled: isPricingEnabled(manifest),
|
|
313
|
+
authenticationEnabled: isAuthenticationEnabled(manifest),
|
|
314
|
+
plans: catalog.plans
|
|
315
|
+
};
|
|
316
|
+
}
|
|
317
|
+
function normalizeBillingPeriod(period) {
|
|
318
|
+
if (!period) {
|
|
319
|
+
return "monthly";
|
|
320
|
+
}
|
|
321
|
+
const normalized = period.toLowerCase();
|
|
322
|
+
if (normalized === "month") {
|
|
323
|
+
return "monthly";
|
|
324
|
+
}
|
|
325
|
+
if (normalized === "year") {
|
|
326
|
+
return "annual";
|
|
327
|
+
}
|
|
328
|
+
return normalized;
|
|
329
|
+
}
|
|
330
|
+
function plansToPreviewCatalog(plans) {
|
|
331
|
+
if (!plans?.length) {
|
|
332
|
+
return { plans: [] };
|
|
333
|
+
}
|
|
334
|
+
return {
|
|
335
|
+
plans: plans.map((plan) => ({
|
|
336
|
+
sku: plan.sku,
|
|
337
|
+
displayName: plan.displayName,
|
|
338
|
+
isFree: plan.isFree,
|
|
339
|
+
priceAmount: plan.priceAmount ?? 0,
|
|
340
|
+
priceCurrency: plan.priceCurrency ?? "usd",
|
|
341
|
+
billingPeriod: normalizeBillingPeriod(plan.billingPeriod),
|
|
342
|
+
limitsJson: plan.limitsJson ?? null,
|
|
343
|
+
includedActionKeys: plan.includedActionKeys ?? []
|
|
344
|
+
}))
|
|
345
|
+
};
|
|
346
|
+
}
|
|
347
|
+
function resolveManifestEnv(viteMode) {
|
|
348
|
+
return viteMode === "production" ? "production" : "development";
|
|
349
|
+
}
|
|
350
|
+
function mergePlansBySku(existing, patch) {
|
|
351
|
+
const bySku = /* @__PURE__ */ new Map();
|
|
352
|
+
for (const plan of existing ?? []) {
|
|
353
|
+
bySku.set(plan.sku, plan);
|
|
354
|
+
}
|
|
355
|
+
for (const plan of patch) {
|
|
356
|
+
const prior = bySku.get(plan.sku);
|
|
357
|
+
bySku.set(plan.sku, prior ? { ...prior, ...plan } : plan);
|
|
358
|
+
}
|
|
359
|
+
return Array.from(bySku.values());
|
|
360
|
+
}
|
|
361
|
+
function mergeManifest(base, override) {
|
|
362
|
+
const merged = { ...base, ...override };
|
|
363
|
+
if (override.branding) {
|
|
364
|
+
merged.branding = { ...base.branding, ...override.branding };
|
|
365
|
+
}
|
|
366
|
+
if (override.pricing) {
|
|
367
|
+
merged.pricing = { ...base.pricing, ...override.pricing };
|
|
368
|
+
}
|
|
369
|
+
if (override.authentication) {
|
|
370
|
+
merged.authentication = {
|
|
371
|
+
...base.authentication,
|
|
372
|
+
...override.authentication
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
if (override.backend) {
|
|
376
|
+
merged.backend = { ...base.backend, ...override.backend };
|
|
377
|
+
}
|
|
378
|
+
if (override.gateway) {
|
|
379
|
+
merged.gateway = { ...base.gateway, ...override.gateway };
|
|
380
|
+
}
|
|
381
|
+
if (override.plans) {
|
|
382
|
+
merged.plans = mergePlansBySku(base.plans, override.plans);
|
|
383
|
+
}
|
|
384
|
+
return merged;
|
|
385
|
+
}
|
|
386
|
+
function manifestFilePath(rootDir, filename) {
|
|
387
|
+
return path3.join(
|
|
388
|
+
path3.resolve(rootDir),
|
|
389
|
+
filename ?? DEV_PORTAL_MANIFEST_FILENAME
|
|
390
|
+
);
|
|
391
|
+
}
|
|
392
|
+
function manifestPathsForEnv(rootDir, _env) {
|
|
393
|
+
const resolvedRoot = path3.resolve(rootDir);
|
|
394
|
+
const configPath = path3.join(resolvedRoot, APITOGO_CONFIG_FILENAME);
|
|
395
|
+
return {
|
|
396
|
+
basePath: configPath,
|
|
397
|
+
overridePath: configPath,
|
|
398
|
+
watchPaths: [configPath]
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
function parseLocalManifestJson(raw) {
|
|
402
|
+
try {
|
|
403
|
+
const parsed = JSON.parse(raw);
|
|
404
|
+
const result = DevPortalLocalManifestSchema.safeParse(parsed);
|
|
405
|
+
if (!result.success) {
|
|
406
|
+
return null;
|
|
407
|
+
}
|
|
408
|
+
return result.data;
|
|
409
|
+
} catch {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
async function fileExists2(filePath) {
|
|
414
|
+
try {
|
|
415
|
+
await access(filePath);
|
|
416
|
+
return true;
|
|
417
|
+
} catch {
|
|
418
|
+
return false;
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
async function readManifestFile(rootDir, filename) {
|
|
422
|
+
const filePath = manifestFilePath(rootDir, filename);
|
|
423
|
+
try {
|
|
424
|
+
const raw = await readFile(filePath, "utf8");
|
|
425
|
+
return parseLocalManifestJson(raw);
|
|
426
|
+
} catch {
|
|
427
|
+
return null;
|
|
428
|
+
}
|
|
429
|
+
}
|
|
430
|
+
function parseManifestRecord(manifest) {
|
|
431
|
+
if (!manifest) {
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
const result = DevPortalLocalManifestSchema.safeParse(manifest);
|
|
435
|
+
return result.success ? result.data : null;
|
|
436
|
+
}
|
|
437
|
+
async function readEffectiveManifest(rootDir, env) {
|
|
438
|
+
try {
|
|
439
|
+
const config2 = loadApitogoConfig(rootDir);
|
|
440
|
+
return parseManifestRecord(extractManifest(config2));
|
|
441
|
+
} catch {
|
|
442
|
+
return readLegacyEffectiveManifest(rootDir, env);
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
async function readLegacyEffectiveManifest(rootDir, env) {
|
|
446
|
+
const resolvedRoot = path3.resolve(rootDir);
|
|
447
|
+
const basePath = path3.join(resolvedRoot, APITOGO_MANIFEST_BASE_FILENAME);
|
|
448
|
+
const overridePath = path3.join(resolvedRoot, APITOGO_MANIFEST_ENV_FILES[env]);
|
|
449
|
+
const hasBase = await fileExists2(basePath);
|
|
450
|
+
const hasOverride = await fileExists2(overridePath);
|
|
451
|
+
if (!hasBase) {
|
|
452
|
+
const legacy = await readManifestFile(
|
|
453
|
+
rootDir,
|
|
454
|
+
APITOGO_MANIFEST_ENV_FILES.development
|
|
455
|
+
);
|
|
456
|
+
if (legacy) {
|
|
457
|
+
return legacy;
|
|
458
|
+
}
|
|
459
|
+
if (hasOverride) {
|
|
460
|
+
return readManifestFile(rootDir, APITOGO_MANIFEST_ENV_FILES[env]);
|
|
461
|
+
}
|
|
462
|
+
return null;
|
|
463
|
+
}
|
|
464
|
+
const base = await readManifestFile(rootDir, APITOGO_MANIFEST_BASE_FILENAME);
|
|
465
|
+
if (!base) {
|
|
466
|
+
return null;
|
|
467
|
+
}
|
|
468
|
+
if (!hasOverride) {
|
|
469
|
+
return base;
|
|
470
|
+
}
|
|
471
|
+
const override = await readManifestFile(
|
|
472
|
+
rootDir,
|
|
473
|
+
APITOGO_MANIFEST_ENV_FILES[env]
|
|
474
|
+
);
|
|
475
|
+
if (!override) {
|
|
476
|
+
return base;
|
|
477
|
+
}
|
|
478
|
+
return mergeManifest(base, override);
|
|
479
|
+
}
|
|
480
|
+
var DEV_PORTAL_MANIFEST_FILENAME, APITOGO_MANIFEST_BASE_FILENAME, APITOGO_MANIFEST_ENV_FILES, BillingPeriodSchema, ManifestPlanInputSchema, DevPortalLocalManifestSchema;
|
|
481
|
+
var init_local_manifest = __esm({
|
|
482
|
+
"src/config/local-manifest.ts"() {
|
|
483
|
+
init_apitogo_config_loader();
|
|
484
|
+
DEV_PORTAL_MANIFEST_FILENAME = "apitogo.local.json";
|
|
485
|
+
APITOGO_MANIFEST_BASE_FILENAME = "apitogo.json";
|
|
486
|
+
APITOGO_MANIFEST_ENV_FILES = {
|
|
487
|
+
development: "apitogo.local.json",
|
|
488
|
+
production: "apitogo.prod.json"
|
|
489
|
+
};
|
|
490
|
+
BillingPeriodSchema = z3.enum(["month", "year", "monthly", "annual"]);
|
|
491
|
+
ManifestPlanInputSchema = z3.object({
|
|
492
|
+
sku: z3.string().min(1),
|
|
493
|
+
displayName: z3.string().min(1),
|
|
494
|
+
isFree: z3.boolean(),
|
|
495
|
+
priceAmount: z3.number().optional(),
|
|
496
|
+
priceCurrency: z3.string().optional(),
|
|
497
|
+
billingPeriod: BillingPeriodSchema.optional(),
|
|
498
|
+
limitsJson: z3.string().optional(),
|
|
499
|
+
includedActionKeys: z3.array(z3.string()).optional()
|
|
500
|
+
});
|
|
501
|
+
DevPortalLocalManifestSchema = z3.object({
|
|
502
|
+
siteName: z3.string().optional(),
|
|
503
|
+
branding: z3.object({
|
|
504
|
+
title: z3.string().optional(),
|
|
505
|
+
logoUrl: z3.string().optional()
|
|
506
|
+
}).optional(),
|
|
507
|
+
pricing: z3.object({
|
|
508
|
+
enabled: z3.boolean().optional()
|
|
509
|
+
}).optional(),
|
|
510
|
+
authentication: z3.object({
|
|
511
|
+
enabled: z3.boolean().optional()
|
|
512
|
+
}).optional(),
|
|
513
|
+
plans: z3.array(ManifestPlanInputSchema).optional(),
|
|
514
|
+
backend: z3.object({
|
|
515
|
+
sourceDirectory: z3.string().optional(),
|
|
516
|
+
publishDirectory: z3.string().optional(),
|
|
517
|
+
openApiPath: z3.string().optional(),
|
|
518
|
+
runtime: z3.string().optional(),
|
|
519
|
+
runtimeVersion: z3.string().optional(),
|
|
520
|
+
deployed: z3.boolean().optional()
|
|
521
|
+
}).optional(),
|
|
522
|
+
gateway: z3.object({
|
|
523
|
+
authMode: z3.enum(["platformManagedEntra", "bringYourOwnOidc"]).optional(),
|
|
524
|
+
oidcMetadataUrl: z3.string().optional(),
|
|
525
|
+
oidcAllowedIssuers: z3.array(z3.string()).optional(),
|
|
526
|
+
oidcAudiences: z3.array(z3.string()).optional(),
|
|
527
|
+
limitsJson: z3.string().optional(),
|
|
528
|
+
publicHealthActionKey: z3.string().optional()
|
|
529
|
+
}).optional(),
|
|
530
|
+
projectId: z3.string().optional(),
|
|
531
|
+
projectName: z3.string().optional()
|
|
532
|
+
});
|
|
533
|
+
}
|
|
534
|
+
});
|
|
535
|
+
|
|
536
|
+
// src/config/validators/ModulesSchema.ts
|
|
537
|
+
import { z as z4 } from "zod";
|
|
140
538
|
var ModuleToggleSchema, DocsModuleSchema, LandingLinkSchema, LandingFeatureSchema, LandingHeroSchema, LandingContentSchema, DashboardContentSchema, ProfileContentSchema, PlanTierSchema, PlansContentSchema, SubmodulePageFields, LandingModuleSchema, UserManagementModuleSchema, ApiKeysModuleSchema, PlansModuleSchema, DashboardModuleSchema, UserPanelModuleSchema, ModulesSchema;
|
|
141
539
|
var init_ModulesSchema = __esm({
|
|
142
540
|
"src/config/validators/ModulesSchema.ts"() {
|
|
143
|
-
ModuleToggleSchema =
|
|
144
|
-
enabled:
|
|
541
|
+
ModuleToggleSchema = z4.object({
|
|
542
|
+
enabled: z4.boolean().describe("Whether this module is active in the application.")
|
|
145
543
|
}).partial();
|
|
146
544
|
DocsModuleSchema = ModuleToggleSchema.extend({
|
|
147
|
-
files:
|
|
148
|
-
publishMarkdown:
|
|
149
|
-
defaultOptions:
|
|
150
|
-
toc:
|
|
151
|
-
copyPage:
|
|
152
|
-
disablePager:
|
|
153
|
-
showLastModified:
|
|
154
|
-
suggestEdit:
|
|
155
|
-
url:
|
|
156
|
-
text:
|
|
545
|
+
files: z4.union([z4.string(), z4.array(z4.string())]).optional(),
|
|
546
|
+
publishMarkdown: z4.boolean().optional(),
|
|
547
|
+
defaultOptions: z4.object({
|
|
548
|
+
toc: z4.boolean(),
|
|
549
|
+
copyPage: z4.boolean().optional(),
|
|
550
|
+
disablePager: z4.boolean(),
|
|
551
|
+
showLastModified: z4.boolean(),
|
|
552
|
+
suggestEdit: z4.object({
|
|
553
|
+
url: z4.string(),
|
|
554
|
+
text: z4.string().optional()
|
|
157
555
|
}).optional()
|
|
158
556
|
}).partial().optional(),
|
|
159
|
-
llms:
|
|
160
|
-
llmsTxt:
|
|
161
|
-
llmsTxtFull:
|
|
162
|
-
includeProtected:
|
|
557
|
+
llms: z4.object({
|
|
558
|
+
llmsTxt: z4.boolean().optional(),
|
|
559
|
+
llmsTxtFull: z4.boolean().optional(),
|
|
560
|
+
includeProtected: z4.boolean().optional()
|
|
163
561
|
}).optional()
|
|
164
562
|
});
|
|
165
|
-
LandingLinkSchema =
|
|
166
|
-
label:
|
|
167
|
-
href:
|
|
563
|
+
LandingLinkSchema = z4.object({
|
|
564
|
+
label: z4.string(),
|
|
565
|
+
href: z4.string()
|
|
168
566
|
});
|
|
169
|
-
LandingFeatureSchema =
|
|
170
|
-
title:
|
|
171
|
-
description:
|
|
567
|
+
LandingFeatureSchema = z4.object({
|
|
568
|
+
title: z4.string(),
|
|
569
|
+
description: z4.string()
|
|
172
570
|
});
|
|
173
|
-
LandingHeroSchema =
|
|
174
|
-
title:
|
|
175
|
-
subtitle:
|
|
176
|
-
description:
|
|
571
|
+
LandingHeroSchema = z4.object({
|
|
572
|
+
title: z4.string().optional(),
|
|
573
|
+
subtitle: z4.string().optional(),
|
|
574
|
+
description: z4.string().optional()
|
|
177
575
|
}).optional();
|
|
178
|
-
LandingContentSchema =
|
|
576
|
+
LandingContentSchema = z4.object({
|
|
179
577
|
hero: LandingHeroSchema,
|
|
180
|
-
features:
|
|
578
|
+
features: z4.array(LandingFeatureSchema).optional(),
|
|
181
579
|
primaryAction: LandingLinkSchema.optional(),
|
|
182
580
|
secondaryAction: LandingLinkSchema.optional(),
|
|
183
|
-
showPoweredBy:
|
|
581
|
+
showPoweredBy: z4.boolean().optional()
|
|
184
582
|
}).optional();
|
|
185
|
-
DashboardContentSchema =
|
|
186
|
-
title:
|
|
187
|
-
subtitle:
|
|
188
|
-
description:
|
|
189
|
-
quickLinks:
|
|
583
|
+
DashboardContentSchema = z4.object({
|
|
584
|
+
title: z4.string().optional(),
|
|
585
|
+
subtitle: z4.string().optional(),
|
|
586
|
+
description: z4.string().optional(),
|
|
587
|
+
quickLinks: z4.array(LandingLinkSchema).optional()
|
|
190
588
|
}).optional();
|
|
191
|
-
ProfileContentSchema =
|
|
192
|
-
title:
|
|
193
|
-
description:
|
|
589
|
+
ProfileContentSchema = z4.object({
|
|
590
|
+
title: z4.string().optional(),
|
|
591
|
+
description: z4.string().optional()
|
|
194
592
|
}).optional();
|
|
195
|
-
PlanTierSchema =
|
|
196
|
-
name:
|
|
197
|
-
price:
|
|
198
|
-
description:
|
|
593
|
+
PlanTierSchema = z4.object({
|
|
594
|
+
name: z4.string(),
|
|
595
|
+
price: z4.string().optional(),
|
|
596
|
+
description: z4.string().optional()
|
|
199
597
|
});
|
|
200
|
-
PlansContentSchema =
|
|
201
|
-
title:
|
|
202
|
-
description:
|
|
203
|
-
tiers:
|
|
598
|
+
PlansContentSchema = z4.object({
|
|
599
|
+
title: z4.string().optional(),
|
|
600
|
+
description: z4.string().optional(),
|
|
601
|
+
tiers: z4.array(PlanTierSchema).optional()
|
|
204
602
|
}).optional();
|
|
205
603
|
SubmodulePageFields = {
|
|
206
|
-
page:
|
|
604
|
+
page: z4.string().optional().describe(
|
|
207
605
|
"Path to a custom page component file, relative to the project root."
|
|
208
606
|
),
|
|
209
|
-
component:
|
|
607
|
+
component: z4.custom().optional().describe("Custom React component for this sub-module page.")
|
|
210
608
|
};
|
|
211
609
|
LandingModuleSchema = ModuleToggleSchema.extend({
|
|
212
|
-
path:
|
|
213
|
-
component:
|
|
214
|
-
page:
|
|
610
|
+
path: z4.string().default("/").describe("Route path for the landing page."),
|
|
611
|
+
component: z4.custom().optional().describe("Custom React component for the landing page."),
|
|
612
|
+
page: z4.string().optional().describe(
|
|
215
613
|
"Path to a custom landing page component file, relative to the project root."
|
|
216
614
|
),
|
|
217
|
-
layout:
|
|
615
|
+
layout: z4.enum(["default", "landing", "none"]).default("landing").describe(
|
|
218
616
|
"Layout wrapper: landing (header + footer), default (docs layout), or none."
|
|
219
617
|
),
|
|
220
618
|
content: LandingContentSchema.describe(
|
|
@@ -222,11 +620,11 @@ var init_ModulesSchema = __esm({
|
|
|
222
620
|
)
|
|
223
621
|
});
|
|
224
622
|
UserManagementModuleSchema = ModuleToggleSchema.extend({
|
|
225
|
-
routes:
|
|
226
|
-
login:
|
|
227
|
-
register:
|
|
228
|
-
profile:
|
|
229
|
-
logout:
|
|
623
|
+
routes: z4.object({
|
|
624
|
+
login: z4.string().default("/signin"),
|
|
625
|
+
register: z4.string().default("/signup"),
|
|
626
|
+
profile: z4.string().default("profile"),
|
|
627
|
+
logout: z4.string().default("/signout")
|
|
230
628
|
}).partial().optional(),
|
|
231
629
|
page: SubmodulePageFields.page,
|
|
232
630
|
component: SubmodulePageFields.component,
|
|
@@ -235,10 +633,10 @@ var init_ModulesSchema = __esm({
|
|
|
235
633
|
)
|
|
236
634
|
});
|
|
237
635
|
ApiKeysModuleSchema = ModuleToggleSchema.extend({
|
|
238
|
-
path:
|
|
636
|
+
path: z4.string().default("settings/api-keys").describe("Route path for API key management.")
|
|
239
637
|
});
|
|
240
638
|
PlansModuleSchema = ModuleToggleSchema.extend({
|
|
241
|
-
path:
|
|
639
|
+
path: z4.string().default("plans").describe("Route path for plans and subscription management."),
|
|
242
640
|
page: SubmodulePageFields.page,
|
|
243
641
|
component: SubmodulePageFields.component,
|
|
244
642
|
content: PlansContentSchema.describe(
|
|
@@ -246,7 +644,7 @@ var init_ModulesSchema = __esm({
|
|
|
246
644
|
)
|
|
247
645
|
});
|
|
248
646
|
DashboardModuleSchema = ModuleToggleSchema.extend({
|
|
249
|
-
path:
|
|
647
|
+
path: z4.string().default("dashboard").describe("Route path for the user dashboard."),
|
|
250
648
|
page: SubmodulePageFields.page,
|
|
251
649
|
component: SubmodulePageFields.component,
|
|
252
650
|
content: DashboardContentSchema.describe(
|
|
@@ -254,13 +652,13 @@ var init_ModulesSchema = __esm({
|
|
|
254
652
|
)
|
|
255
653
|
});
|
|
256
654
|
UserPanelModuleSchema = ModuleToggleSchema.extend({
|
|
257
|
-
basePath:
|
|
655
|
+
basePath: z4.string().default("/account").describe("Base path prefix for user panel routes."),
|
|
258
656
|
dashboard: DashboardModuleSchema.optional(),
|
|
259
657
|
userManagement: UserManagementModuleSchema.optional(),
|
|
260
658
|
apiKeys: ApiKeysModuleSchema.optional(),
|
|
261
659
|
plans: PlansModuleSchema.optional()
|
|
262
660
|
});
|
|
263
|
-
ModulesSchema =
|
|
661
|
+
ModulesSchema = z4.object({
|
|
264
662
|
docs: DocsModuleSchema.optional().describe(
|
|
265
663
|
"Documentation module \u2014 MD/MDX pages and OpenAPI reference."
|
|
266
664
|
),
|
|
@@ -563,30 +961,30 @@ var init_objectEntries = __esm({
|
|
|
563
961
|
});
|
|
564
962
|
|
|
565
963
|
// src/vite/shadcn-registry.ts
|
|
566
|
-
import { z as
|
|
964
|
+
import { z as z5 } from "zod";
|
|
567
965
|
var registryItemCssSchema, registryItemSchema, fetchShadcnRegistryItem;
|
|
568
966
|
var init_shadcn_registry = __esm({
|
|
569
967
|
"src/vite/shadcn-registry.ts"() {
|
|
570
|
-
registryItemCssSchema =
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
() =>
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
968
|
+
registryItemCssSchema = z5.record(
|
|
969
|
+
z5.string(),
|
|
970
|
+
z5.lazy(
|
|
971
|
+
() => z5.union([
|
|
972
|
+
z5.string(),
|
|
973
|
+
z5.record(
|
|
974
|
+
z5.string(),
|
|
975
|
+
z5.union([z5.string(), z5.record(z5.string(), z5.string())])
|
|
578
976
|
)
|
|
579
977
|
])
|
|
580
978
|
)
|
|
581
979
|
);
|
|
582
|
-
registryItemSchema =
|
|
583
|
-
$schema:
|
|
584
|
-
name:
|
|
585
|
-
type:
|
|
586
|
-
cssVars:
|
|
587
|
-
theme:
|
|
588
|
-
light:
|
|
589
|
-
dark:
|
|
980
|
+
registryItemSchema = z5.object({
|
|
981
|
+
$schema: z5.literal("https://ui.shadcn.com/schema/registry-item.json"),
|
|
982
|
+
name: z5.string(),
|
|
983
|
+
type: z5.enum(["registry:theme", "registry:style"]),
|
|
984
|
+
cssVars: z5.object({
|
|
985
|
+
theme: z5.record(z5.string(), z5.string()).optional(),
|
|
986
|
+
light: z5.record(z5.string(), z5.string()).optional(),
|
|
987
|
+
dark: z5.record(z5.string(), z5.string()).optional()
|
|
590
988
|
}).optional(),
|
|
591
989
|
css: registryItemCssSchema.optional()
|
|
592
990
|
});
|
|
@@ -603,7 +1001,7 @@ var init_shadcn_registry = __esm({
|
|
|
603
1001
|
});
|
|
604
1002
|
|
|
605
1003
|
// src/vite/plugin-theme.ts
|
|
606
|
-
import
|
|
1004
|
+
import path4 from "node:path";
|
|
607
1005
|
import { normalizeTheme } from "shiki";
|
|
608
1006
|
var THEME_VARIABLES, uncamelize, processColorValue, generateCss, generateRegistryCss, processCustomCss, MAIN_REPLACE, DEFAULT_THEME_REPLACE, GOOGLE_FONTS, getGoogleFontUrl, processFont, processFontConfig, processFonts, virtualModuleId, resolvedVirtualModuleId, viteThemePlugin;
|
|
609
1007
|
var init_plugin_theme = __esm({
|
|
@@ -891,7 +1289,7 @@ ${rootVars.join("\n")}
|
|
|
891
1289
|
config2.__meta.rootDir,
|
|
892
1290
|
...config2.__meta.dependencies,
|
|
893
1291
|
...config2.__pluginDirs ?? []
|
|
894
|
-
].map((file) =>
|
|
1292
|
+
].map((file) => path4.relative(path4.dirname(id), file))
|
|
895
1293
|
);
|
|
896
1294
|
const code = [...files].map((file) => `@source "${file}";`);
|
|
897
1295
|
code.push("@theme inline {");
|
|
@@ -2915,65 +3313,65 @@ var init_icon_types = __esm({
|
|
|
2915
3313
|
});
|
|
2916
3314
|
|
|
2917
3315
|
// src/config/validators/InputNavigationSchema.ts
|
|
2918
|
-
import { z as
|
|
3316
|
+
import { z as z6 } from "zod";
|
|
2919
3317
|
var IconSchema, BadgeSchema, InputNavigationCategoryLinkDocSchema, DisplaySchema, NavigationModifyRuleSchema, NavigationInsertRuleSchema, NavigationRemoveRuleSchema, NavigationSortRuleSchema, NavigationMoveRuleSchema, NavigationRuleSchema, NavigationRulesSchema, InputNavigationDocSchema, InputNavigationLinkSchema, InputNavigationCustomPageSchema, InputNavigationSeparatorSchema, InputNavigationSectionSchema, InputNavigationFilterSchema, BaseInputNavigationCategorySchema, InputNavigationCategorySchema, InputNavigationItemSchema, InputNavigationSchema;
|
|
2920
3318
|
var init_InputNavigationSchema = __esm({
|
|
2921
3319
|
"src/config/validators/InputNavigationSchema.ts"() {
|
|
2922
|
-
IconSchema =
|
|
2923
|
-
BadgeSchema =
|
|
2924
|
-
label:
|
|
3320
|
+
IconSchema = z6.custom((f) => typeof f === "string");
|
|
3321
|
+
BadgeSchema = z6.object({
|
|
3322
|
+
label: z6.string(),
|
|
2925
3323
|
// prettier-ignore
|
|
2926
|
-
color:
|
|
2927
|
-
invert:
|
|
2928
|
-
className:
|
|
3324
|
+
color: z6.enum(["green", "blue", "yellow", "red", "purple", "indigo", "gray", "outline"]),
|
|
3325
|
+
invert: z6.boolean().optional(),
|
|
3326
|
+
className: z6.string().optional()
|
|
2929
3327
|
});
|
|
2930
|
-
InputNavigationCategoryLinkDocSchema =
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
type:
|
|
2934
|
-
file:
|
|
2935
|
-
label:
|
|
2936
|
-
path:
|
|
3328
|
+
InputNavigationCategoryLinkDocSchema = z6.union([
|
|
3329
|
+
z6.string(),
|
|
3330
|
+
z6.object({
|
|
3331
|
+
type: z6.literal("doc"),
|
|
3332
|
+
file: z6.string(),
|
|
3333
|
+
label: z6.string().optional(),
|
|
3334
|
+
path: z6.string().optional()
|
|
2937
3335
|
})
|
|
2938
3336
|
]);
|
|
2939
|
-
DisplaySchema =
|
|
2940
|
-
|
|
2941
|
-
|
|
3337
|
+
DisplaySchema = z6.union([
|
|
3338
|
+
z6.enum(["auth", "anon", "always", "hide"]),
|
|
3339
|
+
z6.custom((val) => typeof val === "function")
|
|
2942
3340
|
]).optional();
|
|
2943
|
-
NavigationModifyRuleSchema =
|
|
2944
|
-
type:
|
|
2945
|
-
match:
|
|
2946
|
-
set:
|
|
2947
|
-
label:
|
|
3341
|
+
NavigationModifyRuleSchema = z6.object({
|
|
3342
|
+
type: z6.literal("modify"),
|
|
3343
|
+
match: z6.string(),
|
|
3344
|
+
set: z6.object({
|
|
3345
|
+
label: z6.string().optional(),
|
|
2948
3346
|
icon: IconSchema.optional(),
|
|
2949
3347
|
badge: BadgeSchema.optional(),
|
|
2950
|
-
collapsed:
|
|
2951
|
-
collapsible:
|
|
3348
|
+
collapsed: z6.boolean().optional(),
|
|
3349
|
+
collapsible: z6.boolean().optional(),
|
|
2952
3350
|
display: DisplaySchema
|
|
2953
3351
|
})
|
|
2954
3352
|
});
|
|
2955
|
-
NavigationInsertRuleSchema =
|
|
2956
|
-
type:
|
|
2957
|
-
match:
|
|
2958
|
-
position:
|
|
2959
|
-
items:
|
|
3353
|
+
NavigationInsertRuleSchema = z6.object({
|
|
3354
|
+
type: z6.literal("insert"),
|
|
3355
|
+
match: z6.string(),
|
|
3356
|
+
position: z6.enum(["before", "after"]),
|
|
3357
|
+
items: z6.lazy(() => InputNavigationItemSchema.array())
|
|
2960
3358
|
});
|
|
2961
|
-
NavigationRemoveRuleSchema =
|
|
2962
|
-
type:
|
|
2963
|
-
match:
|
|
3359
|
+
NavigationRemoveRuleSchema = z6.object({
|
|
3360
|
+
type: z6.literal("remove"),
|
|
3361
|
+
match: z6.string()
|
|
2964
3362
|
});
|
|
2965
|
-
NavigationSortRuleSchema =
|
|
2966
|
-
type:
|
|
2967
|
-
match:
|
|
2968
|
-
by:
|
|
3363
|
+
NavigationSortRuleSchema = z6.object({
|
|
3364
|
+
type: z6.literal("sort"),
|
|
3365
|
+
match: z6.string(),
|
|
3366
|
+
by: z6.custom((val) => typeof val === "function")
|
|
2969
3367
|
});
|
|
2970
|
-
NavigationMoveRuleSchema =
|
|
2971
|
-
type:
|
|
2972
|
-
match:
|
|
2973
|
-
to:
|
|
2974
|
-
position:
|
|
3368
|
+
NavigationMoveRuleSchema = z6.object({
|
|
3369
|
+
type: z6.literal("move"),
|
|
3370
|
+
match: z6.string(),
|
|
3371
|
+
to: z6.string(),
|
|
3372
|
+
position: z6.enum(["before", "after"])
|
|
2975
3373
|
});
|
|
2976
|
-
NavigationRuleSchema =
|
|
3374
|
+
NavigationRuleSchema = z6.discriminatedUnion("type", [
|
|
2977
3375
|
NavigationModifyRuleSchema,
|
|
2978
3376
|
NavigationInsertRuleSchema,
|
|
2979
3377
|
NavigationRemoveRuleSchema,
|
|
@@ -2981,65 +3379,65 @@ var init_InputNavigationSchema = __esm({
|
|
|
2981
3379
|
NavigationMoveRuleSchema
|
|
2982
3380
|
]);
|
|
2983
3381
|
NavigationRulesSchema = NavigationRuleSchema.array();
|
|
2984
|
-
InputNavigationDocSchema =
|
|
2985
|
-
|
|
2986
|
-
|
|
2987
|
-
type:
|
|
2988
|
-
file:
|
|
3382
|
+
InputNavigationDocSchema = z6.union([
|
|
3383
|
+
z6.string(),
|
|
3384
|
+
z6.object({
|
|
3385
|
+
type: z6.literal("doc"),
|
|
3386
|
+
file: z6.string(),
|
|
2989
3387
|
// Custom URL path for this document (overrides file-based path)
|
|
2990
|
-
path:
|
|
3388
|
+
path: z6.string().optional(),
|
|
2991
3389
|
icon: IconSchema.optional(),
|
|
2992
|
-
label:
|
|
3390
|
+
label: z6.string().optional(),
|
|
2993
3391
|
badge: BadgeSchema.optional(),
|
|
2994
3392
|
display: DisplaySchema
|
|
2995
3393
|
})
|
|
2996
3394
|
]);
|
|
2997
|
-
InputNavigationLinkSchema =
|
|
2998
|
-
type:
|
|
2999
|
-
to:
|
|
3000
|
-
label:
|
|
3001
|
-
target:
|
|
3395
|
+
InputNavigationLinkSchema = z6.object({
|
|
3396
|
+
type: z6.literal("link"),
|
|
3397
|
+
to: z6.string(),
|
|
3398
|
+
label: z6.string(),
|
|
3399
|
+
target: z6.enum(["_self", "_blank"]).optional(),
|
|
3002
3400
|
icon: IconSchema.optional(),
|
|
3003
3401
|
badge: BadgeSchema.optional(),
|
|
3004
3402
|
display: DisplaySchema
|
|
3005
3403
|
});
|
|
3006
|
-
InputNavigationCustomPageSchema =
|
|
3007
|
-
type:
|
|
3008
|
-
path:
|
|
3009
|
-
label:
|
|
3010
|
-
element:
|
|
3404
|
+
InputNavigationCustomPageSchema = z6.object({
|
|
3405
|
+
type: z6.literal("custom-page"),
|
|
3406
|
+
path: z6.string(),
|
|
3407
|
+
label: z6.string().optional(),
|
|
3408
|
+
element: z6.any(),
|
|
3011
3409
|
icon: IconSchema.optional(),
|
|
3012
3410
|
badge: BadgeSchema.optional(),
|
|
3013
3411
|
display: DisplaySchema,
|
|
3014
|
-
layout:
|
|
3412
|
+
layout: z6.enum(["default", "none"]).optional()
|
|
3015
3413
|
});
|
|
3016
|
-
InputNavigationSeparatorSchema =
|
|
3017
|
-
type:
|
|
3414
|
+
InputNavigationSeparatorSchema = z6.object({
|
|
3415
|
+
type: z6.literal("separator"),
|
|
3018
3416
|
display: DisplaySchema
|
|
3019
3417
|
});
|
|
3020
|
-
InputNavigationSectionSchema =
|
|
3021
|
-
type:
|
|
3022
|
-
label:
|
|
3418
|
+
InputNavigationSectionSchema = z6.object({
|
|
3419
|
+
type: z6.literal("section"),
|
|
3420
|
+
label: z6.string(),
|
|
3023
3421
|
display: DisplaySchema
|
|
3024
3422
|
});
|
|
3025
|
-
InputNavigationFilterSchema =
|
|
3026
|
-
type:
|
|
3027
|
-
placeholder:
|
|
3423
|
+
InputNavigationFilterSchema = z6.object({
|
|
3424
|
+
type: z6.literal("filter"),
|
|
3425
|
+
placeholder: z6.string().optional(),
|
|
3028
3426
|
display: DisplaySchema
|
|
3029
3427
|
});
|
|
3030
|
-
BaseInputNavigationCategorySchema =
|
|
3031
|
-
type:
|
|
3428
|
+
BaseInputNavigationCategorySchema = z6.object({
|
|
3429
|
+
type: z6.literal("category"),
|
|
3032
3430
|
icon: IconSchema.optional(),
|
|
3033
|
-
label:
|
|
3034
|
-
collapsible:
|
|
3035
|
-
collapsed:
|
|
3431
|
+
label: z6.string(),
|
|
3432
|
+
collapsible: z6.boolean().optional(),
|
|
3433
|
+
collapsed: z6.boolean().optional(),
|
|
3036
3434
|
link: InputNavigationCategoryLinkDocSchema.optional(),
|
|
3037
3435
|
display: DisplaySchema
|
|
3038
3436
|
});
|
|
3039
3437
|
InputNavigationCategorySchema = BaseInputNavigationCategorySchema.extend({
|
|
3040
|
-
items:
|
|
3438
|
+
items: z6.lazy(() => InputNavigationItemSchema.array())
|
|
3041
3439
|
});
|
|
3042
|
-
InputNavigationItemSchema =
|
|
3440
|
+
InputNavigationItemSchema = z6.union([
|
|
3043
3441
|
InputNavigationDocSchema,
|
|
3044
3442
|
InputNavigationLinkSchema,
|
|
3045
3443
|
InputNavigationCustomPageSchema,
|
|
@@ -3053,39 +3451,39 @@ var init_InputNavigationSchema = __esm({
|
|
|
3053
3451
|
});
|
|
3054
3452
|
|
|
3055
3453
|
// src/config/validators/HeaderNavigationSchema.ts
|
|
3056
|
-
import { z as
|
|
3454
|
+
import { z as z7 } from "zod";
|
|
3057
3455
|
var IconSchema2, HeaderNavLinkItemSchema, HeaderNavGroupSchema, HeaderNavItemSchema, HeaderNavigationSchema;
|
|
3058
3456
|
var init_HeaderNavigationSchema = __esm({
|
|
3059
3457
|
"src/config/validators/HeaderNavigationSchema.ts"() {
|
|
3060
3458
|
init_icon_types();
|
|
3061
3459
|
init_InputNavigationSchema();
|
|
3062
|
-
IconSchema2 =
|
|
3063
|
-
HeaderNavLinkItemSchema =
|
|
3064
|
-
label:
|
|
3460
|
+
IconSchema2 = z7.enum(IconNames);
|
|
3461
|
+
HeaderNavLinkItemSchema = z7.object({
|
|
3462
|
+
label: z7.string(),
|
|
3065
3463
|
icon: IconSchema2.optional(),
|
|
3066
|
-
description:
|
|
3067
|
-
to:
|
|
3068
|
-
target:
|
|
3464
|
+
description: z7.string().optional(),
|
|
3465
|
+
to: z7.string(),
|
|
3466
|
+
target: z7.enum(["_self", "_blank"]).optional(),
|
|
3069
3467
|
display: DisplaySchema
|
|
3070
3468
|
});
|
|
3071
|
-
HeaderNavGroupSchema =
|
|
3072
|
-
label:
|
|
3073
|
-
items:
|
|
3469
|
+
HeaderNavGroupSchema = z7.object({
|
|
3470
|
+
label: z7.string(),
|
|
3471
|
+
items: z7.array(HeaderNavLinkItemSchema)
|
|
3074
3472
|
});
|
|
3075
|
-
HeaderNavItemSchema =
|
|
3076
|
-
|
|
3077
|
-
label:
|
|
3473
|
+
HeaderNavItemSchema = z7.union([
|
|
3474
|
+
z7.object({
|
|
3475
|
+
label: z7.string(),
|
|
3078
3476
|
icon: IconSchema2.optional(),
|
|
3079
|
-
to:
|
|
3080
|
-
target:
|
|
3477
|
+
to: z7.string(),
|
|
3478
|
+
target: z7.enum(["_self", "_blank"]).optional(),
|
|
3081
3479
|
display: DisplaySchema
|
|
3082
3480
|
}),
|
|
3083
|
-
|
|
3084
|
-
label:
|
|
3085
|
-
items:
|
|
3481
|
+
z7.object({
|
|
3482
|
+
label: z7.string(),
|
|
3483
|
+
items: z7.array(z7.union([HeaderNavLinkItemSchema, HeaderNavGroupSchema]))
|
|
3086
3484
|
})
|
|
3087
3485
|
]);
|
|
3088
|
-
HeaderNavigationSchema =
|
|
3486
|
+
HeaderNavigationSchema = z7.array(HeaderNavItemSchema);
|
|
3089
3487
|
}
|
|
3090
3488
|
});
|
|
3091
3489
|
|
|
@@ -3150,23 +3548,23 @@ var init_ZudokuContext = __esm({
|
|
|
3150
3548
|
});
|
|
3151
3549
|
|
|
3152
3550
|
// src/config/validators/ProtectedRoutesSchema.ts
|
|
3153
|
-
import { z as
|
|
3551
|
+
import { z as z8 } from "zod/mini";
|
|
3154
3552
|
var ProtectedRoutesInputSchema, ProtectedRoutesSchema;
|
|
3155
3553
|
var init_ProtectedRoutesSchema = __esm({
|
|
3156
3554
|
"src/config/validators/ProtectedRoutesSchema.ts"() {
|
|
3157
3555
|
init_ZudokuContext();
|
|
3158
|
-
ProtectedRoutesInputSchema =
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3162
|
-
|
|
3163
|
-
|
|
3556
|
+
ProtectedRoutesInputSchema = z8.optional(
|
|
3557
|
+
z8.union([
|
|
3558
|
+
z8.array(z8.string()),
|
|
3559
|
+
z8.record(
|
|
3560
|
+
z8.string(),
|
|
3561
|
+
z8.custom((val) => typeof val === "function")
|
|
3164
3562
|
)
|
|
3165
3563
|
])
|
|
3166
3564
|
);
|
|
3167
|
-
ProtectedRoutesSchema =
|
|
3565
|
+
ProtectedRoutesSchema = z8.pipe(
|
|
3168
3566
|
ProtectedRoutesInputSchema,
|
|
3169
|
-
|
|
3567
|
+
z8.transform(normalizeProtectedRoutes)
|
|
3170
3568
|
);
|
|
3171
3569
|
}
|
|
3172
3570
|
});
|
|
@@ -3184,18 +3582,18 @@ __export(ZudokuConfig_exports, {
|
|
|
3184
3582
|
});
|
|
3185
3583
|
import colors from "picocolors";
|
|
3186
3584
|
import { isValidElement as isValidElement2 } from "react";
|
|
3187
|
-
import { z as
|
|
3585
|
+
import { z as z9 } from "zod";
|
|
3188
3586
|
function validateConfig(config2, configPath) {
|
|
3189
3587
|
const validationResult = ZudokuConfig.safeParse(config2);
|
|
3190
3588
|
if (!validationResult.success) {
|
|
3191
3589
|
if (process.env.NODE_ENV === "production") {
|
|
3192
3590
|
throw new Error(
|
|
3193
3591
|
`Whoops, looks like there's an issue with your ${configPath ?? "config"}:
|
|
3194
|
-
${
|
|
3592
|
+
${z9.prettifyError(validationResult.error)}`
|
|
3195
3593
|
);
|
|
3196
3594
|
}
|
|
3197
3595
|
console.log(colors.yellow("Validation errors:"));
|
|
3198
|
-
console.log(colors.yellow(
|
|
3596
|
+
console.log(colors.yellow(z9.prettifyError(validationResult.error)));
|
|
3199
3597
|
}
|
|
3200
3598
|
}
|
|
3201
3599
|
var ThemeSchema, ApiCatalogCategorySchema, LanguageOption, AiAssistantCustomSchema, AiAssistantPresets, AiAssistantsSchema, ApiOptionsSchema, ApiConfigSchema, VersionConfigSchema, ApiSchema, ApiKeysSchema, LogoSchema, FooterSocialIcons, FooterSocialSchema, FooterSchema, SiteMapSchema, DEFAULT_DOCS_FILES, LlmsConfigSchema, DocsConfigSchema, Redirect, SearchSchema, AuthenticationSchema, MetadataSchema, FontConfigSchema, FontsConfigSchema, CssObject, ThemeConfigSchema, SiteSchema, PlacementPosition, HeaderConfigSchema, ApiCatalogSchema, CdnUrlSchema, BaseConfigSchema, ZudokuConfig;
|
|
@@ -3206,114 +3604,114 @@ var init_ZudokuConfig = __esm({
|
|
|
3206
3604
|
init_InputNavigationSchema();
|
|
3207
3605
|
init_ModulesSchema();
|
|
3208
3606
|
init_ProtectedRoutesSchema();
|
|
3209
|
-
ThemeSchema =
|
|
3210
|
-
background:
|
|
3211
|
-
foreground:
|
|
3212
|
-
card:
|
|
3213
|
-
cardForeground:
|
|
3214
|
-
popover:
|
|
3215
|
-
popoverForeground:
|
|
3216
|
-
primary:
|
|
3217
|
-
primaryForeground:
|
|
3218
|
-
secondary:
|
|
3219
|
-
secondaryForeground:
|
|
3220
|
-
muted:
|
|
3221
|
-
mutedForeground:
|
|
3222
|
-
accent:
|
|
3223
|
-
accentForeground:
|
|
3224
|
-
destructive:
|
|
3225
|
-
destructiveForeground:
|
|
3226
|
-
border:
|
|
3227
|
-
input:
|
|
3228
|
-
ring:
|
|
3229
|
-
radius:
|
|
3607
|
+
ThemeSchema = z9.object({
|
|
3608
|
+
background: z9.string(),
|
|
3609
|
+
foreground: z9.string(),
|
|
3610
|
+
card: z9.string(),
|
|
3611
|
+
cardForeground: z9.string(),
|
|
3612
|
+
popover: z9.string(),
|
|
3613
|
+
popoverForeground: z9.string(),
|
|
3614
|
+
primary: z9.string(),
|
|
3615
|
+
primaryForeground: z9.string(),
|
|
3616
|
+
secondary: z9.string(),
|
|
3617
|
+
secondaryForeground: z9.string(),
|
|
3618
|
+
muted: z9.string(),
|
|
3619
|
+
mutedForeground: z9.string(),
|
|
3620
|
+
accent: z9.string(),
|
|
3621
|
+
accentForeground: z9.string(),
|
|
3622
|
+
destructive: z9.string(),
|
|
3623
|
+
destructiveForeground: z9.string(),
|
|
3624
|
+
border: z9.string(),
|
|
3625
|
+
input: z9.string(),
|
|
3626
|
+
ring: z9.string(),
|
|
3627
|
+
radius: z9.string()
|
|
3230
3628
|
}).partial();
|
|
3231
|
-
ApiCatalogCategorySchema =
|
|
3232
|
-
label:
|
|
3233
|
-
tags:
|
|
3629
|
+
ApiCatalogCategorySchema = z9.object({
|
|
3630
|
+
label: z9.string(),
|
|
3631
|
+
tags: z9.array(z9.string())
|
|
3234
3632
|
});
|
|
3235
|
-
LanguageOption =
|
|
3236
|
-
value:
|
|
3237
|
-
label:
|
|
3633
|
+
LanguageOption = z9.object({
|
|
3634
|
+
value: z9.string().min(1),
|
|
3635
|
+
label: z9.string().min(1)
|
|
3238
3636
|
});
|
|
3239
|
-
AiAssistantCustomSchema =
|
|
3240
|
-
label:
|
|
3241
|
-
icon:
|
|
3242
|
-
url:
|
|
3243
|
-
|
|
3244
|
-
|
|
3637
|
+
AiAssistantCustomSchema = z9.object({
|
|
3638
|
+
label: z9.string(),
|
|
3639
|
+
icon: z9.custom().optional(),
|
|
3640
|
+
url: z9.union([
|
|
3641
|
+
z9.string(),
|
|
3642
|
+
z9.custom((val) => typeof val === "function")
|
|
3245
3643
|
])
|
|
3246
3644
|
});
|
|
3247
3645
|
AiAssistantPresets = ["claude", "chatgpt"];
|
|
3248
|
-
AiAssistantsSchema =
|
|
3249
|
-
|
|
3250
|
-
|
|
3646
|
+
AiAssistantsSchema = z9.union([
|
|
3647
|
+
z9.literal(false),
|
|
3648
|
+
z9.array(z9.union([z9.enum(AiAssistantPresets), AiAssistantCustomSchema]))
|
|
3251
3649
|
]).optional();
|
|
3252
|
-
ApiOptionsSchema =
|
|
3253
|
-
examplesLanguage:
|
|
3254
|
-
supportedLanguages:
|
|
3255
|
-
disablePlayground:
|
|
3256
|
-
disableSidecar:
|
|
3257
|
-
showVersionSelect:
|
|
3258
|
-
expandAllTags:
|
|
3259
|
-
showInfoPage:
|
|
3260
|
-
schemaDownload:
|
|
3261
|
-
transformExamples:
|
|
3650
|
+
ApiOptionsSchema = z9.object({
|
|
3651
|
+
examplesLanguage: z9.string(),
|
|
3652
|
+
supportedLanguages: z9.array(LanguageOption),
|
|
3653
|
+
disablePlayground: z9.boolean(),
|
|
3654
|
+
disableSidecar: z9.boolean(),
|
|
3655
|
+
showVersionSelect: z9.enum(["always", "if-available", "hide"]),
|
|
3656
|
+
expandAllTags: z9.boolean(),
|
|
3657
|
+
showInfoPage: z9.boolean(),
|
|
3658
|
+
schemaDownload: z9.object({ enabled: z9.boolean() }).partial(),
|
|
3659
|
+
transformExamples: z9.custom(
|
|
3262
3660
|
(val) => typeof val === "function"
|
|
3263
3661
|
),
|
|
3264
|
-
generateCodeSnippet:
|
|
3662
|
+
generateCodeSnippet: z9.custom(
|
|
3265
3663
|
(val) => typeof val === "function"
|
|
3266
3664
|
)
|
|
3267
3665
|
}).partial();
|
|
3268
|
-
ApiConfigSchema =
|
|
3269
|
-
server:
|
|
3270
|
-
path:
|
|
3271
|
-
categories:
|
|
3666
|
+
ApiConfigSchema = z9.object({
|
|
3667
|
+
server: z9.string(),
|
|
3668
|
+
path: z9.string(),
|
|
3669
|
+
categories: z9.array(ApiCatalogCategorySchema),
|
|
3272
3670
|
options: ApiOptionsSchema
|
|
3273
3671
|
}).partial();
|
|
3274
|
-
VersionConfigSchema =
|
|
3275
|
-
path:
|
|
3276
|
-
input:
|
|
3277
|
-
label:
|
|
3672
|
+
VersionConfigSchema = z9.object({
|
|
3673
|
+
path: z9.string(),
|
|
3674
|
+
input: z9.string(),
|
|
3675
|
+
label: z9.string().optional()
|
|
3278
3676
|
});
|
|
3279
|
-
ApiSchema =
|
|
3280
|
-
|
|
3281
|
-
type:
|
|
3282
|
-
input:
|
|
3677
|
+
ApiSchema = z9.discriminatedUnion("type", [
|
|
3678
|
+
z9.object({
|
|
3679
|
+
type: z9.literal("url"),
|
|
3680
|
+
input: z9.union([z9.string(), z9.array(VersionConfigSchema)]),
|
|
3283
3681
|
...ApiConfigSchema.shape
|
|
3284
3682
|
}),
|
|
3285
|
-
|
|
3286
|
-
type:
|
|
3287
|
-
input:
|
|
3288
|
-
|
|
3289
|
-
|
|
3683
|
+
z9.object({
|
|
3684
|
+
type: z9.literal("file"),
|
|
3685
|
+
input: z9.union([
|
|
3686
|
+
z9.string(),
|
|
3687
|
+
z9.array(z9.union([z9.string(), VersionConfigSchema]))
|
|
3290
3688
|
]),
|
|
3291
3689
|
...ApiConfigSchema.shape
|
|
3292
3690
|
}),
|
|
3293
|
-
|
|
3294
|
-
type:
|
|
3295
|
-
input:
|
|
3691
|
+
z9.object({
|
|
3692
|
+
type: z9.literal("raw"),
|
|
3693
|
+
input: z9.string(),
|
|
3296
3694
|
...ApiConfigSchema.shape
|
|
3297
3695
|
})
|
|
3298
3696
|
]);
|
|
3299
|
-
ApiKeysSchema =
|
|
3300
|
-
enabled:
|
|
3301
|
-
getConsumers:
|
|
3697
|
+
ApiKeysSchema = z9.object({
|
|
3698
|
+
enabled: z9.boolean(),
|
|
3699
|
+
getConsumers: z9.custom(
|
|
3302
3700
|
(val) => typeof val === "function"
|
|
3303
3701
|
).optional(),
|
|
3304
|
-
rollKey:
|
|
3702
|
+
rollKey: z9.custom(
|
|
3305
3703
|
(val) => typeof val === "function"
|
|
3306
3704
|
).optional(),
|
|
3307
|
-
deleteKey:
|
|
3308
|
-
updateKeyDescription:
|
|
3309
|
-
createKey:
|
|
3705
|
+
deleteKey: z9.custom((val) => typeof val === "function").optional(),
|
|
3706
|
+
updateKeyDescription: z9.custom((val) => typeof val === "function").optional(),
|
|
3707
|
+
createKey: z9.custom((val) => typeof val === "function").optional()
|
|
3310
3708
|
});
|
|
3311
|
-
LogoSchema =
|
|
3312
|
-
src:
|
|
3313
|
-
alt:
|
|
3314
|
-
width:
|
|
3315
|
-
href:
|
|
3316
|
-
reloadDocument:
|
|
3709
|
+
LogoSchema = z9.object({
|
|
3710
|
+
src: z9.object({ light: z9.string(), dark: z9.string() }),
|
|
3711
|
+
alt: z9.string().optional(),
|
|
3712
|
+
width: z9.string().or(z9.number()).optional(),
|
|
3713
|
+
href: z9.string().optional(),
|
|
3714
|
+
reloadDocument: z9.boolean().optional()
|
|
3317
3715
|
});
|
|
3318
3716
|
FooterSocialIcons = [
|
|
3319
3717
|
"reddit",
|
|
@@ -3331,38 +3729,38 @@ var init_ZudokuConfig = __esm({
|
|
|
3331
3729
|
"whatsapp",
|
|
3332
3730
|
"telegram"
|
|
3333
3731
|
];
|
|
3334
|
-
FooterSocialSchema =
|
|
3335
|
-
label:
|
|
3336
|
-
href:
|
|
3337
|
-
icon:
|
|
3338
|
-
|
|
3339
|
-
|
|
3732
|
+
FooterSocialSchema = z9.object({
|
|
3733
|
+
label: z9.string().optional(),
|
|
3734
|
+
href: z9.string(),
|
|
3735
|
+
icon: z9.union([
|
|
3736
|
+
z9.enum(FooterSocialIcons),
|
|
3737
|
+
z9.custom((val) => isValidElement2(val))
|
|
3340
3738
|
]).optional()
|
|
3341
3739
|
});
|
|
3342
|
-
FooterSchema =
|
|
3343
|
-
columns:
|
|
3344
|
-
|
|
3345
|
-
position:
|
|
3346
|
-
title:
|
|
3347
|
-
links:
|
|
3740
|
+
FooterSchema = z9.object({
|
|
3741
|
+
columns: z9.array(
|
|
3742
|
+
z9.object({
|
|
3743
|
+
position: z9.enum(["start", "center", "end"]).optional(),
|
|
3744
|
+
title: z9.string(),
|
|
3745
|
+
links: z9.array(z9.object({ label: z9.string(), href: z9.string() }))
|
|
3348
3746
|
})
|
|
3349
3747
|
).optional(),
|
|
3350
|
-
social:
|
|
3351
|
-
copyright:
|
|
3748
|
+
social: z9.array(FooterSocialSchema).optional(),
|
|
3749
|
+
copyright: z9.string().optional(),
|
|
3352
3750
|
logo: LogoSchema.optional(),
|
|
3353
|
-
position:
|
|
3751
|
+
position: z9.enum(["start", "center", "end"]).optional()
|
|
3354
3752
|
}).optional();
|
|
3355
|
-
SiteMapSchema =
|
|
3753
|
+
SiteMapSchema = z9.object({
|
|
3356
3754
|
/**
|
|
3357
3755
|
* Base url of your website
|
|
3358
3756
|
*/
|
|
3359
|
-
siteUrl:
|
|
3757
|
+
siteUrl: z9.string(),
|
|
3360
3758
|
/**
|
|
3361
3759
|
* Change frequency.
|
|
3362
3760
|
* @default 'daily'
|
|
3363
3761
|
*/
|
|
3364
|
-
changefreq:
|
|
3365
|
-
|
|
3762
|
+
changefreq: z9.optional(
|
|
3763
|
+
z9.enum([
|
|
3366
3764
|
"always",
|
|
3367
3765
|
"hourly",
|
|
3368
3766
|
"daily",
|
|
@@ -3376,101 +3774,101 @@ var init_ZudokuConfig = __esm({
|
|
|
3376
3774
|
* Priority
|
|
3377
3775
|
* @default 0.7
|
|
3378
3776
|
*/
|
|
3379
|
-
priority:
|
|
3380
|
-
outDir:
|
|
3777
|
+
priority: z9.optional(z9.number()),
|
|
3778
|
+
outDir: z9.string().optional(),
|
|
3381
3779
|
/**
|
|
3382
3780
|
* Add <lastmod/> property.
|
|
3383
3781
|
* @default true
|
|
3384
3782
|
*/
|
|
3385
|
-
autoLastmod:
|
|
3783
|
+
autoLastmod: z9.boolean().optional(),
|
|
3386
3784
|
/**
|
|
3387
3785
|
* Array of relative paths to exclude from listing on sitemap.xml or sitemap-*.xml.
|
|
3388
3786
|
* @example ['/page-0', '/page/example']
|
|
3389
3787
|
*/
|
|
3390
|
-
exclude:
|
|
3391
|
-
|
|
3392
|
-
|
|
3788
|
+
exclude: z9.union([
|
|
3789
|
+
z9.custom((val) => typeof val === "function"),
|
|
3790
|
+
z9.array(z9.string())
|
|
3393
3791
|
]).optional()
|
|
3394
3792
|
}).optional();
|
|
3395
3793
|
DEFAULT_DOCS_FILES = "/pages/**/*.{md,mdx}";
|
|
3396
|
-
LlmsConfigSchema =
|
|
3397
|
-
llmsTxt:
|
|
3794
|
+
LlmsConfigSchema = z9.object({
|
|
3795
|
+
llmsTxt: z9.boolean().default(false).describe(
|
|
3398
3796
|
"When enabled, generates an llms.txt file following the spec at https://llmstxt.org/. This file provides a summary with links to all documentation."
|
|
3399
3797
|
),
|
|
3400
|
-
llmsTxtFull:
|
|
3798
|
+
llmsTxtFull: z9.boolean().default(false).describe(
|
|
3401
3799
|
"When enabled, generates an llms-full.txt file with the complete content of all markdown documents for LLM consumption."
|
|
3402
3800
|
),
|
|
3403
|
-
includeProtected:
|
|
3801
|
+
includeProtected: z9.boolean().default(false).describe(
|
|
3404
3802
|
"When enabled, includes content from protected routes in the generated .md files and llms.txt files. By default, protected routes are excluded."
|
|
3405
3803
|
)
|
|
3406
3804
|
}).partial();
|
|
3407
|
-
DocsConfigSchema =
|
|
3408
|
-
files:
|
|
3409
|
-
publishMarkdown:
|
|
3805
|
+
DocsConfigSchema = z9.object({
|
|
3806
|
+
files: z9.union([z9.string(), z9.array(z9.string())]).transform((val) => typeof val === "string" ? [val] : val).default([DEFAULT_DOCS_FILES]),
|
|
3807
|
+
publishMarkdown: z9.boolean().default(false).describe(
|
|
3410
3808
|
"When enabled, generates .md files for each document during build. Access documents at their URL path with .md extension (e.g., /foo/hello.md). Markdown files are generated without frontmatter."
|
|
3411
3809
|
),
|
|
3412
|
-
defaultOptions:
|
|
3413
|
-
toc:
|
|
3414
|
-
copyPage:
|
|
3415
|
-
disablePager:
|
|
3416
|
-
showLastModified:
|
|
3417
|
-
suggestEdit:
|
|
3418
|
-
url:
|
|
3419
|
-
text:
|
|
3810
|
+
defaultOptions: z9.object({
|
|
3811
|
+
toc: z9.boolean(),
|
|
3812
|
+
copyPage: z9.boolean().optional(),
|
|
3813
|
+
disablePager: z9.boolean(),
|
|
3814
|
+
showLastModified: z9.boolean(),
|
|
3815
|
+
suggestEdit: z9.object({
|
|
3816
|
+
url: z9.string(),
|
|
3817
|
+
text: z9.string().optional()
|
|
3420
3818
|
}).optional()
|
|
3421
3819
|
}).partial().optional(),
|
|
3422
3820
|
llms: LlmsConfigSchema.optional()
|
|
3423
3821
|
});
|
|
3424
|
-
Redirect =
|
|
3425
|
-
from:
|
|
3426
|
-
to:
|
|
3822
|
+
Redirect = z9.object({
|
|
3823
|
+
from: z9.string(),
|
|
3824
|
+
to: z9.string()
|
|
3427
3825
|
});
|
|
3428
|
-
SearchSchema =
|
|
3826
|
+
SearchSchema = z9.discriminatedUnion("type", [
|
|
3429
3827
|
// looseObject to allow additional properties so the
|
|
3430
3828
|
// user can set other inkeep settings
|
|
3431
|
-
|
|
3432
|
-
type:
|
|
3433
|
-
apiKey:
|
|
3434
|
-
integrationId:
|
|
3435
|
-
organizationId:
|
|
3436
|
-
primaryBrandColor:
|
|
3437
|
-
organizationDisplayName:
|
|
3829
|
+
z9.looseObject({
|
|
3830
|
+
type: z9.literal("inkeep"),
|
|
3831
|
+
apiKey: z9.string(),
|
|
3832
|
+
integrationId: z9.string(),
|
|
3833
|
+
organizationId: z9.string(),
|
|
3834
|
+
primaryBrandColor: z9.string(),
|
|
3835
|
+
organizationDisplayName: z9.string()
|
|
3438
3836
|
}),
|
|
3439
|
-
|
|
3440
|
-
type:
|
|
3441
|
-
ranking:
|
|
3442
|
-
termFrequency:
|
|
3443
|
-
pageLength:
|
|
3444
|
-
termSimilarity:
|
|
3445
|
-
termSaturation:
|
|
3837
|
+
z9.object({
|
|
3838
|
+
type: z9.literal("pagefind"),
|
|
3839
|
+
ranking: z9.object({
|
|
3840
|
+
termFrequency: z9.number(),
|
|
3841
|
+
pageLength: z9.number(),
|
|
3842
|
+
termSimilarity: z9.number(),
|
|
3843
|
+
termSaturation: z9.number()
|
|
3446
3844
|
}).optional(),
|
|
3447
|
-
maxResults:
|
|
3448
|
-
maxSubResults:
|
|
3449
|
-
transformResults:
|
|
3845
|
+
maxResults: z9.number().optional(),
|
|
3846
|
+
maxSubResults: z9.number().optional(),
|
|
3847
|
+
transformResults: z9.custom((val) => typeof val === "function").optional()
|
|
3450
3848
|
})
|
|
3451
3849
|
]).optional();
|
|
3452
|
-
AuthenticationSchema =
|
|
3453
|
-
|
|
3454
|
-
type:
|
|
3455
|
-
clerkPubKey:
|
|
3850
|
+
AuthenticationSchema = z9.discriminatedUnion("type", [
|
|
3851
|
+
z9.object({
|
|
3852
|
+
type: z9.literal("clerk"),
|
|
3853
|
+
clerkPubKey: z9.custom().refine((val) => /^pk_(test|live)_\w+$/.test(val), {
|
|
3456
3854
|
message: "Clerk public key invalid, must start with pk_test or pk_live"
|
|
3457
3855
|
}),
|
|
3458
|
-
jwtTemplateName:
|
|
3459
|
-
redirectToAfterSignUp:
|
|
3460
|
-
redirectToAfterSignIn:
|
|
3461
|
-
redirectToAfterSignOut:
|
|
3856
|
+
jwtTemplateName: z9.string().optional().default("dev-portal"),
|
|
3857
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3858
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3859
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3462
3860
|
}),
|
|
3463
|
-
|
|
3464
|
-
type:
|
|
3465
|
-
apiKey:
|
|
3466
|
-
authDomain:
|
|
3467
|
-
projectId:
|
|
3468
|
-
storageBucket:
|
|
3469
|
-
messagingSenderId:
|
|
3470
|
-
appId:
|
|
3471
|
-
measurementId:
|
|
3472
|
-
providers:
|
|
3473
|
-
|
|
3861
|
+
z9.object({
|
|
3862
|
+
type: z9.literal("firebase"),
|
|
3863
|
+
apiKey: z9.string(),
|
|
3864
|
+
authDomain: z9.string(),
|
|
3865
|
+
projectId: z9.string(),
|
|
3866
|
+
storageBucket: z9.string().optional(),
|
|
3867
|
+
messagingSenderId: z9.string().optional(),
|
|
3868
|
+
appId: z9.string(),
|
|
3869
|
+
measurementId: z9.string().optional(),
|
|
3870
|
+
providers: z9.array(
|
|
3871
|
+
z9.enum([
|
|
3474
3872
|
"google",
|
|
3475
3873
|
"facebook",
|
|
3476
3874
|
"twitter",
|
|
@@ -3483,37 +3881,37 @@ var init_ZudokuConfig = __esm({
|
|
|
3483
3881
|
"emailLink"
|
|
3484
3882
|
])
|
|
3485
3883
|
).optional(),
|
|
3486
|
-
redirectToAfterSignUp:
|
|
3487
|
-
redirectToAfterSignIn:
|
|
3488
|
-
redirectToAfterSignOut:
|
|
3884
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3885
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3886
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3489
3887
|
}),
|
|
3490
|
-
|
|
3491
|
-
type:
|
|
3492
|
-
basePath:
|
|
3493
|
-
clientId:
|
|
3494
|
-
issuer:
|
|
3495
|
-
audience:
|
|
3496
|
-
scopes:
|
|
3497
|
-
redirectToAfterSignUp:
|
|
3498
|
-
redirectToAfterSignIn:
|
|
3499
|
-
redirectToAfterSignOut:
|
|
3888
|
+
z9.object({
|
|
3889
|
+
type: z9.literal("openid"),
|
|
3890
|
+
basePath: z9.string().optional(),
|
|
3891
|
+
clientId: z9.string(),
|
|
3892
|
+
issuer: z9.string(),
|
|
3893
|
+
audience: z9.string().optional(),
|
|
3894
|
+
scopes: z9.array(z9.string()).optional(),
|
|
3895
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3896
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3897
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3500
3898
|
}),
|
|
3501
|
-
|
|
3502
|
-
type:
|
|
3503
|
-
basePath:
|
|
3504
|
-
clientId:
|
|
3505
|
-
tenantName:
|
|
3506
|
-
policyName:
|
|
3507
|
-
scopes:
|
|
3508
|
-
issuer:
|
|
3509
|
-
redirectToAfterSignUp:
|
|
3510
|
-
redirectToAfterSignIn:
|
|
3511
|
-
redirectToAfterSignOut:
|
|
3899
|
+
z9.object({
|
|
3900
|
+
type: z9.literal("azureb2c"),
|
|
3901
|
+
basePath: z9.string().optional(),
|
|
3902
|
+
clientId: z9.string(),
|
|
3903
|
+
tenantName: z9.string(),
|
|
3904
|
+
policyName: z9.string(),
|
|
3905
|
+
scopes: z9.array(z9.string()).optional(),
|
|
3906
|
+
issuer: z9.string(),
|
|
3907
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3908
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3909
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3512
3910
|
}),
|
|
3513
|
-
|
|
3514
|
-
type:
|
|
3515
|
-
clientId:
|
|
3516
|
-
domain:
|
|
3911
|
+
z9.object({
|
|
3912
|
+
type: z9.literal("auth0"),
|
|
3913
|
+
clientId: z9.string(),
|
|
3914
|
+
domain: z9.string().refine(
|
|
3517
3915
|
(val) => {
|
|
3518
3916
|
if (val.startsWith("http://") || val.startsWith("https://")) {
|
|
3519
3917
|
return false;
|
|
@@ -3527,116 +3925,116 @@ var init_ZudokuConfig = __esm({
|
|
|
3527
3925
|
message: "Domain must be a host only (e.g., 'example.com') without protocol or slashes"
|
|
3528
3926
|
}
|
|
3529
3927
|
),
|
|
3530
|
-
audience:
|
|
3531
|
-
scopes:
|
|
3532
|
-
redirectToAfterSignUp:
|
|
3533
|
-
redirectToAfterSignIn:
|
|
3534
|
-
redirectToAfterSignOut:
|
|
3535
|
-
options:
|
|
3536
|
-
alwaysPromptLogin:
|
|
3537
|
-
prompt:
|
|
3928
|
+
audience: z9.string().optional(),
|
|
3929
|
+
scopes: z9.array(z9.string()).optional(),
|
|
3930
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3931
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3932
|
+
redirectToAfterSignOut: z9.string().optional(),
|
|
3933
|
+
options: z9.object({
|
|
3934
|
+
alwaysPromptLogin: z9.boolean().optional(),
|
|
3935
|
+
prompt: z9.string().optional()
|
|
3538
3936
|
}).optional()
|
|
3539
3937
|
}),
|
|
3540
|
-
|
|
3541
|
-
type:
|
|
3542
|
-
basePath:
|
|
3543
|
-
supabaseUrl:
|
|
3544
|
-
supabaseKey:
|
|
3545
|
-
provider:
|
|
3546
|
-
providers:
|
|
3547
|
-
onlyThirdPartyProviders:
|
|
3548
|
-
redirectToAfterSignUp:
|
|
3549
|
-
redirectToAfterSignIn:
|
|
3550
|
-
redirectToAfterSignOut:
|
|
3938
|
+
z9.object({
|
|
3939
|
+
type: z9.literal("supabase"),
|
|
3940
|
+
basePath: z9.string().optional(),
|
|
3941
|
+
supabaseUrl: z9.string(),
|
|
3942
|
+
supabaseKey: z9.string(),
|
|
3943
|
+
provider: z9.string().optional(),
|
|
3944
|
+
providers: z9.array(z9.string()).optional(),
|
|
3945
|
+
onlyThirdPartyProviders: z9.boolean().optional(),
|
|
3946
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3947
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3948
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3551
3949
|
}),
|
|
3552
|
-
|
|
3553
|
-
type:
|
|
3554
|
-
apiBaseUrl:
|
|
3555
|
-
redirectToAfterSignUp:
|
|
3556
|
-
redirectToAfterSignIn:
|
|
3557
|
-
redirectToAfterSignOut:
|
|
3950
|
+
z9.object({
|
|
3951
|
+
type: z9.literal("dev-portal"),
|
|
3952
|
+
apiBaseUrl: z9.string().optional(),
|
|
3953
|
+
redirectToAfterSignUp: z9.string().optional(),
|
|
3954
|
+
redirectToAfterSignIn: z9.string().optional(),
|
|
3955
|
+
redirectToAfterSignOut: z9.string().optional()
|
|
3558
3956
|
})
|
|
3559
3957
|
]);
|
|
3560
|
-
MetadataSchema =
|
|
3561
|
-
title:
|
|
3562
|
-
defaultTitle:
|
|
3563
|
-
description:
|
|
3564
|
-
logo:
|
|
3565
|
-
favicon:
|
|
3566
|
-
generator:
|
|
3567
|
-
applicationName:
|
|
3568
|
-
referrer:
|
|
3569
|
-
keywords:
|
|
3570
|
-
authors:
|
|
3571
|
-
creator:
|
|
3572
|
-
publisher:
|
|
3958
|
+
MetadataSchema = z9.object({
|
|
3959
|
+
title: z9.string(),
|
|
3960
|
+
defaultTitle: z9.string().optional(),
|
|
3961
|
+
description: z9.string(),
|
|
3962
|
+
logo: z9.string(),
|
|
3963
|
+
favicon: z9.string(),
|
|
3964
|
+
generator: z9.string(),
|
|
3965
|
+
applicationName: z9.string(),
|
|
3966
|
+
referrer: z9.string(),
|
|
3967
|
+
keywords: z9.array(z9.string()),
|
|
3968
|
+
authors: z9.array(z9.string()),
|
|
3969
|
+
creator: z9.string(),
|
|
3970
|
+
publisher: z9.string()
|
|
3573
3971
|
}).partial();
|
|
3574
|
-
FontConfigSchema =
|
|
3575
|
-
|
|
3576
|
-
|
|
3577
|
-
url:
|
|
3578
|
-
fontFamily:
|
|
3972
|
+
FontConfigSchema = z9.union([
|
|
3973
|
+
z9.enum(GOOGLE_FONTS),
|
|
3974
|
+
z9.object({
|
|
3975
|
+
url: z9.string(),
|
|
3976
|
+
fontFamily: z9.string().optional()
|
|
3579
3977
|
})
|
|
3580
3978
|
]);
|
|
3581
|
-
FontsConfigSchema =
|
|
3979
|
+
FontsConfigSchema = z9.object({
|
|
3582
3980
|
sans: FontConfigSchema.optional(),
|
|
3583
3981
|
serif: FontConfigSchema.optional(),
|
|
3584
3982
|
mono: FontConfigSchema.optional()
|
|
3585
3983
|
});
|
|
3586
|
-
CssObject =
|
|
3587
|
-
|
|
3588
|
-
|
|
3589
|
-
() =>
|
|
3590
|
-
|
|
3591
|
-
|
|
3592
|
-
|
|
3593
|
-
|
|
3984
|
+
CssObject = z9.record(
|
|
3985
|
+
z9.string(),
|
|
3986
|
+
z9.lazy(
|
|
3987
|
+
() => z9.union([
|
|
3988
|
+
z9.string(),
|
|
3989
|
+
z9.record(
|
|
3990
|
+
z9.string(),
|
|
3991
|
+
z9.union([z9.string(), z9.record(z9.string(), z9.string())])
|
|
3594
3992
|
)
|
|
3595
3993
|
])
|
|
3596
3994
|
)
|
|
3597
3995
|
);
|
|
3598
|
-
ThemeConfigSchema =
|
|
3599
|
-
registryUrl:
|
|
3600
|
-
customCss:
|
|
3996
|
+
ThemeConfigSchema = z9.object({
|
|
3997
|
+
registryUrl: z9.string().url().optional(),
|
|
3998
|
+
customCss: z9.union([z9.string(), CssObject]).optional(),
|
|
3601
3999
|
light: ThemeSchema.optional(),
|
|
3602
4000
|
dark: ThemeSchema.optional(),
|
|
3603
4001
|
fonts: FontsConfigSchema.optional(),
|
|
3604
|
-
noDefaultTheme:
|
|
4002
|
+
noDefaultTheme: z9.boolean().optional()
|
|
3605
4003
|
});
|
|
3606
|
-
SiteSchema =
|
|
3607
|
-
title:
|
|
3608
|
-
logoUrl:
|
|
3609
|
-
dir:
|
|
4004
|
+
SiteSchema = z9.object({
|
|
4005
|
+
title: z9.string(),
|
|
4006
|
+
logoUrl: z9.string(),
|
|
4007
|
+
dir: z9.enum(["ltr", "rtl"]).optional(),
|
|
3610
4008
|
logo: LogoSchema,
|
|
3611
|
-
banner:
|
|
3612
|
-
message:
|
|
3613
|
-
color:
|
|
4009
|
+
banner: z9.object({
|
|
4010
|
+
message: z9.custom(),
|
|
4011
|
+
color: z9.custom(
|
|
3614
4012
|
(val) => typeof val === "string"
|
|
3615
4013
|
).optional(),
|
|
3616
|
-
dismissible:
|
|
4014
|
+
dismissible: z9.boolean().optional()
|
|
3617
4015
|
}),
|
|
3618
4016
|
footer: FooterSchema
|
|
3619
4017
|
}).partial();
|
|
3620
|
-
PlacementPosition =
|
|
3621
|
-
HeaderConfigSchema =
|
|
4018
|
+
PlacementPosition = z9.enum(["start", "center", "end"]);
|
|
4019
|
+
HeaderConfigSchema = z9.object({
|
|
3622
4020
|
navigation: HeaderNavigationSchema,
|
|
3623
|
-
placements:
|
|
4021
|
+
placements: z9.object({
|
|
3624
4022
|
navigation: PlacementPosition,
|
|
3625
4023
|
search: PlacementPosition,
|
|
3626
|
-
auth:
|
|
4024
|
+
auth: z9.enum(["start", "center", "end", "navigation"])
|
|
3627
4025
|
}).partial().optional()
|
|
3628
4026
|
}).partial();
|
|
3629
|
-
ApiCatalogSchema =
|
|
3630
|
-
path:
|
|
3631
|
-
label:
|
|
3632
|
-
items:
|
|
3633
|
-
filterItems:
|
|
4027
|
+
ApiCatalogSchema = z9.object({
|
|
4028
|
+
path: z9.string(),
|
|
4029
|
+
label: z9.string(),
|
|
4030
|
+
items: z9.array(z9.string()).optional(),
|
|
4031
|
+
filterItems: z9.custom((val) => typeof val === "function").optional()
|
|
3634
4032
|
});
|
|
3635
|
-
CdnUrlSchema =
|
|
3636
|
-
|
|
3637
|
-
|
|
3638
|
-
base:
|
|
3639
|
-
media:
|
|
4033
|
+
CdnUrlSchema = z9.union([
|
|
4034
|
+
z9.string(),
|
|
4035
|
+
z9.object({
|
|
4036
|
+
base: z9.string().optional(),
|
|
4037
|
+
media: z9.string().optional()
|
|
3640
4038
|
})
|
|
3641
4039
|
]).transform((val) => {
|
|
3642
4040
|
if (typeof val === "string") {
|
|
@@ -3644,45 +4042,45 @@ var init_ZudokuConfig = __esm({
|
|
|
3644
4042
|
}
|
|
3645
4043
|
return { base: val.base, media: val.media };
|
|
3646
4044
|
}).optional();
|
|
3647
|
-
BaseConfigSchema =
|
|
3648
|
-
slots:
|
|
4045
|
+
BaseConfigSchema = z9.object({
|
|
4046
|
+
slots: z9.record(z9.string(), z9.custom()),
|
|
3649
4047
|
/**
|
|
3650
4048
|
* @deprecated Use `slots` instead
|
|
3651
4049
|
*/
|
|
3652
|
-
UNSAFE_slotlets:
|
|
3653
|
-
mdx:
|
|
3654
|
-
components:
|
|
4050
|
+
UNSAFE_slotlets: z9.record(z9.string(), z9.custom()),
|
|
4051
|
+
mdx: z9.object({
|
|
4052
|
+
components: z9.custom()
|
|
3655
4053
|
}).partial(),
|
|
3656
|
-
customPages:
|
|
3657
|
-
|
|
3658
|
-
path:
|
|
3659
|
-
element:
|
|
3660
|
-
render:
|
|
3661
|
-
prose:
|
|
4054
|
+
customPages: z9.array(
|
|
4055
|
+
z9.object({
|
|
4056
|
+
path: z9.string(),
|
|
4057
|
+
element: z9.custom().optional(),
|
|
4058
|
+
render: z9.custom().optional(),
|
|
4059
|
+
prose: z9.boolean().optional()
|
|
3662
4060
|
})
|
|
3663
4061
|
),
|
|
3664
|
-
plugins:
|
|
3665
|
-
build:
|
|
4062
|
+
plugins: z9.array(z9.custom()),
|
|
4063
|
+
build: z9.custom(),
|
|
3666
4064
|
protectedRoutes: ProtectedRoutesSchema,
|
|
3667
|
-
basePath:
|
|
3668
|
-
canonicalUrlOrigin:
|
|
4065
|
+
basePath: z9.string().optional(),
|
|
4066
|
+
canonicalUrlOrigin: z9.string().optional(),
|
|
3669
4067
|
cdnUrl: CdnUrlSchema.optional(),
|
|
3670
|
-
port:
|
|
3671
|
-
https:
|
|
3672
|
-
key:
|
|
3673
|
-
cert:
|
|
3674
|
-
ca:
|
|
4068
|
+
port: z9.number().optional(),
|
|
4069
|
+
https: z9.object({
|
|
4070
|
+
key: z9.string(),
|
|
4071
|
+
cert: z9.string(),
|
|
4072
|
+
ca: z9.string().optional()
|
|
3675
4073
|
}).optional(),
|
|
3676
4074
|
site: SiteSchema,
|
|
3677
4075
|
header: HeaderConfigSchema.optional(),
|
|
3678
4076
|
navigation: InputNavigationSchema,
|
|
3679
4077
|
navigationRules: NavigationRulesSchema.optional(),
|
|
3680
4078
|
theme: ThemeConfigSchema,
|
|
3681
|
-
syntaxHighlighting:
|
|
3682
|
-
languages:
|
|
3683
|
-
themes:
|
|
3684
|
-
light:
|
|
3685
|
-
dark:
|
|
4079
|
+
syntaxHighlighting: z9.object({
|
|
4080
|
+
languages: z9.array(z9.custom()),
|
|
4081
|
+
themes: z9.object({
|
|
4082
|
+
light: z9.custom(),
|
|
4083
|
+
dark: z9.custom()
|
|
3686
4084
|
})
|
|
3687
4085
|
}).partial().optional(),
|
|
3688
4086
|
metadata: MetadataSchema,
|
|
@@ -3690,22 +4088,22 @@ var init_ZudokuConfig = __esm({
|
|
|
3690
4088
|
search: SearchSchema,
|
|
3691
4089
|
docs: DocsConfigSchema.optional(),
|
|
3692
4090
|
modules: ModulesSchema,
|
|
3693
|
-
apis:
|
|
3694
|
-
catalogs:
|
|
4091
|
+
apis: z9.union([ApiSchema, z9.array(ApiSchema)]),
|
|
4092
|
+
catalogs: z9.union([ApiCatalogSchema, z9.array(ApiCatalogSchema)]),
|
|
3695
4093
|
apiKeys: ApiKeysSchema,
|
|
3696
4094
|
aiAssistants: AiAssistantsSchema,
|
|
3697
|
-
redirects:
|
|
4095
|
+
redirects: z9.array(Redirect),
|
|
3698
4096
|
sitemap: SiteMapSchema,
|
|
3699
|
-
enableStatusPages:
|
|
3700
|
-
defaults:
|
|
4097
|
+
enableStatusPages: z9.boolean().optional(),
|
|
4098
|
+
defaults: z9.object({
|
|
3701
4099
|
apis: ApiOptionsSchema,
|
|
3702
4100
|
/**
|
|
3703
4101
|
* @deprecated Use `apis.examplesLanguage` or `defaults.apis.examplesLanguage` instead
|
|
3704
4102
|
*/
|
|
3705
|
-
examplesLanguage:
|
|
4103
|
+
examplesLanguage: z9.string().optional()
|
|
3706
4104
|
}),
|
|
3707
4105
|
// Internal: populated by plugins via `transformConfig` to track plugin directories
|
|
3708
|
-
__pluginDirs:
|
|
4106
|
+
__pluginDirs: z9.array(z9.string())
|
|
3709
4107
|
});
|
|
3710
4108
|
ZudokuConfig = BaseConfigSchema.partial();
|
|
3711
4109
|
}
|
|
@@ -3713,7 +4111,7 @@ var init_ZudokuConfig = __esm({
|
|
|
3713
4111
|
|
|
3714
4112
|
// src/config/loader.ts
|
|
3715
4113
|
import { stat as stat2 } from "node:fs/promises";
|
|
3716
|
-
import
|
|
4114
|
+
import path5 from "node:path";
|
|
3717
4115
|
import colors2 from "picocolors";
|
|
3718
4116
|
import {
|
|
3719
4117
|
runnerImport,
|
|
@@ -3721,7 +4119,7 @@ import {
|
|
|
3721
4119
|
} from "vite";
|
|
3722
4120
|
async function getConfigFilePath(rootDir) {
|
|
3723
4121
|
for (const fileName of zudokuConfigFiles) {
|
|
3724
|
-
const filepath =
|
|
4122
|
+
const filepath = path5.join(rootDir, fileName);
|
|
3725
4123
|
if (await fileExists(filepath)) {
|
|
3726
4124
|
return filepath;
|
|
3727
4125
|
}
|
|
@@ -3791,8 +4189,16 @@ function isWatchableConfigDependency(depPath) {
|
|
|
3791
4189
|
return !depPath.startsWith("\0virtual:") && !depPath.startsWith("virtual:");
|
|
3792
4190
|
}
|
|
3793
4191
|
function getWatchableConfigDependencies(config2) {
|
|
4192
|
+
const manifestEnv = resolveManifestEnv(
|
|
4193
|
+
config2.__meta.mode === "production" ? "production" : "development"
|
|
4194
|
+
);
|
|
4195
|
+
const { watchPaths } = manifestPathsForEnv(
|
|
4196
|
+
config2.__meta.rootDir,
|
|
4197
|
+
manifestEnv
|
|
4198
|
+
);
|
|
3794
4199
|
return [
|
|
3795
4200
|
config2.__meta.configPath,
|
|
4201
|
+
...watchPaths,
|
|
3796
4202
|
...config2.__meta.dependencies.filter(isWatchableConfigDependency)
|
|
3797
4203
|
];
|
|
3798
4204
|
}
|
|
@@ -3802,6 +4208,9 @@ async function hasConfigChanged() {
|
|
|
3802
4208
|
try {
|
|
3803
4209
|
const hasChanged = await Promise.all(
|
|
3804
4210
|
files.map(async (depPath) => {
|
|
4211
|
+
if (!await fileExists(depPath)) {
|
|
4212
|
+
return false;
|
|
4213
|
+
}
|
|
3805
4214
|
const depStat = await stat2(depPath);
|
|
3806
4215
|
const cachedMtime = modifiedTimes?.get(depPath);
|
|
3807
4216
|
return !cachedMtime || depStat.mtimeMs !== cachedMtime;
|
|
@@ -3818,6 +4227,9 @@ async function updateModifiedTimes() {
|
|
|
3818
4227
|
modifiedTimes = /* @__PURE__ */ new Map();
|
|
3819
4228
|
await Promise.all(
|
|
3820
4229
|
files.map(async (depPath) => {
|
|
4230
|
+
if (!await fileExists(depPath)) {
|
|
4231
|
+
return;
|
|
4232
|
+
}
|
|
3821
4233
|
const depStat = await stat2(depPath);
|
|
3822
4234
|
modifiedTimes?.set(depPath, depStat.mtimeMs);
|
|
3823
4235
|
})
|
|
@@ -3831,7 +4243,19 @@ async function loadZudokuConfig(configEnv, rootDir) {
|
|
|
3831
4243
|
({ publicEnv, envPrefix } = loadEnv(configEnv, rootDir));
|
|
3832
4244
|
try {
|
|
3833
4245
|
const loadedConfig = await loadZudokuConfigWithMeta(rootDir);
|
|
3834
|
-
const
|
|
4246
|
+
const manifestEnv = resolveManifestEnv(configEnv.mode);
|
|
4247
|
+
const manifest = await readEffectiveManifest(rootDir, manifestEnv);
|
|
4248
|
+
const configWithManifestMeta = {
|
|
4249
|
+
...loadedConfig,
|
|
4250
|
+
__meta: {
|
|
4251
|
+
...loadedConfig.__meta,
|
|
4252
|
+
pricingEnabled: isPricingEnabled(manifest),
|
|
4253
|
+
authenticationEnabled: isAuthenticationEnabled(manifest)
|
|
4254
|
+
}
|
|
4255
|
+
};
|
|
4256
|
+
const transformedConfig = applyAuthenticationHeaderNav(
|
|
4257
|
+
await runPluginTransformConfig(configWithManifestMeta)
|
|
4258
|
+
);
|
|
3835
4259
|
config = {
|
|
3836
4260
|
...transformedConfig,
|
|
3837
4261
|
__resolvedModules: resolveModulesConfig(transformedConfig)
|
|
@@ -3858,9 +4282,11 @@ var init_loader = __esm({
|
|
|
3858
4282
|
"src/config/loader.ts"() {
|
|
3859
4283
|
init_logger();
|
|
3860
4284
|
init_package_json();
|
|
4285
|
+
init_auth_header_nav();
|
|
3861
4286
|
init_transform_config();
|
|
3862
4287
|
init_invariant();
|
|
3863
4288
|
init_file_exists();
|
|
4289
|
+
init_local_manifest();
|
|
3864
4290
|
init_resolve_modules();
|
|
3865
4291
|
init_ZudokuConfig();
|
|
3866
4292
|
zudokuConfigFiles = [
|
|
@@ -3898,7 +4324,7 @@ __export(llms_exports, {
|
|
|
3898
4324
|
generateLlmsTxtFiles: () => generateLlmsTxtFiles
|
|
3899
4325
|
});
|
|
3900
4326
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
3901
|
-
import
|
|
4327
|
+
import path26 from "node:path";
|
|
3902
4328
|
import colors6 from "picocolors";
|
|
3903
4329
|
async function generateLlmsTxtFiles({
|
|
3904
4330
|
markdownFileInfos,
|
|
@@ -3933,7 +4359,7 @@ async function generateLlmsTxtFiles({
|
|
|
3933
4359
|
}
|
|
3934
4360
|
}
|
|
3935
4361
|
const llmsTxt2 = llmsTxtParts.join("\n");
|
|
3936
|
-
await writeFile4(
|
|
4362
|
+
await writeFile4(path26.join(baseOutputDir, "llms.txt"), llmsTxt2, "utf-8");
|
|
3937
4363
|
if (process.env.APITOGO_JSON_ONLY !== "1") {
|
|
3938
4364
|
console.log(colors6.blue("\u2713 generated llms.txt"));
|
|
3939
4365
|
}
|
|
@@ -3961,7 +4387,7 @@ ${info.content}
|
|
|
3961
4387
|
}
|
|
3962
4388
|
const llmsFull = llmsFullParts.join("\n");
|
|
3963
4389
|
await writeFile4(
|
|
3964
|
-
|
|
4390
|
+
path26.join(baseOutputDir, "llms-full.txt"),
|
|
3965
4391
|
llmsFull,
|
|
3966
4392
|
"utf-8"
|
|
3967
4393
|
);
|
|
@@ -3982,11 +4408,11 @@ import { hideBin } from "yargs/helpers";
|
|
|
3982
4408
|
import yargs from "yargs/yargs";
|
|
3983
4409
|
|
|
3984
4410
|
// src/cli/build/handler.ts
|
|
3985
|
-
import
|
|
4411
|
+
import path30 from "node:path";
|
|
3986
4412
|
|
|
3987
4413
|
// src/vite/build.ts
|
|
3988
4414
|
import { mkdir as mkdir5, readFile as readFile4, rename, rm as rm2, writeFile as writeFile5 } from "node:fs/promises";
|
|
3989
|
-
import
|
|
4415
|
+
import path28 from "node:path";
|
|
3990
4416
|
import { build as esbuild } from "esbuild";
|
|
3991
4417
|
import { build as viteBuild, mergeConfig as mergeConfig3 } from "vite";
|
|
3992
4418
|
|
|
@@ -4122,7 +4548,7 @@ init_invariant();
|
|
|
4122
4548
|
init_joinUrl();
|
|
4123
4549
|
|
|
4124
4550
|
// src/vite/config.ts
|
|
4125
|
-
import
|
|
4551
|
+
import path23 from "node:path";
|
|
4126
4552
|
import dotenv from "dotenv";
|
|
4127
4553
|
import colors4 from "picocolors";
|
|
4128
4554
|
import {
|
|
@@ -4133,7 +4559,7 @@ import {
|
|
|
4133
4559
|
// package.json
|
|
4134
4560
|
var package_default = {
|
|
4135
4561
|
name: "@lukoweb/apitogo",
|
|
4136
|
-
version: "0.1.
|
|
4562
|
+
version: "0.1.51",
|
|
4137
4563
|
type: "module",
|
|
4138
4564
|
sideEffects: [
|
|
4139
4565
|
"**/*.css",
|
|
@@ -4202,7 +4628,9 @@ var package_default = {
|
|
|
4202
4628
|
"./processors/*": "./src/lib/plugins/openapi/processors/*.ts",
|
|
4203
4629
|
"./with-zuplo": "./src/zuplo/with-zuplo.ts",
|
|
4204
4630
|
"./testing": "./src/lib/testing/index.tsx",
|
|
4205
|
-
"./local-manifest": "./src/config/local-manifest.ts"
|
|
4631
|
+
"./local-manifest": "./src/config/local-manifest.ts",
|
|
4632
|
+
"./build-config": "./src/config/build-apitogo-config.ts",
|
|
4633
|
+
"./config-loader": "./src/config/apitogo-config-loader.ts"
|
|
4206
4634
|
},
|
|
4207
4635
|
scripts: {
|
|
4208
4636
|
build: "esbuild src/cli/cli.ts src/vite/prerender/worker.ts --outdir=dist/cli --entry-names=[name] --bundle --format=esm --packages=external --target=node20 --platform=node --log-level=error",
|
|
@@ -4516,6 +4944,14 @@ var package_default = {
|
|
|
4516
4944
|
"./local-manifest": {
|
|
4517
4945
|
types: "./dist/declarations/config/local-manifest.d.ts",
|
|
4518
4946
|
default: "./src/config/local-manifest.ts"
|
|
4947
|
+
},
|
|
4948
|
+
"./build-config": {
|
|
4949
|
+
types: "./dist/declarations/config/build-apitogo-config.d.ts",
|
|
4950
|
+
default: "./src/config/build-apitogo-config.ts"
|
|
4951
|
+
},
|
|
4952
|
+
"./config-loader": {
|
|
4953
|
+
types: "./dist/declarations/config/apitogo-config-loader.d.ts",
|
|
4954
|
+
default: "./src/config/apitogo-config-loader.ts"
|
|
4519
4955
|
}
|
|
4520
4956
|
}
|
|
4521
4957
|
}
|
|
@@ -4542,24 +4978,24 @@ async function loadDevPortalViteDefines(rootDir, mode) {
|
|
|
4542
4978
|
|
|
4543
4979
|
// src/vite/package-root.ts
|
|
4544
4980
|
init_file_exists();
|
|
4545
|
-
import
|
|
4981
|
+
import path6 from "node:path";
|
|
4546
4982
|
var findPackageRoot = async (startDir) => {
|
|
4547
4983
|
let dir = startDir;
|
|
4548
|
-
while (dir !==
|
|
4549
|
-
if (await fileExists(
|
|
4550
|
-
dir =
|
|
4984
|
+
while (dir !== path6.dirname(dir)) {
|
|
4985
|
+
if (await fileExists(path6.join(dir, "package.json"))) return dir;
|
|
4986
|
+
dir = path6.dirname(dir);
|
|
4551
4987
|
}
|
|
4552
4988
|
};
|
|
4553
4989
|
|
|
4554
4990
|
// src/vite/pagefind-dev-stub.ts
|
|
4555
4991
|
import fs from "node:fs/promises";
|
|
4556
|
-
import
|
|
4992
|
+
import path7 from "node:path";
|
|
4557
4993
|
var NOT_BUILT_YET = 'throw new Error("NOT_BUILT_YET");';
|
|
4558
4994
|
async function ensurePagefindDevStub(publicDir) {
|
|
4559
|
-
const pagefindPath =
|
|
4995
|
+
const pagefindPath = path7.join(publicDir, "pagefind/pagefind.js");
|
|
4560
4996
|
const exists = await fs.stat(pagefindPath).catch(() => false);
|
|
4561
4997
|
if (!exists) {
|
|
4562
|
-
await fs.mkdir(
|
|
4998
|
+
await fs.mkdir(path7.dirname(pagefindPath), { recursive: true });
|
|
4563
4999
|
await fs.writeFile(pagefindPath, NOT_BUILT_YET);
|
|
4564
5000
|
}
|
|
4565
5001
|
}
|
|
@@ -4571,7 +5007,7 @@ import react from "@vitejs/plugin-react";
|
|
|
4571
5007
|
// src/vite/css/plugin.ts
|
|
4572
5008
|
init_loader();
|
|
4573
5009
|
init_plugin_theme();
|
|
4574
|
-
import
|
|
5010
|
+
import path8 from "node:path";
|
|
4575
5011
|
import { isCSSRequest as isCSSRequest2 } from "vite";
|
|
4576
5012
|
|
|
4577
5013
|
// src/vite/css/collect.ts
|
|
@@ -4606,7 +5042,7 @@ var VIRTUAL_ENTRY = "virtual:ssr-css.css";
|
|
|
4606
5042
|
function vitePluginSsrCss(pluginOpts) {
|
|
4607
5043
|
let server;
|
|
4608
5044
|
const config2 = getCurrentConfig();
|
|
4609
|
-
const virtualHref =
|
|
5045
|
+
const virtualHref = path8.join(
|
|
4610
5046
|
config2.basePath ?? "",
|
|
4611
5047
|
`/@id/__x00__${VIRTUAL_ENTRY}?direct`
|
|
4612
5048
|
);
|
|
@@ -4743,7 +5179,7 @@ var plugin_api_keys_default = viteApiKeysPlugin;
|
|
|
4743
5179
|
|
|
4744
5180
|
// src/vite/plugin-api.ts
|
|
4745
5181
|
import fs3 from "node:fs/promises";
|
|
4746
|
-
import
|
|
5182
|
+
import path14 from "node:path";
|
|
4747
5183
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
4748
5184
|
import { runnerImport as runnerImport3 } from "vite";
|
|
4749
5185
|
init_package_json();
|
|
@@ -4752,20 +5188,20 @@ init_loader();
|
|
|
4752
5188
|
// src/config/validators/BuildSchema.ts
|
|
4753
5189
|
init_file_exists();
|
|
4754
5190
|
init_loader();
|
|
4755
|
-
import
|
|
5191
|
+
import path9 from "node:path";
|
|
4756
5192
|
import { runnerImport as runnerImport2 } from "vite";
|
|
4757
|
-
import { z as
|
|
4758
|
-
var BuildProcessorSchema =
|
|
4759
|
-
var PluginConfigSchema =
|
|
4760
|
-
|
|
5193
|
+
import { z as z10 } from "zod";
|
|
5194
|
+
var BuildProcessorSchema = z10.custom((val) => typeof val === "function");
|
|
5195
|
+
var PluginConfigSchema = z10.custom().or(
|
|
5196
|
+
z10.custom(
|
|
4761
5197
|
(val) => typeof val === "function"
|
|
4762
5198
|
)
|
|
4763
5199
|
);
|
|
4764
|
-
var BuildConfigSchema2 =
|
|
4765
|
-
processors:
|
|
5200
|
+
var BuildConfigSchema2 = z10.object({
|
|
5201
|
+
processors: z10.array(BuildProcessorSchema).optional(),
|
|
4766
5202
|
remarkPlugins: PluginConfigSchema.optional(),
|
|
4767
5203
|
rehypePlugins: PluginConfigSchema.optional(),
|
|
4768
|
-
prerender:
|
|
5204
|
+
prerender: z10.object({ workers: z10.number().optional() }).optional()
|
|
4769
5205
|
});
|
|
4770
5206
|
var buildConfigFiles = [
|
|
4771
5207
|
"apitogo.build.js",
|
|
@@ -4781,7 +5217,7 @@ var buildConfigFiles = [
|
|
|
4781
5217
|
];
|
|
4782
5218
|
async function getBuildConfigFilePath(rootDir) {
|
|
4783
5219
|
for (const fileName of buildConfigFiles) {
|
|
4784
|
-
const filepath =
|
|
5220
|
+
const filepath = path9.join(rootDir, fileName);
|
|
4785
5221
|
if (await fileExists(filepath)) {
|
|
4786
5222
|
return filepath;
|
|
4787
5223
|
}
|
|
@@ -4803,10 +5239,10 @@ function validateBuildConfig(config2) {
|
|
|
4803
5239
|
const validationResult = BuildConfigSchema2.safeParse(config2);
|
|
4804
5240
|
if (!validationResult.success) {
|
|
4805
5241
|
if (process.env.NODE_ENV === "production") {
|
|
4806
|
-
throw new Error(
|
|
5242
|
+
throw new Error(z10.prettifyError(validationResult.error));
|
|
4807
5243
|
}
|
|
4808
5244
|
console.warn("Build config validation errors:");
|
|
4809
|
-
console.warn(
|
|
5245
|
+
console.warn(z10.prettifyError(validationResult.error));
|
|
4810
5246
|
return;
|
|
4811
5247
|
}
|
|
4812
5248
|
return validationResult.data;
|
|
@@ -4890,14 +5326,14 @@ var flattenAllOf = (schema2) => {
|
|
|
4890
5326
|
};
|
|
4891
5327
|
|
|
4892
5328
|
// src/lib/util/traverse.ts
|
|
4893
|
-
var traverse = (specification, transform,
|
|
4894
|
-
const transformed = transform(specification,
|
|
5329
|
+
var traverse = (specification, transform, path39 = []) => {
|
|
5330
|
+
const transformed = transform(specification, path39);
|
|
4895
5331
|
if (typeof transformed !== "object" || transformed === null) {
|
|
4896
5332
|
return transformed;
|
|
4897
5333
|
}
|
|
4898
5334
|
const result = Array.isArray(transformed) ? [] : {};
|
|
4899
5335
|
for (const [key, value] of Object.entries(transformed)) {
|
|
4900
|
-
const currentPath = [...
|
|
5336
|
+
const currentPath = [...path39, key];
|
|
4901
5337
|
if (Array.isArray(value)) {
|
|
4902
5338
|
result[key] = value.map(
|
|
4903
5339
|
(item, index) => typeof item === "object" && item != null ? traverse(item, transform, [...currentPath, index.toString()]) : item
|
|
@@ -4925,9 +5361,9 @@ var resolveLocalRef = (schema2, ref) => {
|
|
|
4925
5361
|
if (schemaCache?.has(ref)) {
|
|
4926
5362
|
return schemaCache.get(ref);
|
|
4927
5363
|
}
|
|
4928
|
-
const
|
|
5364
|
+
const path39 = ref.split("/").slice(1);
|
|
4929
5365
|
let current = schema2;
|
|
4930
|
-
for (const segment of
|
|
5366
|
+
for (const segment of path39) {
|
|
4931
5367
|
if (!current || typeof current !== "object") {
|
|
4932
5368
|
current = null;
|
|
4933
5369
|
}
|
|
@@ -4946,7 +5382,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4946
5382
|
}
|
|
4947
5383
|
const cloned = structuredClone(schema2);
|
|
4948
5384
|
const visited = /* @__PURE__ */ new Set();
|
|
4949
|
-
const resolve = async (current,
|
|
5385
|
+
const resolve = async (current, path39) => {
|
|
4950
5386
|
if (isIndexableObject(current)) {
|
|
4951
5387
|
if (visited.has(current)) {
|
|
4952
5388
|
return CIRCULAR_REF;
|
|
@@ -4954,7 +5390,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4954
5390
|
visited.add(current);
|
|
4955
5391
|
if (Array.isArray(current)) {
|
|
4956
5392
|
for (let index = 0; index < current.length; index++) {
|
|
4957
|
-
current[index] = await resolve(current[index], `${
|
|
5393
|
+
current[index] = await resolve(current[index], `${path39}/${index}`);
|
|
4958
5394
|
}
|
|
4959
5395
|
} else {
|
|
4960
5396
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
@@ -4965,13 +5401,13 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4965
5401
|
for (const resolver of resolvers) {
|
|
4966
5402
|
const resolved = await resolver($ref);
|
|
4967
5403
|
if (resolved) {
|
|
4968
|
-
result2 = await resolve(resolved,
|
|
5404
|
+
result2 = await resolve(resolved, path39);
|
|
4969
5405
|
break;
|
|
4970
5406
|
}
|
|
4971
5407
|
}
|
|
4972
5408
|
if (result2 === void 0) {
|
|
4973
5409
|
const resolved = await resolveLocalRef(cloned, $ref);
|
|
4974
|
-
result2 = await resolve(resolved,
|
|
5410
|
+
result2 = await resolve(resolved, path39);
|
|
4975
5411
|
}
|
|
4976
5412
|
if (hasSiblings) {
|
|
4977
5413
|
if (result2 === CIRCULAR_REF) {
|
|
@@ -4984,7 +5420,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4984
5420
|
return result2;
|
|
4985
5421
|
}
|
|
4986
5422
|
for (const key in current) {
|
|
4987
|
-
current[key] = await resolve(current[key], `${
|
|
5423
|
+
current[key] = await resolve(current[key], `${path39}/${key}`);
|
|
4988
5424
|
}
|
|
4989
5425
|
}
|
|
4990
5426
|
visited.delete(current);
|
|
@@ -5023,9 +5459,9 @@ var upgradeSchema = (schema2) => {
|
|
|
5023
5459
|
}
|
|
5024
5460
|
return sub;
|
|
5025
5461
|
});
|
|
5026
|
-
schema2 = traverse(schema2, (sub,
|
|
5462
|
+
schema2 = traverse(schema2, (sub, path39) => {
|
|
5027
5463
|
if (sub.example !== void 0) {
|
|
5028
|
-
if (isSchemaPath(
|
|
5464
|
+
if (isSchemaPath(path39 ?? [])) {
|
|
5029
5465
|
sub.examples = [sub.example];
|
|
5030
5466
|
} else {
|
|
5031
5467
|
sub.examples = {
|
|
@@ -5038,11 +5474,11 @@ var upgradeSchema = (schema2) => {
|
|
|
5038
5474
|
}
|
|
5039
5475
|
return sub;
|
|
5040
5476
|
});
|
|
5041
|
-
schema2 = traverse(schema2, (schema3,
|
|
5477
|
+
schema2 = traverse(schema2, (schema3, path39) => {
|
|
5042
5478
|
if (schema3.type === "object" && schema3.properties !== void 0) {
|
|
5043
|
-
const parentPath =
|
|
5479
|
+
const parentPath = path39?.slice(0, -1);
|
|
5044
5480
|
const isMultipart = parentPath?.some((segment, index) => {
|
|
5045
|
-
return segment === "content" &&
|
|
5481
|
+
return segment === "content" && path39?.[index + 1] === "multipart/form-data";
|
|
5046
5482
|
});
|
|
5047
5483
|
if (isMultipart) {
|
|
5048
5484
|
const entries = Object.entries(schema3.properties);
|
|
@@ -5056,8 +5492,8 @@ var upgradeSchema = (schema2) => {
|
|
|
5056
5492
|
}
|
|
5057
5493
|
return schema3;
|
|
5058
5494
|
});
|
|
5059
|
-
schema2 = traverse(schema2, (schema3,
|
|
5060
|
-
if (
|
|
5495
|
+
schema2 = traverse(schema2, (schema3, path39) => {
|
|
5496
|
+
if (path39?.includes("content") && path39.includes("application/octet-stream")) {
|
|
5061
5497
|
return {};
|
|
5062
5498
|
}
|
|
5063
5499
|
if (schema3.type === "string" && schema3.format === "binary") {
|
|
@@ -5083,11 +5519,11 @@ var upgradeSchema = (schema2) => {
|
|
|
5083
5519
|
}
|
|
5084
5520
|
return sub;
|
|
5085
5521
|
});
|
|
5086
|
-
schema2 = traverse(schema2, (schema3,
|
|
5522
|
+
schema2 = traverse(schema2, (schema3, path39) => {
|
|
5087
5523
|
if (schema3.type === "string" && schema3.format === "byte") {
|
|
5088
|
-
const parentPath =
|
|
5524
|
+
const parentPath = path39?.slice(0, -1);
|
|
5089
5525
|
const contentMediaType = parentPath?.find(
|
|
5090
|
-
(_, index) =>
|
|
5526
|
+
(_, index) => path39?.[index - 1] === "content"
|
|
5091
5527
|
);
|
|
5092
5528
|
return {
|
|
5093
5529
|
type: "string",
|
|
@@ -5099,7 +5535,7 @@ var upgradeSchema = (schema2) => {
|
|
|
5099
5535
|
});
|
|
5100
5536
|
return schema2;
|
|
5101
5537
|
};
|
|
5102
|
-
function isSchemaPath(
|
|
5538
|
+
function isSchemaPath(path39) {
|
|
5103
5539
|
const schemaLocations = [
|
|
5104
5540
|
["components", "schemas"],
|
|
5105
5541
|
"properties",
|
|
@@ -5112,10 +5548,10 @@ function isSchemaPath(path38) {
|
|
|
5112
5548
|
];
|
|
5113
5549
|
return schemaLocations.some((location) => {
|
|
5114
5550
|
if (Array.isArray(location)) {
|
|
5115
|
-
return location.every((segment, index) =>
|
|
5551
|
+
return location.every((segment, index) => path39[index] === segment);
|
|
5116
5552
|
}
|
|
5117
|
-
return
|
|
5118
|
-
}) ||
|
|
5553
|
+
return path39.includes(location);
|
|
5554
|
+
}) || path39.includes("schema") || path39.some((segment) => segment.endsWith("Schema"));
|
|
5119
5555
|
}
|
|
5120
5556
|
|
|
5121
5557
|
// src/lib/oas/parser/index.ts
|
|
@@ -5197,13 +5633,13 @@ var OPENAPI_PROPS = /* @__PURE__ */ new Set([
|
|
|
5197
5633
|
"anyOf",
|
|
5198
5634
|
"oneOf"
|
|
5199
5635
|
]);
|
|
5200
|
-
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(),
|
|
5636
|
+
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path39 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
|
|
5201
5637
|
if (obj === null || typeof obj !== "object") return obj;
|
|
5202
5638
|
const refPath = obj.__$ref;
|
|
5203
5639
|
const isCircular = currentPath.has(obj) || typeof refPath === "string" && currentRefPaths.has(refPath);
|
|
5204
5640
|
if (isCircular) {
|
|
5205
5641
|
if (typeof refPath === "string") return SCHEMA_REF_PREFIX + refPath;
|
|
5206
|
-
const circularProp =
|
|
5642
|
+
const circularProp = path39.find((p) => !OPENAPI_PROPS.has(p)) || path39[0];
|
|
5207
5643
|
return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
|
|
5208
5644
|
}
|
|
5209
5645
|
if (refs.has(obj)) return refs.get(obj);
|
|
@@ -5213,7 +5649,7 @@ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs
|
|
|
5213
5649
|
value,
|
|
5214
5650
|
currentPath,
|
|
5215
5651
|
refs,
|
|
5216
|
-
[...
|
|
5652
|
+
[...path39, key],
|
|
5217
5653
|
currentRefPaths
|
|
5218
5654
|
);
|
|
5219
5655
|
const result = Array.isArray(obj) ? obj.map((item, i) => recurse(item, i.toString())) : Object.fromEntries(
|
|
@@ -5248,7 +5684,7 @@ var resolveExtensions = (obj) => Object.fromEntries(
|
|
|
5248
5684
|
var getAllTags = (schema2) => {
|
|
5249
5685
|
const rootTags = schema2.tags ?? [];
|
|
5250
5686
|
const operations = Object.values(schema2.paths ?? {}).flatMap(
|
|
5251
|
-
(
|
|
5687
|
+
(path39) => HttpMethods.map((k) => path39?.[k]).filter((op) => op != null)
|
|
5252
5688
|
);
|
|
5253
5689
|
const operationTags = new Set(operations.flatMap((op) => op.tags ?? []));
|
|
5254
5690
|
const hasUntaggedOperations = operations.some(
|
|
@@ -5303,7 +5739,7 @@ var getAllSlugs = (ops, schemaTags = []) => {
|
|
|
5303
5739
|
var getOperationSlugKey = (op) => [op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
|
|
5304
5740
|
var getAllOperations = (paths) => {
|
|
5305
5741
|
const operations = Object.entries(paths ?? {}).flatMap(
|
|
5306
|
-
([
|
|
5742
|
+
([path39, value]) => HttpMethods.flatMap((method) => {
|
|
5307
5743
|
if (!value?.[method]) return [];
|
|
5308
5744
|
const operation = value[method];
|
|
5309
5745
|
const pathParameters = value.parameters ?? [];
|
|
@@ -5323,7 +5759,7 @@ var getAllOperations = (paths) => {
|
|
|
5323
5759
|
return {
|
|
5324
5760
|
...operation,
|
|
5325
5761
|
method,
|
|
5326
|
-
path:
|
|
5762
|
+
path: path39,
|
|
5327
5763
|
parameters,
|
|
5328
5764
|
servers,
|
|
5329
5765
|
tags: operation.tags ?? []
|
|
@@ -5681,8 +6117,8 @@ var Schema = builder.objectRef("Schema").implement({
|
|
|
5681
6117
|
}),
|
|
5682
6118
|
paths: t.field({
|
|
5683
6119
|
type: [PathItem],
|
|
5684
|
-
resolve: (root) => Object.entries(root.paths ?? {}).map(([
|
|
5685
|
-
path:
|
|
6120
|
+
resolve: (root) => Object.entries(root.paths ?? {}).map(([path39, value]) => ({
|
|
6121
|
+
path: path39,
|
|
5686
6122
|
// biome-ignore lint/style/noNonNullAssertion: value is guaranteed to be defined
|
|
5687
6123
|
methods: Object.keys(value)
|
|
5688
6124
|
}))
|
|
@@ -5777,7 +6213,7 @@ var ensureArray = (value) => Array.isArray(value) ? value : [value];
|
|
|
5777
6213
|
|
|
5778
6214
|
// src/vite/api/SchemaManager.ts
|
|
5779
6215
|
import fs2 from "node:fs/promises";
|
|
5780
|
-
import
|
|
6216
|
+
import path10 from "node:path";
|
|
5781
6217
|
import {
|
|
5782
6218
|
$RefParser as $RefParser2
|
|
5783
6219
|
} from "@apidevtools/json-schema-ref-parser";
|
|
@@ -5829,7 +6265,7 @@ init_joinUrl();
|
|
|
5829
6265
|
|
|
5830
6266
|
// src/vite/api/schema-codegen.ts
|
|
5831
6267
|
var unescapeJsonPointer = (uri) => decodeURIComponent(uri.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
5832
|
-
var getSegmentsFromPath = (
|
|
6268
|
+
var getSegmentsFromPath = (path39) => path39.split("/").slice(1).map(unescapeJsonPointer);
|
|
5833
6269
|
var createLocalRefMap = (obj) => {
|
|
5834
6270
|
const refMap = /* @__PURE__ */ new Map();
|
|
5835
6271
|
const siblingsMap = /* @__PURE__ */ new Map();
|
|
@@ -5860,16 +6296,16 @@ var replaceMarkers = (code, mergedRefs) => code.replace(/"__refMap:(.*?)"/g, '__
|
|
|
5860
6296
|
/"__refMap\+Siblings:(.*?)"/g,
|
|
5861
6297
|
(_, key) => mergedRefs.get(key) ?? `__refMap["${key}"]`
|
|
5862
6298
|
);
|
|
5863
|
-
var lookup = (schema2,
|
|
5864
|
-
const parts = getSegmentsFromPath(
|
|
6299
|
+
var lookup = (schema2, path39, filePath) => {
|
|
6300
|
+
const parts = getSegmentsFromPath(path39);
|
|
5865
6301
|
let val = schema2;
|
|
5866
6302
|
for (const part of parts) {
|
|
5867
6303
|
while (val.$ref?.startsWith("#/")) {
|
|
5868
|
-
val = val.$ref ===
|
|
6304
|
+
val = val.$ref === path39 ? val : lookup(schema2, val.$ref, filePath);
|
|
5869
6305
|
}
|
|
5870
6306
|
if (val[part] === void 0) {
|
|
5871
6307
|
throw new Error(
|
|
5872
|
-
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${
|
|
6308
|
+
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path39}`
|
|
5873
6309
|
);
|
|
5874
6310
|
}
|
|
5875
6311
|
val = val[part];
|
|
@@ -5967,18 +6403,18 @@ var SchemaManager = class {
|
|
|
5967
6403
|
];
|
|
5968
6404
|
}
|
|
5969
6405
|
getPathForFile = (input, params) => {
|
|
5970
|
-
const filePath =
|
|
6406
|
+
const filePath = path10.resolve(this.config.__meta.rootDir, input);
|
|
5971
6407
|
const apis = ensureArray(this.config.apis ?? []);
|
|
5972
6408
|
for (const apiConfig of apis) {
|
|
5973
6409
|
if (!apiConfig || apiConfig.type !== "file" || !apiConfig.path) continue;
|
|
5974
6410
|
const match = normalizeInputs(apiConfig.input).some(
|
|
5975
|
-
(i) =>
|
|
6411
|
+
(i) => path10.resolve(this.config.__meta.rootDir, i.input) === filePath && deepEqual(i.params, params)
|
|
5976
6412
|
);
|
|
5977
6413
|
if (match) return apiConfig.path;
|
|
5978
6414
|
}
|
|
5979
6415
|
};
|
|
5980
6416
|
processSchema = async (input) => {
|
|
5981
|
-
const filePath =
|
|
6417
|
+
const filePath = path10.resolve(this.config.__meta.rootDir, input.input);
|
|
5982
6418
|
const params = input.params;
|
|
5983
6419
|
const configuredPath = this.getPathForFile(input.input, params);
|
|
5984
6420
|
if (!configuredPath) {
|
|
@@ -6014,9 +6450,9 @@ var SchemaManager = class {
|
|
|
6014
6450
|
const processedTime = Date.now();
|
|
6015
6451
|
const code = generateCode(processedSchema, filePath);
|
|
6016
6452
|
const prefixPath = slugify(configuredPath);
|
|
6017
|
-
const processedFilePath =
|
|
6453
|
+
const processedFilePath = path10.posix.join(
|
|
6018
6454
|
this.storeDir,
|
|
6019
|
-
`${prefixPath}-${
|
|
6455
|
+
`${prefixPath}-${path10.basename(filePath)}${paramsSuffix(params)}.js`
|
|
6020
6456
|
);
|
|
6021
6457
|
const importKey = processedFilePath;
|
|
6022
6458
|
await fs2.writeFile(processedFilePath, code);
|
|
@@ -6065,7 +6501,7 @@ var SchemaManager = class {
|
|
|
6065
6501
|
};
|
|
6066
6502
|
getAllTrackedFiles = () => Array.from(this.referencedBy.keys());
|
|
6067
6503
|
getFilesToReprocess = (changedFile) => {
|
|
6068
|
-
const resolvedPath =
|
|
6504
|
+
const resolvedPath = path10.resolve(this.config.__meta.rootDir, changedFile);
|
|
6069
6505
|
const referencedBy = this.referencedBy.get(resolvedPath);
|
|
6070
6506
|
if (!referencedBy) return [];
|
|
6071
6507
|
const filesToProcess = referencedBy.size === 0 ? [resolvedPath] : Array.from(referencedBy);
|
|
@@ -6094,7 +6530,7 @@ var SchemaManager = class {
|
|
|
6094
6530
|
version: "",
|
|
6095
6531
|
path: input.path ?? "",
|
|
6096
6532
|
label: input.label,
|
|
6097
|
-
inputPath:
|
|
6533
|
+
inputPath: path10.resolve(this.config.__meta.rootDir, input.input),
|
|
6098
6534
|
params: input.params,
|
|
6099
6535
|
importKey: "",
|
|
6100
6536
|
downloadUrl: "",
|
|
@@ -6114,8 +6550,8 @@ var SchemaManager = class {
|
|
|
6114
6550
|
}
|
|
6115
6551
|
}
|
|
6116
6552
|
};
|
|
6117
|
-
getLatestSchema = (
|
|
6118
|
-
getSchemasForPath = (
|
|
6553
|
+
getLatestSchema = (path39) => this.processedSchemas[path39]?.at(0);
|
|
6554
|
+
getSchemasForPath = (path39) => this.processedSchemas[path39];
|
|
6119
6555
|
getSchemaImports = () => Object.values(this.processedSchemas).flat().filter((s) => s.importKey);
|
|
6120
6556
|
getUrlToFilePathMap = () => {
|
|
6121
6557
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -6137,7 +6573,7 @@ var SchemaManager = class {
|
|
|
6137
6573
|
};
|
|
6138
6574
|
createSchemaPath = (inputPath, versionPath, apiPath, params) => {
|
|
6139
6575
|
const suffix = paramsSuffix(params);
|
|
6140
|
-
const extension = suffix ? ".json" :
|
|
6576
|
+
const extension = suffix ? ".json" : path10.extname(inputPath);
|
|
6141
6577
|
return joinUrl(
|
|
6142
6578
|
this.config.basePath,
|
|
6143
6579
|
apiPath,
|
|
@@ -6160,7 +6596,7 @@ var SchemaManager = class {
|
|
|
6160
6596
|
// src/vite/plugin-config-reload.ts
|
|
6161
6597
|
init_logger();
|
|
6162
6598
|
init_loader();
|
|
6163
|
-
import
|
|
6599
|
+
import path13 from "node:path";
|
|
6164
6600
|
import colors3 from "picocolors";
|
|
6165
6601
|
|
|
6166
6602
|
// src/vite/plugin-navigation.ts
|
|
@@ -6170,14 +6606,14 @@ import { stringify as stringify3 } from "javascript-stringify";
|
|
|
6170
6606
|
import { isElement } from "react-is";
|
|
6171
6607
|
|
|
6172
6608
|
// src/config/validators/NavigationSchema.ts
|
|
6173
|
-
import
|
|
6609
|
+
import path11 from "node:path";
|
|
6174
6610
|
import { glob } from "glob";
|
|
6175
6611
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
6176
6612
|
import { mdxFromMarkdown } from "mdast-util-mdx";
|
|
6177
6613
|
import { mdxjs } from "micromark-extension-mdxjs";
|
|
6178
6614
|
|
|
6179
6615
|
// src/lib/util/readFrontmatter.ts
|
|
6180
|
-
import { readFile } from "node:fs/promises";
|
|
6616
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
6181
6617
|
import matter from "gray-matter";
|
|
6182
6618
|
import { parse, stringify as stringify2 } from "yaml";
|
|
6183
6619
|
var yaml = {
|
|
@@ -6185,7 +6621,7 @@ var yaml = {
|
|
|
6185
6621
|
stringify: (obj) => stringify2(obj)
|
|
6186
6622
|
};
|
|
6187
6623
|
var readFrontmatter = async (filePath) => {
|
|
6188
|
-
const content = await
|
|
6624
|
+
const content = await readFile2(filePath, "utf-8");
|
|
6189
6625
|
const normalizedContent = content.replace(/\r\n/g, "\n");
|
|
6190
6626
|
return matter(normalizedContent, { engines: { yaml } });
|
|
6191
6627
|
};
|
|
@@ -6221,7 +6657,7 @@ var extractRichH1 = (content) => {
|
|
|
6221
6657
|
}
|
|
6222
6658
|
};
|
|
6223
6659
|
var isNavigationItem = (item) => item !== void 0;
|
|
6224
|
-
var toPosixPath = (filePath) => filePath.split(
|
|
6660
|
+
var toPosixPath = (filePath) => filePath.split(path11.win32.sep).join(path11.posix.sep);
|
|
6225
6661
|
var NavigationResolver = class {
|
|
6226
6662
|
rootDir;
|
|
6227
6663
|
globPatterns;
|
|
@@ -6354,13 +6790,13 @@ init_invariant();
|
|
|
6354
6790
|
|
|
6355
6791
|
// src/vite/debug.ts
|
|
6356
6792
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
6357
|
-
import
|
|
6793
|
+
import path12 from "node:path";
|
|
6358
6794
|
async function writePluginDebugCode(rootDir, pluginName, code, extension = "js") {
|
|
6359
6795
|
if (process.env.ZUDOKU_BUILD_DEBUG) {
|
|
6360
|
-
const debugDir =
|
|
6796
|
+
const debugDir = path12.join(rootDir, "dist", "debug");
|
|
6361
6797
|
await mkdir(debugDir, { recursive: true });
|
|
6362
6798
|
await writeFile(
|
|
6363
|
-
|
|
6799
|
+
path12.join(debugDir, `${pluginName}.${extension}`),
|
|
6364
6800
|
typeof code === "string" ? code : code.join("\n")
|
|
6365
6801
|
);
|
|
6366
6802
|
}
|
|
@@ -6471,7 +6907,7 @@ var viteConfigReloadPlugin = () => ({
|
|
|
6471
6907
|
});
|
|
6472
6908
|
logger.info(
|
|
6473
6909
|
colors3.blue(
|
|
6474
|
-
`Config ${
|
|
6910
|
+
`Config ${path13.basename(currentConfig.__meta.configPath)} changed. Reloading...`
|
|
6475
6911
|
),
|
|
6476
6912
|
{ timestamp: true }
|
|
6477
6913
|
);
|
|
@@ -6485,11 +6921,11 @@ var viteApiPlugin = async () => {
|
|
|
6485
6921
|
const resolvedVirtualModuleId5 = `\0${virtualModuleId4}`;
|
|
6486
6922
|
const initialConfig = getCurrentConfig();
|
|
6487
6923
|
const zuploProcessors = ZuploEnv.isZuplo ? await runnerImport3(
|
|
6488
|
-
|
|
6924
|
+
path14.resolve(getZudokuRootDir(), "src/zuplo/with-zuplo-processors.ts")
|
|
6489
6925
|
).then((m) => m.module.default(initialConfig.__meta.rootDir)) : [];
|
|
6490
6926
|
const buildConfig = await getBuildConfig();
|
|
6491
6927
|
const buildProcessors = buildConfig?.processors ?? [];
|
|
6492
|
-
const tmpStoreDir =
|
|
6928
|
+
const tmpStoreDir = path14.posix.join(
|
|
6493
6929
|
initialConfig.__meta.rootDir,
|
|
6494
6930
|
"node_modules/.apitogo/processed"
|
|
6495
6931
|
);
|
|
@@ -6517,7 +6953,7 @@ var viteApiPlugin = async () => {
|
|
|
6517
6953
|
const inputPath = pathMap.get(req.url);
|
|
6518
6954
|
if (!inputPath) return next();
|
|
6519
6955
|
const content = await fs3.readFile(inputPath, "utf-8");
|
|
6520
|
-
const mimeType =
|
|
6956
|
+
const mimeType = path14.extname(inputPath).toLowerCase() === ".json" ? "application/json" : "application/x-yaml";
|
|
6521
6957
|
res.setHeader("Content-Type", `${mimeType}; charset=utf-8`);
|
|
6522
6958
|
return res.end(content);
|
|
6523
6959
|
});
|
|
@@ -6705,8 +7141,8 @@ var viteApiPlugin = async () => {
|
|
|
6705
7141
|
if (process.env.NODE_ENV !== "production") return;
|
|
6706
7142
|
for (const [urlPath, inputPath] of pathMap) {
|
|
6707
7143
|
const content = await fs3.readFile(inputPath, "utf-8");
|
|
6708
|
-
const outputPath =
|
|
6709
|
-
await fs3.mkdir(
|
|
7144
|
+
const outputPath = path14.join(config2.__meta.rootDir, "dist", urlPath);
|
|
7145
|
+
await fs3.mkdir(path14.dirname(outputPath), { recursive: true });
|
|
6710
7146
|
await fs3.writeFile(outputPath, content, "utf-8");
|
|
6711
7147
|
}
|
|
6712
7148
|
}
|
|
@@ -6749,7 +7185,7 @@ var plugin_auth_default = viteAuthPlugin;
|
|
|
6749
7185
|
|
|
6750
7186
|
// src/vite/plugin-component.ts
|
|
6751
7187
|
init_loader();
|
|
6752
|
-
import
|
|
7188
|
+
import path15 from "node:path";
|
|
6753
7189
|
var viteAliasPlugin = () => {
|
|
6754
7190
|
return {
|
|
6755
7191
|
name: "zudoku-component-plugin",
|
|
@@ -6777,7 +7213,7 @@ var viteAliasPlugin = () => {
|
|
|
6777
7213
|
];
|
|
6778
7214
|
const aliases = replacements.map(([find, replacement]) => ({
|
|
6779
7215
|
find,
|
|
6780
|
-
replacement:
|
|
7216
|
+
replacement: path15.posix.join(config2.__meta.moduleDir, replacement)
|
|
6781
7217
|
}));
|
|
6782
7218
|
return config2.__meta.mode === "internal" || config2.__meta.mode === "standalone" ? { resolve: { alias: aliases } } : void 0;
|
|
6783
7219
|
}
|
|
@@ -6914,7 +7350,7 @@ var viteDocMetadataPlugin = () => ({
|
|
|
6914
7350
|
|
|
6915
7351
|
// src/vite/plugin-docs.ts
|
|
6916
7352
|
init_loader();
|
|
6917
|
-
import
|
|
7353
|
+
import path16 from "node:path";
|
|
6918
7354
|
import { glob as glob3 } from "glob";
|
|
6919
7355
|
import globParent from "glob-parent";
|
|
6920
7356
|
init_ZudokuConfig();
|
|
@@ -6983,7 +7419,7 @@ var globMarkdownFiles = async (config2, options = { absolute: false }) => {
|
|
|
6983
7419
|
if (process.env.NODE_ENV !== "development") {
|
|
6984
7420
|
const draftStatuses = await Promise.all(
|
|
6985
7421
|
globbedFiles.map(async (file) => {
|
|
6986
|
-
const absolutePath =
|
|
7422
|
+
const absolutePath = path16.resolve(config2.__meta.rootDir, file);
|
|
6987
7423
|
const { data } = await readFrontmatter(absolutePath);
|
|
6988
7424
|
return { file, isDraft: data.draft === true };
|
|
6989
7425
|
})
|
|
@@ -6996,9 +7432,9 @@ var globMarkdownFiles = async (config2, options = { absolute: false }) => {
|
|
|
6996
7432
|
if (draftFiles.has(file)) {
|
|
6997
7433
|
continue;
|
|
6998
7434
|
}
|
|
6999
|
-
const relativePath =
|
|
7435
|
+
const relativePath = path16.posix.relative(parent, file);
|
|
7000
7436
|
const routePath = ensureLeadingSlash(relativePath.replace(/\.mdx?$/, ""));
|
|
7001
|
-
const filePath = options.absolute ?
|
|
7437
|
+
const filePath = options.absolute ? path16.resolve(config2.__meta.rootDir, file) : file;
|
|
7002
7438
|
fileMapping[routePath] = filePath;
|
|
7003
7439
|
}
|
|
7004
7440
|
}
|
|
@@ -7062,7 +7498,7 @@ var viteDocsPlugin = () => {
|
|
|
7062
7498
|
const globbedDocuments = {};
|
|
7063
7499
|
for (const [routePath, file] of Object.entries(fileMapping)) {
|
|
7064
7500
|
const importPath = ensureLeadingSlash(
|
|
7065
|
-
|
|
7501
|
+
path16.posix.join(globImportBasePath, file)
|
|
7066
7502
|
);
|
|
7067
7503
|
globbedDocuments[routePath] = importPath;
|
|
7068
7504
|
}
|
|
@@ -7086,212 +7522,8 @@ var viteDocsPlugin = () => {
|
|
|
7086
7522
|
var plugin_docs_default = viteDocsPlugin;
|
|
7087
7523
|
|
|
7088
7524
|
// src/vite/plugin-local-manifest.ts
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
// src/config/local-manifest.ts
|
|
7092
|
-
import { access, readFile as readFile2 } from "node:fs/promises";
|
|
7093
|
-
import path15 from "node:path";
|
|
7094
|
-
import { z as z10 } from "zod";
|
|
7095
|
-
var DEV_PORTAL_MANIFEST_FILENAME = "apitogo.local.json";
|
|
7096
|
-
var APITOGO_MANIFEST_BASE_FILENAME = "apitogo.json";
|
|
7097
|
-
var APITOGO_MANIFEST_ENV_FILES = {
|
|
7098
|
-
development: "apitogo.local.json",
|
|
7099
|
-
production: "apitogo.prod.json"
|
|
7100
|
-
};
|
|
7101
|
-
var BillingPeriodSchema = z10.enum(["month", "year", "monthly", "annual"]);
|
|
7102
|
-
var ManifestPlanInputSchema = z10.object({
|
|
7103
|
-
sku: z10.string().min(1),
|
|
7104
|
-
displayName: z10.string().min(1),
|
|
7105
|
-
isFree: z10.boolean(),
|
|
7106
|
-
priceAmount: z10.number().optional(),
|
|
7107
|
-
priceCurrency: z10.string().optional(),
|
|
7108
|
-
billingPeriod: BillingPeriodSchema.optional(),
|
|
7109
|
-
limitsJson: z10.string().optional(),
|
|
7110
|
-
includedActionKeys: z10.array(z10.string()).optional()
|
|
7111
|
-
});
|
|
7112
|
-
var DevPortalLocalManifestSchema = z10.object({
|
|
7113
|
-
siteName: z10.string().optional(),
|
|
7114
|
-
branding: z10.object({
|
|
7115
|
-
title: z10.string().optional(),
|
|
7116
|
-
logoUrl: z10.string().optional()
|
|
7117
|
-
}).optional(),
|
|
7118
|
-
pricing: z10.object({
|
|
7119
|
-
enabled: z10.boolean().optional()
|
|
7120
|
-
}).optional(),
|
|
7121
|
-
plans: z10.array(ManifestPlanInputSchema).optional(),
|
|
7122
|
-
backend: z10.object({
|
|
7123
|
-
sourceDirectory: z10.string().optional(),
|
|
7124
|
-
publishDirectory: z10.string().optional(),
|
|
7125
|
-
openApiPath: z10.string().optional(),
|
|
7126
|
-
runtime: z10.string().optional(),
|
|
7127
|
-
runtimeVersion: z10.string().optional(),
|
|
7128
|
-
deployed: z10.boolean().optional()
|
|
7129
|
-
}).optional(),
|
|
7130
|
-
gateway: z10.object({
|
|
7131
|
-
authMode: z10.enum(["platformManagedEntra", "bringYourOwnOidc"]).optional(),
|
|
7132
|
-
oidcMetadataUrl: z10.string().optional(),
|
|
7133
|
-
oidcAllowedIssuers: z10.array(z10.string()).optional(),
|
|
7134
|
-
oidcAudiences: z10.array(z10.string()).optional(),
|
|
7135
|
-
limitsJson: z10.string().optional(),
|
|
7136
|
-
publicHealthActionKey: z10.string().optional()
|
|
7137
|
-
}).optional(),
|
|
7138
|
-
projectId: z10.string().optional(),
|
|
7139
|
-
projectName: z10.string().optional()
|
|
7140
|
-
});
|
|
7141
|
-
function isPricingEnabled(manifest) {
|
|
7142
|
-
return manifest?.pricing?.enabled === true;
|
|
7143
|
-
}
|
|
7144
|
-
function manifestToPreviewCatalog(manifest) {
|
|
7145
|
-
const plans = manifest?.plans;
|
|
7146
|
-
const catalog = plansToPreviewCatalog(plans);
|
|
7147
|
-
return {
|
|
7148
|
-
pricingEnabled: isPricingEnabled(manifest),
|
|
7149
|
-
plans: catalog.plans
|
|
7150
|
-
};
|
|
7151
|
-
}
|
|
7152
|
-
function normalizeBillingPeriod(period) {
|
|
7153
|
-
if (!period) {
|
|
7154
|
-
return "monthly";
|
|
7155
|
-
}
|
|
7156
|
-
const normalized = period.toLowerCase();
|
|
7157
|
-
if (normalized === "month") {
|
|
7158
|
-
return "monthly";
|
|
7159
|
-
}
|
|
7160
|
-
if (normalized === "year") {
|
|
7161
|
-
return "annual";
|
|
7162
|
-
}
|
|
7163
|
-
return normalized;
|
|
7164
|
-
}
|
|
7165
|
-
function plansToPreviewCatalog(plans) {
|
|
7166
|
-
if (!plans?.length) {
|
|
7167
|
-
return { plans: [] };
|
|
7168
|
-
}
|
|
7169
|
-
return {
|
|
7170
|
-
plans: plans.map((plan) => ({
|
|
7171
|
-
sku: plan.sku,
|
|
7172
|
-
displayName: plan.displayName,
|
|
7173
|
-
isFree: plan.isFree,
|
|
7174
|
-
priceAmount: plan.priceAmount ?? 0,
|
|
7175
|
-
priceCurrency: plan.priceCurrency ?? "usd",
|
|
7176
|
-
billingPeriod: normalizeBillingPeriod(plan.billingPeriod),
|
|
7177
|
-
limitsJson: plan.limitsJson ?? null,
|
|
7178
|
-
includedActionKeys: plan.includedActionKeys ?? []
|
|
7179
|
-
}))
|
|
7180
|
-
};
|
|
7181
|
-
}
|
|
7182
|
-
function resolveManifestEnv(viteMode) {
|
|
7183
|
-
return viteMode === "production" ? "production" : "development";
|
|
7184
|
-
}
|
|
7185
|
-
function mergePlansBySku(existing, patch) {
|
|
7186
|
-
const bySku = /* @__PURE__ */ new Map();
|
|
7187
|
-
for (const plan of existing ?? []) {
|
|
7188
|
-
bySku.set(plan.sku, plan);
|
|
7189
|
-
}
|
|
7190
|
-
for (const plan of patch) {
|
|
7191
|
-
const prior = bySku.get(plan.sku);
|
|
7192
|
-
bySku.set(plan.sku, prior ? { ...prior, ...plan } : plan);
|
|
7193
|
-
}
|
|
7194
|
-
return Array.from(bySku.values());
|
|
7195
|
-
}
|
|
7196
|
-
function mergeManifest(base, override) {
|
|
7197
|
-
const merged = { ...base, ...override };
|
|
7198
|
-
if (override.branding) {
|
|
7199
|
-
merged.branding = { ...base.branding, ...override.branding };
|
|
7200
|
-
}
|
|
7201
|
-
if (override.pricing) {
|
|
7202
|
-
merged.pricing = { ...base.pricing, ...override.pricing };
|
|
7203
|
-
}
|
|
7204
|
-
if (override.backend) {
|
|
7205
|
-
merged.backend = { ...base.backend, ...override.backend };
|
|
7206
|
-
}
|
|
7207
|
-
if (override.gateway) {
|
|
7208
|
-
merged.gateway = { ...base.gateway, ...override.gateway };
|
|
7209
|
-
}
|
|
7210
|
-
if (override.plans) {
|
|
7211
|
-
merged.plans = mergePlansBySku(base.plans, override.plans);
|
|
7212
|
-
}
|
|
7213
|
-
return merged;
|
|
7214
|
-
}
|
|
7215
|
-
function manifestFilePath(rootDir, filename) {
|
|
7216
|
-
return path15.join(
|
|
7217
|
-
path15.resolve(rootDir),
|
|
7218
|
-
filename ?? DEV_PORTAL_MANIFEST_FILENAME
|
|
7219
|
-
);
|
|
7220
|
-
}
|
|
7221
|
-
function manifestPathsForEnv(rootDir, env) {
|
|
7222
|
-
const resolvedRoot = path15.resolve(rootDir);
|
|
7223
|
-
const basePath = path15.join(resolvedRoot, APITOGO_MANIFEST_BASE_FILENAME);
|
|
7224
|
-
const overridePath = path15.join(resolvedRoot, APITOGO_MANIFEST_ENV_FILES[env]);
|
|
7225
|
-
return {
|
|
7226
|
-
basePath,
|
|
7227
|
-
overridePath,
|
|
7228
|
-
watchPaths: [basePath, overridePath]
|
|
7229
|
-
};
|
|
7230
|
-
}
|
|
7231
|
-
function parseLocalManifestJson(raw) {
|
|
7232
|
-
try {
|
|
7233
|
-
const parsed = JSON.parse(raw);
|
|
7234
|
-
const result = DevPortalLocalManifestSchema.safeParse(parsed);
|
|
7235
|
-
if (!result.success) {
|
|
7236
|
-
return null;
|
|
7237
|
-
}
|
|
7238
|
-
return result.data;
|
|
7239
|
-
} catch {
|
|
7240
|
-
return null;
|
|
7241
|
-
}
|
|
7242
|
-
}
|
|
7243
|
-
async function fileExists2(filePath) {
|
|
7244
|
-
try {
|
|
7245
|
-
await access(filePath);
|
|
7246
|
-
return true;
|
|
7247
|
-
} catch {
|
|
7248
|
-
return false;
|
|
7249
|
-
}
|
|
7250
|
-
}
|
|
7251
|
-
async function readManifestFile(rootDir, filename) {
|
|
7252
|
-
const filePath = manifestFilePath(rootDir, filename);
|
|
7253
|
-
try {
|
|
7254
|
-
const raw = await readFile2(filePath, "utf8");
|
|
7255
|
-
return parseLocalManifestJson(raw);
|
|
7256
|
-
} catch {
|
|
7257
|
-
return null;
|
|
7258
|
-
}
|
|
7259
|
-
}
|
|
7260
|
-
async function readEffectiveManifest(rootDir, env) {
|
|
7261
|
-
const { basePath, overridePath } = manifestPathsForEnv(rootDir, env);
|
|
7262
|
-
const hasBase = await fileExists2(basePath);
|
|
7263
|
-
const hasOverride = await fileExists2(overridePath);
|
|
7264
|
-
if (!hasBase) {
|
|
7265
|
-
const legacy = await readManifestFile(
|
|
7266
|
-
rootDir,
|
|
7267
|
-
APITOGO_MANIFEST_ENV_FILES.development
|
|
7268
|
-
);
|
|
7269
|
-
if (legacy) {
|
|
7270
|
-
return legacy;
|
|
7271
|
-
}
|
|
7272
|
-
if (hasOverride) {
|
|
7273
|
-
return readManifestFile(rootDir, APITOGO_MANIFEST_ENV_FILES[env]);
|
|
7274
|
-
}
|
|
7275
|
-
return null;
|
|
7276
|
-
}
|
|
7277
|
-
const base = await readManifestFile(rootDir, APITOGO_MANIFEST_BASE_FILENAME);
|
|
7278
|
-
if (!base) {
|
|
7279
|
-
return null;
|
|
7280
|
-
}
|
|
7281
|
-
if (!hasOverride) {
|
|
7282
|
-
return base;
|
|
7283
|
-
}
|
|
7284
|
-
const override = await readManifestFile(
|
|
7285
|
-
rootDir,
|
|
7286
|
-
APITOGO_MANIFEST_ENV_FILES[env]
|
|
7287
|
-
);
|
|
7288
|
-
if (!override) {
|
|
7289
|
-
return base;
|
|
7290
|
-
}
|
|
7291
|
-
return mergeManifest(base, override);
|
|
7292
|
-
}
|
|
7293
|
-
|
|
7294
|
-
// src/vite/plugin-local-manifest.ts
|
|
7525
|
+
init_local_manifest();
|
|
7526
|
+
import path17 from "node:path";
|
|
7295
7527
|
var APITOGO_LOCAL_MANIFEST_VIRTUAL_ID = "virtual:apitogo-local-manifest";
|
|
7296
7528
|
var resolvedVirtualModuleId4 = `\0${APITOGO_LOCAL_MANIFEST_VIRTUAL_ID}`;
|
|
7297
7529
|
var viteLocalManifestPlugin = () => {
|
|
@@ -7332,8 +7564,8 @@ var viteLocalManifestPlugin = () => {
|
|
|
7332
7564
|
server.watcher.add(watchPath);
|
|
7333
7565
|
}
|
|
7334
7566
|
server.watcher.on("change", async (changedPath) => {
|
|
7335
|
-
const resolvedChanged =
|
|
7336
|
-
if (!watchPaths.some((p) =>
|
|
7567
|
+
const resolvedChanged = path17.resolve(changedPath);
|
|
7568
|
+
if (!watchPaths.some((p) => path17.resolve(p) === resolvedChanged)) {
|
|
7337
7569
|
return;
|
|
7338
7570
|
}
|
|
7339
7571
|
const module = server.moduleGraph.getModuleById(
|
|
@@ -7360,7 +7592,7 @@ init_loader();
|
|
|
7360
7592
|
init_ProtectedRoutesSchema();
|
|
7361
7593
|
init_joinUrl();
|
|
7362
7594
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
7363
|
-
import
|
|
7595
|
+
import path18 from "node:path";
|
|
7364
7596
|
import { matchPath } from "react-router";
|
|
7365
7597
|
var processMarkdownFile = async (filePath) => {
|
|
7366
7598
|
const { content: markdownContent, data: frontmatter } = await readFrontmatter(filePath);
|
|
@@ -7448,7 +7680,7 @@ var viteMarkdownExportPlugin = () => {
|
|
|
7448
7680
|
if (process.env.NODE_ENV !== "production" || Object.keys(markdownFiles).length === 0 || !needsMdFiles) {
|
|
7449
7681
|
return;
|
|
7450
7682
|
}
|
|
7451
|
-
const distDir =
|
|
7683
|
+
const distDir = path18.join(
|
|
7452
7684
|
config2.__meta.rootDir,
|
|
7453
7685
|
"dist",
|
|
7454
7686
|
config2.basePath ?? ""
|
|
@@ -7469,15 +7701,15 @@ var viteMarkdownExportPlugin = () => {
|
|
|
7469
7701
|
content: finalMarkdown
|
|
7470
7702
|
});
|
|
7471
7703
|
const segments = routePath === "/" ? ["index"] : routePath.split("/").filter(Boolean);
|
|
7472
|
-
const outputPath = `${
|
|
7473
|
-
await mkdir2(
|
|
7704
|
+
const outputPath = `${path18.join(distDir, ...segments)}.md`;
|
|
7705
|
+
await mkdir2(path18.dirname(outputPath), { recursive: true });
|
|
7474
7706
|
await writeFile2(outputPath, finalMarkdown, "utf-8");
|
|
7475
7707
|
} catch (error) {
|
|
7476
7708
|
console.warn(`Failed to export markdown for ${routePath}:`, error);
|
|
7477
7709
|
}
|
|
7478
7710
|
}
|
|
7479
7711
|
if (config2.docs?.llms?.llmsTxt || config2.docs?.llms?.llmsTxtFull) {
|
|
7480
|
-
const markdownInfoPath =
|
|
7712
|
+
const markdownInfoPath = path18.join(
|
|
7481
7713
|
config2.__meta.rootDir,
|
|
7482
7714
|
"node_modules/.apitogo/markdown-info.json"
|
|
7483
7715
|
);
|
|
@@ -7629,9 +7861,9 @@ var remarkCodeTabs = () => (tree) => {
|
|
|
7629
7861
|
};
|
|
7630
7862
|
|
|
7631
7863
|
// src/vite/mdx/remark-inject-filepath.ts
|
|
7632
|
-
import
|
|
7864
|
+
import path19 from "node:path";
|
|
7633
7865
|
var remarkInjectFilepath = (rootDir) => (tree, vfile) => {
|
|
7634
|
-
const relativePath =
|
|
7866
|
+
const relativePath = path19.relative(rootDir, vfile.path).split(path19.sep).join(path19.posix.sep);
|
|
7635
7867
|
tree.children.unshift(exportMdxjsConst("__filepath", relativePath));
|
|
7636
7868
|
};
|
|
7637
7869
|
|
|
@@ -7718,18 +7950,18 @@ var remarkLastModified = () => {
|
|
|
7718
7950
|
};
|
|
7719
7951
|
|
|
7720
7952
|
// src/vite/mdx/remark-link-rewrite.ts
|
|
7721
|
-
import
|
|
7953
|
+
import path20 from "node:path";
|
|
7722
7954
|
import { visit as visit5 } from "unist-util-visit";
|
|
7723
7955
|
var remarkLinkRewrite = (basePath = "") => (tree) => {
|
|
7724
7956
|
visit5(tree, "link", (node) => {
|
|
7725
7957
|
if (!node.url) return;
|
|
7726
7958
|
if (node.url.startsWith("http") || node.url.startsWith("mailto:")) return;
|
|
7727
7959
|
node.url = node.url.replace(/\\/g, "/");
|
|
7728
|
-
const base =
|
|
7960
|
+
const base = path20.posix.join(basePath);
|
|
7729
7961
|
if (basePath && node.url.startsWith(base)) {
|
|
7730
7962
|
node.url = node.url.slice(base.length);
|
|
7731
7963
|
} else if (!node.url.startsWith("/") && !node.url.startsWith("#")) {
|
|
7732
|
-
node.url =
|
|
7964
|
+
node.url = path20.posix.join("..", node.url);
|
|
7733
7965
|
}
|
|
7734
7966
|
node.url = node.url.replace(/\.mdx?(#.*)?$/, "$1");
|
|
7735
7967
|
});
|
|
@@ -7949,11 +8181,11 @@ var plugin_mdx_default = viteMdxPlugin;
|
|
|
7949
8181
|
|
|
7950
8182
|
// src/vite/plugin-modules.ts
|
|
7951
8183
|
init_loader();
|
|
7952
|
-
import
|
|
8184
|
+
import path21 from "node:path";
|
|
7953
8185
|
import { normalizePath as normalizePath2 } from "vite";
|
|
7954
|
-
var getLandingModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(
|
|
7955
|
-
var getUserPanelModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(
|
|
7956
|
-
var resolveProjectPageImport = (rootDir, pagePath) => normalizePath2(
|
|
8186
|
+
var getLandingModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(path21.join(moduleDir, "../module-landing/src/index.tsx")) : "@lukoweb/apitogo-module-landing";
|
|
8187
|
+
var getUserPanelModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(path21.join(moduleDir, "../module-user-panel/src/index.tsx")) : "@lukoweb/apitogo-module-user-panel";
|
|
8188
|
+
var resolveProjectPageImport = (rootDir, pagePath) => normalizePath2(path21.resolve(rootDir, pagePath));
|
|
7957
8189
|
var viteModulesPlugin = () => {
|
|
7958
8190
|
const virtualModuleId4 = "virtual:zudoku-modules-plugin";
|
|
7959
8191
|
const resolvedVirtualModuleId5 = `\0${virtualModuleId4}`;
|
|
@@ -8074,7 +8306,7 @@ var plugin_modules_default = viteModulesPlugin;
|
|
|
8074
8306
|
|
|
8075
8307
|
// src/vite/plugin-search.ts
|
|
8076
8308
|
init_loader();
|
|
8077
|
-
import
|
|
8309
|
+
import path22 from "node:path";
|
|
8078
8310
|
var viteSearchPlugin = () => {
|
|
8079
8311
|
const virtualModuleId4 = "virtual:zudoku-search-plugin";
|
|
8080
8312
|
const resolvedVirtualModuleId5 = `\0${virtualModuleId4}`;
|
|
@@ -8092,7 +8324,7 @@ var viteSearchPlugin = () => {
|
|
|
8092
8324
|
return resolvedVirtualModuleId5;
|
|
8093
8325
|
}
|
|
8094
8326
|
if (id === "/pagefind/pagefind.js" && resolvedViteConfig?.publicDir) {
|
|
8095
|
-
return
|
|
8327
|
+
return path22.join(resolvedViteConfig.publicDir, "pagefind/pagefind.js");
|
|
8096
8328
|
}
|
|
8097
8329
|
},
|
|
8098
8330
|
async load(id) {
|
|
@@ -8234,10 +8466,10 @@ function vitePlugin() {
|
|
|
8234
8466
|
var resolveMergedPublicDir = (rootDir, merged) => {
|
|
8235
8467
|
if (merged.publicDir === false) return void 0;
|
|
8236
8468
|
const rel = typeof merged.publicDir === "string" ? merged.publicDir : "public";
|
|
8237
|
-
return
|
|
8469
|
+
return path23.resolve(rootDir, rel);
|
|
8238
8470
|
};
|
|
8239
|
-
var getAppClientEntryPath = () =>
|
|
8240
|
-
var getAppServerEntryPath = () =>
|
|
8471
|
+
var getAppClientEntryPath = () => path23.posix.join(getZudokuRootDir(), "src/app/entry.client.tsx");
|
|
8472
|
+
var getAppServerEntryPath = () => path23.posix.join(getZudokuRootDir(), "src/app/entry.server.tsx");
|
|
8241
8473
|
var hasLoggedCdnInfo = false;
|
|
8242
8474
|
var MEDIA_REGEX = /\.(a?png|jpe?g|gif|bmp|svg|webp|tiff|ico|webm|ogg|mp3|wav|m4a|avif|mp4)/i;
|
|
8243
8475
|
var defineEnvVars = (vars) => Object.fromEntries(
|
|
@@ -8267,7 +8499,7 @@ async function getViteConfig(dir, configEnv) {
|
|
|
8267
8499
|
);
|
|
8268
8500
|
if (ZuploEnv.isZuplo) {
|
|
8269
8501
|
dotenv.config({
|
|
8270
|
-
path:
|
|
8502
|
+
path: path23.resolve(config2.__meta.rootDir, "../.env.zuplo"),
|
|
8271
8503
|
quiet: true
|
|
8272
8504
|
});
|
|
8273
8505
|
}
|
|
@@ -8326,8 +8558,8 @@ async function getViteConfig(dir, configEnv) {
|
|
|
8326
8558
|
ssr: configEnv.isSsrBuild,
|
|
8327
8559
|
sourcemap: true,
|
|
8328
8560
|
target: "es2022",
|
|
8329
|
-
outDir:
|
|
8330
|
-
|
|
8561
|
+
outDir: path23.resolve(
|
|
8562
|
+
path23.join(
|
|
8331
8563
|
dir,
|
|
8332
8564
|
"dist",
|
|
8333
8565
|
config2.basePath ?? "",
|
|
@@ -8346,7 +8578,7 @@ async function getViteConfig(dir, configEnv) {
|
|
|
8346
8578
|
},
|
|
8347
8579
|
experimental: {
|
|
8348
8580
|
renderBuiltUrl(filename) {
|
|
8349
|
-
if (cdnUrl?.base && [".js", ".css"].includes(
|
|
8581
|
+
if (cdnUrl?.base && [".js", ".css"].includes(path23.extname(filename))) {
|
|
8350
8582
|
return joinUrl(cdnUrl.base, filename);
|
|
8351
8583
|
}
|
|
8352
8584
|
if (cdnUrl?.media && MEDIA_REGEX.test(filename)) {
|
|
@@ -8359,7 +8591,7 @@ async function getViteConfig(dir, configEnv) {
|
|
|
8359
8591
|
esbuildOptions: {
|
|
8360
8592
|
target: "es2022"
|
|
8361
8593
|
},
|
|
8362
|
-
entries: [
|
|
8594
|
+
entries: [path23.posix.join(getZudokuRootDir(), "src/{app,lib}/**")],
|
|
8363
8595
|
exclude: [
|
|
8364
8596
|
"@lukoweb/apitogo",
|
|
8365
8597
|
"@lukoweb/apitogo-plugin-dev-portal-billing"
|
|
@@ -8465,7 +8697,7 @@ init_package_json();
|
|
|
8465
8697
|
init_joinUrl();
|
|
8466
8698
|
import assert from "node:assert";
|
|
8467
8699
|
import { cp, mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
8468
|
-
import
|
|
8700
|
+
import path24 from "node:path";
|
|
8469
8701
|
var pkgJson = getZudokuPackageJson();
|
|
8470
8702
|
function generateOutput({
|
|
8471
8703
|
config: config2,
|
|
@@ -8522,9 +8754,9 @@ async function writeOutput(dir, {
|
|
|
8522
8754
|
rewrites
|
|
8523
8755
|
}) {
|
|
8524
8756
|
const output = generateOutput({ config: config2, redirects, rewrites });
|
|
8525
|
-
const outputDir = process.env.VERCEL ?
|
|
8757
|
+
const outputDir = process.env.VERCEL ? path24.join(dir, ".vercel/output") : path24.join(dir, "dist/.output");
|
|
8526
8758
|
await mkdir3(outputDir, { recursive: true });
|
|
8527
|
-
const outputFile =
|
|
8759
|
+
const outputFile = path24.join(outputDir, "config.json");
|
|
8528
8760
|
await writeFile3(outputFile, JSON.stringify(output, null, 2), "utf-8");
|
|
8529
8761
|
if (process.env.VERCEL) {
|
|
8530
8762
|
console.log("Wrote Vercel output to", outputDir);
|
|
@@ -8536,7 +8768,7 @@ init_logger();
|
|
|
8536
8768
|
init_file_exists();
|
|
8537
8769
|
import { readFile as readFile3, rm } from "node:fs/promises";
|
|
8538
8770
|
import os from "node:os";
|
|
8539
|
-
import
|
|
8771
|
+
import path27 from "node:path";
|
|
8540
8772
|
import { pathToFileURL } from "node:url";
|
|
8541
8773
|
import { createIndex } from "pagefind";
|
|
8542
8774
|
import colors7 from "picocolors";
|
|
@@ -8576,9 +8808,9 @@ function throttle(fn) {
|
|
|
8576
8808
|
|
|
8577
8809
|
// src/vite/sitemap.ts
|
|
8578
8810
|
init_joinUrl();
|
|
8579
|
-
import { createWriteStream, existsSync } from "node:fs";
|
|
8811
|
+
import { createWriteStream, existsSync as existsSync2 } from "node:fs";
|
|
8580
8812
|
import { mkdir as mkdir4 } from "node:fs/promises";
|
|
8581
|
-
import
|
|
8813
|
+
import path25 from "node:path";
|
|
8582
8814
|
import colors5 from "picocolors";
|
|
8583
8815
|
import { SitemapStream } from "sitemap";
|
|
8584
8816
|
async function generateSitemap({
|
|
@@ -8592,11 +8824,11 @@ async function generateSitemap({
|
|
|
8592
8824
|
return;
|
|
8593
8825
|
}
|
|
8594
8826
|
const sitemap = new SitemapStream({ hostname: config2.siteUrl });
|
|
8595
|
-
const outputDir =
|
|
8596
|
-
if (!
|
|
8827
|
+
const outputDir = path25.resolve(baseOutputDir, config2.outDir ?? "");
|
|
8828
|
+
if (!existsSync2(outputDir)) {
|
|
8597
8829
|
await mkdir4(outputDir, { recursive: true });
|
|
8598
8830
|
}
|
|
8599
|
-
const sitemapOutputPath =
|
|
8831
|
+
const sitemapOutputPath = path25.join(outputDir, "sitemap.xml");
|
|
8600
8832
|
const writeStream = createWriteStream(sitemapOutputPath);
|
|
8601
8833
|
sitemap.pipe(writeStream);
|
|
8602
8834
|
let lastmod;
|
|
@@ -8626,14 +8858,14 @@ async function generateSitemap({
|
|
|
8626
8858
|
|
|
8627
8859
|
// src/vite/prerender/utils.ts
|
|
8628
8860
|
init_joinUrl();
|
|
8629
|
-
var resolveRoutePath = (
|
|
8630
|
-
const segments =
|
|
8861
|
+
var resolveRoutePath = (path39) => {
|
|
8862
|
+
const segments = path39.split("/");
|
|
8631
8863
|
if (segments.some((s) => s.startsWith(":") && !s.endsWith("?"))) {
|
|
8632
8864
|
return void 0;
|
|
8633
8865
|
}
|
|
8634
8866
|
return segments.filter((s) => !s.startsWith(":")).join("/") || void 0;
|
|
8635
8867
|
};
|
|
8636
|
-
var isSkipped = (
|
|
8868
|
+
var isSkipped = (path39) => path39.includes("*") || /^\d+$/.test(path39);
|
|
8637
8869
|
var resolveRoutes = (routes, parentPath = "") => routes.flatMap((route) => {
|
|
8638
8870
|
if (route.path && isSkipped(route.path)) return [];
|
|
8639
8871
|
const routePath = route.path ? resolveRoutePath(route.path) : void 0;
|
|
@@ -8682,12 +8914,12 @@ var prerender = async ({
|
|
|
8682
8914
|
serverConfigFilename,
|
|
8683
8915
|
writeRedirects = true
|
|
8684
8916
|
}) => {
|
|
8685
|
-
const distDir =
|
|
8917
|
+
const distDir = path27.join(dir, "dist", basePath);
|
|
8686
8918
|
const serverConfigPath = pathToFileURL(
|
|
8687
|
-
|
|
8919
|
+
path27.join(distDir, "server", serverConfigFilename)
|
|
8688
8920
|
).href;
|
|
8689
8921
|
const entryServerPath = pathToFileURL(
|
|
8690
|
-
|
|
8922
|
+
path27.join(distDir, "server/entry.server.js")
|
|
8691
8923
|
).href;
|
|
8692
8924
|
const rawConfig = await import(serverConfigPath).then(
|
|
8693
8925
|
(m) => m.default
|
|
@@ -8772,7 +9004,7 @@ var prerender = async ({
|
|
|
8772
9004
|
})
|
|
8773
9005
|
);
|
|
8774
9006
|
const pagefindWriteResult = await pagefindIndex?.writeFiles({
|
|
8775
|
-
outputPath:
|
|
9007
|
+
outputPath: path27.join(distDir, "pagefind")
|
|
8776
9008
|
});
|
|
8777
9009
|
const seconds = ((performance.now() - start) / 1e3).toFixed(1);
|
|
8778
9010
|
const message = `\u2713 finished prerendering ${paths.length} routes in ${seconds} seconds using ${maxThreads} workers`;
|
|
@@ -8804,7 +9036,7 @@ var prerender = async ({
|
|
|
8804
9036
|
const { generateLlmsTxtFiles: generateLlmsTxtFiles2 } = await Promise.resolve().then(() => (init_llms(), llms_exports));
|
|
8805
9037
|
const docsConfig = DocsConfigSchema2.parse(config2.docs);
|
|
8806
9038
|
const llmsConfig = docsConfig.llms ?? {};
|
|
8807
|
-
const markdownInfoPath =
|
|
9039
|
+
const markdownInfoPath = path27.join(
|
|
8808
9040
|
dir,
|
|
8809
9041
|
"node_modules/.apitogo/markdown-info.json"
|
|
8810
9042
|
);
|
|
@@ -8895,7 +9127,7 @@ async function runBuild(options) {
|
|
|
8895
9127
|
html,
|
|
8896
9128
|
basePath: config2.basePath
|
|
8897
9129
|
});
|
|
8898
|
-
await rm2(
|
|
9130
|
+
await rm2(path28.join(clientOutDir, "index.html"), { force: true });
|
|
8899
9131
|
} else {
|
|
8900
9132
|
await runPrerender({
|
|
8901
9133
|
dir,
|
|
@@ -8919,7 +9151,7 @@ var runPrerender = async (options) => {
|
|
|
8919
9151
|
serverConfigFilename,
|
|
8920
9152
|
writeRedirects: process.env.VERCEL === void 0
|
|
8921
9153
|
});
|
|
8922
|
-
const indexHtml =
|
|
9154
|
+
const indexHtml = path28.join(clientOutDir, "index.html");
|
|
8923
9155
|
if (!workerResults.find((r) => r.outputPath === indexHtml)) {
|
|
8924
9156
|
await writeFile5(indexHtml, html, "utf-8");
|
|
8925
9157
|
}
|
|
@@ -8929,15 +9161,15 @@ var runPrerender = async (options) => {
|
|
|
8929
9161
|
for (const statusPage of statusPages) {
|
|
8930
9162
|
await rename(
|
|
8931
9163
|
statusPage,
|
|
8932
|
-
|
|
9164
|
+
path28.join(dir, DIST_DIR, path28.basename(statusPage))
|
|
8933
9165
|
);
|
|
8934
9166
|
}
|
|
8935
9167
|
await rm2(serverOutDir, { recursive: true, force: true });
|
|
8936
9168
|
if (process.env.VERCEL) {
|
|
8937
|
-
await mkdir5(
|
|
9169
|
+
await mkdir5(path28.join(dir, ".vercel/output/static"), { recursive: true });
|
|
8938
9170
|
await rename(
|
|
8939
|
-
|
|
8940
|
-
|
|
9171
|
+
path28.join(dir, DIST_DIR),
|
|
9172
|
+
path28.join(dir, ".vercel/output/static")
|
|
8941
9173
|
);
|
|
8942
9174
|
}
|
|
8943
9175
|
await writeOutput(dir, {
|
|
@@ -8947,7 +9179,7 @@ var runPrerender = async (options) => {
|
|
|
8947
9179
|
});
|
|
8948
9180
|
if (ZuploEnv.isZuplo && issuer) {
|
|
8949
9181
|
await writeFile5(
|
|
8950
|
-
|
|
9182
|
+
path28.join(dir, DIST_DIR, ".output/zuplo.json"),
|
|
8951
9183
|
JSON.stringify({ issuer }, null, 2),
|
|
8952
9184
|
"utf-8"
|
|
8953
9185
|
);
|
|
@@ -8959,10 +9191,10 @@ var runPrerender = async (options) => {
|
|
|
8959
9191
|
};
|
|
8960
9192
|
var bundleSSREntry = async (options) => {
|
|
8961
9193
|
const { dir, adapter, serverOutDir, serverConfigFilename, html, basePath } = options;
|
|
8962
|
-
const tempEntryPath =
|
|
9194
|
+
const tempEntryPath = path28.join(dir, "__ssr-entry.ts");
|
|
8963
9195
|
const packageRoot = getZudokuRootDir();
|
|
8964
9196
|
const templateContent = await readFile4(
|
|
8965
|
-
|
|
9197
|
+
path28.join(packageRoot, "src/vite/ssr-templates", `${adapter}.ts`),
|
|
8966
9198
|
"utf-8"
|
|
8967
9199
|
);
|
|
8968
9200
|
const entryContent = templateContent.replace('"__TEMPLATE__"', JSON.stringify(html)).replace('"__CONFIG_FILE__"', JSON.stringify(`./${serverConfigFilename}`)).replace(
|
|
@@ -8977,9 +9209,9 @@ var bundleSSREntry = async (options) => {
|
|
|
8977
9209
|
platform: adapter === "node" ? "node" : "neutral",
|
|
8978
9210
|
target: "es2022",
|
|
8979
9211
|
format: "esm",
|
|
8980
|
-
outfile:
|
|
9212
|
+
outfile: path28.join(serverOutDir, "entry.js"),
|
|
8981
9213
|
external: ["./entry.server.js", `./${serverConfigFilename}`],
|
|
8982
|
-
nodePaths: [
|
|
9214
|
+
nodePaths: [path28.join(packageRoot, "node_modules")],
|
|
8983
9215
|
banner: { js: "// Bundled SSR entry" }
|
|
8984
9216
|
});
|
|
8985
9217
|
} finally {
|
|
@@ -9034,11 +9266,11 @@ function textOrJson(text) {
|
|
|
9034
9266
|
init_package_json();
|
|
9035
9267
|
|
|
9036
9268
|
// src/cli/preview/handler.ts
|
|
9037
|
-
import
|
|
9269
|
+
import path29 from "node:path";
|
|
9038
9270
|
import { preview as vitePreview } from "vite";
|
|
9039
9271
|
var DEFAULT_PREVIEW_PORT = 4e3;
|
|
9040
9272
|
async function preview(argv) {
|
|
9041
|
-
const dir =
|
|
9273
|
+
const dir = path29.resolve(process.cwd(), argv.dir);
|
|
9042
9274
|
const viteConfig = await getViteConfig(dir, {
|
|
9043
9275
|
command: "serve",
|
|
9044
9276
|
mode: "production",
|
|
@@ -9079,7 +9311,7 @@ async function build(argv) {
|
|
|
9079
9311
|
printDiagnosticsToConsole("");
|
|
9080
9312
|
printDiagnosticsToConsole("");
|
|
9081
9313
|
}
|
|
9082
|
-
const dir =
|
|
9314
|
+
const dir = path30.resolve(process.cwd(), argv.dir);
|
|
9083
9315
|
try {
|
|
9084
9316
|
await runBuild({
|
|
9085
9317
|
dir,
|
|
@@ -9239,7 +9471,7 @@ var build_default = {
|
|
|
9239
9471
|
// src/cli/configure-github-workflow/handler.ts
|
|
9240
9472
|
import { constants } from "node:fs";
|
|
9241
9473
|
import { access as access2, mkdir as mkdir6, writeFile as writeFile6 } from "node:fs/promises";
|
|
9242
|
-
import
|
|
9474
|
+
import path31 from "node:path";
|
|
9243
9475
|
var APITOGO_DEPLOY_WORKFLOW_YAML = `name: Build and Deploy
|
|
9244
9476
|
|
|
9245
9477
|
on:
|
|
@@ -9350,9 +9582,9 @@ jobs:
|
|
|
9350
9582
|
run: apitogo deploy --deployment-token="$APITOGO_TOKEN" --json-only
|
|
9351
9583
|
`;
|
|
9352
9584
|
async function configureGithubWorkflow(argv) {
|
|
9353
|
-
const dir =
|
|
9354
|
-
const workflowDir =
|
|
9355
|
-
const workflowPath =
|
|
9585
|
+
const dir = path31.resolve(process.cwd(), argv.dir);
|
|
9586
|
+
const workflowDir = path31.join(dir, ".github", "workflows");
|
|
9587
|
+
const workflowPath = path31.join(workflowDir, "apitogo-deploy.yml");
|
|
9356
9588
|
try {
|
|
9357
9589
|
try {
|
|
9358
9590
|
await access2(workflowPath, constants.F_OK);
|
|
@@ -9425,14 +9657,14 @@ function applyJsonOnlyDeployQuietMode() {
|
|
|
9425
9657
|
|
|
9426
9658
|
// src/cli/deploy/handler.ts
|
|
9427
9659
|
import { access as access3, readFile as readFile5 } from "node:fs/promises";
|
|
9428
|
-
import
|
|
9660
|
+
import path32 from "node:path";
|
|
9429
9661
|
import { create as createTar } from "tar";
|
|
9430
9662
|
var DEPLOY_ENDPOINT = "https://deploy-server-dotnet2-b3fkcaaraydbckfe.canadacentral-01.azurewebsites.net/deploy";
|
|
9431
9663
|
var ARCHIVE_NAME = "dist.tgz";
|
|
9432
9664
|
var createDeploymentArchive = async (dir) => {
|
|
9433
|
-
const distDir =
|
|
9665
|
+
const distDir = path32.join(dir, "dist");
|
|
9434
9666
|
await access3(distDir);
|
|
9435
|
-
const archivePath =
|
|
9667
|
+
const archivePath = path32.join(dir, ARCHIVE_NAME);
|
|
9436
9668
|
await createTar(
|
|
9437
9669
|
{
|
|
9438
9670
|
cwd: dir,
|
|
@@ -9446,7 +9678,7 @@ var createDeploymentArchive = async (dir) => {
|
|
|
9446
9678
|
};
|
|
9447
9679
|
async function deploy(argv) {
|
|
9448
9680
|
await build({ ...argv, preview: void 0 });
|
|
9449
|
-
const dir =
|
|
9681
|
+
const dir = path32.resolve(process.cwd(), argv.dir);
|
|
9450
9682
|
const deploymentToken = argv.deploymentToken?.trim() || process.env.npm_config_deployment_token?.trim();
|
|
9451
9683
|
const env = argv.env?.trim() || process.env.npm_config_env?.trim() || "production";
|
|
9452
9684
|
try {
|
|
@@ -9459,7 +9691,7 @@ async function deploy(argv) {
|
|
|
9459
9691
|
const archivePath = await createDeploymentArchive(dir);
|
|
9460
9692
|
if (!isJsonOnlyDeployEnv()) {
|
|
9461
9693
|
printDiagnosticsToConsole(
|
|
9462
|
-
`Uploading ${
|
|
9694
|
+
`Uploading ${path32.basename(archivePath)} to ${env}...`
|
|
9463
9695
|
);
|
|
9464
9696
|
}
|
|
9465
9697
|
const archiveBuffer = await readFile5(archivePath);
|
|
@@ -9467,7 +9699,7 @@ async function deploy(argv) {
|
|
|
9467
9699
|
formData.append(
|
|
9468
9700
|
"file",
|
|
9469
9701
|
new Blob([archiveBuffer], { type: "application/gzip" }),
|
|
9470
|
-
|
|
9702
|
+
path32.basename(archivePath)
|
|
9471
9703
|
);
|
|
9472
9704
|
formData.append("deploymentToken", deploymentToken);
|
|
9473
9705
|
formData.append("env", env);
|
|
@@ -9552,14 +9784,14 @@ var deploy_default = {
|
|
|
9552
9784
|
|
|
9553
9785
|
// src/cli/dev/handler.ts
|
|
9554
9786
|
init_joinUrl();
|
|
9555
|
-
import
|
|
9787
|
+
import path35 from "node:path";
|
|
9556
9788
|
|
|
9557
9789
|
// src/vite/dev-server.ts
|
|
9558
9790
|
init_logger();
|
|
9559
9791
|
import fs4 from "node:fs/promises";
|
|
9560
9792
|
import http from "node:http";
|
|
9561
9793
|
import https from "node:https";
|
|
9562
|
-
import
|
|
9794
|
+
import path34 from "node:path";
|
|
9563
9795
|
import { createHttpTerminator } from "http-terminator";
|
|
9564
9796
|
import {
|
|
9565
9797
|
createServer as createViteServer,
|
|
@@ -9592,7 +9824,7 @@ init_loader();
|
|
|
9592
9824
|
// src/vite/pagefind-dev-index.ts
|
|
9593
9825
|
init_invariant();
|
|
9594
9826
|
init_joinUrl();
|
|
9595
|
-
import
|
|
9827
|
+
import path33 from "node:path";
|
|
9596
9828
|
import { createIndex as createIndex2 } from "pagefind";
|
|
9597
9829
|
import { isRunnableDevEnvironment } from "vite";
|
|
9598
9830
|
async function* buildPagefindDevIndex(vite, config2) {
|
|
@@ -9645,7 +9877,7 @@ async function* buildPagefindDevIndex(vite, config2) {
|
|
|
9645
9877
|
path: urlPath
|
|
9646
9878
|
};
|
|
9647
9879
|
}
|
|
9648
|
-
const outputPath =
|
|
9880
|
+
const outputPath = path33.join(vite.config.publicDir, "pagefind");
|
|
9649
9881
|
await pagefindIndex.writeFiles({ outputPath });
|
|
9650
9882
|
yield { type: "complete", success: true, indexed };
|
|
9651
9883
|
}
|
|
@@ -9664,9 +9896,9 @@ var DevServer = class {
|
|
|
9664
9896
|
this.protocol = "https";
|
|
9665
9897
|
const { dir } = this.options;
|
|
9666
9898
|
const [key, cert, ca] = await Promise.all([
|
|
9667
|
-
fs4.readFile(
|
|
9668
|
-
fs4.readFile(
|
|
9669
|
-
config2.https.ca ? fs4.readFile(
|
|
9899
|
+
fs4.readFile(path34.resolve(dir, config2.https.key)),
|
|
9900
|
+
fs4.readFile(path34.resolve(dir, config2.https.cert)),
|
|
9901
|
+
config2.https.ca ? fs4.readFile(path34.resolve(dir, config2.https.ca)) : void 0
|
|
9670
9902
|
]);
|
|
9671
9903
|
return https.createServer({ key, cert, ca });
|
|
9672
9904
|
}
|
|
@@ -9683,7 +9915,7 @@ var DevServer = class {
|
|
|
9683
9915
|
);
|
|
9684
9916
|
const server = await this.createNodeServer(config2);
|
|
9685
9917
|
if (config2.search?.type === "pagefind" && viteConfig.publicDir !== false) {
|
|
9686
|
-
const publicRoot =
|
|
9918
|
+
const publicRoot = path34.resolve(
|
|
9687
9919
|
this.options.dir,
|
|
9688
9920
|
typeof viteConfig.publicDir === "string" ? viteConfig.publicDir : "public"
|
|
9689
9921
|
);
|
|
@@ -9700,7 +9932,7 @@ var DevServer = class {
|
|
|
9700
9932
|
// built-in transform middleware which would treat the path as a static asset.
|
|
9701
9933
|
name: "apitogo:entry-client",
|
|
9702
9934
|
configureServer(server2) {
|
|
9703
|
-
const entryPath =
|
|
9935
|
+
const entryPath = path34.posix.join(
|
|
9704
9936
|
server2.config.base,
|
|
9705
9937
|
"/__z/entry.client.tsx"
|
|
9706
9938
|
);
|
|
@@ -9865,7 +10097,7 @@ init_package_json();
|
|
|
9865
10097
|
async function dev(argv) {
|
|
9866
10098
|
const packageJson2 = getZudokuPackageJson();
|
|
9867
10099
|
process.env.NODE_ENV = "development";
|
|
9868
|
-
const dir =
|
|
10100
|
+
const dir = path35.resolve(process.cwd(), argv.dir);
|
|
9869
10101
|
const server = new DevServer({
|
|
9870
10102
|
dir,
|
|
9871
10103
|
argPort: argv.port,
|
|
@@ -9950,14 +10182,14 @@ var dev_default = {
|
|
|
9950
10182
|
// src/cli/make-config/handler.ts
|
|
9951
10183
|
import { constants as constants3 } from "node:fs";
|
|
9952
10184
|
import { access as access5, mkdir as mkdir7, readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
9953
|
-
import
|
|
10185
|
+
import path37 from "node:path";
|
|
9954
10186
|
import { glob as glob5 } from "glob";
|
|
9955
10187
|
|
|
9956
10188
|
// src/cli/make-config/scaffold-project.ts
|
|
9957
10189
|
init_package_json();
|
|
9958
10190
|
import { constants as constants2 } from "node:fs";
|
|
9959
10191
|
import { access as access4, readFile as readFile6, writeFile as writeFile7 } from "node:fs/promises";
|
|
9960
|
-
import
|
|
10192
|
+
import path36 from "node:path";
|
|
9961
10193
|
import { glob as glob4 } from "glob";
|
|
9962
10194
|
var OPENAPI_GLOBS = [
|
|
9963
10195
|
"apis/openapi.json",
|
|
@@ -10017,9 +10249,9 @@ var findMatchingCurly = (source, startIndex) => {
|
|
|
10017
10249
|
}
|
|
10018
10250
|
throw new Error("Could not find matching closing brace for object.");
|
|
10019
10251
|
};
|
|
10020
|
-
var toPosix = (p) => p.split(
|
|
10252
|
+
var toPosix = (p) => p.split(path36.sep).join("/");
|
|
10021
10253
|
var sanitizePackageName = (dir) => {
|
|
10022
|
-
const base =
|
|
10254
|
+
const base = path36.basename(path36.resolve(dir));
|
|
10023
10255
|
const s = base.toLowerCase().replace(/[^a-z0-9-_.]/g, "-").replace(/^-+|-+$/g, "");
|
|
10024
10256
|
return s || "apitogo-site";
|
|
10025
10257
|
};
|
|
@@ -10029,7 +10261,7 @@ var apitogoVersionRange = () => {
|
|
|
10029
10261
|
};
|
|
10030
10262
|
async function findOpenApiSpecPath(dir) {
|
|
10031
10263
|
for (const rel of OPENAPI_GLOBS) {
|
|
10032
|
-
const full =
|
|
10264
|
+
const full = path36.join(dir, rel);
|
|
10033
10265
|
try {
|
|
10034
10266
|
await access4(full, constants2.R_OK);
|
|
10035
10267
|
return toPosix(rel);
|
|
@@ -10044,7 +10276,7 @@ async function findOpenApiSpecPath(dir) {
|
|
|
10044
10276
|
return extra[0] ? toPosix(extra[0]) : null;
|
|
10045
10277
|
}
|
|
10046
10278
|
async function ensurePackageJson(dir) {
|
|
10047
|
-
const pkgPath =
|
|
10279
|
+
const pkgPath = path36.join(dir, "package.json");
|
|
10048
10280
|
const apitogoVer = apitogoVersionRange();
|
|
10049
10281
|
const baseDeps = {
|
|
10050
10282
|
react: ">=19.0.0",
|
|
@@ -10107,7 +10339,7 @@ async function ensurePackageJson(dir) {
|
|
|
10107
10339
|
return false;
|
|
10108
10340
|
}
|
|
10109
10341
|
async function ensureTsconfigJson(dir) {
|
|
10110
|
-
const tsPath =
|
|
10342
|
+
const tsPath = path36.join(dir, "tsconfig.json");
|
|
10111
10343
|
try {
|
|
10112
10344
|
await access4(tsPath, constants2.R_OK);
|
|
10113
10345
|
return false;
|
|
@@ -10189,7 +10421,7 @@ var CONFIG_FILENAMES = [
|
|
|
10189
10421
|
];
|
|
10190
10422
|
var DEFAULT_NEW_CONFIG_FILENAME = "apitogo.config.tsx";
|
|
10191
10423
|
var createTreeNode = () => ({ docs: [], children: /* @__PURE__ */ new Map() });
|
|
10192
|
-
var toPosixPath2 = (value) => value.split(
|
|
10424
|
+
var toPosixPath2 = (value) => value.split(path37.sep).join(path37.posix.sep);
|
|
10193
10425
|
var toRoutePath = (relativeFile, pagesDir) => {
|
|
10194
10426
|
const relativeNoExt = relativeFile.replace(/\.mdx?$/, "");
|
|
10195
10427
|
const withoutPagesPrefix = relativeNoExt.replace(
|
|
@@ -10434,7 +10666,7 @@ export default config;
|
|
|
10434
10666
|
`;
|
|
10435
10667
|
};
|
|
10436
10668
|
var ensureApitogoDeployWorkflow = async (dir) => {
|
|
10437
|
-
const workflowPath =
|
|
10669
|
+
const workflowPath = path37.join(
|
|
10438
10670
|
dir,
|
|
10439
10671
|
".github",
|
|
10440
10672
|
"workflows",
|
|
@@ -10445,13 +10677,13 @@ var ensureApitogoDeployWorkflow = async (dir) => {
|
|
|
10445
10677
|
return false;
|
|
10446
10678
|
} catch {
|
|
10447
10679
|
}
|
|
10448
|
-
await mkdir7(
|
|
10680
|
+
await mkdir7(path37.join(dir, ".github", "workflows"), { recursive: true });
|
|
10449
10681
|
await writeFile8(workflowPath, APITOGO_DEPLOY_WORKFLOW_YAML, "utf8");
|
|
10450
10682
|
return true;
|
|
10451
10683
|
};
|
|
10452
10684
|
var findExistingConfigPath = async (dir) => {
|
|
10453
10685
|
for (const filename of CONFIG_FILENAMES) {
|
|
10454
|
-
const fullPath =
|
|
10686
|
+
const fullPath = path37.join(dir, filename);
|
|
10455
10687
|
try {
|
|
10456
10688
|
await readFile7(fullPath, "utf8");
|
|
10457
10689
|
return fullPath;
|
|
@@ -10461,7 +10693,7 @@ var findExistingConfigPath = async (dir) => {
|
|
|
10461
10693
|
return null;
|
|
10462
10694
|
};
|
|
10463
10695
|
async function makeConfig(argv) {
|
|
10464
|
-
const dir =
|
|
10696
|
+
const dir = path37.resolve(process.cwd(), argv.dir);
|
|
10465
10697
|
const pagesDir = toPosixPath2(
|
|
10466
10698
|
argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, "")
|
|
10467
10699
|
);
|
|
@@ -10480,7 +10712,7 @@ async function makeConfig(argv) {
|
|
|
10480
10712
|
let configPath = await findExistingConfigPath(dir);
|
|
10481
10713
|
let createdNew = false;
|
|
10482
10714
|
if (!configPath) {
|
|
10483
|
-
configPath =
|
|
10715
|
+
configPath = path37.join(dir, DEFAULT_NEW_CONFIG_FILENAME);
|
|
10484
10716
|
await writeFile8(
|
|
10485
10717
|
configPath,
|
|
10486
10718
|
buildNewConfigContents(pagesDir, openApiSpecPath),
|
|
@@ -10521,7 +10753,7 @@ async function makeConfig(argv) {
|
|
|
10521
10753
|
await writeFile8(configPath, withRedirects, "utf8");
|
|
10522
10754
|
const action = createdNew ? "Initialized" : "Updated";
|
|
10523
10755
|
printResultToConsole(
|
|
10524
|
-
`${action} ${
|
|
10756
|
+
`${action} ${path37.basename(configPath)} from ${pagesDir}/ (navigation and redirects; other top-level settings preserved unless newly scaffolded).`
|
|
10525
10757
|
);
|
|
10526
10758
|
const createdWorkflow = await ensureApitogoDeployWorkflow(dir);
|
|
10527
10759
|
if (createdWorkflow) {
|
|
@@ -10663,7 +10895,7 @@ var remove_default = {
|
|
|
10663
10895
|
};
|
|
10664
10896
|
|
|
10665
10897
|
// src/cli/common/outdated.ts
|
|
10666
|
-
import { existsSync as
|
|
10898
|
+
import { existsSync as existsSync3, mkdirSync } from "node:fs";
|
|
10667
10899
|
import { readFile as readFile8, writeFile as writeFile9 } from "node:fs/promises";
|
|
10668
10900
|
import { join } from "node:path";
|
|
10669
10901
|
import colors10 from "picocolors";
|
|
@@ -10714,12 +10946,12 @@ function box(message, {
|
|
|
10714
10946
|
|
|
10715
10947
|
// src/cli/common/xdg/lib.ts
|
|
10716
10948
|
import { homedir } from "node:os";
|
|
10717
|
-
import
|
|
10949
|
+
import path38 from "node:path";
|
|
10718
10950
|
function defineDirectoryWithFallback(xdgName, fallback) {
|
|
10719
10951
|
if (process.env[xdgName]) {
|
|
10720
10952
|
return process.env[xdgName];
|
|
10721
10953
|
} else {
|
|
10722
|
-
return
|
|
10954
|
+
return path38.join(homedir(), fallback);
|
|
10723
10955
|
}
|
|
10724
10956
|
}
|
|
10725
10957
|
var XDG_CONFIG_HOME = defineDirectoryWithFallback(
|
|
@@ -10734,15 +10966,15 @@ var XDG_STATE_HOME = defineDirectoryWithFallback(
|
|
|
10734
10966
|
"XDG_DATA_HOME",
|
|
10735
10967
|
".local/state"
|
|
10736
10968
|
);
|
|
10737
|
-
var ZUDOKU_XDG_CONFIG_HOME =
|
|
10969
|
+
var ZUDOKU_XDG_CONFIG_HOME = path38.join(
|
|
10738
10970
|
XDG_CONFIG_HOME,
|
|
10739
10971
|
CLI_XDG_FOLDER_NAME
|
|
10740
10972
|
);
|
|
10741
|
-
var ZUDOKU_XDG_DATA_HOME =
|
|
10973
|
+
var ZUDOKU_XDG_DATA_HOME = path38.join(
|
|
10742
10974
|
XDG_DATA_HOME,
|
|
10743
10975
|
CLI_XDG_FOLDER_NAME
|
|
10744
10976
|
);
|
|
10745
|
-
var ZUDOKU_XDG_STATE_HOME =
|
|
10977
|
+
var ZUDOKU_XDG_STATE_HOME = path38.join(
|
|
10746
10978
|
XDG_STATE_HOME,
|
|
10747
10979
|
CLI_XDG_FOLDER_NAME
|
|
10748
10980
|
);
|
|
@@ -10787,12 +11019,12 @@ async function getLatestVersion() {
|
|
|
10787
11019
|
return void 0;
|
|
10788
11020
|
}
|
|
10789
11021
|
async function getVersionCheckInfo() {
|
|
10790
|
-
if (!
|
|
11022
|
+
if (!existsSync3(ZUDOKU_XDG_STATE_HOME)) {
|
|
10791
11023
|
mkdirSync(ZUDOKU_XDG_STATE_HOME, { recursive: true });
|
|
10792
11024
|
}
|
|
10793
11025
|
const versionCheckPath = join(ZUDOKU_XDG_STATE_HOME, VERSION_CHECK_FILE);
|
|
10794
11026
|
let versionCheckInfo;
|
|
10795
|
-
if (
|
|
11027
|
+
if (existsSync3(versionCheckPath)) {
|
|
10796
11028
|
try {
|
|
10797
11029
|
versionCheckInfo = await readFile8(versionCheckPath, "utf-8").then(
|
|
10798
11030
|
JSON.parse
|