# @bci-web-core
Welcome to the repository of the Web Core packages. \
The repository on Social Coding (Bitbucket) is read-only to allow you to read the source code, clone it and build the demo application on your local machine.\
The actual repository including backlog and build/release pipeline is hosted on BCI's Azure Devops Server instance. This might change in the future. Unfortunately, the contribution process is not yet defined entirely to date. We hope to be able to provide this soon.\
 
The Web Core libraries are released under the BIOSL5-EDF license.

## Getting Started using BCI Web Core
1. Configure your npm with a registry containing the BCI Web Core modules.
2. Make sure your globally installed Angular CLI is up to date.
   Run `npm i -g @angular/cli@9` to install the latest version.
3. Install `@bci-web-core/schematics` globally: `npm i -g @bci-web-core/schematics`
4. Run `ng new <your-application-name> --collection=@bci-web-core/schematics` to create a new application based on BCI Web Core. 
   For an existing Angular project without Web Core, run `ng add @bci-web-core/schematics`.\
   **Important**: It only works when you start with an empty Angular project.
   When running the schematicss on an existing project, there might be unforeseen side effects and they could fail.\
   **Important**: The schematics might override some files, so back-up before. 
5. If not alread given by the latest schematics release, clear the `copy:assets` script 
   in the generated file `package.json` in the project's root folder 
   and add the following entry to your application's assets in `angular.json`:
   ```
    {
       "glob": "**/*",
       "input": "./node_modules/@bci-web-core/common-styles/img",
       "output": "/assets/img/"
     }
   ```

For further details and instructions see [Docupedia: Getting started with Web Core](https://inside-docupedia.bosch.com/confluence/x/SSnLK).

## Structure
This repository is a monorepo, containing all bci-web-core angular dependencies.

You can find the libraries in `libs`-Folder.
In the apps folder differen demo apps are located. They are used to test features of the libraries and to demonstrate features and components.

## Developing
Start the demo application with `start-core` .
Changes in the library source code are automatically reflected in the running demo app.

When adding features to the library also create a new component in the demo app. Also ensure that after changing code the demo app is still working.

## Testing
The `test-libs`, `test-apps`' and `e2e` tasks run the unit tests and end-to-end tests resp.

## Building locally
* The `build:libs` task compiles the libraries into dist folder. 
* The `build:apps` task compiles the demo apps into dist folder.

## Building on Azure Devops Server
After your pull request is reviewed and approved, your code is automatically (if there are no conflicts) merged. This causes the CI build to start and check if at least the library compiles with your changes.

If the pull request cannot be merged automatically you have to rebase your branch on the master branch again. Once committed again, the pull request should complete.

## Release
Releases are published only by the Azure Devops Server release management.
Release builds are created only on the master branch.

## Open Source Scans
We perform Source Code Scans (using FossId) of the `/libs` directory. If there will be findings, you can find a NOTICE file in the root directory of this repository.
Demo applications are only provided as examples and are not scanned in build process. 

Dependencies are not scanned. Each project should do the artifact scan of their application in their respective build- and release-processes.
