Skip to content

Commit

Permalink
fix: npm run build, lint, test failure in 3.0 (#2680)
Browse files Browse the repository at this point in the history
* fix: build, lint, test

* chore: save

* fix: build, lint, test

* chore: save
  • Loading branch information
Alex-huxiyang authored Oct 30, 2024
1 parent aba2e6b commit 9e7009d
Show file tree
Hide file tree
Showing 13 changed files with 90 additions and 175 deletions.
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
src/sites
src/packages/nutui.react.build.rn.ts
scripts
site_docs
coverage
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@
**/*.eot
package.json
node_modules
src/packages/nutui.react.build.rn.ts
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
"generate:file:taro": "node scripts/taro/generate-nutui-taro.js",
"generate:file:taro:pages": "node scripts/taro/generate-taro-pages.js",
"gulp:watch": "gulp watch --environment",
"lint": "eslint ./src/packages",
"lint": "eslint ./src/packages/*/",
"lint:fix": "eslint --fix ./src/packages",
"postpublish": "node scripts/postpublish.js",
"prepare": "husky && npm run generate:file && npm run generate:file:taro && npm run generate:file:taro:pages",
Expand Down
1 change: 0 additions & 1 deletion src/packages/avatar/avatar.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ export const Avatar: FunctionComponent<
background,
color,
src,
alt,
icon,
fit,
avatarIndex,
Expand Down
8 changes: 4 additions & 4 deletions src/packages/avatarcropper/avatarcropper.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import React, {
} from 'react'
import Taro, { useReady, createSelectorQuery } from '@tarojs/taro'
import classNames from 'classnames'
import { Canvas, View } from '@tarojs/components'
import { Canvas, CommonEventFunction, View } from '@tarojs/components'
import { Button } from '@/packages/button/button.taro'
import { useConfig } from '@/packages/configprovider/configprovider.taro'

Expand Down Expand Up @@ -449,7 +449,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
})
const { startMoveX, startMoveY, startScale, startDistance } = startMove

const onTouchStart = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchStart: CommonEventFunction = (event: any) => {
const { touches } = event
const { offsetX } = touch

Expand All @@ -472,7 +472,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
}
}

const onTouchMove = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchMove: CommonEventFunction = (event: any) => {
const { touches } = event

touch.move(event)
Expand Down Expand Up @@ -500,7 +500,7 @@ export const AvatarCropper: FunctionComponent<Partial<AvatarCropperProps>> = (
}
}

const onTouchEnd = (event: React.TouchEvent<HTMLDivElement>) => {
const onTouchEnd: CommonEventFunction = (event: any) => {
let stopPropagation = false

if (moving || zooming) {
Expand Down
90 changes: 48 additions & 42 deletions src/packages/configprovider/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export type NutCSSVariables =
| 'nutuiColorPrimaryStop2'
| 'nutuiColorPrimaryPressed'
| 'nutuiColorPrimaryDisabled'
| 'nutuiColorPrimaryLight'
| 'nutuiColorPrimaryDisabledSpecial'
| 'nutuiColorPrimaryLightPressed'
| 'nutuiColorDefault'
| 'nutuiColorDefaultPressed'
Expand All @@ -30,51 +30,51 @@ export type NutCSSVariables =
| 'nutuiColorDangerDisabled'
| 'nutuiColorDangerLight'
| 'nutuiColorDangerBackground'
| 'nutuiGray12'
| 'nutuiGray0'
| 'nutuiGray1'
| 'nutuiWhite12'
| 'nutuiBlack8'
| 'nutuiBlack3'
| 'nutuiGray4'
| 'nutuiGray7'
| 'nutuiGray6'
| 'nutuiGray5'
| 'nutuiColorBackground'
| 'nutuiColorBackgroundOverlay'
| 'nutuiColorBackgroundSunken'
| 'nutuiColorMask'
| 'nutuiColorMaskPart'
| 'nutuiColorMaskFaultToleran'
| 'nutuiColorBorder'
| 'nutuiColorBorderDisabled'
| 'nutuiColorTitle'
| 'nutuiColorText'
| 'nutuiColorTextHelp'
| 'nutuiColorTextDisabled'
| 'nutuiWhite12'
| 'nutuiColorPrimaryText'
| 'nutuiFontSizeXxs'
| 'nutuiFontSizeXs'
| 'nutuiFontSizeS'
| 'nutuiFontSizeBase'
| 'nutuiFontSizeL'
| 'nutuiFontSizeXl'
| 'nutuiFontSizeXxl'
| 'nutuiFontSize10'
| 'nutuiFontSize11'
| 'nutuiFontWeightLight'
| 'nutuiFontWeight'
| 'nutuiFontWeightBold'
| 'nutuiLineHeightBase'
| 'nutuiSpacing2'
| 'nutuiSpacing4'
| 'nutuiSpacing6'
| 'nutuiSpacing8'
| 'nutuiSpacing10'
| 'nutuiSpacing12'
| 'nutuiSpacing14'
| 'nutuiSpacing16'
| 'nutuiRadius3'
| 'nutuiRadius4'
| 'nutuiRadius6'
| 'nutuiRadius8'
| 'nutuiRadius12'
| 'nutuiRadius16'
| 'nutuiRadius20'
| 'nutuiRadius24'
| 'nutuiGray3'
| 'nutuiGray2'
| 'nutuiBlack10'
| 'nutuiBlack2'
| 'nutuiFontSize1'
| 'nutuiFontSize2'
| 'nutuiFontSize3'
| 'nutuiFontSize4'
| 'nutuiFontSize6'
| 'nutuiFontSize8'
| 'nutuiFontSize10'
| 'nutuiFontSize11'
| 'nutuiColorPrimaryText'
| 'nutuiColorTextLink'
| 'nutuiPaddingXs'
| 'nutuiSpacingXxxs'
| 'nutuiSpacingXxs'
| 'nutuiSpacingXs'
| 'nutuiSpacingS'
| 'nutuiSpacingBase'
| 'nutuiSpacingL'
| 'nutuiSpacingXl'
| 'nutuiSpacingXxl'
| 'nutuiSpacingXxxl'
| 'nutuiRadiusXxxs'
| 'nutuiRadiusXxs'
| 'nutuiRadiusXs'
| 'nutuiRadiusS'
| 'nutuiRadiusBase'
| 'nutuiRadiusL'
| 'nutuiRadiusXl'
| 'nutuiRadiusXxl'
| 'nutuiRadiusXxxl'
| 'nutuiButtonSquareBorderRadius'
| 'nutuiButtonBorderRadius'
| 'nutuiButtonBorderWidth'
Expand Down Expand Up @@ -332,13 +332,19 @@ export type NutCSSVariables =
| 'nutuiCalendarDayFontWeight'
| 'nutuiCalendarDayActiveBorderRadius'
| 'nutuiHoverbuttonSpacing'
| 'nutuiSpacing16'
| 'nutuiHoverbuttonPositionBottom'
| 'nutuiHoverbuttonPositionRight'
| 'nutuiHoverbuttonItemBorderColor'
| 'nutuiBlack3'
| 'nutuiHoverbuttonItemBackground'
| 'nutuiGray1'
| 'nutuiHoverbuttonItemBackgroundActive'
| 'nutuiGray3'
| 'nutuiHoverbuttonItemIconColor'
| 'nutuiGray7'
| 'nutuiHoverbuttonItemIconColorActive'
| 'nutuiGray6'
| 'nutuiOverlayBgColor'
| 'nutuiOverlayZIndex'
| 'nutuiOverlayContentBgColor'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,116 +116,6 @@ exports[`emit click event 1`] = `
</div>
`;

exports[`prop 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
URL 跳转
</div>
</div>
<div
class="nut-cell-extra"
>
https://m.jd.com/
</div>
</div>
</div>
`;

exports[`prop title extra description test 1`] = `
<div>
<div
class="nut-cell"
data-testid="prop"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
我是标题
</div>
<div
class="nut-cell-description"
>
我是描述
</div>
</div>
<div
class="nut-cell-extra"
>
描述文字
</div>
</div>
</div>
`;

exports[`slot default test 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
<div>
自定义内容
</div>
</div>
</div>
<div
class="nut-cell-extra"
>
描述文字
</div>
</div>
</div>
`;

exports[`slot extra 1`] = `
<div>
<div
class="nut-cell"
style="border-radius: 6px; align-items: flex-start;"
>
<div
class="nut-cell-left"
>
<div
class="nut-cell-title"
>
Switch
</div>
</div>
<div
class="nut-cell-extra"
>
<div
class="nut-switch"
>
<div
class="nut-switch-button nut-switch-button-open"
/>
</div>
</div>
</div>
</div>
`;

exports[`tabbar height 1`] = `
<div>
<div
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ exports[`infiniteloading base 01 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand Down Expand Up @@ -127,7 +131,11 @@ exports[`pull base 01 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -152,7 +160,11 @@ exports[`pull base 03 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -177,7 +189,11 @@ exports[`pull base 03 2`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -202,7 +218,11 @@ exports[`pull base 1`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
Expand All @@ -227,7 +247,11 @@ exports[`pull base 2`] = `
/>
<div
class="nut-infinite-bottom"
/>
>
<div
class="nut-infinite-bottom-tips"
/>
</div>
</div>
</div>
`;
4 changes: 2 additions & 2 deletions src/packages/popup/popup.rn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ export const Popup: FunctionComponent<
animationType="none" // 使用 slide 动画
transparent // 使背景透明
visible={innerVisible}
onRequestClose={onHandleClickOverlay} // 处理 Android 设备的返回按钮
// onRequestClose={onHandleClickOverlay} // 处理 Android 设备的返回按钮
>
{overlay ? (
<TouchableOpacity
Expand All @@ -293,7 +293,7 @@ export const Popup: FunctionComponent<
// closeOnOverlayClick={closeOnOverlayClick}
// lockScroll={lockScroll}
// duration={duration}
onPress={onHandleClickOverlay}
// onPress={onHandleClickOverlay}
>
<View className={overlayClassName} style={overlayStyles} />
</TouchableOpacity>
Expand Down
Loading

0 comments on commit 9e7009d

Please sign in to comment.