
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@newskit/codemod
Advanced tools
You can use this CLI tool to run various scripts (codemods) that will help update NewsKit APIs
NewsKit provides Codemod transformations to help upgrade your codebase when a component is updated or deprecated.
Codemods are transformations that run on your codebase programmatically. This allows for a large amount of changes to be applied without having to manually go through every file.
You can run these at the root of your project.
npx @newskit/codemod [codemod] [paths]
run to see all codemods and flags
npx @newskit/codemod --help
The following transformers are available when upgrading to v7:
audio-player-play-pause-buttonThere are changes to the default styling of the AudioPlayer component in v7.
Run this codemod if you would like to apply manual overrides to keep the old default styling.
- <AudioPlayerPlayPauseButton />
+ <AudioPlayerPlayPauseButton size="large" />
all-defaultRun this codemod if you would like to apply manual overrides to the keep the old default for all components listed above.
replace-space-inset-props-and-overridesspaceInset prop was marked as deprecated and has now been removed in V7.
Run this codemod if you would like to apply logical props instead.
- <Flag overrides={{spaceInset: "space060"}}>Flag</Flag>
+ <Flag overrides={{paddingBlock: "space060", paddingInline: "space060"}}>Flag</Flag>
- <Block spaceInset="space020" stylePreset="inkContrast">Block</Block>
+ <Block stylePreset="inkContrast" paddingBlock="space020" paddingInline="space020">Block</Block>
popoverThe Popover component has a renamed override prop - from distance to offset
The script replace the override prop distance with offset
- <Popover overrides={{distance: 'space020'}>Content</Popover>
+ <Popover overrides={{offset: 'space020'}>Content</Popover>
tooltipThe Tooltip component has a renamed override prop - from distance to offset
The script replace the override prop distance with offset
- <Tooltip overrides={{distance: 'space020'}>Content</Tooltip>
+ <Tooltip overrides={{offset: 'space020'}>Content</Tooltip>
caption-insetCaptionInset has been removed in favour of Caption. Using this script the same functionality can be achieve by adding paddingBlock and paddingInline as overrides.
- <CaptionInset />
+ <Caption overrides={{paddingBlock: "space040", paddingInline: "space040"}} />
The following transformers are available when upgrading to v6:
emotion-iconsremove-redundant-marker-ulupdate-list-item-marker-ul-valueenum-to-unionupdate-linkinlineupdate-linkstandaloneemotion-iconsImports and transform newskit icons to emotion-icons;
- import { IconFilledAccountTree } from 'newskit';
+ import { toNewsKitIcon } from 'newskit';
+ import {AccountTree as FilledAccountTree} from '@emotion-icons/material/AccountTree';
+ const IconFilledAccountTree = toNewsKitIcon(FilledAccountTree);
npx @newskit/codemod v6.0.0/emotion-icons [path]
// example
npx @newskit/codemod v6.0.0/emotion-icons 'components/**/*.+(ts|tsx|js|jsx)'
remove-redundant-marker-ulUnordered List has now a default marker, removes the prop passing the same icon now set as default.
- <UnorderedList listItemMarker={IconFilledCircle}>{listData}</UnorderedList>
+ <UnorderedList >{listData}</UnorderedList>
update-list-item-marker-ul-valueUnordered List has now a default marker, the script passes listItemMarker with a value of null to UnorderedList components originally not passing any marker.
- <UnorderedList></UnorderedList>
+ <UnorderedList listItemMarker={null}></UnorderedList>
enum-to-unionSome of NewsKit components support enum as the prop type, the script remove the imports of enum and replace enum type with union type.
- <Button size={ButtonSize.Small}>Button</Button>
+ <Button size="small">Button</Button>
update-linkinlineUpdates deprecated Link component to LinkInline. LinkInline is used within paragraphs or sentences to link to different content on the same page or other pages.
- import {Link} from 'newskit';
- <Link href={'www.google.com'}>Click on me</Link>;
+ import {LinkInline} from 'newskit';
+ <LinkInline href={'www.google.com'}>Click on me</LinkInline>;
update-linkstandaloneUpdates deprecated Link component to LinkStandalone. LinkStandalone is used outside of body content, for example within navigational components such as menus, headers and footers.
- import {Link} from 'newskit';
- <Link href={'www.google.com'}>Click on me</Link>;
+ import {LinkStandalone} from 'newskit';
+ <LinkStandalone href={'www.google.com'}>Click on me</LinkStandalone>;
yarn install
Link this package in your global node_modules by running:
cd lib/codemod
yarn link
Run the codemod package locally:
newskit-codemod [codemod [path]
FAQs
You can use this CLI tool to run various scripts (codemods) that will help update NewsKit APIs
We found that @newskit/codemod demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.