GithubHelp home page GithubHelp logo

ms-dg / create-dg-react Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebook/create-react-app

4.0 2.0 0.0 16.59 MB

Set up a modern web app by running one command.

License: MIT License

JavaScript 70.39% CSS 1.03% HTML 1.34% Shell 21.25% TypeScript 4.45% SCSS 1.44% Sass 0.10%

create-dg-react's Introduction

Create DG React apps with no build configuration.

Create DG React App works on macOS, Windows, and Linux.

Quick Overview

npm create dg-react dg-app
cd dg-app
npm start

If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app or yarn global remove create-react-app to ensure that npx always uses the latest version.

(npx comes with npm 5.2+ and higher, see instructions for older npm versions)

Then open http://localhost:3000/ to see your app.
When you’re ready to deploy to production, create a minified bundle with npm run build.

Get Started Immediately

You don’t need to install or configure tools like webpack or Babel.
They are preconfigured and hidden so that you can focus on the code.

Create a project, and you’re good to go.

Creating an App

You’ll need to have Node 10.16.0 or later version on your local development machine (but it’s not required on the server). You can use nvm (macOS/Linux) or nvm-windows to switch Node versions between different projects.

To create a new app, you may choose one of the following methods:

npm

npm create dg-react dg-app

npm create <initializer> is available in npm 6+

(or npx create-dg-react dg-app with npx is a package runner tool that comes with npm 5.2+ and higher, see instructions for older npm versions)

Yarn

yarn create dg-react dg-app

yarn create <starter-kit-package> is available in Yarn 0.25+

Default template files

It will create a directory called dg-app inside the current folder.
Inside that directory, it will generate the initial project structure and install the transitive dependencies:

dg-app
├── azure-pipelines.yml # Azure piplines CI/CD entry point
├── README.md
├── package.json
├── .gitignore
├── .azure-devops/ # azure piplines config and templates
|
├── public/ # static resources
│   ├── favicon.ico
│   ├── index.html
│   └── manifest.json
│
└── src/ # source code
    ├── App.scss
    ├── App.tsx
    ├── App.test.tsx
    ├── index.scss
    ├── index.tsx
    ├── logo.svg
    └── serviceWorker.ts

No configuration or complicated folder structures, only the files you need to build your app.
Once the installation is done, you can open your project folder:

cd dg-app

Inside the newly created project, you can run some built-in commands:

npm start or yarn start

Runs the app in development mode.

Open http://localhost:3000 to view it in the browser.

The page will automatically reload if you make changes to the code.

You will see the build errors and lint warnings in the console.

Build errors

npm test or yarn test

Runs the test watcher in an interactive mode. By default, runs tests related to files changed since the last commit.

Read more about testing.

npm run build or yarn build

Builds the app for production to the build folder.
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.

Your app is ready to be deployed.

User Guide

You can find detailed instructions on using Create DG App and many tips in Create React App documentation (almost the same behaviors).

How to Update to New Versions?

if you want to update current project (already exists)

update the dependency @dragongate/react-scripts to lasted in your app project.

if you want to create a new project

create a app without global install.

Multi Entities

Add APP_INDEX=src/Entry1,src/Entry2 in your configuration (.env)

Philosophy

  • One Dependency: There is only one build dependency. It uses webpack, Babel, ESLint, and other amazing projects, but provides a cohesive curated experience on top of them.

  • No Configuration: You don't need to configure anything. A reasonably good configuration of both development and production builds is handled for you so you can focus on writing code.

What’s Included?

Your environment will have everything you need to build a modern single-page React app with git:

  • Integrated with Azure pipelines (build/test/env).
  • Shared vscode (IDE) config and plugins.
  • Force lint rules on build and staged check.
    • stylelint for css style
    • eslint for js/ts/jsx
  • prettier integration.
  • Git hook support for commit and push.
  • Cross-Platform VSTS auth
  • React, JSX, ES6, TypeScript syntax support.
  • Language extras beyond ES6 like the object spread operator.
  • Autoprefixed CSS, so you don’t need -webkit- or other prefixes.
  • A fast interactive unit test runner with built-in support for coverage reporting.
  • A live development server that warns about common mistakes.
  • A build script to bundle JS, CSS, and images for production, with hashes and sourcemaps.
  • An offline-first service worker and a web app manifest, meeting all the Progressive Web App criteria.
  • Hassle-free updates for the above tools with a single dependency.

The tradeoff is that these tools are preconfigured to work in a specific way. If your project needs more customization, you can "eject" and customize it, but then you will need to maintain this configuration.

License

MIT

create-dg-react's People

Contributors

newfuture avatar gaearon avatar dependabot-preview[bot] avatar timer avatar iansu avatar selbekk avatar ianschmitz avatar dependabot[bot] avatar fson avatar vjeux avatar viankakrisna avatar andriijas avatar wahan2019 avatar mxstbr avatar mrmckeb avatar tharakawj avatar amyrlam avatar brunolemos avatar jeffposnick avatar enoahnetzach avatar existentialism avatar arcanis avatar ro-savage avatar xiaoxiangmoe avatar heyimalex avatar bondz avatar ddddddavid avatar greengremlin avatar ryansully avatar sidoshi avatar

Stargazers

 avatar  avatar Justin Hebb avatar Ivan Ganev 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.