Skip to content

Commit 0c2a674

Browse files
authored
Merge pull request #354 from trojs/feature/auto-merge
Auto merge package updates from renovate
2 parents 3c037b4 + f07efff commit 0c2a674

5 files changed

Lines changed: 422 additions & 224 deletions

File tree

.github/copilot-instructions.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# Copilot Instructions
2+
3+
## Philosophy
4+
5+
- **Pure Functions**: Favor pure functions (no side effects, no mutation, deterministic) as advocated by Eric Elliott.
6+
- **Test-Driven Development (TDD)**: Write tests first, code in small, testable increments, following Uncle Bob’s TDD cycle.
7+
- **Extreme Programming (XP)**: Embrace simplicity, communication, feedback, and courage. Prefer small, frequent, high-quality changes.
8+
- **Framework Agnostic**: Do not use any frameworks or libraries unless explicitly requested. Use only standard JavaScript (ESM).
9+
- **JSDoc**: All functions, classes, and modules must be documented with JSDoc for type safety and clarity.
10+
- **Design Patterns**: Use classic, well-known patterns (factory, strategy, observer, etc.) only when they add clarity or testability.
11+
- **Clean Code**: Prioritize readability, maintainability, and simplicity. Avoid cleverness for its own sake.
12+
- **Testability**: All code should be easily testable. Avoid hidden dependencies and global state.
13+
- **Small Iterations**: Make small, incremental changes. Each change should be easy to review and test.
14+
- **No Frameworks**: Do not use React, Vue, Angular, or any other framework. No build tools unless explicitly requested.
15+
16+
## Coding Guidelines
17+
18+
- Use **ES Modules** (`import`/`export`).
19+
- Use **pure functions** wherever possible.
20+
- Use **const** and **let** (never `var`).
21+
- Use **arrow functions** for short, stateless functions.
22+
- Use **descriptive names** for variables, functions, and classes.
23+
- **No mutation** of input arguments.
24+
- **No side effects** in pure functions.
25+
- **No global state** unless absolutely necessary (and then, document it).
26+
- **JSDoc** for every function, class, and exported symbol.
27+
- **Write a test** for every new function or feature (see `/src/*.test.js` for examples).
28+
- **Keep files small** and focused on a single responsibility.
29+
- **No magic numbers**—use named constants.
30+
- **No unnecessary abstractions**—keep it simple.
31+
32+
## Example Function
33+
34+
```js
35+
/**
36+
* Adds two numbers (pure function).
37+
* @param {number} a
38+
* @param {number} b
39+
* @returns {number}
40+
*/
41+
export const add = (a, b) => a + b
42+
```
43+
44+
## Example Test
45+
46+
```js
47+
import assert from 'node:assert/strict'
48+
import { add } from './add.js'
49+
50+
assert.equal(add(2, 3), 5)
51+
```
52+
53+
## When in Doubt
54+
55+
- **Ask for clarification** if requirements are unclear.
56+
- **Prefer simplicity** over cleverness.
57+
- **Write tests** for all edge cases.
58+
- **Document** all exported symbols with JSDoc.
59+
60+
---
61+
62+
**Summary:**
63+
Write clean, pure, framework-agnostic JavaScript (ESM) with JSDoc and tests.
64+
Favor small, testable, incremental changes.
65+
No frameworks, no unnecessary abstractions, no side effects.
66+
67+
---
68+

.github/workflows/test.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,20 @@ jobs:
88

99
strategy:
1010
matrix:
11-
node-version: [20.x, 22.x, 23.x]
11+
node-version: [20.x, 22.x, 23.x, 24.x]
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
- name: Cache node_modules
16+
uses: actions/cache@v4
17+
with:
18+
path: |
19+
~/.npm
20+
node_modules
21+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
22+
restore-keys: |
23+
${{ runner.os }}-node-${{ matrix.node-version }}-
24+
1525
- name: Use Node.js ${{ matrix.node-version }}
1626
uses: actions/setup-node@v4
1727
with:

.nvmrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
22.16.0
1+
24

0 commit comments

Comments
 (0)