Giter Club home page Giter Club logo

create-compositive-react-app-cli's Introduction

create-compositive-react-app-cli

npm 源地址:同 git 仓库名

https://juejin.cn/post/6951330074905804814

Introduction 脚手架介绍

减少从 0 到 1 搭建项目的成本,快速开发项目

create-react-app v4.0.3脚手架基础上,增加了如下项目配置可选项

  • React-Redux + Redux-Thunk + Redux-Logger
  • React-Router (可选择History, Hash模式)
  • Linter / Formatter (目前提供了Eslint + EditorConfig + Prettier + CommitLint

完成模板创建后,自动安装依赖。

Getting started 快速使用

  • 推荐使用 npx create-compositive-react-app-cli init <your project name>
  • 也可使用 npm i -g create-compositive-react-app-cli ccra init <your project name>

Usage 使用方法

快速搭建项目

ccra init <name>

配置项有 3 种可选项:

  • Redux
  • React-Router (可选择 History, Hash 模式)
  • Linter / Formatter (目前提供了 Eslint + EditorConfig + Prettier + CommitLint)
快速创建 Page、Component 模板

ccra create

可以在 CLI 中自行选择创建 PageComponent 输入 name 后即可完成模板自动创建

Template Structures 模板结构

├─.editorconfig
├─.eslintignore
├─.eslintrc.js
├─.prettierrc.js
├─README.md
├─commitlint.config.js
├─package.json
├─src
|  ├─App.js
|  ├─index.js
|  ├─views
|  |   ├─login
|  |   |   ├─login.jsx
|  |   |   └login.module.scss
|  ├─utils
|  |   └index.js
|  ├─styles
|  |   ├─index.scss
|  |   ├─modules
|  |   |    ├─function.scss
|  |   |    ├─global.scss
|  |   |    ├─mixin.scss
|  |   |    └variables.scss
|  ├─store
|  |   └store.js
|  ├─routes
|  |   ├─routes.jsx
|  |   └routesConfig.jsx
|  ├─reducers
|  |    ├─reducers.js
|  |    ├─module
|  |    |   └auth.js
|  ├─layouts
|  |    ├─BasicLayout
|  |    |      ├─BasicLayout.jsx
|  |    |      └BasicLayout.module.scss
|  ├─constants
|  |     └constants.js
|  ├─components
|  |     ├─Widget
|  |     |   ├─widget.jsx
|  |     |   └widget.module.scss
|  ├─actions
|  |    ├─actions.js
|  |    ├─module
|  |    |   └auth.js
├─public
|   └index.html

Features 功能介绍

  • 一键快速创建Page组件
  • 一键快速创建Components组件
  • ccra init <name>进行初始化项目时,通过Inquirer库的功能,提供给用户各类可选项,可以根据用户所需配置,进行项目自动化构建。
    • 注:状态管理暂时仅提供Redux模板
    • 路由管理提供React-Router v5模板
  • 自动安装所需要的@types文件,即便用户使用JavaScript进行开发,也能在vscode IDE下得到函数提示支持

Contact me 联系我

wechat:actuallys

create-compositive-react-app-cli's People

Contributors

ericlee33 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

jinjinhrb

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.