@lukoweb/apitogo 0.1.96 → 0.1.97

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 CHANGED
@@ -734,7 +734,7 @@ import { stat } from "node:fs/promises";
734
734
  var fileExists;
735
735
  var init_file_exists = __esm({
736
736
  "src/config/file-exists.ts"() {
737
- fileExists = (path69) => stat(path69).then(() => true).catch(() => false);
737
+ fileExists = (path70) => stat(path70).then(() => true).catch(() => false);
738
738
  }
739
739
  });
740
740
 
@@ -5126,7 +5126,7 @@ __export(llms_exports, {
5126
5126
  generateLlmsTxtFiles: () => generateLlmsTxtFiles
5127
5127
  });
5128
5128
  import { writeFile as writeFile9 } from "node:fs/promises";
5129
- import path45 from "node:path";
5129
+ import path46 from "node:path";
5130
5130
  import colors7 from "picocolors";
5131
5131
  async function generateLlmsTxtFiles({
5132
5132
  markdownFileInfos,
@@ -5161,7 +5161,7 @@ async function generateLlmsTxtFiles({
5161
5161
  }
5162
5162
  }
5163
5163
  const llmsTxt2 = llmsTxtParts.join("\n");
5164
- await writeFile9(path45.join(baseOutputDir, "llms.txt"), llmsTxt2, "utf-8");
5164
+ await writeFile9(path46.join(baseOutputDir, "llms.txt"), llmsTxt2, "utf-8");
5165
5165
  if (process.env.APITOGO_JSON_ONLY !== "1") {
5166
5166
  console.log(colors7.blue("\u2713 generated llms.txt"));
5167
5167
  }
@@ -5189,7 +5189,7 @@ ${info.content}
5189
5189
  }
5190
5190
  const llmsFull = llmsFullParts.join("\n");
5191
5191
  await writeFile9(
5192
- path45.join(baseOutputDir, "llms-full.txt"),
5192
+ path46.join(baseOutputDir, "llms-full.txt"),
5193
5193
  llmsFull,
5194
5194
  "utf-8"
5195
5195
  );
@@ -5504,8 +5504,8 @@ var PlatformApiClient = class {
5504
5504
  constructor(config2) {
5505
5505
  this.config = config2;
5506
5506
  }
5507
- url(path69) {
5508
- return `${this.config.apiUrl}${path69.startsWith("/") ? path69 : `/${path69}`}`;
5507
+ url(path70) {
5508
+ return `${this.config.apiUrl}${path70.startsWith("/") ? path70 : `/${path70}`}`;
5509
5509
  }
5510
5510
  headers(extra) {
5511
5511
  return {
@@ -5515,9 +5515,9 @@ var PlatformApiClient = class {
5515
5515
  ...extra
5516
5516
  };
5517
5517
  }
5518
- async request(method, path69, init4) {
5518
+ async request(method, path70, init4) {
5519
5519
  const response = await fetchWithRetry(
5520
- this.url(path69),
5520
+ this.url(path70),
5521
5521
  {
5522
5522
  method,
5523
5523
  ...init4,
@@ -5717,15 +5717,15 @@ var PlatformApiClient = class {
5717
5717
  }
5718
5718
  );
5719
5719
  }
5720
- deleteDevPortalPage(projectId, path69) {
5721
- const query = new URLSearchParams({ path: path69 });
5720
+ deleteDevPortalPage(projectId, path70) {
5721
+ const query = new URLSearchParams({ path: path70 });
5722
5722
  return this.request(
5723
5723
  "DELETE",
5724
5724
  `/api/v1/projects/${projectId}/dev-portal/pages/files?${query.toString()}`
5725
5725
  );
5726
5726
  }
5727
- renameDevPortalPage(projectId, path69, newName) {
5728
- const query = new URLSearchParams({ path: path69 });
5727
+ renameDevPortalPage(projectId, path70, newName) {
5728
+ const query = new URLSearchParams({ path: path70 });
5729
5729
  return this.request(
5730
5730
  "POST",
5731
5731
  `/api/v1/projects/${projectId}/dev-portal/pages/files/rename?${query.toString()}`,
@@ -7317,8 +7317,8 @@ function normalizeActionKey(actionKey) {
7317
7317
  const trimmed = actionKey.trim();
7318
7318
  if (trimmed.includes(":")) {
7319
7319
  const [method2, ...pathParts] = trimmed.split(":");
7320
- const path70 = pathParts.join(":").trim();
7321
- return `${method2.toLowerCase()}:${path70.startsWith("/") ? path70 : `/${path70}`}`;
7320
+ const path71 = pathParts.join(":").trim();
7321
+ return `${method2.toLowerCase()}:${path71.startsWith("/") ? path71 : `/${path71}`}`;
7322
7322
  }
7323
7323
  const spaceIndex = trimmed.indexOf(" ");
7324
7324
  if (spaceIndex <= 0) {
@@ -7327,8 +7327,8 @@ function normalizeActionKey(actionKey) {
7327
7327
  );
7328
7328
  }
7329
7329
  const method = trimmed.slice(0, spaceIndex).trim().toLowerCase();
7330
- const path69 = trimmed.slice(spaceIndex + 1).trim();
7331
- return `${method}:${path69.startsWith("/") ? path69 : `/${path69}`}`;
7330
+ const path70 = trimmed.slice(spaceIndex + 1).trim();
7331
+ return `${method}:${path70.startsWith("/") ? path70 : `/${path70}`}`;
7332
7332
  }
7333
7333
  async function applyGatewayPublicRoutes(client, projectId, routes, options) {
7334
7334
  const applied = [];
@@ -11482,8 +11482,8 @@ function normalizeActionKeyFormat(actionKey) {
11482
11482
  const trimmed = actionKey.trim();
11483
11483
  if (trimmed.includes(":")) {
11484
11484
  const [method2, ...pathParts] = trimmed.split(":");
11485
- const path70 = pathParts.join(":").trim();
11486
- return `${method2.toLowerCase()}:${path70.startsWith("/") ? path70 : `/${path70}`}`;
11485
+ const path71 = pathParts.join(":").trim();
11486
+ return `${method2.toLowerCase()}:${path71.startsWith("/") ? path71 : `/${path71}`}`;
11487
11487
  }
11488
11488
  const spaceIndex = trimmed.indexOf(" ");
11489
11489
  if (spaceIndex <= 0) {
@@ -11492,8 +11492,8 @@ function normalizeActionKeyFormat(actionKey) {
11492
11492
  );
11493
11493
  }
11494
11494
  const method = trimmed.slice(0, spaceIndex).trim().toLowerCase();
11495
- const path69 = trimmed.slice(spaceIndex + 1).trim();
11496
- return `${method}:${path69.startsWith("/") ? path69 : `/${path69}`}`;
11495
+ const path70 = trimmed.slice(spaceIndex + 1).trim();
11496
+ return `${method}:${path70.startsWith("/") ? path70 : `/${path70}`}`;
11497
11497
  }
11498
11498
  function normalizePublicRoute(route) {
11499
11499
  const trimmed = route.trim();
@@ -12459,11 +12459,11 @@ var apply_default = {
12459
12459
  };
12460
12460
 
12461
12461
  // src/cli/build/handler.ts
12462
- import path49 from "node:path";
12462
+ import path50 from "node:path";
12463
12463
 
12464
12464
  // src/vite/build.ts
12465
12465
  import { mkdir as mkdir9, readFile as readFile11, rename, rm as rm3, writeFile as writeFile10 } from "node:fs/promises";
12466
- import path47 from "node:path";
12466
+ import path48 from "node:path";
12467
12467
  import { build as esbuild } from "esbuild";
12468
12468
  import { build as viteBuild, mergeConfig as mergeConfig3 } from "vite";
12469
12469
 
@@ -12599,7 +12599,7 @@ init_invariant();
12599
12599
  init_joinUrl();
12600
12600
 
12601
12601
  // src/vite/config.ts
12602
- import path42 from "node:path";
12602
+ import path43 from "node:path";
12603
12603
  import dotenv from "dotenv";
12604
12604
  import colors5 from "picocolors";
12605
12605
  import {
@@ -12610,7 +12610,7 @@ import {
12610
12610
  // package.json
12611
12611
  var package_default = {
12612
12612
  name: "@lukoweb/apitogo",
12613
- version: "0.1.96",
12613
+ version: "0.1.97",
12614
12614
  type: "module",
12615
12615
  sideEffects: [
12616
12616
  "**/*.css",
@@ -13388,14 +13388,14 @@ var flattenAllOf = (schema2) => {
13388
13388
  };
13389
13389
 
13390
13390
  // src/lib/util/traverse.ts
13391
- var traverse = (specification, transform, path69 = []) => {
13392
- const transformed = transform(specification, path69);
13391
+ var traverse = (specification, transform, path70 = []) => {
13392
+ const transformed = transform(specification, path70);
13393
13393
  if (typeof transformed !== "object" || transformed === null) {
13394
13394
  return transformed;
13395
13395
  }
13396
13396
  const result = Array.isArray(transformed) ? [] : {};
13397
13397
  for (const [key, value] of Object.entries(transformed)) {
13398
- const currentPath = [...path69, key];
13398
+ const currentPath = [...path70, key];
13399
13399
  if (Array.isArray(value)) {
13400
13400
  result[key] = value.map(
13401
13401
  (item, index) => typeof item === "object" && item != null ? traverse(item, transform, [...currentPath, index.toString()]) : item
@@ -13423,9 +13423,9 @@ var resolveLocalRef = (schema2, ref) => {
13423
13423
  if (schemaCache?.has(ref)) {
13424
13424
  return schemaCache.get(ref);
13425
13425
  }
13426
- const path69 = ref.split("/").slice(1);
13426
+ const path70 = ref.split("/").slice(1);
13427
13427
  let current = schema2;
13428
- for (const segment of path69) {
13428
+ for (const segment of path70) {
13429
13429
  if (!current || typeof current !== "object") {
13430
13430
  current = null;
13431
13431
  }
@@ -13444,7 +13444,7 @@ var dereference = async (schema2, resolvers = []) => {
13444
13444
  }
13445
13445
  const cloned = structuredClone(schema2);
13446
13446
  const visited = /* @__PURE__ */ new Set();
13447
- const resolve = async (current, path69) => {
13447
+ const resolve = async (current, path70) => {
13448
13448
  if (isIndexableObject(current)) {
13449
13449
  if (visited.has(current)) {
13450
13450
  return CIRCULAR_REF;
@@ -13452,7 +13452,7 @@ var dereference = async (schema2, resolvers = []) => {
13452
13452
  visited.add(current);
13453
13453
  if (Array.isArray(current)) {
13454
13454
  for (let index = 0; index < current.length; index++) {
13455
- current[index] = await resolve(current[index], `${path69}/${index}`);
13455
+ current[index] = await resolve(current[index], `${path70}/${index}`);
13456
13456
  }
13457
13457
  } else {
13458
13458
  if ("$ref" in current && typeof current.$ref === "string") {
@@ -13463,13 +13463,13 @@ var dereference = async (schema2, resolvers = []) => {
13463
13463
  for (const resolver of resolvers) {
13464
13464
  const resolved = await resolver($ref);
13465
13465
  if (resolved) {
13466
- result2 = await resolve(resolved, path69);
13466
+ result2 = await resolve(resolved, path70);
13467
13467
  break;
13468
13468
  }
13469
13469
  }
13470
13470
  if (result2 === void 0) {
13471
13471
  const resolved = await resolveLocalRef(cloned, $ref);
13472
- result2 = await resolve(resolved, path69);
13472
+ result2 = await resolve(resolved, path70);
13473
13473
  }
13474
13474
  if (hasSiblings) {
13475
13475
  if (result2 === CIRCULAR_REF) {
@@ -13482,7 +13482,7 @@ var dereference = async (schema2, resolvers = []) => {
13482
13482
  return result2;
13483
13483
  }
13484
13484
  for (const key in current) {
13485
- current[key] = await resolve(current[key], `${path69}/${key}`);
13485
+ current[key] = await resolve(current[key], `${path70}/${key}`);
13486
13486
  }
13487
13487
  }
13488
13488
  visited.delete(current);
@@ -13521,9 +13521,9 @@ var upgradeSchema = (schema2) => {
13521
13521
  }
13522
13522
  return sub;
13523
13523
  });
13524
- schema2 = traverse(schema2, (sub, path69) => {
13524
+ schema2 = traverse(schema2, (sub, path70) => {
13525
13525
  if (sub.example !== void 0) {
13526
- if (isSchemaPath(path69 ?? [])) {
13526
+ if (isSchemaPath(path70 ?? [])) {
13527
13527
  sub.examples = [sub.example];
13528
13528
  } else {
13529
13529
  sub.examples = {
@@ -13536,11 +13536,11 @@ var upgradeSchema = (schema2) => {
13536
13536
  }
13537
13537
  return sub;
13538
13538
  });
13539
- schema2 = traverse(schema2, (schema3, path69) => {
13539
+ schema2 = traverse(schema2, (schema3, path70) => {
13540
13540
  if (schema3.type === "object" && schema3.properties !== void 0) {
13541
- const parentPath = path69?.slice(0, -1);
13541
+ const parentPath = path70?.slice(0, -1);
13542
13542
  const isMultipart = parentPath?.some((segment, index) => {
13543
- return segment === "content" && path69?.[index + 1] === "multipart/form-data";
13543
+ return segment === "content" && path70?.[index + 1] === "multipart/form-data";
13544
13544
  });
13545
13545
  if (isMultipart) {
13546
13546
  const entries = Object.entries(schema3.properties);
@@ -13554,8 +13554,8 @@ var upgradeSchema = (schema2) => {
13554
13554
  }
13555
13555
  return schema3;
13556
13556
  });
13557
- schema2 = traverse(schema2, (schema3, path69) => {
13558
- if (path69?.includes("content") && path69.includes("application/octet-stream")) {
13557
+ schema2 = traverse(schema2, (schema3, path70) => {
13558
+ if (path70?.includes("content") && path70.includes("application/octet-stream")) {
13559
13559
  return {};
13560
13560
  }
13561
13561
  if (schema3.type === "string" && schema3.format === "binary") {
@@ -13581,11 +13581,11 @@ var upgradeSchema = (schema2) => {
13581
13581
  }
13582
13582
  return sub;
13583
13583
  });
13584
- schema2 = traverse(schema2, (schema3, path69) => {
13584
+ schema2 = traverse(schema2, (schema3, path70) => {
13585
13585
  if (schema3.type === "string" && schema3.format === "byte") {
13586
- const parentPath = path69?.slice(0, -1);
13586
+ const parentPath = path70?.slice(0, -1);
13587
13587
  const contentMediaType = parentPath?.find(
13588
- (_, index) => path69?.[index - 1] === "content"
13588
+ (_, index) => path70?.[index - 1] === "content"
13589
13589
  );
13590
13590
  return {
13591
13591
  type: "string",
@@ -13597,7 +13597,7 @@ var upgradeSchema = (schema2) => {
13597
13597
  });
13598
13598
  return schema2;
13599
13599
  };
13600
- function isSchemaPath(path69) {
13600
+ function isSchemaPath(path70) {
13601
13601
  const schemaLocations = [
13602
13602
  ["components", "schemas"],
13603
13603
  "properties",
@@ -13610,10 +13610,10 @@ function isSchemaPath(path69) {
13610
13610
  ];
13611
13611
  return schemaLocations.some((location) => {
13612
13612
  if (Array.isArray(location)) {
13613
- return location.every((segment, index) => path69[index] === segment);
13613
+ return location.every((segment, index) => path70[index] === segment);
13614
13614
  }
13615
- return path69.includes(location);
13616
- }) || path69.includes("schema") || path69.some((segment) => segment.endsWith("Schema"));
13615
+ return path70.includes(location);
13616
+ }) || path70.includes("schema") || path70.some((segment) => segment.endsWith("Schema"));
13617
13617
  }
13618
13618
 
13619
13619
  // src/lib/oas/parser/index.ts
@@ -13695,13 +13695,13 @@ var OPENAPI_PROPS = /* @__PURE__ */ new Set([
13695
13695
  "anyOf",
13696
13696
  "oneOf"
13697
13697
  ]);
13698
- var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path69 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
13698
+ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path70 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
13699
13699
  if (obj === null || typeof obj !== "object") return obj;
13700
13700
  const refPath = obj.__$ref;
13701
13701
  const isCircular = currentPath.has(obj) || typeof refPath === "string" && currentRefPaths.has(refPath);
13702
13702
  if (isCircular) {
13703
13703
  if (typeof refPath === "string") return SCHEMA_REF_PREFIX + refPath;
13704
- const circularProp = path69.find((p) => !OPENAPI_PROPS.has(p)) || path69[0];
13704
+ const circularProp = path70.find((p) => !OPENAPI_PROPS.has(p)) || path70[0];
13705
13705
  return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
13706
13706
  }
13707
13707
  if (refs.has(obj)) return refs.get(obj);
@@ -13711,7 +13711,7 @@ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs
13711
13711
  value,
13712
13712
  currentPath,
13713
13713
  refs,
13714
- [...path69, key],
13714
+ [...path70, key],
13715
13715
  currentRefPaths
13716
13716
  );
13717
13717
  const result = Array.isArray(obj) ? obj.map((item, i) => recurse(item, i.toString())) : Object.fromEntries(
@@ -13746,7 +13746,7 @@ var resolveExtensions = (obj) => Object.fromEntries(
13746
13746
  var getAllTags = (schema2) => {
13747
13747
  const rootTags = schema2.tags ?? [];
13748
13748
  const operations = Object.values(schema2.paths ?? {}).flatMap(
13749
- (path69) => HttpMethods.map((k) => path69?.[k]).filter((op) => op != null)
13749
+ (path70) => HttpMethods.map((k) => path70?.[k]).filter((op) => op != null)
13750
13750
  );
13751
13751
  const operationTags = new Set(operations.flatMap((op) => op.tags ?? []));
13752
13752
  const hasUntaggedOperations = operations.some(
@@ -13801,7 +13801,7 @@ var getAllSlugs = (ops, schemaTags = []) => {
13801
13801
  var getOperationSlugKey = (op) => [op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
13802
13802
  var getAllOperations = (paths) => {
13803
13803
  const operations = Object.entries(paths ?? {}).flatMap(
13804
- ([path69, value]) => HttpMethods.flatMap((method) => {
13804
+ ([path70, value]) => HttpMethods.flatMap((method) => {
13805
13805
  if (!value?.[method]) return [];
13806
13806
  const operation = value[method];
13807
13807
  const pathParameters = value.parameters ?? [];
@@ -13821,7 +13821,7 @@ var getAllOperations = (paths) => {
13821
13821
  return {
13822
13822
  ...operation,
13823
13823
  method,
13824
- path: path69,
13824
+ path: path70,
13825
13825
  parameters,
13826
13826
  servers,
13827
13827
  tags: operation.tags ?? []
@@ -14179,8 +14179,8 @@ var Schema = builder.objectRef("Schema").implement({
14179
14179
  }),
14180
14180
  paths: t.field({
14181
14181
  type: [PathItem],
14182
- resolve: (root) => Object.entries(root.paths ?? {}).map(([path69, value]) => ({
14183
- path: path69,
14182
+ resolve: (root) => Object.entries(root.paths ?? {}).map(([path70, value]) => ({
14183
+ path: path70,
14184
14184
  // biome-ignore lint/style/noNonNullAssertion: value is guaranteed to be defined
14185
14185
  methods: Object.keys(value)
14186
14186
  }))
@@ -14345,7 +14345,7 @@ init_joinUrl();
14345
14345
 
14346
14346
  // src/vite/api/schema-codegen.ts
14347
14347
  var unescapeJsonPointer = (uri) => decodeURIComponent(uri.replace(/~1/g, "/").replace(/~0/g, "~"));
14348
- var getSegmentsFromPath = (path69) => path69.split("/").slice(1).map(unescapeJsonPointer);
14348
+ var getSegmentsFromPath = (path70) => path70.split("/").slice(1).map(unescapeJsonPointer);
14349
14349
  var createLocalRefMap = (obj) => {
14350
14350
  const refMap = /* @__PURE__ */ new Map();
14351
14351
  const siblingsMap = /* @__PURE__ */ new Map();
@@ -14376,16 +14376,16 @@ var replaceMarkers = (code, mergedRefs) => code.replace(/"__refMap:(.*?)"/g, '__
14376
14376
  /"__refMap\+Siblings:(.*?)"/g,
14377
14377
  (_, key) => mergedRefs.get(key) ?? `__refMap["${key}"]`
14378
14378
  );
14379
- var lookup2 = (schema2, path69, filePath) => {
14380
- const parts = getSegmentsFromPath(path69);
14379
+ var lookup2 = (schema2, path70, filePath) => {
14380
+ const parts = getSegmentsFromPath(path70);
14381
14381
  let val = schema2;
14382
14382
  for (const part of parts) {
14383
14383
  while (val.$ref?.startsWith("#/")) {
14384
- val = val.$ref === path69 ? val : lookup2(schema2, val.$ref, filePath);
14384
+ val = val.$ref === path70 ? val : lookup2(schema2, val.$ref, filePath);
14385
14385
  }
14386
14386
  if (val[part] === void 0) {
14387
14387
  throw new Error(
14388
- `Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path69}`
14388
+ `Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path70}`
14389
14389
  );
14390
14390
  }
14391
14391
  val = val[part];
@@ -14630,8 +14630,8 @@ var SchemaManager = class {
14630
14630
  }
14631
14631
  }
14632
14632
  };
14633
- getLatestSchema = (path69) => this.processedSchemas[path69]?.at(0);
14634
- getSchemasForPath = (path69) => this.processedSchemas[path69];
14633
+ getLatestSchema = (path70) => this.processedSchemas[path70]?.at(0);
14634
+ getSchemasForPath = (path70) => this.processedSchemas[path70];
14635
14635
  getSchemaImports = () => Object.values(this.processedSchemas).flat().filter((s) => s.importKey);
14636
14636
  getUrlToFilePathMap = () => {
14637
14637
  const map = /* @__PURE__ */ new Map();
@@ -16467,9 +16467,53 @@ var viteModulesPlugin = () => {
16467
16467
  };
16468
16468
  var plugin_modules_default = viteModulesPlugin;
16469
16469
 
16470
- // src/vite/plugin-search.ts
16470
+ // src/vite/plugin-offroot-resolve.ts
16471
16471
  init_loader();
16472
16472
  import path41 from "node:path";
16473
+ function stripQuery(id) {
16474
+ const query = id.indexOf("?");
16475
+ return query === -1 ? id : id.slice(0, query);
16476
+ }
16477
+ function isInside(parent, child) {
16478
+ const relative = path41.relative(path41.resolve(parent), path41.resolve(child));
16479
+ return relative === "" || !relative.startsWith("..") && !path41.isAbsolute(relative);
16480
+ }
16481
+ function isBareSpecifier(source) {
16482
+ return !source.startsWith("\0") && !source.startsWith(".") && !source.startsWith("/") && !path41.isAbsolute(source);
16483
+ }
16484
+ function isInsideNodeModules(filePath) {
16485
+ return filePath.split(path41.sep).includes("node_modules");
16486
+ }
16487
+ function shouldResolveFromSiteRoot(source, importer, rootDir) {
16488
+ if (!importer || !isBareSpecifier(source)) {
16489
+ return false;
16490
+ }
16491
+ const importerPath = stripQuery(importer);
16492
+ if (isInside(rootDir, importerPath) || isInsideNodeModules(importerPath)) {
16493
+ return false;
16494
+ }
16495
+ return true;
16496
+ }
16497
+ function viteOffrootResolvePlugin() {
16498
+ return {
16499
+ name: "zudoku-offroot-resolve",
16500
+ enforce: "pre",
16501
+ async resolveId(source, importer, options) {
16502
+ const rootDir = getCurrentConfig().__meta.rootDir;
16503
+ if (!shouldResolveFromSiteRoot(source, importer, rootDir)) {
16504
+ return;
16505
+ }
16506
+ return this.resolve(source, path41.join(rootDir, "package.json"), {
16507
+ ...options,
16508
+ skipSelf: true
16509
+ });
16510
+ }
16511
+ };
16512
+ }
16513
+
16514
+ // src/vite/plugin-search.ts
16515
+ init_loader();
16516
+ import path42 from "node:path";
16473
16517
  var viteSearchPlugin = () => {
16474
16518
  const virtualModuleId4 = "virtual:zudoku-search-plugin";
16475
16519
  const resolvedVirtualModuleId5 = `\0${virtualModuleId4}`;
@@ -16487,7 +16531,7 @@ var viteSearchPlugin = () => {
16487
16531
  return resolvedVirtualModuleId5;
16488
16532
  }
16489
16533
  if (id === "/pagefind/pagefind.js" && resolvedViteConfig?.publicDir) {
16490
- return path41.join(resolvedViteConfig.publicDir, "pagefind/pagefind.js");
16534
+ return path42.join(resolvedViteConfig.publicDir, "pagefind/pagefind.js");
16491
16535
  }
16492
16536
  },
16493
16537
  async load(id) {
@@ -16603,6 +16647,7 @@ init_plugin_theme();
16603
16647
  function vitePlugin() {
16604
16648
  return [
16605
16649
  viteShikiRegisterPlugin(),
16650
+ viteOffrootResolvePlugin(),
16606
16651
  viteConfigReloadPlugin(),
16607
16652
  plugin_local_manifest_default(),
16608
16653
  plugin_mdx_default(),
@@ -16626,17 +16671,17 @@ function vitePlugin() {
16626
16671
  }
16627
16672
 
16628
16673
  // src/vite/config.ts
16629
- var browserConfigLoaderPath2 = path42.join(
16674
+ var browserConfigLoaderPath2 = path43.join(
16630
16675
  getZudokuRootDir(),
16631
16676
  "src/config/apitogo-config-loader.browser.ts"
16632
16677
  );
16633
16678
  var resolveMergedPublicDir = (rootDir, merged) => {
16634
16679
  if (merged.publicDir === false) return void 0;
16635
16680
  const rel = typeof merged.publicDir === "string" ? merged.publicDir : "public";
16636
- return path42.resolve(rootDir, rel);
16681
+ return path43.resolve(rootDir, rel);
16637
16682
  };
16638
- var getAppClientEntryPath = () => path42.posix.join(getZudokuRootDir(), "src/app/entry.client.tsx");
16639
- var getAppServerEntryPath = () => path42.posix.join(getZudokuRootDir(), "src/app/entry.server.tsx");
16683
+ var getAppClientEntryPath = () => path43.posix.join(getZudokuRootDir(), "src/app/entry.client.tsx");
16684
+ var getAppServerEntryPath = () => path43.posix.join(getZudokuRootDir(), "src/app/entry.server.tsx");
16640
16685
  var hasLoggedCdnInfo = false;
16641
16686
  var MEDIA_REGEX = /\.(a?png|jpe?g|gif|bmp|svg|webp|tiff|ico|webm|ogg|mp3|wav|m4a|avif|mp4)/i;
16642
16687
  var defineEnvVars = (vars) => Object.fromEntries(
@@ -16666,7 +16711,7 @@ async function getViteConfig(dir, configEnv) {
16666
16711
  );
16667
16712
  if (ZuploEnv.isZuplo) {
16668
16713
  dotenv.config({
16669
- path: path42.resolve(config2.__meta.rootDir, "../.env.zuplo"),
16714
+ path: path43.resolve(config2.__meta.rootDir, "../.env.zuplo"),
16670
16715
  quiet: true
16671
16716
  });
16672
16717
  }
@@ -16691,11 +16736,11 @@ async function getViteConfig(dir, configEnv) {
16691
16736
  client: {
16692
16737
  resolve: {
16693
16738
  alias: {
16694
- [path42.join(
16739
+ [path43.join(
16695
16740
  getZudokuRootDir(),
16696
16741
  "src/config/apitogo-config-loader.node.ts"
16697
16742
  )]: browserConfigLoaderPath2,
16698
- [path42.join(
16743
+ [path43.join(
16699
16744
  getZudokuRootDir(),
16700
16745
  "src/config/apitogo-config-loader.node.js"
16701
16746
  )]: browserConfigLoaderPath2
@@ -16727,6 +16772,9 @@ async function getViteConfig(dir, configEnv) {
16727
16772
  server: {
16728
16773
  middlewareMode: true,
16729
16774
  open: true,
16775
+ fs: {
16776
+ allow: [dir, path43.dirname(dir)]
16777
+ },
16730
16778
  watch: {
16731
16779
  ignored: [
16732
16780
  `${dir}/dist`,
@@ -16741,8 +16789,8 @@ async function getViteConfig(dir, configEnv) {
16741
16789
  ssr: configEnv.isSsrBuild,
16742
16790
  sourcemap: true,
16743
16791
  target: "es2022",
16744
- outDir: path42.resolve(
16745
- path42.join(
16792
+ outDir: path43.resolve(
16793
+ path43.join(
16746
16794
  dir,
16747
16795
  "dist",
16748
16796
  config2.basePath ?? "",
@@ -16761,7 +16809,7 @@ async function getViteConfig(dir, configEnv) {
16761
16809
  },
16762
16810
  experimental: {
16763
16811
  renderBuiltUrl(filename) {
16764
- if (cdnUrl?.base && [".js", ".css"].includes(path42.extname(filename))) {
16812
+ if (cdnUrl?.base && [".js", ".css"].includes(path43.extname(filename))) {
16765
16813
  return joinUrl(cdnUrl.base, filename);
16766
16814
  }
16767
16815
  if (cdnUrl?.media && MEDIA_REGEX.test(filename)) {
@@ -16774,7 +16822,7 @@ async function getViteConfig(dir, configEnv) {
16774
16822
  esbuildOptions: {
16775
16823
  target: "es2022"
16776
16824
  },
16777
- entries: [path42.posix.join(getZudokuRootDir(), "src/{app,lib}/**")],
16825
+ entries: [path43.posix.join(getZudokuRootDir(), "src/{app,lib}/**")],
16778
16826
  exclude: [
16779
16827
  "@lukoweb/apitogo",
16780
16828
  "@lukoweb/apitogo-plugin-dev-portal-billing"
@@ -16880,7 +16928,7 @@ init_package_json();
16880
16928
  init_joinUrl();
16881
16929
  import assert from "node:assert";
16882
16930
  import { cp, mkdir as mkdir7, writeFile as writeFile8 } from "node:fs/promises";
16883
- import path43 from "node:path";
16931
+ import path44 from "node:path";
16884
16932
  var pkgJson = getZudokuPackageJson();
16885
16933
  function generateOutput({
16886
16934
  config: config2,
@@ -16937,9 +16985,9 @@ async function writeOutput(dir, {
16937
16985
  rewrites
16938
16986
  }) {
16939
16987
  const output2 = generateOutput({ config: config2, redirects, rewrites });
16940
- const outputDir = process.env.VERCEL ? path43.join(dir, ".vercel/output") : path43.join(dir, "dist/.output");
16988
+ const outputDir = process.env.VERCEL ? path44.join(dir, ".vercel/output") : path44.join(dir, "dist/.output");
16941
16989
  await mkdir7(outputDir, { recursive: true });
16942
- const outputFile = path43.join(outputDir, "config.json");
16990
+ const outputFile = path44.join(outputDir, "config.json");
16943
16991
  await writeFile8(outputFile, JSON.stringify(output2, null, 2), "utf-8");
16944
16992
  if (process.env.VERCEL) {
16945
16993
  console.log("Wrote Vercel output to", outputDir);
@@ -16951,7 +16999,7 @@ init_logger();
16951
16999
  init_file_exists();
16952
17000
  import { readFile as readFile10, rm as rm2 } from "node:fs/promises";
16953
17001
  import os from "node:os";
16954
- import path46 from "node:path";
17002
+ import path47 from "node:path";
16955
17003
  import { pathToFileURL } from "node:url";
16956
17004
  import { createIndex } from "pagefind";
16957
17005
  import colors8 from "picocolors";
@@ -16993,7 +17041,7 @@ function throttle(fn) {
16993
17041
  init_joinUrl();
16994
17042
  import { createWriteStream as createWriteStream3, existsSync as existsSync3 } from "node:fs";
16995
17043
  import { mkdir as mkdir8 } from "node:fs/promises";
16996
- import path44 from "node:path";
17044
+ import path45 from "node:path";
16997
17045
  import colors6 from "picocolors";
16998
17046
  import { SitemapStream } from "sitemap";
16999
17047
  async function generateSitemap({
@@ -17007,11 +17055,11 @@ async function generateSitemap({
17007
17055
  return;
17008
17056
  }
17009
17057
  const sitemap = new SitemapStream({ hostname: config2.siteUrl });
17010
- const outputDir = path44.resolve(baseOutputDir, config2.outDir ?? "");
17058
+ const outputDir = path45.resolve(baseOutputDir, config2.outDir ?? "");
17011
17059
  if (!existsSync3(outputDir)) {
17012
17060
  await mkdir8(outputDir, { recursive: true });
17013
17061
  }
17014
- const sitemapOutputPath = path44.join(outputDir, "sitemap.xml");
17062
+ const sitemapOutputPath = path45.join(outputDir, "sitemap.xml");
17015
17063
  const writeStream = createWriteStream3(sitemapOutputPath);
17016
17064
  sitemap.pipe(writeStream);
17017
17065
  let lastmod;
@@ -17041,14 +17089,14 @@ async function generateSitemap({
17041
17089
 
17042
17090
  // src/vite/prerender/utils.ts
17043
17091
  init_joinUrl();
17044
- var resolveRoutePath = (path69) => {
17045
- const segments = path69.split("/");
17092
+ var resolveRoutePath = (path70) => {
17093
+ const segments = path70.split("/");
17046
17094
  if (segments.some((s) => s.startsWith(":") && !s.endsWith("?"))) {
17047
17095
  return void 0;
17048
17096
  }
17049
17097
  return segments.filter((s) => !s.startsWith(":")).join("/") || void 0;
17050
17098
  };
17051
- var isSkipped = (path69) => path69.includes("*") || /^\d+$/.test(path69);
17099
+ var isSkipped = (path70) => path70.includes("*") || /^\d+$/.test(path70);
17052
17100
  var resolveRoutes = (routes, parentPath = "") => routes.flatMap((route) => {
17053
17101
  if (route.path && isSkipped(route.path)) return [];
17054
17102
  const routePath = route.path ? resolveRoutePath(route.path) : void 0;
@@ -17097,12 +17145,12 @@ var prerender = async ({
17097
17145
  serverConfigFilename,
17098
17146
  writeRedirects = true
17099
17147
  }) => {
17100
- const distDir = path46.join(dir, "dist", basePath);
17148
+ const distDir = path47.join(dir, "dist", basePath);
17101
17149
  const serverConfigPath = pathToFileURL(
17102
- path46.join(distDir, "server", serverConfigFilename)
17150
+ path47.join(distDir, "server", serverConfigFilename)
17103
17151
  ).href;
17104
17152
  const entryServerPath = pathToFileURL(
17105
- path46.join(distDir, "server/entry.server.js")
17153
+ path47.join(distDir, "server/entry.server.js")
17106
17154
  ).href;
17107
17155
  const rawConfig = await import(serverConfigPath).then(
17108
17156
  (m) => m.default
@@ -17187,7 +17235,7 @@ var prerender = async ({
17187
17235
  })
17188
17236
  );
17189
17237
  const pagefindWriteResult = await pagefindIndex?.writeFiles({
17190
- outputPath: path46.join(distDir, "pagefind")
17238
+ outputPath: path47.join(distDir, "pagefind")
17191
17239
  });
17192
17240
  const seconds = ((performance.now() - start) / 1e3).toFixed(1);
17193
17241
  const message = `\u2713 finished prerendering ${paths.length} routes in ${seconds} seconds using ${maxThreads} workers`;
@@ -17219,7 +17267,7 @@ var prerender = async ({
17219
17267
  const { generateLlmsTxtFiles: generateLlmsTxtFiles2 } = await Promise.resolve().then(() => (init_llms(), llms_exports));
17220
17268
  const docsConfig = DocsConfigSchema2.parse(config2.docs);
17221
17269
  const llmsConfig = docsConfig.llms ?? {};
17222
- const markdownInfoPath = path46.join(
17270
+ const markdownInfoPath = path47.join(
17223
17271
  dir,
17224
17272
  "node_modules/.apitogo/markdown-info.json"
17225
17273
  );
@@ -17310,7 +17358,7 @@ async function runBuild(options) {
17310
17358
  html,
17311
17359
  basePath: config2.basePath
17312
17360
  });
17313
- await rm3(path47.join(clientOutDir, "index.html"), { force: true });
17361
+ await rm3(path48.join(clientOutDir, "index.html"), { force: true });
17314
17362
  } else {
17315
17363
  await runPrerender({
17316
17364
  dir,
@@ -17334,7 +17382,7 @@ var runPrerender = async (options) => {
17334
17382
  serverConfigFilename,
17335
17383
  writeRedirects: process.env.VERCEL === void 0
17336
17384
  });
17337
- const indexHtml = path47.join(clientOutDir, "index.html");
17385
+ const indexHtml = path48.join(clientOutDir, "index.html");
17338
17386
  if (!workerResults.find((r) => r.outputPath === indexHtml)) {
17339
17387
  await writeFile10(indexHtml, html, "utf-8");
17340
17388
  }
@@ -17344,15 +17392,15 @@ var runPrerender = async (options) => {
17344
17392
  for (const statusPage of statusPages) {
17345
17393
  await rename(
17346
17394
  statusPage,
17347
- path47.join(dir, DIST_DIR, path47.basename(statusPage))
17395
+ path48.join(dir, DIST_DIR, path48.basename(statusPage))
17348
17396
  );
17349
17397
  }
17350
17398
  await rm3(serverOutDir, { recursive: true, force: true });
17351
17399
  if (process.env.VERCEL) {
17352
- await mkdir9(path47.join(dir, ".vercel/output/static"), { recursive: true });
17400
+ await mkdir9(path48.join(dir, ".vercel/output/static"), { recursive: true });
17353
17401
  await rename(
17354
- path47.join(dir, DIST_DIR),
17355
- path47.join(dir, ".vercel/output/static")
17402
+ path48.join(dir, DIST_DIR),
17403
+ path48.join(dir, ".vercel/output/static")
17356
17404
  );
17357
17405
  }
17358
17406
  await writeOutput(dir, {
@@ -17362,7 +17410,7 @@ var runPrerender = async (options) => {
17362
17410
  });
17363
17411
  if (ZuploEnv.isZuplo && issuer) {
17364
17412
  await writeFile10(
17365
- path47.join(dir, DIST_DIR, ".output/zuplo.json"),
17413
+ path48.join(dir, DIST_DIR, ".output/zuplo.json"),
17366
17414
  JSON.stringify({ issuer }, null, 2),
17367
17415
  "utf-8"
17368
17416
  );
@@ -17374,10 +17422,10 @@ var runPrerender = async (options) => {
17374
17422
  };
17375
17423
  var bundleSSREntry = async (options) => {
17376
17424
  const { dir, adapter, serverOutDir, serverConfigFilename, html, basePath } = options;
17377
- const tempEntryPath = path47.join(dir, "__ssr-entry.ts");
17425
+ const tempEntryPath = path48.join(dir, "__ssr-entry.ts");
17378
17426
  const packageRoot = getZudokuRootDir();
17379
17427
  const templateContent = await readFile11(
17380
- path47.join(packageRoot, "src/vite/ssr-templates", `${adapter}.ts`),
17428
+ path48.join(packageRoot, "src/vite/ssr-templates", `${adapter}.ts`),
17381
17429
  "utf-8"
17382
17430
  );
17383
17431
  const entryContent = templateContent.replace('"__TEMPLATE__"', JSON.stringify(html)).replace('"__CONFIG_FILE__"', JSON.stringify(`./${serverConfigFilename}`)).replace(
@@ -17392,9 +17440,9 @@ var bundleSSREntry = async (options) => {
17392
17440
  platform: adapter === "node" ? "node" : "neutral",
17393
17441
  target: "es2022",
17394
17442
  format: "esm",
17395
- outfile: path47.join(serverOutDir, "entry.js"),
17443
+ outfile: path48.join(serverOutDir, "entry.js"),
17396
17444
  external: ["./entry.server.js", `./${serverConfigFilename}`],
17397
- nodePaths: [path47.join(packageRoot, "node_modules")],
17445
+ nodePaths: [path48.join(packageRoot, "node_modules")],
17398
17446
  banner: { js: "// Bundled SSR entry" }
17399
17447
  });
17400
17448
  } finally {
@@ -17407,11 +17455,11 @@ init_logger();
17407
17455
  init_package_json();
17408
17456
 
17409
17457
  // src/cli/preview/handler.ts
17410
- import path48 from "node:path";
17458
+ import path49 from "node:path";
17411
17459
  import { preview as vitePreview } from "vite";
17412
17460
  var DEFAULT_PREVIEW_PORT = 4e3;
17413
17461
  async function preview(argv) {
17414
- const dir = path48.resolve(process.cwd(), argv.dir);
17462
+ const dir = path49.resolve(process.cwd(), argv.dir);
17415
17463
  const viteConfig = await getViteConfig(dir, {
17416
17464
  command: "serve",
17417
17465
  mode: "production",
@@ -17452,7 +17500,7 @@ async function build(argv) {
17452
17500
  printDiagnosticsToConsole("");
17453
17501
  printDiagnosticsToConsole("");
17454
17502
  }
17455
- const dir = path49.resolve(process.cwd(), argv.dir);
17503
+ const dir = path50.resolve(process.cwd(), argv.dir);
17456
17504
  try {
17457
17505
  await runBuild({
17458
17506
  dir,
@@ -17512,12 +17560,12 @@ var build_default = {
17512
17560
  };
17513
17561
 
17514
17562
  // src/cli/check/handler.ts
17515
- import path51 from "node:path";
17563
+ import path52 from "node:path";
17516
17564
 
17517
17565
  // src/cli/platform/tools/check-publish-readiness.ts
17518
- import path50 from "node:path";
17566
+ import path51 from "node:path";
17519
17567
  async function checkPublishReadiness(client, _config, args) {
17520
- const sourceDirectory = path50.resolve(args.sourceDirectory);
17568
+ const sourceDirectory = path51.resolve(args.sourceDirectory);
17521
17569
  const manifest = await readManifest(sourceDirectory) ?? createScaffoldManifest();
17522
17570
  const emailOptions = await resolveEmailOptionsForPublish(
17523
17571
  client,
@@ -17595,7 +17643,7 @@ async function checkPublishReadiness(client, _config, args) {
17595
17643
 
17596
17644
  // src/cli/check/handler.ts
17597
17645
  async function check(argv) {
17598
- const sourceDirectory = path51.resolve(process.cwd(), argv.dir);
17646
+ const sourceDirectory = path52.resolve(process.cwd(), argv.dir);
17599
17647
  const config2 = loadConfig();
17600
17648
  const client = new PlatformApiClient(config2);
17601
17649
  let result;
@@ -17640,13 +17688,13 @@ var check_default = {
17640
17688
  // src/cli/make-config/handler.ts
17641
17689
  import { constants as constants2 } from "node:fs";
17642
17690
  import { access as access8, mkdir as mkdir12, readFile as readFile16, writeFile as writeFile15 } from "node:fs/promises";
17643
- import path59 from "node:path";
17691
+ import path60 from "node:path";
17644
17692
  import { stdin as input2 } from "node:process";
17645
17693
  import { glob as glob5 } from "glob";
17646
17694
 
17647
17695
  // src/cli/scaffold/dev-portal-config-pages.ts
17648
17696
  import { access as access4, readFile as readFile12, rename as rename2, rm as rm4, writeFile as writeFile11 } from "node:fs/promises";
17649
- import path52 from "node:path";
17697
+ import path53 from "node:path";
17650
17698
  async function writeConfigAtomically(filePath, content) {
17651
17699
  const temporaryPath = `${filePath}.${process.pid}.${Date.now()}.tmp`;
17652
17700
  try {
@@ -17659,7 +17707,7 @@ async function writeConfigAtomically(filePath, content) {
17659
17707
  }
17660
17708
  async function resolveApitogoConfigPath(sourceDirectory) {
17661
17709
  for (const filename of ["apitogo.config.tsx", "apitogo.config.jsx"]) {
17662
- const configPath = path52.join(sourceDirectory, filename);
17710
+ const configPath = path53.join(sourceDirectory, filename);
17663
17711
  try {
17664
17712
  await access4(configPath);
17665
17713
  return configPath;
@@ -18396,16 +18444,16 @@ async function wireNewDevPortalPageInConfig(sourceDirectory, slug, label) {
18396
18444
 
18397
18445
  // src/cli/scaffold/wire-openapi.ts
18398
18446
  import { access as access6, readFile as readFile14, writeFile as writeFile13 } from "node:fs/promises";
18399
- import path55 from "node:path";
18447
+ import path56 from "node:path";
18400
18448
 
18401
18449
  // src/cli/scaffold/scaffold-dev-portal-site.ts
18402
18450
  import { mkdir as mkdir10, readFile as readFile13, writeFile as writeFile12 } from "node:fs/promises";
18403
- import path54 from "node:path";
18451
+ import path55 from "node:path";
18404
18452
 
18405
18453
  // src/cli/scaffold/create-apitogo-cli.ts
18406
18454
  import { spawn as spawn3 } from "node:child_process";
18407
18455
  import { access as access5, rm as rm5 } from "node:fs/promises";
18408
- import path53 from "node:path";
18456
+ import path54 from "node:path";
18409
18457
 
18410
18458
  // src/cli/scaffold/apitogo-npm-packages.ts
18411
18459
  var DEFAULT_CREATE_APITOGO_PACKAGE2 = "@lukoweb/create-apitogo@latest";
@@ -18506,9 +18554,9 @@ function resolveDocToolPath(explicit) {
18506
18554
  return value || void 0;
18507
18555
  }
18508
18556
  function splitOutputDirectory(outputDirectory) {
18509
- const resolvedOutputDirectory = path53.resolve(outputDirectory);
18510
- const projectName = path53.basename(resolvedOutputDirectory);
18511
- const parentDirectory = path53.dirname(resolvedOutputDirectory);
18557
+ const resolvedOutputDirectory = path54.resolve(outputDirectory);
18558
+ const projectName = path54.basename(resolvedOutputDirectory);
18559
+ const parentDirectory = path54.dirname(resolvedOutputDirectory);
18512
18560
  if (!projectName || projectName === "." || projectName === "..") {
18513
18561
  throw new Error(
18514
18562
  "outputDirectory must be a named folder (e.g. ./dev-portal-site), not the current directory."
@@ -18534,7 +18582,7 @@ async function directoryHasEntries(dir) {
18534
18582
  }
18535
18583
  }
18536
18584
  function resolveLocalCreateApitogoEntry(docToolPath) {
18537
- return path53.resolve(docToolPath, "packages/create-zudoku/dist/index.js");
18585
+ return path54.resolve(docToolPath, "packages/create-zudoku/dist/index.js");
18538
18586
  }
18539
18587
  async function resolveCreateApitogoInvocation(options) {
18540
18588
  const docToolPath = resolveDocToolPath(options.docToolPath);
@@ -18616,7 +18664,7 @@ async function runCreateApitogoDevPortal(options) {
18616
18664
  result.exitCode
18617
18665
  );
18618
18666
  }
18619
- if (!await pathExists3(path53.join(resolvedOutputDirectory, "package.json"))) {
18667
+ if (!await pathExists3(path54.join(resolvedOutputDirectory, "package.json"))) {
18620
18668
  throw new CreateApitogoCliError(
18621
18669
  `create-apitogo completed but package.json was not found at ${resolvedOutputDirectory}`,
18622
18670
  result.output,
@@ -18672,7 +18720,7 @@ function ensureRequiredApitogoModules(pkg, options) {
18672
18720
  ]
18673
18721
  ]) {
18674
18722
  if (options.docToolPath) {
18675
- deps[moduleName] = `file:${path54.join(options.docToolPath, localPath)}`;
18723
+ deps[moduleName] = `file:${path55.join(options.docToolPath, localPath)}`;
18676
18724
  continue;
18677
18725
  }
18678
18726
  deps[moduleName] = `npm:${moduleName}@${moduleAliasVersion}`;
@@ -18701,7 +18749,7 @@ function rewritePackageJson(raw, options) {
18701
18749
  if (!deps) continue;
18702
18750
  for (const [dep, relativePath] of Object.entries(DOC_TOOL_LOCAL_PACKAGE_PATHS)) {
18703
18751
  if (dep in deps) {
18704
- deps[dep] = `file:${path54.join(options.docToolPath, relativePath)}`;
18752
+ deps[dep] = `file:${path55.join(options.docToolPath, relativePath)}`;
18705
18753
  linkedWorkspacePackage = true;
18706
18754
  }
18707
18755
  }
@@ -18798,23 +18846,23 @@ function patchDashboardPageConfig(content) {
18798
18846
  );
18799
18847
  }
18800
18848
  async function ensureAccountPlansPage(outputDirectory) {
18801
- const pagePath = path54.join(outputDirectory, ACCOUNT_PLANS_PAGE_PATH);
18849
+ const pagePath = path55.join(outputDirectory, ACCOUNT_PLANS_PAGE_PATH);
18802
18850
  try {
18803
18851
  await readFile13(pagePath, "utf8");
18804
18852
  return void 0;
18805
18853
  } catch {
18806
- await mkdir10(path54.dirname(pagePath), { recursive: true });
18854
+ await mkdir10(path55.dirname(pagePath), { recursive: true });
18807
18855
  await writeFile12(pagePath, ACCOUNT_PLANS_PAGE);
18808
18856
  return ACCOUNT_PLANS_PAGE_PATH;
18809
18857
  }
18810
18858
  }
18811
18859
  async function ensureDashboardPage(outputDirectory) {
18812
- const pagePath = path54.join(outputDirectory, DASHBOARD_PAGE_PATH);
18860
+ const pagePath = path55.join(outputDirectory, DASHBOARD_PAGE_PATH);
18813
18861
  try {
18814
18862
  await readFile13(pagePath, "utf8");
18815
18863
  return void 0;
18816
18864
  } catch {
18817
- await mkdir10(path54.dirname(pagePath), { recursive: true });
18865
+ await mkdir10(path55.dirname(pagePath), { recursive: true });
18818
18866
  await writeFile12(pagePath, DASHBOARD_PAGE);
18819
18867
  return DASHBOARD_PAGE_PATH;
18820
18868
  }
@@ -18865,7 +18913,7 @@ function patchApitogoConfig(content, options) {
18865
18913
  async function patchScaffoldedSite(outputDirectory, options) {
18866
18914
  const title = options.branding?.title ?? options.siteName;
18867
18915
  const filesWritten = [];
18868
- const packageJsonPath = path54.join(outputDirectory, "package.json");
18916
+ const packageJsonPath = path55.join(outputDirectory, "package.json");
18869
18917
  if (options.patchPackageJson !== false) {
18870
18918
  const packageJson2 = await readFile13(packageJsonPath, "utf8");
18871
18919
  await writeFile12(
@@ -18878,7 +18926,7 @@ async function patchScaffoldedSite(outputDirectory, options) {
18878
18926
  );
18879
18927
  filesWritten.push("package.json");
18880
18928
  }
18881
- const configPath = path54.join(outputDirectory, "apitogo.config.tsx");
18929
+ const configPath = path55.join(outputDirectory, "apitogo.config.tsx");
18882
18930
  const configContent = await readFile13(configPath, "utf8");
18883
18931
  await writeFile12(
18884
18932
  configPath,
@@ -18973,8 +19021,8 @@ async function discoverOpenApiByMode(siteDirectory, mode) {
18973
19021
  return discoverNearbyOpenApi(siteDirectory);
18974
19022
  }
18975
19023
  async function wireDevPortalOpenApi(sourceDirectory, openApiPath) {
18976
- const resolvedSource = path55.resolve(sourceDirectory);
18977
- const resolvedOpenApi = path55.resolve(openApiPath);
19024
+ const resolvedSource = path56.resolve(sourceDirectory);
19025
+ const resolvedOpenApi = path56.resolve(openApiPath);
18978
19026
  const input3 = toSiteRelativeOpenApiInput(resolvedSource, resolvedOpenApi);
18979
19027
  const validation = await validateOpenApiFile(resolvedOpenApi);
18980
19028
  if (!validation.valid) {
@@ -18999,7 +19047,7 @@ async function wireDevPortalOpenApi(sourceDirectory, openApiPath) {
18999
19047
  "utf8"
19000
19048
  );
19001
19049
  } else {
19002
- const tsxConfigPath = path55.join(resolvedSource, "apitogo.config.tsx");
19050
+ const tsxConfigPath = path56.join(resolvedSource, "apitogo.config.tsx");
19003
19051
  const configContent = await readFile14(tsxConfigPath, "utf8");
19004
19052
  try {
19005
19053
  const patched = patchApitogoConfigOpenApiToFile(configContent, input3);
@@ -19087,10 +19135,10 @@ async function discoverAndWireOpenApi(siteDirectory, mode) {
19087
19135
  // src/cli/make-config/interactive.ts
19088
19136
  import { createInterface } from "node:readline/promises";
19089
19137
  import { stdin as input, stdout as output } from "node:process";
19090
- import path57 from "node:path";
19138
+ import path58 from "node:path";
19091
19139
 
19092
19140
  // src/cli/make-config/json-config.ts
19093
- import path56 from "node:path";
19141
+ import path57 from "node:path";
19094
19142
  var APITOGO_JSON_FILENAME = "apitogo.config.json";
19095
19143
  var DOCUMENTATION_NAV_LABEL2 = "Documentation";
19096
19144
  var API_REFERENCE_PATH = "/api";
@@ -19449,9 +19497,9 @@ function openapiInputForConfig(specRelativePosix) {
19449
19497
  return `./${specRelativePosix}`;
19450
19498
  }
19451
19499
  function toRelativeOpenApiInput(projectDir, inputPath) {
19452
- const resolved = path56.isAbsolute(inputPath) ? inputPath : path56.resolve(projectDir, inputPath);
19453
- const relative = path56.relative(projectDir, resolved);
19454
- const posix = relative.split(path56.sep).join(path56.posix.sep);
19500
+ const resolved = path57.isAbsolute(inputPath) ? inputPath : path57.resolve(projectDir, inputPath);
19501
+ const relative = path57.relative(projectDir, resolved);
19502
+ const posix = relative.split(path57.sep).join(path57.posix.sep);
19455
19503
  if (!posix) {
19456
19504
  throw new Error("OpenAPI path must point to a file.");
19457
19505
  }
@@ -19824,7 +19872,7 @@ async function promptMakeConfigInteractive(options) {
19824
19872
  continue;
19825
19873
  }
19826
19874
  const routePath = `/${slug}`;
19827
- const relativePath = path57.posix.join(options.pagesDir, `${slug}.tsx`);
19875
+ const relativePath = path58.posix.join(options.pagesDir, `${slug}.tsx`);
19828
19876
  const page = {
19829
19877
  slug,
19830
19878
  title: pageTitle.trim(),
@@ -19917,7 +19965,7 @@ export default function ${componentName}() {
19917
19965
  init_package_json();
19918
19966
  import { constants } from "node:fs";
19919
19967
  import { access as access7, mkdir as mkdir11, readFile as readFile15, writeFile as writeFile14 } from "node:fs/promises";
19920
- import path58 from "node:path";
19968
+ import path59 from "node:path";
19921
19969
  import { glob as glob4 } from "glob";
19922
19970
 
19923
19971
  // src/cli/make-config/branding-assets.ts
@@ -19941,9 +19989,9 @@ var OPENAPI_GLOBS = [
19941
19989
  "openapi.yaml",
19942
19990
  "openapi.yml"
19943
19991
  ];
19944
- var toPosix = (p) => p.split(path58.sep).join("/");
19992
+ var toPosix = (p) => p.split(path59.sep).join("/");
19945
19993
  var sanitizePackageName = (dir) => {
19946
- const base = path58.basename(path58.resolve(dir));
19994
+ const base = path59.basename(path59.resolve(dir));
19947
19995
  const s = base.toLowerCase().replace(/[^a-z0-9-_.]/g, "-").replace(/^-+|-+$/g, "");
19948
19996
  return s || "apitogo-site";
19949
19997
  };
@@ -19953,7 +20001,7 @@ var apitogoVersionRange = () => {
19953
20001
  };
19954
20002
  async function findOpenApiSpecPath(dir) {
19955
20003
  for (const rel of OPENAPI_GLOBS) {
19956
- const full = path58.join(dir, rel);
20004
+ const full = path59.join(dir, rel);
19957
20005
  try {
19958
20006
  await access7(full, constants.R_OK);
19959
20007
  return toPosix(rel);
@@ -19968,7 +20016,7 @@ async function findOpenApiSpecPath(dir) {
19968
20016
  return extra[0] ? toPosix(extra[0]) : null;
19969
20017
  }
19970
20018
  async function ensurePackageJson(dir) {
19971
- const pkgPath = path58.join(dir, "package.json");
20019
+ const pkgPath = path59.join(dir, "package.json");
19972
20020
  const apitogoVer = apitogoVersionRange();
19973
20021
  const baseDeps = {
19974
20022
  react: ">=19.0.0",
@@ -20035,7 +20083,7 @@ async function ensurePackageJson(dir) {
20035
20083
  return false;
20036
20084
  }
20037
20085
  async function ensureTsconfigJson(dir) {
20038
- const tsPath = path58.join(dir, "tsconfig.json");
20086
+ const tsPath = path59.join(dir, "tsconfig.json");
20039
20087
  try {
20040
20088
  await access7(tsPath, constants.R_OK);
20041
20089
  return false;
@@ -20084,28 +20132,28 @@ var fileExists2 = async (filePath) => {
20084
20132
  }
20085
20133
  };
20086
20134
  async function ensurePortalStubFiles(dir) {
20087
- const landingPath = path58.join(dir, "landing", "LandingPage.tsx");
20135
+ const landingPath = path59.join(dir, "landing", "LandingPage.tsx");
20088
20136
  if (!await fileExists2(landingPath)) {
20089
- await mkdir11(path58.join(dir, "landing"), { recursive: true });
20137
+ await mkdir11(path59.join(dir, "landing"), { recursive: true });
20090
20138
  await writeFile14(landingPath, LANDING_PAGE_SOURCE, "utf8");
20091
20139
  }
20092
- const plansPath = path58.join(dir, "user-panel", "AccountPlansPage.tsx");
20140
+ const plansPath = path59.join(dir, "user-panel", "AccountPlansPage.tsx");
20093
20141
  if (!await fileExists2(plansPath)) {
20094
- await mkdir11(path58.join(dir, "user-panel"), { recursive: true });
20142
+ await mkdir11(path59.join(dir, "user-panel"), { recursive: true });
20095
20143
  await writeFile14(plansPath, ACCOUNT_PLANS_PAGE_SOURCE, "utf8");
20096
20144
  }
20097
- const dashboardPath = path58.join(dir, "user-panel", "DashboardPage.tsx");
20145
+ const dashboardPath = path59.join(dir, "user-panel", "DashboardPage.tsx");
20098
20146
  if (!await fileExists2(dashboardPath)) {
20099
- await mkdir11(path58.join(dir, "user-panel"), { recursive: true });
20147
+ await mkdir11(path59.join(dir, "user-panel"), { recursive: true });
20100
20148
  await writeFile14(dashboardPath, DASHBOARD_PAGE_SOURCE, "utf8");
20101
20149
  }
20102
20150
  await ensurePublicBrandingFiles(dir);
20103
20151
  }
20104
20152
  async function ensurePublicBrandingFiles(dir) {
20105
- const destDir = path58.join(dir, "public");
20153
+ const destDir = path59.join(dir, "public");
20106
20154
  await mkdir11(destDir, { recursive: true });
20107
20155
  for (const { name, content } of BRANDING_ASSETS) {
20108
- const dest = path58.join(destDir, name);
20156
+ const dest = path59.join(destDir, name);
20109
20157
  if (await fileExists2(dest)) {
20110
20158
  continue;
20111
20159
  }
@@ -20113,7 +20161,7 @@ async function ensurePublicBrandingFiles(dir) {
20113
20161
  }
20114
20162
  }
20115
20163
  async function ensureThinConfigTsx(dir) {
20116
- const tsxPath = path58.join(dir, "apitogo.config.tsx");
20164
+ const tsxPath = path59.join(dir, "apitogo.config.tsx");
20117
20165
  if (await fileExists2(tsxPath)) {
20118
20166
  return false;
20119
20167
  }
@@ -20122,7 +20170,7 @@ async function ensureThinConfigTsx(dir) {
20122
20170
  }
20123
20171
 
20124
20172
  // src/cli/make-config/handler.ts
20125
- var toPosixPath2 = (value) => value.split(path59.sep).join(path59.posix.sep);
20173
+ var toPosixPath2 = (value) => value.split(path60.sep).join(path60.posix.sep);
20126
20174
  var fileExists3 = async (filePath) => {
20127
20175
  try {
20128
20176
  await access8(filePath, constants2.F_OK);
@@ -20180,7 +20228,7 @@ async function persistConfig(config2, ctx) {
20180
20228
  };
20181
20229
  await writeFile15(ctx.jsonPath, `${JSON.stringify(next, null, 2)}
20182
20230
  `, "utf8");
20183
- const tsxPath = path59.join(ctx.dir, "apitogo.config.tsx");
20231
+ const tsxPath = path60.join(ctx.dir, "apitogo.config.tsx");
20184
20232
  if (await fileExists3(tsxPath) && tsxRoutes.length > 0) {
20185
20233
  const tsxSource = await readFile16(tsxPath, "utf8");
20186
20234
  if (isManagedConfigWrapper(tsxSource)) {
@@ -20207,7 +20255,7 @@ function mergeBackendFlag(config2, backend) {
20207
20255
  return next;
20208
20256
  }
20209
20257
  async function makeConfig(argv) {
20210
- const dir = path59.resolve(process.cwd(), argv.dir);
20258
+ const dir = path60.resolve(process.cwd(), argv.dir);
20211
20259
  const pagesDir = toPosixPath2(
20212
20260
  argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, "")
20213
20261
  );
@@ -20227,14 +20275,14 @@ async function makeConfig(argv) {
20227
20275
  printDiagnosticsToConsole("Created tsconfig.json.");
20228
20276
  }
20229
20277
  await ensurePortalStubFiles(dir);
20230
- const jsonPath = path59.join(dir, APITOGO_JSON_FILENAME);
20278
+ const jsonPath = path60.join(dir, APITOGO_JSON_FILENAME);
20231
20279
  let createdJson = false;
20232
20280
  let config2;
20233
20281
  if (await fileExists3(jsonPath)) {
20234
20282
  config2 = await readJsonConfig(jsonPath);
20235
20283
  } else {
20236
20284
  config2 = createDefaultApitogoJsonConfig({
20237
- title: titleFromDirectoryName(path59.basename(dir)),
20285
+ title: titleFromDirectoryName(path60.basename(dir)),
20238
20286
  pagesDir
20239
20287
  });
20240
20288
  createdJson = true;
@@ -20283,8 +20331,8 @@ async function makeConfig(argv) {
20283
20331
  return;
20284
20332
  }
20285
20333
  if (action2.kind === "page") {
20286
- const pagePath = path59.join(dir, action2.page.relativePath);
20287
- await mkdir12(path59.dirname(pagePath), { recursive: true });
20334
+ const pagePath = path60.join(dir, action2.page.relativePath);
20335
+ await mkdir12(path60.dirname(pagePath), { recursive: true });
20288
20336
  await writeFile15(
20289
20337
  pagePath,
20290
20338
  buildStarterDocsPageTsx(action2.page.slug, action2.page.title),
@@ -20337,7 +20385,7 @@ async function makeConfig(argv) {
20337
20385
  if (argv.openapi) {
20338
20386
  const wire = await wireDevPortalOpenApi(
20339
20387
  dir,
20340
- path59.resolve(dir, argv.openapi)
20388
+ path60.resolve(dir, argv.openapi)
20341
20389
  );
20342
20390
  if (wire.status !== "succeeded") {
20343
20391
  throw new Error(
@@ -20366,7 +20414,7 @@ async function makeConfig(argv) {
20366
20414
  const slug = normalizePageSlug(argv.pageSlug);
20367
20415
  const pageTemplate = normalizePageTemplate(argv.pageTemplate);
20368
20416
  const relativePagePath = pageComponentRelativePath(slug);
20369
- const filePath = path59.join(dir, relativePagePath);
20417
+ const filePath = path60.join(dir, relativePagePath);
20370
20418
  const isUpdate = argv.pageUpdate === true;
20371
20419
  if (isUpdate) {
20372
20420
  if (!await fileExists3(filePath)) {
@@ -20399,7 +20447,7 @@ async function makeConfig(argv) {
20399
20447
  argv.pageContent,
20400
20448
  pageTemplate
20401
20449
  );
20402
- await mkdir12(path59.dirname(filePath), { recursive: true });
20450
+ await mkdir12(path60.dirname(filePath), { recursive: true });
20403
20451
  await writeFile15(filePath, tsx, "utf8");
20404
20452
  const configResult = await wireNewDevPortalPageInConfig(
20405
20453
  dir,
@@ -20412,7 +20460,7 @@ async function makeConfig(argv) {
20412
20460
  pagePath: relativePagePath,
20413
20461
  pageTemplate,
20414
20462
  configUpdated: configResult.updated,
20415
- configPath: configResult.configPath ? path59.relative(dir, configResult.configPath) : null
20463
+ configPath: configResult.configPath ? path60.relative(dir, configResult.configPath) : null
20416
20464
  };
20417
20465
  changes.push("page_add");
20418
20466
  }
@@ -20566,14 +20614,14 @@ var deploy_default = {
20566
20614
 
20567
20615
  // src/cli/dev/handler.ts
20568
20616
  init_joinUrl();
20569
- import path62 from "node:path";
20617
+ import path63 from "node:path";
20570
20618
 
20571
20619
  // src/vite/dev-server.ts
20572
20620
  init_logger();
20573
20621
  import fs11 from "node:fs/promises";
20574
20622
  import http from "node:http";
20575
20623
  import https from "node:https";
20576
- import path61 from "node:path";
20624
+ import path62 from "node:path";
20577
20625
  import { createHttpTerminator } from "http-terminator";
20578
20626
  import {
20579
20627
  createServer as createViteServer,
@@ -20606,7 +20654,7 @@ init_loader();
20606
20654
  // src/vite/pagefind-dev-index.ts
20607
20655
  init_invariant();
20608
20656
  init_joinUrl();
20609
- import path60 from "node:path";
20657
+ import path61 from "node:path";
20610
20658
  import { createIndex as createIndex2 } from "pagefind";
20611
20659
  import { isRunnableDevEnvironment } from "vite";
20612
20660
  async function* buildPagefindDevIndex(vite, config2) {
@@ -20659,7 +20707,7 @@ async function* buildPagefindDevIndex(vite, config2) {
20659
20707
  path: urlPath
20660
20708
  };
20661
20709
  }
20662
- const outputPath = path60.join(vite.config.publicDir, "pagefind");
20710
+ const outputPath = path61.join(vite.config.publicDir, "pagefind");
20663
20711
  await pagefindIndex.writeFiles({ outputPath });
20664
20712
  yield { type: "complete", success: true, indexed };
20665
20713
  }
@@ -20678,9 +20726,9 @@ var DevServer = class {
20678
20726
  this.protocol = "https";
20679
20727
  const { dir } = this.options;
20680
20728
  const [key, cert, ca] = await Promise.all([
20681
- fs11.readFile(path61.resolve(dir, config2.https.key)),
20682
- fs11.readFile(path61.resolve(dir, config2.https.cert)),
20683
- config2.https.ca ? fs11.readFile(path61.resolve(dir, config2.https.ca)) : void 0
20729
+ fs11.readFile(path62.resolve(dir, config2.https.key)),
20730
+ fs11.readFile(path62.resolve(dir, config2.https.cert)),
20731
+ config2.https.ca ? fs11.readFile(path62.resolve(dir, config2.https.ca)) : void 0
20684
20732
  ]);
20685
20733
  return https.createServer({ key, cert, ca });
20686
20734
  }
@@ -20697,7 +20745,7 @@ var DevServer = class {
20697
20745
  );
20698
20746
  const server = await this.createNodeServer(config2);
20699
20747
  if (config2.search?.type === "pagefind" && viteConfig.publicDir !== false) {
20700
- const publicRoot = path61.resolve(
20748
+ const publicRoot = path62.resolve(
20701
20749
  this.options.dir,
20702
20750
  typeof viteConfig.publicDir === "string" ? viteConfig.publicDir : "public"
20703
20751
  );
@@ -20714,7 +20762,7 @@ var DevServer = class {
20714
20762
  // built-in transform middleware which would treat the path as a static asset.
20715
20763
  name: "apitogo:entry-client",
20716
20764
  configureServer(server2) {
20717
- const entryPath = path61.posix.join(
20765
+ const entryPath = path62.posix.join(
20718
20766
  server2.config.base,
20719
20767
  "/__z/entry.client.tsx"
20720
20768
  );
@@ -20879,7 +20927,7 @@ init_package_json();
20879
20927
  async function dev(argv) {
20880
20928
  const packageJson2 = getZudokuPackageJson();
20881
20929
  process.env.NODE_ENV = "development";
20882
- const dir = path62.resolve(process.cwd(), argv.dir);
20930
+ const dir = path63.resolve(process.cwd(), argv.dir);
20883
20931
  const server = new DevServer({
20884
20932
  dir,
20885
20933
  argPort: argv.port,
@@ -20962,11 +21010,11 @@ var dev_default = {
20962
21010
  };
20963
21011
 
20964
21012
  // src/cli/init/handler.ts
20965
- import path65 from "node:path";
21013
+ import path66 from "node:path";
20966
21014
 
20967
21015
  // src/cli/scaffold/run-scaffold-discovery.ts
20968
21016
  import { access as access10, readFile as readFile18, writeFile as writeFile17 } from "node:fs/promises";
20969
- import path64 from "node:path";
21017
+ import path65 from "node:path";
20970
21018
 
20971
21019
  // src/cli/scaffold/wire-docs.ts
20972
21020
  import {
@@ -20979,7 +21027,7 @@ import {
20979
21027
  symlink,
20980
21028
  writeFile as writeFile16
20981
21029
  } from "node:fs/promises";
20982
- import path63 from "node:path";
21030
+ import path64 from "node:path";
20983
21031
  var DOCS_DIR_WHITELIST = [
20984
21032
  "docs",
20985
21033
  "documents",
@@ -21016,14 +21064,14 @@ async function isDirectory(filePath) {
21016
21064
  }
21017
21065
  }
21018
21066
  function toPosix2(value) {
21019
- return value.split(path63.sep).join(path63.posix.sep);
21067
+ return value.split(path64.sep).join(path64.posix.sep);
21020
21068
  }
21021
21069
  function isWhitelistedDirName(name) {
21022
21070
  return DOCS_DIR_WHITELIST.includes(name.toLowerCase());
21023
21071
  }
21024
- function isInside(parent, child) {
21025
- const relative = path63.relative(parent, child);
21026
- return relative === "" || !relative.startsWith("..") && !path63.isAbsolute(relative);
21072
+ function isInside2(parent, child) {
21073
+ const relative = path64.relative(parent, child);
21074
+ return relative === "" || !relative.startsWith("..") && !path64.isAbsolute(relative);
21027
21075
  }
21028
21076
  async function collectMarkdownFiles(dir) {
21029
21077
  const files = [];
@@ -21037,7 +21085,7 @@ async function collectMarkdownFiles(dir) {
21037
21085
  if (entry.name.startsWith(".")) {
21038
21086
  continue;
21039
21087
  }
21040
- const full = path63.join(dir, entry.name);
21088
+ const full = path64.join(dir, entry.name);
21041
21089
  if (entry.isDirectory()) {
21042
21090
  if (SKIP_SEARCH_DIRS.has(entry.name) || entry.isSymbolicLink()) {
21043
21091
  continue;
@@ -21052,11 +21100,11 @@ async function collectMarkdownFiles(dir) {
21052
21100
  return files;
21053
21101
  }
21054
21102
  async function collectSearchRoots(siteDirectory) {
21055
- const site = path63.resolve(siteDirectory);
21056
- const parent = path63.dirname(site);
21103
+ const site = path64.resolve(siteDirectory);
21104
+ const parent = path64.dirname(site);
21057
21105
  const roots = [];
21058
21106
  const add = (dir) => {
21059
- const resolved = path63.resolve(dir);
21107
+ const resolved = path64.resolve(dir);
21060
21108
  if (!roots.includes(resolved)) {
21061
21109
  roots.push(resolved);
21062
21110
  }
@@ -21069,7 +21117,7 @@ async function collectSearchRoots(siteDirectory) {
21069
21117
  if (!entry.isDirectory() || SKIP_SEARCH_DIRS.has(entry.name)) {
21070
21118
  continue;
21071
21119
  }
21072
- add(path63.join(parent, entry.name));
21120
+ add(path64.join(parent, entry.name));
21073
21121
  }
21074
21122
  } catch {
21075
21123
  }
@@ -21078,14 +21126,14 @@ async function collectSearchRoots(siteDirectory) {
21078
21126
  return roots;
21079
21127
  }
21080
21128
  async function discoverNearbyDocsDirectories(siteDirectory) {
21081
- const site = path63.resolve(siteDirectory);
21082
- const sitePages = path63.join(site, PAGES_DIR);
21129
+ const site = path64.resolve(siteDirectory);
21130
+ const sitePages = path64.join(site, PAGES_DIR);
21083
21131
  const searchedDirectories = await collectSearchRoots(site);
21084
21132
  const directories = [];
21085
21133
  const seen = /* @__PURE__ */ new Set();
21086
21134
  const consider = async (dir) => {
21087
- const resolved = path63.resolve(dir);
21088
- if (resolved === site || seen.has(resolved) || isInside(sitePages, resolved)) {
21135
+ const resolved = path64.resolve(dir);
21136
+ if (resolved === site || seen.has(resolved) || isInside2(sitePages, resolved)) {
21089
21137
  return;
21090
21138
  }
21091
21139
  if (!await isDirectory(resolved)) {
@@ -21101,7 +21149,7 @@ async function discoverNearbyDocsDirectories(siteDirectory) {
21101
21149
  directories.push({ sourceDirectory: resolved, files });
21102
21150
  };
21103
21151
  for (const root of searchedDirectories) {
21104
- if (isWhitelistedDirName(path63.basename(root))) {
21152
+ if (isWhitelistedDirName(path64.basename(root))) {
21105
21153
  await consider(root);
21106
21154
  }
21107
21155
  try {
@@ -21113,7 +21161,7 @@ async function discoverNearbyDocsDirectories(siteDirectory) {
21113
21161
  if (!isWhitelistedDirName(entry.name)) {
21114
21162
  continue;
21115
21163
  }
21116
- await consider(path63.join(root, entry.name));
21164
+ await consider(path64.join(root, entry.name));
21117
21165
  }
21118
21166
  } catch {
21119
21167
  }
@@ -21124,8 +21172,8 @@ function slugifyDirName(name) {
21124
21172
  return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "docs";
21125
21173
  }
21126
21174
  async function allocateLinkName(pagesDir, sourceDirectory, used) {
21127
- const base = slugifyDirName(path63.basename(sourceDirectory));
21128
- const parent = slugifyDirName(path63.basename(path63.dirname(sourceDirectory)));
21175
+ const base = slugifyDirName(path64.basename(sourceDirectory));
21176
+ const parent = slugifyDirName(path64.basename(path64.dirname(sourceDirectory)));
21129
21177
  const candidates = [base, `${parent}-${base}`];
21130
21178
  let index = 2;
21131
21179
  while (true) {
@@ -21133,7 +21181,7 @@ async function allocateLinkName(pagesDir, sourceDirectory, used) {
21133
21181
  if (used.has(name)) {
21134
21182
  continue;
21135
21183
  }
21136
- const target = path63.join(pagesDir, name);
21184
+ const target = path64.join(pagesDir, name);
21137
21185
  if (await pathExists5(target)) {
21138
21186
  const stat4 = await lstat(target);
21139
21187
  if (!stat4.isDirectory() || !await isManagedLinkDir(target)) {
@@ -21164,8 +21212,8 @@ async function alreadyLinked(linkPath, sourcePath) {
21164
21212
  return false;
21165
21213
  }
21166
21214
  const current = await readlink(linkPath);
21167
- const resolved = path63.resolve(path63.dirname(linkPath), current);
21168
- return resolved === path63.resolve(sourcePath);
21215
+ const resolved = path64.resolve(path64.dirname(linkPath), current);
21216
+ return resolved === path64.resolve(sourcePath);
21169
21217
  } catch {
21170
21218
  return false;
21171
21219
  }
@@ -21177,8 +21225,8 @@ async function linkMarkdownFile(sourcePath, linkPath) {
21177
21225
  if (await pathExists5(linkPath)) {
21178
21226
  return "skipped";
21179
21227
  }
21180
- await mkdir13(path63.dirname(linkPath), { recursive: true });
21181
- const relativeTarget = path63.relative(path63.dirname(linkPath), sourcePath);
21228
+ await mkdir13(path64.dirname(linkPath), { recursive: true });
21229
+ const relativeTarget = path64.relative(path64.dirname(linkPath), sourcePath);
21182
21230
  await symlink(
21183
21231
  relativeTarget,
21184
21232
  linkPath,
@@ -21193,7 +21241,7 @@ async function applyDocsNavigation(siteDirectory, routes) {
21193
21241
  if (routes.length === 0) {
21194
21242
  return;
21195
21243
  }
21196
- const configPath = path63.join(siteDirectory, CONFIG_FILENAME);
21244
+ const configPath = path64.join(siteDirectory, CONFIG_FILENAME);
21197
21245
  if (!await pathExists5(configPath)) {
21198
21246
  return;
21199
21247
  }
@@ -21209,8 +21257,8 @@ async function applyDocsNavigation(siteDirectory, routes) {
21209
21257
  `, "utf8");
21210
21258
  }
21211
21259
  async function discoverAndWireDocs(siteDirectory) {
21212
- const site = path63.resolve(siteDirectory);
21213
- const pagesDir = path63.join(site, PAGES_DIR);
21260
+ const site = path64.resolve(siteDirectory);
21261
+ const pagesDir = path64.join(site, PAGES_DIR);
21214
21262
  const { directories, searchedDirectories } = await discoverNearbyDocsDirectories(site);
21215
21263
  if (directories.length === 0) {
21216
21264
  return {
@@ -21232,14 +21280,14 @@ async function discoverAndWireDocs(siteDirectory) {
21232
21280
  directory.sourceDirectory,
21233
21281
  usedNames
21234
21282
  );
21235
- const linkDirectory = path63.join(pagesDir, linkName);
21283
+ const linkDirectory = path64.join(pagesDir, linkName);
21236
21284
  const linked = [];
21237
21285
  const skipped = [];
21238
21286
  for (const sourcePath of directory.files) {
21239
21287
  const relativeSource = toPosix2(
21240
- path63.relative(directory.sourceDirectory, sourcePath)
21288
+ path64.relative(directory.sourceDirectory, sourcePath)
21241
21289
  );
21242
- const linkPath = path63.join(linkDirectory, relativeSource);
21290
+ const linkPath = path64.join(linkDirectory, relativeSource);
21243
21291
  const result = await linkMarkdownFile(sourcePath, linkPath);
21244
21292
  if (result === "skipped") {
21245
21293
  skipped.push({
@@ -21248,7 +21296,7 @@ async function discoverAndWireDocs(siteDirectory) {
21248
21296
  });
21249
21297
  continue;
21250
21298
  }
21251
- const relativeLink = toPosix2(path63.relative(site, linkPath));
21299
+ const relativeLink = toPosix2(path64.relative(site, linkPath));
21252
21300
  const route = toRoutePath(relativeLink, PAGES_DIR);
21253
21301
  linked.push({ sourcePath, linkPath, route, relativeSource });
21254
21302
  routes.push(route);
@@ -21281,11 +21329,11 @@ async function discoverAndWireDocs(siteDirectory) {
21281
21329
  };
21282
21330
  }
21283
21331
  function siteRelative(siteDirectory, filePath) {
21284
- const relative = toPosix2(path63.relative(siteDirectory, filePath));
21332
+ const relative = toPosix2(path64.relative(siteDirectory, filePath));
21285
21333
  if (!relative) {
21286
21334
  return ".";
21287
21335
  }
21288
- if (path63.isAbsolute(relative)) {
21336
+ if (path64.isAbsolute(relative)) {
21289
21337
  return toPosix2(filePath);
21290
21338
  }
21291
21339
  if (relative.startsWith("..")) {
@@ -21352,7 +21400,7 @@ async function pathExists6(filePath) {
21352
21400
  }
21353
21401
  async function wireOpenApiIntoJsonConfig(siteDirectory, openApiPath) {
21354
21402
  const input3 = toSiteRelativeOpenApiInput(siteDirectory, openApiPath);
21355
- const jsonConfigPath = path64.join(siteDirectory, "apitogo.config.json");
21403
+ const jsonConfigPath = path65.join(siteDirectory, "apitogo.config.json");
21356
21404
  const raw = await readFile18(jsonConfigPath, "utf8");
21357
21405
  const siteConfig = JSON.parse(raw);
21358
21406
  const updated = applyOpenApiToSiteConfig(siteConfig, {
@@ -21404,7 +21452,7 @@ async function discoverAndWireOpenApiLite(siteDirectory, mode) {
21404
21452
  wired: false
21405
21453
  };
21406
21454
  }
21407
- const jsonConfigPath = path64.join(siteDirectory, "apitogo.config.json");
21455
+ const jsonConfigPath = path65.join(siteDirectory, "apitogo.config.json");
21408
21456
  if (!await pathExists6(jsonConfigPath)) {
21409
21457
  return {
21410
21458
  openApiDiscovery: {
@@ -21465,8 +21513,8 @@ function slugifyName2(name) {
21465
21513
  return name.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "") || "dev-portal-site";
21466
21514
  }
21467
21515
  function resolveInitOutputDirectory(dirArg, name) {
21468
- const resolved = path65.resolve(process.cwd(), dirArg);
21469
- const base = path65.basename(resolved);
21516
+ const resolved = path66.resolve(process.cwd(), dirArg);
21517
+ const base = path66.basename(resolved);
21470
21518
  const isDot = dirArg === "." || dirArg === "./" || base === "." || resolved === process.cwd();
21471
21519
  if (isDot) {
21472
21520
  const fromName = name?.trim();
@@ -21476,7 +21524,7 @@ function resolveInitOutputDirectory(dirArg, name) {
21476
21524
  );
21477
21525
  }
21478
21526
  return {
21479
- outputDirectory: path65.resolve(process.cwd(), slugifyName2(fromName)),
21527
+ outputDirectory: path66.resolve(process.cwd(), slugifyName2(fromName)),
21480
21528
  siteName: fromName
21481
21529
  };
21482
21530
  }
@@ -21720,9 +21768,9 @@ var remove_default = {
21720
21768
  };
21721
21769
 
21722
21770
  // src/cli/status/handler.ts
21723
- import path66 from "node:path";
21771
+ import path67 from "node:path";
21724
21772
  async function status(argv) {
21725
- const sourceDirectory = path66.resolve(process.cwd(), argv.dir);
21773
+ const sourceDirectory = path67.resolve(process.cwd(), argv.dir);
21726
21774
  const config2 = loadConfig();
21727
21775
  const client = new PlatformApiClient(config2);
21728
21776
  let whoamiJson;
@@ -21802,7 +21850,7 @@ var status_default = {
21802
21850
  };
21803
21851
 
21804
21852
  // src/cli/teardown/handler.ts
21805
- import path67 from "node:path";
21853
+ import path68 from "node:path";
21806
21854
  function resultLooksFailed3(payload) {
21807
21855
  try {
21808
21856
  const parsed = JSON.parse(payload);
@@ -21818,7 +21866,7 @@ async function teardown(argv) {
21818
21866
  );
21819
21867
  return;
21820
21868
  }
21821
- const sourceDirectory = path67.resolve(process.cwd(), argv.dir);
21869
+ const sourceDirectory = path68.resolve(process.cwd(), argv.dir);
21822
21870
  const config2 = loadConfig();
21823
21871
  const client = new PlatformApiClient(config2);
21824
21872
  let projectId = argv.projectId?.trim();
@@ -21951,12 +21999,12 @@ function box(message, {
21951
21999
 
21952
22000
  // src/cli/common/xdg/lib.ts
21953
22001
  import { homedir } from "node:os";
21954
- import path68 from "node:path";
22002
+ import path69 from "node:path";
21955
22003
  function defineDirectoryWithFallback(xdgName, fallback) {
21956
22004
  if (process.env[xdgName]) {
21957
22005
  return process.env[xdgName];
21958
22006
  } else {
21959
- return path68.join(homedir(), fallback);
22007
+ return path69.join(homedir(), fallback);
21960
22008
  }
21961
22009
  }
21962
22010
  var XDG_CONFIG_HOME = defineDirectoryWithFallback(
@@ -21971,15 +22019,15 @@ var XDG_STATE_HOME = defineDirectoryWithFallback(
21971
22019
  "XDG_DATA_HOME",
21972
22020
  ".local/state"
21973
22021
  );
21974
- var ZUDOKU_XDG_CONFIG_HOME = path68.join(
22022
+ var ZUDOKU_XDG_CONFIG_HOME = path69.join(
21975
22023
  XDG_CONFIG_HOME,
21976
22024
  CLI_XDG_FOLDER_NAME
21977
22025
  );
21978
- var ZUDOKU_XDG_DATA_HOME = path68.join(
22026
+ var ZUDOKU_XDG_DATA_HOME = path69.join(
21979
22027
  XDG_DATA_HOME,
21980
22028
  CLI_XDG_FOLDER_NAME
21981
22029
  );
21982
- var ZUDOKU_XDG_STATE_HOME = path68.join(
22030
+ var ZUDOKU_XDG_STATE_HOME = path69.join(
21983
22031
  XDG_STATE_HOME,
21984
22032
  CLI_XDG_FOLDER_NAME
21985
22033
  );