Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh
changelog="CHANGELOG.md"
msgfile="$1"
msg=$(head -n1 "$msgfile")

# Ensure changelog contains bullet for the commit message
if ! grep -Fq "- $msg" "$changelog"; then
sed -i "/^## \[Unreleased\]/a - $msg" "$changelog"
git add "$changelog"
fi
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- upcoming changes

## [0.1.22] - 2025-06-04
- Added `CONTRIBUTING.md` with setup and test instructions.
21 changes: 21 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Contributing to TSDataStructure

Thank you for considering contributing! Follow these steps to get started.

## Setup

1. Install dependencies:
```bash
npm install
```
2. Run the linter and build the project:
```bash
npm run lint
npm run build
```
3. Execute the test suite:
```bash
npm test
```

Please ensure all tests pass before submitting a pull request. Commit messages should be clear and descriptive.
4 changes: 2 additions & 2 deletions DEVELOPMENT_PLAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ This document outlines possible improvements and future developments for the `TS
## Documentation

- **API Examples**: Expand the README with practical examples demonstrating each data structure in real-world scenarios.
- **Contribution Guide**: Provide a `CONTRIBUTING.md` describing how to set up the project, run tests, and submit pull requests.
- **Changelog**: Maintain a `CHANGELOG.md` to track notable changes between releases.
- **Contribution Guide**: Provide a `CONTRIBUTING.md` describing how to set up the project, run tests, and submit pull requests. *(Implemented)*
- **Changelog**: Maintain a `CHANGELOG.md` to track notable changes between releases. *(Implemented)*

## Packaging and Distribution

Expand Down
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -500,9 +500,11 @@ If you have an advice, please feel free to contact with me

## Git Hooks

This project uses a pre-commit hook stored in `.githooks/pre-commit` to
automatically bump the package patch version each time you commit. Enable the
hooks with the following command:
This project uses git hooks stored in the `.githooks` directory. The
`pre-commit` hook automatically bumps the package patch version each time you
commit, while the `commit-msg` hook appends the commit message to the
`CHANGELOG.md` under the *Unreleased* section. Enable the hooks with the
following command:

```bash
git config core.hooksPath .githooks
Expand Down