Skip to content

Commit

Permalink
Merge pull request #42 from qianmoQ/feature-dev
Browse files Browse the repository at this point in the history
Release for `2024.1.1`
  • Loading branch information
qianmoQ authored Oct 16, 2024
2 parents 9934a6c + ffd7b84 commit 93f5adf
Show file tree
Hide file tree
Showing 22 changed files with 1,928 additions and 25 deletions.
22 changes: 0 additions & 22 deletions .github/workflows/build.yml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,4 @@ dist-ssr
yarn.lock
src/components/ui
.npmrc
docs/.vitepress/cache
12 changes: 12 additions & 0 deletions configure/publish/publish-deploy-npm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env sh
set -e

yarn run build

time=$(date "+%Y-%m-%d %H:%M:%S")

echo "Publish to NPM $VERSION on $time"

yarn publish --access public --non-interactive

echo "Publish to NPM done"
21 changes: 21 additions & 0 deletions configure/publish/publish-deploy-page.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/usr/bin/env sh
VERSION=$(jq -r '.version' package.json)
set -e

yarn run docs:build

cd docs/.vitepress/dist

echo 'shadcn.vue.devlive.org' > CNAME

time=$(date "+%Y-%m-%d %H:%M:%S")

echo "GitHub Action Auto Deploy $VERSION on $time"

git init
git add -A
git commit -m "GitHub Action Auto Deploy $VERSION on $time"

git push -f [email protected]:devlive-community/view-shadcn-ui.git master:gh-pages

echo "GitHub Action Auto Deploy done"
83 changes: 83 additions & 0 deletions docs/.vitepress/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
export default {
title: 'View Shadcn UI',
description: 'A component library built on Shadcn UI and Tailwind CSS.',
themeConfig: {
nav: [
{text: 'Home', link: '/'},
{
text: "Guide",
link: "/guide/installation",
activeMatch: '/guide/'
},
{
text: 'Components (v2024.1.1)',
items: [
{
text: '2024.1.1',
link: '/components/2024.1.1/release-notes',
activeMatch: '/components/2024.1.1/'
},
]
}
],
socialLinks: [
{icon: "github", link: "https://github.com/devlive-community/view-shadcn-ui"},
],
sidebar: {
"/guide/": [
{
text: "Guide",
collapsed: false,
base: "/guide/",
items: [
{text: "Installation", link: "installation"},
{text: "Quick Start", link: "quickstart"},
]
}
],
'/components/2024.1.1/': [
{
text: 'Release Notes',
base: '/components/2024.1.1/',
link: 'release-notes',
},
{
text: 'Base Components',
base: '/components/2024.1.1/',
collapsed: false,
items: [
{text: 'Button', link: 'button'},
{text: 'Icon', link: 'icon'},
{text: 'Copy', link: 'copy'},
]
},
{
text: 'Layout Components',
base: '/components/2024.1.1/',
collapsed: false,
items: [
{text: 'Card', link: 'card'}
]
},
{
text: 'View Components',
base: '/components/2024.1.1/',
collapsed: false,
items: [
{text: 'Modal', link: 'modal'},
{text: 'Tooltip', link: 'tooltip'},
{text: 'Code', link: 'code'},
]
},
{
text: 'Form Components',
base: '/components/2024.1.1/',
collapsed: false,
items: [
{text: 'Input', link: 'input'},
]
}
]
}
}
}
50 changes: 50 additions & 0 deletions docs/.vitepress/theme/components/ApiTable.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<ShadcnCard>
<template #content>
<div class="p-2 border-b space-y-10">
<div class="font-bold">{{ title }}</div>
</div>

<table class="w-full">
<thead>
<tr>
<th v-for="(header, index) in headers" :key="index" class="p-2 text-left">
{{ header }}
</th>
</tr>
</thead>
<tbody>
<tr v-for="(column, rowIndex) in columns" :key="rowIndex">
<td v-for="(value, colIndex) in column" :key="colIndex" class="p-2">
{{ value }}
</td>
</tr>
</tbody>
</table>
</template>
</ShadcnCard>
</template>

<script setup lang="ts">
const props = defineProps({
title: {
type: String,
required: true
},
headers: {
type: Array as () => string[],
required: true
},
columns: {
type: Array as () => string[][],
required: true
}
})
</script>

<style scoped>
.vp-doc table {
margin: 0;
display: table;
}
</style>
35 changes: 35 additions & 0 deletions docs/.vitepress/theme/components/CodeRunner.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<template>
<ShadcnCard>
<template #content>
<div class="p-2 border-b space-y-10">
<div class="font-bold">{{ title }}</div>
<div class="text-sm text-muted-foreground">{{ description }}</div>
</div>
<div class="p-3 space-x-2">
<slot/>
</div>
</template>

<template #footer>
<div v-if="onlineLink" class="flex items-center justify-center p-2 border-t w-full">
<ShadcnButton type="primary" @click="handleGoToOnline">{{ goToOnline }}</ShadcnButton>
</div>
</template>
</ShadcnCard>
</template>

<script setup lang="ts">
const props = withDefaults(defineProps<{
title: String
description?: String
onlineLink?: String
goToOnline?: String
}>(), {
goToOnline: 'Go to online'
})
const handleGoToOnline = () => {
window.open(props.onlineLink)
}
</script>
18 changes: 18 additions & 0 deletions docs/.vitepress/theme/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import DefaultTheme from 'vitepress/theme'

import CodeRunner from './components/CodeRunner.vue'
import ApiTable from "./components/ApiTable.vue";

export default {
...DefaultTheme,
enhanceApp: async ({app, router, siteData}) => {
// Fixed window is not defined
if (!import.meta.env.SSR) {
const module = await import('view-shadcn-ui')
app.use(module.default)
}

app.component('CodeRunner', CodeRunner)
app.component('ApiTable', ApiTable)
}
}
Loading

0 comments on commit 93f5adf

Please sign in to comment.