Giter Site home page Giter Site logo

ams-dg5's Introduction

AMS For DG5

Introduction

This project is based on DRC starter kit, DRC starter kit is a environment for establishing your project quickly. There are many build-in features, like scaffolding, hot-reload, code splitting etc. If you want to adjust starter kit for fit your scenario, it retains many flexibility for you.

DRC starter kit

build status. coverage report

For more information, please visit our gitbook: http://10.136.225.86:3003/book/drc-starter-kit/

Features of DRC starter kit

  • ๐Ÿ‘ Hot reloading
  • ๐Ÿ‘ Scaffolding
  • ๐Ÿ‘ Code splitting
  • ๐Ÿ‘ Redux devtool is supported
  • ๐Ÿ‘ Integration with lint testing, unit testing and coverage testing
  • ๐Ÿ‘ Integration with browser compatibility
  • ๐Ÿ‘ Multi style loader supported
  • ๐Ÿ‘ Integration complex settings with one file
  • ๐Ÿ‘ Nice flexibility for extension
  • ๐Ÿ‘ Using modern plug-ins (React-router, React etc.)

Requirements

node ^5.0.0

yarn ^0.23.0 or npm ^3.0.0

Installation

Now, you can clone our repo by:

git clone http://10.120.137.178/wfatec/AMS-dg5.git

Then, you need to install some dependencies:

cd AMS-DG5;
npm install  # Install project dependencies (or `yarn install`)

It's done!

Running the Project

After completing the installation step, you're ready to start the project!

npm start  # Start the development server (or `yarn start`)

While developing, you will probably rely mostly on npm start; however, there are additional scripts at your disposal:

Script (also yarn) Description
npm start Start compile your project. The default serve url would be: http://localhost:3000
npm run quick Call scaffolding to generate template file
npm run build build your project as production (minify, hash etc). The default output root is dist
npm run test Testing your codes. This command will run lint testing and unit testing at same time
npm run test:unit Run unit testing alone
npm run test:unit:watch Run unit testing in watching mode (Trace your changing in testing immediately)
npm run test:lint Run lint testing alone
npm run test:lint:fix Run lint testing with automatically fixing errors
npm run test:lint:report Run lint testing and output result as a report. The default path of report is reports
npm run test:coverage Run coverage testing and output report in reports directory
npm run release Release your codes with test, build. If passed, the version tag and codes will be pushed into repo

Besides, there are many options you can attach after your command:

Option Description
--indir The entry directory of your main codes in your project. Default is src.
--main The file name of the application's entry point. Default is main
--outdir The name of the directory in which to emit compiled assets. Default is dist
--testdir The name of the testing entry directory. Default is tests
--reportdir The name of the testing output report directory. Default is reports
--template The template of html. It will be used if the configuration of html is true. Default is index.html
--port The port of the server. Default is 3000.
--publicpath The base path for all projects assets (relative to the website root). Default is '/'
--sourcemaps Whether to generate sourcemaps. Default is false
--externals A hash map of keys that the compiler should treat as external to the project. Default is {}
--globals A hash map of variables and their values to expose globally. Default is {}
--outputlint Whether to output the lint report. Default is false.
--fixlint Whether to fix the lint error automatically. Default is false.
--verbose Whether to enable verbose logging. Default is false.
--dsiableless Whether to disable less loader. Default is false.
--dsiablecss Whether to disable css loader. Default is false.
--dsiablescss Whether to disable scss loader. Default is false.
--dsiabletext Whether to disable text loader. Default is false.
--dsiableimage Whether to disable image loader. Default is false.
--dsiablefont Whether to disable font loader. Default is false.
--dsiablehtml Whether to disable html loader. Default is false.
--polyfill Assign the location of polyfill. By default, the babel-polyfill will be used.
--imagesize The limit of image size. Default is 8192.
--fontsize The limit of font size. Default is 10000.
--threshold The setting of the coverage threshold. Default is { statements: 50, branches: 50, functions: 50, lines: 50}
--vendors The list of modules to bundle separately from the core application code.

All of default setting can be modified in project.config.js of root.

Project structure

The project structure is designed by functionality of Redux-React. For more introduction of this structure can visit the offical website of Redux: connect. If you want to modify the folder structure, please feel free to do that. There is no constraint in project structure of our starter kit.

.
โ”œโ”€โ”€ build                      # All build-related code
โ”‚   |โ”€โ”€ configs                # All configuration files
โ”‚   โ”‚   โ”œโ”€โ”€ jest.config.js     # The configuration of Jest
โ”‚   โ”‚   โ””โ”€โ”€ postcss.config.js  # You can put your settings here to do some post css prefix
โ”‚   |โ”€โ”€ lib                    # All libraries used in scripts
โ”‚   โ”‚   โ”œโ”€โ”€ logger.js          # A logger script for printing pretty log
โ”‚   โ”‚   โ””โ”€โ”€ path.js            # A path script for handling path issue in script
โ”‚   |โ”€โ”€ scaffold               # All Scaffold setting files and script files
โ”‚   โ”‚   โ”œโ”€โ”€ **                 # Template of scaffolding
โ”‚   โ”‚   โ”œโ”€โ”€ start.js           # The entry point of scaffold script
โ”‚   โ”‚   โ””โ”€โ”€ validate.js        # A script for checking if file is exised
โ”‚   |โ”€โ”€ scripts                # All build-related scripts
โ”‚   โ”‚   โ”œโ”€โ”€ compile.js         # A script for handling code compiling
โ”‚   โ”‚   โ”œโ”€โ”€ eslint.js          # A script for handling lint checking
โ”‚   โ”‚   โ””โ”€โ”€ start.js           # A script for starting building server
โ”‚   |โ”€โ”€ server                 # Express application that provides webpack middleware
โ”‚   โ”‚   โ””โ”€โ”€ main.js            # Server application entry point
โ”‚   โ””โ”€โ”€ webpack.config.js      # Configuration of webpack
โ”œโ”€โ”€ public                     # Static public assets (not imported anywhere in source code)
โ”œโ”€โ”€ src                        # Application source code
โ”‚   โ”œโ”€โ”€ actions                # All of business logics for components
โ”‚   โ”œโ”€โ”€ assets                 # Fonts, images, svgs, csvs etc. All kinds of files used in pages.
โ”‚   โ”œโ”€โ”€ components             # Global reusable components
โ”‚   โ”œโ”€โ”€ containers             # Global reusable container components
โ”‚   โ”œโ”€โ”€ hocs                   # Global reusable higher order components
โ”‚   โ”œโ”€โ”€ layouts                # Components that dictate major page structure
โ”‚   โ”œโ”€โ”€ models                 # Data structure definition of reducer
โ”‚   โ”œโ”€โ”€ reducers               # A center to decide how to update state
โ”‚   โ”œโ”€โ”€ routes                 # Main route definitions and async split points
โ”‚   โ”œโ”€โ”€ store                  # Redux-specific pieces
โ”‚   โ”‚   โ””โ”€โ”€ createStore.js     # Create and instrument redux store
โ”‚   โ”œโ”€โ”€ index.html             # Main HTML page container for app
โ”‚   โ””โ”€โ”€ main.js                # Application bootstrap and rendering
โ””โ”€โ”€ tests                      # Unit tests

Create you own scaffolding

Allows you to auto-generate boilerplate code for common parts of your application. Feel free to modify or create a new template in build/scaffold.

Testing

To add a unit test, create a .spec.js file anywhere inside of ./tests. Jest and webpack will automatically find these files, and Enzyme will be available within your test without the need to import them.

Maintainers


chuck.wu

chao.wang

ams-dg5's People

Contributors

hongxiaomin avatar

Watchers

James Cloos avatar  avatar

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.