Template para librerias de Angular compatibles con AOT/JIT, SCSS-styles externos y HTML-templates.
- AOT/JIT compatible library build via Angular Compiler (ngc).
- UMD build via Webpack that allows you to use your library for browser builds. You may play with it on Plunker.
- Testing with Karma and Jasmine.
- Test coverage report via Istanbul.
- Watch modes for building and testing procedures that makes developing process easier.
- Linting with TSLint and Codelyzer for static code analysis.
- Exploring your build via Sourcemap Explorer that shows you a treemap visualization to help you debug where all the code is coming from.
- Documentation generation via Compodoc. Take a look at documentation example.
- Documentation hosting via GitHub Pages.
- AOT/JIT/UMD demos via Webpack and SystemJS that allows you to test library builds.
- Continuous integration with Travis CI.
- Code coverage badge via Codecov as a reminder to cover code with tests.
angular-library-seed
├─ src * Library sources home folder (THE PLACE FOR YOUR LIBRARY SOURCES)
| ├─ components * Library components with tests
| ├─ services * Library services with tests
| ├─ index.ts * Library entry point that is used by builders
| └─ module.ts * Library module
|
├─ .editorconfig * Common IDE configuration
├─ .gitignore * List of files that are ignored while publishing to git repo
├─ .npmignore * List of files that are ignored while publishing to npm
├─ .travis.yml * Travic CI configuration
├─ LICENSE * License details
├─ README.md * README for you library
├─ gulpfile.js * Gulp helper scripts
├─ library-package.json * Package configuration for your library
├─ template-package.json * NPM dependencies, scripts for the template
├─ karma-test-entry.ts * Entry script for Karma tests
├─ karma.conf.ts * Karma configuration for our unit tests
├─ package.json * NPM dependencies, scripts and package configuration
├─ tsconfig-aot.json * TypeScript configuration for AOT build
├─ tsconfig.json * TypeScript configuration for UMD and Test builds
├─ tslint.json * TypeScript linting configuration
├─ webpack-test.config.ts * Webpack configuration for building test version of the library
├─ webpack-umd.config.ts * Webpack configuration for building UMD bundle
└─ yarn.lock * Yarn lock file that locks dependency versions
Instalar la ultima version de Node y NPM siguiendo las instrucciones. Versiones Node ≥ 7.0 y NPM ≥ 4.
Gulp.js Gulp.js es un build system(sistema de construcción) que permite automatizar tareas comunes de desarrollo, tales como la minificación de código JavaScript, recarga del navegador, compresión de imágenes, validación de sintaxis de código y un sin fin de tareas más.
Instalar Gulp npm install gulp-cli -g.
Yarn package manager Yarn es un administrador de dependencias open source y fue creado por miembros de Facebook y Google, su principal característica es la rápidez. Más ventajas.
Instalar Yarn siguiendo las instrucciones para windows, despues de instalar reinciar el equipo.
forkel repositorio.clonelocalmente.- Modifica
library-package.jsonagregando los camposname,version,keywords,description,author,repository,homepage. Para mas información puedes consultar la documentacion de npm package.json handling. yarn installpara instalar las dependencias requeridas para realizar elmerge-json.gulp merge-jsonpara integrar el archivo package.json.yarn installvolver a correr comando para actualizar las dependencias requeridas después de realizar el merge de package.json.
En este repositorio encontraras un proyecto de ejemplo, con la estructura para poder generar un modulo con sus respectivos componentes y servicios.
yarn buildfor building the library once (both ESM and AOT versions).yarn build:watchfor building the library (both ESM and AOT versions) and watch for file changes.
You may also build UMD bundle and ESM files separately:
yarn build:esm- for building AOT/JIT compatible versions of files.yarn build:esm:watch- the same as previous command but in watch-mode.yarn build:umd- for building UMD bundle only.yarn build:umd:watch- the same as previous command but in watch-mode.
yarn lintfor performing static code analysis.
yarn testfor running all your*.spec.tstests once. Generated code coverage report may be found incoveragefolder.yarn test:watchfor running all you*.spec.tsand watch for file changes.
yarn docsfor generating documentation locally.
yarn explorerto find out where all your code in bundle is coming from.
npm version patchto increase library version. More on bumping.
preversion script in this case will automatically run project testing and linting in prior in order to check that the library is ready for publishing.
yarn clean:tmpcommand will clean up all temporary files likedocs,dist,coverageetc.yarn clean:allcommand will clean up all temporary files along withnode_modulesfolder.