@happychef/algorithm 1.2.12 → 1.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/.github/workflows/ci-cd.yml +234 -234
  2. package/BRANCH_PROTECTION_SETUP.md +167 -167
  3. package/CHANGELOG.md +8 -8
  4. package/README.md +144 -144
  5. package/RESERVERINGEN_GIDS.md +986 -986
  6. package/__tests__/filters.test.js +276 -276
  7. package/__tests__/isDateAvailable.test.js +175 -175
  8. package/__tests__/isTimeAvailable.test.js +168 -168
  9. package/__tests__/restaurantData.test.js +422 -422
  10. package/__tests__/tableHelpers.test.js +247 -247
  11. package/assignTables.js +443 -424
  12. package/changes/2025/December/PR2___change.md +14 -14
  13. package/changes/2025/December/PR3_add__change.md +20 -20
  14. package/changes/2025/December/PR4___.md +15 -15
  15. package/changes/2025/December/PR5___.md +15 -15
  16. package/changes/2025/December/PR6__del_.md +17 -17
  17. package/changes/2025/December/PR7_add__change.md +21 -21
  18. package/changes/2026/January/PR10_add__change.md +22 -0
  19. package/changes/2026/January/PR8_add__change.md +38 -38
  20. package/changes/2026/January/PR9_add__change.md +19 -19
  21. package/filters/maxArrivalsFilter.js +114 -114
  22. package/filters/maxGroupsFilter.js +221 -221
  23. package/filters/timeFilter.js +89 -89
  24. package/getAvailableTimeblocks.js +158 -158
  25. package/grouping.js +162 -162
  26. package/index.js +42 -42
  27. package/isDateAvailable.js +80 -80
  28. package/isDateAvailableWithTableCheck.js +172 -171
  29. package/isTimeAvailable.js +25 -25
  30. package/jest.config.js +23 -23
  31. package/package.json +27 -27
  32. package/processing/dailyGuestCounts.js +73 -73
  33. package/processing/mealTypeCount.js +133 -133
  34. package/processing/timeblocksAvailable.js +182 -167
  35. package/reservation_data/counter.js +74 -64
  36. package/restaurant_data/exceptions.js +149 -149
  37. package/restaurant_data/openinghours.js +123 -123
  38. package/simulateTableAssignment.js +726 -709
  39. package/tableHelpers.js +178 -178
  40. package/tables/time/parseTime.js +19 -19
  41. package/tables/time/shifts.js +7 -7
  42. package/tables/utils/calculateDistance.js +13 -13
  43. package/tables/utils/isTableFreeForAllSlots.js +14 -14
  44. package/tables/utils/isTemporaryTableValid.js +39 -39
  45. package/test/test_counter.js +194 -194
  46. package/test/test_dailyCount.js +81 -81
  47. package/test/test_datesAvailable.js +106 -106
  48. package/test/test_exceptions.js +172 -172
  49. package/test/test_isDateAvailable.js +330 -330
  50. package/test/test_mealTypeCount.js +54 -54
  51. package/test/test_timesAvailable.js +88 -88
  52. package/test-detailed-filter.js +100 -100
  53. package/test-lunch-debug.js +110 -110
  54. package/test-max-arrivals-filter.js +79 -79
  55. package/test-meal-stop-fix.js +147 -147
  56. package/test-meal-stop-simple.js +93 -93
  57. package/test-timezone-debug.js +47 -47
  58. package/test.js +336 -336
@@ -1,167 +1,167 @@
1
- # Branch Protection Setup Guide
2
-
3
- This guide explains how to configure GitHub branch protection rules to require all tests to pass before merging pull requests.
4
-
5
- ## Why Branch Protection?
6
-
7
- Branch protection ensures:
8
- - ✅ All tests must pass before merging PRs
9
- - ✅ No direct pushes to main without review (optional)
10
- - ✅ Code quality is maintained
11
- - ✅ Broken code never reaches production
12
-
13
- ## Setup Instructions
14
-
15
- ### Step 1: Go to Branch Protection Settings
16
-
17
- 1. Navigate to your GitHub repository: `https://github.com/thibaultvandesompele2/15-happy-algorithm`
18
- 2. Click on **Settings** (tab at the top)
19
- 3. In the left sidebar, click **Branches** (under "Code and automation")
20
- 4. Click **Add branch protection rule** (or **Add rule**)
21
-
22
- ### Step 2: Configure the Rule
23
-
24
- #### Basic Settings:
25
- 1. **Branch name pattern**: Enter `main`
26
-
27
- #### Required Settings:
28
-
29
- ✅ **Check these boxes:**
30
-
31
- 1. ☑️ **Require a pull request before merging**
32
- - This prevents direct pushes to main
33
- - Optional: Set "Required number of approvals" to 1 or more
34
-
35
- 2. ☑️ **Require status checks to pass before merging**
36
- - This is the CRITICAL setting for test enforcement
37
- - Check: **Require branches to be up to date before merging**
38
-
39
- 3. In the **Status checks** search box, you'll see:
40
- - `Run Tests` (your test job)
41
-
42
- ☑️ **Select both Node.js test jobs:**
43
- - `Run Tests (18.x)`
44
- - `Run Tests (20.x)`
45
-
46
- *Note: These will appear after the first workflow run completes*
47
-
48
- 4. ☑️ **Do not allow bypassing the above settings** (recommended)
49
- - Even admins must follow these rules
50
-
51
- #### Optional but Recommended:
52
-
53
- 5. ☑️ **Require conversation resolution before merging**
54
- - All PR comments must be resolved
55
-
56
- 6. ☑️ **Require linear history**
57
- - Prevents messy merge commits
58
-
59
- ### Step 3: Save
60
-
61
- 1. Scroll to the bottom
62
- 2. Click **Create** or **Save changes**
63
-
64
- ## What Happens After Setup
65
-
66
- ### On Pull Requests:
67
- - GitHub automatically runs the CI/CD tests
68
- - You'll see status checks at the bottom of the PR
69
- - **Merge button will be DISABLED** until all tests pass
70
- - If tests fail, you must fix them before merging
71
-
72
- ### Visual Indicators:
73
-
74
- **Tests Running:**
75
- ```
76
- ⏳ Run Tests (18.x) — In progress
77
- ⏳ Run Tests (20.x) — In progress
78
- ```
79
-
80
- **Tests Passed:**
81
- ```
82
- ✅ Run Tests (18.x) — Passed
83
- ✅ Run Tests (20.x) — Passed
84
- 🟢 Merge pull request button is ENABLED
85
- ```
86
-
87
- **Tests Failed:**
88
- ```
89
- ❌ Run Tests (18.x) — Failed
90
- ❌ Run Tests (20.x) — Failed
91
- 🔴 Merge pull request button is DISABLED
92
- ```
93
-
94
- ## Testing the Protection
95
-
96
- ### Create a Test PR:
97
-
98
- 1. Create a new branch:
99
- ```bash
100
- git checkout -b test-branch-protection
101
- ```
102
-
103
- 2. Make a small change:
104
- ```bash
105
- echo "# Test" >> test-file.txt
106
- git add test-file.txt
107
- git commit -m "Test branch protection"
108
- git push origin test-branch-protection
109
- ```
110
-
111
- 3. Go to GitHub and create a pull request
112
-
113
- 4. Observe:
114
- - Tests run automatically
115
- - Merge button is disabled until tests complete
116
- - After tests pass, merge button becomes available
117
-
118
- ## Workflow Behavior
119
-
120
- ### For Pull Requests:
121
- - ✅ Runs all 70 tests on Node.js 18.x and 20.x
122
- - ✅ Must pass before merge is allowed
123
- - ✅ Shows test summary in PR
124
- - ❌ Does NOT publish to npm (only tests)
125
-
126
- ### For Pushes to Main:
127
- - ✅ Runs all tests
128
- - ✅ If version changed AND tests pass → publishes to npm
129
- - ✅ Creates git tag
130
- - ✅ Shows summary of all actions
131
-
132
- ## Troubleshooting
133
-
134
- ### "Status checks not found"
135
- - The status checks only appear after the first workflow run completes
136
- - Push this branch protection setup, wait for workflow to run, then configure protection
137
-
138
- ### "Can't find Run Tests in status checks"
139
- - Make sure the workflow has run at least once
140
- - Check the Actions tab to see workflow runs
141
- - The job name must match exactly: `Run Tests`
142
-
143
- ### "Tests are running but merge button isn't disabled"
144
- - You need to enable "Require status checks to pass before merging"
145
- - Make sure you selected the specific test jobs (18.x and 20.x)
146
-
147
- ## Quick Setup Checklist
148
-
149
- - [ ] Go to Settings → Branches
150
- - [ ] Add branch protection rule for `main`
151
- - [ ] Enable "Require status checks to pass before merging"
152
- - [ ] Select `Run Tests (18.x)` and `Run Tests (20.x)`
153
- - [ ] Enable "Do not allow bypassing"
154
- - [ ] Save the rule
155
- - [ ] Test with a PR
156
-
157
- ## Additional Security (Optional)
158
-
159
- For additional security, you can also enable:
160
-
161
- - **Require deployments to succeed** - Wait for tests before deploying
162
- - **Lock branch** - Temporarily prevent all changes
163
- - **Restrict who can push** - Only specific users/teams can push
164
-
165
- ---
166
-
167
- **Result:** After setup, no code can be merged to `main` without passing all 70 tests! 🎉
1
+ # Branch Protection Setup Guide
2
+
3
+ This guide explains how to configure GitHub branch protection rules to require all tests to pass before merging pull requests.
4
+
5
+ ## Why Branch Protection?
6
+
7
+ Branch protection ensures:
8
+ - ✅ All tests must pass before merging PRs
9
+ - ✅ No direct pushes to main without review (optional)
10
+ - ✅ Code quality is maintained
11
+ - ✅ Broken code never reaches production
12
+
13
+ ## Setup Instructions
14
+
15
+ ### Step 1: Go to Branch Protection Settings
16
+
17
+ 1. Navigate to your GitHub repository: `https://github.com/thibaultvandesompele2/15-happy-algorithm`
18
+ 2. Click on **Settings** (tab at the top)
19
+ 3. In the left sidebar, click **Branches** (under "Code and automation")
20
+ 4. Click **Add branch protection rule** (or **Add rule**)
21
+
22
+ ### Step 2: Configure the Rule
23
+
24
+ #### Basic Settings:
25
+ 1. **Branch name pattern**: Enter `main`
26
+
27
+ #### Required Settings:
28
+
29
+ ✅ **Check these boxes:**
30
+
31
+ 1. ☑️ **Require a pull request before merging**
32
+ - This prevents direct pushes to main
33
+ - Optional: Set "Required number of approvals" to 1 or more
34
+
35
+ 2. ☑️ **Require status checks to pass before merging**
36
+ - This is the CRITICAL setting for test enforcement
37
+ - Check: **Require branches to be up to date before merging**
38
+
39
+ 3. In the **Status checks** search box, you'll see:
40
+ - `Run Tests` (your test job)
41
+
42
+ ☑️ **Select both Node.js test jobs:**
43
+ - `Run Tests (18.x)`
44
+ - `Run Tests (20.x)`
45
+
46
+ *Note: These will appear after the first workflow run completes*
47
+
48
+ 4. ☑️ **Do not allow bypassing the above settings** (recommended)
49
+ - Even admins must follow these rules
50
+
51
+ #### Optional but Recommended:
52
+
53
+ 5. ☑️ **Require conversation resolution before merging**
54
+ - All PR comments must be resolved
55
+
56
+ 6. ☑️ **Require linear history**
57
+ - Prevents messy merge commits
58
+
59
+ ### Step 3: Save
60
+
61
+ 1. Scroll to the bottom
62
+ 2. Click **Create** or **Save changes**
63
+
64
+ ## What Happens After Setup
65
+
66
+ ### On Pull Requests:
67
+ - GitHub automatically runs the CI/CD tests
68
+ - You'll see status checks at the bottom of the PR
69
+ - **Merge button will be DISABLED** until all tests pass
70
+ - If tests fail, you must fix them before merging
71
+
72
+ ### Visual Indicators:
73
+
74
+ **Tests Running:**
75
+ ```
76
+ ⏳ Run Tests (18.x) — In progress
77
+ ⏳ Run Tests (20.x) — In progress
78
+ ```
79
+
80
+ **Tests Passed:**
81
+ ```
82
+ ✅ Run Tests (18.x) — Passed
83
+ ✅ Run Tests (20.x) — Passed
84
+ 🟢 Merge pull request button is ENABLED
85
+ ```
86
+
87
+ **Tests Failed:**
88
+ ```
89
+ ❌ Run Tests (18.x) — Failed
90
+ ❌ Run Tests (20.x) — Failed
91
+ 🔴 Merge pull request button is DISABLED
92
+ ```
93
+
94
+ ## Testing the Protection
95
+
96
+ ### Create a Test PR:
97
+
98
+ 1. Create a new branch:
99
+ ```bash
100
+ git checkout -b test-branch-protection
101
+ ```
102
+
103
+ 2. Make a small change:
104
+ ```bash
105
+ echo "# Test" >> test-file.txt
106
+ git add test-file.txt
107
+ git commit -m "Test branch protection"
108
+ git push origin test-branch-protection
109
+ ```
110
+
111
+ 3. Go to GitHub and create a pull request
112
+
113
+ 4. Observe:
114
+ - Tests run automatically
115
+ - Merge button is disabled until tests complete
116
+ - After tests pass, merge button becomes available
117
+
118
+ ## Workflow Behavior
119
+
120
+ ### For Pull Requests:
121
+ - ✅ Runs all 70 tests on Node.js 18.x and 20.x
122
+ - ✅ Must pass before merge is allowed
123
+ - ✅ Shows test summary in PR
124
+ - ❌ Does NOT publish to npm (only tests)
125
+
126
+ ### For Pushes to Main:
127
+ - ✅ Runs all tests
128
+ - ✅ If version changed AND tests pass → publishes to npm
129
+ - ✅ Creates git tag
130
+ - ✅ Shows summary of all actions
131
+
132
+ ## Troubleshooting
133
+
134
+ ### "Status checks not found"
135
+ - The status checks only appear after the first workflow run completes
136
+ - Push this branch protection setup, wait for workflow to run, then configure protection
137
+
138
+ ### "Can't find Run Tests in status checks"
139
+ - Make sure the workflow has run at least once
140
+ - Check the Actions tab to see workflow runs
141
+ - The job name must match exactly: `Run Tests`
142
+
143
+ ### "Tests are running but merge button isn't disabled"
144
+ - You need to enable "Require status checks to pass before merging"
145
+ - Make sure you selected the specific test jobs (18.x and 20.x)
146
+
147
+ ## Quick Setup Checklist
148
+
149
+ - [ ] Go to Settings → Branches
150
+ - [ ] Add branch protection rule for `main`
151
+ - [ ] Enable "Require status checks to pass before merging"
152
+ - [ ] Select `Run Tests (18.x)` and `Run Tests (20.x)`
153
+ - [ ] Enable "Do not allow bypassing"
154
+ - [ ] Save the rule
155
+ - [ ] Test with a PR
156
+
157
+ ## Additional Security (Optional)
158
+
159
+ For additional security, you can also enable:
160
+
161
+ - **Require deployments to succeed** - Wait for tests before deploying
162
+ - **Lock branch** - Temporarily prevent all changes
163
+ - **Restrict who can push** - Only specific users/teams can push
164
+
165
+ ---
166
+
167
+ **Result:** After setup, no code can be merged to `main` without passing all 70 tests! 🎉
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- PR 2:
2
- ADDED:
3
- - Modified the `getAvailableTimeblocks.js` file to change the default value of `uurOpVoorhand` from 4 hours to 0 hours, enabling immediate bookings when the field is not explicitly set in general settings.
4
-
5
- REMOVED:
6
- - No functions, features, or code were removed; only a configuration default value was updated.
7
-
8
- ---
1
+ PR 2:
2
+ ADDED:
3
+ - Modified the `getAvailableTimeblocks.js` file to change the default value of `uurOpVoorhand` from 4 hours to 0 hours, enabling immediate bookings when the field is not explicitly set in general settings.
4
+
5
+ REMOVED:
6
+ - No functions, features, or code were removed; only a configuration default value was updated.
7
+
8
+ ---
package/README.md CHANGED
@@ -1,144 +1,144 @@
1
- # @happychef/algorithm
2
-
3
- Restaurant and reservation algorithm utilities for Happy Chef.
4
-
5
- [![CI/CD Pipeline](https://github.com/YOUR_USERNAME/YOUR_REPO/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/YOUR_USERNAME/YOUR_REPO/actions/workflows/ci-cd.yml)
6
- [![codecov](https://codecov.io/gh/YOUR_USERNAME/YOUR_REPO/branch/main/graph/badge.svg)](https://codecov.io/gh/YOUR_USERNAME/YOUR_REPO)
7
- [![npm version](https://badge.fury.io/js/%40happychef%2Falgorithm.svg)](https://www.npmjs.com/package/@happychef/algorithm)
8
-
9
- ## Installation
10
-
11
- ```bash
12
- npm install @happychef/algorithm
13
- ```
14
-
15
- ## Features
16
-
17
- - **Date & Time Availability**: Check if specific dates and times are available for reservations
18
- - **Timeblock Management**: Get available timeblocks based on restaurant settings
19
- - **Table Assignment**: Automatically assign tables to reservations
20
- - **Smart Filtering**: Filter timeblocks based on max arrivals, max groups, and other constraints
21
- - **Exception Handling**: Support for restaurant opening hours exceptions and closures
22
- - **Comprehensive Testing**: 70+ unit tests ensuring reliability
23
-
24
- ## Usage
25
-
26
- ```javascript
27
- const {
28
- isDateAvailable,
29
- isTimeAvailable,
30
- getAvailableTimeblocks,
31
- assignTablesIfPossible
32
- } = require('@happychef/algorithm');
33
-
34
- // Check if a date is available
35
- const available = isDateAvailable(
36
- restaurantData,
37
- '2025-06-15',
38
- reservations,
39
- guests
40
- );
41
-
42
- // Get available timeblocks
43
- const timeblocks = getAvailableTimeblocks(
44
- restaurantData,
45
- '2025-06-15',
46
- reservations,
47
- guests
48
- );
49
-
50
- // Check if specific time is available
51
- const timeAvailable = isTimeAvailable(
52
- restaurantData,
53
- '2025-06-15',
54
- '12:00',
55
- reservations,
56
- guests
57
- );
58
- ```
59
-
60
- ## Development
61
-
62
- ### Running Tests
63
-
64
- ```bash
65
- # Run all tests
66
- npm test
67
-
68
- # Run tests in watch mode
69
- npm run test:watch
70
-
71
- # Run tests with coverage
72
- npm run test:coverage
73
- ```
74
-
75
- ### Test Coverage
76
-
77
- The package includes comprehensive unit tests covering:
78
- - Helper functions (parseTime, getMealTypeByTime, etc.)
79
- - Date and time availability checks
80
- - Timeblock filtering
81
- - Restaurant data and exceptions handling
82
- - Table assignment logic
83
- - Filter functions (max arrivals, max groups)
84
-
85
- All tests are automatically run on every push to the main branch via GitHub Actions.
86
-
87
- ## CI/CD Pipeline
88
-
89
- This package uses GitHub Actions for continuous integration and deployment:
90
-
91
- 1. **Automated Testing**: Tests run on Node.js 18.x and 20.x
92
- 2. **Coverage Reports**: Automatically uploaded to Codecov
93
- 3. **Automatic Publishing**: When tests pass on main branch and version changes, package is automatically published to npm
94
- 4. **Git Tagging**: Successful releases are automatically tagged
95
-
96
- ### Setup Instructions
97
-
98
- To enable automatic publishing:
99
-
100
- 1. **Create an NPM Token**:
101
- - Go to [npmjs.com](https://www.npmjs.com/)
102
- - Navigate to Access Tokens
103
- - Generate a new "Automation" token
104
- - Copy the token
105
-
106
- 2. **Add NPM Token to GitHub Secrets**:
107
- - Go to your GitHub repository
108
- - Navigate to Settings > Secrets and variables > Actions
109
- - Click "New repository secret"
110
- - Name: `NPM_TOKEN`
111
- - Value: Paste your NPM token
112
- - Click "Add secret"
113
-
114
- 3. **Optional: Add Codecov Token** (for coverage reports):
115
- - Go to [codecov.io](https://codecov.io/)
116
- - Add your repository
117
- - Copy the token
118
- - Add as `CODECOV_TOKEN` secret in GitHub
119
-
120
- 4. **Publish New Version**:
121
- - Update version in `package.json`
122
- - Commit and push to main branch
123
- - GitHub Actions will automatically:
124
- - Run all tests
125
- - Publish to npm if tests pass
126
- - Create a git tag for the release
127
-
128
- ## Contributing
129
-
130
- 1. Fork the repository
131
- 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
132
- 3. Write tests for your changes
133
- 4. Ensure all tests pass (`npm test`)
134
- 5. Commit your changes (`git commit -m 'Add some amazing feature'`)
135
- 6. Push to the branch (`git push origin feature/amazing-feature`)
136
- 7. Open a Pull Request
137
-
138
- ## License
139
-
140
- MIT
141
-
142
- ## Author
143
-
144
- Happy Chef
1
+ # @happychef/algorithm
2
+
3
+ Restaurant and reservation algorithm utilities for Happy Chef.
4
+
5
+ [![CI/CD Pipeline](https://github.com/YOUR_USERNAME/YOUR_REPO/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/YOUR_USERNAME/YOUR_REPO/actions/workflows/ci-cd.yml)
6
+ [![codecov](https://codecov.io/gh/YOUR_USERNAME/YOUR_REPO/branch/main/graph/badge.svg)](https://codecov.io/gh/YOUR_USERNAME/YOUR_REPO)
7
+ [![npm version](https://badge.fury.io/js/%40happychef%2Falgorithm.svg)](https://www.npmjs.com/package/@happychef/algorithm)
8
+
9
+ ## Installation
10
+
11
+ ```bash
12
+ npm install @happychef/algorithm
13
+ ```
14
+
15
+ ## Features
16
+
17
+ - **Date & Time Availability**: Check if specific dates and times are available for reservations
18
+ - **Timeblock Management**: Get available timeblocks based on restaurant settings
19
+ - **Table Assignment**: Automatically assign tables to reservations
20
+ - **Smart Filtering**: Filter timeblocks based on max arrivals, max groups, and other constraints
21
+ - **Exception Handling**: Support for restaurant opening hours exceptions and closures
22
+ - **Comprehensive Testing**: 70+ unit tests ensuring reliability
23
+
24
+ ## Usage
25
+
26
+ ```javascript
27
+ const {
28
+ isDateAvailable,
29
+ isTimeAvailable,
30
+ getAvailableTimeblocks,
31
+ assignTablesIfPossible
32
+ } = require('@happychef/algorithm');
33
+
34
+ // Check if a date is available
35
+ const available = isDateAvailable(
36
+ restaurantData,
37
+ '2025-06-15',
38
+ reservations,
39
+ guests
40
+ );
41
+
42
+ // Get available timeblocks
43
+ const timeblocks = getAvailableTimeblocks(
44
+ restaurantData,
45
+ '2025-06-15',
46
+ reservations,
47
+ guests
48
+ );
49
+
50
+ // Check if specific time is available
51
+ const timeAvailable = isTimeAvailable(
52
+ restaurantData,
53
+ '2025-06-15',
54
+ '12:00',
55
+ reservations,
56
+ guests
57
+ );
58
+ ```
59
+
60
+ ## Development
61
+
62
+ ### Running Tests
63
+
64
+ ```bash
65
+ # Run all tests
66
+ npm test
67
+
68
+ # Run tests in watch mode
69
+ npm run test:watch
70
+
71
+ # Run tests with coverage
72
+ npm run test:coverage
73
+ ```
74
+
75
+ ### Test Coverage
76
+
77
+ The package includes comprehensive unit tests covering:
78
+ - Helper functions (parseTime, getMealTypeByTime, etc.)
79
+ - Date and time availability checks
80
+ - Timeblock filtering
81
+ - Restaurant data and exceptions handling
82
+ - Table assignment logic
83
+ - Filter functions (max arrivals, max groups)
84
+
85
+ All tests are automatically run on every push to the main branch via GitHub Actions.
86
+
87
+ ## CI/CD Pipeline
88
+
89
+ This package uses GitHub Actions for continuous integration and deployment:
90
+
91
+ 1. **Automated Testing**: Tests run on Node.js 18.x and 20.x
92
+ 2. **Coverage Reports**: Automatically uploaded to Codecov
93
+ 3. **Automatic Publishing**: When tests pass on main branch and version changes, package is automatically published to npm
94
+ 4. **Git Tagging**: Successful releases are automatically tagged
95
+
96
+ ### Setup Instructions
97
+
98
+ To enable automatic publishing:
99
+
100
+ 1. **Create an NPM Token**:
101
+ - Go to [npmjs.com](https://www.npmjs.com/)
102
+ - Navigate to Access Tokens
103
+ - Generate a new "Automation" token
104
+ - Copy the token
105
+
106
+ 2. **Add NPM Token to GitHub Secrets**:
107
+ - Go to your GitHub repository
108
+ - Navigate to Settings > Secrets and variables > Actions
109
+ - Click "New repository secret"
110
+ - Name: `NPM_TOKEN`
111
+ - Value: Paste your NPM token
112
+ - Click "Add secret"
113
+
114
+ 3. **Optional: Add Codecov Token** (for coverage reports):
115
+ - Go to [codecov.io](https://codecov.io/)
116
+ - Add your repository
117
+ - Copy the token
118
+ - Add as `CODECOV_TOKEN` secret in GitHub
119
+
120
+ 4. **Publish New Version**:
121
+ - Update version in `package.json`
122
+ - Commit and push to main branch
123
+ - GitHub Actions will automatically:
124
+ - Run all tests
125
+ - Publish to npm if tests pass
126
+ - Create a git tag for the release
127
+
128
+ ## Contributing
129
+
130
+ 1. Fork the repository
131
+ 2. Create your feature branch (`git checkout -b feature/amazing-feature`)
132
+ 3. Write tests for your changes
133
+ 4. Ensure all tests pass (`npm test`)
134
+ 5. Commit your changes (`git commit -m 'Add some amazing feature'`)
135
+ 6. Push to the branch (`git push origin feature/amazing-feature`)
136
+ 7. Open a Pull Request
137
+
138
+ ## License
139
+
140
+ MIT
141
+
142
+ ## Author
143
+
144
+ Happy Chef