当前位置: 首页 > 软件库 > Web应用开发 > >

create-react-redux-app-structure

授权协议 MIT License
开发语言 JavaScript
所属分类 Web应用开发
软件类型 开源软件
地区 不详
投 递 者 诸葛砚文
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

Create React Redux App Structure

MIT Licence

Create React + Redux app structure with build configurations.

What can I find here?

  • Express, Cors
  • React + Redux, ES6, async/await
  • Web Components (Custom Elements) integration
  • React Router
  • Internationalization
  • SASS
  • PostCSS (autoprefixer), so you do not need -webkit, -moz or other prefixes
  • Build script configuration Development, Staging, Production with CDN, cache-busting support
  • Build script to bundle JS, CSS, with sourcemaps
  • Unit tests Jest, Enzyme
  • E2E Cypress tests
  • ESLint
  • Ghooks (pre-commit with unit tests and eslint validation)
  • Code Coverage (https://codecov.io)
  • Travis CI runs Unit and E2E tests and report to codecov

Quick Start

Create React + Redux app structure works on macOS, Windows, and Linux.If something doesn’t work, please file an issue.

npm

npm i -g create-react-redux-app-structure

yarn

yarn add global create-react-redux-app-structure

create-react-redux-app-structure my-app
cd my-app/
npm run fast-start

http://localhost:8080/ will be opened automatically.

When you are ready to deploy to staging/production please see Build Scripts section.

Getting Started

You will need to have Node >= 6 on your local development machine and Yarn installed.

Install it once globally:

npm

npm i -g create-react-redux-app-structure

yarn

yarn add global create-react-redux-app-structure

Patience, please. It takes time, most of it is spent installing npm packages.

Creating an App

To create a new app, run:

create-react-redux-app-structure my-app
cd my-app/

It will create a directory called my-app inside the current folder.

Prepare config.json for build configurations

For running builds you need to have config.json in app/ folder.So you can create new one or rename app/config.json.example.

Inside that file:

  • PATHS is used in Grunt and Gulp tasks
  • assetHost CDN path for each build
  • serverHost is used for running e2e Cypress tests

Installation

npm install or yarn install

You can run npm run fast-start script, it will install all npm packages, run dev build, server and open http://localhost:8080/

Run build script

Have a look at Build Scripts section

Run server

node index.js or npm run server

Then open http://localhost:8080/ to see test weather app :)

Build scripts

Development - npm run dev or yarn run dev

Production - npm run prod or yarn run prod

Staging - npm run staging or yarn run staging

Tests

Unit - npm run test or yarn run test

Unit with watch - npm run test:watch or yarn run test:watch

E2E - npm run e2e or yarn run e2e

Coverage is here - app/tests/tests/coverage/Icon-report/index.html

Automation tests

Let's imagine that for automation tests we need to get access to the Redux store.We can do that by adding to the window object property with reference to the store. For e.g. in app.jsx file.Automation tests run only in staging, so for production build we remove them out by Grunt task strip_code

/* staging-code */
window.store = store;
/* end-staging-code */

Tips

Kill all node processes:

  • MacOS sudo killall -9 node
  • Windows (cmd) taskkill /f /im node.exe

Detailed description about features and approaches

Contributing

I would love to have your help.

If you have an idea how to improve or found an issue please read the Contributions Guidelines before submitting a PR.Thanks!

License

MIT © Vasyl Stokolosa

  • Hello everyone! With the recent release of create-react-app v3 and React hooks, I decided to write a tutorial on how to refactor a class component to a functional hooks component. 大家好! 随着最近发布的create-r

  • by Arnel Enero 通过Arnel Enero 如何简化React应用程序中的状态-轻松实现Redux (How to simplify state in your React app — Redux with a twist) 良好的旧Redux的新的,更容易的语法和语义 (New, much easier syntax and semantics for good old Redux

  • by Andrea Bizzotto 通过安德里亚·比佐托(Andrea Bizzotto) 使用Redux在React Navigation App中管理状态 (Managing State in a React Navigation App with Redux) In this tutorial, I will show how to manage navigation and applic

  • by Panagiotis Vrs 通过Panagiotis Vrs 从AngularJS到React&Redux —如何迁移您的Web应用 (From AngularJS to React & Redux — how to migrate your web app) Some days ago I wanted to start implementing something I had in m

 相关资料
  • Create React App 不用配置就可以创建 React App。 全局安装: npm install -g create-react-app 创建 App: create-react-app my-appcd my-app/ 启动 npm: npm start 打开 http://localhost:3000/  查看你的 App。 如果你准备将其部署到生产环境,只需创建一个压缩包,并且运行 npm run build。

  • Create React Native App The fastest way to create universal React Native apps npx create-react-native-app Once you're up and running with Create React Native App, visit this tutorial for more informat

  • create-react-app React Project with Node Express Backend Example on using create-react-app with a Node Express Backend Usage Install nodemon globally npm i nodemon -g Install server and client depende

  • 创建响应应用时,图像中出现错误。它一直在正常工作,我所做的就是mkdir和cd到那个dir。 这就是错误的样子... NPX:在36.634s中安装了99必须使用导入来加载ES模块: C:\用户\Neeraj\AppData\漫游\npm-cache_npx\5172\node_modules\create-react-app\node_modules\is-promise\index.js不支持

  • 问题如下: 想要在React 项目执行yarn build 时, 给index.html 增加后缀 没有使用react-eject, 使用的是crao 替代, 但是craco.config.js 配置 HtmlWebpackPlugin不生效。 craco.config.js 配置如下: package.json 部分组件版本如下: 执行yarn build 打包后,配置无效, 请教各位大佬们了

  • 问题内容: 我正在尝试在Google App Engine上部署使用create-react-app创建的应用程序。 我的应用程序在本地(和)都可以正常运行。但是,在Google App Engine上部署的应用程序仅显示index.html,并且不会调用我的react代码。 Chrome开发者控制台显示。 另外,我在console.cloud.google.com上发现,已部署的应用程序不包含构