Skip to content

Commit f18e051

Browse files
committed
chore: project init
1 parent 9b51a1d commit f18e051

11 files changed

+247
-5
lines changed

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
indent_style = space
6+
indent_size = 2
7+
end_of_line = lf
8+
charset = utf-8
9+
trim_trailing_whitespace = true
10+
insert_final_newline = true
11+
12+
[*.md]
13+
trim_trailing_whitespace = false
14+
15+
[Makefile]
16+
indent_style = tab

.fatherrc.ts

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { readdirSync } from 'fs';
2+
import { join } from 'path';
3+
4+
// utils must build before core
5+
// runtime must build before renderer-react
6+
const headPkgs: string[] = [];
7+
const tailPkgs = readdirSync(join(__dirname, 'packages')).filter(
8+
(pkg) => pkg.charAt(0) !== '.' && !headPkgs.includes(pkg),
9+
);
10+
11+
export default {
12+
cjs: {
13+
type: 'babel',
14+
lazy: true
15+
},
16+
esm: {
17+
type: 'babel',
18+
importLibToEs: true,
19+
},
20+
pkgs: [...headPkgs, ...tailPkgs],
21+
extraBabelPlugins: [
22+
['babel-plugin-import', { libraryName: 'antd', libraryDirectory: 'es', style: true }, 'antd'],
23+
],
24+
};

.gitignore

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Log
2+
npm-debug.log*
3+
yarn-debug.log*
4+
yarn-error.log*
5+
6+
# Test
7+
coverage
8+
9+
# Dependency directories
10+
node_modules
11+
12+
package-lock.json
13+
14+
# build output
15+
es
16+
lib
17+
dist
18+
19+
# IDE
20+
.idea
21+
.vscode
22+
23+
.DS_Store
24+
25+
# Umi
26+
.umi
27+
.umi-production
28+
29+
# Local
30+
local.config.ts
31+
yarn.lock

.umirc.ts

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import { readdirSync } from 'fs';
2+
import chalk from 'chalk';
3+
import { join } from 'path';
4+
5+
const headPkgList = [];
6+
// utils must build before core
7+
// runtime must build before renderer-react
8+
const pkgList = readdirSync(join(__dirname, 'packages')).filter(
9+
(pkg) => pkg.charAt(0) !== '.' && !headPkgList.includes(pkg),
10+
);
11+
12+
const alias = pkgList.reduce((pre, pkg) => {
13+
pre[`@pansy/react-${pkg}`] = join(__dirname, 'packages', pkg, 'src');
14+
return {
15+
...pre,
16+
};
17+
}, {});
18+
19+
console.log(`🌼 alias list \n${chalk.blue(Object.keys(alias).join('\n'))}`);
20+
21+
const tailPkgList = pkgList
22+
.map((path) => [join('packages', path, 'docs')])
23+
.reduce((acc, val) => acc.concat(val), []);
24+
25+
export default {
26+
title: 'React Components',
27+
mode: 'site',
28+
extraBabelPlugins: [
29+
[
30+
'import',
31+
{
32+
libraryName: 'antd',
33+
libraryDirectory: 'es',
34+
style: true,
35+
},
36+
],
37+
],
38+
alias,
39+
resolve: { includes: [...tailPkgList, 'docs'] },
40+
navs: [
41+
null,
42+
{
43+
title: 'GitHub',
44+
path: 'https://github.com/pansyjs/react-components',
45+
},
46+
],
47+
hash: true,
48+
dynamicImport: {}
49+
};

README.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@
22

33
<h4 align="center">React components library.<h4>
44

5-
## 📦 组件
5+
## 📦 组件看板
66

7-
| 组件 | 版本 | 描述 |
8-
|------|-----------|-----------|
9-
|[watermark](https://github.com/pansyjs/react-components/packages/watermark)|[![NPM version](https://img.shields.io/npm/v/@pansy/react-fullscreen.svg?style=flat)](https://npmjs.org/package/@pansy/react-fullscreen)|水印组件|
10-
|[aliplayer](https://github.com/pansyjs/react-components/packages/aliplayer)|[![NPM version](https://img.shields.io/npm/v/@pansy/react-aliplayer.svg?style=flat)](https://npmjs.org/package/@pansy/react-aliplayer)|阿里云播放器封装|
7+
| 组件 | 下载量 | 版本 |
8+
| --- | --- | --- |
9+
| watermark | [![](https://img.shields.io/npm/dw/@pansy/react-watermark.svg)](https://www.npmjs.com/package/@pansy/react-watermark) | [![npm package](https://img.shields.io/npm/v/@pansy/react-watermark.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@pansy/react-watermark) |
1110

1211
## 🌟 社区互助
1312

build.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
yarn
3+
yarn site

docs/index.md

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
title: 介绍 - ProComponents
3+
order: 10
4+
sidebar: false
5+
hero:
6+
title: React Components
7+
desc: React components library.
8+
actions:
9+
- text: 快速开始 →
10+
link: /docs/getting-started-table
11+
12+
features:
13+
- icon: https://gw.alipayobjects.com/os/q/cms/images/k9ziitmp/13668549-b393-42a2-97c3-a6365ba87ac2_w96_h96.png
14+
title: 简单易用
15+
desc: 简洁的API,开箱即用
16+
- icon: https://gw.alipayobjects.com/os/q/cms/images/k9ziip85/89434dcf-5f1d-4362-9ce0-ab8012a85924_w96_h96.png
17+
title: 国际化
18+
desc: 提供完备的国际化语言支持
19+
- icon: https://gw.alipayobjects.com/os/q/cms/images/k9zij2bh/67f75d56-0d62-47d6-a8a5-dbd0cb79a401_w96_h96.png
20+
title: TypeScript
21+
desc: 使用 TypeScript 开发,提供完整的类型定义文件
22+
23+
footer: Open-source MIT Licensed | Copyright © 2017-present
24+
---
25+
26+
## 📦 组件看板
27+
28+
| 组件 | 下载量 | 版本 |
29+
| --- | --- | --- |
30+
| watermark | [![](https://img.shields.io/npm/dw/@pansy/react-watermark.svg)](https://www.npmjs.com/package/@pansy/react-watermark) | [![npm package](https://img.shields.io/npm/v/@pansy/react-watermark.svg?style=flat-square?style=flat-square)](https://www.npmjs.com/package/@pansy/react-watermark) |
31+
32+
## 🌟 社区互助
33+
34+
| Github Issue | 钉钉群 | 微信群 |
35+
| ------------------------------------------------- | ------------------------------------------------------------------------------------------ | ---------------------------------------------------------------------------------------- |
36+
| [issues](https://github.com/pansyjs/react-components/issues) | <img src="https://github.com/alitajs/alita/blob/master/public/dingding.png" width="100" /> | <img src="https://github.com/alitajs/alita/blob/master/public/wechat.png" width="100" /> |
37+

lerna.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"npmClient": "yarn",
3+
"version": "independent",
4+
"useWorkspaces": true,
5+
"packages": [
6+
"packages/*"
7+
],
8+
"command": {
9+
"publish": {
10+
"npmClient": "npm",
11+
"verifyAccess": false,
12+
"ignoreChanges": ["*.md", "**/test/**"],
13+
"message": "chore(release): publish"
14+
}
15+
}
16+
}

now.json

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "react-components",
3+
"version": 2,
4+
"builds": [
5+
{
6+
"src": "build.sh",
7+
"use": "@now/static-build",
8+
"config": {
9+
"distDir": "dist"
10+
}
11+
}
12+
],
13+
"rewrites": [{ "source": "/(.*)", "destination": "/index.html" }]
14+
}

package.json

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{
2+
"name": "@pansy/react-components",
3+
"repository": "[email protected]:pansyjs/react-components.git",
4+
"author": "wangxingkang <[email protected]>",
5+
"license": "MIT",
6+
"private": true,
7+
"scripts": {
8+
"start": "dumi dev",
9+
"build": "father-build",
10+
"site": "dumi build"
11+
},
12+
"devDependencies": {
13+
"dumi": "^1.0.34",
14+
"father-build": "^1.18.5",
15+
"lerna": "^3.22.1",
16+
"typescript": "^4.0.3"
17+
},
18+
"workspaces": [
19+
"packages/*"
20+
],
21+
"publishConfig": {
22+
"registry": "https://registry.npmjs.org",
23+
"access": "public"
24+
}
25+
}

tsconfig.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"target": "esnext",
5+
"moduleResolution": "node",
6+
"jsx": "preserve",
7+
"esModuleInterop": true,
8+
"experimentalDecorators": true,
9+
"strict": true,
10+
"forceConsistentCasingInFileNames": true,
11+
"noImplicitReturns": true,
12+
"suppressImplicitAnyIndexErrors": true,
13+
"declaration": true,
14+
"skipLibCheck": true,
15+
"paths": {}
16+
},
17+
"include": [
18+
"**/src/**/*",
19+
"**/docs/**/*",
20+
"scripts/**/*",
21+
"**/demos",
22+
".eslintrc.js",
23+
"tests",
24+
"jest.config.js",
25+
"**/fixtures",
26+
"./tests/no-duplicated.ts"
27+
]
28+
}

0 commit comments

Comments
 (0)