Add docs and git hooks

This commit is contained in:
Timo
2025-03-25 20:12:36 +01:00
parent 6fa218dd91
commit f868eca938
4 changed files with 54 additions and 0 deletions

View File

@@ -10,3 +10,30 @@ matrix-js-sdk: ../path/to/matrix-js-sdk
```
Then run `yarn install`.
## Hooks
Changes in `.links.yaml` will also update `yarn.lock` when `yarn` is executed. The lockfile will then contain the local
version of the package which would not work on others dev setups or the github CI.
One always needs to run:
```bash
mv .links.yaml .links.disabled.yaml
yarn
```
before committing a change.
To make it more convenient to work with this linking system we added git hooks for your conviniece.
A `pre-commit` hook will run `mv .links.yaml .links.disabled.yaml`, `yarn` and `git add yarn.lock` if it detects
a `.links.yaml` file and abort the commit.
You will than need to check if the resulting changes are appropriate and commit again.
A `post-commit` hook will setup the linking as it was
before if a `.links.disabled.yaml` is present. It runs `mv .links.disabled.yaml .links.yaml` and `yarn`.
To activate the hooks automatically configure git with
```bash
git config --local core.hooksPath .githooks/
```