Skip to content

Commit 6efcec0

Browse files
EmilyyyLiuyoyo837
andauthored
refactor: migrate to @rc-component namespace (#56)
Co-authored-by: yoyo837 <yoyo837@hotmail.com>
1 parent 8457740 commit 6efcec0

File tree

11 files changed

+34
-34
lines changed

11 files changed

+34
-34
lines changed

.github/workflows/main.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
key: lock-${{ github.sha }}
2525

2626
- name: create package-lock.json
27-
run: npm i --package-lock-only --ignore-scripts
27+
run: npm i --package-lock-only --ignore-scripts --legacy-peer-deps
2828

2929
- name: hack for singe file
3030
run: |
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: install
4444
if: steps.node_modules_cache_id.outputs.cache-hit != 'true'
45-
run: npm ci
45+
run: npm ci --legacy-peer-deps
4646

4747
lint:
4848
runs-on: ubuntu-latest

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# rc-overflow 🐾
1+
# @rc-component/overflow 🐾
22

33
[![NPM version][npm-image]][npm-url]
44
[![npm download][download-image]][download-url]
@@ -7,8 +7,8 @@
77
[![bundle size][bundlephobia-image]][bundlephobia-url]
88
[![dumi][dumi-image]][dumi-url]
99

10-
[npm-image]: http://img.shields.io/npm/v/rc-overflow.svg?style=flat-square
11-
[npm-url]: http://npmjs.org/package/rc-overflow
10+
[npm-image]: http://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square
11+
[npm-url]: http://npmjs.org/package/@rc-component/overflow
1212
[github-actions-image]: https://github.com/react-component/overflow/workflows/CI/badge.svg
1313
[github-actions-url]: https://github.com/react-component/overflow/actions
1414
[codecov-image]: https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square
@@ -17,10 +17,10 @@
1717
[david-image]: https://david-dm.org/react-component/overflow/status.svg?style=flat-square
1818
[david-dev-url]: https://david-dm.org/react-component/overflow?type=dev
1919
[david-dev-image]: https://david-dm.org/react-component/overflow/dev-status.svg?style=flat-square
20-
[download-image]: https://img.shields.io/npm/dm/rc-overflow.svg?style=flat-square
21-
[download-url]: https://npmjs.org/package/rc-overflow
22-
[bundlephobia-url]: https://bundlephobia.com/result?p=rc-overflow
23-
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-overflow
20+
[download-image]: https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square
21+
[download-url]: https://npmjs.org/package/@rc-component/overflow
22+
[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/overflow
23+
[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/overflow
2424
[dumi-url]: https://github.com/umijs/dumi
2525
[dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square
2626

@@ -32,7 +32,7 @@ https://overflow-react-component.vercel.app/
3232

3333
## Install
3434

35-
[![rc-overflow](https://nodei.co/npm/rc-overflow.png)](https://npmjs.org/package/rc-overflow)
35+
[![@rc-component/overflow](https://nodei.co/npm/@rc-component/overflow.png)](https://npmjs.org/package/@rc-component/overflow)
3636

3737
## Usage
3838

@@ -54,4 +54,4 @@ npm start
5454

5555
## License
5656

57-
rc-overflow is released under the MIT license.
57+
@rc-component/overflow is released under the MIT license.

docs/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
hero:
3-
title: rc-overflow
3+
title: @rc-component/overflow
44
description: React Overflow Component
55
---
66

examples/fill-width.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import useLayoutEffect from "rc-util/lib/hooks/useLayoutEffect";
2+
import useLayoutEffect from "@rc-component/util/lib/hooks/useLayoutEffect";
33
import Overflow from '../src';
44
import '../assets/index.less';
55
import './common.less';

package.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"name": "rc-overflow",
3-
"version": "1.4.1",
2+
"name": "@rc-component/overflow",
3+
"version": "1.0.0",
44
"description": "Auto collapse box when overflow",
55
"keywords": [
66
"react",
@@ -38,22 +38,22 @@
3838
"prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"",
3939
"test": "rc-test",
4040
"test:coverage": "rc-test --coverage",
41-
"prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish",
41+
"prepublishOnly": "npm run compile && rc-np",
4242
"lint": "eslint src/ --ext .tsx,.ts",
4343
"lint:tsc": "tsc -p tsconfig.json --noEmit",
4444
"now-build": "npm run docs:build"
4545
},
4646
"dependencies": {
4747
"@babel/runtime": "^7.11.1",
48-
"classnames": "^2.2.1",
49-
"rc-resize-observer": "^1.0.0",
50-
"rc-util": "^5.37.0"
48+
"@rc-component/resize-observer": "^1.0.1",
49+
"@rc-component/util": "^1.4.0",
50+
"clsx": "^2.1.1"
5151
},
5252
"devDependencies": {
53-
"@rc-component/father-plugin": "^1.0.0",
53+
"@rc-component/father-plugin": "^2.0.0",
54+
"@rc-component/np": "^1.0.4",
5455
"@testing-library/jest-dom": "^5.16.4",
5556
"@testing-library/react": "^12.0.0",
56-
"@types/classnames": "^2.2.9",
5757
"@types/enzyme": "^3.10.8",
5858
"@types/jest": "^26.0.23",
5959
"@types/node": "^24.8.1",

src/Item.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as React from 'react';
2-
import classNames from 'classnames';
3-
import ResizeObserver from 'rc-resize-observer';
2+
import { clsx } from 'clsx';
3+
import ResizeObserver from '@rc-component/resize-observer';
44
import type { ComponentType } from './RawItem';
55

66
// Use shared variable to save bundle size
@@ -89,7 +89,7 @@ function InternalItem<ItemType>(
8989

9090
let itemNode = (
9191
<Component
92-
className={classNames(!invalidate && prefixCls, className)}
92+
className={clsx(!invalidate && prefixCls, className)}
9393
style={{
9494
...overflowStyle,
9595
...style,

src/Overflow.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import * as React from 'react';
22
import { useState, useMemo, useCallback } from 'react';
3-
import classNames from 'classnames';
4-
import ResizeObserver from 'rc-resize-observer';
5-
import useLayoutEffect from 'rc-util/lib/hooks/useLayoutEffect';
3+
import { clsx } from 'clsx';
4+
import ResizeObserver from '@rc-component/resize-observer';
5+
import useLayoutEffect from '@rc-component/util/lib/hooks/useLayoutEffect';
66
import Item from './Item';
77
import useEffectState, { useBatcher } from './hooks/useEffectState';
88
import type { ComponentType } from './RawItem';
@@ -394,7 +394,7 @@ function Overflow<ItemType = any>(
394394

395395
const overflowNode = (
396396
<Component
397-
className={classNames(!invalidate && prefixCls, className)}
397+
className={clsx(!invalidate && prefixCls, className)}
398398
style={style}
399399
ref={ref}
400400
{...restProps}

src/RawItem.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import * as React from 'react';
2-
import classNames from 'classnames';
2+
import { clsx } from 'clsx';
33
import Item from './Item';
44
import { OverflowContext } from './context';
55

@@ -31,7 +31,7 @@ const InternalRawItem = (props: RawItemProps, ref: React.Ref<any>) => {
3131
<OverflowContext.Provider value={null}>
3232
<Item
3333
ref={ref}
34-
className={classNames(contextClassName, className)}
34+
className={clsx(contextClassName, className)}
3535
{...restContext}
3636
{...restProps}
3737
/>

src/hooks/channelUpdate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import raf from 'rc-util/lib/raf';
1+
import raf from '@rc-component/util/lib/raf';
22

33
export default function channelUpdate(callback: VoidFunction) {
44
if (typeof MessageChannel === 'undefined') {

src/hooks/useEffectState.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import useEvent from 'rc-util/lib/hooks/useEvent';
1+
import useEvent from '@rc-component/util/lib/hooks/useEvent';
22
import * as React from 'react';
33
import { unstable_batchedUpdates } from 'react-dom';
44
import channelUpdate from './channelUpdate';

0 commit comments

Comments
 (0)