@dogsbay/ssg 0.0.0-stage → 0.2.0-beta.129

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.
Files changed (60) hide show
  1. package/LICENSE +201 -0
  2. package/NOTICE +17 -0
  3. package/README.md +39 -2
  4. package/dist/package/THIRD-PARTY-NOTICES.txt +589 -0
  5. package/dist/package/browser.mjs +4690 -0
  6. package/dist/package/chunks/chunk-3BM23K4O.mjs +84 -0
  7. package/dist/package/chunks/chunk-UZZEKSEQ.mjs +47 -0
  8. package/dist/package/chunks/katex-assets-7BGR6WCR.mjs +7 -0
  9. package/dist/package/chunks/prebuilt-css-default-MOOPVBZ5.mjs +2161 -0
  10. package/dist/package/chunks/prebuilt-css-mintlify-HAG54PAM.mjs +2161 -0
  11. package/dist/package/chunks/tailwind-fallback-KPRFHW3C.mjs +7 -0
  12. package/dist/package/chunks/topicmap-PY3WDCSI.mjs +53 -0
  13. package/dist/package/client.mjs +683 -0
  14. package/dist/package/css.mjs +421 -0
  15. package/dist/package/types/client/data-script.d.ts +6 -0
  16. package/dist/package/types/client/elements.d.ts +16 -0
  17. package/dist/package/types/client/highlight.d.ts +1 -0
  18. package/dist/package/types/client/image-zoom.d.ts +2 -0
  19. package/dist/package/types/client/mount.d.ts +27 -0
  20. package/dist/package/types/client/pagefind.d.ts +14 -0
  21. package/dist/package/types/client/search.d.ts +13 -0
  22. package/dist/package/types/client/targets.d.ts +6 -0
  23. package/dist/package/types/core/blog.d.ts +53 -0
  24. package/dist/package/types/core/build.d.ts +283 -0
  25. package/dist/package/types/core/canonical.d.ts +63 -0
  26. package/dist/package/types/core/config.d.ts +286 -0
  27. package/dist/package/types/core/detach.d.ts +55 -0
  28. package/dist/package/types/core/dev.d.ts +63 -0
  29. package/dist/package/types/core/diagrams.d.ts +93 -0
  30. package/dist/package/types/core/links.d.ts +39 -0
  31. package/dist/package/types/core/merman.d.ts +28 -0
  32. package/dist/package/types/core/nav.d.ts +35 -0
  33. package/dist/package/types/core/paths.d.ts +24 -0
  34. package/dist/package/types/core/pele.d.ts +15 -0
  35. package/dist/package/types/core/preprocess.d.ts +14 -0
  36. package/dist/package/types/core/resolve.d.ts +95 -0
  37. package/dist/package/types/core/site-files.d.ts +121 -0
  38. package/dist/package/types/core/strings.d.ts +1 -0
  39. package/dist/package/types/core/taxonomy.d.ts +39 -0
  40. package/dist/package/types/core/topicmap.d.ts +28 -0
  41. package/dist/package/types/core/yaml.d.ts +1 -0
  42. package/dist/package/types/generated/assets.d.ts +7 -0
  43. package/dist/package/types/generated/css-assets.d.ts +2 -0
  44. package/dist/package/types/generated/katex-assets.d.ts +3 -0
  45. package/dist/package/types/generated/prebuilt-css-default.d.ts +1 -0
  46. package/dist/package/types/generated/prebuilt-css-mintlify.d.ts +1 -0
  47. package/dist/package/types/package/browser.d.ts +29 -0
  48. package/dist/package/types/package/client.d.ts +17 -0
  49. package/dist/package/types/package/css.d.ts +6 -0
  50. package/dist/package/types/package/prebuilt.d.ts +2 -0
  51. package/dist/package/types/theme/classes.d.ts +7 -0
  52. package/dist/package/types/theme/compose.d.ts +99 -0
  53. package/dist/package/types/theme/css-build.d.ts +16 -0
  54. package/dist/package/types/theme/docs-layout/link-icons.d.ts +33 -0
  55. package/dist/package/types/theme/docs-layout/tag-list-data.d.ts +126 -0
  56. package/dist/package/types/theme/page.d.ts +34 -0
  57. package/dist/package/types/theme/pagefind.d.ts +10 -0
  58. package/dist/package/types/theme/regions.d.ts +84 -0
  59. package/dist/package/types/theme/seo.d.ts +57 -0
  60. package/package.json +92 -4
@@ -0,0 +1,7 @@
1
+ // stub:tailwind-fallback
2
+ var buildSiteCss = () => {
3
+ throw new Error("@dogsbay/ssg/browser: pass BuildInput.css (prebuiltSiteCss, or buildSiteCss from @dogsbay/ssg/css)");
4
+ };
5
+ export {
6
+ buildSiteCss
7
+ };
@@ -0,0 +1,53 @@
1
+ import {
2
+ dirname,
3
+ normalize
4
+ } from "./chunk-UZZEKSEQ.mjs";
5
+
6
+ // src/core/topicmap.ts
7
+ import { resolveTopicMap, topicMapToNavFile } from "@dogsbay/format-topicmap";
8
+ async function topicMapNav(mapPath, contentRoot, read, variables) {
9
+ const root = normalize(mapPath.replace(/^\.\//, ""));
10
+ const dir = dirname(root);
11
+ const at = (p) => dir ? `${dir}/${p}` : p;
12
+ const maps = [];
13
+ const result = await resolveTopicMap(root.slice(dir ? dir.length + 1 : 0), {
14
+ variables,
15
+ loader: async (p) => {
16
+ const path = normalize(at(p.replace(/^\/+/, "")));
17
+ if (path === ".." || path.startsWith("../") || dir && path !== dir && !path.startsWith(`${dir}/`)) {
18
+ throw new Error(`Refusing topic-map entry outside the map root: "${p}" resolves to ${path}, which is not inside ${dir || "the project"}`);
19
+ }
20
+ const text = await read(path);
21
+ if (text === void 0) throw new Error(`${path} does not exist`);
22
+ maps.push(path);
23
+ return text;
24
+ }
25
+ });
26
+ const errors = [...result.errors];
27
+ const rebase = (e) => {
28
+ const out = { ...e };
29
+ if (out.file !== void 0) {
30
+ const path = normalize(at(out.file));
31
+ const problem = path === contentRoot.replace(/\/$/, "") ? `"${e.file}" names the source content directory itself (${path || "the project"}): a nav entry names a page in it, such as ${path ? `${path}/` : ""}index.md` : path === ".." || path.startsWith("../") || !path.startsWith(contentRoot) ? `"${e.file}" resolves outside the source content directory (${path}): nav targets must live inside the source` : void 0;
32
+ if (problem) {
33
+ errors.push({ mapPath: root, code: "invalid-entry", message: problem });
34
+ delete out.file;
35
+ } else {
36
+ out.file = path.slice(contentRoot.length);
37
+ }
38
+ }
39
+ if (out.children) out.children = out.children.map(rebase);
40
+ return out;
41
+ };
42
+ return { entries: topicMapToNavFile(result.map).map(rebase), maps, errors };
43
+ }
44
+ function topicMapError(mapPath, errors) {
45
+ const details = errors.map((e) => ` \u2717 [${e.code}] ${e.mapPath ? `${e.mapPath}: ` : ""}${e.message}`).join("\n");
46
+ return new Error(`Topic map ${mapPath} has ${errors.length} problem(s):
47
+ ${details}
48
+ Fix the map or validate it with: dogsbay topicmap check ${mapPath}`);
49
+ }
50
+ export {
51
+ topicMapError,
52
+ topicMapNav
53
+ };