1.0.22 • Published 3 years ago

dealer-hub v1.0.22

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Dealer hub

This project contains components and services used for dealers.

Contents

1 Project structure

  • Library:
    • lib folder for the classes
    • public_api.ts entry point for all public APIs of the package
    • package.json npm options
    • rollup.config.js Rollup configuration for building the umd bundles
    • rollup.es.config.js Rollup configuration for building the es2015 bundles
    • tsconfig-build.json ngc compiler options for AoT compilation
    • build.js building process using ShellJS
  • Testing:
    • tests folder for unit & integration tests
    • karma.conf.js Karma configuration that uses webpack to build the tests
    • spec.bundle.js defines the files used by webpack
  • Extra:
    • tslint.json Angular TSLint Preset (TypeScript linter rules with Codelyzer)

2 Installation

Install the npm packages by running the following command:

npm run build

4 Building

The following command:

npm run build
  • starts TSLint with Codelyzer using Angular TSLint Preset
  • starts AoT compilation using ngc compiler
  • creates dist folder with all the files of distribution, following Angular Package Format (APF) v5.0:
└── dist
    ├── bundles
    |   ├── dealer-hub.umd.js
    |   ├── dealer-hub.umd.js.map
    |   ├── dealer-hub.umd.min.js
    |   └── dealer-hub.umd.min.js.map
    ├── esm5
    |   ├── dealer-hub.js
    |   └── dealer-hub.js.map
    ├── esm2015
    |   ├── dealer-hub.js
    |   └── dealer-hub.js.map
    ├── src
    |   └── **/*.d.ts
    ├── dealer-hub.d.ts
    ├── dealer-hub.metadata.json
    ├── LICENSE
    ├── package.json
    ├── public_api.d.ts
    └── README

To test locally the npm package before publishing:

npm run pack:lib

Then you can install it in an app to test it:

npm install [path]dealer-hub-[version].tgz

4 Testing

The following command runs unit & integration tests that are in the tests folder (you can change the folder in spec.bundle.js file):

npm test 

or in watch mode:

npm test:watch

It also reports coverage using Istanbul.

5 Releasing

The following command will pack the dist folder and push it to the release branch:

npm run publish:lib

Then a github release can be formed against the release branch based on the build version

6 Documentation

To generate the documentation, this starter uses compodoc:

npm run compodoc
npm run compodoc:serve 

7 Demo

1) Go to Demo folder and import respective component in app.component.js 2) Add selectors in html file if its component. 3) For service. Import service and add it in providers and call those services. 3) Run npm start - It will build package and link it with demo project and then start demo project.