diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 09638c3..c99089b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,7 @@ jobs: key: lock-${{ github.sha }} - name: create package-lock.json - run: npm i --package-lock-only --ignore-scripts + run: npm i --package-lock-only --ignore-scripts --legacy-peer-deps - name: hack for singe file run: | @@ -42,7 +42,7 @@ jobs: - name: install if: steps.node_modules_cache_id.outputs.cache-hit != 'true' - run: npm ci + run: npm ci --legacy-peer-deps lint: runs-on: ubuntu-latest diff --git a/README.md b/README.md index f4e1ebc..1354af2 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# rc-overflow 🐾 +# @rc-component/overflow 🐾 [![NPM version][npm-image]][npm-url] [![npm download][download-image]][download-url] @@ -7,8 +7,8 @@ [![bundle size][bundlephobia-image]][bundlephobia-url] [![dumi][dumi-image]][dumi-url] -[npm-image]: http://img.shields.io/npm/v/rc-overflow.svg?style=flat-square -[npm-url]: http://npmjs.org/package/rc-overflow +[npm-image]: http://img.shields.io/npm/v/@rc-component/overflow.svg?style=flat-square +[npm-url]: http://npmjs.org/package/@rc-component/overflow [github-actions-image]: https://github.com/react-component/overflow/workflows/CI/badge.svg [github-actions-url]: https://github.com/react-component/overflow/actions [codecov-image]: https://img.shields.io/codecov/c/github/react-component/overflow/master.svg?style=flat-square @@ -17,10 +17,10 @@ [david-image]: https://david-dm.org/react-component/overflow/status.svg?style=flat-square [david-dev-url]: https://david-dm.org/react-component/overflow?type=dev [david-dev-image]: https://david-dm.org/react-component/overflow/dev-status.svg?style=flat-square -[download-image]: https://img.shields.io/npm/dm/rc-overflow.svg?style=flat-square -[download-url]: https://npmjs.org/package/rc-overflow -[bundlephobia-url]: https://bundlephobia.com/result?p=rc-overflow -[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/rc-overflow +[download-image]: https://img.shields.io/npm/dm/@rc-component/overflow.svg?style=flat-square +[download-url]: https://npmjs.org/package/@rc-component/overflow +[bundlephobia-url]: https://bundlephobia.com/result?p=@rc-component/overflow +[bundlephobia-image]: https://badgen.net/bundlephobia/minzip/@rc-component/overflow [dumi-url]: https://github.com/umijs/dumi [dumi-image]: https://img.shields.io/badge/docs%20by-dumi-blue?style=flat-square @@ -32,7 +32,7 @@ https://overflow-react-component.vercel.app/ ## Install -[![rc-overflow](https://nodei.co/npm/rc-overflow.png)](https://npmjs.org/package/rc-overflow) +[![@rc-component/overflow](https://nodei.co/npm/@rc-component/overflow.png)](https://npmjs.org/package/@rc-component/overflow) ## Usage @@ -54,4 +54,4 @@ npm start ## License -rc-overflow is released under the MIT license. +@rc-component/overflow is released under the MIT license. diff --git a/docs/index.md b/docs/index.md index 9bb192a..60fe8f2 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,6 +1,6 @@ --- hero: - title: rc-overflow + title: @rc-component/overflow description: React Overflow Component --- diff --git a/examples/fill-width.tsx b/examples/fill-width.tsx index 5dd6407..e433bf1 100644 --- a/examples/fill-width.tsx +++ b/examples/fill-width.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import useLayoutEffect from "rc-util/lib/hooks/useLayoutEffect"; +import useLayoutEffect from "@rc-component/util/lib/hooks/useLayoutEffect"; import Overflow from '../src'; import '../assets/index.less'; import './common.less'; diff --git a/package.json b/package.json index 78520de..c39530b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { - "name": "rc-overflow", - "version": "1.4.1", + "name": "@rc-component/overflow", + "version": "1.0.0", "description": "Auto collapse box when overflow", "keywords": [ "react", @@ -38,22 +38,22 @@ "prettier": "prettier --write \"**/*.{js,jsx,tsx,ts,less,md,json}\"", "test": "rc-test", "test:coverage": "rc-test --coverage", - "prepublishOnly": "npm run compile && np --no-cleanup --yolo --no-publish", + "prepublishOnly": "npm run compile && rc-np", "lint": "eslint src/ --ext .tsx,.ts", "lint:tsc": "tsc -p tsconfig.json --noEmit", "now-build": "npm run docs:build" }, "dependencies": { "@babel/runtime": "^7.11.1", - "classnames": "^2.2.1", - "rc-resize-observer": "^1.0.0", - "rc-util": "^5.37.0" + "@rc-component/resize-observer": "^1.0.1", + "@rc-component/util": "^1.4.0", + "clsx": "^2.1.1" }, "devDependencies": { - "@rc-component/father-plugin": "^1.0.0", + "@rc-component/father-plugin": "^2.0.0", + "@rc-component/np": "^1.0.4", "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^12.0.0", - "@types/classnames": "^2.2.9", "@types/enzyme": "^3.10.8", "@types/jest": "^26.0.23", "@types/node": "^24.8.1", @@ -94,4 +94,4 @@ "tnpm": { "mode": "npm" } -} \ No newline at end of file +} diff --git a/src/Item.tsx b/src/Item.tsx index 6946da6..cfd18bd 100644 --- a/src/Item.tsx +++ b/src/Item.tsx @@ -1,6 +1,6 @@ import * as React from 'react'; -import classNames from 'classnames'; -import ResizeObserver from 'rc-resize-observer'; +import { clsx } from 'clsx'; +import ResizeObserver from '@rc-component/resize-observer'; import type { ComponentType } from './RawItem'; // Use shared variable to save bundle size @@ -89,7 +89,7 @@ function InternalItem( let itemNode = ( ( const overflowNode = ( ) => { diff --git a/src/hooks/channelUpdate.ts b/src/hooks/channelUpdate.ts index fabb27a..4422798 100644 --- a/src/hooks/channelUpdate.ts +++ b/src/hooks/channelUpdate.ts @@ -1,4 +1,4 @@ -import raf from 'rc-util/lib/raf'; +import raf from '@rc-component/util/lib/raf'; export default function channelUpdate(callback: VoidFunction) { if (typeof MessageChannel === 'undefined') { diff --git a/src/hooks/useEffectState.tsx b/src/hooks/useEffectState.tsx index 02833f2..1d4dd97 100644 --- a/src/hooks/useEffectState.tsx +++ b/src/hooks/useEffectState.tsx @@ -1,4 +1,4 @@ -import useEvent from 'rc-util/lib/hooks/useEvent'; +import useEvent from '@rc-component/util/lib/hooks/useEvent'; import * as React from 'react'; import { unstable_batchedUpdates } from 'react-dom'; import channelUpdate from './channelUpdate'; diff --git a/tests/github.spec.tsx b/tests/github.spec.tsx index 05b21f4..c709b2b 100644 --- a/tests/github.spec.tsx +++ b/tests/github.spec.tsx @@ -1,9 +1,9 @@ import React from 'react'; import { render, act } from '@testing-library/react'; -import { spyElementPrototypes } from 'rc-util/lib/test/domHook'; +import { spyElementPrototypes } from '@rc-component/util/lib/test/domHook'; import Overflow from '../src'; -import { _rs as onResize } from 'rc-resize-observer/lib/utils/observerUtil'; +import { _rs as onResize } from '@rc-component/resize-observer/lib/utils/observerUtil'; interface ItemType { label: React.ReactNode;