
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
@ant-design/codemod-v5
Advanced tools
English | 简体中文
A collection of codemod scripts that help upgrade antd v5 using jscodeshift and postcss.(Inspired by react-codemod)
Before run codemod scripts, you'd better make sure to commit your local git changes firstly.
# Run directly through npx
npx -p @ant-design/codemod-v5 antd5-codemod src
# Or run directly through pnpm
pnpm --package=@ant-design/codemod-v5 dlx antd5-codemod src
v5-removed-component-migrationReplace import for removed component in v5.
Comment import from @ant-design/compatible.PageHeader import from @ant-design/pro-layout.BackTop from FloatButton.BackTop.- import { Avatar, BackTop, Comment, PageHeader } from 'antd';
+ import { Comment } from '@ant-design/compatible';
+ import { PageHeader } from '@ant-design/pro-layout';
+ import { Avatar, FloatButton } from 'antd';
ReactDOM.render( (
<div>
<PageHeader
className="site-page-header"
onBack={() => null}
title="Title"
subTitle="This is a subtitle"
/>
<Comment
actions={actions}
author={<a>Han Solo</a>}
avatar={<Avatar src="https://joeschmoe.io/api/v1/random" alt="Han Solo" />}
content={
<p>
We supply a series of design principles, practical patterns and high quality design
resources (Sketch and Axure), to help people create their product prototypes beautifully
and efficiently.
</p>
}
datetime={
<span title="2016-11-22 11:22:33">8 hours ago</span>
}
/>
- <BackTop />
+ <FloatButton.BackTop />
</div>
);
v5-props-changed-migrationChange props usage from v4 to v5.
import { Tag, Modal, Slider } from 'antd';
const App = () => {
const [visible, setVisible] = useState(false);
return (
<>
- <Tag
- visible={visible}
- />
+ {visible ? <Tag /> : null}
<Modal
- visible={visible}
+ open={visible}
/>
- <Slider tooltipVisible={visible} tooltipPlacement="bottomLeft" />
+ <Slider tooltip={{ placement: "bottomLeft", open: visible }} />
</>
);
};
v5-removed-static-method-migrationmessage.warn with message.warning.notification.close with notification.destroy.import { message, notification } from 'antd';
const App = () => {
const [messageApi, contextHolder] = message.useMessage();
const onClick1 = () => {
- message.warn();
+ message.warning();
}
const onClick2 = () => {
- messageApi.warn();
+ messageApi.warning();
};
const [notificationApi] = notification.useNotification();
const onClick3 = () => {
- notification.close();
+ notification.destroy();
}
const onClick4 = () => {
- notificationApi.close();
+ notificationApi.destroy();
};
return <>{contextHolder}</>;
};
v5-remove-style-importComment out the style file import from antd (in js file).
- import 'antd/es/auto-complete/style';
- import 'antd/lib/button/style/index.less';
- import 'antd/dist/antd.compact.min.css';
+ // import 'antd/es/auto-complete/style';
+ // import 'antd/lib/button/style/index.less';
+ // import 'antd/dist/antd.compact.min.css';
Remove Antd Less in less fileComment out the style file import from antd in less file.
- @import (reference) '~antd/dist/antd.less';
- @import '~antd/es/button/style/index.less';
+ /* @import (reference) '~antd/dist/antd.less'; */
+ /* @import '~antd/es/button/style/index.less'; */
@import './styles.less';
body {
font-size: 14px;
}
npm run release
npm publish
MIT
FAQs
Codemod for ant design v5 upgrade
The npm package @ant-design/codemod-v5 receives a total of 32 weekly downloads. As such, @ant-design/codemod-v5 popularity was classified as not popular.
We found that @ant-design/codemod-v5 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.