diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dceeb36 --- /dev/null +++ b/.gitignore @@ -0,0 +1,7 @@ +dist +.DS_Store +node_modules +*.log +.idea +.eslintcache +.vitepress diff --git a/package.json b/package.json new file mode 100644 index 0000000..bf5cc04 --- /dev/null +++ b/package.json @@ -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" +} diff --git a/packages/components/index.ts b/packages/components/index.ts new file mode 100644 index 0000000..99b4096 --- /dev/null +++ b/packages/components/index.ts @@ -0,0 +1 @@ +export * from './lib' diff --git a/packages/components/lib/Button/Button.vue b/packages/components/lib/Button/Button.vue new file mode 100644 index 0000000..32ef131 --- /dev/null +++ b/packages/components/lib/Button/Button.vue @@ -0,0 +1,11 @@ + + + + diff --git a/packages/components/lib/Button/index.ts b/packages/components/lib/Button/index.ts new file mode 100644 index 0000000..33aad7b --- /dev/null +++ b/packages/components/lib/Button/index.ts @@ -0,0 +1,4 @@ +import { withInstall } from '@gujiam-element/utils' +import Button from './Button.vue' + +export const GButton = withInstall(Button) diff --git a/packages/components/lib/index.ts b/packages/components/lib/index.ts new file mode 100644 index 0000000..8486fd6 --- /dev/null +++ b/packages/components/lib/index.ts @@ -0,0 +1 @@ +export * from './Button' diff --git a/packages/components/package.json b/packages/components/package.json new file mode 100644 index 0000000..a7f7f1d --- /dev/null +++ b/packages/components/package.json @@ -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" +} diff --git a/packages/core/components.ts b/packages/core/components.ts new file mode 100644 index 0000000..b3d4bce --- /dev/null +++ b/packages/core/components.ts @@ -0,0 +1,4 @@ +import { GButton } from '@gujiam-element/components' +import { Plugin } from 'vue' + +export default [GButton] as Plugin[] diff --git a/packages/core/index.ts b/packages/core/index.ts new file mode 100644 index 0000000..96f9662 --- /dev/null +++ b/packages/core/index.ts @@ -0,0 +1,6 @@ +import { makeInstaller } from '@gujiam-element/utils' +import components from './components' + +export * from '@gujiam-element/components' + +export default makeInstaller(components) diff --git a/packages/core/package.json b/packages/core/package.json new file mode 100644 index 0000000..6149a46 --- /dev/null +++ b/packages/core/package.json @@ -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" +} diff --git a/packages/docs/api-examples.md b/packages/docs/api-examples.md new file mode 100644 index 0000000..6bd8bb5 --- /dev/null +++ b/packages/docs/api-examples.md @@ -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 + + +## Results + +### Theme Data +
{{ theme }}+ +### Page Data +
{{ page }}+ +### Page Frontmatter +
{{ frontmatter }}+``` + + + +## Results + +### Theme Data +
{{ theme }}+ +### Page Data +
{{ page }}+ +### Page Frontmatter +
{{ frontmatter }}+ +## More + +Check out the documentation for the [full list of runtime APIs](https://vitepress.dev/reference/runtime-api#usedata). diff --git a/packages/docs/index.md b/packages/docs/index.md new file mode 100644 index 0000000..fb23157 --- /dev/null +++ b/packages/docs/index.md @@ -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 +--- + diff --git a/packages/docs/markdown-examples.md b/packages/docs/markdown-examples.md new file mode 100644 index 0000000..f9258a5 --- /dev/null +++ b/packages/docs/markdown-examples.md @@ -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). diff --git a/packages/docs/package.json b/packages/docs/package.json new file mode 100644 index 0000000..3dc7112 --- /dev/null +++ b/packages/docs/package.json @@ -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" + } +} diff --git a/packages/playground/.gitignore b/packages/playground/.gitignore new file mode 100644 index 0000000..a547bf3 --- /dev/null +++ b/packages/playground/.gitignore @@ -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? diff --git a/packages/playground/.vscode/extensions.json b/packages/playground/.vscode/extensions.json new file mode 100644 index 0000000..a7cea0b --- /dev/null +++ b/packages/playground/.vscode/extensions.json @@ -0,0 +1,3 @@ +{ + "recommendations": ["Vue.volar"] +} diff --git a/packages/playground/README.md b/packages/playground/README.md new file mode 100644 index 0000000..33895ab --- /dev/null +++ b/packages/playground/README.md @@ -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 ` +