Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
arvinxx authored Oct 20, 2023
0 parents commit d4b8d32
Show file tree
Hide file tree
Showing 36 changed files with 1,313 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .changelogrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// 详情配置查看 https://github.com/arvinxx/gitmoji-commit-workflow/tree/master/packages/changelog#readme
module.exports = {
displayTypes: ['feat', 'fix', 'styles', 'pref', 'build'],
titleLanguage: 'zh-CN',
showAuthor: true,
showAuthorAvatar: true,
showSummary: true,
reduceHeadingLevel: true,
newlineTimestamp: true,
addBackToTop: true,
};
3 changes: 3 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
extends: ['gitmoji'],
};
10 changes: 10 additions & 0 deletions .dumirc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { defineConfig } from 'dumi';
import { homepage } from './package.json';

export default defineConfig({
themeConfig: {
name: '@arvinxu/npm-template',
github: homepage,
},
html2sketch: {},
});
16 changes: 16 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# 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

[Makefile]
indent_style = tab
12 changes: 12 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
/lambda/mock/**
/scripts
/config
/example
_test_
__test__

/node_modules
jest*
/es
/lib
/docs
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
module.exports = require('@umijs/lint/dist/config/eslint');
6 changes: 6 additions & 0 deletions .fatherrc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from 'father';

export default defineConfig({
cjs: { output: 'lib' },
esm: { output: 'es' },
});
46 changes: 46 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
name: '报告Bug 🐛'
about: 报告 @arvinxu/npm-template 的 bug
title: '🐛[BUG]'
labels: '🐛 BUG'
assignees: ''
---

### 🐛 bug 描述

<!--
详细地描述 bug,让大家都能理解
-->

### 📷 复现步骤

<!--
清晰描述复现步骤,让别人也能看到问题
-->

### 🏞 期望结果

<!--
描述你原本期望看到的结果
-->

### 💻 复现代码

<!--
提供可复现的代码,仓库,或线上示例
(可在下方 codesandbox 链接中添加你的最小可复现 demo)
-->

[可复现 demo](https://codesandbox.io/s/html2ksetch-demo-m53be?file=/src/Demo.tsx)

### © 版本信息

- @arvinxu/npm-template 版本: [e.g. 1.0.0]
- 浏览器环境
- 开发环境 [e.g. mac OS]

### 🚑 其他信息

<!--
如截图等其他信息可以贴在这里
-->
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: '功能需求 ✨'
about: 对 @arvinxu/npm-template 的需求或建议
title: '👑 [需求]'
labels: '👑 Feature'
assignees: ''
---

### 🥰 需求描述

<!--
详细地描述问题,让大家都能理解
-->

### 🧐 解决方案

<!--
如果你有解决方案,在这里清晰地阐述
-->

### 🚑 其他信息

<!--
如截图等其他信息可以贴在这里
-->
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/question.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: '疑问或需要帮助 ❓'
about: 对 @arvinxu/npm-template 使用的疑问或需要帮助
title: '🧐[问题]'
labels: '🧐 Question'
assignees: ''
---

### 🧐 问题描述

<!--
详细地描述问题,让大家都能理解
-->

### 💻 示例代码

<!--
如果有必要,展示代码,线上示例,或仓库
-->

### 🚑 其他信息

<!--
如截图等其他信息可以贴在这里
-->
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#### 💻 变更类型 | Change Type

<!-- For change type, change [ ] to [x]. -->

- \[ ] ✨ feat
- \[ ] 🐛 fix
- \[ ] 💄 style
- \[ ] 🔨 chore
- \[ ] 📝 docs

#### 🔀 变更说明 | Description of Change

<!-- Thank you for your Pull Request. Please provide a description above. -->

#### 📝 补充信息 | Additional Information

<!-- Add any other context about the Pull Request here. -->
28 changes: 28 additions & 0 deletions .github/workflows/contributor-help.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Contributor Helper

on:
schedule:
- cron: '0 0 * * *'

jobs:
contributor:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master

- uses: actions-cool/contributor-helper@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
style: 'simple'
update-files: 'README.md'
update-places: '<!-- CONTRIBUTION GROUP -->/<!-- CONTRIBUTION END -->'

- name: Commit and push if changed
run: |-
git diff
git config --global user.email "[email protected]"
git config --global user.name "github-actions"
git pull
git add -A
git commit -m "🤖 docs: Auto update contributors" || exit 0
git push
57 changes: 57 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release CI
on:
push:
branches:
- master
- alpha
- beta
- rc

jobs:
test:
name: Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install deps
run: pnpm install

- name: Test
run: pnpm run test

release:
needs: test
name: Release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install deps
run: pnpm install

- name: release
run: pnpm run release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
30 changes: 30 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Test CI
on: [push, pull_request]
jobs:
test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install pnpm
uses: pnpm/action-setup@v2
with:
version: 8

- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install deps
run: pnpm install

- name: lint
run: pnpm run ci

- name: Test and coverage
run: pnpm run test:coverage

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v3
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
**/node_modules
# roadhog-api-doc ignore
/src/utils/request-temp.js
_roadhog-api-doc

# production
**/dist
/.vscode
/es
/lib

# misc
.DS_Store
storybook-static
npm-debug.log*
yarn-error.log

/coverage
.idea
package-lock.json
*bak
.vscode

# visual studio code
.history
*.log
functions/*
lambda/mock/index.js
.temp/**

# umi
.dumi/tmp*

# screenshot
screenshot
.firebase
example/.temp/*
.eslintcache
techUI*
3 changes: 3 additions & 0 deletions .gitpod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
tasks:
- init: pnpm install
command: pnpm run start
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no -- commitlint --edit ${1}
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install lint-staged
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lockfile=false
resolution-mode=highest
18 changes: 18 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
**/*.svg
.umi
.umi-production
/dist
.dockerignore
.DS_Store
.eslintignore
*.png
*.toml
docker
.editorconfig
Dockerfile*
.gitignore
.prettierignore
LICENSE
.eslintcache
*.lock
yarn-error.log
19 changes: 19 additions & 0 deletions .prettierrc.js
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: 100,
proseWrap: 'never',
singleQuote: true,
trailingComma: 'all',
overrides: [
{
files: '*.md',
options: {
proseWrap: 'preserve',
},
},
],
};
Loading

0 comments on commit d4b8d32

Please sign in to comment.