Skip to content

ArtemKlyuev/notifier

Repository files navigation

Notifier

Commitizen friendly

A low-level engine to manage notifications.

Notifier is a low-level engine to create and manage your app notifications. It's supposed to be used on the frontend, but you're not limited by the platform anyway.

Table of contents

Packages

This repository is a monorepo containing the following packages:

Examples

Check live demo

Check out examples folder for more usage examples.

Changes

Detailed release notes for a given version can be found on a releases page.

Maintaining

Package manager

This project uses yarn v1 package manager, please make sure you have it installed and ready to use.

Commits

This project uses commitizen please use the cm script to run it.

Scripts

List of available scripts to run from the project root:

  • add:root — add dependency to the project root package.json
  • lint — lint all files with eslint
  • lint:fix — fix all problematic files with eslint
  • cm — launch commit workflow with commitizen
  • package:core — launch any command from the @notifierjs/core package root
  • package:react — launch any command from the @notifierjs/react package root

pre-commit hook

pre-commit hooks set up thanks to sudo-suhas and his lint-staged-multi-pkg project repo

helpful lerna options:

https://github.com/lerna/lerna/tree/main/core/global-options#--concurrency

https://github.com/lerna/lerna/tree/main/core/filter-options#--since-ref

husky is installed in the root package.json as recommended in husky docs.

The pre-commit hook is configured with the script

yarn lerna run --concurrency 1 --stream precommit --since HEAD --exclude-dependents

in the .husky/pre-commit file

This executes the precommit script for each package (if it exists). Execution is limited to only those packages with modified files, however the --since HEAD --exclude-dependents option does not consider whether the file is staged. To further limit precommit to only staged files please look at the discussion in sudo-suhas/lint-staged-multi-pkg#4. Furthermore, concurrent execution is disabled because it can cause problems during git add (see okonet/lint-staged#225).

Each package has its own lint-staged config file and precommit script which is triggered by lerna.