From ff040e0cd86ec43f0d17f0a08546ed17b150d312 Mon Sep 17 00:00:00 2001 From: Bakhtier Gaibulloev Date: Wed, 4 Jun 2025 10:24:31 +0200 Subject: [PATCH 1/3] Add contribution guide --- CONTRIBUTING.md | 21 +++++++++++++++++++++ DEVELOPMENT_PLAN.md | 2 +- 2 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..fce9315 --- /dev/null +++ b/CONTRIBUTING.md @@ -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. diff --git a/DEVELOPMENT_PLAN.md b/DEVELOPMENT_PLAN.md index 64556e9..7342ee7 100644 --- a/DEVELOPMENT_PLAN.md +++ b/DEVELOPMENT_PLAN.md @@ -23,7 +23,7 @@ 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. +- **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. ## Packaging and Distribution From 2bf78cab5982877706fe211dd113cbb28e1e6eda Mon Sep 17 00:00:00 2001 From: Bakhtier Gaibulloev Date: Wed, 4 Jun 2025 10:43:03 +0200 Subject: [PATCH 2/3] Add changelog and mark task complete --- CHANGELOG.md | 12 ++++++++++++ DEVELOPMENT_PLAN.md | 2 +- 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..04320a8 --- /dev/null +++ b/CHANGELOG.md @@ -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. diff --git a/DEVELOPMENT_PLAN.md b/DEVELOPMENT_PLAN.md index 7342ee7..c366785 100644 --- a/DEVELOPMENT_PLAN.md +++ b/DEVELOPMENT_PLAN.md @@ -24,7 +24,7 @@ This document outlines possible improvements and future developments for the `TS - **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. *(Implemented)* -- **Changelog**: Maintain a `CHANGELOG.md` to track notable changes between releases. +- **Changelog**: Maintain a `CHANGELOG.md` to track notable changes between releases. *(Implemented)* ## Packaging and Distribution From 6a5eaad0d2f41b349b4a15c9b746c42fb811240f Mon Sep 17 00:00:00 2001 From: Bakhtier Gaibulloev Date: Wed, 4 Jun 2025 10:48:16 +0200 Subject: [PATCH 3/3] Add commit-msg hook to update changelog --- .githooks/commit-msg | 10 ++++++++++ README.md | 8 +++++--- 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 .githooks/commit-msg diff --git a/.githooks/commit-msg b/.githooks/commit-msg new file mode 100755 index 0000000..ed5d14f --- /dev/null +++ b/.githooks/commit-msg @@ -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 diff --git a/README.md b/README.md index e82a0d2..149ae5b 100644 --- a/README.md +++ b/README.md @@ -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