@devappsnpm/vue-kit 0.1.0

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 (48) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +82 -0
  3. package/bin/devapps-vue.js +3 -0
  4. package/dist/index.cjs +556 -0
  5. package/dist/index.cjs.map +1 -0
  6. package/dist/index.js +510 -0
  7. package/dist/index.js.map +1 -0
  8. package/dist/ui.cjs +515 -0
  9. package/dist/ui.cjs.map +1 -0
  10. package/dist/ui.js +485 -0
  11. package/dist/ui.js.map +1 -0
  12. package/package.json +57 -0
  13. package/stubs/components/component.vue.stub +17 -0
  14. package/stubs/module/basic/component.vue.stub +9 -0
  15. package/stubs/module/basic/index.ts.stub +1 -0
  16. package/stubs/module/crud/modal/components/DeleteModal.vue.stub +35 -0
  17. package/stubs/module/crud/modal/components/FormModal.vue.stub +88 -0
  18. package/stubs/module/crud/modal/components/List.vue.stub +60 -0
  19. package/stubs/module/crud/modal/index.ts.stub +4 -0
  20. package/stubs/module/crud/modal/router.ts.stub +11 -0
  21. package/stubs/module/crud/modal/services/service.ts.stub +9 -0
  22. package/stubs/module/crud/modal/stores/store.ts.stub +9 -0
  23. package/stubs/module/crud/modal/types/types.ts.stub +16 -0
  24. package/stubs/module/crud/modal/views/View.vue.stub +83 -0
  25. package/stubs/module/crud/page/components/DeleteModal.vue.stub +35 -0
  26. package/stubs/module/crud/page/components/Form.vue.stub +62 -0
  27. package/stubs/module/crud/page/components/List.vue.stub +42 -0
  28. package/stubs/module/crud/page/index.ts.stub +4 -0
  29. package/stubs/module/crud/page/pages/CreatePage.vue.stub +27 -0
  30. package/stubs/module/crud/page/pages/EditPage.vue.stub +34 -0
  31. package/stubs/module/crud/page/pages/ListPage.vue.stub +59 -0
  32. package/stubs/module/crud/page/pages/ShowPage.vue.stub +28 -0
  33. package/stubs/module/crud/page/router.ts.stub +26 -0
  34. package/stubs/module/crud/page/services/service.ts.stub +9 -0
  35. package/stubs/module/crud/page/stores/store.ts.stub +9 -0
  36. package/stubs/module/crud/page/types/types.ts.stub +16 -0
  37. package/stubs/module/dashboard/Dashboard.vue.stub +24 -0
  38. package/stubs/module/dashboard/index.ts.stub +1 -0
  39. package/stubs/module/dashboard/router.ts.stub +11 -0
  40. package/stubs/module/resource/List.vue.stub +19 -0
  41. package/stubs/module/resource/index.ts.stub +3 -0
  42. package/stubs/module/resource/service.ts.stub +9 -0
  43. package/stubs/module/resource/store.ts.stub +9 -0
  44. package/stubs/module/resource/types.ts.stub +10 -0
  45. package/stubs/pages/page.vue.stub +14 -0
  46. package/stubs/services/service.ts.stub +13 -0
  47. package/stubs/stores/store.ts.stub +19 -0
  48. package/stubs/types/types.ts.stub +6 -0
@@ -0,0 +1,16 @@
1
+ export interface {{ ModuleName }} {
2
+ uuid: string
3
+ // TODO: add fields
4
+ created_at: string
5
+ updated_at: string
6
+ }
7
+
8
+ export interface {{ ModuleName }}Form {
9
+ // TODO: add form fields
10
+ }
11
+
12
+ export interface {{ ModuleName }}Filters {
13
+ page?: number
14
+ per_page?: number
15
+ search?: string
16
+ }
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ // {{ ModuleName }} Dashboard
3
+ </script>
4
+
5
+ <template>
6
+ <div class="{{ moduleSlug }}-dashboard">
7
+ <h1 class="text-xl font-semibold mb-4">{{ ModuleName }} Dashboard</h1>
8
+
9
+ <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
10
+ <div class="bg-white p-6 rounded shadow">
11
+ <h3 class="text-sm font-medium text-gray-500">Metric 1</h3>
12
+ <p class="text-2xl font-bold mt-2">0</p>
13
+ </div>
14
+ <div class="bg-white p-6 rounded shadow">
15
+ <h3 class="text-sm font-medium text-gray-500">Metric 2</h3>
16
+ <p class="text-2xl font-bold mt-2">0</p>
17
+ </div>
18
+ <div class="bg-white p-6 rounded shadow">
19
+ <h3 class="text-sm font-medium text-gray-500">Metric 3</h3>
20
+ <p class="text-2xl font-bold mt-2">0</p>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ </template>
@@ -0,0 +1 @@
1
+ export { default as routes } from './router'
@@ -0,0 +1,11 @@
1
+ import type { RouteRecordRaw } from 'vue-router'
2
+
3
+ const routes: RouteRecordRaw[] = [
4
+ {
5
+ path: '/{{ moduleSlugPlural }}-dashboard',
6
+ name: '{{ moduleSlugPlural }}.dashboard',
7
+ component: () => import('./views/{{ ModuleName }}Dashboard.vue'),
8
+ },
9
+ ]
10
+
11
+ export default routes
@@ -0,0 +1,19 @@
1
+ <script setup lang="ts">
2
+ import { onMounted } from 'vue'
3
+ import { use{{ ModuleName }}Store } from '../stores/{{ moduleSlug }}.store'
4
+
5
+ const store = use{{ ModuleName }}Store()
6
+
7
+ onMounted(() => store.fetchAll())
8
+ </script>
9
+
10
+ <template>
11
+ <div class="{{ moduleSlug }}-list">
12
+ <div v-if="store.loading">Loading...</div>
13
+ <ul v-else>
14
+ <li v-for="item in store.items" :key="item.uuid">
15
+ {{ item }}
16
+ </li>
17
+ </ul>
18
+ </div>
19
+ </template>
@@ -0,0 +1,3 @@
1
+ export * from './types/{{ moduleSlug }}.types'
2
+ export * from './services/{{ moduleSlug }}.service'
3
+ export * from './stores/{{ moduleSlug }}.store'
@@ -0,0 +1,9 @@
1
+ import { CrudService } from '@devapps/vue-kit'
2
+ import type { HttpClient } from '@devapps/vue-kit'
3
+ import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
4
+
5
+ export class {{ ModuleName }}Service extends CrudService<{{ ModuleName }}> {
6
+ constructor(http: HttpClient) {
7
+ super(http, '{{ resourcePath }}')
8
+ }
9
+ }
@@ -0,0 +1,9 @@
1
+ import { defineCrudStore } from '@devapps/vue-kit'
2
+ import { {{ ModuleName }}Service } from '../services/{{ moduleSlug }}.service'
3
+ import type { {{ ModuleName }} } from '../types/{{ moduleSlug }}.types'
4
+ import { useHttpClient } from '@/composables/useHttpClient' // adjust to your project
5
+
6
+ export const use{{ ModuleName }}Store = defineCrudStore<{{ ModuleName }}>(
7
+ '{{ moduleName }}',
8
+ () => new {{ ModuleName }}Service(useHttpClient()),
9
+ )
@@ -0,0 +1,10 @@
1
+ export interface {{ ModuleName }} {
2
+ uuid: string
3
+ // TODO: add fields
4
+ created_at: string
5
+ updated_at: string
6
+ }
7
+
8
+ export interface {{ ModuleName }}Form {
9
+ // TODO: add form fields
10
+ }
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ import { ref } from 'vue'
3
+
4
+ </script>
5
+
6
+ <template>
7
+ <div class="{{ moduleSlug }}-page">
8
+ <h1 class="text-xl font-semibold mb-4">{{ ModuleName }} Page</h1>
9
+
10
+ <div class="bg-white p-6 rounded shadow">
11
+ <!-- Page content -->
12
+ </div>
13
+ </div>
14
+ </template>
@@ -0,0 +1,13 @@
1
+ import { BaseService } from '@devapps/vue-kit'
2
+ import type { HttpClient } from '@devapps/vue-kit'
3
+
4
+ export class {{ ModuleName }}Service extends BaseService {
5
+ constructor(http: HttpClient) {
6
+ super(http)
7
+ }
8
+
9
+ // async customAction() {
10
+ // const response = await this.get('/custom-endpoint')
11
+ // return response.data
12
+ // }
13
+ }
@@ -0,0 +1,19 @@
1
+ import { defineStore } from 'pinia'
2
+ import { ref } from 'vue'
3
+
4
+ export const use{{ ModuleName }}Store = defineStore('{{ moduleName }}', () => {
5
+ // state
6
+ const data = ref<any>(null)
7
+ const loading = ref(false)
8
+
9
+ // actions
10
+ function setData(newData: any) {
11
+ data.value = newData
12
+ }
13
+
14
+ return {
15
+ data,
16
+ loading,
17
+ setData,
18
+ }
19
+ })
@@ -0,0 +1,6 @@
1
+ export interface {{ ModuleName }} {
2
+ id: string | number
3
+ // fields
4
+ created_at: string
5
+ updated_at: string
6
+ }