Skip to content

Commit

Permalink
Merge pull request #1 from kwooshung/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
kwooshung committed Jan 22, 2024
2 parents 795d4f2 + 5b4dc99 commit 1cb0519
Show file tree
Hide file tree
Showing 52 changed files with 8,748 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .codeclimate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "2"
exclude_patterns:
- "scripts/"
- "**/*test.js"
- "**/*test.ts"
- "**/*spec.js"
- "**/*spec.ts"
1 change: 1 addition & 0 deletions .commitlintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./configs/commitlintrc.cjs');
1 change: 1 addition & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./configs/eslintrc.cjs');
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
65 changes: 65 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: ci

# 当推送到 main分支 时 触发此工作流
on:
push:
branches:
- main
permissions:
contents: write

jobs:
build-and-deploy:
runs-on: ubuntu-latest

steps:
- name: checkout
uses: actions/checkout@main

# 全局安装 pnpm
- name: install pnpm
run: npm install -g pnpm

# 使用 pnpm 安装依赖
- name: install dependencies
run: pnpm install

# 使用 pnpm 执行测试
- name: run tests
run: pnpm test:ci

# 上传覆盖率报告到 Coveralls
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@main
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# 使用 pnpm 构建
- name: build
run: pnpm build

# 自动发布
- name: Auto Release
run: npx cvlar -r
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

# 同步到 Gitee
- name: Sync to Gitee
uses: wearerequired/git-mirror-action@master
env:
SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
with:
source-repo: 'git@github.com:kwooshung/files.git'
destination-repo: 'git@gitee.com:kwooshung/files.git'

# 自动发布到 npm
- name: Sync to Npm.js
uses: actions/setup-node@main
with:
node-version: '14.0.0'
registry-url: https://registry.npmjs.org/
- name: Publish to Npm.js
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*
.eslintcache
.stylelintcache
node_modules
dist
dist-ssr
coverage
*.local
# Editor directories and files
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
*.bak
.cvlar-commit-message-*.tmp
1 change: 1 addition & 0 deletions .ks-cvlarrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('./configs/.ks-cvlarrc.cjs');
4 changes: 4 additions & 0 deletions .lintstagedrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,jsx,ts,tsx}": ["npx prettier --write", "npx eslint --fix"],
"*.json": ["npx prettier --write"]
}
41 changes: 41 additions & 0 deletions .prettierrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
eslintInter: true,
// 一行最多 200 字符
printWidth: 200,
// 使用 2 个空格缩进
tabWidth: 2,
// 不使用缩进符,而使用空格
useTabs: false,
// 行尾分号
semi: true,
// 使用单引号
singleQuote: true,
// 对象的 key 仅在必要时用引号
quoteProps: 'as-needed',
// jsx 使用单引号
jsxSingleQuote: true,
// 尾随逗号
trailingComma: 'all',
// 大括号内的首尾需要空格
bracketSpacing: true,
// jsx 标签的反尖括号需要换行
jsxBracketSameLine: true,
// 箭头函数,只有一个参数的时候,也需要括号
arrowParens: 'always',
// 每个文件格式化的范围是文件的全部内容
rangeStart: 0,
// 需要格式化和检查的代码结束偏移值(从尾部开始)
rangeEnd: Infinity,
// 不需要写文件开头的 @prettier
requirePragma: false,
// 不需要自动在文件开头插入 @prettier
insertPragma: false,
// 使用默认的折行标准
proseWrap: 'preserve',
// 根据显示样式决定 html 要不要折行
htmlWhitespaceSensitivity: 'css',
// 去除对象最后一个逗号
trailingComma: 'none',
// 换行符使用 lf
endOfLine: 'lf'
};
10 changes: 10 additions & 0 deletions .swcrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"jsc": {
"target": "es5",
"parser": {
"syntax": "typescript",
"dynamicImport": false,
"decorators": false
}
}
}
Loading

0 comments on commit 1cb0519

Please sign in to comment.