Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use father #85

Merged
merged 21 commits into from Sep 1, 2020
Merged

chore: use father #85

merged 21 commits into from Sep 1, 2020

Conversation

xrkffgg
Copy link
Member

@xrkffgg xrkffgg commented Aug 27, 2020

No description provided.

@vercel
Copy link

vercel bot commented Aug 27, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/react-component/progress/kryv8374w
✅ Preview: https://progress-git-up-father.react-component.vercel.app

@xrkffgg xrkffgg changed the title chore: use father [WIP] chore: use father Aug 27, 2020
package.json Outdated
"rc-tools": "9.x",
"react": "^16.9.0",
"react-dom": "^16.9.0",
"typescript": "^3.9.7"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^4.0.2

@xrkffgg
Copy link
Member Author

xrkffgg commented Aug 31, 2020

PR 的过去了,push 的一直报错。

@xrkffgg xrkffgg requested a review from zombieJ August 31, 2020 09:41
@zombieJ
Copy link
Member

zombieJ commented Aug 31, 2020

https://stackoverflow.com/questions/34974925/travis-ci-creates-two-builds-for-each-github-commit-push/34975730

PR 是合到 master 后的 CI, Push 是当前 branch 的 CI。本地 git clean -fdx 重新安装一遍试试看会不会遇到这个错误。

package.json Outdated
"eslint": "^7.6.0",
"father": "^2.29.6",
"np": "^6.5.0",
"rc-tools": "9.x",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rc-tools 应该没用了。

@codecov
Copy link

codecov bot commented Aug 31, 2020

Codecov Report

Merging #85 into master will increase coverage by 14.37%.
The diff coverage is 100.00%.

Impacted file tree graph

@@             Coverage Diff             @@
##           master      #85       +/-   ##
===========================================
+ Coverage   84.68%   99.05%   +14.37%     
===========================================
  Files           4        3        -1     
  Lines         111      106        -5     
  Branches       24       26        +2     
===========================================
+ Hits           94      105       +11     
+ Misses         17        1       -16     
Impacted Files Coverage Δ
src/Circle.tsx 100.00% <100.00%> (ø)
src/Line.tsx 100.00% <100.00%> (ø)
src/common.ts 94.73% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3d693d8...8205255. Read the comment docs.


node_js:
- 10
- 12
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

升级了就好了。

现在就剩下覆盖率的问题了。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

用例 转了下写法 就下降了 。。。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以补两个用例

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

之前的dialog 和 upload 咋没有覆盖率检查结果显示呢?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

版本的原因吧,那2个都是10

index.js Outdated
@@ -1,4 +1,4 @@
import Progress, { Line, Circle } from './src/';
import Progress, { Line, Circle } from './src';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个文件应该没用了

src/interface.ts Outdated
@@ -0,0 +1,22 @@
import * as React from 'react';

export interface progressProps {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

类型定义以大写开头

@xrkffgg
Copy link
Member Author

xrkffgg commented Sep 1, 2020

@kermit-xuan 帮忙 Review 下~

src/Circle.tsx Outdated
@@ -2,18 +2,26 @@
import React, { useMemo } from 'react';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

导入 React 的时候最好使用 import * as React from 'React',否则当 tsconfig 未开启 esModuleInterop 选项时,编译会有问题。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

return +percent.replace('%', '');
}

function toArray(symArray) {
function toArray(symArray: any) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里有具体类型的话,尽量写上类型,避免使用 any

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

toArray 一个传入 percent?: number | number[];
一个传入 string | string[] | object;
然后 下面 还用这个的返回值
😂 索性就改成 any 了

@@ -57,7 +65,7 @@ function getPathStyles(offset, percent, strokeColor, strokeWidth, gapDegree = 0,
};
}

const Circle = ({
const Circle: React.FC<ProgressProps> = ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数式组件导出时,写上 displayName 属性。


const Line = ({
const Line: React.FC<ProgressProps> = ({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

函数式组件导出时,写上 displayName 属性。

src/Line.tsx Outdated
@@ -2,8 +2,9 @@
import React from 'react';
Copy link
Member

@kerm1it kerm1it Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

导入 React 的时候最好使用 import * as React from 'React',否则当 tsconfig 未开启 esModuleInterop 选项时,编译会有问题。

src/common.ts Outdated
@@ -1,20 +1,22 @@
import { useRef, useEffect } from 'react';
import { StrokeLinecapType } from './interface';

export const defaultProps = {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

defaultProps 最好加上类型 Partial<ProgressProps>,另外 strokeLinecap 应该可以不用 as

@@ -60,7 +61,7 @@ const Line = ({
className={`${prefixCls}-line-path`}
d={pathString}
strokeLinecap={strokeLinecap}
stroke={color}
stroke={color as string}
Copy link
Member

@kerm1it kerm1it Sep 1, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个 color 的类型有点迷,可以为 stringstring[]object,但是没有看见 object 用到。

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

object 好像是这种的

{
  0%: 'xxx'
  50%: 'xxx'
  100%: 'xxx',
}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明白了,Line 和 Circle 用的一个 Props 定义,但是有些字段的类型是有分叉的。

Copy link
Member

@kerm1it kerm1it left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我这没啥问题了, @afc163 @zombieJ 你们再看看有没有漏掉的?

@afc163 afc163 merged commit 4bada1e into master Sep 1, 2020
@delete-merged-branch delete-merged-branch bot deleted the up-father branch September 1, 2020 13:35
@afc163
Copy link
Member

afc163 commented Sep 1, 2020

我先发一个 minor 版本到 antd 再测测。

@xrkffgg xrkffgg mentioned this pull request Nov 16, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants