Skip to content

Commit 5a6e250

Browse files
author
ifreeOvO
committed
release: 版本1.0.0
0 parents  commit 5a6e250

38 files changed

+8901
-0
lines changed

.editorconfig

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# 表示是最顶层的配置文件,发现值为true时,才会停止查找.editorconfig文件
2+
root = true
3+
[*]
4+
# 设置使用那种缩进风格(tab是制表符,space是空格)
5+
indent_style = space
6+
7+
# 设置换行符,值为lf、cr和crlf
8+
end_of_line = lf
9+
charset = utf-8
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{ts,cjs}]
15+
indent_size = 4

.eslintignore

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
node_modules
2+
dist
3+
.eslintrc.cjs
4+
devtools-frontend
5+
.turbo
6+
.rollup.cache
7+
**/scripts/**/*

.eslintrc.cjs

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
module.exports = {
2+
root: true,
3+
env: { browser: true, es2020: true, node: true },
4+
extends: [
5+
'eslint:recommended',
6+
'plugin:@typescript-eslint/recommended',
7+
'plugin:prettier/recommended',
8+
],
9+
parser: '@typescript-eslint/parser',
10+
plugins: ['eslint-plugin-import'],
11+
settings: {
12+
'import/resolver': {
13+
typescript: {
14+
project: ['apps/**/tsconfig.json', 'packages/**/tsconfig.json'],
15+
},
16+
node: {
17+
extensions: ['js', '.ts', '.d.ts', '.tsx', '.mjs', '.cjs'],
18+
},
19+
},
20+
},
21+
rules: {
22+
'import/order': [
23+
'error',
24+
{
25+
groups: [
26+
'type',
27+
'builtin',
28+
'external',
29+
'internal',
30+
'parent',
31+
'sibling',
32+
'index',
33+
'object',
34+
'unknown',
35+
],
36+
pathGroups: [
37+
{
38+
pattern: '@/**',
39+
group: 'external',
40+
position: 'after',
41+
},
42+
],
43+
},
44+
],
45+
'@typescript-eslint/no-explicit-any': 'off',
46+
'@typescript-eslint/ban-types': 'off',
47+
},
48+
}

.gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.husky/* linguist-vendored

.github/workflows/deploy.yml

+86
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
branches:
6+
- main # 触发条件,可以根据需要修改
7+
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
12+
13+
concurrency:
14+
group: "pages"
15+
cancel-in-progress: false
16+
17+
jobs:
18+
deploy-production:
19+
environment:
20+
name: github-pages
21+
url: ${{ steps.deployment.outputs.page_url }}
22+
runs-on: ubuntu-latest
23+
24+
steps:
25+
# 环境准备
26+
- name: Checkout
27+
uses: actions/checkout@v4
28+
- name: Check for 'release' in commit messages
29+
id: check_release
30+
run: |
31+
if git log -1 --pretty=%B | grep -q "release"; then
32+
echo "继续执行后续流程"
33+
else
34+
echo "提交记录里没有包含 'release',本次不执行发布流程"
35+
exit 0
36+
fi
37+
38+
39+
- name: Setup pnpm
40+
uses: pnpm/action-setup@v4
41+
42+
- name: Setup node
43+
uses: actions/setup-node@v4
44+
with:
45+
node-version: 18
46+
registry-url: 'https://registry.npmjs.org'
47+
- name: Get pnpm store directory
48+
id: pnpm-cache
49+
run: |
50+
echo "pnpm_cache_dir=$(pnpm store path)" >> $GITHUB_OUTPUT
51+
- uses: actions/cache@v4
52+
name: Setup pnpm cache
53+
with:
54+
path: ${{ steps.pnpm-cache.outputs.pnpm_cache_dir }}
55+
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
56+
restore-keys: |
57+
${{ runner.os }}-pnpm-store-
58+
59+
# 发布npm
60+
- name: Install dependencies
61+
run: pnpm install --frozen-lockfile
62+
- name: Lint
63+
run: pnpm lint
64+
- name: Test
65+
run: pnpm test
66+
- name: Build
67+
run: pnpm build
68+
- name: Publish
69+
run: |
70+
npm config set https://registry.npmjs.org/:_authToken=${{secrets.NPM_TOKEN}}
71+
npm publish
72+
73+
# 部署github-page
74+
- name: Copy dist
75+
run: cp -r dist examples/
76+
- name: Setup Pages
77+
uses: actions/configure-pages@v5
78+
- name: Upload artifact
79+
uses: actions/upload-pages-artifact@v3
80+
with:
81+
path: './examples'
82+
- name: Deploy to GitHub Pages
83+
id: deployment
84+
uses: actions/deploy-pages@v4
85+
86+
+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: Issue Inactive
2+
3+
on:
4+
schedule:
5+
# GMT+8 00:00
6+
- cron: '0 16 * * *'
7+
8+
jobs:
9+
close-issues:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: need reproduction
13+
uses: actions-cool/issues-helper@v3
14+
with:
15+
actions: 'close-issues'
16+
labels: 'need reproduction'
17+
inactive-day: 3
18+
19+
- name: needs more info
20+
uses: actions-cool/issues-helper@v3
21+
with:
22+
actions: 'close-issues'
23+
labels: 'needs more info'
24+
inactive-day: 3
25+
body: |
26+
Since the issue was labeled with `needs-more-info`, but no response in 3 days. This issue will be closed. If you have any questions, you can comment and reply.
27+
由于该 issue 被标记为需要更多信息,却 3 天未收到回应。现关闭 issue,若有任何问题,可评论回复。
28+
29+
lock-issues:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: lock-issues
33+
uses: actions-cool/issues-helper@v3
34+
with:
35+
actions: 'lock-issues'
36+
token: ${{ secrets.GITHUB_TOKEN }}
37+
issue-state: closed
38+
inactive-day: 7
39+
body: |
40+
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
41+
42+
此 issue 已被自动锁定,因为关闭后没有任何近期活动。如果有相关 bug,请重新创建一个新 issue。
43+
44+
check-inactive:
45+
runs-on: ubuntu-latest
46+
steps:
47+
- name: check-inactive
48+
uses: actions-cool/issues-helper@v3
49+
with:
50+
actions: 'check-inactive'
51+
inactive-day: 7

.gitignore

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# compiled output
2+
dist
3+
node_modules
4+
5+
# Logs
6+
logs
7+
*.log
8+
npm-debug.log*
9+
pnpm-debug.log*
10+
yarn-debug.log*
11+
yarn-error.log*
12+
lerna-debug.log*
13+
14+
# OS
15+
.DS_Store
16+
17+
# Tests
18+
test
19+
20+
# IDEs and editors
21+
/.idea
22+
.project
23+
.classpath
24+
.c9/
25+
*.launch
26+
.settings/
27+
*.sublime-workspace
28+
29+
# IDE - VSCode
30+
.vscode
31+
32+
# dotenv environment variable files
33+
.env.local
34+
35+
# temp directory
36+
.temp
37+
.tmp
38+
.turbo
39+
.rollup.cache
40+
.eslintcache
41+

.husky/commit-msg

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install commitlint --edit $1

.husky/pre-commit

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
npx --no-install lint-staged && npm run test

.npmrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
shamefully-hoist=true
2+
strict-peer-dependencies=false
3+
shell-emulator=true

.nvmrc

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
v18

.prettierignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
devtools-frontend

.prettierrc

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"printWidth": 100,
3+
"semi": false,
4+
"singleQuote": true,
5+
"tabWidth": 4
6+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2024-present IFreeOvO
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

0 commit comments

Comments
 (0)