Skip to content

TGRstack/skeleton-ts-service

Repository files navigation

TS-service | skeleton | TGRstack

TypeScript WebPack Node

TSLint TS-Jest

NPS friendly Commitizen friendly Semver friendly

Packages

  "devDependencies": {
    "@tgrx/tslint-config-tgr": "5.0.0", # TGR - tslint settings for minimial clutter

Using TS-Service as an upstream for other Skeletons

The main reason for this repo is to use as an upstream for other service-skeletons like: TGR-Fullstack, TG-API, and TR-Storybook. There are also module-skeletons the key difference being exportable/consumable.

skeleton-ts-service         - the root service (this)
├── skeleton-tr-api         - graphql api service
├── skeleton-tgr-fullstack  - fullstack service
└── skeleton-tr-storybook   - storybook service designed to consume React & TS modules

Developing a TS-Service

After you've cloned this repo and ran npm i -D, do the following:

in your terminal:

$ nps ss                # Start the dev server

Commands

* nps                   # Executes all the tooling
* 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

Stack

Docs

File Structure

src/
├── middlewares/  - third-party HOC functionality (apollo, loggers, routers)
└── modules/      - first-party modules (co-developed)
    └── some-lib  - pre-cursor to extracting a module
├── service/      - service initialization (express, apollo, storybook)
├── types/        - ts modules, common, interfaces
├── utils/        - useful functions
└── stack.ts      - import service & middlewares

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

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

Style

  • 🚦 tslint configured for strict, consistent, code style
  • 🚦 2019 eslint replacing TSLint
  • 🚦 ts-prettier for some of that code-consistancy that's missing from tslint
  • 🚦 SonarTS Static code analyzer detects bugs and suspicious patterns

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.

Build (w/ Webpack)

  • 📦 All source is bundled using Webpack v4
  • 🌟 webpack for dev, prod, common
  • 🚦 ts-loader for compiling typescript
  • 💦 babel-loader for additional polyfills (browser support)
  • 😎 HappyPack
  • 🤖 Auto generated Vendor DLL for smooth development experiences
  • 🍃 Tree-shaking

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors