0.1.5 • Published 2 years ago

rtwister v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

rtwister

rtwister is a cli tool built for react apps to generate react components and other useful seperate files (eg. hooks).

Installation


npm install rtwister -g or yarn global add rtwister

Usage


To use rtwister just type rtwister <commands> in your terminal.

CommandsDescription
fcFor functional components
fFor simple function file
hFor hook file
--help or -hFor help

Example

CommandsExample
fcrtwister fc <component_name> <relative_path>
frtwister f <function_name> <relative_path>
hrtwister h <hook_name> <relative_path>
Functional component

rtwister fc Boo ./Foo/Faa, this command will generate required scalable files for a functional component.

|-- /Foo
    |-- /Faa
        |-- /Boo
            |-- Boo.tsx
            |-- Boo.model.tsx
            |-- Boo.styles.ts
            |-- Boo.constants.ts
            |-- Boo.view.tsx

FileDescription
Boo.tsxYour main FC file
Boo.model.tsxThis file will have your business logic
Boo.view.tsxYour view or JSX file
Boo.styles.tsxYour CSS module file
Boo.constants.tsHere FC constants

Why such file structure?

  • Tons of lines of code hurts your eyes.
  • Imagine 10000+ line of a code in just a single file.
  • Searching\debugging becomes a mess.
  • Before adding something new in between will make you think twice.
  • Managing your components can become a mess.

After using rtwister

  • Your FC will split into seperate files.
  • Less line of a code in a file
  • Business logic, styles and view will be in a seperate file.
  • Wanna make some changes in view file, you know where to find.
  • Change in business logic, directly switch to model file and make the required changes.
  • Reviewing such FC code becomes damn easy.

#Project in progress...

0.1.5

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.1.0

2 years ago

0.0.1-beta.0.2

2 years ago

0.0.1-beta.0.1

2 years ago

0.0.201-beta.2

3 years ago

0.0.201-beta.1

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago