Skip to content

Commit

Permalink
refactor(hooks): moved specific hooks to shared package
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklin committed Aug 17, 2023
1 parent fcc757a commit 6e9758a
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 12 deletions.
24 changes: 15 additions & 9 deletions apps/admin/autoResolver/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ declare global {
const useClipboard: typeof import('@vueuse/core')['useClipboard']
const useCloned: typeof import('@vueuse/core')['useCloned']
const useColorMode: typeof import('@vueuse/core')['useColorMode']
const useComponentRef: typeof import('../src/composables/useComponentRef')['useComponentRef']
const useComponentRef: typeof import('@celeris/hooks')['useComponentRef']
const useConfirmDialog: typeof import('@vueuse/core')['useConfirmDialog']
const useCounter: typeof import('@vueuse/core')['useCounter']
const useCssModule: typeof import('vue')['useCssModule']
Expand Down Expand Up @@ -195,6 +195,7 @@ declare global {
const useKeyModifier: typeof import('@vueuse/core')['useKeyModifier']
const useLastChanged: typeof import('@vueuse/core')['useLastChanged']
const useLink: typeof import('vue-router')['useLink']
const useLoading: typeof import('@celeris/hooks')['useLoading']
const useLoadingBar: typeof import('@celeris/ca-components')['useLoadingBar']
const useLocalStorage: typeof import('@vueuse/core')['useLocalStorage']
const useMagicKeys: typeof import('@vueuse/core')['useMagicKeys']
Expand All @@ -204,7 +205,7 @@ declare global {
const useMemoize: typeof import('@vueuse/core')['useMemoize']
const useMemory: typeof import('@vueuse/core')['useMemory']
const useMenuSetting: typeof import('../src/composables/setting/useMenuSetting')['useMenuSetting']
const useMergeState: typeof import('../src/composables/useMergeState')['useMergeState']
const useMergeState: typeof import('@celeris/hooks')['useMergeState']
const useMessage: typeof import('@celeris/ca-components')['useMessage']
const useMounted: typeof import('@vueuse/core')['useMounted']
const useMouse: typeof import('@vueuse/core')['useMouse']
Expand Down Expand Up @@ -238,6 +239,7 @@ declare global {
const useResizeObserver: typeof import('@vueuse/core')['useResizeObserver']
const useRoute: typeof import('vue-router')['useRoute']
const useRouter: typeof import('vue-router')['useRouter']
const useScreen: typeof import('@celeris/hooks')['useScreen']
const useScreenOrientation: typeof import('@vueuse/core')['useScreenOrientation']
const useScreenSafeArea: typeof import('@vueuse/core')['useScreenSafeArea']
const useScriptTag: typeof import('@vueuse/core')['useScriptTag']
Expand All @@ -249,7 +251,7 @@ declare global {
const useSorted: typeof import('@vueuse/core')['useSorted']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useState: typeof import('../src/composables/useState')['useState']
const useState: typeof import('@celeris/hooks')['useState']
const useStepper: typeof import('@vueuse/core')['useStepper']
const useStorage: typeof import('@vueuse/core')['useStorage']
const useStorageAsync: typeof import('@vueuse/core')['useStorageAsync']
Expand Down Expand Up @@ -446,7 +448,7 @@ declare module 'vue' {
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useComponentRef: UnwrapRef<typeof import('../src/composables/useComponentRef')['useComponentRef']>
readonly useComponentRef: UnwrapRef<typeof import('@celeris/hooks')['useComponentRef']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
Expand Down Expand Up @@ -499,6 +501,7 @@ declare module 'vue' {
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLoading: UnwrapRef<typeof import('@celeris/hooks')['useLoading']>
readonly useLoadingBar: UnwrapRef<typeof import('@celeris/ca-components')['useLoadingBar']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
Expand All @@ -508,7 +511,7 @@ declare module 'vue' {
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMenuSetting: UnwrapRef<typeof import('../src/composables/setting/useMenuSetting')['useMenuSetting']>
readonly useMergeState: UnwrapRef<typeof import('../src/composables/useMergeState')['useMergeState']>
readonly useMergeState: UnwrapRef<typeof import('@celeris/hooks')['useMergeState']>
readonly useMessage: UnwrapRef<typeof import('@celeris/ca-components')['useMessage']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
Expand Down Expand Up @@ -542,6 +545,7 @@ declare module 'vue' {
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useScreen: UnwrapRef<typeof import('@celeris/hooks')['useScreen']>
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
Expand All @@ -553,7 +557,7 @@ declare module 'vue' {
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
readonly useState: UnwrapRef<typeof import('../src/composables/useState')['useState']>
readonly useState: UnwrapRef<typeof import('@celeris/hooks')['useState']>
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
Expand Down Expand Up @@ -744,7 +748,7 @@ declare module '@vue/runtime-core' {
readonly useClipboard: UnwrapRef<typeof import('@vueuse/core')['useClipboard']>
readonly useCloned: UnwrapRef<typeof import('@vueuse/core')['useCloned']>
readonly useColorMode: UnwrapRef<typeof import('@vueuse/core')['useColorMode']>
readonly useComponentRef: UnwrapRef<typeof import('../src/composables/useComponentRef')['useComponentRef']>
readonly useComponentRef: UnwrapRef<typeof import('@celeris/hooks')['useComponentRef']>
readonly useConfirmDialog: UnwrapRef<typeof import('@vueuse/core')['useConfirmDialog']>
readonly useCounter: UnwrapRef<typeof import('@vueuse/core')['useCounter']>
readonly useCssModule: UnwrapRef<typeof import('vue')['useCssModule']>
Expand Down Expand Up @@ -797,6 +801,7 @@ declare module '@vue/runtime-core' {
readonly useKeyModifier: UnwrapRef<typeof import('@vueuse/core')['useKeyModifier']>
readonly useLastChanged: UnwrapRef<typeof import('@vueuse/core')['useLastChanged']>
readonly useLink: UnwrapRef<typeof import('vue-router')['useLink']>
readonly useLoading: UnwrapRef<typeof import('@celeris/hooks')['useLoading']>
readonly useLoadingBar: UnwrapRef<typeof import('@celeris/ca-components')['useLoadingBar']>
readonly useLocalStorage: UnwrapRef<typeof import('@vueuse/core')['useLocalStorage']>
readonly useMagicKeys: UnwrapRef<typeof import('@vueuse/core')['useMagicKeys']>
Expand All @@ -806,7 +811,7 @@ declare module '@vue/runtime-core' {
readonly useMemoize: UnwrapRef<typeof import('@vueuse/core')['useMemoize']>
readonly useMemory: UnwrapRef<typeof import('@vueuse/core')['useMemory']>
readonly useMenuSetting: UnwrapRef<typeof import('../src/composables/setting/useMenuSetting')['useMenuSetting']>
readonly useMergeState: UnwrapRef<typeof import('../src/composables/useMergeState')['useMergeState']>
readonly useMergeState: UnwrapRef<typeof import('@celeris/hooks')['useMergeState']>
readonly useMessage: UnwrapRef<typeof import('@celeris/ca-components')['useMessage']>
readonly useMounted: UnwrapRef<typeof import('@vueuse/core')['useMounted']>
readonly useMouse: UnwrapRef<typeof import('@vueuse/core')['useMouse']>
Expand Down Expand Up @@ -840,6 +845,7 @@ declare module '@vue/runtime-core' {
readonly useResizeObserver: UnwrapRef<typeof import('@vueuse/core')['useResizeObserver']>
readonly useRoute: UnwrapRef<typeof import('vue-router')['useRoute']>
readonly useRouter: UnwrapRef<typeof import('vue-router')['useRouter']>
readonly useScreen: UnwrapRef<typeof import('@celeris/hooks')['useScreen']>
readonly useScreenOrientation: UnwrapRef<typeof import('@vueuse/core')['useScreenOrientation']>
readonly useScreenSafeArea: UnwrapRef<typeof import('@vueuse/core')['useScreenSafeArea']>
readonly useScriptTag: UnwrapRef<typeof import('@vueuse/core')['useScriptTag']>
Expand All @@ -851,7 +857,7 @@ declare module '@vue/runtime-core' {
readonly useSorted: UnwrapRef<typeof import('@vueuse/core')['useSorted']>
readonly useSpeechRecognition: UnwrapRef<typeof import('@vueuse/core')['useSpeechRecognition']>
readonly useSpeechSynthesis: UnwrapRef<typeof import('@vueuse/core')['useSpeechSynthesis']>
readonly useState: UnwrapRef<typeof import('../src/composables/useState')['useState']>
readonly useState: UnwrapRef<typeof import('@celeris/hooks')['useState']>
readonly useStepper: UnwrapRef<typeof import('@vueuse/core')['useStepper']>
readonly useStorage: UnwrapRef<typeof import('@vueuse/core')['useStorage']>
readonly useStorageAsync: UnwrapRef<typeof import('@vueuse/core')['useStorageAsync']>
Expand Down
3 changes: 0 additions & 3 deletions apps/admin/src/composables/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
export * from "./setting";
export * from "./useChartOption";
export * from "./useComponentRef";
export * from "./useMergeState";
export * from "./useNaiveUIConfigProvider";
export * from "./useState";
9 changes: 9 additions & 0 deletions packages/node/vite/src/plugins/unpluginAutoImport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,15 @@ export function createAutoImportPluginConfig(): PluginOption {
"useLoadingBar",
],
},
{
"@celeris/hooks": [
"useComponentRef",
"useLoading",
"useMergeState",
"useScreen",
"useState",
],
},
],
dts: "autoResolver/auto-imports.d.ts",
dirs: [
Expand Down
1 change: 1 addition & 0 deletions packages/web/hooks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
},
"dependencies": {
"@celeris/types": "workspace:*",
"@celeris/utils": "workspace:*",
"@vueuse/core": "^10.2.1",
"@vueuse/integrations": "^10.2.1"
},
Expand Down
3 changes: 3 additions & 0 deletions packages/web/hooks/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
export * from "./useComponentRef";
export * from "./useLoading";
export * from "./useMergeState";
export * from "./useScreen";
export * from "./useState";
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 comments on commit 6e9758a

@vercel
Copy link

@vercel vercel bot commented on 6e9758a Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

celeris-web – ./apps/admin

celeris-web-git-master-kirklin.vercel.app
celeris-web-kirklin.vercel.app
celeris-web.vercel.app

@vercel
Copy link

@vercel vercel bot commented on 6e9758a Aug 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

celeris-web-api – ./services/admin

celeris-web-api-kirklin.vercel.app
celeris-web-api.vercel.app
celeris-web-api-git-master-kirklin.vercel.app

Please sign in to comment.