dommief 0.1.0 → 0.1.2

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 (46) hide show
  1. package/README.md +120 -0
  2. package/dist/cli.js +168 -143
  3. package/dist/index.js +5 -1
  4. package/package.json +1 -72
  5. package/src/build.ts +290 -0
  6. package/src/cache.ts +172 -0
  7. package/src/cli.ts +87 -0
  8. package/src/config.ts +258 -0
  9. package/src/exclude.ts +38 -0
  10. package/src/index.ts +17 -0
  11. package/src/link-check.ts +101 -0
  12. package/src/log.ts +10 -0
  13. package/src/markdown/errors.ts +28 -0
  14. package/src/markdown/index.ts +96 -0
  15. package/src/markdown/rehype-api.ts +131 -0
  16. package/src/markdown/rehype-code.ts +147 -0
  17. package/src/markdown/rehype-demo.ts +76 -0
  18. package/src/markdown/rehype-desc.ts +30 -0
  19. package/src/markdown/rehype-img.ts +33 -0
  20. package/src/markdown/rehype-link.ts +50 -0
  21. package/src/markdown/rehype-slug.ts +41 -0
  22. package/src/markdown/rehype-text.ts +53 -0
  23. package/src/markdown/remark-container.ts +76 -0
  24. package/src/markdown/remark-meta.ts +73 -0
  25. package/src/markdown/to-module.ts +35 -0
  26. package/src/paths.ts +38 -0
  27. package/src/plugins.ts +131 -0
  28. package/src/prefers-color.ts +28 -0
  29. package/src/preview.ts +127 -0
  30. package/src/routes.ts +232 -0
  31. package/src/search.ts +88 -0
  32. package/src/siteFeatures.ts +123 -0
  33. package/src/siteModule.ts +47 -0
  34. package/src/sitemap.ts +59 -0
  35. package/src/ssr-guard.ts +72 -0
  36. package/src/theme/index.ts +5 -0
  37. package/src/theme/loader.ts +151 -0
  38. package/src/theme/resolver.ts +115 -0
  39. package/src/theme/types.ts +25 -0
  40. package/src/theme-modules.d.ts +52 -0
  41. package/src/utils/path.ts +8 -0
  42. package/src/vite/plugin.ts +182 -0
  43. package/src/vite/routesPlugin.ts +39 -0
  44. package/src/vite/searchIndexPlugin.ts +66 -0
  45. package/src/vite/sitePlugin.ts +97 -0
  46. package/src/vite/state.ts +27 -0
package/README.md ADDED
@@ -0,0 +1,120 @@
1
+ # dommief
2
+
3
+ Static site generator for documentation and demo sites, built on React, Vite, and Markdown. Aims to replace dumi for component libraries while staying a lightweight Vite-native docs/demo generator.
4
+
5
+ ## Stack
6
+
7
+ - TypeScript, pnpm (Node >= 22)
8
+ - React 19, Vite 8, React Router 8
9
+ - unified/remark/rehype markdown pipeline, shiki, minisearch, zod
10
+
11
+ ## Packages
12
+
13
+ - `packages/core` — core library, CLI, Vite plugins, markdown pipeline
14
+ - `packages/theme-default` — default theme components
15
+ - `examples/docs` — demo site
16
+
17
+ ## Quick start
18
+
19
+ Install from npm (published as `dommief`):
20
+
21
+ ```bash
22
+ npm install -D dommief
23
+ npx dommief dev # dev server
24
+ npx dommief build # production build + SSG
25
+ npx dommief preview # preview
26
+ ```
27
+
28
+ Or work from source:
29
+
30
+ ```bash
31
+ pnpm install
32
+ pnpm -C packages/core build
33
+ npx dommief dev # dev server
34
+ npx dommief build # production build + SSG
35
+ npx dommief preview # preview
36
+ ```
37
+
38
+ Config file `dommief.config.ts`:
39
+
40
+ ```ts
41
+ import { defineConfig } from 'dommief';
42
+ export default defineConfig({
43
+ title: 'My Docs',
44
+ base: '/',
45
+ srcDir: 'docs',
46
+ preset: 'docs', // 'docs' | 'library'
47
+ });
48
+ ```
49
+
50
+ ## Configuration
51
+
52
+ | Option | Default | Description |
53
+ |---|---|---|
54
+ | title | 'Dommief' | Site title |
55
+ | description | — | Meta description |
56
+ | base | '/' | Base URL path |
57
+ | outDir | 'dist' | Output directory |
58
+ | srcDir | 'docs' | Source docs directory |
59
+ | preset | 'docs' | 'docs' or 'library' (auto-scans src/) |
60
+ | docDirs | — | Extra doc directories |
61
+ | forceKebabCase | true | Force kebab-case routes |
62
+ | locales | [{id:'en-US',name:'English'}] | i18n (base or suffix mode, mutually exclusive) |
63
+ | theme | 'dommief-theme-default' | Theme package |
64
+ | themeConfig | {} | Theme config |
65
+ | ssg.concurrency | 4 | Prerender concurrency |
66
+ | ssg.exclude | [] | Skip prerender, still shell |
67
+ | ssg.noEmit | [] | No file emitted |
68
+ | cache | true | Cache md transforms by hash |
69
+ | linkCheck | true | Dead link check at build |
70
+ | dev.port | 5173 | Dev server port |
71
+ | sitemap | false | false or {hostname, exclude} |
72
+ | robots | auto | Write robots.txt |
73
+ | markdown.shiki | github themes | Shiki themes or false |
74
+ | markdown.lineNumbers | false | Line numbers |
75
+ | search.enabled | true | Client search index |
76
+ | plugins | [] | Plugin array |
77
+
78
+ ## CLI
79
+
80
+ - `dommief dev` — dev server + HMR
81
+ - `dommief build` — production build + prerender
82
+ - `dommief preview` — preview built site
83
+
84
+ Flags: `--base`, `--outDir`, `--no-cache`, `--no-link-check`, `--config <path>`.
85
+
86
+ ## Features
87
+
88
+ - Filesystem routing
89
+ - Live demos via `<code src="./Button.tsx" />`
90
+ - API table via `<API src="./Foo.tsx"/>` (cached by file hash)
91
+ - Theme override via `.dommief/theme/**`
92
+ - i18n (base/suffix modes)
93
+ - Client-side search (minisearch)
94
+ - SSG with SSR safety guard
95
+ - Sitemap & robots.txt
96
+ - Link checking
97
+ - Content-hash build cache
98
+
99
+ ## Theme override
100
+
101
+ Create `.dommief/theme/slots/<Name>/index.tsx` or `.dommief/theme/layouts/<Name>.tsx` to override default theme components.
102
+
103
+ ## Presets
104
+
105
+ - `docs` — standard docs site
106
+ - `library` — auto-scans `src/` for component demos
107
+
108
+ ## Development
109
+
110
+ ```bash
111
+ pnpm install
112
+ pnpm typecheck
113
+ pnpm test
114
+ pnpm build
115
+ pnpm lint
116
+ ```
117
+
118
+ ## License
119
+
120
+ MIT