diff --git a/docs/examples/simple.tsx b/docs/examples/simple.tsx
index b0088be..3677dab 100644
--- a/docs/examples/simple.tsx
+++ b/docs/examples/simple.tsx
@@ -1,33 +1,28 @@
import '../../assets/index.less';
import React, { useState } from 'react';
-import type { SwitchChangeEventHandler } from 'rc-switch';
-import Switch from 'rc-switch';
+import type { SwitchChangeEventHandler } from '@rc-component/switch';
+import Switch from '@rc-component/switch';
const onChange: SwitchChangeEventHandler = (value, event) => {
// eslint-disable-next-line no-console
console.log(`switch checked: ${value}`, event);
-}
+};
export default () => {
const [disabled, setDisabled] = useState(false);
const toggle = () => {
setDisabled((prev) => !prev);
- }
+ };
return (
- )
-}
+ );
+};
diff --git a/package.json b/package.json
index 12db8d0..6349924 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
- "name": "rc-switch",
- "version": "4.1.0",
+ "name": "@rc-component/switch",
+ "version": "1.0.0",
"description": "switch ui component for react",
"keywords": [
"react",
@@ -32,7 +32,7 @@
"lint": "eslint .",
"lint-staged": "lint-staged",
"prepare": "husky install && dumi setup",
- "prepublishOnly": "npm run compile && np --yolo --no-publish",
+ "prepublishOnly": "npm run compile && rc-np",
"postpublish": "npm run gh-pages",
"start": "dumi dev",
"test": "umi-test"
@@ -43,12 +43,11 @@
]
},
"dependencies": {
- "@babel/runtime": "^7.21.0",
"classnames": "^2.2.1",
- "rc-util": "^5.30.0"
+ "@rc-component/util": "^1.2.0"
},
"devDependencies": {
- "@rc-component/father-plugin": "^1.0.0",
+ "@rc-component/father-plugin": "^2.0.0",
"@types/classnames": "^2.2.10",
"@types/jest": "^29.4.0",
"@umijs/fabric": "^3.0.0",
@@ -65,7 +64,7 @@
"husky": "^8.0.1",
"less": "^4.1.3",
"lint-staged": "^15.1.0",
- "np": "^9.0.0",
+ "@rc-component/np": "^1.0.3",
"prettier": "^3.1.0",
"react": "^16.0.0",
"react-dom": "^16.0.0",
diff --git a/src/index.tsx b/src/index.tsx
index 887c25d..b4ce9b6 100644
--- a/src/index.tsx
+++ b/src/index.tsx
@@ -1,7 +1,7 @@
import * as React from 'react';
import classNames from 'classnames';
-import useMergedState from 'rc-util/lib/hooks/useMergedState';
-import KeyCode from 'rc-util/lib/KeyCode';
+import useMergedState from '@rc-component/util/lib/hooks/useMergedState';
+import KeyCode from '@rc-component/util/lib/KeyCode';
export type SwitchChangeEventHandler = (
checked: boolean,
diff --git a/tests/index.spec.js b/tests/index.spec.js
index eef4e03..4863932 100644
--- a/tests/index.spec.js
+++ b/tests/index.spec.js
@@ -1,5 +1,5 @@
import React from 'react';
-import KeyCode from 'rc-util/lib/KeyCode';
+import KeyCode from '@rc-component/util/lib/KeyCode';
import { mount } from 'enzyme';
import Switch from '..';
diff --git a/tsconfig.json b/tsconfig.json
index eea6766..f110b99 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -13,7 +13,7 @@
"skipLibCheck": true,
"declaration": true,
"paths": {
- "rc-switch": ["src/index.tsx"],
+ "@rc-component/switch": ["src/"],
"@@/*": [".dumi/tmp/*"]
}
}