generated from it-at-m/oss-repository-en-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): switch to vitepress for demo and developement setup
- Loading branch information
1 parent
617c359
commit 3574102
Showing
18 changed files
with
277 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<script setup> | ||
import sprites from "../../../public/assets/temporary/muc-icons.svg?raw" | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<svg | ||
style="display: none;" | ||
v-html="sprites"> | ||
</svg> | ||
|
||
<div class="demo-container"> | ||
<slot></slot> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
const path = require('path') | ||
|
||
module.exports = { | ||
title: 'My Lib', | ||
description: 'Just playing around.', | ||
themeConfig: { | ||
repo: 'https://github.com/wuruoyun/vue-component-lib-starter', | ||
sidebar: [ | ||
{ | ||
text: 'Introduction', | ||
children: [ | ||
{ text: 'What is My Lib?', link: '/' }, | ||
{ text: 'Getting Started', link: '/guide/' }, | ||
], | ||
}, { | ||
text: 'Components', | ||
children: [ | ||
{ text: 'MucBanner', link: '/components/muc-banner' }, | ||
{ text: 'MucButton', link: '/components/muc-button' }, | ||
{ text: 'MucIntro', link: '/components/muc-intro' }, | ||
], | ||
} | ||
], | ||
}, | ||
vite: { | ||
resolve: { | ||
alias: { | ||
'muc-patternlab-vue': path.resolve(__dirname, '../../src'), | ||
}, | ||
dedupe: ['vue'], // avoid error when using dependencies that also use Vue | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.demo-container { | ||
border: 1px solid lightgrey; | ||
border-radius: 5px; | ||
padding: 10px 20px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import DefaultTheme from 'vitepress/theme' | ||
import DemoContainer from '../components/DemoContainer.vue' | ||
import MucPatternlabVue from 'muc-patternlab-vue' | ||
|
||
import './custom.css' | ||
|
||
export default { | ||
...DefaultTheme, | ||
enhanceApp({ app }) { | ||
app.use(MucPatternlabVue) | ||
app.component('DemoContainer', DemoContainer) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<template> | ||
<div> | ||
<muc-banner type="warning"> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr. | ||
</muc-banner> | ||
|
||
<muc-banner type="emergency"> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr. | ||
</muc-banner> | ||
|
||
<muc-banner type="info"> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr. | ||
</muc-banner> | ||
</div> | ||
</template> | ||
<style scoped> | ||
div * { | ||
margin-bottom: 16px; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<template> | ||
<muc-button>Click me</muc-button> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<template> | ||
<muc-intro title="Intro-Titel"> | ||
Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. | ||
Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. | ||
</muc-intro> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Components | ||
|
||
You may add a summary of the components here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import Basic from './demo/MucBanner/Basic.vue' | ||
</script> | ||
|
||
# muc-banner | ||
|
||
//todo describe banner | ||
|
||
## Example Usage | ||
|
||
<DemoContainer> | ||
<Basic/> | ||
</DemoContainer> | ||
|
||
<<< @/components/demo/MucBanner/Basic.vue | ||
|
||
## Reference | ||
|
||
### Properties | ||
|
||
| Name | Type | Default | Description | | ||
| ---- | ------ | ------- | -------------- | | ||
| msg | string | null | Messge to show | | ||
|
||
### Events | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | | ||
|
||
### Slots | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import Basic from './demo/MucButton/Basic.vue' | ||
</script> | ||
|
||
# muc-button | ||
|
||
//todo describe button | ||
|
||
## Example Usage | ||
|
||
<DemoContainer> | ||
<Basic/> | ||
</DemoContainer> | ||
|
||
<<< @/components/demo/MucButton/Basic.vue | ||
|
||
## Reference | ||
|
||
### Properties | ||
|
||
| Name | Type | Default | Description | | ||
| ---- | ------ | ------- | -------------- | | ||
| msg | string | null | Messge to show | | ||
|
||
### Events | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | | ||
|
||
### Slots | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<script setup> | ||
import Basic from './demo/MucIntro/Basic.vue' | ||
</script> | ||
|
||
# muc-intro | ||
|
||
//todo describe intro | ||
|
||
## Example Usage | ||
|
||
<DemoContainer> | ||
<Basic/> | ||
</DemoContainer> | ||
|
||
<<< @/components/demo/MucIntro/Basic.vue | ||
|
||
## Reference | ||
|
||
### Properties | ||
|
||
| Name | Type | Default | Description | | ||
| ---- | ------ | ------- | -------------- | | ||
| msg | string | null | Messge to show | | ||
|
||
### Events | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | | ||
|
||
### Slots | ||
|
||
| Name | Parameters | Description | | ||
| ---- | ---------- | ----------- | | ||
| | | | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Getting Started | ||
|
||
You may add the usage of the library here. | ||
|
||
## Setup | ||
|
||
This setup assumes your client app is created with Vite and vue-ts template, and you use 'npm link' to link to `my-lib` locally. | ||
|
||
In your `package.json`, you shall have the dependencies compatible with the following: | ||
|
||
```json | ||
"dependencies": { | ||
"vue": "^3.2.25" | ||
} | ||
``` | ||
|
||
In your `vite.config.ts`, you shall configure to dedupe `vue`: | ||
|
||
```ts | ||
export default defineConfig({ | ||
resolve: { | ||
dedupe: ['vue'], | ||
}, | ||
}); | ||
``` | ||
|
||
In your `main.ts`, you shall import the libraries and CSS: | ||
|
||
```ts | ||
import 'my-lib/dist/style.css'; | ||
``` | ||
|
||
In your Webcomponents Entry you should import the css and svg sprite for MDE5-Icons: | ||
|
||
```html | ||
<script lang="ts" setup> | ||
import sprites from "@muenchen/muc-patternlab-vue/dist/assets/temporary/muc-icons.svg?raw"; | ||
</script> | ||
|
||
<template> | ||
<div> | ||
<svg | ||
style="display: none;" | ||
v-html="sprites"> | ||
</svg> | ||
<...> | ||
</div> | ||
</template> | ||
|
||
<style> | ||
@import "@/assets/muenchende-style.css"; | ||
</style> | ||
``` | ||
|
||
Import components from this library in your own component: | ||
|
||
```html | ||
<script setup lang="ts"> | ||
import { MucBanner } from "@muenchen/muc-patternlab-vue"; | ||
</script> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# What is muc-patternlab-vue? | ||
|
||
//todo describe lib |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.