Skip to content

Commit

Permalink
fix(playground): erroe deps
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv committed Oct 22, 2022
1 parent e755466 commit e17bb09
Show file tree
Hide file tree
Showing 11 changed files with 42 additions and 72 deletions.
1 change: 1 addition & 0 deletions packages/components/auto-imports.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ declare global {
const useSessionStorage: typeof import('@vueuse/core')['useSessionStorage']
const useShare: typeof import('@vueuse/core')['useShare']
const useSlots: typeof import('vue')['useSlots']
const useSorted: typeof import('@vueuse/core')['useSorted']
const useSpeechRecognition: typeof import('@vueuse/core')['useSpeechRecognition']
const useSpeechSynthesis: typeof import('@vueuse/core')['useSpeechSynthesis']
const useStepper: typeof import('@vueuse/core')['useStepper']
Expand Down
2 changes: 1 addition & 1 deletion packages/components/button/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ import Button from './src/index.vue'
export const OButton = withInstall(Button)
export default OButton

export * from './src/button'
export * from './src/props'
6 changes: 3 additions & 3 deletions packages/components/button/src/index.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
<script setup lang="ts" name="O-Button">
import { buttonProps } from './button'
import { buttonProps } from './props'
const props = defineProps(buttonProps)
const slots = useSlots()
const isDisabled = computed(() => props.loading || props.disabled)
const onlyIcon = computed(() => slots.icon && !slots.default)
const binds = Object.assign({}, useAttrs(), props.to ? { href: props.to } : {})
</script>

<template>
<component
:is="to ? 'a' : 'button'"
v-bind="to && { href: to }"
v-bind="binds"
:disabled="isDisabled"
:aria-disabled="isDisabled"
class="o-button-base"
Expand All @@ -21,7 +22,6 @@ const onlyIcon = computed(() => slots.icon && !slots.default)
isDisabled ? 'o-disabled' : 'o-transition o-button-hover o-button-active',
onlyIcon && 'aspect-square px-0',
]"
:o="o"
>
<div v-if="loading" i-carbon-circle-dash animate-spin />
<slot v-else name="icon" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
import type { SizeType, ThemeType } from './../../types'
import type { SizeType, ThemeType } from '../../types'
import type { ExtractPropTypes, PropType } from 'vue'

export const buttonProps = {
o: {
type: String as PropType<ThemeType>,
default: 'primary',
},
to: String,
light: Boolean,
text: Boolean,
Expand Down
3 changes: 1 addition & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,8 @@
],
"sideEffects": false,
"scripts": {
"build": "vite build && vue-tsc --declaration --emitDeclarationOnly --skipLibCheck && pnpm run --filter \"../onu-ui\" build",
"build": "vite build && pnpm run --filter \"../onu-ui\" build",
"stub": "vite build --watch"

},
"dependencies": {
"@onu-ui/preset": "workspace:*",
Expand Down
4 changes: 0 additions & 4 deletions packages/components/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
{
"extends": "../../tsconfig.json",
"compilerOptions": {
"baseUrl": ".",
"outDir": "dist",
},
"exclude": [
"**/dist/**",
"./unocss.config.ts",
Expand Down
4 changes: 3 additions & 1 deletion packages/components/unocss.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import { defineConfig, presetAttributify, presetIcons, presetUno, transformerDir
export default defineConfig({
presets: [
presetAttributify(),
presetIcons(),
presetIcons({
cdn: 'https://esm.sh/'
}),
presetUno(),
presetOnu(),
],
Expand Down
8 changes: 2 additions & 6 deletions packages/components/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import VueJSX from '@vitejs/plugin-vue-jsx'
import { defineConfig } from 'vite'
import UnoCSS from 'unocss/vite'
import VueSetupExtend from 'vite-plugin-vue-setup-extend'
import dts from 'vite-plugin-dts'
import Dts from 'vite-plugin-dts'
import AutoImport from 'unplugin-auto-import/vite'
import fs from 'fs-extra'
import type { ResolvedConfig } from 'vite'
Expand Down Expand Up @@ -32,11 +32,7 @@ export default defineConfig({
VueJSX(),
VueSetupExtend(),
UnoCSS(),
dts({
// debug mode https://github.com/qmhc/vite-plugin-dts/blob/main/README.zh-CN.md#%E6%89%93%E5%8C%85%E5%90%8E%E5%87%BA%E7%8E%B0%E7%B1%BB%E5%9E%8B%E6%96%87%E4%BB%B6%E7%BC%BA%E5%A4%B1
// skipDiagnostics: false,
// logDiagnostics: true,
}),
Dts(),
AutoImport({
imports: ['vue', '@vueuse/core'],
dts: 'auto-imports.d.ts',
Expand Down
9 changes: 5 additions & 4 deletions playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
"version": "0.0.0",
"private": true,
"scripts": {
"dev": "vite --port=9898 --open --host --force",
"dev": "vite --port=9898 --open",
"build": "vite build",
"serve": "vite preview"
},
"dependencies": {
"@unocss/reset": "^0.44.5",
"onu-ui": "workspace:*",
"vue": "^3.2.41",
"vue-router": "^4.1.4"
},
"devDependencies": {
"onu-ui": "workspace:*",
"resize-observer-polyfill":"^1.5.1",
"@unocss/reset": "^0.44.5",
"resize-observer-polyfill": "^1.5.1",
"vite-plugin-pages": "^0.25.0",
"vite-plugin-vue-layouts": "^0.7.0"
}
Expand Down
Loading

0 comments on commit e17bb09

Please sign in to comment.