🎉 chore: init project
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
// 详情配置查看 https://github.com/arvinxx/gitmoji-commit-workflow/tree/master/packages/changelog#readme
|
||||
module.exports = {
|
||||
displayTypes: ['feat', 'fix', 'styles', 'pref', 'build'],
|
||||
titleLanguage: 'zh-CN',
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['gitmoji'],
|
||||
};
|
||||
@@ -0,0 +1,9 @@
|
||||
import { defineConfig } from 'dumi';
|
||||
import { homepage } from './package.json';
|
||||
|
||||
export default defineConfig({
|
||||
themeConfig: {
|
||||
name: 'lobe-ui',
|
||||
github: homepage,
|
||||
},
|
||||
});
|
||||
@@ -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
|
||||
@@ -0,0 +1,12 @@
|
||||
/lambda/mock/**
|
||||
/scripts
|
||||
/config
|
||||
/example
|
||||
_test_
|
||||
__test__
|
||||
|
||||
/node_modules
|
||||
jest*
|
||||
/es
|
||||
/lib
|
||||
/docs
|
||||
@@ -0,0 +1 @@
|
||||
module.exports = require('@umijs/lint/dist/config/eslint');
|
||||
@@ -0,0 +1,6 @@
|
||||
import { defineConfig } from 'father';
|
||||
|
||||
export default defineConfig({
|
||||
cjs: { output: 'lib' },
|
||||
esm: { output: 'es' },
|
||||
});
|
||||
@@ -0,0 +1,46 @@
|
||||
---
|
||||
name: '报告Bug 🐛'
|
||||
about: 报告 lobe-ui 的 bug
|
||||
title: '🐛[BUG]'
|
||||
labels: '🐛 BUG'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### 🐛 bug 描述
|
||||
|
||||
<!--
|
||||
详细地描述 bug,让大家都能理解
|
||||
-->
|
||||
|
||||
### 📷 复现步骤
|
||||
|
||||
<!--
|
||||
清晰描述复现步骤,让别人也能看到问题
|
||||
-->
|
||||
|
||||
### 🏞 期望结果
|
||||
|
||||
<!--
|
||||
描述你原本期望看到的结果
|
||||
-->
|
||||
|
||||
### 💻 复现代码
|
||||
|
||||
<!--
|
||||
提供可复现的代码,仓库,或线上示例
|
||||
(可在下方 codesandbox 链接中添加你的最小可复现 demo)
|
||||
-->
|
||||
|
||||
[可复现 demo](https://codesandbox.io/s/html2ksetch-demo-m53be?file=/src/Demo.tsx)
|
||||
|
||||
### © 版本信息
|
||||
|
||||
- lobe-ui 版本: [e.g. 1.0.0]
|
||||
- 浏览器环境
|
||||
- 开发环境 [e.g. mac OS]
|
||||
|
||||
### 🚑 其他信息
|
||||
|
||||
<!--
|
||||
如截图等其他信息可以贴在这里
|
||||
-->
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: '功能需求 ✨'
|
||||
about: 对 lobe-ui 的需求或建议
|
||||
title: '👑 [需求]'
|
||||
labels: '👑 Feature'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### 🥰 需求描述
|
||||
|
||||
<!--
|
||||
详细地描述问题,让大家都能理解
|
||||
-->
|
||||
|
||||
### 🧐 解决方案
|
||||
|
||||
<!--
|
||||
如果你有解决方案,在这里清晰地阐述
|
||||
-->
|
||||
|
||||
### 🚑 其他信息
|
||||
|
||||
<!--
|
||||
如截图等其他信息可以贴在这里
|
||||
-->
|
||||
@@ -0,0 +1,25 @@
|
||||
---
|
||||
name: '疑问或需要帮助 ❓'
|
||||
about: 对 lobe-ui 使用的疑问或需要帮助
|
||||
title: '🧐[问题]'
|
||||
labels: '🧐 Question'
|
||||
assignees: ''
|
||||
---
|
||||
|
||||
### 🧐 问题描述
|
||||
|
||||
<!--
|
||||
详细地描述问题,让大家都能理解
|
||||
-->
|
||||
|
||||
### 💻 示例代码
|
||||
|
||||
<!--
|
||||
如果有必要,展示代码,线上示例,或仓库
|
||||
-->
|
||||
|
||||
### 🚑 其他信息
|
||||
|
||||
<!--
|
||||
如截图等其他信息可以贴在这里
|
||||
-->
|
||||
@@ -0,0 +1,60 @@
|
||||
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: build
|
||||
run: pnpm run build
|
||||
|
||||
- name: release
|
||||
run: pnpm run release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
@@ -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
@@ -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*
|
||||
@@ -0,0 +1,3 @@
|
||||
tasks:
|
||||
- init: pnpm install
|
||||
command: pnpm run start
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no -- commitlint --edit ${1}
|
||||
Executable
+4
@@ -0,0 +1,4 @@
|
||||
#!/usr/bin/env sh
|
||||
. "$(dirname -- "$0")/_/husky.sh"
|
||||
|
||||
npx --no-install lint-staged
|
||||
Generated
+5
@@ -0,0 +1,5 @@
|
||||
# 默认忽略的文件
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# 基于编辑器的 HTTP 客户端请求
|
||||
/httpRequests/
|
||||
@@ -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
|
||||
@@ -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',
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
extends: ['semantic-release-config-gitmoji'],
|
||||
};
|
||||
@@ -0,0 +1,10 @@
|
||||
module.exports = {
|
||||
extends: ['stylelint-config-recommended', 'stylelint-config-clean-order'],
|
||||
files: ['*.js', '*.jsx', '*.ts', '*.tsx'],
|
||||
plugins: ['stylelint-order'],
|
||||
customSyntax: 'postcss-styled-syntax',
|
||||
rules: {
|
||||
'no-empty-source': null,
|
||||
'no-invalid-double-slash-comments': null,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2023 LobeHub
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,44 @@
|
||||
# lobe-ui
|
||||
|
||||
[![NPM version][npm-image]][npm-url] [![NPM downloads][download-image]][download-url] [![install size][npm-size]][npm-size-url]
|
||||
|
||||
[![Test CI status][test-ci]][test-ci-url] [![Deploy CI][release-ci]][release-ci-url] [![Coverage][coverage]][codecov-url]
|
||||
|
||||
[![ docs by dumi][dumi-url]](https://d.umijs.org/) [![Build With father][father-url]](https://github.com/umijs/father/)
|
||||
|
||||
<!-- gitpod url -->
|
||||
|
||||
[gitpod-badge]: https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod
|
||||
[gitpod-url]: https://gitpod.io/#https://github.com/ant-design/lobe-ui
|
||||
|
||||
<!-- umi url -->
|
||||
|
||||
[dumi-url]: https://img.shields.io/badge/docs%20by-dumi-blue
|
||||
[father-url]: https://img.shields.io/badge/build%20with-father-028fe4.svg
|
||||
|
||||
<!-- npm url -->
|
||||
|
||||
[npm-image]: http://img.shields.io/npm/v/lobe-ui.svg?style=flat-square&color=deepgreen&label=latest
|
||||
[npm-url]: http://npmjs.org/package/lobe-ui
|
||||
[npm-size]: https://img.shields.io/bundlephobia/minzip/lobe-ui?color=deepgreen&label=gizpped%20size&style=flat-square
|
||||
[npm-size-url]: https://packagephobia.com/result?p=lobe-ui
|
||||
|
||||
<!-- coverage -->
|
||||
|
||||
[coverage]: https://codecov.io/gh/lobehub/lobe-ui/branch/master/graph/badge.svg
|
||||
[codecov-url]: https://codecov.io/gh/lobehub/lobe-ui/branch/master
|
||||
|
||||
<!-- Github CI -->
|
||||
|
||||
[test-ci]: https://github.com/lobehub/lobe-ui/workflows/Test%20CI/badge.svg
|
||||
[release-ci]: https://github.com/lobehub/lobe-ui/workflows/Release%20CI/badge.svg
|
||||
[test-ci-url]: https://github.com/lobehub/lobe-ui/actions?query=workflow%3ATest%20CI
|
||||
[release-ci-url]: https://github.com/lobehub/lobe-ui/actions?query=workflow%3ARelease%20CI
|
||||
[download-image]: https://img.shields.io/npm/dm/lobe-ui.svg?style=flat-square
|
||||
[download-url]: https://npmjs.org/package/lobe-ui
|
||||
|
||||
## 简介
|
||||
|
||||
## License
|
||||
|
||||
[MIT](./LICENSE)
|
||||
@@ -0,0 +1,8 @@
|
||||
---
|
||||
title: 更新日志
|
||||
nav:
|
||||
title: 更新日志
|
||||
order: 999
|
||||
---
|
||||
|
||||
<embed src="../CHANGELOG.md"></embed>
|
||||
@@ -0,0 +1,12 @@
|
||||
---
|
||||
hero:
|
||||
title: lobe-ui
|
||||
description: a npm develop template
|
||||
actions:
|
||||
- text: 快速上手
|
||||
link: /guide
|
||||
- text: 完全指南
|
||||
link: /usage
|
||||
---
|
||||
|
||||
<embed src="../README.md"></embed>
|
||||
@@ -0,0 +1,96 @@
|
||||
{
|
||||
"name": "lobe-ui",
|
||||
"version": "0.0.0",
|
||||
"description": "ui kit for lobehub",
|
||||
"keywords": [
|
||||
"npm",
|
||||
"template"
|
||||
],
|
||||
"homepage": "https://github.com/lobehub/lobe-ui",
|
||||
"bugs": {
|
||||
"url": "https://github.com/lobehub/lobe-ui/issues/new"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/lobehub/lobe-ui.git"
|
||||
},
|
||||
"license": "MIT",
|
||||
"author": "LobeHubƒ",
|
||||
"sideEffects": false,
|
||||
"main": "lib/index.js",
|
||||
"module": "es/index.js",
|
||||
"types": "lib/index.d.ts",
|
||||
"files": [
|
||||
"lib",
|
||||
"es"
|
||||
],
|
||||
"scripts": {
|
||||
"build": "father build",
|
||||
"build:watch": "father dev",
|
||||
"ci": "npm run lint && npm run type-check",
|
||||
"clean": "rm -rf es lib dist coverage .dumi/tmp .eslintcache",
|
||||
"dev": "dumi dev",
|
||||
"docs:build": "dumi build",
|
||||
"doctor": "father doctor",
|
||||
"lint": "eslint \"{src,test}/**/*.{js,jsx,ts,tsx}\"",
|
||||
"prepare": "husky install && npm run setup",
|
||||
"prepublishOnly": "father doctor && npm run build",
|
||||
"prettier": "prettier -c --write \"**/**\"",
|
||||
"release": "semantic-release",
|
||||
"setup": "dumi setup",
|
||||
"start": "dumi dev",
|
||||
"test": "vitest",
|
||||
"test:coverage": "vitest run --coverage",
|
||||
"test:update": "vitest -u",
|
||||
"type-check": "tsc -p tsconfig-check.json"
|
||||
},
|
||||
"lint-staged": {
|
||||
"*.{md,json}": [
|
||||
"prettier --write --no-error-on-unmatched-pattern"
|
||||
],
|
||||
"*.{js,jsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
],
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --parser=typescript --write"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "^17",
|
||||
"@testing-library/react": "^13",
|
||||
"@types/react": "^18",
|
||||
"@types/react-dom": "^18",
|
||||
"@umijs/lint": "^4",
|
||||
"@vitest/coverage-c8": "latest",
|
||||
"antd": "^5",
|
||||
"commitlint": "^17",
|
||||
"commitlint-config-gitmoji": "^2",
|
||||
"concurrently": "^7",
|
||||
"cross-env": "^7",
|
||||
"dumi": "^2",
|
||||
"dumi-theme-antd-style": "latest",
|
||||
"eslint": "^8",
|
||||
"eslint-import-resolver-alias": "^1",
|
||||
"eslint-import-resolver-typescript": "^2",
|
||||
"father": "^4",
|
||||
"husky": "^8",
|
||||
"jsdom": "^21.1.1",
|
||||
"lint-staged": "^13",
|
||||
"prettier": "^2",
|
||||
"prettier-plugin-organize-imports": "^3",
|
||||
"prettier-plugin-packagejson": "^2",
|
||||
"react": "^18",
|
||||
"react-dom": "^18",
|
||||
"semantic-release": "^20",
|
||||
"semantic-release-config-gitmoji": "^1",
|
||||
"stylelint": "^14",
|
||||
"typescript": "^5",
|
||||
"vitest": "latest"
|
||||
},
|
||||
"publishConfig": {
|
||||
"access": "public",
|
||||
"registry": "https://registry.npmjs.org"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export const hello = () => {
|
||||
return 'world';
|
||||
};
|
||||
@@ -0,0 +1,5 @@
|
||||
import { hello } from 'lobe-ui';
|
||||
|
||||
test('hello', () => {
|
||||
expect(hello()).toBe('world');
|
||||
});
|
||||
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
{
|
||||
"include": ["src", "tests", ".dumi/**/*", ".dumirc.ts", "*.ts"],
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"declaration": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"resolveJsonModule": true,
|
||||
"jsx": "react-jsx",
|
||||
"baseUrl": ".",
|
||||
"types": ["vitest/globals"],
|
||||
"paths": {
|
||||
"@@/*": [".dumi/tmp/*"],
|
||||
"@/*": ["src"],
|
||||
"lobe-ui": ["src"],
|
||||
"lobe-ui/*": ["src/*", "*"]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { defineConfig } from 'vitest/config';
|
||||
import { name } from './package.json';
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
setupFiles: './tests/test-setup.ts',
|
||||
environment: 'jsdom',
|
||||
globals: true,
|
||||
alias: {
|
||||
'@': './src',
|
||||
[name]: './src',
|
||||
},
|
||||
},
|
||||
});
|
||||
Reference in New Issue
Block a user