@nikala-ui/docs 0.12.0 → 0.12.1
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/LICENSE +20 -0
- package/README.md +172 -11
- package/dist/cli/commands/build.js +1 -1
- package/dist/cli/commands/dev.js +1 -1
- package/dist/cli/commands/init.js +1 -1
- package/dist/cli/commands/preview.js +1 -1
- package/dist/cli/commands/serve.js +1 -1
- package/dist/cli/index.js +1 -1
- package/package.json +2 -2
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Giorgi Magradze
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO QUALITY AND FITNESS FOR A PARTICULAR
|
|
17
|
+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
|
18
|
+
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
|
|
19
|
+
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,22 +1,183 @@
|
|
|
1
1
|
# @nikala-ui/docs
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
`@nikala-ui/docs` is a file-based documentation engine for SolidJS projects. It uses MDX, Vite, and Tailwind CSS v4 to build customizable documentation sites with local, copy-paste-owned components and hooks.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## What it provides
|
|
6
6
|
|
|
7
|
-
-
|
|
8
|
-
-
|
|
9
|
-
-
|
|
10
|
-
-
|
|
11
|
-
-
|
|
12
|
-
-
|
|
7
|
+
- MDX documentation with file-based routes.
|
|
8
|
+
- Automatic sidebar categories from directories inside `docs/`.
|
|
9
|
+
- Static production builds with server-rendered page content.
|
|
10
|
+
- Development server with configuration and content hot reload.
|
|
11
|
+
- Customizable SolidJS themes and layouts.
|
|
12
|
+
- Syntax highlighting, table of contents, breadcrumbs, pagination, search, and dark mode.
|
|
13
|
+
- Local Nikala UI component and reactive hook sources generated inside the consuming project.
|
|
14
|
+
- Tailwind CSS v4 theme tokens generated as part of the project setup.
|
|
13
15
|
|
|
14
|
-
|
|
16
|
+
The generated project does not import `@nikala-ui/core` or `@nikala-ui/hooks` at runtime. Components are copied into `src/components/ui`, and hooks are copied into `src/hooks`, so the consuming project owns and can modify the source code.
|
|
17
|
+
|
|
18
|
+
## Create a documentation project
|
|
19
|
+
|
|
20
|
+
Install the package in an existing SolidJS project or use the initializer to create the documentation structure:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
bun add @nikala-ui/docs
|
|
24
|
+
bunx @nikala-ui/docs init .
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The initializer creates the following project files and directories:
|
|
28
|
+
|
|
29
|
+
```text
|
|
30
|
+
.
|
|
31
|
+
├── docs/
|
|
32
|
+
│ └── index.mdx
|
|
33
|
+
├── docs.config.ts
|
|
34
|
+
├── nikala.config.json
|
|
35
|
+
└── src/
|
|
36
|
+
├── components/ui/
|
|
37
|
+
├── hooks/
|
|
38
|
+
├── index.css
|
|
39
|
+
├── lib/
|
|
40
|
+
├── providers/
|
|
41
|
+
└── themes/custom/
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
The initializer also runs the Nikala UI project setup and installs the dependencies required by the generated local sources.
|
|
45
|
+
|
|
46
|
+
## Development and production commands
|
|
47
|
+
|
|
48
|
+
From the documentation project root:
|
|
15
49
|
|
|
16
50
|
```bash
|
|
17
|
-
# Start
|
|
51
|
+
# Start the development server
|
|
18
52
|
bunx @nikala-ui/docs dev
|
|
19
53
|
|
|
20
|
-
# Build production
|
|
54
|
+
# Build the production site into dist/
|
|
21
55
|
bunx @nikala-ui/docs build
|
|
56
|
+
|
|
57
|
+
# Preview the production build
|
|
58
|
+
bunx @nikala-ui/docs preview
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Generated projects contain the same commands in `package.json`:
|
|
62
|
+
|
|
63
|
+
```json
|
|
64
|
+
{
|
|
65
|
+
"scripts": {
|
|
66
|
+
"dev": "bunx @nikala-ui/docs dev",
|
|
67
|
+
"build": "bunx @nikala-ui/docs build",
|
|
68
|
+
"preview": "bunx @nikala-ui/docs preview"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
## Content structure
|
|
74
|
+
|
|
75
|
+
The default content directory is `docs/`. Every MDX file becomes a route, and directories become automatic sidebar categories.
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
docs/
|
|
79
|
+
├── index.mdx
|
|
80
|
+
├── getting-started.mdx
|
|
81
|
+
├── components/
|
|
82
|
+
│ ├── button.mdx
|
|
83
|
+
│ └── dialog.mdx
|
|
84
|
+
└── guides/
|
|
85
|
+
└── theming.mdx
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
This produces routes such as:
|
|
89
|
+
|
|
90
|
+
```text
|
|
91
|
+
/
|
|
92
|
+
/getting-started
|
|
93
|
+
/components/button
|
|
94
|
+
/components/dialog
|
|
95
|
+
/guides/theming
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
Page metadata can be defined with frontmatter:
|
|
99
|
+
|
|
100
|
+
```mdx
|
|
101
|
+
---
|
|
102
|
+
title: Button
|
|
103
|
+
description: A flexible action button for SolidJS applications.
|
|
104
|
+
order: 1
|
|
105
|
+
toc: true
|
|
106
|
+
---
|
|
107
|
+
|
|
108
|
+
# Button
|
|
109
|
+
|
|
110
|
+
Button documentation goes here.
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
Supported metadata includes `title`, `description`, `order`, `categoryOrder`, `icon`, `badge`, `addedAt`, `prev`, `next`, and `toc`.
|
|
114
|
+
|
|
115
|
+
## Configuration
|
|
116
|
+
|
|
117
|
+
Create or edit `docs.config.ts` in the project root:
|
|
118
|
+
|
|
119
|
+
```ts
|
|
120
|
+
export default {
|
|
121
|
+
title: "Project Documentation",
|
|
122
|
+
description: "Documentation for my SolidJS project",
|
|
123
|
+
siteUrl: "https://example.com",
|
|
124
|
+
contentDir: "docs",
|
|
125
|
+
navigation: {
|
|
126
|
+
layout: "sidebar",
|
|
127
|
+
sidebar: {
|
|
128
|
+
header: true,
|
|
129
|
+
footer: false,
|
|
130
|
+
headerSubtitle: "Developer Documentation",
|
|
131
|
+
footerText: "Documentation",
|
|
132
|
+
},
|
|
133
|
+
},
|
|
134
|
+
search: {
|
|
135
|
+
enabled: true,
|
|
136
|
+
provider: "local",
|
|
137
|
+
},
|
|
138
|
+
theme: {
|
|
139
|
+
path: "./src/themes/custom",
|
|
140
|
+
defaultMode: "system",
|
|
141
|
+
},
|
|
142
|
+
};
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Available configuration areas include:
|
|
146
|
+
|
|
147
|
+
- `title`, `description`, and `siteUrl` for document metadata.
|
|
148
|
+
- `contentDir` for the MDX content root.
|
|
149
|
+
- `logo` for text, image, and logo link configuration.
|
|
150
|
+
- `repository` for source repository links.
|
|
151
|
+
- `nav` for top-level navigation items.
|
|
152
|
+
- `sidebar` for explicit sidebar entries or automatic directory discovery.
|
|
153
|
+
- `navigation` for sidebar or top navigation layout settings.
|
|
154
|
+
- `theme` for the custom theme path and color mode.
|
|
155
|
+
- `shiki` for code themes and supported languages.
|
|
156
|
+
- `search` for search enablement and provider selection.
|
|
157
|
+
|
|
158
|
+
## Custom themes
|
|
159
|
+
|
|
160
|
+
The generated project includes a local theme under `src/themes/custom`. Modify its SolidJS components to customize the navbar, sidebar, content layout, navigation, overlays, and mobile table of contents.
|
|
161
|
+
|
|
162
|
+
The generated `src/index.css` contains the Tailwind CSS v4 imports and semantic design tokens. Update those tokens to customize the light and dark color schemes without replacing the documentation engine.
|
|
163
|
+
|
|
164
|
+
## Local components and hooks
|
|
165
|
+
|
|
166
|
+
The initializer copies the component and hook sources needed by the generated documentation theme into the project:
|
|
167
|
+
|
|
168
|
+
```ts
|
|
169
|
+
import { Button } from "@/components/ui/button";
|
|
170
|
+
import { createClipboard } from "@/hooks/create-clipboard";
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
The sources are ordinary project files. They can be inspected, customized, and extended without depending on a runtime UI registry package.
|
|
174
|
+
|
|
175
|
+
## Package development
|
|
176
|
+
|
|
177
|
+
Build this package from the Nikala UI monorepo with:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
bun run build:docs
|
|
22
181
|
```
|
|
182
|
+
|
|
183
|
+
The build bundles the documentation engine, registry manifests, and local source snapshots required by `@nikala-ui/docs init`.
|
|
@@ -4,7 +4,7 @@ import { buildDocs } from "../../server/index.js";
|
|
|
4
4
|
export async function runBuildCommand(dir, options = {}) {
|
|
5
5
|
const outDir = options.outDir || "dist";
|
|
6
6
|
console.log();
|
|
7
|
-
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.
|
|
7
|
+
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.1"));
|
|
8
8
|
console.log(pc.dim(` Building documentation bundle from ${pc.bold(dir || "configured contentDir")} to ${pc.bold(outDir)}...`));
|
|
9
9
|
console.log();
|
|
10
10
|
const startTime = Date.now();
|
package/dist/cli/commands/dev.js
CHANGED
|
@@ -6,7 +6,7 @@ export async function runDevCommand(dir, options = {}) {
|
|
|
6
6
|
const host = options.host || "localhost";
|
|
7
7
|
const open = options.open ?? false;
|
|
8
8
|
console.log();
|
|
9
|
-
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.
|
|
9
|
+
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.1"));
|
|
10
10
|
console.log(pc.dim(" Honoring Niko Pirosmani (Nikala) — Elegant docs for SolidJS"));
|
|
11
11
|
console.log();
|
|
12
12
|
try {
|
|
@@ -272,7 +272,7 @@ async function writeProjectFiles(root, registryDependencies) {
|
|
|
272
272
|
export async function runInitCommand(targetDir = ".") {
|
|
273
273
|
const root = path.resolve(process.cwd(), targetDir);
|
|
274
274
|
console.log();
|
|
275
|
-
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.
|
|
275
|
+
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.1"));
|
|
276
276
|
console.log(pc.dim(` Initializing copy-paste documentation project in ${pc.bold(root)}...`));
|
|
277
277
|
console.log();
|
|
278
278
|
await fs.ensureDir(root);
|
|
@@ -6,7 +6,7 @@ export async function runPreviewCommand(dir = "docs", options = {}) {
|
|
|
6
6
|
const host = options.host || "localhost";
|
|
7
7
|
const outDir = options.outDir || "dist";
|
|
8
8
|
console.log();
|
|
9
|
-
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.
|
|
9
|
+
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.1"));
|
|
10
10
|
console.log(pc.dim(` Previewing production build from ${pc.bold(outDir)}...`));
|
|
11
11
|
console.log();
|
|
12
12
|
try {
|
|
@@ -25,7 +25,7 @@ export async function runServeCommand(dir = ".", options = {}) {
|
|
|
25
25
|
});
|
|
26
26
|
server.listen(port, host, () => {
|
|
27
27
|
console.log();
|
|
28
|
-
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.
|
|
28
|
+
console.log(pc.bold(pc.cyan(" Nikala Docs Engine ")) + pc.dim("v0.12.1"));
|
|
29
29
|
console.log(pc.dim(` SSR server: ${pc.bold(`http://${host}:${port}/`)}`));
|
|
30
30
|
console.log();
|
|
31
31
|
});
|
package/dist/cli/index.js
CHANGED
|
@@ -9,7 +9,7 @@ const program = new Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name("@nikala-ui/docs")
|
|
11
11
|
.description("Zero-config, fast, and elegant documentation engine for SolidJS")
|
|
12
|
-
.version("0.12.
|
|
12
|
+
.version("0.12.1");
|
|
13
13
|
program
|
|
14
14
|
.command("dev [dir]")
|
|
15
15
|
.description("Start local development server with live MDX reload")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nikala-ui/docs",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Zero-config, fast, and elegant documentation engine for SolidJS, built on Nikala UI and Tailwind CSS v4",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"dev": "tsc -p tsconfig.build.json --watch"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"@nikala-ui/cli": "
|
|
54
|
+
"@nikala-ui/cli": "0.12.1",
|
|
55
55
|
"@kobalte/core": "^0.13.12",
|
|
56
56
|
"@mdx-js/mdx": "^3.1.0",
|
|
57
57
|
"@mdx-js/rollup": "^3.1.0",
|