Skip to content

Commit

Permalink
chore: fix ts build issues and sync all deps
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Apr 29, 2023
1 parent 997ed3b commit e4e055e
Show file tree
Hide file tree
Showing 35 changed files with 4,024 additions and 5,131 deletions.
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"repository": "https://github.com/epicmaxco/vuestic-ui",
"devDependencies": {
"lerna": "^3.20.2",
"syncpack": "^9.8.6",
"yorkie": "^2.0.0"
},
"private": true,
Expand Down Expand Up @@ -39,14 +40,5 @@
},
"gitHooks": {
"pre-commit": "lerna run --concurrency 1 --stream precommit --since HEAD"
},
"resolutions": {
"nuxt": "3.1.1",
"vue": "3.2.37",
"vite": "^4",
"vue-router": "4.1.6",
"@nuxt/schema": "3.0.0",
"vue-tsc": "1.2.0",
"typescript": "4.7.4"
}
}
2 changes: 1 addition & 1 deletion packages/ag-grid-theme/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"@ag-grid-community/vue3": "^29.0.0"
},
"peerDependencies": {
"vuestic-ui": "^1.3.0"
"vuestic-ui": "1.6.4"
},
"devDependencies": {
"sass": "^1.57.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/deploy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@
"release": "tsx release-script/release-script.ts"
},
"devDependencies": {
"tsx": "^3.5.0",
"tsx": "^3.12.1",
"inquirer": "^9.0.0",
"typescript": "^4.3.2",
"chalk": "^5.0.1"
"typescript": "4.7.4",
"chalk": "^5.2.0"
},
"exports": {
"./execute": "./execute/index.ts"
Expand Down
4 changes: 2 additions & 2 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"escodegen": "^2.0.0",
"eslint": "7",
"nuxt": "^3.1.1",
"postcss": "^7",
"postcss": "^8.2.1",
"postcss-custom-properties": "^13.1.1",
"serve": "^14.2.0",
"stylelint": "^13.13.1",
Expand All @@ -36,7 +36,7 @@
"vue-component-meta": "^1.2.0",
"vue-i18n": "^9.2.2",
"vue-router": "^4.1.6",
"vue-tsc": "^1.0.24"
"vue-tsc": "^1.2.0"
},
"dependencies": {
"@docsearch/js": "^3.2.1",
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,9 @@
"dependencies": {
"@nuxt/kit": "^3.0.0",
"chokidar": "*",
"nuxt": "^3.0.0",
"nuxt": "^3.1.1",
"pathe": "^0.3.5",
"vuestic-ui": "^1.4.10"
"vuestic-ui": "1.6.4"
},
"devDependencies": {
"@nuxt/module-builder": "latest",
Expand Down
12 changes: 6 additions & 6 deletions packages/sandbox/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,21 @@
"vue": "*"
},
"devDependencies": {
"@vitejs/plugin-vue": "^1.3.0",
"@vitejs/plugin-vue": "^4.1.0",
"@vue/test-utils": "^2.0.2",
"lodash": "^4.17.21",
"nuxt": "3.0.0",
"nuxt": "^3.1.1",
"rollup-plugin-analyzer": "^4.0.0",
"sass": "^1.54.4",
"serve": "^12.0.0",
"sass": "^1.57.1",
"serve": "^14.2.0",
"ts-loader": "^9.3.0",
"ts-node": "^10.8.1",
"typescript": "^4.3.2",
"typescript": "4.7.4",
"vite": "^4.2.1",
"vitest": "*",
"vue-bundle-renderer": "0.4.1",
"vue-tsc": "^1.2.0",
"webpack": "5",
"webpack": "^5.4.1",
"webpack-cli": "^4.9.2",
"when-dependencies-installed": "^1.0.1"
},
Expand Down
10 changes: 5 additions & 5 deletions packages/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,19 +96,19 @@
"postcss": "^8.2.1",
"postcss-import": "^14.0.2",
"postcss-loader": "^4.1.0",
"rollup": "^2.53.1",
"rollup": "^3.15.0",
"rollup-plugin-copy": "^3.4.0",
"rollup-plugin-postcss": "^4.0.0",
"rollup-plugin-terser": "^7.0.2",
"rollup-plugin-typescript2": "^0.30.0",
"rollup-plugin-vue": "^6.0.0",
"sass": "^1.26.5",
"sass": "^1.57.1",
"sass-loader": "^10.1.0",
"semver": "^7.3.5",
"style-loader": "^2.0.0",
"stylelint": "^13.13.1",
"stylelint-config-standard": "^22.0.0",
"ts-loader": "^8.0.14",
"ts-loader": "^9.3.0",
"typescript": "4.7.4",
"vite": "^4.2.1",
"vite-plugin-chunk-split": "^0.4.7",
Expand All @@ -120,7 +120,7 @@
"vuelidate": "^0.7.5",
"webpack": "^5.4.1",
"webpack-bundle-analyzer": "^4.1.0",
"webpack-cli": "^4.4.0",
"webpack-cli": "^4.9.2",
"webpack-merge": "^5.5.0",
"yargs": "^17.5.1"
},
Expand Down Expand Up @@ -170,4 +170,4 @@
]
}
}
}
}
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-accordion/VaAccordion.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { useAccordion } from './hooks/useAccordion'
export default defineComponent({
name: 'VaAccordion',
emits: useStatefulEmits,
emits: [...useStatefulEmits],
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-alert/VaAlert.vue
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ import { VaIcon } from '../va-icon'
export default defineComponent({
name: 'VaAlert',
components: { VaIcon },
emits: useStatefulEmits,
emits: [...useStatefulEmits], // useStatefulEmits,
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
/>
<slot name="rest" v-bind="avatarProps">
<va-avatar
color="secondary"
v-bind="avatarProps"
role="listitem"
>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-carousel/VaCarousel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export default defineComponent({
ariaSlideOfLabel: { type: String, default: '$t:slideOf' },
},
emits: useStatefulEmits,
emits: [...useStatefulEmits],
setup (props, { emit }) {
const { valueComputed: currentSlide } = useStateful(props, emit, 'modelValue', { defaultValue: 0 })
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import {
export default defineComponent({
name: 'VaColorIndicator',
emits: useStatefulEmits,
emits: [...useStatefulEmits],
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-color-input/VaColorInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default defineComponent({
VaInput,
VaColorIndicator,
},
emits: useStatefulEmits,
emits: [...useStatefulEmits],
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ import { VaColorIndicator } from '../va-color-indicator'
export default defineComponent({
name: 'VaColorPalette',
components: { VaColorIndicator },
emits: useStatefulEmits,
emits: [...useStatefulEmits],
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-date-picker/VaDatePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default defineComponent({
const { syncView } = useView(props, emit, { type: props.type })
const classComputed = computed(() => ({
'va-date-picker_without-week-days': props.hideWeekDays,
// 'va-date-picker_without-week-days': props.hideWeekDays,
'va-date-picker_disabled': props.disabled,
}))
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/va-dropdown/VaDropdown.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ export default defineComponent({
ariaLabel: { type: String, default: '$t:toggleDropdown' },
},
emits: [...useStatefulEmits, 'anchor-click', 'anchor-right-click', 'content-click', 'click-outside', 'close', 'open'],
emits: [...useStatefulEmits, 'anchor-click', 'anchor-right-click', 'content-click', 'click-outside', 'close', 'open', 'anchor-dblclick'],
setup (props, { emit, slots, attrs }) {
const contentRef = shallowRef<HTMLElement>()
Expand Down Expand Up @@ -119,7 +119,7 @@ export default defineComponent({
cancelHoverDebounce()
}
const emitAndClose = (eventName: string, close?: boolean, e?: Event) => {
const emitAndClose = (eventName: Parameters<typeof emit>[0], close?: boolean, e?: Event) => {
emit(eventName, e)
if (close && props.trigger !== 'none') { valueComputed.value = false }
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-hover/VaHover.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export default defineComponent({
modelValue: { type: Boolean, default: false },
},
emits: useStatefulEmits,
emits: [...useStatefulEmits],
setup (props, { emit }) {
const { valueComputed } = useStateful(props, emit)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<component
:is="$props.tag"
:is="$props.tag as 'div'"
ref="element"
role="feed"
class="va-infinite-scroll"
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-option-list/VaOptionList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export default defineComponent({
VaSwitch,
VaMessageListWrapper,
},
emits: [...useStatefulEmits],
emits: [...useStatefulEmits, 'clear'],
props: {
...useComponentPresetProp,
...useSelectableListProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-pagination/VaPagination.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ import { VaButton } from '../va-button'
export default defineComponent({
name: 'VaPagination',
components: { VaButton },
emits: useStatefulEmits,
emits: [...useStatefulEmits],
props: {
...useStatefulProps,
...useComponentPresetProp,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/components/va-split/VaSplit.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export default defineComponent({
ariaLabel: { type: String, default: '$t:splitPanels' },
},
emits: useStatefulEmits,
emits: [...useStatefulEmits],
setup: (props, { emit }) => {
const splitPanelsContainer = shallowRef<HTMLElement>()
Expand Down Expand Up @@ -202,7 +202,7 @@ export default defineComponent({
const checkSnappingRange = () => {
return result.every((el, index, array) => {
if (!array[index + 1]) { return true }
return Math.abs(el - array[index + 1]) > props.snappingRange
return Math.abs(el - array[index + 1]) > Number(props.snappingRange)
})
}
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/components/va-time-picker/VaTimePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default defineComponent({
visibleCellsCount: { type: Number, default: 7 },
},
emits: useStatefulEmits,
emits: [...useStatefulEmits],
setup (props, { emit }) {
const { valueComputed } = useStateful(props, emit)
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useClearable.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export const useClearableProps = {
clearValue: { type: String, default: '' },
}

export const useClearableEmits = ['clear']
export const useClearableEmits = ['clear'] as const

export const useClearable = (
props: ClearableProps,
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useColors.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { ColorInput } from 'colortranslator/dist/@types'
import type { ColorVariables, CssColor } from '../services/color'
import { computed } from 'vue'
import { useGlobalConfig } from '../services/global-config/global-config'
Expand All @@ -20,6 +19,7 @@ import {
getColorLightness,
cssVariableName,
normalizeColorName,
type ColorInput,
} from '../services/color/utils'
import { isDev } from '../utils/env'

Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useFocus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { unwrapEl } from './../utils/unwrapEl'
import { focusElement, blurElement } from './../utils/focus'
import { ref, onMounted, onBeforeUnmount, Ref } from 'vue'

export const useFocusEmits = ['focus', 'blur']
export const useFocusEmits = ['focus', 'blur'] as const

export function useFocus (
el?: Ref<HTMLElement | null | undefined>,
Expand Down
3 changes: 1 addition & 2 deletions packages/ui/src/composables/useStateful.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { ref, computed, watch, PropType, Ref } from 'vue'

export type StatefulProps = {
stateful: boolean
[key: string]: any
}

export type StatefulOptions<T> = {
Expand All @@ -28,7 +27,7 @@ export const createStatefulProps = <T>(modelValueType?: T, statefulDefault = fal
}
}

export const useStatefulEmits = ['update:modelValue']
export const useStatefulEmits = ['update:modelValue'] as const

/**
* Returns `valueComputed` that is proxy for `modelValue` or given key of the props
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/composables/useValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export type ValidationProps<V extends any> = typeof useValidationProps & {
rules: { type: PropType<ValidationRule<V>[]> }
}

export const useValidationEmits = ['update:error', 'update:errorMessages']
export const useValidationEmits = ['update:error', 'update:errorMessages'] as const

const isPromise = (value: any): value is Promise<any> => {
return typeof value === 'object' && typeof value.then === 'function'
Expand Down
4 changes: 3 additions & 1 deletion packages/ui/src/services/color/utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import kebabCase from 'lodash/kebabCase.js'
import camelCase from 'lodash/camelCase.js'
import { ColorTranslator } from 'colortranslator'
import type { HSLObject, ColorInput } from 'colortranslator/dist/@types'
import type { HSLObject, HEXObject, RGBObject } from 'colortranslator'

export type ColorInput = string | HEXObject | HSLObject | RGBObject

export const isCSSVariable = (strColor: string): boolean => /var\(--.+\)/.test(strColor)
export const cssVariableName = (colorName: string) => `--va-${kebabCase(colorName)}`
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/services/component-config/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export type ComponentConfig = Partial<{
// key-value hack to avoid generics in type (like Omit, PropTypes, etc.)
// `key: type` as result
[componentName in VuesticComponentName]: {
[key in keyof PropTypes<VuesticComponentsMap[componentName]>]: PropTypes<VuesticComponentsMap[componentName]>[key]
[key in keyof PropTypes<VuesticComponentsMap[componentName]>]?: PropTypes<VuesticComponentsMap[componentName]>[key]
}
} & { all: Props, presets: Presets }>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { App, AppContext, ComponentCustomProperties } from 'vue'

/** Type safe return app global properties for assign */
export const extractGlobalProperties = (app: App | AppContext) => app.config.globalProperties as ComponentCustomProperties
export const extractGlobalProperties = (app: App | AppContext) => app.config.globalProperties

/**
* Type safe set vue global property
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import type { DefineComponent } from 'vue'
import type { ExtractComponentEmits, ExtractComponentProps, DefineComponentOptions } from './types'
import { getComponentProps } from './resolve-component-props'

Expand Down
Loading

0 comments on commit e4e055e

Please sign in to comment.