Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
crs-codemod
Advanced tools
A collection (only one for now) of Codemod transformations to help you upgrade your codebase when a Chakra React Select feature is 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.
These codemods are based on
the codemods offered by Next.js,
and are written using jscodeshift
.
In your terminal, navigate (cd
) into your project's folder, then run:
npx crs-codemod <transform> <path>
Replacing <transform>
and <path>
with appropriate values.
transform
- name of transformpath
- files or directory to transform--dry
Do a dry-run, no code will be edited--print
Prints the changed output for comparisonv5
)npx crs-codemod v5 .
# or
npx crs-codemod v5 ./src
NOTE: This codemod currently has a side effect where it removes any TypeScript generics you pass into your
Select
components. This appears to be a shortcoming ofjscodeshift
, as it appears not to recognize generics used in JSX. While in most cases you shouldn't need generics in order for your component to be typed properly, there are some edge cases where they are necessary. If you have a need for them, you should either add them back in after the codemod is run, or manually make the following transformations.
This codemod runs on all versions of the Select
component (Select
,
AsyncSelect
, AsyncCreatableSelect
, CreatableSelect
), and performs the
following modifications to your every instance of them:
useBasicStyles
prop.
v5.0.0
.selectedOptionColor
to selectedOptionColorScheme
.
v4.6.0
to reduce confusion about what values can be passed to it. It has been fully
removed in v5.0.0
.hasStickyGroupHeaders
prop
v4.6.0
as well due to it not working properly with keyboard navigation, and being
outside the scope of the intentions for this project. It has also been fully
removed in v5.0.0
.This codemod will only work for props that are added directly to a Select
instance. If you have a shared props object, you will have to make these changes
manually.
FAQs
A set of codemods for chakra-react-select
The npm package crs-codemod receives a total of 1 weekly downloads. As such, crs-codemod popularity was classified as not popular.
We found that crs-codemod demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.