Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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 28 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.