abckit 0.0.1 → 0.0.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.
- package/LICENSE +21 -0
- package/README.md +131 -0
- package/dist/module.mjs +2 -28
- package/package.json +1 -1
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 productdevbook
|
|
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 THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# abckit
|
|
2
|
+
|
|
3
|
+
[![npm version][npm-version-src]][npm-version-href]
|
|
4
|
+
[![npm downloads][npm-downloads-src]][npm-downloads-href]
|
|
5
|
+
[![License][license-src]][license-href]
|
|
6
|
+
|
|
7
|
+
A batteries-included Nuxt 4 module that gives you everything you need to build modern web apps — beautiful UI components, authentication, storage, and more.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **50+ UI Components** — shadcn/ui style components built on [Reka UI](https://reka-ui.com)
|
|
12
|
+
- **Authentication** — [Better Auth](https://better-auth.com) integration with session management
|
|
13
|
+
- **Storage** — S3/R2, Redis/Dragonfly, and local disk drivers
|
|
14
|
+
- **GraphQL API** — [GraphQL Yoga](https://the-guild.dev/graphql/yoga-server) via nitro-graphql
|
|
15
|
+
- **Dark Mode** — Built-in color mode support
|
|
16
|
+
- **Forms** — Validation with VeeValidate + Zod
|
|
17
|
+
- **Data Fetching** — Pinia Colada with global error handling
|
|
18
|
+
- **Icons** — 100k+ icons via Nuxt Icon
|
|
19
|
+
|
|
20
|
+
## Quick Start
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Install
|
|
24
|
+
pnpm add abckit
|
|
25
|
+
|
|
26
|
+
# Add to nuxt.config.ts
|
|
27
|
+
export default defineNuxtConfig({
|
|
28
|
+
modules: ['abckit']
|
|
29
|
+
})
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Import components from `abckit/shadcn/*`:
|
|
33
|
+
|
|
34
|
+
```vue
|
|
35
|
+
<script setup lang="ts">
|
|
36
|
+
import { Button } from 'abckit/shadcn/button'
|
|
37
|
+
import { Card, CardHeader, CardTitle } from 'abckit/shadcn/card'
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<Button variant="outline">Click me</Button>
|
|
42
|
+
<Card>
|
|
43
|
+
<CardHeader>
|
|
44
|
+
<CardTitle>Hello</CardTitle>
|
|
45
|
+
</CardHeader>
|
|
46
|
+
</Card>
|
|
47
|
+
</template>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## Components
|
|
51
|
+
|
|
52
|
+
Accordion, Alert, AlertDialog, AspectRatio, AutoForm, Avatar, Badge, Breadcrumb, Button, ButtonGroup, Calendar, Card, Carousel, Chart, Checkbox, Collapsible, Combobox, Command, ContextMenu, CountrySelect, CurrencySelect, Dialog, Drawer, DropdownMenu, Empty, Field, File, Form, HoverCard, Input, InputGroup, InputOTP, Item, Kbd, Label, LanguageSelect, Menubar, NativeSelect, NavigationMenu, NumberField, Pagination, PinInput, Popover, Progress, RadioGroup, RangeCalendar, Resizable, ScrollArea, Select, Separator, Sheet, Sidebar, Skeleton, Slider, Spinner, Stepper, Storage, Switch, Table, Tabs, TagsInput, Textarea, TimezoneSelect, Toggle, ToggleGroup, Tooltip
|
|
53
|
+
|
|
54
|
+
## Composables
|
|
55
|
+
|
|
56
|
+
```ts
|
|
57
|
+
// Authentication
|
|
58
|
+
const { user, isAuthenticated, login, logout } = useAuth()
|
|
59
|
+
|
|
60
|
+
// Image CDN URLs with presets
|
|
61
|
+
const { getImageUrl } = useImageUrl()
|
|
62
|
+
const url = getImageUrl('products/photo.jpg', 'lg') // 1000x1000
|
|
63
|
+
|
|
64
|
+
// Auto breadcrumbs from routes
|
|
65
|
+
const items = useBreadcrumbItems()
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Configuration
|
|
69
|
+
|
|
70
|
+
```ts
|
|
71
|
+
// nuxt.config.ts
|
|
72
|
+
export default defineNuxtConfig({
|
|
73
|
+
extends: ['abckit'],
|
|
74
|
+
runtimeConfig: {
|
|
75
|
+
// Redis/Dragonfly
|
|
76
|
+
dragonfly: {
|
|
77
|
+
host: 'localhost',
|
|
78
|
+
port: 6379
|
|
79
|
+
},
|
|
80
|
+
// S3/R2 Storage
|
|
81
|
+
s3: {
|
|
82
|
+
accessKeyId: '',
|
|
83
|
+
secretAccessKey: '',
|
|
84
|
+
endpoint: '',
|
|
85
|
+
bucket: ''
|
|
86
|
+
},
|
|
87
|
+
// Enable storage drivers
|
|
88
|
+
storage: {
|
|
89
|
+
redis: true,
|
|
90
|
+
s3: true,
|
|
91
|
+
disk: false
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
})
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Theming
|
|
98
|
+
|
|
99
|
+
Override the default theme by creating `app/assets/css/tailwind.css`:
|
|
100
|
+
|
|
101
|
+
```css
|
|
102
|
+
@import "tailwindcss";
|
|
103
|
+
@import "tw-animate-css";
|
|
104
|
+
|
|
105
|
+
:root {
|
|
106
|
+
--primary: oklch(0.6 0.2 250);
|
|
107
|
+
--radius: 0.5rem;
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
## Contributing
|
|
112
|
+
|
|
113
|
+
Contributions, issues, and feature requests are welcome! Feel free to open an issue or submit a pull request.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
MIT
|
|
118
|
+
|
|
119
|
+
---
|
|
120
|
+
|
|
121
|
+
<p align="center">
|
|
122
|
+
<img src=".github/assets/footer.svg" width="100%" alt="abckit footer" />
|
|
123
|
+
</p>
|
|
124
|
+
|
|
125
|
+
<!-- Badges -->
|
|
126
|
+
[npm-version-src]: https://img.shields.io/npm/v/abckit?style=flat&colorA=080f12&colorB=1fa669
|
|
127
|
+
[npm-version-href]: https://npmjs.com/package/abckit
|
|
128
|
+
[npm-downloads-src]: https://img.shields.io/npm/dm/abckit?style=flat&colorA=080f12&colorB=1fa669
|
|
129
|
+
[npm-downloads-href]: https://npmjs.com/package/abckit
|
|
130
|
+
[license-src]: https://img.shields.io/github/license/productdevbook/abckit.svg?style=flat&colorA=080f12&colorB=1fa669
|
|
131
|
+
[license-href]: https://github.com/productdevbook/abckit/blob/main/LICENSE
|
package/dist/module.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { readdirSync } from 'node:fs';
|
|
2
1
|
import { join } from 'node:path';
|
|
3
|
-
import { defineNuxtModule, createResolver, addTypeTemplate, addImportsDir, addServerScanDir, addRouteMiddleware
|
|
2
|
+
import { defineNuxtModule, createResolver, addTypeTemplate, addImportsDir, addServerScanDir, addRouteMiddleware } from '@nuxt/kit';
|
|
4
3
|
import { defu } from 'defu';
|
|
5
4
|
|
|
6
5
|
const module$1 = defineNuxtModule({
|
|
@@ -170,7 +169,7 @@ export {}
|
|
|
170
169
|
baseURL: "/",
|
|
171
170
|
maxAge: 0
|
|
172
171
|
});
|
|
173
|
-
|
|
172
|
+
resolve("./runtime/components/ui");
|
|
174
173
|
nuxt.hook("tailwindcss:sources:extend", (sources) => {
|
|
175
174
|
sources.push({
|
|
176
175
|
source: `${resolve("./runtime/components")}`,
|
|
@@ -231,31 +230,6 @@ export {}
|
|
|
231
230
|
path: resolve("./runtime/middleware/auth.global"),
|
|
232
231
|
global: true
|
|
233
232
|
});
|
|
234
|
-
addComponentsDir({
|
|
235
|
-
path: componentDir,
|
|
236
|
-
extensions: [],
|
|
237
|
-
ignore: ["**/*"]
|
|
238
|
-
}, {
|
|
239
|
-
prepend: true
|
|
240
|
-
});
|
|
241
|
-
try {
|
|
242
|
-
await Promise.all(readdirSync(componentDir).map(async (dir) => {
|
|
243
|
-
try {
|
|
244
|
-
const filePath = await resolvePath(join(componentDir, dir, "index"), { extensions: [".ts", ".js"] });
|
|
245
|
-
addComponentExports({
|
|
246
|
-
prefix: "",
|
|
247
|
-
filePath: resolve(filePath),
|
|
248
|
-
priority: 1
|
|
249
|
-
});
|
|
250
|
-
} catch (err) {
|
|
251
|
-
if (err instanceof Error)
|
|
252
|
-
console.warn("Module error: ", err.message);
|
|
253
|
-
}
|
|
254
|
-
}));
|
|
255
|
-
} catch (err) {
|
|
256
|
-
if (err instanceof Error)
|
|
257
|
-
console.warn(err.message);
|
|
258
|
-
}
|
|
259
233
|
}
|
|
260
234
|
});
|
|
261
235
|
|