Skip to content

Starter for libraries to be consumed by Angular

License

Notifications You must be signed in to change notification settings

smithad15/angular-library-starter

Repository files navigation

Angular Library Starter

CircleCI

This starter lays out a project structure for libraries that are to be consumed by Angular. It will output files that correspond to the Angular Package Format.

Features

  • FESM (Flat ECMAScript Module) with ES5 code
  • FESM with ES2015 code
  • TSLint
  • Prettier
  • Should work on Windows/Linux/Mac
  • Code can be consumed by AOT
  • Tree Shakeable
  • Support for Closure Compiler
  • Unit testing and code coverage with Jest
  • Basic CircleCI 2.0 config

Getting Started

All of the code inside of src will be bundled up for you automatically. The entry point for the end package is src/index.ts. All files that are to be included must be part of that entry point.

Of course, you will probably not want to have angular-library-starter be your package name. Change it to your own library name in the following places:

  • package.json
    • name
    • module path
    • es2015 path
    • typings path
  • tsconfig.json and tsconfig.es2015.json
    • angularCompilerOptions
      • flatModuleOutFile
      • flatModuleId

Any packages that you include in your peerDependencies will not be included in your published bundle automatically.

Publishing Your Package

This repo has been designed to be published on npm. It is recommended to use the procedure described here. For release note tracking, it is recommended to use GitHub's releases feature due to the extra niceties that come along with it (easy release note management, automatic source code bundling, etc.)

Scripts

  • npm run build: Run through the entire build process
  • npm run lint: Runs all linters
  • npm run prettify: Runs prettier over the entire codebase
  • npm test: Runs the unit test suite with code coverage
  • npm run test:watch: Runs the unit test suite in watch mode
  • npm run clean: Removes build artifacts

Resources

About

Starter for libraries to be consumed by Angular

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published