Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
react-route-generator
Advanced tools
This is the MVP of the code generator for route types that are written in https://github.com/pillarjs/path-to-regexp which is what react-router uses internally.
The generated types can be used to type generic Route
component props
$ yarn add react-route-generator
Or
$ npm i react-route-generator
Add routegen.yml
to project root. Example:
apps:
client:
routes:
login: /app/login
signup: /app/signup
logout: /app/logout
me: /app/me
routingType: ReactRouter
destinationDir: client/src/routes
client-seo:
routes:
home: /
routingType: NextJS
destinationDir: client-seo/src/routes
# Use on of these options below if you want to custom how Link is created
reactRouterLinkCreatorPath: src/common/ui/createCustomReactRouterLink
nextJSLinkCreatorPath?: src/common/ui/createCustomNextJSLink
defaultLinkCreatorPath?: src/common/ui/createDefaultLink
$ yarn routegen
Or
$ npx routegen
We need to build from TS -> JS to be able to run the generator. For the changes to reflect, after making changes in src
, run the following:
$ yarn run build
$ yarn run generate
$ yarn run test:cli
tests/output
folder for nowcreateRoute
function which uses the generated types to generate the route objectsindex.ts
into smaller filescreateLink
as a function so route & link always have the same function.FAQs
Route generator
The npm package react-route-generator receives a total of 3 weekly downloads. As such, react-route-generator popularity was classified as not popular.
We found that react-route-generator 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.