@monsenso/components v1.1.1-prerelease.20
angular-component-library
Requirements
Tools
Quick Start
# Install all dependencies
yarn
# Build the library
yarn buildGetting Started
Build the library
yarn buildfor building the library once.yarn build:watchfor building the library and watch for file changes.
You may also build 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.
Other commands
Lint the code
yarn lintfor performing static code analysis on both typescript files and scss files.
Lint the typescript code
yarn tslintfor performing static code analysis on typescript files.
Lint the SCSS code
yarn sass-lintfor performing static code analysis on scss files.
Test the library
yarn testfor running all your*.spec.tstests once. Chrome browser is used by default.yarn test:watchfor running all your*.spec.tsand watch for file changes.yarn test:safarifor running all your*.spec.tstests once with Safari.yarn test:iefor running all your*.spec.tstests once with Internet Explorer.yarn test:edgefor running all your*.spec.tstests once with Edge.yarn test:safarifor running all your*.spec.tstests once with Safari.yarn test:allfor running all your*.spec.tstests once with all 4 supported browsers.
Generate documentation
yarn docsfor generating documentation in the docs folder.
Bump library version
npm version [<newversion> | major | minor | patch]to increase library version.
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.
Publish library to NPM
- This is done automatically on Jenkins. Pre-release is pushed when the develop branch is processed and release is pushed when the master branch is processed.
Cleaning
yarn clean:tmpcommand will clean up all temporary files likedocs,lib,tmpetc.yarn clean:allcommand will clean up all temporary files along withnode_modulesfolder.
Library development workflow
In order to debug the library in your browser you'll need to have an Angular project that will consume your library, build the application and display it. For your convenience all of that should happen automatically in background so once you change library source code you should instantly see the changes in browser.
There are several ways to go here:
- Use your real library-consumer project and link your library to it via
yarn linkcommand (see below). - Use Angular-CLI OR Ionic-CLI to generate library-consumer project for
you and then use
yarn linkto link your library to it.
Using yarn link
In you angular-component-library root folder:
# Create symbolic link
yarn link
# Build library in watch mode
yarn build:watchIn you project folder that should consume the library:
# Link your library to the project
yarn link "@monsenso/components"Note that this link is removed when yarn install is done on the consumer project. So you must do yarn install before setting up the link.
Now, once you update your library source code it will automatically be re-compiled and your project will be re-built so you may see library changes instantly.
More information about yarn link command.
At the moment of publishing this project there is a bug exists when using
yarn linkin combination with Angular CLI. The issue is caused by havingnode_modulesfolder inside linked library. There is a workaround has been provided that suggests to add apathsproperty with all Angular dependencies to thetsconfig.jsonfile of the Angular CLI project like so:"paths": { "@angular/*": ["../node_modules/@angular/*"] }
Known issues
Images in components
At the moment angular-component-library does not handle images in components. When a component needs an image file to work this file must be added to the consumer project at the location specified in the component code.
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago