Skip to content

Commit 03aaf00

Browse files
committed
feat: init
0 parents  commit 03aaf00

File tree

24 files changed

+7627
-0
lines changed

24 files changed

+7627
-0
lines changed

.github/workflows/docs.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: Deploy Docs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- master
8+
paths:
9+
- 'packages/**/*.md'
10+
- 'packages/.vitepress/**'
11+
- 'packages/public/**'
12+
13+
jobs:
14+
docs:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- name: Checkout 🛎️
19+
uses: actions/[email protected]
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v2
23+
with:
24+
version: '8.x'
25+
26+
- name: Install and Build 🔧
27+
uses: actions/[email protected]
28+
with:
29+
node-version: '16.x'
30+
cache: pnpm
31+
- run: pnpm i
32+
- run: pnpm run docs:build
33+
34+
- name: Deploy to GitHub Pages 🚀
35+
uses: JamesIves/[email protected]
36+
with:
37+
branch: pages
38+
folder: packages/.vitepress/dist

.github/workflows/publish.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: Publish Package To Npmjs
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
tags:
7+
- 'v*'
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout 🛎️
14+
uses: actions/[email protected]
15+
16+
- name: Configure Git
17+
run: |
18+
git config user.email "[email protected]"
19+
git config user.name "coderhyh"
20+
21+
- name: Install pnpm
22+
uses: pnpm/action-setup@v2
23+
with:
24+
version: '8.x'
25+
26+
- uses: actions/[email protected]
27+
with:
28+
node-version: '16.x'
29+
registry-url: 'https://registry.npmjs.org/'
30+
cache: pnpm
31+
32+
- name: ⏳ Install dependencies
33+
run: pnpm i
34+
35+
- name: 👷 Build lib
36+
run: pnpm run build
37+
38+
- name: 📦 Publish
39+
run: npm publish
40+
env:
41+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
42+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.gitignore

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
bin
13+
es
14+
lib
15+
cli
16+
dist-ssr
17+
.vitepress/cache
18+
*.local
19+
20+
# Editor directories and files
21+
# .vscode/*
22+
# !.vscode/extensions.json
23+
.idea
24+
.DS_Store
25+
*.suo
26+
*.ntvs*
27+
*.njsproj
28+
*.sln
29+
*.sw?

.vitepress/config.ts

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
import { resolve } from 'node:path'
2+
import { componentPreview, containerPreview } from '@vitepress-demo-preview/plugin'
3+
import Unocss from 'unocss/vite'
4+
import { defineConfig } from 'vitepress'
5+
6+
import nav from './nav'
7+
import sidebar from './sidebar'
8+
9+
export default defineConfig({
10+
title: ' ',
11+
description: 'coding-playground是一个vitepress的起始模板',
12+
base: '/coding-playground',
13+
lastUpdated: true,
14+
head: [
15+
[
16+
'link',
17+
{
18+
rel: 'icon',
19+
href: './vue-icon.svg',
20+
},
21+
],
22+
[
23+
'meta',
24+
{
25+
name: 'viewport',
26+
content: 'width=device-width,height=device-height, maximum-scale=1.0,minimum-scale=1.0',
27+
},
28+
],
29+
],
30+
themeConfig: {
31+
logo: '/logo.svg',
32+
nav,
33+
sidebar,
34+
socialLinks: [{ icon: 'github', link: 'https://github.com/coderhyh/coding-playground' }],
35+
search: {
36+
provider: 'local',
37+
},
38+
},
39+
markdown: {
40+
lineNumbers: true,
41+
config(md) {
42+
md.use(containerPreview)
43+
md.use(componentPreview)
44+
},
45+
},
46+
vite: {
47+
resolve: { alias: { 'coding-playground': resolve(__dirname, '../packages') } },
48+
plugins: [
49+
// @ts-expect-error unocss返回类型错误
50+
Unocss(),
51+
],
52+
},
53+
})

.vitepress/nav.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import type { DefaultTheme } from 'vitepress'
2+
3+
export default <DefaultTheme.NavItem[]>[{ text: '首页', link: '/' }]

.vitepress/sidebar.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import type { DefaultTheme } from 'vitepress'
2+
3+
export default <DefaultTheme.Sidebar>[
4+
{
5+
text: '指引',
6+
items: [{ text: '入手指南', link: '/' }],
7+
},
8+
{
9+
text: '性能优化',
10+
items: [{ text: 'useDefer', link: '/packages/performance/useDefer' }],
11+
},
12+
{
13+
text: 'hooks',
14+
items: [{ text: 'useSum', link: '/packages/hooks/useSum' }],
15+
},
16+
]

.vitepress/theme/base.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
::-webkit-scrollbar {
2+
/* 滚动条整体样式 */
3+
width: 5px; /* 高宽分别对应横竖滚动条的尺寸 */
4+
height: 5px;
5+
}
6+
7+
::-webkit-scrollbar-track {
8+
/* 滚动条里面轨道 */
9+
border-radius: 5px;
10+
}
11+
12+
::-webkit-scrollbar-thumb {
13+
/* 滚动条里面小方块 */
14+
border-radius: 5px;
15+
background: #dfdfdf;
16+
}
17+
18+
::-webkit-scrollbar-thumb:hover {
19+
background: #cfcfcf;
20+
}
21+
22+
.vp-doc tr:nth-child(2n) {
23+
background-color: inherit;
24+
}

.vitepress/theme/index.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import { NaiveUIContainer } from '@vitepress-demo-preview/component'
2+
// https://vitepress.dev/guide/custom-theme
3+
import DefaultTheme from 'vitepress/theme'
4+
import '@vitepress-demo-preview/component/dist/style.css'
5+
import './base.css'
6+
import 'virtual:uno.css'
7+
8+
export default {
9+
...DefaultTheme,
10+
enhanceApp({ app, router, siteData }) {
11+
app.component('demo-preview', NaiveUIContainer)
12+
},
13+
}

.vscode/extensions.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": []
3+
}

.vscode/settings.json

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
{
2+
"stylelint.validate": ["css", "less", "vue", "html"],
3+
4+
// Disable the default formatter, use eslint instead
5+
"prettier.enable": false,
6+
"editor.formatOnSave": false,
7+
8+
// Auto fix
9+
"editor.codeActionsOnSave": {
10+
"source.fixAll.eslint": "explicit",
11+
"source.organizeImports": "never",
12+
"source.fixAll.stylelint": "explicit"
13+
},
14+
15+
// Silent the stylistic rules in you IDE, but still auto fix them
16+
"eslint.rules.customizations": [
17+
{ "rule": "style/*", "severity": "off", "fixable": true },
18+
{ "rule": "format/*", "severity": "off", "fixable": true },
19+
{ "rule": "*-indent", "severity": "off", "fixable": true },
20+
{ "rule": "*-spacing", "severity": "off", "fixable": true },
21+
{ "rule": "*-spaces", "severity": "off", "fixable": true },
22+
{ "rule": "*-order", "severity": "off", "fixable": true },
23+
{ "rule": "*-dangle", "severity": "off", "fixable": true },
24+
{ "rule": "*-newline", "severity": "off", "fixable": true },
25+
{ "rule": "*quotes", "severity": "off", "fixable": true },
26+
{ "rule": "*semi", "severity": "off", "fixable": true }
27+
],
28+
29+
// Enable eslint for all supported languages
30+
"eslint.validate": [
31+
"javascript",
32+
"javascriptreact",
33+
"typescript",
34+
"typescriptreact",
35+
"vue",
36+
"html",
37+
"markdown",
38+
"json",
39+
"jsonc",
40+
"yaml",
41+
"toml",
42+
"xml",
43+
"gql",
44+
"graphql",
45+
"astro",
46+
"svelte",
47+
"css",
48+
"less",
49+
"scss",
50+
"pcss",
51+
"postcss"
52+
]
53+
}

0 commit comments

Comments
 (0)