@lonik/prestige 0.0.0 → 0.1.6

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/ui.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  import { n as SidebarType } from "./content.types-BbDmygmP.js";
2
2
  import { TocItem } from "remark-flexible-toc";
3
3
  import React, { ReactNode } from "react";
4
- import * as react_jsx_runtime7 from "react/jsx-runtime";
4
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
5
5
  import { Tabs as Tabs$1 } from "@base-ui/react/tabs";
6
6
 
7
7
  //#region src/ui/components/aside/aside.d.ts
@@ -17,7 +17,7 @@ declare function Aside({
17
17
  children,
18
18
  className,
19
19
  ...props
20
- }: AsideProps): react_jsx_runtime7.JSX.Element;
20
+ }: AsideProps): react_jsx_runtime0.JSX.Element;
21
21
  //#endregion
22
22
  //#region src/ui/components/code/code.d.ts
23
23
  interface CodeProps {
@@ -29,7 +29,7 @@ interface CodeProps {
29
29
  declare function Code({
30
30
  code,
31
31
  children
32
- }: CodeProps): react_jsx_runtime7.JSX.Element;
32
+ }: CodeProps): react_jsx_runtime0.JSX.Element;
33
33
  //#endregion
34
34
  //#region src/ui/components/package-managers/package-managers.d.ts
35
35
  type CommandType = "add" | "create" | "exec" | "run";
@@ -50,26 +50,26 @@ declare function PackageManagers({
50
50
  dev,
51
51
  args,
52
52
  className
53
- }: PackageManagersProps): react_jsx_runtime7.JSX.Element;
53
+ }: PackageManagersProps): react_jsx_runtime0.JSX.Element;
54
54
  //#endregion
55
55
  //#region src/ui/components/tabs/tabs.d.ts
56
56
  declare function Tabs({
57
57
  orientation,
58
58
  className,
59
59
  ...props
60
- }: Tabs$1.Root.Props): react_jsx_runtime7.JSX.Element;
60
+ }: Tabs$1.Root.Props): react_jsx_runtime0.JSX.Element;
61
61
  declare function TabsList({
62
62
  className,
63
63
  ...props
64
- }: Tabs$1.List.Props): react_jsx_runtime7.JSX.Element;
64
+ }: Tabs$1.List.Props): react_jsx_runtime0.JSX.Element;
65
65
  declare function TabsTrigger({
66
66
  className,
67
67
  ...props
68
- }: Tabs$1.Tab.Props): react_jsx_runtime7.JSX.Element;
68
+ }: Tabs$1.Tab.Props): react_jsx_runtime0.JSX.Element;
69
69
  declare function TabsContent({
70
70
  className,
71
71
  ...props
72
- }: Tabs$1.Panel.Props): react_jsx_runtime7.JSX.Element;
72
+ }: Tabs$1.Panel.Props): react_jsx_runtime0.JSX.Element;
73
73
  //#endregion
74
74
  //#region src/ui/routes/prestige-shell.d.ts
75
75
  interface PrestigeShellProps {
@@ -81,13 +81,13 @@ declare function PrestigeShell({
81
81
  }: {
82
82
  children: ReactNode;
83
83
  options?: PrestigeShellProps;
84
- }): react_jsx_runtime7.JSX.Element;
84
+ }): react_jsx_runtime0.JSX.Element;
85
85
  //#endregion
86
86
  //#region src/ui/core/header/header.d.ts
87
87
  type HeaderProps = Pick<PrestigeShellProps, "customHeaderTitle">;
88
88
  declare function Header({
89
89
  customHeaderTitle
90
- }: HeaderProps): react_jsx_runtime7.JSX.Element;
90
+ }: HeaderProps): react_jsx_runtime0.JSX.Element;
91
91
  //#endregion
92
92
  //#region src/ui/routes/content/content-navigations.d.ts
93
93
  interface NavigationLink {
@@ -107,18 +107,18 @@ declare function PrestigePage({
107
107
  toc,
108
108
  prev,
109
109
  next
110
- }: PrestigePageProps): react_jsx_runtime7.JSX.Element;
110
+ }: PrestigePageProps): react_jsx_runtime0.JSX.Element;
111
111
  //#endregion
112
112
  //#region src/ui/routes/collection/collection.route.d.ts
113
113
  declare function CollectionRoute(sidebar: SidebarType, id: string): {
114
- component: () => react_jsx_runtime7.JSX.Element;
114
+ component: () => react_jsx_runtime0.JSX.Element;
115
115
  };
116
116
  //#endregion
117
117
  //#region src/ui/routes/content/content.route.d.ts
118
118
  declare function ContentRoute(inlineData: any): any;
119
119
  //#endregion
120
120
  //#region src/ui/routes/not-found.d.ts
121
- declare function NotFound(): react_jsx_runtime7.JSX.Element;
121
+ declare function NotFound(): react_jsx_runtime0.JSX.Element;
122
122
  //#endregion
123
123
  export { Aside, type AsideProps, type AsideType, Code, type CodeProps, CollectionRoute, ContentRoute, Header, NotFound, PackageManagers, type PackageManagersProps, PrestigePage, type PrestigePageProps, type PrestigeShellProps as PrestigeRootRouteOptions, PrestigeShell, Tabs, TabsContent, TabsList, TabsTrigger };
124
124
  //# sourceMappingURL=ui.d.ts.map
package/dist/vite.js CHANGED
@@ -615,12 +615,12 @@ function prestige(inlineConfig) {
615
615
  sidebarsMap = await resolveSidebars(collections, contentDir);
616
616
  logger_default.info("Resolving content links...", { timestamp: true });
617
617
  internalLinksMap = resolveContentInternalLinks(sidebarsMap);
618
- logger_default.info("Resolving collection navigations...", { timestamp: true });
618
+ logger_default.info("Resolving collection navigations....", { timestamp: true });
619
619
  collectionNavigations = resolveCollectionNavigations(collections, internalLinksMap);
620
620
  const routesDir = join(resolvedConfig.root, "src", "routes");
621
621
  logger_default.info("Compiling routes...", { timestamp: true });
622
622
  await compileRoutes(internalLinksMap, routesDir);
623
- logger_default.info("Warming up compiler...", { timestamp: true });
623
+ logger_default.info("Warming up shiki compiler...", { timestamp: true });
624
624
  warmupCompiler(config.markdown);
625
625
  },
626
626
  resolveId(id) {
package/dist/vite.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"vite.js","names":["CollectionGroupSchema: z.ZodType<CollectionGroup, CollectionGroup>","CollectionItemSchema: z.ZodType<CollectionItem, CollectionItem>","data","typeMap: Record<\"note\" | \"tip\" | \"caution\" | \"danger\", string>","titleChildren: any[]","toc: TocItem[]","shikiOptions: RehypeShikiOptions","sidebarLinks: InternalSidebarLinkType[]","processItem","prev: InternalSidebarLinkType | undefined","next: InternalSidebarLinkType | undefined","join","items: SidebarItemType[]","group: CollectionGroup","join","collections: CollectionNavigation[]","config: PrestigeConfig","contentDir: string","isDocsMatcher: Matcher","collections: Collections","internalLinksMap: Map<string, InternalSidebarLinkType[]>","collectionNavigations: string","sidebarsMap: Map<string, SidebarType>"],"sources":["../src/vite/utils/errors.ts","../src/vite/core/content/content.types.ts","../src/vite/config/config.types.ts","../src/vite/utils/file-utils.ts","../src/vite/config/config.ts","../src/vite/content/content-compiler.ts","../src/vite/content/content-links.ts","../src/vite/utils/logger.ts","../src/vite/content/content.store.ts","../src/vite/content/content-sidebar.store.ts","../src/vite/content/router-compiler.ts","../src/vite/utils/code-generation.ts","../src/vite/core/content/content-collection.store.ts","../src/vite/plugin.ts"],"sourcesContent":["import { type ZodType, input } from \"zod\";\n\nexport class PrestigeError extends Error {}\n\n/**\n * Parse data with zod schema and if fails throw PrestigeError that is friendly error\n * for prestige ecosystem\n */\nexport function parseWithFriendlyErrors<T extends ZodType>(s: T, input: input<T>, message: string) {\n try {\n return s.parse(input);\n } catch (e) {\n if (e instanceof Error) {\n throw new PrestigeError(`Prestige error cause: ${message}, with error: ${e.message} `);\n } else {\n throw new PrestigeError(`Prestige error cause: ${message} `);\n }\n }\n}\n","import { z } from \"zod\";\n\nexport const ContentFrontmatterSchema = z.object({\n title: z.string().describe(\"The title of the article\"),\n description: z.string().optional().describe(\"The description of the article\"),\n label: z.string().optional().describe(\"The label of the content\"),\n});\n\nexport type ContentFrontmatterType = z.infer<typeof ContentFrontmatterSchema>;\n\nexport const ContentSchema = z.object({\n matter: ContentFrontmatterSchema,\n html: z.string().describe(\"The html of the content\"),\n});\n\nexport type ContentType = z.infer<typeof ContentSchema>;\n\nconst InternalCollectionLinkSchema = z.union([\n z.object({\n label: z.string(),\n slug: z.string(),\n }),\n z.string(),\n]);\n\nconst ExternalCollectionLinkSchema = z.object({\n label: z.string(),\n link: z.string(),\n});\n\nexport type ExternalCollectionLink = z.infer<\n typeof ExternalCollectionLinkSchema\n>;\n\nexport type InternalCollectionLink = z.infer<\n typeof InternalCollectionLinkSchema\n>;\n\nexport type CollectionGroup = {\n label: string;\n items?: CollectionItem[] | undefined;\n collapsible?: boolean | undefined;\n autogenerate?: { directory: string } | undefined;\n};\n\nexport type CollectionItem =\n | InternalCollectionLink\n | CollectionGroup\n | ExternalCollectionLink;\n\nconst CollectionGroupSchema: z.ZodType<CollectionGroup, CollectionGroup> =\n z.object({\n label: z.string(),\n items: z.lazy(() => z.array(CollectionItemSchema)).optional(),\n collapsible: z.boolean().optional(),\n autogenerate: z\n .object({\n directory: z.string(),\n })\n .optional(),\n });\n\nconst CollectionItemSchema: z.ZodType<CollectionItem, CollectionItem> = z.union(\n [\n ExternalCollectionLinkSchema,\n InternalCollectionLinkSchema,\n z.lazy(() => CollectionGroupSchema),\n ],\n);\n\nexport const CollectionSchema = z.object({\n id: z\n .string()\n .min(1, { message: \"Folder name cannot be empty\" })\n .max(50, { message: \"Folder name too long\" })\n // Allows alphanumeric, hyphens, and underscores\n .regex(/^[a-zA-Z0-9-_]+$/, {\n message: \"Only alphanumeric, hyphens, and underscores allowed\",\n })\n .describe(\"The id of the collection, must match the folder name\"),\n items: z.array(CollectionItemSchema),\n label: z.string().optional().describe(\"The label of the collection\"),\n defaultLink: z\n .string()\n .optional()\n .describe(\"The default link of the collection\"),\n});\n\nexport type Collection = z.infer<typeof CollectionSchema>;\n\nexport type CollectionNavigation = {\n id: string;\n label: string;\n defaultLink?: string;\n};\n\nexport type CollectionInput = z.input<typeof CollectionSchema>;\n\nexport const CollectionsSchema = z.array(CollectionSchema);\n\nexport type Collections = z.infer<typeof CollectionsSchema>;\n\nexport interface InternalSidebarLinkType {\n slug: string;\n label: string;\n}\n\nexport interface ExternalSidebarLinkType {\n label: string;\n link: string;\n}\n\nexport type SidebarLinkType = InternalSidebarLinkType | ExternalSidebarLinkType;\n\nexport interface SidebarGroupType {\n label: string;\n items: SidebarItemType[];\n collapsible?: boolean | undefined;\n}\n\nexport type SidebarItemType =\n | InternalSidebarLinkType\n | SidebarGroupType\n | ExternalSidebarLinkType;\n\nexport interface SidebarType {\n items: SidebarItemType[];\n defaultLink: string;\n}\n","import { RehypeShikiOptions } from \"@shikijs/rehype\";\nimport { FlexibleTocOptions } from \"remark-flexible-toc\";\nimport type { Options as RemarkGfmOptions } from \"remark-gfm\";\nimport { PluggableList } from \"unified\";\nimport { z } from \"zod\";\nimport { CollectionsSchema } from \"../core/content/content.types\";\n\nexport const PrestigeConfigSchema = z.object({\n title: z.string().describe(\"Title of the website\"),\n github: z.string().optional().describe(\"Github repo\"),\n algolia: z\n .object({\n appId: z.string().describe(\"Algolia app id\"),\n apiKey: z.string().describe(\"Algolia api key\"),\n indices: z.array(z.string()).describe(\"Algolia indices\"),\n })\n .optional()\n .describe(\"Algolia options\"),\n license: z\n .object({\n label: z.string().describe(\"License label\"),\n url: z.string().describe(\"License url\"),\n })\n .optional()\n .describe(\"License options\"),\n collections: CollectionsSchema,\n markdown: z\n .object({\n shikiOptions: z\n .custom<RehypeShikiOptions>()\n .optional()\n .describe(\"Options for Shiki syntax highlighting\"),\n gfmOptions: z\n .custom<RemarkGfmOptions>()\n .optional()\n .describe(\"Options for remark-gfm\"),\n rehypePlugins: z\n .custom<PluggableList>()\n .optional()\n .describe(\"Additional rehype plugins\"),\n remarkPlugins: z\n .custom<PluggableList>()\n .optional()\n .describe(\"Additional remark plugins\"),\n remarkFlexibleToc: z\n .custom<FlexibleTocOptions>()\n .optional()\n .describe(\"Options for remark-flexible-toc\"),\n rehypeSlug: z\n .custom<{\n prefix?: string;\n }>()\n .optional()\n .describe(\"Options for rehype-slug\"),\n })\n .optional()\n .describe(\"Markdown options, configure how markdown is parsed\"),\n});\n\nexport type PrestigeConfigInput = z.input<typeof PrestigeConfigSchema>;\nexport type PrestigeConfig = z.infer<typeof PrestigeConfigSchema>;\n","import { mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"pathe\";\n\nexport async function pathExists(path: string) {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string) {\n await mkdir(dirPath, { recursive: true });\n}\n\nexport async function outputFile(\n filePath: string,\n data: string | NodeJS.ArrayBufferView,\n) {\n const dir = dirname(filePath);\n\n // recursive: true won't throw if the dir already exists\n await mkdir(dir, { recursive: true });\n await writeFile(filePath, data);\n}\n\nexport async function rmSafe(path: string) {\n try {\n await rm(path, { recursive: true, force: true });\n return true;\n } catch {\n return false;\n }\n}\n\n// Helper function to extract the virtual ID from a messy path\nexport function extractVirtualId(fullId: string, virtualPrefix: string) {\n const startIndex = fullId.indexOf(virtualPrefix);\n if (startIndex !== -1) {\n // Slice from the start of the virtual prefix to the end of the string\n return \"\\0\" + fullId.slice(startIndex);\n }\n return null;\n}\n","import { parseWithFriendlyErrors, PrestigeError } from \"../utils/errors\";\nimport { PrestigeConfigInput, PrestigeConfigSchema } from \"./config.types\";\nimport { join } from \"pathe\";\nimport { pathExists } from \"../utils/file-utils\";\n\nexport function validateConfig(config: PrestigeConfigInput) {\n return parseWithFriendlyErrors(PrestigeConfigSchema, config, \"Invalid schema\");\n}\n\nexport async function resolvePrestigeConfig(\n configInput: PrestigeConfigInput | undefined,\n root: string,\n) {\n if (!configInput) {\n throw new PrestigeError(\"Prestige config is required\");\n }\n\n const validatedConfig = validateConfig(configInput);\n const docsDirPath = join(root, \"src/content\");\n\n if (!(await pathExists(docsDirPath))) {\n throw new PrestigeError(`Docs! directory not found: ${docsDirPath}`);\n }\n\n return { config: validatedConfig, fullDocsDir: docsDirPath };\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport rehypeShiki, { RehypeShikiOptions } from \"@shikijs/rehype\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkFlexibleToc, { TocItem } from \"remark-flexible-toc\";\nimport remarkFrontmatter from \"remark-frontmatter\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkDirective from \"remark-directive\";\nimport { PluggableList } from \"unified\";\nimport { Compatible, VFile } from \"vfile\";\nimport { matter } from \"vfile-matter\";\nimport { PrestigeConfig } from \"../config/config.types\";\n\nimport { visit } from \"unist-util-visit\";\nimport { h } from \"hastscript\";\nimport type { Node } from \"unist\";\n\nexport default function remarkAdmonitions() {\n return (tree: Node) => {\n visit(tree, (node: any) => {\n if (\n node.type === \"textDirective\" ||\n node.type === \"leafDirective\" ||\n node.type === \"containerDirective\"\n ) {\n if (node.type !== \"containerDirective\") {\n const data = node.data || (node.data = {});\n const hast = h(node.type === \"textDirective\" ? \"span\" : \"aside\", {\n className: [\"admonition\", `admonition-${node.name}`],\n ...node.attributes,\n });\n data.hName = hast.tagName;\n data.hProperties = hast.properties;\n return;\n }\n\n const type = [\"note\", \"tip\", \"caution\", \"danger\"].includes(node.name)\n ? node.name\n : \"note\";\n\n const typeMap: Record<\"note\" | \"tip\" | \"caution\" | \"danger\", string> = {\n note: \"bg-blue-50/50 dark:bg-blue-900/20 border-blue-500 text-blue-900 dark:text-blue-200\",\n tip: \"bg-purple-50/50 dark:bg-purple-900/20 border-purple-500 text-purple-900 dark:text-purple-200\",\n caution:\n \"bg-yellow-50/50 dark:bg-yellow-900/20 border-yellow-500 text-yellow-900 dark:text-yellow-200\",\n danger:\n \"bg-red-50/50 dark:bg-red-900/20 border-red-500 text-red-900 dark:text-red-200\",\n };\n\n const data = node.data || (node.data = {});\n data.hName = \"aside\";\n data.hProperties = {\n \"aria-label\": type.charAt(0).toUpperCase() + type.slice(1),\n className: [\n \"relative\",\n \"my-6\",\n \"px-4\",\n \"py-3\",\n \"border-l-4\",\n \"rounded-lg\",\n ...(typeMap[type as keyof typeof typeMap] || typeMap[\"note\"]).split(\n \" \",\n ),\n ],\n ...node.attributes,\n };\n\n let titleNodeIndex = node.children.findIndex(\n (c: any) => c.data?.directiveLabel,\n );\n let titleChildren: any[];\n\n if (titleNodeIndex !== -1) {\n titleChildren = node.children[titleNodeIndex].children;\n node.children.splice(titleNodeIndex, 1);\n } else {\n titleChildren = [\n {\n type: \"text\",\n value: type.charAt(0).toUpperCase() + type.slice(1),\n },\n ];\n }\n\n const getIconHast = (t: string) => {\n const props = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n className: [\"w-5\", \"h-5\", \"flex-shrink-0\"],\n };\n if (t === \"note\")\n return h(\"svg\", props, [\n h(\"circle\", { cx: \"12\", cy: \"12\", r: \"10\" }),\n h(\"path\", { d: \"M12 16v-4\" }),\n h(\"path\", { d: \"M12 8h.01\" }),\n ]);\n if (t === \"tip\")\n return h(\"svg\", props, [\n h(\"path\", {\n d: \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z\",\n }),\n h(\"path\", {\n d: \"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z\",\n }),\n h(\"path\", { d: \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0\" }),\n h(\"path\", { d: \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" }),\n ]);\n if (t === \"caution\")\n return h(\"svg\", props, [\n h(\"path\", {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\",\n }),\n h(\"path\", { d: \"M12 9v4\" }),\n h(\"path\", { d: \"M12 17h.01\" }),\n ]);\n if (t === \"danger\")\n return h(\"svg\", props, [\n h(\"polygon\", {\n points:\n \"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\",\n }),\n h(\"path\", { d: \"M12 8v4\" }),\n h(\"path\", { d: \"M12 16h.01\" }),\n ]);\n return null;\n };\n\n const titleBlock = {\n type: \"paragraph\",\n data: {\n hName: \"p\",\n hProperties: {\n className: [\n \"flex\",\n \"items-center\",\n \"gap-2\",\n \"mb-2\",\n \"mt-0\",\n \"font-bold\",\n \"text-lg\",\n ],\n },\n },\n children: [\n {\n type: \"text\",\n value: \"\",\n data: { hName: \"span\", hChildren: [getIconHast(type)] },\n },\n ...titleChildren,\n ],\n };\n\n const contentBlock = {\n type: \"paragraph\",\n data: {\n hName: \"section\",\n hProperties: {\n className: [\n \"[&>p]:mt-0\",\n \"[&>p]:mb-2\",\n \"[&>p:last-child]:mb-0\",\n \"text-sm\",\n ],\n },\n },\n children: node.children,\n };\n\n node.children = [titleBlock, contentBlock];\n }\n });\n };\n}\n\nexport async function compileMarkdown(\n content: Readonly<Compatible>,\n baseUrl: string,\n options?: PrestigeConfig[\"markdown\"],\n) {\n const toc: TocItem[] = [];\n\n const shikiOptions: RehypeShikiOptions = {\n themes: {\n light: \"github-light\",\n dark: \"github-dark\",\n },\n ...options?.shikiOptions,\n };\n\n const rehypePlugins: PluggableList = [\n ...(options?.rehypePlugins ?? []),\n [rehypeShiki, shikiOptions],\n rehypeSlug,\n ];\n\n const remarkPlugins: PluggableList = [\n ...(options?.remarkPlugins ?? []),\n remarkFrontmatter,\n [remarkGfm, options?.gfmOptions || {}],\n remarkDirective,\n remarkAdmonitions,\n [remarkFlexibleToc, { tocRef: toc }],\n ];\n\n const code = await compile(content, {\n outputFormat: \"program\",\n rehypePlugins,\n remarkPlugins,\n baseUrl: baseUrl,\n });\n return { code: String(code), toc };\n}\n\nexport async function compileFrontmatter(vFile: VFile) {\n matter(vFile, { strip: true });\n return vFile.data[\"matter\"] || {};\n}\n\nexport function warmupCompiler(options?: PrestigeConfig[\"markdown\"]) {\n compileMarkdown(\"```js\\n```\", \"http://localhost\", options).catch(() => {});\n}\n","import { InternalSidebarLinkType, SidebarItemType, SidebarType } from \"../core/content/content.types\";\n\nexport function resolveContentInternalLinks(sidebars: Map<string, SidebarType>) {\n const links = new Map<string, InternalSidebarLinkType[]>();\n for (const [key, sidebar] of sidebars) {\n const sidebarLinks: InternalSidebarLinkType[] = [];\n for (const item of sidebar.items) {\n processItem(item, sidebarLinks);\n }\n links.set(key, sidebarLinks);\n }\n return links;\n}\n\nfunction processItem(item: SidebarItemType, links: InternalSidebarLinkType[] = []) {\n if (\"slug\" in item) {\n links.push(item);\n } else if (\"items\" in item) {\n for (const childItem of item.items) {\n processItem(childItem, links);\n }\n }\n return links;\n}\n","import { createLogger } from \"vite\";\nconst logger = createLogger(undefined, { prefix: \"[Prestige]\" });\nexport default logger;\n","import { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { parse, relative } from \"pathe\";\nimport { glob } from \"tinyglobby\";\nimport { read } from \"to-vfile\";\nimport {\n InternalSidebarLinkType,\n SidebarLinkType,\n} from \"../core/content/content.types\";\nimport { compileMarkdown } from \"./content-compiler\";\n\nimport { PrestigeError } from \"../utils/errors\";\nimport { compileFrontmatter } from \"./content-compiler\";\n\nexport const CONTENT_VIRTUAL_ID = \"virtual:prestige/content/\";\n\nexport function resolveSiblings(\n base: string,\n slug: string,\n linksMap: Map<string, SidebarLinkType[]>,\n) {\n const links = linksMap.get(base);\n if (!links?.length) {\n return { prev: undefined, next: undefined };\n }\n const linkIndex = links\n .filter((l) => \"slug\" in l)\n .findIndex((link) => link.slug === slug);\n\n let prev: InternalSidebarLinkType | undefined;\n let next: InternalSidebarLinkType | undefined;\n if (linkIndex > 0) {\n prev = links[linkIndex - 1] as InternalSidebarLinkType;\n }\n if (linkIndex < links.length - 1) {\n next = links[linkIndex + 1] as InternalSidebarLinkType;\n }\n return { prev, next };\n}\n\nexport async function resolveMarkdown(slug: string, contentDir: string) {\n const filePath = await getPathBySlug(slug, contentDir);\n const baseUrl = pathToFileURL(filePath).href;\n const file = await read(filePath);\n const frontmatter = await compileFrontmatter(file);\n const { code, toc } = await compileMarkdown(file, baseUrl);\n return { code, toc, frontmatter };\n}\n\nexport async function resolveContent(\n id: string,\n linksMap: Map<string, SidebarLinkType[]>,\n contentDir: string,\n) {\n const slug = id.replace(CONTENT_VIRTUAL_ID, \"\").replace(\"\\0\", \"\");\n const base = slug.split(\"/\")[0] as string;\n\n const { prev, next } = resolveSiblings(base, slug, linksMap);\n const { toc, code, frontmatter } = await resolveMarkdown(slug, contentDir);\n let resolvedCode = code;\n\n resolvedCode += `\\n export const toc = ${JSON.stringify(toc)}\\n`;\n resolvedCode += `\\n export const prev = ${JSON.stringify(prev)}\\n`;\n resolvedCode += `\\n export const next = ${JSON.stringify(next)}\\n`;\n resolvedCode += `\\n export const frontmatter = ${JSON.stringify(\n frontmatter,\n )}\\n`;\n return resolvedCode;\n}\n\nexport async function getPathBySlug(slug: string, contentDir: string) {\n const pathMatch = join(contentDir, slug);\n const matches = await glob(`${pathMatch}.{md,mdx}`);\n if (matches.length === 0) {\n throw new PrestigeError(\n `[Prestige] Could not find markdown file for slug: \"${slug}\". Searched at: ${pathMatch}.{md,mdx}. If you want to link to a custom page, use 'link: \"${slug}\"' instead of 'slug: \"${slug}\"' in your collection config.`,\n );\n }\n return matches[0] as string;\n}\n\nexport async function getFileBySlug(slug: string, contentDir: string) {\n return await read(await getPathBySlug(slug, contentDir));\n}\n\nexport function getVirtualModuleIdsForFile(path: string, contentDir: string) {\n const slug = getSlugByPath(path, contentDir);\n return [\"\\0\" + CONTENT_VIRTUAL_ID + slug];\n}\n\nexport function getSlugByPath(path: string, contentDir: string) {\n // 1. Get the relative path: \"zz/zz/myFile.json\"\n const relativePath = relative(contentDir, path);\n\n // 2. Parse the path to separate the extension\n const pathInfo = parse(relativePath);\n\n const result = join(pathInfo.dir, pathInfo.name);\n\n return result;\n}\n","import { readdir } from \"node:fs/promises\";\nimport { basename } from \"node:path\";\nimport { join } from \"pathe\";\nimport {\n Collection,\n CollectionGroup,\n CollectionItem,\n Collections,\n ExternalSidebarLinkType,\n InternalCollectionLink,\n InternalSidebarLinkType,\n SidebarGroupType,\n SidebarItemType,\n SidebarType,\n} from \"../core/content/content.types\";\nimport { PrestigeError } from \"../utils/errors\";\nimport { pathExists } from \"../utils/file-utils\";\nimport logger from \"../utils/logger\";\nimport { compileFrontmatter } from \"./content-compiler\";\nimport { getFileBySlug } from \"./content.store\";\n\nexport const SIDEBAR_VIRTUAL_ID = \"virtual:prestige/sidebar/\";\n\nfunction resolveDefaultLink(\n items: SidebarItemType[],\n defaultLink?: string,\n): string | undefined {\n if (defaultLink) {\n return defaultLink;\n }\n for (const item of items) {\n if (\"slug\" in item) {\n return item.slug;\n } else if (\"link\" in item) {\n return item.link;\n } else if (\"items\" in item && item.items.length > 0) {\n const link = resolveDefaultLink(item.items);\n if (link) return link;\n }\n }\n return undefined;\n}\n\nexport async function resolveSidebars(\n collections: Collections,\n contentDir: string,\n) {\n const store = new Map<string, SidebarType>();\n\n for (const collection of collections) {\n const sidebar = await processCollection(collection, contentDir);\n store.set(collection.id, sidebar);\n }\n return store;\n}\n\n/** @visibleForTesting */\nasync function processCollection(\n collection: Collection,\n contentDir: string,\n): Promise<SidebarType> {\n const items: SidebarItemType[] = [];\n for (const item of collection.items) {\n items.push(await processItem(item, contentDir));\n }\n const defaultLink = resolveDefaultLink(items, collection.defaultLink);\n if (!defaultLink) {\n throw new PrestigeError(\n `No default link found in collection, it means there are no links in the collection. Please define one in ${collection.id}`,\n );\n }\n return {\n items,\n defaultLink: defaultLink,\n };\n}\n\n/** @visibleForTesting */\nasync function processItem(\n item: CollectionItem,\n contentDir: string,\n): Promise<SidebarItemType> {\n if (typeof item === \"string\" || \"slug\" in item) {\n return resolveInternalSidebarLink(\n item as InternalCollectionLink,\n contentDir,\n );\n } else if (\"link\" in item) {\n return resolveSidebarLink(item, contentDir);\n } else {\n return resolveSidebarGroup(item as CollectionGroup, contentDir);\n }\n}\n\n/** @visibleForTesting */\nasync function resolveSidebarGroup(\n group: CollectionGroup,\n contentDir: string,\n): Promise<SidebarGroupType> {\n const label = await resolveLabel(group, contentDir);\n const items: SidebarItemType[] = [];\n\n if (group.items?.length && group.autogenerate) {\n logger.warn(\n `${group.label} has both items and autogenerate. Only items will be used.`,\n );\n }\n\n if (group.items) {\n for (const childItem of group.items) {\n items.push(await processItem(childItem, contentDir));\n }\n } else if (group.autogenerate?.directory) {\n const generatedItems = await autogenerateSidebar(\n group.autogenerate.directory,\n contentDir,\n );\n items.push(...generatedItems);\n }\n\n return {\n label,\n collapsible: group.collapsible,\n items,\n };\n}\n\n/** @visibleForTesting */\nasync function resolveInternalSidebarLink(\n item: InternalCollectionLink,\n contentDir: string,\n): Promise<InternalSidebarLinkType> {\n const label = await resolveLabel(item, contentDir);\n const slug = resolveSlug(item);\n\n if (slug.startsWith(\"/\") || slug.endsWith(\"/\")) {\n throw new PrestigeError(\n `The slug ${slug} cannot start or end with a slash. Remove it and try again.`,\n );\n }\n\n if (!slug) {\n throw new PrestigeError(\n `The slug cannot be empty. Remove it and try again. link label is ${label}`,\n );\n }\n\n return {\n label,\n slug,\n };\n}\n\n/** @visibleForTesting */\nasync function resolveSidebarLink(\n item: ExternalSidebarLinkType,\n contentDir: string,\n): Promise<ExternalSidebarLinkType> {\n const label = await resolveLabel(item, contentDir);\n const link = resolveLink(item);\n\n if (!link) {\n throw new PrestigeError(\n `The link cannot be empty. Remove it and try again. link label is ${label}`,\n );\n }\n\n return {\n label,\n link,\n };\n}\n\n/** @visibleForTesting */\nasync function autogenerateSidebar(\n directory: string,\n contentDir: string,\n): Promise<SidebarItemType[]> {\n const fileExtRegex = /\\.mdx?$/i;\n\n const items: SidebarItemType[] = [];\n const dirPath = join(contentDir, directory);\n if (!(await pathExists(dirPath))) {\n logger.warn(`Directory doesn't exist: ${directory}`);\n return [];\n }\n\n const dirents = await readdir(dirPath, { withFileTypes: true });\n dirents.sort((a, b) => a.name.localeCompare(b.name));\n for (const dirent of dirents) {\n if (dirent.isDirectory()) {\n const subDir = join(directory, dirent.name);\n const group: CollectionGroup = {\n label: dirent.name,\n autogenerate: { directory: subDir },\n };\n items.push(await resolveSidebarGroup(group, contentDir));\n } else if (dirent.isFile() && fileExtRegex.test(dirent.name)) {\n const fullPath = join(directory, dirent.name);\n const slug = fullPath.replace(fileExtRegex, \"\");\n items.push(await resolveInternalSidebarLink(slug, contentDir));\n }\n }\n return items;\n}\n\n/** @visibleForTesting */\nasync function resolveLabel(\n item: CollectionItem,\n contentDir: string,\n): Promise<string> {\n if (typeof item !== \"string\" && \"label\" in item && item.label) {\n return item.label;\n }\n\n if (typeof item === \"string\" || \"slug\" in item) {\n const slug = resolveSlug(item);\n\n const file = await getFileBySlug(slug, contentDir);\n if (!file) {\n throw new PrestigeError(\n `markdown file not found with slug: ${slug} add one in content folder or update config`,\n );\n }\n const data = (await compileFrontmatter(file)) as any;\n if (data?.label) {\n return data?.label;\n }\n\n return basename(slug);\n }\n\n // is a group\n if (typeof item !== \"string\" && (\"items\" in item || \"autogenerate\" in item)) {\n return item.label;\n }\n\n return \"\";\n}\n\n/** @visibleForTesting */\nexport function resolveSlug(item: CollectionItem) {\n if (typeof item === \"string\") {\n return item;\n } else {\n if (\"slug\" in item) {\n return item.slug;\n }\n return \"\";\n }\n}\n\n/** @visibleForTesting */\nexport function resolveLink(item: CollectionItem) {\n if (typeof item === \"object\" && \"link\" in item) {\n return item.link;\n }\n return \"\";\n}\n","import { mkdir, readdir, readFile, unlink, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { SidebarLinkType } from \"../core/content/content.types\";\nimport logger from \"../utils/logger\";\n\nexport async function compileRoutes(\n linksMap: Map<string, SidebarLinkType[]>,\n routesDir: string,\n) {\n const prestigePath = \"(prestige)\";\n const prestigeFullPath = join(routesDir, prestigePath);\n\n try {\n await mkdir(prestigeFullPath, { recursive: true });\n\n const generatedFiles = new Map<string, string>();\n\n for (const [key, links] of linksMap) {\n const onlyInternalLinks = links.filter((l) => \"slug\" in l);\n\n const sidebarPath = key;\n const sidebarFile = sidebarPath + \".lazy.tsx\";\n generatedFiles.set(sidebarFile, createLayoutRoute(key));\n\n for (const l of onlyInternalLinks) {\n const pathified = l.slug.replaceAll(\"/\", \".\") + \".lazy.tsx\";\n generatedFiles.set(pathified, createContentRoute(l.slug));\n }\n }\n\n // Write files only if they have changed or do not exist\n await Promise.all(\n [...generatedFiles.entries()].map(async ([fileName, contents]) => {\n const filePath = join(prestigeFullPath, fileName);\n try {\n const existingContent = await readFile(filePath, \"utf-8\");\n if (existingContent === contents) {\n return; // Skip writing if identical\n }\n } catch (e) {\n // File doesn't exist yet, proceed to write\n }\n logger.info(`Writing route file: ${fileName}`, { timestamp: true });\n return writeFile(filePath, contents);\n }),\n );\n\n const existingFiles = await readdir(prestigeFullPath);\n const staleFiles = existingFiles.filter(\n (fileName) =>\n fileName.endsWith(\".lazy.tsx\") && !generatedFiles.has(fileName),\n );\n\n await Promise.all(\n staleFiles.map((fileName) => {\n logger.info(`Removing stale route file: ${fileName}`, {\n timestamp: true,\n });\n return unlink(join(prestigeFullPath, fileName));\n }),\n );\n } catch (error) {\n logger.error(\n `[Prestige Router Compiler] Failed to compile routes: ${error}`,\n { timestamp: true },\n );\n console.error(\n \"[Prestige Router Compiler] Failed to compile routes:\",\n error,\n );\n }\n}\n\nfunction createLayoutRoute(id: string) {\n return (\n `\nimport { createLazyFileRoute } from '@tanstack/react-router';\nimport sidebar from \"virtual:prestige/sidebar/${id}\";\nimport { CollectionRoute } from \"@lonik/prestige/ui\";\n\nexport const Route = createLazyFileRoute('/(prestige)/${id}')(CollectionRoute(sidebar, \"${id}\"));\n`.trim() + \"\\n\"\n );\n}\n\nfunction createContentRoute(slug: string) {\n return (\n `\nimport { createLazyFileRoute } from \"@tanstack/react-router\";\nimport * as contentData from \"virtual:prestige/content/${slug}\";\nimport { ContentRoute } from \"@lonik/prestige/ui\";\n\nexport const Route = createLazyFileRoute('/(prestige)/${slug}')(ContentRoute(contentData));\n`.trim() + \"\\n\"\n );\n}\n","import { genDynamicImport } from \"knitwork\";\n\nexport function genExportDefault(specifier: string) {\n return `export default ${specifier};`;\n}\n\n/** exports default undefined */\nexport function genExportUndefined() {\n return genExportDefault(\"undefined\");\n}\n\nexport function genDynamicImportWithDefault(specifier: string) {\n return `${genDynamicImport(specifier)}.then(m => m.default)`;\n}\n","import { genArrayFromRaw, genObjectFromValues } from \"knitwork\";\nimport { genExportDefault } from \"../../utils/code-generation\";\nimport { PrestigeError } from \"../../utils/errors\";\nimport {\n CollectionNavigation,\n Collections,\n InternalSidebarLinkType,\n} from \"./content.types\";\n\nexport const COLLECTION_VIRTUAL_ID = \"virtual:prestige/collection-all\";\n\nexport function resolveCollectionNavigations(\n inlineCollections: Collections,\n linksMap: Map<string, InternalSidebarLinkType[]>,\n) {\n const collections: CollectionNavigation[] = inlineCollections.map((c) => ({\n id: c.id,\n label: c.label ?? c.id,\n defaultLink: c.defaultLink ?? \"\",\n }));\n if (collections.length === 0) {\n throw new PrestigeError(\n `No collections found, add one in prestige plugin config`,\n );\n }\n\n for (const coll of collections) {\n const links = linksMap.get(coll.id);\n const firstLink = links?.[0];\n if (coll.defaultLink || !firstLink) {\n continue;\n }\n coll.defaultLink = firstLink.slug;\n }\n\n for (const coll of collections) {\n if (!coll.defaultLink) {\n console.warn(\n `No default link found for collection ${coll.id}, it won't be displayed in the header navigation`,\n );\n }\n }\n\n const validCollections = collections.filter((c) => c.defaultLink);\n\n return genExportDefault(\n genArrayFromRaw(validCollections.map((c) => genObjectFromValues(c))),\n );\n}\n","import { join } from \"pathe\";\nimport picomatch, { type Matcher } from \"picomatch\";\nimport { EnvironmentModuleNode, type Plugin } from \"vite\";\nimport { resolvePrestigeConfig } from \"./config/config\";\nimport { PrestigeConfig, PrestigeConfigInput } from \"./config/config.types\";\n\nimport { genObjectFromValues } from \"knitwork\";\nimport { warmupCompiler } from \"./content/content-compiler\";\nimport { resolveContentInternalLinks } from \"./content/content-links\";\nimport {\n resolveSidebars,\n SIDEBAR_VIRTUAL_ID,\n} from \"./content/content-sidebar.store\";\nimport {\n CONTENT_VIRTUAL_ID,\n getSlugByPath,\n resolveContent,\n} from \"./content/content.store\";\nimport { compileRoutes } from \"./content/router-compiler\";\nimport {\n COLLECTION_VIRTUAL_ID,\n resolveCollectionNavigations,\n} from \"./core/content/content-collection.store\";\nimport {\n Collections,\n InternalSidebarLinkType,\n SidebarType\n} from \"./core/content/content.types\";\nimport { genExportDefault, genExportUndefined } from \"./utils/code-generation\";\nimport { extractVirtualId } from \"./utils/file-utils\";\nimport logger from \"./utils/logger\";\n\nexport const CONFIG_VIRTUAL_ID = \"virtual:prestige/config\";\n\nexport default function prestige(inlineConfig?: PrestigeConfigInput): Plugin {\n let config: PrestigeConfig;\n let contentDir: string;\n let isDocsMatcher: Matcher;\n let collections: Collections = [];\n let internalLinksMap: Map<string, InternalSidebarLinkType[]>;\n let collectionNavigations: string;\n let sidebarsMap: Map<string, SidebarType>;\n return {\n name: \"vite-plugin-prestige\",\n enforce: \"pre\",\n async configResolved(resolvedConfig) {\n logger.info(\"Resolving Prestige configuration...\", { timestamp: true });\n const { config: loadedConfig } = await resolvePrestigeConfig(\n inlineConfig,\n resolvedConfig.root,\n );\n config = loadedConfig;\n contentDir = join(resolvedConfig.root, \"src/content\");\n isDocsMatcher = picomatch(join(contentDir, \"**/*.{md,mdx}\"));\n collections = config.collections ?? [];\n\n logger.info(\"Resolving sidebars...\", { timestamp: true });\n sidebarsMap = await resolveSidebars(collections, contentDir);\n\n logger.info(\"Resolving content links...\", { timestamp: true });\n internalLinksMap = resolveContentInternalLinks(sidebarsMap);\n\n logger.info(\"Resolving collection navigations...\", { timestamp: true });\n collectionNavigations = resolveCollectionNavigations(\n collections,\n internalLinksMap,\n );\n\n const routesDir = join(resolvedConfig.root, \"src\", \"routes\");\n\n logger.info(\"Compiling routes...\", { timestamp: true });\n await compileRoutes(internalLinksMap, routesDir);\n\n logger.info(\"Warming up compiler...\", { timestamp: true });\n // Warm up the MDX compiler to pre-initialize the syntax highlighter (e.g. Shiki)\n // We do this non-blocking so it doesn't slow down the Vite startup.\n warmupCompiler(config.markdown);\n },\n resolveId(id) {\n // even though the import will be import * from \"virtual:prestige/docs/introduction\"\n // it is not guaranteed that some other plugin doesn't modify this import and attach full path\n // we call extractVirtualId to trim the import\n\n if (id.includes(CONFIG_VIRTUAL_ID)) {\n logger.info(`Resolving config virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, CONFIG_VIRTUAL_ID);\n }\n\n if (id.includes(CONTENT_VIRTUAL_ID)) {\n logger.info(`Resolving content virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, CONTENT_VIRTUAL_ID);\n }\n\n if (id.includes(COLLECTION_VIRTUAL_ID)) {\n logger.info(`Resolving collection virtual ID: ${id}`, {\n timestamp: true,\n });\n return extractVirtualId(id, COLLECTION_VIRTUAL_ID);\n }\n\n if (id.includes(SIDEBAR_VIRTUAL_ID)) {\n logger.info(`Resolving sidebar virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, SIDEBAR_VIRTUAL_ID);\n }\n\n return null;\n },\n async load(id) {\n if (id === `\\0${CONFIG_VIRTUAL_ID}`) {\n logger.info(`Loading config virtual module: ${id}`, {\n timestamp: true,\n });\n return genExportDefault(JSON.stringify(config));\n }\n if (id.includes(CONTENT_VIRTUAL_ID)) {\n logger.info(`Loading content virtual module: ${id}`, {\n timestamp: true,\n });\n return await resolveContent(id, internalLinksMap, contentDir);\n }\n if (id.includes(COLLECTION_VIRTUAL_ID)) {\n logger.info(`Loading collection virtual module: ${id}`, {\n timestamp: true,\n });\n return collectionNavigations;\n }\n\n if (id.includes(SIDEBAR_VIRTUAL_ID)) {\n logger.info(`Loading sidebar virtual module: ${id}`, {\n timestamp: true,\n });\n const sidebarId = id.replace(SIDEBAR_VIRTUAL_ID, \"\").replace(\"\\0\", \"\");\n const sidebar = sidebarsMap.get(sidebarId);\n if (!sidebar) {\n return genExportUndefined();\n }\n return genExportDefault(genObjectFromValues(sidebar));\n }\n\n return null;\n },\n\n async hotUpdate({ file, timestamp }) {\n if (isDocsMatcher(file)) {\n logger.info(`Invalidating module ${file}...`, { timestamp: true });\n const invalidatedModules = new Set<EnvironmentModuleNode>();\n const slug = getSlugByPath(file, contentDir);\n const virtualModuleId = `\\0${CONTENT_VIRTUAL_ID}${slug}`;\n const module =\n this.environment.moduleGraph.getModuleById(virtualModuleId);\n if (module) {\n this.environment.moduleGraph.invalidateModule(\n module,\n invalidatedModules,\n timestamp,\n true,\n );\n logger.info(`Reloading application...`, { timestamp: true });\n this.environment.hot.send({ type: \"full-reload\" });\n }\n }\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,gBAAb,cAAmC,MAAM;;;;;AAMzC,SAAgB,wBAA2C,GAAM,OAAiB,SAAiB;AACjG,KAAI;AACF,SAAO,EAAE,MAAM,MAAM;UACd,GAAG;AACV,MAAI,aAAa,MACf,OAAM,IAAI,cAAc,yBAAyB,QAAQ,gBAAgB,EAAE,QAAQ,GAAG;MAEtF,OAAM,IAAI,cAAc,yBAAyB,QAAQ,GAAG;;;;;;ACblE,MAAa,2BAA2B,EAAE,OAAO;CAC/C,OAAO,EAAE,QAAQ,CAAC,SAAS,2BAA2B;CACtD,aAAa,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,iCAAiC;CAC7E,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,2BAA2B;CAClE,CAAC;AAIF,MAAa,gBAAgB,EAAE,OAAO;CACpC,QAAQ;CACR,MAAM,EAAE,QAAQ,CAAC,SAAS,0BAA0B;CACrD,CAAC;AAIF,MAAM,+BAA+B,EAAE,MAAM,CAC3C,EAAE,OAAO;CACP,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ;CACjB,CAAC,EACF,EAAE,QAAQ,CACX,CAAC;AAEF,MAAM,+BAA+B,EAAE,OAAO;CAC5C,OAAO,EAAE,QAAQ;CACjB,MAAM,EAAE,QAAQ;CACjB,CAAC;AAsBF,MAAMA,wBACJ,EAAE,OAAO;CACP,OAAO,EAAE,QAAQ;CACjB,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC,CAAC,UAAU;CAC7D,aAAa,EAAE,SAAS,CAAC,UAAU;CACnC,cAAc,EACX,OAAO,EACN,WAAW,EAAE,QAAQ,EACtB,CAAC,CACD,UAAU;CACd,CAAC;AAEJ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C,QAAI,CAAC,QACH,QAAO,oBAAoB;AAE7B,WAAO,iBAAiB,oBAAoB,QAAQ,CAAC;;AAGvD,UAAO;;EAGT,MAAM,UAAU,EAAE,MAAM,aAAa;AACnC,OAAI,cAAc,KAAK,EAAE;AACvB,mBAAO,KAAK,uBAAuB,KAAK,MAAM,EAAE,WAAW,MAAM,CAAC;IAClE,MAAM,qCAAqB,IAAI,KAA4B;IAE3D,MAAM,kBAAkB,KAAK,qBADhB,cAAc,MAAM,WAAW;IAE5C,MAAM,SACJ,KAAK,YAAY,YAAY,cAAc,gBAAgB;AAC7D,QAAI,QAAQ;AACV,UAAK,YAAY,YAAY,iBAC3B,QACA,oBACA,WACA,KACD;AACD,oBAAO,KAAK,4BAA4B,EAAE,WAAW,MAAM,CAAC;AAC5D,UAAK,YAAY,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;;;;EAIzD"}
1
+ {"version":3,"file":"vite.js","names":["CollectionGroupSchema: z.ZodType<CollectionGroup, CollectionGroup>","CollectionItemSchema: z.ZodType<CollectionItem, CollectionItem>","data","typeMap: Record<\"note\" | \"tip\" | \"caution\" | \"danger\", string>","titleChildren: any[]","toc: TocItem[]","shikiOptions: RehypeShikiOptions","sidebarLinks: InternalSidebarLinkType[]","processItem","prev: InternalSidebarLinkType | undefined","next: InternalSidebarLinkType | undefined","join","items: SidebarItemType[]","group: CollectionGroup","join","collections: CollectionNavigation[]","config: PrestigeConfig","contentDir: string","isDocsMatcher: Matcher","collections: Collections","internalLinksMap: Map<string, InternalSidebarLinkType[]>","collectionNavigations: string","sidebarsMap: Map<string, SidebarType>"],"sources":["../src/vite/utils/errors.ts","../src/vite/core/content/content.types.ts","../src/vite/config/config.types.ts","../src/vite/utils/file-utils.ts","../src/vite/config/config.ts","../src/vite/content/content-compiler.ts","../src/vite/content/content-links.ts","../src/vite/utils/logger.ts","../src/vite/content/content.store.ts","../src/vite/content/content-sidebar.store.ts","../src/vite/content/router-compiler.ts","../src/vite/utils/code-generation.ts","../src/vite/core/content/content-collection.store.ts","../src/vite/plugin.ts"],"sourcesContent":["import { type ZodType, input } from \"zod\";\n\nexport class PrestigeError extends Error {}\n\n/**\n * Parse data with zod schema and if fails throw PrestigeError that is friendly error\n * for prestige ecosystem\n */\nexport function parseWithFriendlyErrors<T extends ZodType>(s: T, input: input<T>, message: string) {\n try {\n return s.parse(input);\n } catch (e) {\n if (e instanceof Error) {\n throw new PrestigeError(`Prestige error cause: ${message}, with error: ${e.message} `);\n } else {\n throw new PrestigeError(`Prestige error cause: ${message} `);\n }\n }\n}\n","import { z } from \"zod\";\n\nexport const ContentFrontmatterSchema = z.object({\n title: z.string().describe(\"The title of the article\"),\n description: z.string().optional().describe(\"The description of the article\"),\n label: z.string().optional().describe(\"The label of the content\"),\n});\n\nexport type ContentFrontmatterType = z.infer<typeof ContentFrontmatterSchema>;\n\nexport const ContentSchema = z.object({\n matter: ContentFrontmatterSchema,\n html: z.string().describe(\"The html of the content\"),\n});\n\nexport type ContentType = z.infer<typeof ContentSchema>;\n\nconst InternalCollectionLinkSchema = z.union([\n z.object({\n label: z.string(),\n slug: z.string(),\n }),\n z.string(),\n]);\n\nconst ExternalCollectionLinkSchema = z.object({\n label: z.string(),\n link: z.string(),\n});\n\nexport type ExternalCollectionLink = z.infer<\n typeof ExternalCollectionLinkSchema\n>;\n\nexport type InternalCollectionLink = z.infer<\n typeof InternalCollectionLinkSchema\n>;\n\nexport type CollectionGroup = {\n label: string;\n items?: CollectionItem[] | undefined;\n collapsible?: boolean | undefined;\n autogenerate?: { directory: string } | undefined;\n};\n\nexport type CollectionItem =\n | InternalCollectionLink\n | CollectionGroup\n | ExternalCollectionLink;\n\nconst CollectionGroupSchema: z.ZodType<CollectionGroup, CollectionGroup> =\n z.object({\n label: z.string(),\n items: z.lazy(() => z.array(CollectionItemSchema)).optional(),\n collapsible: z.boolean().optional(),\n autogenerate: z\n .object({\n directory: z.string(),\n })\n .optional(),\n });\n\nconst CollectionItemSchema: z.ZodType<CollectionItem, CollectionItem> = z.union(\n [\n ExternalCollectionLinkSchema,\n InternalCollectionLinkSchema,\n z.lazy(() => CollectionGroupSchema),\n ],\n);\n\nexport const CollectionSchema = z.object({\n id: z\n .string()\n .min(1, { message: \"Folder name cannot be empty\" })\n .max(50, { message: \"Folder name too long\" })\n // Allows alphanumeric, hyphens, and underscores\n .regex(/^[a-zA-Z0-9-_]+$/, {\n message: \"Only alphanumeric, hyphens, and underscores allowed\",\n })\n .describe(\"The id of the collection, must match the folder name\"),\n items: z.array(CollectionItemSchema),\n label: z.string().optional().describe(\"The label of the collection\"),\n defaultLink: z\n .string()\n .optional()\n .describe(\"The default link of the collection\"),\n});\n\nexport type Collection = z.infer<typeof CollectionSchema>;\n\nexport type CollectionNavigation = {\n id: string;\n label: string;\n defaultLink?: string;\n};\n\nexport type CollectionInput = z.input<typeof CollectionSchema>;\n\nexport const CollectionsSchema = z.array(CollectionSchema);\n\nexport type Collections = z.infer<typeof CollectionsSchema>;\n\nexport interface InternalSidebarLinkType {\n slug: string;\n label: string;\n}\n\nexport interface ExternalSidebarLinkType {\n label: string;\n link: string;\n}\n\nexport type SidebarLinkType = InternalSidebarLinkType | ExternalSidebarLinkType;\n\nexport interface SidebarGroupType {\n label: string;\n items: SidebarItemType[];\n collapsible?: boolean | undefined;\n}\n\nexport type SidebarItemType =\n | InternalSidebarLinkType\n | SidebarGroupType\n | ExternalSidebarLinkType;\n\nexport interface SidebarType {\n items: SidebarItemType[];\n defaultLink: string;\n}\n","import { RehypeShikiOptions } from \"@shikijs/rehype\";\nimport { FlexibleTocOptions } from \"remark-flexible-toc\";\nimport type { Options as RemarkGfmOptions } from \"remark-gfm\";\nimport { PluggableList } from \"unified\";\nimport { z } from \"zod\";\nimport { CollectionsSchema } from \"../core/content/content.types\";\n\nexport const PrestigeConfigSchema = z.object({\n title: z.string().describe(\"Title of the website\"),\n github: z.string().optional().describe(\"Github repo\"),\n algolia: z\n .object({\n appId: z.string().describe(\"Algolia app id\"),\n apiKey: z.string().describe(\"Algolia api key\"),\n indices: z.array(z.string()).describe(\"Algolia indices\"),\n })\n .optional()\n .describe(\"Algolia options\"),\n license: z\n .object({\n label: z.string().describe(\"License label\"),\n url: z.string().describe(\"License url\"),\n })\n .optional()\n .describe(\"License options\"),\n collections: CollectionsSchema,\n markdown: z\n .object({\n shikiOptions: z\n .custom<RehypeShikiOptions>()\n .optional()\n .describe(\"Options for Shiki syntax highlighting\"),\n gfmOptions: z\n .custom<RemarkGfmOptions>()\n .optional()\n .describe(\"Options for remark-gfm\"),\n rehypePlugins: z\n .custom<PluggableList>()\n .optional()\n .describe(\"Additional rehype plugins\"),\n remarkPlugins: z\n .custom<PluggableList>()\n .optional()\n .describe(\"Additional remark plugins\"),\n remarkFlexibleToc: z\n .custom<FlexibleTocOptions>()\n .optional()\n .describe(\"Options for remark-flexible-toc\"),\n rehypeSlug: z\n .custom<{\n prefix?: string;\n }>()\n .optional()\n .describe(\"Options for rehype-slug\"),\n })\n .optional()\n .describe(\"Markdown options, configure how markdown is parsed\"),\n});\n\nexport type PrestigeConfigInput = z.input<typeof PrestigeConfigSchema>;\nexport type PrestigeConfig = z.infer<typeof PrestigeConfigSchema>;\n","import { mkdir, rm, stat, writeFile } from \"node:fs/promises\";\nimport { dirname } from \"pathe\";\n\nexport async function pathExists(path: string) {\n try {\n await stat(path);\n return true;\n } catch {\n return false;\n }\n}\n\nexport async function ensureDir(dirPath: string) {\n await mkdir(dirPath, { recursive: true });\n}\n\nexport async function outputFile(\n filePath: string,\n data: string | NodeJS.ArrayBufferView,\n) {\n const dir = dirname(filePath);\n\n // recursive: true won't throw if the dir already exists\n await mkdir(dir, { recursive: true });\n await writeFile(filePath, data);\n}\n\nexport async function rmSafe(path: string) {\n try {\n await rm(path, { recursive: true, force: true });\n return true;\n } catch {\n return false;\n }\n}\n\n// Helper function to extract the virtual ID from a messy path\nexport function extractVirtualId(fullId: string, virtualPrefix: string) {\n const startIndex = fullId.indexOf(virtualPrefix);\n if (startIndex !== -1) {\n // Slice from the start of the virtual prefix to the end of the string\n return \"\\0\" + fullId.slice(startIndex);\n }\n return null;\n}\n","import { parseWithFriendlyErrors, PrestigeError } from \"../utils/errors\";\nimport { PrestigeConfigInput, PrestigeConfigSchema } from \"./config.types\";\nimport { join } from \"pathe\";\nimport { pathExists } from \"../utils/file-utils\";\n\nexport function validateConfig(config: PrestigeConfigInput) {\n return parseWithFriendlyErrors(PrestigeConfigSchema, config, \"Invalid schema\");\n}\n\nexport async function resolvePrestigeConfig(\n configInput: PrestigeConfigInput | undefined,\n root: string,\n) {\n if (!configInput) {\n throw new PrestigeError(\"Prestige config is required\");\n }\n\n const validatedConfig = validateConfig(configInput);\n const docsDirPath = join(root, \"src/content\");\n\n if (!(await pathExists(docsDirPath))) {\n throw new PrestigeError(`Docs! directory not found: ${docsDirPath}`);\n }\n\n return { config: validatedConfig, fullDocsDir: docsDirPath };\n}\n","import { compile } from \"@mdx-js/mdx\";\nimport rehypeShiki, { RehypeShikiOptions } from \"@shikijs/rehype\";\nimport rehypeSlug from \"rehype-slug\";\nimport remarkFlexibleToc, { TocItem } from \"remark-flexible-toc\";\nimport remarkFrontmatter from \"remark-frontmatter\";\nimport remarkGfm from \"remark-gfm\";\nimport remarkDirective from \"remark-directive\";\nimport { PluggableList } from \"unified\";\nimport { Compatible, VFile } from \"vfile\";\nimport { matter } from \"vfile-matter\";\nimport { PrestigeConfig } from \"../config/config.types\";\n\nimport { visit } from \"unist-util-visit\";\nimport { h } from \"hastscript\";\nimport type { Node } from \"unist\";\n\nexport default function remarkAdmonitions() {\n return (tree: Node) => {\n visit(tree, (node: any) => {\n if (\n node.type === \"textDirective\" ||\n node.type === \"leafDirective\" ||\n node.type === \"containerDirective\"\n ) {\n if (node.type !== \"containerDirective\") {\n const data = node.data || (node.data = {});\n const hast = h(node.type === \"textDirective\" ? \"span\" : \"aside\", {\n className: [\"admonition\", `admonition-${node.name}`],\n ...node.attributes,\n });\n data.hName = hast.tagName;\n data.hProperties = hast.properties;\n return;\n }\n\n const type = [\"note\", \"tip\", \"caution\", \"danger\"].includes(node.name)\n ? node.name\n : \"note\";\n\n const typeMap: Record<\"note\" | \"tip\" | \"caution\" | \"danger\", string> = {\n note: \"bg-blue-50/50 dark:bg-blue-900/20 border-blue-500 text-blue-900 dark:text-blue-200\",\n tip: \"bg-purple-50/50 dark:bg-purple-900/20 border-purple-500 text-purple-900 dark:text-purple-200\",\n caution:\n \"bg-yellow-50/50 dark:bg-yellow-900/20 border-yellow-500 text-yellow-900 dark:text-yellow-200\",\n danger:\n \"bg-red-50/50 dark:bg-red-900/20 border-red-500 text-red-900 dark:text-red-200\",\n };\n\n const data = node.data || (node.data = {});\n data.hName = \"aside\";\n data.hProperties = {\n \"aria-label\": type.charAt(0).toUpperCase() + type.slice(1),\n className: [\n \"relative\",\n \"my-6\",\n \"px-4\",\n \"py-3\",\n \"border-l-4\",\n \"rounded-lg\",\n ...(typeMap[type as keyof typeof typeMap] || typeMap[\"note\"]).split(\n \" \",\n ),\n ],\n ...node.attributes,\n };\n\n let titleNodeIndex = node.children.findIndex(\n (c: any) => c.data?.directiveLabel,\n );\n let titleChildren: any[];\n\n if (titleNodeIndex !== -1) {\n titleChildren = node.children[titleNodeIndex].children;\n node.children.splice(titleNodeIndex, 1);\n } else {\n titleChildren = [\n {\n type: \"text\",\n value: type.charAt(0).toUpperCase() + type.slice(1),\n },\n ];\n }\n\n const getIconHast = (t: string) => {\n const props = {\n xmlns: \"http://www.w3.org/2000/svg\",\n width: \"24\",\n height: \"24\",\n viewBox: \"0 0 24 24\",\n fill: \"none\",\n stroke: \"currentColor\",\n strokeWidth: \"2\",\n strokeLinecap: \"round\",\n strokeLinejoin: \"round\",\n className: [\"w-5\", \"h-5\", \"flex-shrink-0\"],\n };\n if (t === \"note\")\n return h(\"svg\", props, [\n h(\"circle\", { cx: \"12\", cy: \"12\", r: \"10\" }),\n h(\"path\", { d: \"M12 16v-4\" }),\n h(\"path\", { d: \"M12 8h.01\" }),\n ]);\n if (t === \"tip\")\n return h(\"svg\", props, [\n h(\"path\", {\n d: \"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z\",\n }),\n h(\"path\", {\n d: \"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z\",\n }),\n h(\"path\", { d: \"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0\" }),\n h(\"path\", { d: \"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5\" }),\n ]);\n if (t === \"caution\")\n return h(\"svg\", props, [\n h(\"path\", {\n d: \"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z\",\n }),\n h(\"path\", { d: \"M12 9v4\" }),\n h(\"path\", { d: \"M12 17h.01\" }),\n ]);\n if (t === \"danger\")\n return h(\"svg\", props, [\n h(\"polygon\", {\n points:\n \"7.86 2 16.14 2 22 7.86 22 16.14 16.14 22 7.86 22 2 16.14 2 7.86 7.86 2\",\n }),\n h(\"path\", { d: \"M12 8v4\" }),\n h(\"path\", { d: \"M12 16h.01\" }),\n ]);\n return null;\n };\n\n const titleBlock = {\n type: \"paragraph\",\n data: {\n hName: \"p\",\n hProperties: {\n className: [\n \"flex\",\n \"items-center\",\n \"gap-2\",\n \"mb-2\",\n \"mt-0\",\n \"font-bold\",\n \"text-lg\",\n ],\n },\n },\n children: [\n {\n type: \"text\",\n value: \"\",\n data: { hName: \"span\", hChildren: [getIconHast(type)] },\n },\n ...titleChildren,\n ],\n };\n\n const contentBlock = {\n type: \"paragraph\",\n data: {\n hName: \"section\",\n hProperties: {\n className: [\n \"[&>p]:mt-0\",\n \"[&>p]:mb-2\",\n \"[&>p:last-child]:mb-0\",\n \"text-sm\",\n ],\n },\n },\n children: node.children,\n };\n\n node.children = [titleBlock, contentBlock];\n }\n });\n };\n}\n\nexport async function compileMarkdown(\n content: Readonly<Compatible>,\n baseUrl: string,\n options?: PrestigeConfig[\"markdown\"],\n) {\n const toc: TocItem[] = [];\n\n const shikiOptions: RehypeShikiOptions = {\n themes: {\n light: \"github-light\",\n dark: \"github-dark\",\n },\n ...options?.shikiOptions,\n };\n\n const rehypePlugins: PluggableList = [\n ...(options?.rehypePlugins ?? []),\n [rehypeShiki, shikiOptions],\n rehypeSlug,\n ];\n\n const remarkPlugins: PluggableList = [\n ...(options?.remarkPlugins ?? []),\n remarkFrontmatter,\n [remarkGfm, options?.gfmOptions || {}],\n remarkDirective,\n remarkAdmonitions,\n [remarkFlexibleToc, { tocRef: toc }],\n ];\n\n const code = await compile(content, {\n outputFormat: \"program\",\n rehypePlugins,\n remarkPlugins,\n baseUrl: baseUrl,\n });\n return { code: String(code), toc };\n}\n\nexport async function compileFrontmatter(vFile: VFile) {\n matter(vFile, { strip: true });\n return vFile.data[\"matter\"] || {};\n}\n\nexport function warmupCompiler(options?: PrestigeConfig[\"markdown\"]) {\n compileMarkdown(\"```js\\n```\", \"http://localhost\", options).catch(() => {});\n}\n","import { InternalSidebarLinkType, SidebarItemType, SidebarType } from \"../core/content/content.types\";\n\nexport function resolveContentInternalLinks(sidebars: Map<string, SidebarType>) {\n const links = new Map<string, InternalSidebarLinkType[]>();\n for (const [key, sidebar] of sidebars) {\n const sidebarLinks: InternalSidebarLinkType[] = [];\n for (const item of sidebar.items) {\n processItem(item, sidebarLinks);\n }\n links.set(key, sidebarLinks);\n }\n return links;\n}\n\nfunction processItem(item: SidebarItemType, links: InternalSidebarLinkType[] = []) {\n if (\"slug\" in item) {\n links.push(item);\n } else if (\"items\" in item) {\n for (const childItem of item.items) {\n processItem(childItem, links);\n }\n }\n return links;\n}\n","import { createLogger } from \"vite\";\nconst logger = createLogger(undefined, { prefix: \"[Prestige]\" });\nexport default logger;\n","import { join } from \"node:path\";\nimport { pathToFileURL } from \"node:url\";\nimport { parse, relative } from \"pathe\";\nimport { glob } from \"tinyglobby\";\nimport { read } from \"to-vfile\";\nimport {\n InternalSidebarLinkType,\n SidebarLinkType,\n} from \"../core/content/content.types\";\nimport { compileMarkdown } from \"./content-compiler\";\n\nimport { PrestigeError } from \"../utils/errors\";\nimport { compileFrontmatter } from \"./content-compiler\";\n\nexport const CONTENT_VIRTUAL_ID = \"virtual:prestige/content/\";\n\nexport function resolveSiblings(\n base: string,\n slug: string,\n linksMap: Map<string, SidebarLinkType[]>,\n) {\n const links = linksMap.get(base);\n if (!links?.length) {\n return { prev: undefined, next: undefined };\n }\n const linkIndex = links\n .filter((l) => \"slug\" in l)\n .findIndex((link) => link.slug === slug);\n\n let prev: InternalSidebarLinkType | undefined;\n let next: InternalSidebarLinkType | undefined;\n if (linkIndex > 0) {\n prev = links[linkIndex - 1] as InternalSidebarLinkType;\n }\n if (linkIndex < links.length - 1) {\n next = links[linkIndex + 1] as InternalSidebarLinkType;\n }\n return { prev, next };\n}\n\nexport async function resolveMarkdown(slug: string, contentDir: string) {\n const filePath = await getPathBySlug(slug, contentDir);\n const baseUrl = pathToFileURL(filePath).href;\n const file = await read(filePath);\n const frontmatter = await compileFrontmatter(file);\n const { code, toc } = await compileMarkdown(file, baseUrl);\n return { code, toc, frontmatter };\n}\n\nexport async function resolveContent(\n id: string,\n linksMap: Map<string, SidebarLinkType[]>,\n contentDir: string,\n) {\n const slug = id.replace(CONTENT_VIRTUAL_ID, \"\").replace(\"\\0\", \"\");\n const base = slug.split(\"/\")[0] as string;\n\n const { prev, next } = resolveSiblings(base, slug, linksMap);\n const { toc, code, frontmatter } = await resolveMarkdown(slug, contentDir);\n let resolvedCode = code;\n\n resolvedCode += `\\n export const toc = ${JSON.stringify(toc)}\\n`;\n resolvedCode += `\\n export const prev = ${JSON.stringify(prev)}\\n`;\n resolvedCode += `\\n export const next = ${JSON.stringify(next)}\\n`;\n resolvedCode += `\\n export const frontmatter = ${JSON.stringify(\n frontmatter,\n )}\\n`;\n return resolvedCode;\n}\n\nexport async function getPathBySlug(slug: string, contentDir: string) {\n const pathMatch = join(contentDir, slug);\n const matches = await glob(`${pathMatch}.{md,mdx}`);\n if (matches.length === 0) {\n throw new PrestigeError(\n `[Prestige] Could not find markdown file for slug: \"${slug}\". Searched at: ${pathMatch}.{md,mdx}. If you want to link to a custom page, use 'link: \"${slug}\"' instead of 'slug: \"${slug}\"' in your collection config.`,\n );\n }\n return matches[0] as string;\n}\n\nexport async function getFileBySlug(slug: string, contentDir: string) {\n return await read(await getPathBySlug(slug, contentDir));\n}\n\nexport function getVirtualModuleIdsForFile(path: string, contentDir: string) {\n const slug = getSlugByPath(path, contentDir);\n return [\"\\0\" + CONTENT_VIRTUAL_ID + slug];\n}\n\nexport function getSlugByPath(path: string, contentDir: string) {\n // 1. Get the relative path: \"zz/zz/myFile.json\"\n const relativePath = relative(contentDir, path);\n\n // 2. Parse the path to separate the extension\n const pathInfo = parse(relativePath);\n\n const result = join(pathInfo.dir, pathInfo.name);\n\n return result;\n}\n","import { readdir } from \"node:fs/promises\";\nimport { basename } from \"node:path\";\nimport { join } from \"pathe\";\nimport {\n Collection,\n CollectionGroup,\n CollectionItem,\n Collections,\n ExternalSidebarLinkType,\n InternalCollectionLink,\n InternalSidebarLinkType,\n SidebarGroupType,\n SidebarItemType,\n SidebarType,\n} from \"../core/content/content.types\";\nimport { PrestigeError } from \"../utils/errors\";\nimport { pathExists } from \"../utils/file-utils\";\nimport logger from \"../utils/logger\";\nimport { compileFrontmatter } from \"./content-compiler\";\nimport { getFileBySlug } from \"./content.store\";\n\nexport const SIDEBAR_VIRTUAL_ID = \"virtual:prestige/sidebar/\";\n\nfunction resolveDefaultLink(\n items: SidebarItemType[],\n defaultLink?: string,\n): string | undefined {\n if (defaultLink) {\n return defaultLink;\n }\n for (const item of items) {\n if (\"slug\" in item) {\n return item.slug;\n } else if (\"link\" in item) {\n return item.link;\n } else if (\"items\" in item && item.items.length > 0) {\n const link = resolveDefaultLink(item.items);\n if (link) return link;\n }\n }\n return undefined;\n}\n\nexport async function resolveSidebars(\n collections: Collections,\n contentDir: string,\n) {\n const store = new Map<string, SidebarType>();\n\n for (const collection of collections) {\n const sidebar = await processCollection(collection, contentDir);\n store.set(collection.id, sidebar);\n }\n return store;\n}\n\n/** @visibleForTesting */\nasync function processCollection(\n collection: Collection,\n contentDir: string,\n): Promise<SidebarType> {\n const items: SidebarItemType[] = [];\n for (const item of collection.items) {\n items.push(await processItem(item, contentDir));\n }\n const defaultLink = resolveDefaultLink(items, collection.defaultLink);\n if (!defaultLink) {\n throw new PrestigeError(\n `No default link found in collection, it means there are no links in the collection. Please define one in ${collection.id}`,\n );\n }\n return {\n items,\n defaultLink: defaultLink,\n };\n}\n\n/** @visibleForTesting */\nasync function processItem(\n item: CollectionItem,\n contentDir: string,\n): Promise<SidebarItemType> {\n if (typeof item === \"string\" || \"slug\" in item) {\n return resolveInternalSidebarLink(\n item as InternalCollectionLink,\n contentDir,\n );\n } else if (\"link\" in item) {\n return resolveSidebarLink(item, contentDir);\n } else {\n return resolveSidebarGroup(item as CollectionGroup, contentDir);\n }\n}\n\n/** @visibleForTesting */\nasync function resolveSidebarGroup(\n group: CollectionGroup,\n contentDir: string,\n): Promise<SidebarGroupType> {\n const label = await resolveLabel(group, contentDir);\n const items: SidebarItemType[] = [];\n\n if (group.items?.length && group.autogenerate) {\n logger.warn(\n `${group.label} has both items and autogenerate. Only items will be used.`,\n );\n }\n\n if (group.items) {\n for (const childItem of group.items) {\n items.push(await processItem(childItem, contentDir));\n }\n } else if (group.autogenerate?.directory) {\n const generatedItems = await autogenerateSidebar(\n group.autogenerate.directory,\n contentDir,\n );\n items.push(...generatedItems);\n }\n\n return {\n label,\n collapsible: group.collapsible,\n items,\n };\n}\n\n/** @visibleForTesting */\nasync function resolveInternalSidebarLink(\n item: InternalCollectionLink,\n contentDir: string,\n): Promise<InternalSidebarLinkType> {\n const label = await resolveLabel(item, contentDir);\n const slug = resolveSlug(item);\n\n if (slug.startsWith(\"/\") || slug.endsWith(\"/\")) {\n throw new PrestigeError(\n `The slug ${slug} cannot start or end with a slash. Remove it and try again.`,\n );\n }\n\n if (!slug) {\n throw new PrestigeError(\n `The slug cannot be empty. Remove it and try again. link label is ${label}`,\n );\n }\n\n return {\n label,\n slug,\n };\n}\n\n/** @visibleForTesting */\nasync function resolveSidebarLink(\n item: ExternalSidebarLinkType,\n contentDir: string,\n): Promise<ExternalSidebarLinkType> {\n const label = await resolveLabel(item, contentDir);\n const link = resolveLink(item);\n\n if (!link) {\n throw new PrestigeError(\n `The link cannot be empty. Remove it and try again. link label is ${label}`,\n );\n }\n\n return {\n label,\n link,\n };\n}\n\n/** @visibleForTesting */\nasync function autogenerateSidebar(\n directory: string,\n contentDir: string,\n): Promise<SidebarItemType[]> {\n const fileExtRegex = /\\.mdx?$/i;\n\n const items: SidebarItemType[] = [];\n const dirPath = join(contentDir, directory);\n if (!(await pathExists(dirPath))) {\n logger.warn(`Directory doesn't exist: ${directory}`);\n return [];\n }\n\n const dirents = await readdir(dirPath, { withFileTypes: true });\n dirents.sort((a, b) => a.name.localeCompare(b.name));\n for (const dirent of dirents) {\n if (dirent.isDirectory()) {\n const subDir = join(directory, dirent.name);\n const group: CollectionGroup = {\n label: dirent.name,\n autogenerate: { directory: subDir },\n };\n items.push(await resolveSidebarGroup(group, contentDir));\n } else if (dirent.isFile() && fileExtRegex.test(dirent.name)) {\n const fullPath = join(directory, dirent.name);\n const slug = fullPath.replace(fileExtRegex, \"\");\n items.push(await resolveInternalSidebarLink(slug, contentDir));\n }\n }\n return items;\n}\n\n/** @visibleForTesting */\nasync function resolveLabel(\n item: CollectionItem,\n contentDir: string,\n): Promise<string> {\n if (typeof item !== \"string\" && \"label\" in item && item.label) {\n return item.label;\n }\n\n if (typeof item === \"string\" || \"slug\" in item) {\n const slug = resolveSlug(item);\n\n const file = await getFileBySlug(slug, contentDir);\n if (!file) {\n throw new PrestigeError(\n `markdown file not found with slug: ${slug} add one in content folder or update config`,\n );\n }\n const data = (await compileFrontmatter(file)) as any;\n if (data?.label) {\n return data?.label;\n }\n\n return basename(slug);\n }\n\n // is a group\n if (typeof item !== \"string\" && (\"items\" in item || \"autogenerate\" in item)) {\n return item.label;\n }\n\n return \"\";\n}\n\n/** @visibleForTesting */\nexport function resolveSlug(item: CollectionItem) {\n if (typeof item === \"string\") {\n return item;\n } else {\n if (\"slug\" in item) {\n return item.slug;\n }\n return \"\";\n }\n}\n\n/** @visibleForTesting */\nexport function resolveLink(item: CollectionItem) {\n if (typeof item === \"object\" && \"link\" in item) {\n return item.link;\n }\n return \"\";\n}\n","import { mkdir, readdir, readFile, unlink, writeFile } from \"node:fs/promises\";\nimport { join } from \"node:path\";\nimport { SidebarLinkType } from \"../core/content/content.types\";\nimport logger from \"../utils/logger\";\n\nexport async function compileRoutes(\n linksMap: Map<string, SidebarLinkType[]>,\n routesDir: string,\n) {\n const prestigePath = \"(prestige)\";\n const prestigeFullPath = join(routesDir, prestigePath);\n\n try {\n await mkdir(prestigeFullPath, { recursive: true });\n\n const generatedFiles = new Map<string, string>();\n\n for (const [key, links] of linksMap) {\n const onlyInternalLinks = links.filter((l) => \"slug\" in l);\n\n const sidebarPath = key;\n const sidebarFile = sidebarPath + \".lazy.tsx\";\n generatedFiles.set(sidebarFile, createLayoutRoute(key));\n\n for (const l of onlyInternalLinks) {\n const pathified = l.slug.replaceAll(\"/\", \".\") + \".lazy.tsx\";\n generatedFiles.set(pathified, createContentRoute(l.slug));\n }\n }\n\n // Write files only if they have changed or do not exist\n await Promise.all(\n [...generatedFiles.entries()].map(async ([fileName, contents]) => {\n const filePath = join(prestigeFullPath, fileName);\n try {\n const existingContent = await readFile(filePath, \"utf-8\");\n if (existingContent === contents) {\n return; // Skip writing if identical\n }\n } catch (e) {\n // File doesn't exist yet, proceed to write\n }\n logger.info(`Writing route file: ${fileName}`, { timestamp: true });\n return writeFile(filePath, contents);\n }),\n );\n\n const existingFiles = await readdir(prestigeFullPath);\n const staleFiles = existingFiles.filter(\n (fileName) =>\n fileName.endsWith(\".lazy.tsx\") && !generatedFiles.has(fileName),\n );\n\n await Promise.all(\n staleFiles.map((fileName) => {\n logger.info(`Removing stale route file: ${fileName}`, {\n timestamp: true,\n });\n return unlink(join(prestigeFullPath, fileName));\n }),\n );\n } catch (error) {\n logger.error(\n `[Prestige Router Compiler] Failed to compile routes: ${error}`,\n { timestamp: true },\n );\n console.error(\n \"[Prestige Router Compiler] Failed to compile routes:\",\n error,\n );\n }\n}\n\nfunction createLayoutRoute(id: string) {\n return (\n `\nimport { createLazyFileRoute } from '@tanstack/react-router';\nimport sidebar from \"virtual:prestige/sidebar/${id}\";\nimport { CollectionRoute } from \"@lonik/prestige/ui\";\n\nexport const Route = createLazyFileRoute('/(prestige)/${id}')(CollectionRoute(sidebar, \"${id}\"));\n`.trim() + \"\\n\"\n );\n}\n\nfunction createContentRoute(slug: string) {\n return (\n `\nimport { createLazyFileRoute } from \"@tanstack/react-router\";\nimport * as contentData from \"virtual:prestige/content/${slug}\";\nimport { ContentRoute } from \"@lonik/prestige/ui\";\n\nexport const Route = createLazyFileRoute('/(prestige)/${slug}')(ContentRoute(contentData));\n`.trim() + \"\\n\"\n );\n}\n","import { genDynamicImport } from \"knitwork\";\n\nexport function genExportDefault(specifier: string) {\n return `export default ${specifier};`;\n}\n\n/** exports default undefined */\nexport function genExportUndefined() {\n return genExportDefault(\"undefined\");\n}\n\nexport function genDynamicImportWithDefault(specifier: string) {\n return `${genDynamicImport(specifier)}.then(m => m.default)`;\n}\n","import { genArrayFromRaw, genObjectFromValues } from \"knitwork\";\nimport { genExportDefault } from \"../../utils/code-generation\";\nimport { PrestigeError } from \"../../utils/errors\";\nimport {\n CollectionNavigation,\n Collections,\n InternalSidebarLinkType,\n} from \"./content.types\";\n\nexport const COLLECTION_VIRTUAL_ID = \"virtual:prestige/collection-all\";\n\nexport function resolveCollectionNavigations(\n inlineCollections: Collections,\n linksMap: Map<string, InternalSidebarLinkType[]>,\n) {\n const collections: CollectionNavigation[] = inlineCollections.map((c) => ({\n id: c.id,\n label: c.label ?? c.id,\n defaultLink: c.defaultLink ?? \"\",\n }));\n if (collections.length === 0) {\n throw new PrestigeError(\n `No collections found, add one in prestige plugin config`,\n );\n }\n\n for (const coll of collections) {\n const links = linksMap.get(coll.id);\n const firstLink = links?.[0];\n if (coll.defaultLink || !firstLink) {\n continue;\n }\n coll.defaultLink = firstLink.slug;\n }\n\n for (const coll of collections) {\n if (!coll.defaultLink) {\n console.warn(\n `No default link found for collection ${coll.id}, it won't be displayed in the header navigation`,\n );\n }\n }\n\n const validCollections = collections.filter((c) => c.defaultLink);\n\n return genExportDefault(\n genArrayFromRaw(validCollections.map((c) => genObjectFromValues(c))),\n );\n}\n","import { join } from \"pathe\";\nimport picomatch, { type Matcher } from \"picomatch\";\nimport { EnvironmentModuleNode, type Plugin } from \"vite\";\nimport { resolvePrestigeConfig } from \"./config/config\";\nimport { PrestigeConfig, PrestigeConfigInput } from \"./config/config.types\";\n\nimport { genObjectFromValues } from \"knitwork\";\nimport { warmupCompiler } from \"./content/content-compiler\";\nimport { resolveContentInternalLinks } from \"./content/content-links\";\nimport {\n resolveSidebars,\n SIDEBAR_VIRTUAL_ID,\n} from \"./content/content-sidebar.store\";\nimport {\n CONTENT_VIRTUAL_ID,\n getSlugByPath,\n resolveContent,\n} from \"./content/content.store\";\nimport { compileRoutes } from \"./content/router-compiler\";\nimport {\n COLLECTION_VIRTUAL_ID,\n resolveCollectionNavigations,\n} from \"./core/content/content-collection.store\";\nimport {\n Collections,\n InternalSidebarLinkType,\n SidebarType\n} from \"./core/content/content.types\";\nimport { genExportDefault, genExportUndefined } from \"./utils/code-generation\";\nimport { extractVirtualId } from \"./utils/file-utils\";\nimport logger from \"./utils/logger\";\n\nexport const CONFIG_VIRTUAL_ID = \"virtual:prestige/config\";\n\nexport default function prestige(inlineConfig?: PrestigeConfigInput): Plugin {\n let config: PrestigeConfig;\n let contentDir: string;\n let isDocsMatcher: Matcher;\n let collections: Collections = [];\n let internalLinksMap: Map<string, InternalSidebarLinkType[]>;\n let collectionNavigations: string;\n let sidebarsMap: Map<string, SidebarType>;\n return {\n name: \"vite-plugin-prestige\",\n enforce: \"pre\",\n async configResolved(resolvedConfig) {\n logger.info(\"Resolving Prestige configuration...\", { timestamp: true });\n const { config: loadedConfig } = await resolvePrestigeConfig(\n inlineConfig,\n resolvedConfig.root,\n );\n config = loadedConfig;\n contentDir = join(resolvedConfig.root, \"src/content\");\n isDocsMatcher = picomatch(join(contentDir, \"**/*.{md,mdx}\"));\n collections = config.collections ?? [];\n\n logger.info(\"Resolving sidebars...\", { timestamp: true });\n sidebarsMap = await resolveSidebars(collections, contentDir);\n\n logger.info(\"Resolving content links...\", { timestamp: true });\n internalLinksMap = resolveContentInternalLinks(sidebarsMap);\n\n logger.info(\"Resolving collection navigations....\", { timestamp: true });\n collectionNavigations = resolveCollectionNavigations(\n collections,\n internalLinksMap,\n );\n\n const routesDir = join(resolvedConfig.root, \"src\", \"routes\");\n\n logger.info(\"Compiling routes...\", { timestamp: true });\n await compileRoutes(internalLinksMap, routesDir);\n\n logger.info(\"Warming up shiki compiler...\", { timestamp: true });\n // Warm up the MDX compiler to pre-initialize the syntax highlighter (e.g. Shiki)\n // We do this non-blocking so it doesn't slow down the Vite startup.\n warmupCompiler(config.markdown);\n },\n resolveId(id) {\n // even though the import will be import * from \"virtual:prestige/docs/introduction\"\n // it is not guaranteed that some other plugin doesn't modify this import and attach full path\n // we call extractVirtualId to trim the import\n\n if (id.includes(CONFIG_VIRTUAL_ID)) {\n logger.info(`Resolving config virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, CONFIG_VIRTUAL_ID);\n }\n\n if (id.includes(CONTENT_VIRTUAL_ID)) {\n logger.info(`Resolving content virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, CONTENT_VIRTUAL_ID);\n }\n\n if (id.includes(COLLECTION_VIRTUAL_ID)) {\n logger.info(`Resolving collection virtual ID: ${id}`, {\n timestamp: true,\n });\n return extractVirtualId(id, COLLECTION_VIRTUAL_ID);\n }\n\n if (id.includes(SIDEBAR_VIRTUAL_ID)) {\n logger.info(`Resolving sidebar virtual ID: ${id}`, { timestamp: true });\n return extractVirtualId(id, SIDEBAR_VIRTUAL_ID);\n }\n\n return null;\n },\n async load(id) {\n if (id === `\\0${CONFIG_VIRTUAL_ID}`) {\n logger.info(`Loading config virtual module: ${id}`, {\n timestamp: true,\n });\n return genExportDefault(JSON.stringify(config));\n }\n if (id.includes(CONTENT_VIRTUAL_ID)) {\n logger.info(`Loading content virtual module: ${id}`, {\n timestamp: true,\n });\n return await resolveContent(id, internalLinksMap, contentDir);\n }\n if (id.includes(COLLECTION_VIRTUAL_ID)) {\n logger.info(`Loading collection virtual module: ${id}`, {\n timestamp: true,\n });\n return collectionNavigations;\n }\n\n if (id.includes(SIDEBAR_VIRTUAL_ID)) {\n logger.info(`Loading sidebar virtual module: ${id}`, {\n timestamp: true,\n });\n const sidebarId = id.replace(SIDEBAR_VIRTUAL_ID, \"\").replace(\"\\0\", \"\");\n const sidebar = sidebarsMap.get(sidebarId);\n if (!sidebar) {\n return genExportUndefined();\n }\n return genExportDefault(genObjectFromValues(sidebar));\n }\n\n return null;\n },\n\n async hotUpdate({ file, timestamp }) {\n if (isDocsMatcher(file)) {\n logger.info(`Invalidating module ${file}...`, { timestamp: true });\n const invalidatedModules = new Set<EnvironmentModuleNode>();\n const slug = getSlugByPath(file, contentDir);\n const virtualModuleId = `\\0${CONTENT_VIRTUAL_ID}${slug}`;\n const module =\n this.environment.moduleGraph.getModuleById(virtualModuleId);\n if (module) {\n this.environment.moduleGraph.invalidateModule(\n module,\n invalidatedModules,\n timestamp,\n true,\n );\n logger.info(`Reloading application...`, { timestamp: true });\n this.environment.hot.send({ type: \"full-reload\" });\n }\n }\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAEA,IAAa,gBAAb,cAAmC,MAAM;;;;;AAMzC,SAAgB,wBAA2C,GAAM,OAAiB,SAA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KAA4B;IAE3D,MAAM,kBAAkB,KAAK,qBADhB,cAAc,MAAM,WAAW;IAE5C,MAAM,SACJ,KAAK,YAAY,YAAY,cAAc,gBAAgB;AAC7D,QAAI,QAAQ;AACV,UAAK,YAAY,YAAY,iBAC3B,QACA,oBACA,WACA,KACD;AACD,oBAAO,KAAK,4BAA4B,EAAE,WAAW,MAAM,CAAC;AAC5D,UAAK,YAAY,IAAI,KAAK,EAAE,MAAM,eAAe,CAAC;;;;EAIzD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lonik/prestige",
3
- "version": "0.0.0",
3
+ "version": "0.1.6",
4
4
  "description": "Static Site Generator for Tanstack Start",
5
5
  "homepage": "https://github.com/lukonik/prestige#readme",
6
6
  "bugs": {
@@ -10,7 +10,7 @@
10
10
  "author": "Luka Onikadze",
11
11
  "repository": {
12
12
  "type": "git",
13
- "url": "git+https://github.com/author/library.git"
13
+ "url": "git+https://github.com/lukonik/prestige.git"
14
14
  },
15
15
  "files": [
16
16
  "dist",
@@ -41,6 +41,18 @@
41
41
  "publishConfig": {
42
42
  "access": "public"
43
43
  },
44
+ "scripts": {
45
+ "build": "tsdown",
46
+ "dev": "tsdown --watch",
47
+ "play": "vite",
48
+ "play:build": "vite build",
49
+ "play:preview": "vite preview",
50
+ "test": "vitest",
51
+ "typecheck": "tsc --noEmit",
52
+ "publish": "pnpm publish --no-git-checks",
53
+ "release": "bumpp && pnpm publish",
54
+ "release-v": "bumpp minor --no-commit --no-tag --no-push --no-git-checks && pnpm publish --registry http://localhost:4873 --no-git-checks"
55
+ },
44
56
  "peerDependencies": {
45
57
  "@base-ui/react": "^1.2.0",
46
58
  "@docsearch/css": "^4.6.0",
@@ -88,16 +100,16 @@
88
100
  "devDependencies": {
89
101
  "@arethetypeswrong/core": "^0.18.2",
90
102
  "@tailwindcss/typography": "^0.5.19",
91
- "@tailwindcss/vite": "^4.2.1",
92
- "@tanstack/react-devtools": "0.9.6",
93
- "@tanstack/react-router": "^1.162.4",
94
- "@tanstack/react-router-devtools": "1.162.4",
95
- "@tanstack/react-start": "^1.162.4",
103
+ "@tailwindcss/vite": "catalog:",
104
+ "@tanstack/react-devtools": "catalog:",
105
+ "@tanstack/react-router": "catalog:",
106
+ "@tanstack/react-router-devtools": "catalog:",
107
+ "@tanstack/react-start": "catalog:",
96
108
  "@tsconfig/strictest": "^2.0.8",
97
109
  "@types/node": "^25.0.3",
98
110
  "@types/picomatch": "^4.0.2",
99
- "@types/react": "^19.2.7",
100
- "@types/react-dom": "^19.2.3",
111
+ "@types/react": "catalog:",
112
+ "@types/react-dom": "catalog:",
101
113
  "@types/unist": "^3.0.3",
102
114
  "@vitejs/plugin-react": "^5.1.2",
103
115
  "@vitest/browser-playwright": "^4.0.16",
@@ -106,9 +118,9 @@
106
118
  "memfs": "^4.56.10",
107
119
  "nitro": "3.0.1-alpha.2",
108
120
  "publint": "^0.3.17",
109
- "react": "^19.2.0",
110
- "react-dom": "^19.2.0",
111
- "tailwindcss": "^4.2.1",
121
+ "react": "catalog:",
122
+ "react-dom": "catalog:",
123
+ "tailwindcss": "catalog:",
112
124
  "tsdown": "^0.18.1",
113
125
  "typescript": "^5.9.3",
114
126
  "vite": ">=7.0.0",
@@ -116,16 +128,5 @@
116
128
  "vite-tsconfig-paths": "^6.1.1",
117
129
  "vitest": "^4.0.16",
118
130
  "vitest-browser-react": "^2.0.2"
119
- },
120
- "scripts": {
121
- "build": "tsdown",
122
- "dev": "tsdown --watch",
123
- "play": "vite",
124
- "play:build": "vite build",
125
- "play:preview": "vite preview",
126
- "test": "vitest",
127
- "typecheck": "tsc --noEmit",
128
- "release": "bumpp && pnpm publish",
129
- "release-v": "bumpp minor --no-commit --no-tag --no-push --no-git-checks && pnpm publish --registry http://localhost:4873 --no-git-checks"
130
131
  }
131
- }
132
+ }