Skip to content

Commit

Permalink
chore: build
Browse files Browse the repository at this point in the history
  • Loading branch information
jaskang committed Jul 23, 2024
1 parent 2420202 commit f82ef91
Show file tree
Hide file tree
Showing 14 changed files with 687 additions and 1,095 deletions.
21 changes: 10 additions & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
"docs:preview": "vitepress preview site",
"build": "vite build",
"change": "pnpm changeset",
"release": "pnpm build && changeset publish"
"release": "pnpm build && changeset publish",
"test": "vitest"
},
"dependencies": {
"@floating-ui/vue": "^1.1.1",
"@radix-ui/colors": "^3.0.0",
"@floating-ui/vue": "^1.1.2",
"@vueuse/core": "^10.11.0",
"kotl": "^2.1.4",
"mitt": "^3.0.1"
Expand All @@ -52,10 +52,11 @@
"@types/node": "^20.14.11",
"@vitejs/plugin-vue": "^5.0.5",
"@vitejs/plugin-vue-jsx": "^4.0.0",
"@vue/test-utils": "^2.4.6",
"autoprefixer": "^10.4.19",
"eslint": "^9.7.0",
"happy-dom": "^14.12.3",
"lucide-vue-next": "^0.408.0",
"lucide-vue-next": "^0.414.0",
"mdast-util-from-markdown": "^2.0.1",
"mdast-util-frontmatter": "^2.0.1",
"mdast-util-to-markdown": "^2.1.0",
Expand All @@ -66,16 +67,14 @@
"prettier-plugin-tailwindcss": "^0.6.5",
"rimraf": "^6.0.1",
"tailwindcss": "^4.0.0-alpha.17",
"tsup": "^8.1.1",
"typescript": "^5.5.3",
"tsup": "^8.2.2",
"typescript": "^5.5.4",
"unist-util-visit": "^5.0.0",
"vite": "^5.3.4",
"vite-plugin-dts": "^3.9.1",
"vite-plugin-inspect": "^0.8.4",
"vite-plugin-vue-devtools": "^7.3.6",
"vite-plugin-dts": "^4.0.0-beta.1",
"vitepress": "1.2.2",
"vitest": "^2.0.3",
"vue": "^3.4.31",
"vitest": "^2.0.4",
"vue": "^3.4.33",
"vue-router": "^4.4.0"
},
"pnpm": {
Expand Down
1,344 changes: 586 additions & 758 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

284 changes: 0 additions & 284 deletions preset.ts

This file was deleted.

3 changes: 1 addition & 2 deletions site/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { dirname, resolve } from 'node:path'
import { fileURLToPath } from 'node:url'
import tailwindcss from '@tailwindcss/vite'
import jsx from '@vitejs/plugin-vue-jsx'
import VueDevTools from 'vite-plugin-vue-devtools'
import { defineConfigWithTheme } from 'vitepress'
import { demo } from './plugins/demo'
import type { ThemeConfig } from './theme/theme'
Expand Down Expand Up @@ -67,7 +66,7 @@ export default defineConfigWithTheme<ThemeConfig>({
},
},
vite: {
plugins: [jsx(), demo(), tailwindcss(), VueDevTools()],
plugins: [jsx(), demo(), tailwindcss()],
resolve: {
alias: [
{ find: /^tailv$/, replacement: resolve(__dirname, '../../src') },
Expand Down
1 change: 1 addition & 0 deletions site/.vitepress/theme/styles/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
/* @import './tailwind.css'; */
@import '../../../../src/style.css';
@import './code.css';
@import './prose.css';

html {
background-color: var(--color-white);
Expand Down
Empty file.
7 changes: 7 additions & 0 deletions src/Button/__snapshots__/button.test.ts.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

exports[`Button > default 1`] = `
"<button type="button" class="focus-visible:outline-primary-solid inline-flex cursor-pointer appearance-none items-center justify-center whitespace-nowrap text-center font-medium outline-none transition-[color,background-color,text-decoration-color] focus:z-10 focus-visible:outline-2 focus-visible:outline-offset-2 disabled:cursor-not-allowed disabled:opacity-50 border-input-border text-foreground bg-input-background enabled:hover:bg-input-background-hover border shadow-sm h-9 text-sm py-1.5 px-3 rounded-md">
<!--v-if-->Hello world
</button>"
`;
27 changes: 27 additions & 0 deletions src/Button/button.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { mount } from '@vue/test-utils'
import { describe, expect, test } from 'vitest'
import Button from './index.vue'

describe('Button', () => {
test('default', async () => {
const wrapper = mount(Button, {
props: {},
slots: { default: 'Hello world' },
})
const el = wrapper.element as HTMLButtonElement

// Assert the rendered text of the component
expect(wrapper.text()).toContain('Hello world')

expect(el.className.split(' ').includes('bg-input-background')).toBe(true)
})

test('variant', async () => {
const wrapper = mount(Button, {
props: { variant: 'outline' },
slots: { default: 'Hello world' },
})
const el = wrapper.element as HTMLButtonElement
expect(el.className.split(' ').includes('border-primary-border')).toBe(true)
})
})
Loading

0 comments on commit f82ef91

Please sign in to comment.