helgoland-toolbox v0.0.1-alpha.2
helgoland-toolbox
tools for a sensor observation service based client
This project contains Angular based Modules, Components, Injectables to build a sensor observation service based client.
Getting Started
Dependencies
Node/NPM
Install latest Node and NPM following the instructions. Make sure you have Node version ≥ 7.0 and NPM ≥ 4.
brew install nodefor Mac.
Yarn
Yarn package manager is optional but highly recommended. If you prefer to work with npm directly you may ignore this step.
Yarn installs library dependencies faster and also locks theirs versions. It has more advantages but these two are already pretty attractive.
Install Yarn by following the instructions.
brew install yarnfor Mac.
Installing
forkthis repository.cloneyour fork to your local environment.yarn installto install required dependencies (ornpm i).
Build the library
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.
Other commands
Lint the code
yarn lintfor performing static code analysis.
Test the library
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.
Generate documentation
yarn docsfor generating documentation locally.yarn gh-pagesfor generating documentation and uploading it to GitHub Pages. Documentation example.
Explore the bundle
yarn explorerto find out where all your code in bundle is coming from.
Bump library version
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.
Publish library to NPM
npm publishto publish your library sources on npmjs.com. Once the library is published it will be available for usage in npm packages.
prepublishOnly script in this case will automatically run project testing and linting in prior in order to check that the library is ready for publishing.
Cleaning
yarn clean:tmpcommand will clean up all temporary files likedocs,dist,coverageetc.yarn clean:allcommand will clean up all temporary files along withnode_modulesfolder.
Library development workflow
In order to debug your library in browser you need to have 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 demo applications that are provided for your convenience as a part of this repository.
- Use Angular-CLI to generate library-consumer project for you and then use
yarn linkto link your library to it.
Using yarn link
In you 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 you library to the project
yarn link "angular-library-seed"
# Build your project. In case of Angular-CLI use the following command.
ng serve --aotThen you need to import your library into your project's source code.
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 it is shown below:{ "compilerOptions": { "paths": { "@angular/*": ["../node_modules/@angular/*"] } } }
6 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