GithubHelp home page GithubHelp logo

kekel87 / angular-seed Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 5.04 MB

๐Ÿ…ฐ๏ธ Angular seed app with all my default setup, linter, tests, theming

Home Page: https://kekel87.github.io/angular-seed/

TypeScript 33.50% HTML 39.38% SCSS 27.13%

angular-seed's Introduction

Angular seed angular

angular typescript rxjs ngrx jest cypress eslint prettier github-actions

Here is my project for new angular project, with selection and configuration of tools to ensure a good quality of code, like linter, formatter, unit tests or e2e tests.

Indeed @angular/cli doesn't impose linter or e2e test anymore.

And doesn't seem to want to use var jest for unit testing. ๐Ÿคท

I include @angular/material with theming by CSS variables and ngrx, because I use them in most of my projects.

Commands

Development server

npm start

Linter and Formatter

npm run format
npm run lint

You can run only specific lint/formatter if you want:

# For TS and HTML template (AKA ng lint)
npm run format:ng
npm run lint:ng

# For SCSS, JS and JSON
npm run lint:prettier
npm run format:prettier

# For SCSS
npm run format:stylelint
npm run lint:stylelint

Tests

npm run test
npm run e2e -- -c headless

Build

npm run build

Stack and Changes

  • ๐Ÿ…ฐ๏ธ Core:
    • @angular
    • @angular/cli
      • root scss move to dedicated folder src/scss (stylePreprocessorOptions)
      • remove .vscode folder because it has to remain IDE agnostic
      • basics TS alias
    • @angular/material
      • theming with CSS variables
      • dedicated variables file
      • NO global MaterialModule which import all the lib (tree-shaking ...) !
      • light/dark theme auto switch with prefers-color-scheme (no class)
    • ngrx
  • ๐Ÿ‘ฎ Linter/Formatter
  • โœ” Unit Test
    • jest with @briebug/jest-schematic
      • all config put in src/tests folder
      • prepare src/tests/mocks to put tests mocks
      • setup coverage threshold to 100 because I am a crazy person
      • jest-createspyobj for missing typed createspyobj Need to find better typing
      • jest-marbles for rxjs testing
      • jasmine-marble for rxjs testing (do not trust the name, is not related to jasmine (no dependence))
      • ng-mocks for greatly simplify component testing
  • ๐Ÿต E2E Test
    • cypress
    • disable video and screenshotOnRunFailure
    • I keep only the npm run e2e command (with configs)

Basic GH Actions

CI/CD must guarantee the quality of the code without being burdensome for the developers (so it must be fast).

And it must deploy (here, in GH Pages) the application automatically.

Job Description
๐Ÿšง Install Installation of dependencies and creation/update of cache.
๐Ÿ‘ฎ Lint Syntax verification of the code
โœ” Unit tests Units tests
๐Ÿต E2E tests E2E tests
๐Ÿ› ๏ธ Build Build Angular application in prod config
๐Ÿš€ Deploy Deployment on Github Pages

angular-seed's People

Contributors

kekel87 avatar

Stargazers

 avatar

Watchers

 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.