Giter Site home page Giter Site logo

2018-typescript-react-app's Introduction

Typescript React App (TGRStack)

TypeScript React Apollo WebPack Node

TSLint TS-Jest

NPS friendly Commitizen friendly Semver friendly

About

This starter kit is a launching point for TS React module development. Running the build script compiles src/ into a build that is ready to be deployed to a server. This module is part of a collection of uniformly built starter-kits designed for large-scale application development with TypeScript, GraphQL, and React. Find these, articles, and examplse at www.TGRStack.com. Skip to the bottom for links to a series of tutorials that walkthrough the creation of this module.

Commands - READ THIS

* nps                   # Executes the module, watching for rebuilds.
* nps help              # Displays all available commands
* nps commit            # Creates a commit, don't use `git commit -m ...`
* nps build             # Builds the module
* nps lint              # Lint checks the module
* nps test              # Test checks the module

Features

Core

  • ๐Ÿš€ ES2018+ support syntax that is stage-3 or later in the TC39 process.
  • ๐ŸŽ› Preconfigured to support development and optimized production builds
  • ๐ŸŽถ typescript incremental returns reducing development bugs
  • ๐Ÿšฆ tslint configured for strict, consistent, code style

GraphQL

  • ๐Ÿ’Ž apollo-client w/ link-state instead of react-redux

React

  • ๐Ÿ‰ React 16+
  • ๐Ÿ‘พ HMR reloads the Changed Code w/o refreshing the entire page

CSS

  • ๐ŸŒ… typings-for-css-modules-loader replaces 'css-loader' for webpack
  • ๐ŸŽ  typings-for-css-modules-loader generates d.ts for css files
  • ๐ŸŒ‡ sass-loader adds vars, imports, heirarchies to css.

Tests

  • ๐ŸŽญ jest as the test framework.
  • ๐ŸŽญ ts-jest configured to test TS files, uses tsconfig.jest.json, and skip babel.
  • ๐ŸŽญ enzyme makes it easier to assert, manipulate, and traverse components.
  • ๐ŸŽญ react-testing-library maintainable tests that avoid impl. details.
  • ๐ŸŽญ jest-dom patterns for dom testing, compat w/ react-testing-library.

Build (w/ Webpack)

  • ๐Ÿ“ฆ All source is bundled using Webpack v4
  • ๐ŸŒŸ webpack for dev, prod, common
  • ๐Ÿšฆ ts-loader for compiling typescript
  • ๐Ÿšฆ webpack-graphql-loader for separating gql from ts files
  • ๐Ÿ’ฆ babel-loader for additional polyfills (browser support)
  • ๐Ÿ˜Ž HappyPack
  • ๐Ÿค– Auto generated Vendor DLL for smooth development experiences
  • ๐Ÿƒ Tree-shaking

Utils

  • ๐ŸŽฎ nps node-package-scripts removes the limitation of package.json enabling JS & //comments . Modify /package-scripts.js and use nps <command> instead of npm run <command>.
  • ๐Ÿ™Œ commitizen to help us generate beautifully formatted and consistent commit messages.
  • ๐Ÿ˜น cz-emoji is a plugin for commitizen that adds emoji to the commit template.
  • ๐Ÿ† standard-version is a replacement for npm version with automatic CHANGELOG generation
  • โœ… commitlint validates commit messages to follow commitizen patterns

Getting started

To use the starter-kit to build your own ts-module run these commands:

git clone https://github.com/Falieson/2018-typescript-module.git my-project
cd my-project
rm -rf .git && git init
git commit -m "INIT'd w/ Falieson's 2018-typescript-module@SHA4985"
npm install
nps test
nps

Open package.json and reset following fields:

- name
- version ( It is recommended to start from 1.0.0 )
- description
- main ( "umd/typescript-lib-starter.js" => "umd/{name}.js" )
- repository.url
- author
- license ( use whatever you want )

Now go make some changes to src/index.ts to see the tooling in action.

Stack

Docs

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.