@unterberg/nivel 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,231 +0,0 @@
1
- import {
2
- extractDocHeadings,
3
- getResolvedPageById,
4
- resolveDocsConfig
5
- } from "./chunk-D7IAGT53.js";
6
-
7
- // src/runtime/node/codegen.ts
8
- import fs from "fs";
9
- import path from "path";
10
- var GENERATED_DIRNAME = "(nivel-generated)";
11
- var writeFileIfChanged = (filePath, source) => {
12
- const current = fs.existsSync(filePath) ? fs.readFileSync(filePath, "utf8") : null;
13
- if (current === source) {
14
- return;
15
- }
16
- fs.mkdirSync(path.dirname(filePath), { recursive: true });
17
- fs.writeFileSync(filePath, source);
18
- };
19
- var toPosix = (value) => value.split(path.sep).join(path.posix.sep);
20
- var getRelativeImportPath = (fromDirectory, toFile) => {
21
- const relativePath = toPosix(path.relative(fromDirectory, toFile));
22
- if (relativePath.startsWith(".")) {
23
- return relativePath;
24
- }
25
- return `./${relativePath}`;
26
- };
27
- var serializeData = (data) => JSON.stringify(data, null, 2);
28
- var collectFiles = (directoryPath) => {
29
- if (!fs.existsSync(directoryPath)) {
30
- return [];
31
- }
32
- const entries = fs.readdirSync(directoryPath, { withFileTypes: true });
33
- return entries.flatMap((entry) => {
34
- const entryPath = path.join(directoryPath, entry.name);
35
- return entry.isDirectory() ? collectFiles(entryPath) : [entryPath];
36
- });
37
- };
38
- var removeEmptyDirectories = (directoryPath, rootPath) => {
39
- if (!fs.existsSync(directoryPath)) {
40
- return;
41
- }
42
- for (const entry of fs.readdirSync(directoryPath, { withFileTypes: true })) {
43
- if (!entry.isDirectory()) {
44
- continue;
45
- }
46
- removeEmptyDirectories(path.join(directoryPath, entry.name), rootPath);
47
- }
48
- if (directoryPath === rootPath) {
49
- return;
50
- }
51
- if (fs.readdirSync(directoryPath).length === 0) {
52
- fs.rmdirSync(directoryPath);
53
- }
54
- };
55
- var getGeneratedPageSource = (contentImportPath) => {
56
- return [
57
- "import { DocsPage } from '@unterberg/nivel/client'",
58
- `import Content from ${JSON.stringify(contentImportPath)}`,
59
- "",
60
- "const Page = () => {",
61
- " return <DocsPage Content={Content} />",
62
- "}",
63
- "",
64
- "export default Page",
65
- ""
66
- ].join("\n");
67
- };
68
- var getGeneratedDataSource = (data) => {
69
- return [
70
- "import type { DocPageData } from '@unterberg/nivel'",
71
- "",
72
- `const data: DocPageData = ${serializeData(data)}`,
73
- "",
74
- "const pageData = () => {",
75
- " return data",
76
- "}",
77
- "",
78
- "export default pageData",
79
- ""
80
- ].join("\n");
81
- };
82
- var getGeneratedGlobalContextSource = (data) => {
83
- return [
84
- "import type { DocsGlobalContextData } from '@unterberg/nivel'",
85
- "",
86
- `const docsGlobalContextData: DocsGlobalContextData = ${serializeData(data)}`,
87
- "",
88
- "export { docsGlobalContextData }",
89
- ""
90
- ].join("\n");
91
- };
92
- var getRouteString = (href) => {
93
- if (href === "/") {
94
- return href;
95
- }
96
- return href.replace(/\/+$/g, "");
97
- };
98
- var getGeneratedRouteSource = (href) => {
99
- return [`export default ${JSON.stringify(getRouteString(href))}`, ""].join("\n");
100
- };
101
- var getGeneratedTextExport = (value) => {
102
- return [`export default ${JSON.stringify(value)}`, ""].join("\n");
103
- };
104
- var toDocPageLinkData = (page) => {
105
- if (!page) {
106
- return null;
107
- }
108
- return {
109
- id: page.id,
110
- title: page.title,
111
- href: page.href,
112
- documentTitle: page.documentTitle
113
- };
114
- };
115
- var getGeneratedPagesRoot = (rootDir) => path.join(rootDir, "pages", GENERATED_DIRNAME);
116
- var syncGeneratedDocsPages = (options) => {
117
- const { rootDir, docsConfig } = options;
118
- const resolved = resolveDocsConfig(docsConfig);
119
- const generatedPagesRoot = getGeneratedPagesRoot(rootDir);
120
- const docsRoot = path.join(rootDir, "docs");
121
- const expectedFiles = /* @__PURE__ */ new Set();
122
- const globalContextFilePath = path.join(generatedPagesRoot, "_docsGlobalContext.ts");
123
- fs.mkdirSync(generatedPagesRoot, { recursive: true });
124
- const globalContextData = {
125
- siteTitle: resolved.siteTitle,
126
- basePath: resolved.basePath,
127
- theme: resolved.theme,
128
- footer: resolved.footer,
129
- brand: resolved.brand,
130
- head: resolved.head,
131
- partners: resolved.partners,
132
- algolia: resolved.algolia,
133
- pages: resolved.pages,
134
- navbarItems: resolved.navbarItems,
135
- sidebarSections: resolved.sections
136
- };
137
- writeFileIfChanged(globalContextFilePath, getGeneratedGlobalContextSource(globalContextData));
138
- expectedFiles.add(globalContextFilePath);
139
- for (const [pageIndex, page] of resolved.pages.entries()) {
140
- const contentFilePath = path.join(docsRoot, page.source);
141
- if (!fs.existsSync(contentFilePath)) {
142
- throw new Error(`Docs page "${page.id}" points to missing source file: ${contentFilePath}`);
143
- }
144
- const pageSource = fs.readFileSync(contentFilePath, "utf8");
145
- const data = {
146
- page: getResolvedPageById(resolved, page.id),
147
- headings: extractDocHeadings(pageSource),
148
- previousPage: toDocPageLinkData(resolved.pages[pageIndex - 1]),
149
- nextPage: toDocPageLinkData(resolved.pages[pageIndex + 1])
150
- };
151
- for (const routeHref of [page.href, ...page.aliasHrefs]) {
152
- const routeSlug = routeHref.replace(/^\/docs\//, "").replace(/\/+$/g, "");
153
- const pageDir = path.join(generatedPagesRoot, ...routeSlug.split("/"));
154
- const contentImportPath = getRelativeImportPath(pageDir, contentFilePath);
155
- const pageFilePath = path.join(pageDir, "+Page.tsx");
156
- const dataFilePath = path.join(pageDir, "+data.ts");
157
- const routeFilePath = path.join(pageDir, "+route.ts");
158
- const titleFilePath = path.join(pageDir, "+title.ts");
159
- writeFileIfChanged(pageFilePath, getGeneratedPageSource(contentImportPath));
160
- writeFileIfChanged(dataFilePath, getGeneratedDataSource(data));
161
- writeFileIfChanged(routeFilePath, getGeneratedRouteSource(routeHref));
162
- writeFileIfChanged(titleFilePath, getGeneratedTextExport(page.documentTitle));
163
- expectedFiles.add(pageFilePath);
164
- expectedFiles.add(dataFilePath);
165
- expectedFiles.add(routeFilePath);
166
- expectedFiles.add(titleFilePath);
167
- if (page.description) {
168
- const descriptionFilePath = path.join(pageDir, "+description.ts");
169
- writeFileIfChanged(descriptionFilePath, getGeneratedTextExport(page.description));
170
- expectedFiles.add(descriptionFilePath);
171
- }
172
- }
173
- }
174
- for (const filePath of collectFiles(generatedPagesRoot)) {
175
- if (expectedFiles.has(filePath)) {
176
- continue;
177
- }
178
- fs.rmSync(filePath, { force: true });
179
- }
180
- removeEmptyDirectories(generatedPagesRoot, generatedPagesRoot);
181
- };
182
- var isDocsSourcePath = (filePath, rootDir) => {
183
- const normalized = toPosix(filePath);
184
- const docsRoot = toPosix(path.join(rootDir, "docs"));
185
- const docsConfigPath = toPosix(path.join(rootDir, "pages", "+docs.ts"));
186
- const generatedRoot = toPosix(getGeneratedPagesRoot(rootDir));
187
- if (normalized.startsWith(generatedRoot)) {
188
- return false;
189
- }
190
- return normalized === docsConfigPath || normalized.startsWith(`${docsRoot}/`);
191
- };
192
-
193
- // src/runtime/node/loadDocsConfig.ts
194
- import path2 from "path";
195
- import { pathToFileURL } from "url";
196
- import { register } from "tsx/esm/api";
197
- var getDocsConfigModulePath = (rootDir) => {
198
- return path2.join(rootDir, "pages", "+docs.ts");
199
- };
200
- var getDocsConfigFromLoadedModule = (loaded, modulePath) => {
201
- const docsConfig = loaded.default;
202
- if (!docsConfig) {
203
- throw new Error(`Expected default export from ${modulePath}`);
204
- }
205
- return docsConfig;
206
- };
207
- var loadDocsConfig = async (options) => {
208
- const modulePath = getDocsConfigModulePath(options.rootDir);
209
- const loaded = await options.loadModule(modulePath);
210
- return getDocsConfigFromLoadedModule(loaded, modulePath);
211
- };
212
- var loadDocsConfigWithVite = async (rootDir) => {
213
- const unregister = register();
214
- const modulePath = getDocsConfigModulePath(rootDir);
215
- const moduleUrl = pathToFileURL(modulePath).href;
216
- try {
217
- const loaded = await import(moduleUrl);
218
- return getDocsConfigFromLoadedModule(loaded, modulePath);
219
- } finally {
220
- await unregister();
221
- }
222
- };
223
-
224
- export {
225
- getGeneratedPagesRoot,
226
- syncGeneratedDocsPages,
227
- isDocsSourcePath,
228
- loadDocsConfig,
229
- loadDocsConfigWithVite
230
- };
231
- //# sourceMappingURL=chunk-DNCQR5NH.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/runtime/node/codegen.ts","../src/runtime/node/loadDocsConfig.ts"],"sourcesContent":["import fs from 'node:fs'\nimport path from 'node:path'\nimport type { DocPageData, DocPageLinkData, DocsConfig, DocsGlobalContextData } from '../../docs/types.js'\nimport { extractDocHeadings } from '../../docs/docHeadings.js'\nimport { getResolvedPageById, resolveDocsConfig } from '../../docs/resolveDocsConfig.js'\n\nconst GENERATED_DIRNAME = '(nivel-generated)'\n\nconst writeFileIfChanged = (filePath: string, source: string) => {\n const current = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : null\n if (current === source) {\n return\n }\n\n fs.mkdirSync(path.dirname(filePath), { recursive: true })\n fs.writeFileSync(filePath, source)\n}\n\nconst toPosix = (value: string) => value.split(path.sep).join(path.posix.sep)\n\nconst getRelativeImportPath = (fromDirectory: string, toFile: string) => {\n const relativePath = toPosix(path.relative(fromDirectory, toFile))\n if (relativePath.startsWith('.')) {\n return relativePath\n }\n return `./${relativePath}`\n}\n\nconst serializeData = (data: DocPageData | DocsGlobalContextData) => JSON.stringify(data, null, 2)\n\nconst collectFiles = (directoryPath: string): string[] => {\n if (!fs.existsSync(directoryPath)) {\n return []\n }\n\n const entries = fs.readdirSync(directoryPath, { withFileTypes: true })\n\n return entries.flatMap((entry) => {\n const entryPath = path.join(directoryPath, entry.name)\n return entry.isDirectory() ? collectFiles(entryPath) : [entryPath]\n })\n}\n\nconst removeEmptyDirectories = (directoryPath: string, rootPath: string) => {\n if (!fs.existsSync(directoryPath)) {\n return\n }\n\n for (const entry of fs.readdirSync(directoryPath, { withFileTypes: true })) {\n if (!entry.isDirectory()) {\n continue\n }\n\n removeEmptyDirectories(path.join(directoryPath, entry.name), rootPath)\n }\n\n if (directoryPath === rootPath) {\n return\n }\n\n if (fs.readdirSync(directoryPath).length === 0) {\n fs.rmdirSync(directoryPath)\n }\n}\n\nconst getGeneratedPageSource = (contentImportPath: string) => {\n return [\n \"import { DocsPage } from '@unterberg/nivel/client'\",\n `import Content from ${JSON.stringify(contentImportPath)}`,\n '',\n 'const Page = () => {',\n ' return <DocsPage Content={Content} />',\n '}',\n '',\n 'export default Page',\n '',\n ].join('\\n')\n}\n\nconst getGeneratedDataSource = (data: DocPageData) => {\n return [\n \"import type { DocPageData } from '@unterberg/nivel'\",\n '',\n `const data: DocPageData = ${serializeData(data)}`,\n '',\n 'const pageData = () => {',\n ' return data',\n '}',\n '',\n 'export default pageData',\n '',\n ].join('\\n')\n}\n\nconst getGeneratedGlobalContextSource = (data: DocsGlobalContextData) => {\n return [\n \"import type { DocsGlobalContextData } from '@unterberg/nivel'\",\n '',\n `const docsGlobalContextData: DocsGlobalContextData = ${serializeData(data)}`,\n '',\n 'export { docsGlobalContextData }',\n '',\n ].join('\\n')\n}\n\nconst getRouteString = (href: string) => {\n if (href === '/') {\n return href\n }\n\n return href.replace(/\\/+$/g, '')\n}\n\nconst getGeneratedRouteSource = (href: string) => {\n return [`export default ${JSON.stringify(getRouteString(href))}`, ''].join('\\n')\n}\n\nconst getGeneratedTextExport = (value: string) => {\n return [`export default ${JSON.stringify(value)}`, ''].join('\\n')\n}\n\nconst toDocPageLinkData = (\n page:\n | {\n id: string\n title: string\n href: string\n documentTitle: string\n }\n | undefined,\n): DocPageLinkData | null => {\n if (!page) {\n return null\n }\n\n return {\n id: page.id,\n title: page.title,\n href: page.href,\n documentTitle: page.documentTitle,\n }\n}\n\nexport const getGeneratedPagesRoot = (rootDir: string) => path.join(rootDir, 'pages', GENERATED_DIRNAME)\n\nexport const syncGeneratedDocsPages = (options: { rootDir: string; docsConfig: DocsConfig }) => {\n const { rootDir, docsConfig } = options\n const resolved = resolveDocsConfig(docsConfig)\n const generatedPagesRoot = getGeneratedPagesRoot(rootDir)\n const docsRoot = path.join(rootDir, 'docs')\n const expectedFiles = new Set<string>()\n const globalContextFilePath = path.join(generatedPagesRoot, '_docsGlobalContext.ts')\n\n fs.mkdirSync(generatedPagesRoot, { recursive: true })\n\n const globalContextData: DocsGlobalContextData = {\n siteTitle: resolved.siteTitle,\n basePath: resolved.basePath,\n theme: resolved.theme,\n footer: resolved.footer,\n brand: resolved.brand,\n head: resolved.head,\n partners: resolved.partners,\n algolia: resolved.algolia,\n pages: resolved.pages,\n navbarItems: resolved.navbarItems,\n sidebarSections: resolved.sections,\n }\n\n writeFileIfChanged(globalContextFilePath, getGeneratedGlobalContextSource(globalContextData))\n expectedFiles.add(globalContextFilePath)\n\n for (const [pageIndex, page] of resolved.pages.entries()) {\n const contentFilePath = path.join(docsRoot, page.source)\n\n if (!fs.existsSync(contentFilePath)) {\n throw new Error(`Docs page \"${page.id}\" points to missing source file: ${contentFilePath}`)\n }\n\n const pageSource = fs.readFileSync(contentFilePath, 'utf8')\n const data: DocPageData = {\n page: getResolvedPageById(resolved, page.id),\n headings: extractDocHeadings(pageSource),\n previousPage: toDocPageLinkData(resolved.pages[pageIndex - 1]),\n nextPage: toDocPageLinkData(resolved.pages[pageIndex + 1]),\n }\n\n for (const routeHref of [page.href, ...page.aliasHrefs]) {\n const routeSlug = routeHref.replace(/^\\/docs\\//, '').replace(/\\/+$/g, '')\n const pageDir = path.join(generatedPagesRoot, ...routeSlug.split('/'))\n const contentImportPath = getRelativeImportPath(pageDir, contentFilePath)\n\n const pageFilePath = path.join(pageDir, '+Page.tsx')\n const dataFilePath = path.join(pageDir, '+data.ts')\n const routeFilePath = path.join(pageDir, '+route.ts')\n const titleFilePath = path.join(pageDir, '+title.ts')\n\n writeFileIfChanged(pageFilePath, getGeneratedPageSource(contentImportPath))\n writeFileIfChanged(dataFilePath, getGeneratedDataSource(data))\n writeFileIfChanged(routeFilePath, getGeneratedRouteSource(routeHref))\n writeFileIfChanged(titleFilePath, getGeneratedTextExport(page.documentTitle))\n\n expectedFiles.add(pageFilePath)\n expectedFiles.add(dataFilePath)\n expectedFiles.add(routeFilePath)\n expectedFiles.add(titleFilePath)\n\n if (page.description) {\n const descriptionFilePath = path.join(pageDir, '+description.ts')\n writeFileIfChanged(descriptionFilePath, getGeneratedTextExport(page.description))\n expectedFiles.add(descriptionFilePath)\n }\n }\n }\n\n for (const filePath of collectFiles(generatedPagesRoot)) {\n if (expectedFiles.has(filePath)) {\n continue\n }\n\n fs.rmSync(filePath, { force: true })\n }\n\n removeEmptyDirectories(generatedPagesRoot, generatedPagesRoot)\n}\n\nexport const isDocsSourcePath = (filePath: string, rootDir: string) => {\n const normalized = toPosix(filePath)\n const docsRoot = toPosix(path.join(rootDir, 'docs'))\n const docsConfigPath = toPosix(path.join(rootDir, 'pages', '+docs.ts'))\n const generatedRoot = toPosix(getGeneratedPagesRoot(rootDir))\n\n if (normalized.startsWith(generatedRoot)) {\n return false\n }\n\n return normalized === docsConfigPath || normalized.startsWith(`${docsRoot}/`)\n}\n","import path from 'node:path'\nimport { pathToFileURL } from 'node:url'\nimport { register } from 'tsx/esm/api'\nimport type { DocsConfig } from '../../docs/types.js'\n\nconst getDocsConfigModulePath = (rootDir: string) => {\n return path.join(rootDir, 'pages', '+docs.ts')\n}\n\nconst getDocsConfigFromLoadedModule = (loaded: unknown, modulePath: string) => {\n const docsConfig = (loaded as { default?: DocsConfig }).default\n\n if (!docsConfig) {\n throw new Error(`Expected default export from ${modulePath}`)\n }\n\n return docsConfig\n}\n\nexport const loadDocsConfig = async (options: {\n rootDir: string\n loadModule: (modulePath: string) => Promise<unknown>\n}) => {\n const modulePath = getDocsConfigModulePath(options.rootDir)\n const loaded = await options.loadModule(modulePath)\n return getDocsConfigFromLoadedModule(loaded, modulePath)\n}\n\nexport const loadDocsConfigWithVite = async (rootDir: string) => {\n const unregister = register()\n const modulePath = getDocsConfigModulePath(rootDir)\n const moduleUrl = pathToFileURL(modulePath).href\n\n try {\n const loaded = await import(moduleUrl)\n return getDocsConfigFromLoadedModule(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