Skip to content

Commit

Permalink
chore:init
Browse files Browse the repository at this point in the history
  • Loading branch information
gongqiang committed Sep 6, 2024
0 parents commit edd1338
Show file tree
Hide file tree
Showing 35 changed files with 1,860 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dist
.DS_Store
node_modules
*.log
.idea
.eslintcache
.vitepress
27 changes: 27 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"name": "gujiam-element",
"version": "1.0.0",
"private": true,
"description": "",
"main": "index.js",
"scripts": {
"dev": "pnpm --filter @gujiam-element/playground run dev",
"dev:docs": "pnpm --filter @gujiam-element/docs run dev",
"build:docs": "pnpm --filter @gujiam-element/docs run build"
},
"dependencies": {
"vue": "^3.4.37"
},
"devDependencies": {
"@gujiam-element/components": "workspace:*",
"@gujiam-element/utils": "workspace:*",
"@gujiam-element/core": "workspace:*",
"@vitejs/plugin-vue": "^5.1.2",
"typescript": "^5.5.3",
"vite": "^5.4.1",
"vue-tsc": "^2.0.29"
},
"keywords": [],
"author": "",
"license": "ISC"
}
1 change: 1 addition & 0 deletions packages/components/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './lib'
11 changes: 11 additions & 0 deletions packages/components/lib/Button/Button.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<template>
<button class="g-btn">
<slot />
</button>
</template>
<script setup lang="ts">
defineOptions({
name: 'GButton'
})
</script>
4 changes: 4 additions & 0 deletions packages/components/lib/Button/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { withInstall } from '@gujiam-element/utils'
import Button from './Button.vue'

export const GButton = withInstall(Button)
1 change: 1 addition & 0 deletions packages/components/lib/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './Button'
12 changes: 12 additions & 0 deletions packages/components/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@gujiam-element/components",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
4 changes: 4 additions & 0 deletions packages/core/components.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { GButton } from '@gujiam-element/components'
import { Plugin } from 'vue'

export default [GButton] as Plugin[]
6 changes: 6 additions & 0 deletions packages/core/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { makeInstaller } from '@gujiam-element/utils'
import components from './components'

export * from '@gujiam-element/components'

export default makeInstaller(components)
12 changes: 12 additions & 0 deletions packages/core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"name": "@gujiam-element/core",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"keywords": [],
"author": "",
"license": "ISC"
}
49 changes: 49 additions & 0 deletions packages/docs/api-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
---
outline: deep
---

# Runtime API Examples

This page demonstrates usage of some of the runtime APIs provided by VitePress.

The main `useData()` API can be used to access site, theme, and page data for the current page. It works in both `.md` and `.vue` files:

```md
<script setup>
import { useData } from 'vitepress'

const { theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>
```

<script setup>
import { useData } from 'vitepress'

const { site, theme, page, frontmatter } = useData()
</script>

## Results

### Theme Data
<pre>{{ theme }}</pre>

### Page Data
<pre>{{ page }}</pre>

### Page Frontmatter
<pre>{{ frontmatter }}</pre>

## More

Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata).
25 changes: 25 additions & 0 deletions packages/docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
# https://vitepress.dev/reference/default-theme-home-page
layout: home

hero:
name: "Gujiam-Element"
text: "Vue UI Library"
tagline: My great project tagline
actions:
- theme: brand
text: Markdown Examples
link: /markdown-examples
- theme: alt
text: API Examples
link: /api-examples

features:
- title: Feature A
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature B
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
- title: Feature C
details: Lorem ipsum dolor sit amet, consectetur adipiscing elit
---

85 changes: 85 additions & 0 deletions packages/docs/markdown-examples.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Markdown Extension Examples

This page demonstrates some of the built-in markdown extensions provided by VitePress.

## Syntax Highlighting

VitePress provides Syntax Highlighting powered by [Shiki](https://github.com/shikijs/shiki), with additional features like line-highlighting:

**Input**

````md
```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```
````

**Output**

```js{4}
export default {
data () {
return {
msg: 'Highlighted!'
}
}
}
```

## Custom Containers

**Input**

```md
::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::
```

**Output**

::: info
This is an info box.
:::

::: tip
This is a tip.
:::

::: warning
This is a warning.
:::

::: danger
This is a dangerous warning.
:::

::: details
This is a details block.
:::

## More

Check out the documentation for the [full list of markdown extensions](https://vitepress.dev/guide/markdown).
18 changes: 18 additions & 0 deletions packages/docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"name": "@gujiam-element/docs",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"dev": "vitepress dev",
"build": "vitepress build",
"preview": "vitepress preview"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"vitepress": "^1.3.4"
}
}
24 changes: 24 additions & 0 deletions packages/playground/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
3 changes: 3 additions & 0 deletions packages/playground/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar"]
}
5 changes: 5 additions & 0 deletions packages/playground/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Vue 3 + TypeScript + Vite

This template should help get you started developing with Vue 3 and TypeScript in Vite. The template uses Vue 3 `<script setup>` SFCs, check out the [script setup docs](https://v3.vuejs.org/api/sfc-script-setup.html#sfc-script-setup) to learn more.

Learn more about the recommended Project Setup and IDE Support in the [Vue Docs TypeScript Guide](https://vuejs.org/guide/typescript/overview.html#project-setup).
13 changes: 13 additions & 0 deletions packages/playground/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Vue + TS</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
11 changes: 11 additions & 0 deletions packages/playground/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "@gujiam-element/playground",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "vue-tsc -b && vite build",
"preview": "vite preview"
}
}
1 change: 1 addition & 0 deletions packages/playground/public/vite.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions packages/playground/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<script setup lang="ts">
import { GButton } from '@gujiam-element/components';
</script>

<template>
<GButton>asdasd</GButton>
</template>

<style scoped>
.logo {
height: 6em;
padding: 1.5em;
will-change: filter;
transition: filter 300ms;
}
.logo:hover {
filter: drop-shadow(0 0 2em #646cffaa);
}
.logo.vue:hover {
filter: drop-shadow(0 0 2em #42b883aa);
}
</style>
1 change: 1 addition & 0 deletions packages/playground/src/assets/vue.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit edd1338

Please sign in to comment.