Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-route-generator

Package Overview
Dependencies
Maintainers
1
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-route-generator

Route generator

  • 0.0.4
  • npm
  • Socket score

Version published
Weekly downloads
3
increased by200%
Maintainers
1
Weekly downloads
 
Created
Source

react-route-generator

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

Build it!

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:

npm run build

Run it!

npm run generate

Or Do it all in one command!

npm run integration

How it works

  • Reads in the config
  • Go through each "app"
  • Look at the routes it needs to generate and destination folder
  • Generate each route into its own file in the destination folder ( this helps codesplitting )
  • The files are generated into tests/output folder for now

TODO

  • Bring over createRoute function which uses the generated types to generate the route objects
  • Break index.ts into smaller files
  • Handle inter app routing
  • Handle NextJS routing
  • Add yaml file for config
  • Make this CLI
  • Publish this

Keywords

FAQs

Package last updated on 17 Feb 2020

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc