@neezco/cache 0.1.1 → 0.2.1
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.
- package/CHANGELOG.md +23 -0
- package/dist/browser/index.d.ts +19 -4
- package/dist/browser/index.js +61 -15
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +62 -15
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +19 -4
- package/dist/node/index.d.mts +19 -4
- package/dist/node/index.mjs +62 -15
- package/dist/node/index.mjs.map +1 -1
- package/docs/api-reference.md +17 -4
- package/docs/configuration.md +41 -2
- package/docs/contributing/code-style.md +40 -0
- package/docs/contributing/issues.md +30 -0
- package/docs/contributing/project-structure.md +35 -0
- package/docs/contributing/scripts.md +38 -0
- package/docs/contributing/setup.md +49 -0
- package/docs/contributing/workflow.md +71 -0
- package/package.json +3 -3
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# Available Scripts
|
|
2
|
+
|
|
3
|
+
Use these scripts during development:
|
|
4
|
+
|
|
5
|
+
## Building
|
|
6
|
+
|
|
7
|
+
| Script | Purpose |
|
|
8
|
+
| ------------------ | ---------------------------------------------- |
|
|
9
|
+
| `pnpm build` | Transpiles TypeScript to JavaScript |
|
|
10
|
+
| `pnpm build:watch` | Watches for changes and rebuilds automatically |
|
|
11
|
+
|
|
12
|
+
## Linting & Formatting
|
|
13
|
+
|
|
14
|
+
| Script | Purpose |
|
|
15
|
+
| ---------------------- | ----------------------------------------- |
|
|
16
|
+
| `pnpm lint` | Runs ESLint to detect code quality issues |
|
|
17
|
+
| `pnpm lint:fix` | Automatically fixes ESLint problems |
|
|
18
|
+
| `pnpm format:prettier` | Formats the entire codebase with Prettier |
|
|
19
|
+
| `pnpm format:all` | Runs linting fixes and Prettier together |
|
|
20
|
+
|
|
21
|
+
## Type Checking & Validation
|
|
22
|
+
|
|
23
|
+
| Script | Purpose |
|
|
24
|
+
| ---------------- | ------------------------------------------------------------------------ |
|
|
25
|
+
| `pnpm typecheck` | Runs TypeScript type checker without emitting files |
|
|
26
|
+
| `pnpm check:all` | **Run before committing.** Runs formatting and type checking in parallel |
|
|
27
|
+
|
|
28
|
+
## Testing
|
|
29
|
+
|
|
30
|
+
| Script | Purpose |
|
|
31
|
+
| -------------------- | ---------------------------------------------------- |
|
|
32
|
+
| `pnpm test` | Runs the test suite once |
|
|
33
|
+
| `pnpm test:watch` | Runs tests in watch mode (useful during development) |
|
|
34
|
+
| `pnpm test:coverage` | Generates test coverage reports |
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
**Before committing:** Always run `pnpm check:all` to ensure everything passes.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# Setting Up Your Environment
|
|
2
|
+
|
|
3
|
+
## Prerequisites
|
|
4
|
+
|
|
5
|
+
This repository comes pre-configured with:
|
|
6
|
+
|
|
7
|
+
- **ESLint** for linting
|
|
8
|
+
- **Prettier** for formatting
|
|
9
|
+
- **Husky** for Git hooks
|
|
10
|
+
- **Conventional Commits** validation
|
|
11
|
+
- **Type checking** and **test scripts**
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
1. **Fork and clone** the repository:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
git clone https://github.com/YOUR_USERNAME/cache.git
|
|
19
|
+
cd cache
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
2. **Add upstream repository**:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
git remote add upstream https://github.com/neezco/cache.git
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
3. **Install dependencies**:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm install
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
4. **Initialize Husky** for Git hooks:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm prepare
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## What Husky Does
|
|
41
|
+
|
|
42
|
+
Once initialized, Husky automatically validates your changes:
|
|
43
|
+
|
|
44
|
+
| Hook | What it runs |
|
|
45
|
+
| -------------- | ----------------------------------- |
|
|
46
|
+
| **Pre-commit** | ESLint, Prettier, and type checking |
|
|
47
|
+
| **Pre-push** | Full test suite |
|
|
48
|
+
|
|
49
|
+
You're ready to start contributing!
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Contribution Workflow
|
|
2
|
+
|
|
3
|
+
## 1. Create a Feature Branch
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
git checkout -b feat/your-feature-name
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
Use conventional commit types for branch names:
|
|
10
|
+
|
|
11
|
+
- `feat/` for features
|
|
12
|
+
- `fix/` for bug fixes
|
|
13
|
+
- `docs/` for documentation
|
|
14
|
+
- `refactor/` for refactoring
|
|
15
|
+
|
|
16
|
+
## 2. Make Your Changes
|
|
17
|
+
|
|
18
|
+
Follow the [Code Style Guidelines](code-style.md).
|
|
19
|
+
|
|
20
|
+
## 3. Verify Your Work
|
|
21
|
+
|
|
22
|
+
Run the full check suite before committing:
|
|
23
|
+
|
|
24
|
+
```bash
|
|
25
|
+
pnpm check:all
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
This runs formatting, linting, and type checking in parallel.
|
|
29
|
+
|
|
30
|
+
## 4. Commit with Conventional Commits
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
git commit -m "feat: add your feature"
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
Husky validates your commit message. Use these types:
|
|
37
|
+
|
|
38
|
+
| Type | Purpose |
|
|
39
|
+
| ----------- | ----------------------------------------- |
|
|
40
|
+
| `feat:` | A new feature |
|
|
41
|
+
| `fix:` | A bug fix |
|
|
42
|
+
| `docs:` | Documentation changes |
|
|
43
|
+
| `style:` | Formatting only (no code changes) |
|
|
44
|
+
| `refactor:` | Code refactoring without behavior changes |
|
|
45
|
+
| `test:` | Adding or updating tests |
|
|
46
|
+
| `chore:` | Maintenance tasks (configs, tooling, CI) |
|
|
47
|
+
|
|
48
|
+
### Examples
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
git commit -m "feat: add has method to LocalTtlCache"
|
|
52
|
+
git commit -m "fix: prevent expired entries from being returned"
|
|
53
|
+
git commit -m "test: add test coverage for stale window behavior"
|
|
54
|
+
git commit -m "docs: update API reference"
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## 5. Push and Create a Pull Request
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
git push origin feat/your-feature-name
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Then create a pull request on GitHub:
|
|
64
|
+
|
|
65
|
+
- Reference any related issues
|
|
66
|
+
- Provide a clear description of your changes
|
|
67
|
+
- Ensure all tests and checks pass
|
|
68
|
+
|
|
69
|
+
---
|
|
70
|
+
|
|
71
|
+
**That's it!** The maintainers will review your PR soon.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neezco/cache",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"module": "./dist/
|
|
4
|
+
"module": "./dist/browser/index.js",
|
|
5
5
|
"main": "./dist/node/index.cjs",
|
|
6
6
|
"types": "./dist/node/index.d.cts",
|
|
7
7
|
"author": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"exports": {
|
|
21
21
|
".": {
|
|
22
22
|
"require": "./dist/node/index.cjs",
|
|
23
|
-
"import": "./dist/
|
|
23
|
+
"import": "./dist/browser/index.js"
|
|
24
24
|
},
|
|
25
25
|
"./package.json": "./package.json"
|
|
26
26
|
},
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"node": ">=24.12.0",
|
|
90
90
|
"pnpm": ">=10.27.0"
|
|
91
91
|
},
|
|
92
|
-
"version": "0.
|
|
92
|
+
"version": "0.2.1"
|
|
93
93
|
}
|