@ebsolutions/generate-react-templates v1.7.2
Generate React Templates
This package is used to generate React template files for a component, container, or page (NextJS). The container and component files returned can be either Typescript or Javascript depending on the flag passed.
Usage
Install the package using npm or yarn:
npm install @ebsolutions/generate-react-templates --saveDevor
yarn add @ebsolutions/generate-react-templates --devRun the desired command to generate the applicable template(s):
node ./node_modules/@ebsolutions/generate-react-templates --type=COMP --name=taco
node ./node_modules/@ebsolutions/generate-react-templates --type=CONT --name=taco
node ./node_modules/@ebsolutions/generate-react-templates --type=PAGE --name=tacoNOTE: Adding --useTypescript==true to the CONT and COMP types will return Typescript (.tsx and .ts) files.
Example return value:
The package creates a the following file(s) and places them into their corresponding directory.
Page
Creates a page in the pages/ directory as shown below:
src/pages/page-name.jsContainer
Creates a container (Typescript or Javascript) in the containers/ directory with file structure below:
containers/name-container/
- name-container.jsx`
- index.js
- name-container.module.scssComponent
Creates a component (Typescript or Javascript) in the components/ directory with file structure below:
components/name-component/
- name-component.jsx`
- index.js
- name-component.module.scssFinshing touches
- Getting scripts to populate
package.jsonon install- "gen:comp": "node ./node_modules/@ebsolutions/generate-react-templates --type=COMP --name=taco"
- "gen:cont": "node ./node_modules/@ebsolutions/generate-react-templates --type=CONT --name=taco"
- "gen:page": "node ./node_modules/@ebsolutions/generate-react-templates --type=PAGE --name=taco"
Enhancements
- Get
npxcommand to work or add a script to package.json that calls node ./node_modules/etc. - Testing
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago