Skip to content

Commit

Permalink
chore: properly export composables
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-solanki committed Dec 30, 2022
1 parent abb70c9 commit a1f46c5
Show file tree
Hide file tree
Showing 11 changed files with 1,310 additions and 1,475 deletions.
3 changes: 3 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
ignore-workspace-root-check=true
shamefully-hoist=true
strict-peer-dependencies=false
auto-install-peers=true
2 changes: 1 addition & 1 deletion packages/anu-nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
],
"scripts": {
"build": "pnpm dev:prepare && pnpm gen-imports && pnpm nuxt-module-build",
"dev": "pnpm dev:prepare && pnpm gen-imports && nuxi dev playground",
"dev": "pnpm dev:prepare && nuxi dev playground",
"dev:build": "nuxi build playground",
"dev:prepare": "nuxt-module-build --stub && nuxi prepare playground",
"gen-imports": "na tsx ../../scripts/update-nuxt.ts",
Expand Down
4 changes: 2 additions & 2 deletions packages/anu-nuxt/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
"@unocss/nuxt": "^0.46.5"
},
"dependencies": {
"@anu-vue/preset-theme-default": "workspace:^0.12.0"
"@anu-vue/preset-theme-default": "workspace:*"
}
}
}
15 changes: 7 additions & 8 deletions packages/anu-nuxt/src/module.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/* eslint-disable @typescript-eslint/no-use-before-define */
import {
addComponent,
addImportsSources,
addPlugin,
createResolver,
defineNuxtModule,
addComponent,
addImportsSources,
addPlugin,
createResolver,
defineNuxtModule
} from '@nuxt/kit'

import { name, version } from '../package.json'
Expand Down Expand Up @@ -81,14 +81,13 @@ const anuComposables = [
'useConfigurable',
'useDOMScrollLock',
'useGroupModel',
'useInternalState',
'useInternalBooleanState',
'useLayer',
'useProps',
'useSearch',
'useSort',
'useSpacing',
'useTeleport',
'useTypography',
// 'useProps',
]

declare module '@nuxt/schema' {
Expand Down
4 changes: 2 additions & 2 deletions packages/anu-vue/src/components/alert/AAlert.vue
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<script lang="ts" setup>
import type { ExtractPropTypes } from 'vue'
import { useInternalBooleanState } from '@/composables/useInternalState'
import { useInternalBooleanState } from '@/composables/useInternalBooleanState'
import { useLayer, useProps as useLayerProps } from '@/composables/useLayer'
import { configurable as configurableProp, spacing as spacingProp } from '@/composables/useProps'
import { useSpacing } from '@/composables/useSpacing'
import type { ExtractPropTypes } from 'vue'
const props = defineProps({
spacing: spacingProp,
Expand Down
6 changes: 3 additions & 3 deletions packages/anu-vue/src/components/card/ACard.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<script lang="ts" setup>
import { ATypography } from '../typography'
import { cardProps } from './props'
import { isTypographyUsed } from '@/components/typography/utils'
import { ConfigurableValue, useConfigurable } from '@/composables/useConfigurable'
import { useLayer } from '@/composables/useLayer'
import { useSpacing } from '@/composables/useSpacing'
import { isTypographyUsed } from '@/composables/useTypography'
import { ATypography } from '../typography'
import { cardProps } from './props'
const props = defineProps(cardProps)
Expand Down
8 changes: 4 additions & 4 deletions packages/anu-vue/src/components/menu/AMenu.vue
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<script lang="ts" setup>
import { ACard } from '@/components'
import { useInternalBooleanState } from '@/composables/useInternalBooleanState'
import { useTeleport } from '@/composables/useTeleport'
import type { Middleware, Placement, Strategy } from '@floating-ui/dom'
import { autoUpdate, computePosition, flip, shift } from '@floating-ui/dom'
import { onClickOutside, useEventListener, useMounted } from '@vueuse/core'
import type { PropType } from 'vue'
import { Teleport, Transition, getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, watch } from 'vue'
import { getCurrentInstance, nextTick, onBeforeUnmount, onMounted, ref, Teleport, Transition, watch } from 'vue'
import { sameWidth as sameWidthMiddleware } from './middlewares'
import { useTeleport } from '@/composables/useTeleport'
import { useInternalBooleanState } from '@/composables/useInternalState'
import { ACard } from '@/components'
const props = defineProps({
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Ref, Slots, ToRef } from 'vue'
import type { TypographyProps } from '@/components/typography/props'
import type { ConfigurableValue } from '@/composables/useConfigurable'
import type { Ref, Slots, ToRef } from 'vue'
import type { TypographyProps } from './props'

export const isTypographyUsed = (props: { [K in keyof TypographyProps]: ToRef<TypographyProps[K]> }, slots: Slots) => {
const { title, subtitle, text } = props
Expand Down
8 changes: 4 additions & 4 deletions packages/anu-vue/src/composables/index.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
export * from './useConfigurable'
export * from './useDOMScrollLock'
export * from './useGroupModel'
export * from './useInternalState'
export * from './useInternalBooleanState'
export * from './useLayer'
export * from './useProps'
export * from './useSearch'
export * from './useSort'
export * from './useSpacing'
export { spacingProp, useSpacing } from './useSpacing'
export * from './useTeleport'
export * from './useTypography'

// This is not composable at all. It is utility
// export * from './useProps'
Loading

0 comments on commit a1f46c5

Please sign in to comment.