-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
395 additions
and
0 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,13 @@ | ||
import { defineConfig } from 'dumi'; | ||
|
||
export default defineConfig({ | ||
apiParser: {}, | ||
resolve: { | ||
entryFile: 'src/index.ts', | ||
}, | ||
outputPath: 'docs-dist', | ||
themeConfig: { | ||
name: '{{{ name }}}', | ||
}, | ||
presets: [require.resolve('@dumijs/preset-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,13 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
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,14 @@ | ||
module.exports = { | ||
extends: require.resolve('@umijs/lint/dist/config/eslint'), | ||
parser: 'vue-eslint-parser', | ||
parserOptions: { | ||
parser: '@typescript-eslint/parser', | ||
sourceType: 'module', | ||
ecmaVersion: 2020, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
}, | ||
extends: ['plugin:vue/vue3-recommended'], | ||
rules: {}, | ||
}; |
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 @@ | ||
import { defineConfig } from 'father'; | ||
|
||
export default defineConfig({ | ||
// more father config: https://github.com/umijs/father/blob/master/docs/config.md | ||
esm: { output: 'dist' }, | ||
}); |
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 @@ | ||
node_modules | ||
/dist | ||
.dumi/tmp | ||
.dumi/tmp-test | ||
.dumi/tmp-production | ||
.DS_Store |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx commitlint --edit "${1}" |
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,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
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,2 @@ | ||
/dist | ||
*.yaml |
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,19 @@ | ||
module.exports = { | ||
pluginSearchDirs: false, | ||
plugins: [ | ||
require.resolve('prettier-plugin-organize-imports'), | ||
require.resolve('prettier-plugin-packagejson'), | ||
], | ||
printWidth: 80, | ||
proseWrap: 'never', | ||
singleQuote: true, | ||
trailingComma: 'all', | ||
overrides: [ | ||
{ | ||
files: '*.md', | ||
options: { | ||
proseWrap: 'preserve', | ||
}, | ||
}, | ||
], | ||
}; |
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 @@ | ||
{ | ||
"extends": "@umijs/lint/dist/config/stylelint" | ||
} |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) {{{ author }}} | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,43 @@ | ||
# {{{ name }}} | ||
|
||
[![NPM version](https://img.shields.io/npm/v/{{{ name }}}.svg?style=flat)](https://npmjs.org/package/{{{ name }}}) | ||
[![NPM downloads](http://img.shields.io/npm/dm/{{{ name }}}.svg?style=flat)](https://npmjs.org/package/{{{ name }}}) | ||
|
||
{{{ description }}} | ||
|
||
## Usage | ||
|
||
TODO | ||
|
||
## Options | ||
|
||
TODO | ||
|
||
## Development | ||
|
||
```bash | ||
# install dependencies | ||
$ {{ npmClient }} install | ||
|
||
# develop library by docs demo | ||
$ {{ npmClient }} start | ||
|
||
# build library source code | ||
$ {{ npmClient }} run build | ||
|
||
# build library source code in watch mode | ||
$ {{ npmClient }} run build:watch | ||
|
||
# build docs | ||
$ {{ npmClient }} run docs:build | ||
|
||
# Locally preview the production build. | ||
$ {{ npmClient }} run docs:preview | ||
|
||
# check your project for potential problems | ||
$ {{ npmClient }} run doctor | ||
``` | ||
|
||
## LICENSE | ||
|
||
MIT |
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 @@ | ||
This is a guide example. |
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,22 @@ | ||
--- | ||
hero: | ||
title: library | ||
description: {{{ description }}} | ||
actions: | ||
- text: Hello | ||
link: / | ||
- text: Vue | ||
link: / | ||
features: | ||
- title: Hello | ||
emoji: 💎 | ||
description: Put hello description here | ||
- title: Vue | ||
emoji: 🌈 | ||
description: Put world description here | ||
- title: '!' | ||
emoji: 🚀 | ||
description: Put ! description here | ||
--- | ||
|
||
{{{ name }}} |
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,80 @@ | ||
{ | ||
"name": "{{{ name }}}", | ||
"version": "0.0.1", | ||
"description": "{{{ description }}}", | ||
"module": "dist/index.js", | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"start": "npm run dev", | ||
"dev": "dumi dev", | ||
"build": "father build", | ||
"build:watch": "father dev", | ||
"docs:build": "dumi build", | ||
"docs:preview": "dumi preview", | ||
"prepare": "husky install && dumi setup", | ||
"doctor": "father doctor", | ||
"lint": "npm run lint:es && npm run lint:css", | ||
"lint:css": "stylelint \"{src,test}/**/*.{css,less}\"", | ||
"lint:es": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"", | ||
"prepublishOnly": "father doctor && npm run build" | ||
}, | ||
"authors": [{{#author}} | ||
"{{{ author }}}" | ||
{{/author}}], | ||
"repository": { | ||
"type": "git" | ||
}, | ||
"license": "MIT", | ||
"files": [ | ||
"dist" | ||
], | ||
"commitlint": { | ||
"extends": [ | ||
"@commitlint/config-conventional" | ||
] | ||
}, | ||
"lint-staged": { | ||
"*.{md,json}": [ | ||
"prettier --write --no-error-on-unmatched-pattern" | ||
], | ||
"*.{css,less}": [ | ||
"stylelint --fix", | ||
"prettier --write" | ||
], | ||
"*.{js,jsx}": [ | ||
"eslint --fix", | ||
"prettier --write" | ||
], | ||
"*.{ts,tsx}": [ | ||
"eslint --fix", | ||
"prettier --parser=typescript --write" | ||
] | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"peerDependencies": { | ||
"vue": ">=3.3.0" | ||
}, | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.1.2", | ||
"@commitlint/config-conventional": "^17.1.0", | ||
"@dumijs/preset-vue": "^2", | ||
"@types/react": "^18.0.0", | ||
"@types/react-dom": "^18.0.0", | ||
"@umijs/lint": "^4.0.0", | ||
"dumi": "{{{ version }}}", | ||
"eslint": "^8.23.0", | ||
"eslint-plugin-vue": "^9.17.0", | ||
"father": "^4.1.0", | ||
"husky": "^8.0.1", | ||
"lint-staged": "^13.0.3", | ||
"prettier": "^2.7.1", | ||
"prettier-plugin-organize-imports": "^3.0.0", | ||
"prettier-plugin-packagejson": "^2.2.18", | ||
"react": "^18.0.0", | ||
"react-dom": "^18.0.0", | ||
"stylelint": "^14.9.1", | ||
"vue": "^3.4.0" | ||
} | ||
} |
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,47 @@ | ||
<template> | ||
<span | ||
@click="handleClick" | ||
> | ||
<template v-if="icon"> | ||
{{icon}} | ||
</template> | ||
<slot v-else name="icon" /> <slot /> | ||
</span> | ||
</template> | ||
|
||
<style lang="css" scoped> | ||
span { | ||
border: 1px solid red; | ||
border-radius: 4px; | ||
padding: 4px; | ||
} | ||
</style> | ||
|
||
<script setup lang="ts"> | ||
import { VNodeChild } from 'vue'; | ||
defineProps<{ | ||
/** | ||
* 图标字符 | ||
*/ | ||
icon?: string; | ||
}>(); | ||
defineSlots<{ | ||
/** | ||
* 图标插槽 | ||
* @alpha | ||
*/ | ||
icon?: VNodeChild; | ||
default: VNodeChild, | ||
}>(); | ||
const emit = defineEmits<{ | ||
(e: 'click', event: MouseEvent): void | ||
}>(); | ||
function handleClick(e: MouseEvent) { | ||
emit('click', e); | ||
} | ||
</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,39 @@ | ||
# Bar | ||
|
||
This is an example component of Vue SFC. | ||
|
||
```vue | ||
<script setup> | ||
import { ref } from 'vue'; | ||
import { Bar } from '{{{ name }}}'; | ||
const color = ref('red'); | ||
</script> | ||
|
||
<template> | ||
<p class="greeting"> | ||
<Bar icon="🤙">Hello Vue!</Bar> | ||
</p> | ||
</template> | ||
|
||
<style> | ||
.greeting { | ||
color: v-bind('color'); | ||
font-size: 16px; | ||
font-weight: bold; | ||
} | ||
</style> | ||
``` | ||
## Bar API | ||
|
||
### Props | ||
|
||
<API id="Bar" type="props"></API> | ||
|
||
### Slots | ||
|
||
<API id="Bar" type="slots"></API> | ||
|
||
### Events | ||
|
||
<API id="Bar" type="events"></API> |
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 @@ | ||
export { default as Bar } from './RootBar.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,9 @@ | ||
# Foo | ||
|
||
This is an example component of Vue JSX. | ||
|
||
```jsx | ||
import { Foo } from '{{{ name }}}'; | ||
|
||
export default () => <Foo title="Hello vue!" /> | ||
``` |
Oops, something went wrong.