@sidekick-coder/zenith-kit 0.3.9 → 0.3.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sidekick-coder/zenith-kit",
3
- "version": "0.3.9",
3
+ "version": "0.3.11",
4
4
  "license": "MIT",
5
5
  "description": "Package to use with zenith framework",
6
6
  "author": "Henrique Oliveira <henriqueoliwork@gmail.com>",
@@ -70,7 +70,7 @@
70
70
  "scripts": {
71
71
  "build:server": "tsdown",
72
72
  "build:client": "vite build --config vite.client.config.ts",
73
- "build:components": "vite build",
73
+ "build:components": "vite build --config vite.components.config.ts",
74
74
  "build": "npm-run-all -p build:*",
75
75
  "test:unit": "vitest --project unit",
76
76
  "test:int": "vitest -p integration",
@@ -5,7 +5,6 @@ import { toTypedSchema } from '@vee-validate/valibot'
5
5
  import { computed, ref, watch } from 'vue'
6
6
  import type { PropType } from 'vue'
7
7
  import type { BaseSchema } from 'valibot'
8
- import { toast } from 'vue-sonner'
9
8
  import ClientOnly from './ClientOnly.vue'
10
9
  import FormAutoFieldList from './FormAutoFieldList.vue'
11
10
 
@@ -23,6 +22,7 @@ import {
23
22
  import { tryCatch } from '#shared/utils/tryCatch.ts'
24
23
  import { validator } from '#shared/facades/validator.ts'
25
24
  import type { DefineFormField } from '#client/utils/defineFormFields.ts'
25
+ import toast from '#client/facades/toast.ts'
26
26
 
27
27
  const props = defineProps({
28
28
  title: {
@@ -1,7 +1,6 @@
1
1
  <script setup lang="ts">
2
2
  import { ref } from 'vue'
3
3
  import { useField } from 'vee-validate'
4
- import { toast } from 'vue-sonner'
5
4
 
6
5
  import { $fetch } from '#client/utils/fetcher.ts'
7
6
  import { $file } from '#client/utils/file.ts'
@@ -16,6 +15,7 @@ import {
16
15
  } from '#client/components/ui/form/index.ts'
17
16
  import Button from '#client/components/ZButton.vue'
18
17
  import Icon from '#client/components/Icon.vue'
18
+ import toast from '#client/facades/toast.ts'
19
19
 
20
20
  const props = defineProps({
21
21
  name: {
@@ -24,7 +24,7 @@ import {
24
24
  useSidebar,
25
25
  } from '#client/components/ui/sidebar/index.ts'
26
26
  import Icon from '#client/components/Icon.vue'
27
- import { toast } from 'vue-sonner'
27
+ import toast from '#client/facades/toast.ts'
28
28
 
29
29
  interface Link {
30
30
  label: string
@@ -1,5 +1,5 @@
1
1
  <script setup lang="ts">
2
- import { toast } from 'vue-sonner'
2
+ import toast from '#client/facades/toast.ts'
3
3
  import Button from './ZButton.vue'
4
4
  import ClientOnly from './ClientOnly.vue'
5
5
  import {
@@ -5,7 +5,7 @@ import { toTypedSchema } from '@vee-validate/valibot'
5
5
  import { computed, ref, watch } from 'vue'
6
6
  import type { PropType } from 'vue'
7
7
  import type { BaseSchema } from 'valibot'
8
- import { toast } from 'vue-sonner'
8
+ import toast from '#client/facades/toast.ts'
9
9
  import ClientOnly from './ClientOnly.vue'
10
10
  import FormAutoFieldList from './FormAutoFieldList.vue'
11
11
 
@@ -1,4 +1,3 @@
1
1
  import type { InjectionKey } from 'vue'
2
2
 
3
- export const FORM_ITEM_INJECTION_KEY
4
- = Symbol() as InjectionKey<string>
3
+ export const FORM_ITEM_INJECTION_KEY = Symbol.for("zenith:form-item") as InjectionKey<string>
@@ -1,6 +1,6 @@
1
- import { toast } from 'vue-sonner'
2
1
  import qs from 'qs'
3
2
  import { tryCatch } from '#shared/utils/tryCatch.ts'
3
+ import toast from '#client/facades/toast.ts'
4
4
 
5
5
  export interface FetchOptions extends RequestInit {
6
6
  query?: Record<string, any>
@@ -1,3 +1,3 @@
1
- import { toast } from 'vue-sonner'
1
+ import toast from "#client/facades/toast.ts";
2
2
 
3
3
  export const $toast = toast
@@ -1,9 +1,10 @@
1
- import { createLogger, defineConfig, UserConfig } from 'vite'
1
+ import { createLogger, defineConfig, mergeConfig, UserConfig } from 'vite'
2
2
  import vue from '@vitejs/plugin-vue'
3
3
  import tailwindcss from '@tailwindcss/vite'
4
4
  import dts from 'vite-plugin-dts'
5
5
  import { generateIndexFile } from '#server/utils/generateIndexFile.ts'
6
6
  import zenith from './vite/plugins/zenith'
7
+ import viteCommonConfig from './vite.common.config'
7
8
 
8
9
  const logger = createLogger()
9
10
 
@@ -56,32 +57,45 @@ const plugins: UserConfig['plugins'] = [
56
57
  }),
57
58
  ]
58
59
 
59
- plugins.push(dts({
60
- // entryRoot: 'src/client/index.ts',
61
- tsconfigPath: './tsconfig.client.json',
62
- staticImport: true,
63
- }))
64
-
65
- plugins.push(tailwindcss(), prebuild())
60
+ // plugins.push(dts({
61
+ // // entryRoot: 'src/client/index.ts',
62
+ // tsconfigPath: './tsconfig.client.json',
63
+ // staticImport: true,
64
+ // }))
65
+ //
66
+ // plugins.push(tailwindcss(), prebuild())
66
67
 
67
68
  // plugins.push(zenith({
68
69
  // imports: externals
69
70
  // }))
70
71
 
71
- export default defineConfig({
72
- customLogger: logger,
73
- plugins: plugins,
72
+ // export default defineConfig({
73
+ // customLogger: logger,
74
+ // plugins: plugins,
75
+ // build: {
76
+ // outDir: 'dist/client',
77
+ // rollupOptions: {
78
+ // external: externals,
79
+ // },
80
+ // lib: {
81
+ // name: 'Client',
82
+ // entry: 'src/client/index.ts',
83
+ // formats: ['es'],
84
+ // fileName: (format) => `index.${format}.js`,
85
+ // cssFileName: 'styles',
86
+ // },
87
+ // },
88
+ // })
89
+ export default mergeConfig(viteCommonConfig, defineConfig({
90
+ plugins: [prebuild()],
74
91
  build: {
75
92
  outDir: 'dist/client',
76
- rollupOptions: {
77
- external: externals,
78
- },
79
93
  lib: {
80
- name: 'Client',
94
+ name: 'Components',
81
95
  entry: 'src/client/index.ts',
82
96
  formats: ['es'],
83
97
  fileName: (format) => `index.${format}.js`,
84
98
  cssFileName: 'styles',
85
99
  },
86
100
  },
87
- })
101
+ }))
@@ -0,0 +1,49 @@
1
+ import { createLogger, defineConfig, UserConfig } from 'vite'
2
+ import vue from '@vitejs/plugin-vue'
3
+ import tailwindcss from '@tailwindcss/vite'
4
+ import dts from 'vite-plugin-dts'
5
+
6
+ export const logger = createLogger()
7
+
8
+ const externals = [
9
+ 'vue',
10
+ // 'vue-router',
11
+ // '@vueuse/core',
12
+ // '@vueuse/router',
13
+ 'vee-validate',
14
+ '@vee-validate/valibot',
15
+ // "@unhead/vue",
16
+ // "vue-router",
17
+ // "vue-sonner",
18
+ // "vee-validate",
19
+ // "reka-ui",
20
+ ]
21
+
22
+ const plugins: UserConfig['plugins'] = [
23
+ vue({
24
+ template: {
25
+ compilerOptions: {
26
+ isCustomElement: (tag) => {
27
+ return ['iconify-icon'].includes(tag)
28
+ }
29
+ }
30
+ }
31
+ }),
32
+ ]
33
+
34
+ plugins.push(dts({
35
+ tsconfigPath: './tsconfig.client.json',
36
+ staticImport: true,
37
+ }))
38
+
39
+ plugins.push(tailwindcss())
40
+
41
+ export default defineConfig({
42
+ customLogger: logger,
43
+ plugins: plugins,
44
+ build: {
45
+ rollupOptions: {
46
+ external: externals,
47
+ },
48
+ },
49
+ })
@@ -1,11 +1,11 @@
1
- import { createLogger, defineConfig, UserConfig } from 'vite'
1
+ import { createLogger, defineConfig, mergeConfig, UserConfig } from 'vite'
2
2
  import vue from '@vitejs/plugin-vue'
3
3
  import tailwindcss from '@tailwindcss/vite'
4
4
  import dts from 'vite-plugin-dts'
5
5
  import { generateIndexFile } from '#server/utils/generateIndexFile.ts'
6
6
  import zenith from './vite/plugins/zenith'
7
+ import viteCommonConfig, { logger } from './vite.common.config'
7
8
 
8
- const logger = createLogger()
9
9
 
10
10
  const prebuild = () => ({
11
11
  name: 'prebuild',
@@ -35,7 +35,7 @@ const externals = [
35
35
  //
36
36
  // 'vee-validate',
37
37
  // '@vee-validate/valibot',
38
- //
38
+ // //
39
39
  // "@unhead/vue",
40
40
  // "@unhead/vue/components",
41
41
 
@@ -45,44 +45,58 @@ const externals = [
45
45
  // "embla-carousel-vue"
46
46
  ]
47
47
 
48
- const plugins: UserConfig['plugins'] = [
49
- vue({
50
- template: {
51
- compilerOptions: {
52
- isCustomElement: (tag) => {
53
- return ['iconify-icon'].includes(tag)
54
- }
55
- }
56
- }
57
- }),
58
- ]
59
-
60
- plugins.push(dts({
61
- // entryRoot: 'src/client/components.ts',
62
- tsconfigPath: './tsconfig.client.json',
63
- staticImport: true
64
- }))
48
+ // const plugins: UserConfig['plugins'] = [
49
+ // vue({
50
+ // template: {
51
+ // compilerOptions: {
52
+ // isCustomElement: (tag) => {
53
+ // return ['iconify-icon'].includes(tag)
54
+ // }
55
+ // }
56
+ // }
57
+ // }),
58
+ // ]
59
+ //
60
+ // plugins.push(dts({
61
+ // // entryRoot: 'src/client/components.ts',
62
+ // tsconfigPath: './tsconfig.client.json',
63
+ // staticImport: true
64
+ // }))
65
65
 
66
- plugins.push(tailwindcss(), prebuild())
66
+ // plugins.push(tailwindcss(), prebuild())
67
67
 
68
68
  // plugins.push(zenith({
69
69
  // imports: externals
70
70
  // }))
71
71
 
72
- export default defineConfig({
73
- customLogger: logger,
74
- plugins: plugins,
72
+ export default mergeConfig(viteCommonConfig, defineConfig({
73
+ plugins: [prebuild()],
75
74
  build: {
76
75
  outDir: 'dist/components',
77
- rollupOptions: {
78
- external: externals,
79
- },
80
76
  lib: {
81
- name: 'Client',
77
+ name: 'Components',
82
78
  entry: 'src/client/components.ts',
83
79
  formats: ['es'],
84
80
  fileName: (format) => `index.${format}.js`,
85
81
  cssFileName: 'styles',
86
82
  },
87
83
  },
88
- })
84
+ }))
85
+
86
+ // export default defineConfig({
87
+ // customLogger: logger,
88
+ // plugins: plugins,
89
+ // build: {
90
+ // outDir: 'dist/components',
91
+ // rollupOptions: {
92
+ // external: externals,
93
+ // },
94
+ // lib: {
95
+ // name: 'Client',
96
+ // entry: 'src/client/components.ts',
97
+ // formats: ['es'],
98
+ // fileName: (format) => `index.${format}.js`,
99
+ // cssFileName: 'styles',
100
+ // },
101
+ // },
102
+ // })