{"id":19154307,"url":"https://github.com/baloise/web-app-utils","last_synced_at":"2025-05-07T06:30:11.859Z","repository":{"id":36961703,"uuid":"362821703","full_name":"baloise/web-app-utils","owner":"baloise","description":"Utilities for Baloise Web Applications","archived":false,"fork":false,"pushed_at":"2025-04-10T09:08:56.000Z","size":12293,"stargazers_count":3,"open_issues_count":11,"forks_count":1,"subscribers_count":13,"default_branch":"master","last_synced_at":"2025-04-29T02:06:50.749Z","etag":null,"topics":["angular","pipes","typescript","utilities","validators","vue"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/baloise.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2021-04-29T13:10:55.000Z","updated_at":"2025-04-10T09:08:59.000Z","dependencies_parsed_at":"2024-01-15T09:25:31.025Z","dependency_job_id":"e259a47b-2d3d-46ab-a53d-d3b7ebb41bf6","html_url":"https://github.com/baloise/web-app-utils","commit_stats":{"total_commits":328,"total_committers":14,"mean_commits":"23.428571428571427","dds":0.5762195121951219,"last_synced_commit":"b67b6e8d889d901b9ee262d8dd819f34b0fdb438"},"previous_names":[],"tags_count":77,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baloise%2Fweb-app-utils","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baloise%2Fweb-app-utils/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baloise%2Fweb-app-utils/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/baloise%2Fweb-app-utils/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/baloise","download_url":"https://codeload.github.com/baloise/web-app-utils/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252826565,"owners_count":21810132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","pipes","typescript","utilities","validators","vue"],"created_at":"2024-11-09T08:26:23.541Z","updated_at":"2025-05-07T06:30:11.840Z","avatar_url":"https://github.com/baloise.png","language":"TypeScript","readme":"# Web App Utilities\n\n[![Continuous](https://github.com/baloise/web-app-utils/actions/workflows/continuous.yml/badge.svg?branch=master)](https://github.com/baloise/web-app-utils/actions/workflows/continuous.yml)\n[![Release](https://github.com/baloise/web-app-utils/actions/workflows/release.yml/badge.svg?branch=master)](https://github.com/baloise/web-app-utils/actions/workflows/release.yml)\n![GitHub](https://img.shields.io/github/license/baloise/web-app-utils)\n![GitHub issues](https://img.shields.io/github/issues/baloise/web-app-utils)\n\n## About\n\nA collection of utilities for Baloise web applications.\n\n- [Utils](./packages/utils/README.md)\n- [Pipes](./packages/pipes/README.md)\n- [Validators](./packages/validators/README.md)\n- [Unsupported Browsers](./packages/unsupported-browsers/README.md)\n- [Clean Architecture](./packages/clean-architecture/README.md)\n- [Form Vue](./packages/form-vue/README.md)\n\n## Table of Content\n\n- [Packages](#packages)\n- [Contributing](#contributing)\n\n## Packages\n\n| Library                                                                                                                               | Status                                                                     | Description                                                                                                                                                   |\n| ------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| [@baloise/web-app-utils](https://github.com/baloise/web-app-utils/blob/master/packages/utils/README.md)                               | ![npm](https://img.shields.io/npm/v/@baloise/web-app-utils)                | A collection of JavaScript utilities like simple functions, models and integration logic.                                                                     |\n| [@baloise/web-app-pipes](https://github.com/baloise/web-app-utils/blob/master/packages/pipes/README.md)                               | ![npm](https://img.shields.io/npm/v/@baloise/web-app-pipes)                | A collection of pipe function to transform raw values in a certain format.                                                                                    |\n| [@baloise/web-app-pipes-angular](https://github.com/baloise/web-app-utils/blob/master/packages/pipes-angular/README.md)               | ![npm](https://img.shields.io/npm/v/@baloise/web-app-pipes-angular)        | Proxy package for angular applications.                                                                                                                       |\n| [@baloise/web-app-pipes-vue](https://github.com/baloise/web-app-utils/blob/master/packages/pipes-vue/README.md)                       | ![npm](https://img.shields.io/npm/v/@baloise/web-app-pipes-vue)            | Proxy package for vue applications.                                                                                                                           |\n| [@baloise/web-app-validators](https://github.com/baloise/web-app-utils/blob/master/packages/validators/README.md)                     | ![npm](https://img.shields.io/npm/v/@baloise/web-app-validators)           | A collection of validator functions.                                                                                                                          |\n| [@baloise/web-app-validators-angular](https://github.com/baloise/web-app-utils/blob/master/packages/validators-angular/README.md)     | ![npm](https://img.shields.io/npm/v/@baloise/web-app-validators-angular)   | Proxy package for angular applications.                                                                                                                       |\n| [@baloise/web-app-validators-vue](https://github.com/baloise/web-app-utils/blob/master/packages/validators-vue/README.md)             | ![npm](https://img.shields.io/npm/v/@baloise/web-app-validators-vue)       | Proxy package for vue applications.                                                                                                                           |\n| [@baloise/web-app-unsupported-browsers](https://github.com/baloise/web-app-utils/blob/master/packages/unsupported-browsers/README.md) | ![npm](https://img.shields.io/npm/v/@baloise/web-app-unsupported-browsers) | This script verifies if the users browser is supported by the Baloise applications and if not it redirects directly to the static unsupported-browsers pages. |\n| [@baloise/web-app-clean-architecture](https://github.com/baloise/web-app-utils/blob/master/packages/clean-architecture/README.md) | ![npm](https://img.shields.io/npm/v/@baloise/web-app-clean-architecture) | Utils for clean architecture |\n| [@baloise/web-app-form-vue](https://github.com/baloise/web-app-utils/blob/master/packages/form-vue/README.md) | ![npm](https://img.shields.io/npm/v/@baloise/web-app-form-vue) | Components and utils for Vue form creation. |\n\n## Contribution\n\nWe gratefully accept contributions to the Baloise Web App Utilites, but expect new feature requests and changes to be approved by the Baloise Web Community before creating a [pull request](https://github.com/baloise/web-app-utils/pulls).\n\n### Introduction\n\nBaloise Web App Utilities is free to use for anybody building a Baloise product or website, and the Baloise community is always working to make it better. Contributors like you help to make Baloise Web App Utilities great, and so we’re glad you’re here.\n\nContributions are not limited to code. We also encourage feedback, documentation, new designs, and tools.\n\nAll you need is a [public GitHub account](https://github.com/) to get started. Most contributions begin with a GitHub issue using one of these templates:\n\n- [Ask a question](https://github.com/baloise/web-app-utils/issues/new?assignees=\u0026labels=question\u0026template=question.md)\n- [Report a bug](https://github.com/baloise/web-app-utils/issues/new?assignees=\u0026labels=bug\u0026template=bug-report.md\u0026title=)\n- [Request a feature](https://github.com/baloise/web-app-utils/issues/new?assignees=\u0026labels=enhancement\u0026template=feature-request.md\u0026title=)\n\n### Community\n\n#### Users\n\nUsers are members of the community who use Baloise Web App Utilities guidelines, assets, and tooling. Anyone can be a user, and we encourage users to participate in the community as much as possible.\n\n#### Contributors\n\nContributors are members of the community who contribute to Baloise Web App Utilities in a material way. Anyone can be a contributor. In addition to participating as a user, you can also contribute by:\n\n- Reporting bugs or missing features through GitHub issues\n- Fixing bugs, adding features, and improving documentation\n\n#### Maintainers\n\nMaintainers are members of the community who are committed to the success of individual Baloise Web App Utilities projects. In addition to their participation as a contributor, maintainers:\n\n- Label, close, and manage GitHub issues\n- Close and merge GitHub pull requests\n\n### Workflow\n\nThe Baloise Web App Utilities typically use a [fork and pull request workflow](https://docs.github.com/en/get-started/quickstart/contributing-to-projects) for contributions\n\n### Dev Setup\n\nBaloise Web App Utils are divided into multiple NPM packages. Development for all of the packages happens inside one mono repository. Follow the below steps to get the dev environment up and running.\n\n#### Prerequisite - NodeJS\n\nTo work with this project a recent LTS version of NodeJS and npm is required. Make sure you've installed and/or updated [Node](https://nodejs.org/en/) before continuing.\n\n### How to's\n\nTo start building a new utilities, clone this repo to a new directory:\n\n```bash\ngit clone https://github.com/baloise/web-app-utils.git web-app-utils\ncd web-app-utils\n```\n\n- Run `npm install` in the root directory to install all dependencies of the packages\n- Run `npm run build` in the root directory to build all packages\n- Run `npm run test` in the root directory to run all tests of packages\n- Run `npm run docs` in the root directory to generate the api documentation of the utilities\n\n#### Write your own Utility\n\nAll our validators are located in the `packages/utils` dir.\n\n##### Getting Started\n\nNavigate into the component package:\n\n```bash\ncd packages/utils\n```\n\nTo run the test use this command:\n\n```bash\nnpm run test\n```\n\n##### Structure\n\nThe structure of the utils in the folder `utils` is importend, because out of it the documentation is automatically generate as well as the adapter for our supported frameworks like angular.\n\nThe comment block has a short description and an example part for the documentaion.\n\nEach utility function needs to be exported.\n\n````typescript\n/**\n * Returns `true` if the arrays are equal\n *\n * ```typescript\n * isValidMonetaryNumber(`1'000.99`) // true\n * ```\n */\nexport function isValidMonetaryNumber(stringValue: string): boolean {\n  // utility logic\n  return any\n}\n````\n\n#### Write your own Validator\n\nAll our validators are located in the `packages/validators` dir.\n\n##### Getting Started\n\nNavigate into the component package:\n\n```bash\ncd packages/validators\n```\n\nEach validator has its own test file.\n\nTo run the test use this command:\n\n```bash\nnpm run test\n```\n\n##### Structure\n\nThe structure of the validator is importend, because out of it the documentation is automatically generate as well as the adapter for our supported frameworks like angular.\n\nThe comment block has a short description and an example part for the documentaion.\n\nThe first function receivs the options parameter and the second function gets the value to validate.\n\n````typescript\nimport { BalValidatorFn } from './validator.type'\n\n/**\n * Returns `true` if the value date is before the given date\n *\n * ```typescript\n * BalValidators.isCustom((value) =\u003e value \u003e 2)(3) // true\n * ```\n */\nexport function isCustom(validatorFn: BalValidatorFn): BalValidatorFn {\n  return function (value: any) {\n    return validatorFn(value)\n  }\n}\n````\n\n#### Write your own Pipe\n\nAll our pipe functions are located in the `packages/pipes` dir.\n\n##### Getting Started\n\nNavigate into the component package:\n\n```bash\ncd packages/pipes\n```\n\nEach pipe has its own test file.\n\nTo run the test use this command:\n\n```bash\nnpm run test\n```\n\n##### Structure\n\nThe structure of the pipe function is importend, because out of it the documentation is automatically generate as well as the adapter for our supported frameworks like angular.\n\nThe comment block has a short description and an example part for the documentaion.\n\nThe pipe are simple functions which always return a string.\n\n````typescript\nimport { isEmpty } from '@baloise/web-app-utils'\nimport capitalize from 'lodash.capitalize'\n\n/**\n * Transforms the given string parameter to capitalize string.\n *\n * ```typescript\n * balCapitalize('baloise') // Baloise\n * ```\n */\nexport function balCapitalize(value: string | null | undefined): string {\n  if (isEmpty(value)) {\n    return ''\n  } else {\n    return capitalize(value as string)\n  }\n}\n````\n\n### Release\n\nIt is important to follow the [conventional commits](/guide/development/release.html#conventional-commits) rules of the sematic versioning.\n\nNote that the lerna release uses the commit messages to determine the type of changes in the codebase.\nThe changelog gets generated out of the commit messages.\n\n## Process\n\n1. Create a new git branch.\n2. Create a pull request and follow the [conventional commits](/guide/development/release.html#conventional-commits) rules.\n3. After merging the github action `.github/release.yml` will release the changes immediately.\n   - First it determines the new version out of the git commit messages\n   - Then it releases is on npm\n   - The changelog is generated out of the git commit messages aswell.\n\n## Conventional Commits\n\nWe are following the [Karam Git Message guideliness](http://karma-runner.github.io/5.2/dev/git-commit-msg.html).\n\nHere are some examples of the release type that will be done based on a commit messages:\n\n| Commit message                                                                                                                                                                                   | Release type               |\n| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | -------------------------- |\n| `fix(pencil): stop graphite breaking when too much pressure applied`                                                                                                                             | Patch Release              |\n| `feat(pencil): add 'graphiteWidth' option`                                                                                                                                                       | ~~Minor~~ Feature Release  |\n| `perf(pencil): remove graphiteWidth option`\u003cbr\u003e\u003cbr\u003e`BREAKING CHANGE: The graphiteWidth option has been removed.`\u003cbr\u003e`The default graphite width of 10mm is always used for performance reasons.` | ~~Major~~ Breaking Release |\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaloise%2Fweb-app-utils","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbaloise%2Fweb-app-utils","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbaloise%2Fweb-app-utils/lists"}