@wordup-md/nuxt-layer-shadcn-unocss 0.2.16 → 0.2.18
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/README.md +181 -42
- package/package.json +4 -4
- package/vercel.json +7 -0
package/README.md
CHANGED
|
@@ -1,93 +1,232 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @wordup-md/nuxt-layer-shadcn-unocss
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
> A beautiful, accessible, and feature-rich Nuxt layer for building documentation sites and content-driven applications with shadcn-vue and UnoCSS.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@wordup-md/nuxt-layer-shadcn-unocss)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Fork of [shadcn-docs-nuxt](https://github.com/shadcn/shadcn-docs-nuxt) at v0.8.13\
|
|
4
9
|
`git diff --name-status 54b80e2e96bbc7249170150fb72e20078629a170`
|
|
5
10
|
|
|
6
|
-
##
|
|
11
|
+
## ✨ Features
|
|
12
|
+
|
|
13
|
+
- 🎨 **shadcn-vue Components** - Beautiful, accessible UI components built with Radix Vue
|
|
14
|
+
- ⚡ **UnoCSS** - Utility-first CSS framework with instant on-demand compilation
|
|
15
|
+
- 📝 **Nuxt Content** - File-based CMS with MDC (Markdown Components) support
|
|
16
|
+
- 🌍 **i18n Ready** - Built-in internationalization with `@nuxtjs/i18n`
|
|
17
|
+
- 🎭 **Color Mode** - Dark/light mode support with `@nuxtjs/color-mode`
|
|
18
|
+
- ♿ **Accessibility** - WCAG compliant components and utilities
|
|
19
|
+
- 🔍 **Search** - Full-text search powered by Nuxt Content
|
|
20
|
+
- 📱 **Responsive** - Mobile-first design with UnoCSS utilities
|
|
21
|
+
- 🎯 **TypeScript** - Full TypeScript support with auto-imports
|
|
22
|
+
- 🚀 **Performance** - Optimized for SSR, code-splitting, and fast load times
|
|
7
23
|
|
|
8
|
-
|
|
24
|
+
## 📦 Installation
|
|
25
|
+
|
|
26
|
+
### Quick Start
|
|
27
|
+
|
|
28
|
+
1. **Create a new Nuxt project** (if you don't have one):
|
|
9
29
|
```bash
|
|
10
|
-
npx
|
|
30
|
+
npx nuxi@latest init my-docs
|
|
31
|
+
cd my-docs
|
|
11
32
|
```
|
|
12
33
|
|
|
13
|
-
|
|
34
|
+
2. **Install the layer**:
|
|
14
35
|
```bash
|
|
15
36
|
pnpm add @wordup-md/nuxt-layer-shadcn-unocss
|
|
16
37
|
```
|
|
17
38
|
|
|
18
|
-
|
|
39
|
+
3. **Extend the layer** in your `nuxt.config.ts`:
|
|
19
40
|
```ts
|
|
20
|
-
defineNuxtConfig({
|
|
41
|
+
export default defineNuxtConfig({
|
|
21
42
|
extends: '@wordup-md/nuxt-layer-shadcn-unocss'
|
|
22
43
|
})
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
## Setup
|
|
44
|
+
```
|
|
26
45
|
|
|
27
|
-
|
|
46
|
+
4. **Start developing**:
|
|
47
|
+
```bash
|
|
48
|
+
pnpm dev
|
|
49
|
+
```
|
|
28
50
|
|
|
51
|
+
## 🏗️ What's Included
|
|
52
|
+
|
|
53
|
+
### Modules
|
|
54
|
+
- `@nuxt/content` - Content management
|
|
55
|
+
- `@nuxt/image` - Image optimization
|
|
56
|
+
- `@nuxt/icon` - Icon component
|
|
57
|
+
- `@nuxtjs/color-mode` - Color mode switching
|
|
58
|
+
- `@nuxtjs/i18n` - Internationalization
|
|
59
|
+
- `@unocss/nuxt` - UnoCSS integration
|
|
60
|
+
- `shadcn-nuxt` - shadcn-vue components
|
|
61
|
+
- `@vueuse/nuxt` - VueUse composables
|
|
62
|
+
- `@unpress/nuxt-module` - Content editing capabilities
|
|
63
|
+
|
|
64
|
+
### Components
|
|
65
|
+
|
|
66
|
+
#### UI Components (shadcn-vue)
|
|
67
|
+
- Accordion, Alert, Avatar, Badge, Breadcrumb
|
|
68
|
+
- Button, Card, Checkbox, Collapsible, Combobox
|
|
69
|
+
- Command, Dialog, Dropdown Menu, Input, Label
|
|
70
|
+
- Navigation Menu, Popover, Scroll Area, Separator
|
|
71
|
+
- Sheet, Slider, Table, Tabs, Textarea, Toast
|
|
72
|
+
|
|
73
|
+
#### Content Components
|
|
74
|
+
- Hero, Alert, Badge, Card, Code blocks
|
|
75
|
+
- File Tree, Icon, Keyboard shortcuts
|
|
76
|
+
- Menu, Steps, Tabs, and more
|
|
77
|
+
|
|
78
|
+
#### Layout Components
|
|
79
|
+
- Header with navigation
|
|
80
|
+
- Sidebar with tree navigation
|
|
81
|
+
- Footer, Breadcrumb, Table of Contents
|
|
82
|
+
- Search dialog, Language switcher
|
|
83
|
+
- Dark mode toggle
|
|
84
|
+
|
|
85
|
+
### Layouts
|
|
86
|
+
- **Default** - Standard documentation layout with sidebar and TOC
|
|
87
|
+
- **Editorial** - Content-rich layout for articles and marketing pages
|
|
88
|
+
- **Blank** - Minimal layout for custom structures
|
|
89
|
+
|
|
90
|
+
### Composables
|
|
91
|
+
- `useConfig()` - Access site configuration
|
|
92
|
+
- `useBreadcrumb()` - Breadcrumb navigation
|
|
93
|
+
- `useI18nDocs()` - i18n utilities for docs
|
|
94
|
+
- `useScrollspy()` - Scroll spy for TOC
|
|
95
|
+
- `useThemes()` - Theme management
|
|
96
|
+
- `useToast()` - Toast notifications
|
|
97
|
+
- And more...
|
|
98
|
+
|
|
99
|
+
## 🛠️ Development
|
|
100
|
+
|
|
101
|
+
### Setup
|
|
102
|
+
|
|
103
|
+
Install dependencies:
|
|
29
104
|
```bash
|
|
30
105
|
pnpm install
|
|
31
106
|
```
|
|
32
107
|
|
|
33
|
-
|
|
108
|
+
### Working on the Layer
|
|
109
|
+
|
|
110
|
+
The layer is structured like a regular Nuxt project at the root of this repository. The `.playground` directory is used for local development and testing.
|
|
111
|
+
|
|
112
|
+
**Start development server**:
|
|
113
|
+
```bash
|
|
114
|
+
pnpm dev
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
This will start the playground at `http://localhost:3000`, which imports and uses the layer.
|
|
118
|
+
|
|
119
|
+
**Development commands**:
|
|
120
|
+
```bash
|
|
121
|
+
# Start dev server (playground)
|
|
122
|
+
pnpm dev
|
|
123
|
+
|
|
124
|
+
# Start dev server (root layer)
|
|
125
|
+
pnpm dev:root
|
|
34
126
|
|
|
35
|
-
|
|
127
|
+
# Build playground
|
|
128
|
+
pnpm build
|
|
36
129
|
|
|
37
|
-
|
|
130
|
+
# Generate static site
|
|
131
|
+
pnpm generate
|
|
38
132
|
|
|
39
|
-
|
|
133
|
+
# Preview production build
|
|
134
|
+
pnpm preview
|
|
40
135
|
|
|
41
|
-
|
|
136
|
+
# Lint code
|
|
137
|
+
pnpm lint
|
|
42
138
|
|
|
43
|
-
|
|
139
|
+
# Build content documentation JSON
|
|
140
|
+
pnpm build:json-doc
|
|
141
|
+
```
|
|
44
142
|
|
|
45
|
-
|
|
143
|
+
### Manual Publishing
|
|
46
144
|
|
|
145
|
+
1. **Verify `files` field** in `package.json` (if present) includes all necessary files
|
|
146
|
+
2. **Build content documentation** (if needed):
|
|
147
|
+
```bash
|
|
148
|
+
pnpm build:json-doc
|
|
149
|
+
```
|
|
150
|
+
3. **Publish to npm**:
|
|
47
151
|
```bash
|
|
48
152
|
npm publish --access public
|
|
49
153
|
```
|
|
50
154
|
|
|
51
|
-
|
|
155
|
+
### After Publishing
|
|
156
|
+
|
|
157
|
+
Users can install and use your layer:
|
|
52
158
|
|
|
53
159
|
```bash
|
|
54
|
-
npm install
|
|
160
|
+
npm install @wordup-md/nuxt-layer-shadcn-unocss
|
|
55
161
|
```
|
|
56
162
|
|
|
57
|
-
Then
|
|
58
|
-
|
|
163
|
+
Then extend it in their `nuxt.config.ts`:
|
|
59
164
|
```ts
|
|
60
|
-
defineNuxtConfig({
|
|
61
|
-
extends: '
|
|
165
|
+
export default defineNuxtConfig({
|
|
166
|
+
extends: '@wordup-md/nuxt-layer-shadcn-unocss'
|
|
62
167
|
})
|
|
63
168
|
```
|
|
64
169
|
|
|
65
|
-
##
|
|
170
|
+
## 🎨 Customization
|
|
66
171
|
|
|
67
|
-
|
|
172
|
+
### Overriding Components
|
|
68
173
|
|
|
69
|
-
|
|
70
|
-
|
|
174
|
+
You can override any component by creating a component with the same path in your project. For example, to override the Footer:
|
|
175
|
+
|
|
176
|
+
```vue
|
|
177
|
+
<!-- components/layout/Footer.vue -->
|
|
178
|
+
<template>
|
|
179
|
+
<footer class="py-6">
|
|
180
|
+
<div class="container">
|
|
181
|
+
Your custom footer content
|
|
182
|
+
</div>
|
|
183
|
+
</footer>
|
|
184
|
+
</template>
|
|
71
185
|
```
|
|
72
186
|
|
|
73
|
-
|
|
187
|
+
### Configuration
|
|
74
188
|
|
|
75
|
-
|
|
189
|
+
The layer uses Nuxt's configuration system. You can override module configurations in your `nuxt.config.ts`:
|
|
76
190
|
|
|
77
|
-
```
|
|
78
|
-
|
|
191
|
+
```ts
|
|
192
|
+
export default defineNuxtConfig({
|
|
193
|
+
extends: '@wordup-md/nuxt-layer-shadcn-unocss',
|
|
194
|
+
|
|
195
|
+
// Override i18n config
|
|
196
|
+
i18n: {
|
|
197
|
+
defaultLocale: 'fr',
|
|
198
|
+
locales: ['fr', 'en']
|
|
199
|
+
},
|
|
200
|
+
|
|
201
|
+
// Override color mode
|
|
202
|
+
colorMode: {
|
|
203
|
+
preference: 'dark'
|
|
204
|
+
}
|
|
205
|
+
})
|
|
79
206
|
```
|
|
80
207
|
|
|
81
|
-
|
|
208
|
+
## 📚 Documentation
|
|
82
209
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
210
|
+
- [Nuxt Documentation](https://nuxt.com)
|
|
211
|
+
- [Nuxt Content](https://content.nuxtjs.org)
|
|
212
|
+
- [shadcn-vue](https://www.shadcn-vue.com)
|
|
213
|
+
- [UnoCSS](https://unocss.dev)
|
|
214
|
+
- [VueUse](https://vueuse.org)
|
|
86
215
|
|
|
87
|
-
|
|
216
|
+
## 🤝 Contributing
|
|
88
217
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
218
|
+
Contributions are welcome! Please feel free to submit a Pull Request.
|
|
219
|
+
|
|
220
|
+
## 📄 License
|
|
221
|
+
|
|
222
|
+
This project is licensed under the MIT License.
|
|
223
|
+
|
|
224
|
+
## 🙏 Acknowledgments
|
|
225
|
+
|
|
226
|
+
- [shadcn-docs-nuxt](https://github.com/shadcn/shadcn-docs-nuxt) - Original inspiration
|
|
227
|
+
- [shadcn-vue](https://www.shadcn-vue.com) - UI components
|
|
228
|
+
- [Nuxt](https://nuxt.com) - The framework
|
|
229
|
+
|
|
230
|
+
---
|
|
92
231
|
|
|
93
|
-
|
|
232
|
+
Made with ❤️ by [Emmanuel Salomon](https://github.com/ManUtopiK/) with [WordUp.md](https://wordup.md)
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordup-md/nuxt-layer-shadcn-unocss",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.18",
|
|
5
5
|
"author": "Emmanuel Salomon <emmanuel.salomon@gmail.com>",
|
|
6
6
|
"main": "./nuxt.config.ts",
|
|
7
7
|
"repository": {
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
"scripts": {
|
|
58
58
|
"dev": "nuxi dev .playground",
|
|
59
59
|
"dev:root": "nuxi dev",
|
|
60
|
-
"build": "nuxt build .playground",
|
|
61
|
-
"generate": "nuxt generate .playground",
|
|
62
|
-
"preview": "nuxt preview .playground",
|
|
60
|
+
"build": "npx nuxt build .playground",
|
|
61
|
+
"generate": "npx nuxt generate .playground",
|
|
62
|
+
"preview": "npx nuxt preview .playground",
|
|
63
63
|
"lint": "eslint .",
|
|
64
64
|
"build:json-doc": "tsx scripts/buildContentDoc-cli.ts",
|
|
65
65
|
"bump": "pnpm build:json-doc && git add public/content-doc.json && bumpp --skip-install --commit --push --tag",
|