@finema/finework-layer 0.2.50 → 0.2.51
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/.playground/app/pages/layout-admin/test/[id]/index.vue +286 -0
- package/.playground/app/pages/layout-admin.vue +2 -2
- package/@finema finework-layer - LLM Documentation Guide.md +566 -0
- package/API_REFERENCE.md +780 -0
- package/ARCHITECTURE.md +592 -0
- package/CHANGELOG.md +6 -0
- package/COMPONENT_EXAMPLES.md +893 -0
- package/DOCUMENTATION_INDEX.md +354 -0
- package/EXAMPLES.md +597 -0
- package/QUICK_START.md +678 -0
- package/README.md +199 -33
- package/TROUBLESHOOTING.md +646 -0
- package/app/components/Button/Back.vue +1 -1
- package/app/components/Layout/Admin/Sidebar.vue +10 -3
- package/app/components/Layout/Admin/index.vue +9 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,73 +1,239 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @finema/finework-layer
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
A comprehensive Nuxt Layer providing reusable components, composables, layouts, and utilities for Finework applications.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/@finema/finework-layer)
|
|
6
|
+
[](https://www.npmjs.com/package/@finema/finework-layer)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
## 📚 Documentation
|
|
9
|
+
|
|
10
|
+
### For Developers
|
|
11
|
+
|
|
12
|
+
- **[Quick Start Guide](./QUICK_START.md)** - Get started in 5 minutes
|
|
13
|
+
- **[Component Examples](./COMPONENT_EXAMPLES.md)** - Real-world usage examples
|
|
14
|
+
- **[API Reference](./API_REFERENCE.md)** - Complete API documentation
|
|
15
|
+
- **[Architecture](./ARCHITECTURE.md)** - System design and patterns
|
|
16
|
+
- **[Troubleshooting](./TROUBLESHOOTING.md)** - Common issues and solutions
|
|
17
|
+
|
|
18
|
+
### For LLM/AI Assistants
|
|
19
|
+
|
|
20
|
+
- **[LLM Guide](./LLM_GUIDE.md)** - Comprehensive guide for AI code generation
|
|
21
|
+
|
|
22
|
+
## 🚀 Features
|
|
23
|
+
|
|
24
|
+
- ✅ **Authentication System** - Complete auth flow with permissions
|
|
25
|
+
- ✅ **Layout Components** - Admin and User layouts
|
|
26
|
+
- ✅ **Data Loading** - Smart loading states with StatusBox
|
|
27
|
+
- ✅ **Form Handling** - Validation with Valibot
|
|
28
|
+
- ✅ **Type Safety** - Full TypeScript support
|
|
29
|
+
- ✅ **Auto-imports** - Components, composables, and constants
|
|
30
|
+
- ✅ **Middleware** - Auth, permissions, and route guards
|
|
31
|
+
- ✅ **UI Components** - Built on @nuxt/ui
|
|
32
|
+
|
|
33
|
+
## 📦 Installation
|
|
8
34
|
|
|
9
35
|
```bash
|
|
10
|
-
pnpm
|
|
36
|
+
pnpm add @finema/finework-layer
|
|
11
37
|
```
|
|
12
38
|
|
|
13
|
-
##
|
|
39
|
+
## 🎯 Quick Start
|
|
40
|
+
|
|
41
|
+
### 1. Extend the Layer
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
// nuxt.config.ts
|
|
45
|
+
export default defineNuxtConfig({
|
|
46
|
+
extends: ["@finema/finework-layer"],
|
|
47
|
+
|
|
48
|
+
runtimeConfig: {
|
|
49
|
+
public: {
|
|
50
|
+
baseAPI: process.env.NUXT_PUBLIC_BASE_API,
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
```
|
|
14
55
|
|
|
15
|
-
|
|
56
|
+
### 2. Create Your First Page
|
|
57
|
+
|
|
58
|
+
```vue
|
|
59
|
+
<template>
|
|
60
|
+
<LayoutAdmin label="Dashboard" :items="navItems">
|
|
61
|
+
<StatusBox :status="data.status.value" :data="data.data.value">
|
|
62
|
+
<template #default="{ data }">
|
|
63
|
+
<Card>
|
|
64
|
+
<h1>Welcome, {{ data.name }}!</h1>
|
|
65
|
+
</Card>
|
|
66
|
+
</template>
|
|
67
|
+
</StatusBox>
|
|
68
|
+
</LayoutAdmin>
|
|
69
|
+
</template>
|
|
70
|
+
|
|
71
|
+
<script setup lang="ts">
|
|
72
|
+
definePageMeta({
|
|
73
|
+
middleware: ["auth"],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
const data = useObjectLoader({
|
|
77
|
+
method: "GET",
|
|
78
|
+
url: "/api/dashboard",
|
|
79
|
+
getRequestOptions: useRequestOptions().auth,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
onMounted(() => data.run());
|
|
83
|
+
|
|
84
|
+
const navItems = [
|
|
85
|
+
{ label: "Dashboard", to: "/dashboard", icon: "i-heroicons-home" },
|
|
86
|
+
];
|
|
87
|
+
</script>
|
|
88
|
+
```
|
|
16
89
|
|
|
17
|
-
|
|
90
|
+
## 🏗️ Project Structure
|
|
18
91
|
|
|
19
|
-
|
|
92
|
+
```
|
|
93
|
+
@finema/finework-layer/
|
|
94
|
+
├── app/
|
|
95
|
+
│ ├── components/ # Reusable components
|
|
96
|
+
│ │ ├── Button/ # Button variants
|
|
97
|
+
│ │ ├── Layout/ # Layout components
|
|
98
|
+
│ │ ├── InfoItemList.vue
|
|
99
|
+
│ │ └── StatusBox.vue
|
|
100
|
+
│ ├── composables/ # Vue composables
|
|
101
|
+
│ │ ├── useAuth.ts
|
|
102
|
+
│ │ └── useRequestOptions.ts
|
|
103
|
+
│ ├── constants/ # App constants
|
|
104
|
+
│ │ └── routes.ts
|
|
105
|
+
│ ├── middleware/ # Route middleware
|
|
106
|
+
│ │ ├── auth.ts
|
|
107
|
+
│ │ ├── permissions.ts
|
|
108
|
+
│ │ └── guest.ts
|
|
109
|
+
│ └── app.config.ts # App configuration
|
|
110
|
+
├── .playground/ # Development playground
|
|
111
|
+
└── docs/ # Documentation
|
|
112
|
+
```
|
|
20
113
|
|
|
21
|
-
##
|
|
114
|
+
## 🎨 Key Components
|
|
22
115
|
|
|
23
|
-
|
|
116
|
+
### StatusBox
|
|
24
117
|
|
|
25
|
-
|
|
118
|
+
Handles loading, error, and empty states automatically.
|
|
26
119
|
|
|
27
|
-
```
|
|
28
|
-
|
|
120
|
+
```vue
|
|
121
|
+
<StatusBox :status="loader.status.value" :data="loader.data.value">
|
|
122
|
+
<template #default="{ data }">
|
|
123
|
+
<!-- Your content -->
|
|
124
|
+
</template>
|
|
125
|
+
</StatusBox>
|
|
29
126
|
```
|
|
30
127
|
|
|
31
|
-
|
|
128
|
+
### InfoItemList
|
|
32
129
|
|
|
33
|
-
|
|
34
|
-
|
|
130
|
+
Display key-value information in a clean layout.
|
|
131
|
+
|
|
132
|
+
```vue
|
|
133
|
+
<InfoItemList
|
|
134
|
+
:items="[
|
|
135
|
+
{ label: 'Name', value: user.name },
|
|
136
|
+
{ label: 'Email', value: user.email },
|
|
137
|
+
{ label: 'Active', value: user.is_active, type: 'boolean' },
|
|
138
|
+
]"
|
|
139
|
+
/>
|
|
35
140
|
```
|
|
36
141
|
|
|
37
|
-
|
|
142
|
+
### Layouts
|
|
143
|
+
|
|
144
|
+
Pre-built layouts for admin and user interfaces.
|
|
38
145
|
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
146
|
+
```vue
|
|
147
|
+
<LayoutAdmin label="Admin Panel" :items="navigationItems">
|
|
148
|
+
<!-- Your content -->
|
|
149
|
+
</LayoutAdmin>
|
|
43
150
|
```
|
|
44
151
|
|
|
45
|
-
##
|
|
152
|
+
## 🔐 Authentication
|
|
46
153
|
|
|
47
|
-
|
|
154
|
+
Built-in authentication system with permission management.
|
|
48
155
|
|
|
49
|
-
```
|
|
50
|
-
|
|
156
|
+
```typescript
|
|
157
|
+
const auth = useAuth();
|
|
158
|
+
|
|
159
|
+
// Check authentication
|
|
160
|
+
if (auth.isAuthenticated.value) {
|
|
161
|
+
console.log("User:", auth.me.value);
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
// Check permissions
|
|
165
|
+
if (auth.hasPermission(UserModule.PMO, Permission.ADMIN)) {
|
|
166
|
+
// User has PMO admin access
|
|
167
|
+
}
|
|
51
168
|
```
|
|
52
169
|
|
|
53
|
-
##
|
|
170
|
+
## 🛠️ Development
|
|
54
171
|
|
|
55
|
-
|
|
172
|
+
### Setup
|
|
56
173
|
|
|
57
174
|
```bash
|
|
175
|
+
# Install dependencies
|
|
176
|
+
pnpm install
|
|
177
|
+
|
|
178
|
+
# Start development server
|
|
179
|
+
pnpm dev
|
|
180
|
+
|
|
181
|
+
# Build for production
|
|
58
182
|
pnpm build
|
|
183
|
+
|
|
184
|
+
# Run linter
|
|
185
|
+
pnpm lint
|
|
186
|
+
|
|
187
|
+
# Fix linting issues
|
|
188
|
+
pnpm lint:fix
|
|
59
189
|
```
|
|
60
190
|
|
|
61
|
-
|
|
191
|
+
### Working on the Layer
|
|
192
|
+
|
|
193
|
+
The `.playground` directory is used for development and testing. It imports the layer itself, allowing you to test changes in real-time.
|
|
62
194
|
|
|
63
195
|
```bash
|
|
64
|
-
|
|
196
|
+
# Start playground
|
|
197
|
+
pnpm dev
|
|
65
198
|
```
|
|
66
199
|
|
|
67
|
-
|
|
200
|
+
## 📝 Publishing
|
|
68
201
|
|
|
69
202
|
```bash
|
|
70
|
-
|
|
203
|
+
# Update version and create changelog
|
|
204
|
+
pnpm release
|
|
205
|
+
|
|
206
|
+
# Or manually
|
|
207
|
+
npm publish --access public
|
|
71
208
|
```
|
|
72
209
|
|
|
73
|
-
|
|
210
|
+
## 🤝 Contributing
|
|
211
|
+
|
|
212
|
+
1. Create a feature branch
|
|
213
|
+
2. Make your changes
|
|
214
|
+
3. Run tests and linting
|
|
215
|
+
4. Submit a pull request
|
|
216
|
+
|
|
217
|
+
## 📄 License
|
|
218
|
+
|
|
219
|
+
MIT License - see LICENSE file for details
|
|
220
|
+
|
|
221
|
+
## 🔗 Links
|
|
222
|
+
|
|
223
|
+
- [Nuxt Documentation](https://nuxt.com)
|
|
224
|
+
- [Nuxt UI Documentation](https://ui.nuxt.com)
|
|
225
|
+
- [@finema/core](https://www.npmjs.com/package/@finema/core)
|
|
226
|
+
|
|
227
|
+
## 📞 Support
|
|
228
|
+
|
|
229
|
+
For issues and questions:
|
|
230
|
+
|
|
231
|
+
1. Check the [Troubleshooting Guide](./TROUBLESHOOTING.md)
|
|
232
|
+
2. Review [Component Examples](./COMPONENT_EXAMPLES.md)
|
|
233
|
+
3. Consult the [API Reference](./API_REFERENCE.md)
|
|
234
|
+
|
|
235
|
+
---
|
|
236
|
+
|
|
237
|
+
**Version:** 0.2.50
|
|
238
|
+
**Last Updated:** 2025-11-07
|
|
239
|
+
**Maintained by:** Finema Team
|