With this script you have a template for create react components with some default files as:
Template example:
Component
├── index.js
├── Component.jsx
├── Component.css
├── Component.test.js
You can create your own template and have support for
Typescript's components
and to usescss
orsass
; you can also select if you want to use anindex file
,style file
,test file
and if you want your componentinside a folder
orno
- Clone the repository
git clone https://github.com/isaacismaelx14/Project-Manager-CLI.git
cd ./Project-Manager-CLI
- Install
create_component
module
python setup.py install
Create a component with default
configuration
create_component <compnent name>
-c
, --config
: Create a configuration file.
Example:
create_component -c
-d
, --destination
: Change the default destination.
Example:
create_component <component name> -d <path>
You can use the comand
create_component -c
to create the configuration file.
PManager.json
{
"dir": "src/components",
"lang": "react",
"component": {
"lang": "js",
"component_file_type": "jsx",
"style_type": "css",
"use_test": true,
"use_folder": true,
"use_index": true
}
}
lang attribute
is not supported yet.
Key | Type | Value | Description |
---|---|---|---|
dir | String | * | Path of the folder where you want to create your components |
lang | String | react | angular | vue.js |
NOT SUPPORTED . This will be used for define the type of component that your project use. Exp: react , angular or vue.js . Now only support for react |
component | Object | lang | component_file_type | use_test | use_folder | use_index |
contain the component configuration |
Key | Type | Value | Description |
---|---|---|---|
lang | String | js | ts |
define the language of your project js for Javascript and ts for Typescript |
component_file_type | String | jsx | js | tsx |
define if you want to use js file for your components or jsx file. (if your componet -> lang is ts default is tsx ) |
use_test | Boolean | true | false |
define if you want to create and test file for unit test |
use_folder | Boolean | true | false |
define if you want that your component's files are inside and folder |
use_index | Boolean | true | false |
define if you want that your component's folder have an index file to link to your component (useful is you are using a lot of components) |
- Now you can install the CLI in your system
- create support for
angular
andvue.js
components.
version 1.2
With 💖 by isaacismaelx14