Skip to content

Commit c7ab32d

Browse files
docs: add files
0 parents  commit c7ab32d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+65508
-0
lines changed

.browserslistrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
>1%

.editorconfig

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
trim_trailing_whitespace = true
9+
insert_final_newline = true

.eslintignore

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dist/*
2+
build/*
3+
node_modules/*
4+
__tests__
5+
setupTests.ts
6+
.eslintrc.js
7+
.stylelintrc.js
8+
babel.config.js
9+
postcss.config.js
10+
commitlint.config.js
11+
tsconfig.json
12+
**/*.css
13+
**/*.scss
14+
**/*.less
15+
**/*.module.css
16+
**/*.module.scss
17+
**/*.module.less
18+
__unconfig_vite.config.ts
19+
vite.config.ts

.eslintrc.js

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
module.exports = {
2+
extends: [
3+
'airbnb-base',
4+
'airbnb-typescript/base', // https://www.npmjs.com/package/eslint-config-airbnb-typescript
5+
'plugin:vue/vue3-recommended',
6+
'@vue/typescript/recommended',
7+
'eslint:recommended', // https://eslint.org/docs/rules/
8+
'plugin:jsx-a11y/strict', // https://www.npmjs.com/package/eslint-plugin-jsx-a11y
9+
],
10+
env: {
11+
browser: true,
12+
es6: true,
13+
node: true,
14+
},
15+
plugins: [
16+
'@typescript-eslint',
17+
'jsx-a11y',
18+
],
19+
parserOptions: {
20+
project: './tsconfig.json',
21+
extraFileExtensions: ['.vue'],
22+
ecmaFeatures: {
23+
jsx: true,
24+
tsx: true,
25+
},
26+
ecmaVersion: 2020,
27+
useJSXTextNode: true,
28+
sourceType: 'module',
29+
},
30+
rules: {
31+
// eslint
32+
'import/export': 'off',
33+
'import/prefer-default-export': 'off',
34+
'no-unused-vars': 'off',
35+
'no-undef': 'off',
36+
'prefer-rest-params': 'off',
37+
'no-async-promise-executor': 'off',
38+
'prefer-promise-reject-errors': 'off',
39+
'import/extensions': 'off',
40+
'no-nested-ternary': 'off',
41+
'no-spaced-func': 'off',
42+
'import/no-unresolved': 'off',
43+
// jsx
44+
'jsx-a11y/click-events-have-key-events': 'off',
45+
'jsx-a11y/no-static-element-interactions': 'off',
46+
'jsx-a11y/anchor-is-valid': 'off',
47+
'jsx-a11y/no-noninteractive-tabindex': 'off',
48+
'jsx-a11y/no-noninteractive-element-interactions': 'off',
49+
// 代码风格
50+
'vue/multi-word-component-names': 'off',
51+
'arrow-parens': 'off',
52+
'no-else-return': 'off',
53+
'jsx-quotes': ['error', 'prefer-double'],
54+
'import/no-cycle': 'off',
55+
'import/no-extraneous-dependencies': 'off',
56+
'import/no-named-as-default-member': 'off',
57+
'operator-linebreak': 'off',
58+
'import/order': 'off',
59+
'linebreak-style': 'off',
60+
'no-console': 'off',
61+
'class-methods-use-this': 'off',
62+
'max-classes-per-file': 'off',
63+
'consistent-return': 'off',
64+
'default-case': 'off',
65+
'global-require': 'off',
66+
'import/no-dynamic-require': 'off',
67+
'generator-star-spacing': 'off',
68+
'max-len': ['error', { 'code': 130 }],
69+
// javascript
70+
'func-names': 'off',
71+
'no-bitwise': 'off',
72+
'no-plusplus': 'off',
73+
'prefer-template': 'off',
74+
'object-curly-newline': 'off',
75+
'no-param-reassign': 'off',
76+
'no-restricted-globals': 'off',
77+
'no-underscore-dangle': 'off',
78+
'no-restricted-syntax': 'off',
79+
'no-useless-escape': 'off',
80+
'no-confusing-arrow': 'off',
81+
'no-new': 'off',
82+
'no-void': 'off',
83+
'prefer-rest-params': 'off',
84+
'no-async-promise-executor': 'off',
85+
'no-case-declarations': 'off',
86+
// typescript
87+
'@typescript-eslint/no-var-requires': 'off',
88+
'@typescript-eslint/no-inferrable-types': 'off',
89+
'@typescript-eslint/naming-convention': 'off',
90+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
91+
'@typescript-eslint/no-unused-vars': 'off',
92+
'@typescript-eslint/no-useless-constructor': 'off',
93+
'@typescript-eslint/no-use-before-define': 'off',
94+
'@typescript-eslint/no-unsafe-assignment': 'off',
95+
'@typescript-eslint/await-thenable': 'off',
96+
'@typescript-eslint/no-namespace': 'off',
97+
'@typescript-eslint/prefer-regexp-exec': 'off',
98+
'@typescript-eslint/explicit-module-boundary-types': 'off',
99+
'@typescript-eslint/no-explicit-any': 'off',
100+
'@typescript-eslint/ban-ts-comment': 'off',
101+
'@typescript-eslint/ban-types': 'off',
102+
'@typescript-eslint/no-this-alias': 'off',
103+
'@typescript-eslint/no-unsafe-call:': 'off',
104+
'@typescript-eslint/no-unsafe-member-access': 'off',
105+
'@typescript-eslint/no-floating-promises': 'off',
106+
'@typescript-eslint/restrict-plus-operands': 'off',
107+
'@typescript-eslint/restrict-template-expressions': 'off',
108+
'@typescript-eslint/no-misused-promises': 'off',
109+
'@typescript-eslint/no-unsafe-return': 'off',
110+
'@typescript-eslint/unbound-method': 'off',
111+
'@typescript-eslint/no-unsafe-argument': 'off',
112+
// vue - https://eslint.vuejs.org/rules/
113+
'vue/require-default-prop': 'off',
114+
'vue/singleline-html-element-content-newline': 'off',
115+
'vue/multiline-html-element-content-newline': 'off',
116+
'vue/max-attributes-per-line': ['warn', {
117+
singleline: {
118+
max: 3,
119+
},
120+
multiline: {
121+
max: 1,
122+
}
123+
}]
124+
},
125+
}

.github/workflows/ci.yaml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: CI
2+
3+
on:
4+
# push:
5+
# branches:
6+
# - main
7+
8+
# https://frontside.com/blog/2020-05-26-github-actions-pull_request
9+
pull_request:
10+
types: [ opened, edited, synchronize, reopened ]
11+
branches:
12+
- main
13+
14+
jobs:
15+
lint:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v3
19+
- name: Setup Node 16.x
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: 16.x
23+
registry-url: https://registry.npmjs.org/
24+
25+
- name: Install
26+
run: npm ci
27+
28+
- name: Remove react types
29+
run: rm -rf node_modules/@types/react
30+
31+
- name: Lint
32+
run: npm run lint
33+
34+
stylelint:
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
- name: Setup Node 16.x
39+
uses: actions/setup-node@v3
40+
with:
41+
node-version: 16.x
42+
registry-url: https://registry.npmjs.org/
43+
44+
- name: Install
45+
run: npm ci
46+
47+
- name: Stylelint
48+
run: npm run stylelint
49+
50+
typecheck:
51+
runs-on: ubuntu-latest
52+
steps:
53+
- uses: actions/checkout@v3
54+
- name: Setup Node 16.x
55+
uses: actions/setup-node@v3
56+
with:
57+
node-version: 16.x
58+
registry-url: https://registry.npmjs.org/
59+
60+
- name: Install
61+
run: npm ci
62+
63+
- name: Remove react types
64+
run: rm -rf node_modules/@types/react
65+
66+
- name: Typecheck
67+
run: npm run typecheck
68+
69+
test:
70+
runs-on: ubuntu-latest
71+
steps:
72+
- uses: actions/checkout@v3
73+
- name: Setup Node 16.x
74+
uses: actions/setup-node@v3
75+
with:
76+
node-version: 16.x
77+
registry-url: https://registry.npmjs.org/
78+
79+
- name: Install
80+
run: npm ci
81+
82+
- name: Remove react types
83+
run: rm -rf node_modules/@types/react
84+
85+
- name: Unit Test
86+
run: npm run test

.github/workflows/deploy.yaml

+57
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'Deploy(main)'
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
pull_request:
9+
types: [ opened, edited, synchronize, reopened ]
10+
branches:
11+
- main
12+
13+
jobs:
14+
check:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v3
18+
- uses: actions/setup-node@v3
19+
with:
20+
node-version: 16
21+
22+
- run: npm ci
23+
24+
- name: Remove react types
25+
run: rm -rf node_modules/@types/react
26+
27+
- run: npm test
28+
- run: npm run lint
29+
- run: npm run stylelint
30+
- run: npm run typecheck
31+
32+
deploy:
33+
needs: check
34+
name: 'Deploy to vercel'
35+
runs-on: ubuntu-latest
36+
steps:
37+
- uses: actions/checkout@v3
38+
39+
https://github.com/marketplace/actions/netlify-deploy
40+
- name: deploy to netlify
41+
uses: jsmrcaga/action-netlify-deploy@v1.8.0
42+
with:
43+
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_TOKEN }}
44+
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
45+
NETLIFY_DEPLOY_TO_PROD: true
46+
use_nvm: false
47+
build_command: 'npm run build:storybook'
48+
build_directory: 'playground/storybook-static'
49+
50+
# https://github.com/marketplace/actions/deploy-to-vercel-action
51+
- name: deploy to vercel
52+
uses: BetaHuhn/deploy-to-vercel-action@v1.7.1
53+
with:
54+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
56+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
57+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

.github/workflows/release.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: Release (main)
2+
3+
on:
4+
push:
5+
# Sequence of patterns matched against refs/tags
6+
tags:
7+
- "v*" # push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
check:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 16
17+
18+
- run: npm ci
19+
20+
- name: Remove react types
21+
run: rm -rf node_modules/@types/react
22+
23+
- run: npm test
24+
- run: npm run lint
25+
- run: npm run stylelint
26+
- run: npm run typecheck
27+
28+
publish-npm:
29+
needs: check
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v3
33+
- uses: actions/setup-node@v3
34+
with:
35+
node-version: 16
36+
37+
- name: Install
38+
run: npm ci
39+
40+
- name: Remove react types
41+
run: rm -rf node_modules/@types/react
42+
43+
- name: Set registry
44+
run: |
45+
npm config set //registry.npmjs.org/:_authToken=$NODE_AUTH_TOKEN
46+
npm publish
47+
env:
48+
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
49+
50+
create-release:
51+
needs: publish-npm
52+
runs-on: ubuntu-latest
53+
steps:
54+
- uses: actions/checkout@v3
55+
with:
56+
fetch-depth: 0
57+
58+
- uses: actions/setup-node@v3
59+
with:
60+
node-version: 16
61+
registry-url: https://registry.npmjs.org/
62+
63+
- run: npx changelogithub
64+
env:
65+
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}

.gitignore

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.DS_Store
2+
.vite-ssg-dist
3+
.vite-ssg-temp
4+
*.local
5+
dist
6+
dist-ssr
7+
build
8+
node_modules
9+
.idea/
10+
*.log
11+
/coverage
12+
# package-lock.json
13+
pnpm-lock.yaml
14+
yarn.lock
15+
16+
playground/dist
17+
playground/storybook-static
18+
19+
__unconfig_vite.config.ts
20+
.vercel

.husky/commit-msg

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/sh
2+
3+
# shellcheck source=./_/husky.sh
4+
. "$(dirname "$0")/_/husky.sh"
5+
6+
npx --no-install commitlint --edit "$1"

0 commit comments

Comments
 (0)