Skip to content

Commit 6881d2e

Browse files
authored
chore: update documentation (#61)
* feat: Enhance troubleshooting and documentation for geospatial and datetime operators - Updated troubleshooting guide with detailed solutions for geospatial and datetime query issues. - Added new sections for geospatial queries, datetime filters, and performance optimizations. - Expanded operators implementation summary to include new geospatial and datetime operators. - Updated installation instructions to include yarn and pnpm. - Revised changelog to reflect the addition of 30+ operators and enhanced type system. - Updated roadmap with release details for v5.6.0 focusing on geospatial and datetime features. * feat: add comprehensive TypeScript type safety documentation - Introduced a new guide on TypeScript type safety in @mcabreradev/filter, covering features like dot notation paths, operator autocomplete, and advanced type patterns. - Added examples demonstrating basic type inference, explicit generic types, and dot notation type safety. - Included advanced type utilities such as NestedKeyOf, PathValue, and DeepPartial for enhanced type safety in filtering operations. refactor: enhance type helpers and utilities - Created a new file for type helpers, implementing NestedKeyOf, PathValue, DeepPartial, PrimitiveKeys, ObjectKeys, and NestedPaths. - Implemented utility functions for nested key access, validation, and manipulation of nested objects. fix: improve object predicate matching with case-insensitive comparison - Updated the createObjectPredicate function to handle case-insensitive string comparisons when caseSensitive is false. feat: introduce typed filter utilities - Added typedFilter function for type-safe filtering with dot notation support. - Created a TypedFilterBuilder class for building filter expressions with type safety. test: update vitest configuration for improved test coverage - Modified vitest configuration to include tests from the __test__ directory. * feat: enhance TypeScript type safety documentation with examples and best practices * Refactor code structure for improved readability and maintainability * feat(errors): introduce comprehensive error handling for filter operations - Added a new `error-helpers.ts` module to provide utility functions for error management. - Created a set of specific error classes (`InvalidExpressionError`, `OperatorError`, `ValidationError`, `TypeMismatchError`, `GeospatialError`, `ConfigurationError`, `PerformanceLimitError`) to represent various filter-related errors. - Implemented functions to create and format error messages, check for filter errors, and extract error details for logging. - Developed unit tests for the new error handling functionality to ensure robustness and correctness. feat(performance): implement performance monitoring for filter operations - Introduced a `PerformanceMonitor` class to track and log performance metrics for filter operations. - Added methods to start tracking operations, record durations, and retrieve metrics. - Implemented a global performance monitor instance for easy access and management. - Created unit tests to validate the performance monitoring functionality. fix(validation): improve error handling in validation functions - Updated `validateExpression` and `validateOptions` functions to throw specific errors (`InvalidExpressionError` and `ConfigurationError`) instead of generic errors. - Enhanced error messages to include detailed information about validation issues. * feat: enhance documentation and examples for @mcabreradev/filter - Updated React, Svelte, and Vue documentation to include modular import recommendations for reduced bundle size. - Added a comprehensive installation guide covering various package managers. - Introduced a new guide on modular imports detailing import styles and best practices. - Expanded the quick start guide with installation and import style sections. - Added new examples for analytics dashboard and e-commerce search scenarios. - Created new files for lazy evaluation functions and operators, improving modularity. - Updated core index to export relevant hooks for React integration. - Added missing operator files for array, comparison, datetime, geospatial, logical, and string operations. * fix(ci): update workflows to pnpm 10 and regenerate lockfile - Update all GitHub Actions workflows to use pnpm 10 - Regenerate pnpm-lock.yaml with compatible version - Fix CI frozen-lockfile compatibility error * chore: update bundle size limit to 66 KB - Increased from 65 KB to 66 KB to accommodate new features - Current size: 65.63 KB (within new limit) - Growth due to geospatial operators, datetime operators, and enhanced documentation * fix(ci): remove incompatible size-limit-action - Remove andresz1/size-limit-action@v1 (incompatible with pnpm) - Use direct pnpm size command instead - Fixes JSON parsing error in CI * perf: reduce bundle size from 65.63 KB to 12.02 KB (81% reduction) - Move zod to optional peer dependency (user installs if needed) - Move @vercel/analytics, @vue-leaflet, leaflet to devDependencies - Update size limit from 66 KB to 15 KB - All dependencies now excluded from main bundle - Core library is now truly zero-dependency BREAKING CHANGE: zod is now a peer dependency. Users who need runtime validation must install zod separately: pnpm add zod * perf: reduce bundle size from 65.63 KB to 12.02 KB (81% reduction) - Move zod to optional peer dependency (user installs if needed) - Move @vercel/analytics, @vue-leaflet, leaflet to devDependencies - Update size limit from 66 KB to 15 KB - All dependencies now excluded from main bundle - Core library is now truly zero-dependency BREAKING CHANGE: zod is now a peer dependency. Users who need runtime validation must install zod separately: pnpm add zod * docs: update VitePress documentation for zero dependencies - Update installation.md: Add note about optional Zod peer dependency - Update bundle size metrics from ~10 KB to ~12 KB throughout - Update index.md: Change to 'truly zero dependencies' messaging - Add v5.6.1 migration guide section in migration.md - Clarify validation features are optional and require Zod - Update bundle-size.md with new percentages (75%, 83%) - Emphasize 81% bundle size reduction achievement
1 parent 0f43cdd commit 6881d2e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+13879
-868
lines changed

.editorconfig

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
max_line_length = off
14+
15+
[*.{json,yml,yaml}]
16+
indent_size = 2
17+
18+
[*.ts]
19+
indent_size = 2
20+
max_line_length = 120
21+
22+
[*.tsx]
23+
indent_size = 2
24+
max_line_length = 120
25+
26+
[{package.json,*.yml,*.yaml}]
27+
indent_size = 2
Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: '[BUG] '
5+
labels: bug
6+
assignees: ''
7+
---
8+
9+
## Bug Description
10+
11+
A clear and concise description of what the bug is.
12+
13+
## To Reproduce
14+
15+
Steps to reproduce the behavior:
16+
17+
1. Go to '...'
18+
2. Click on '....'
19+
3. Scroll down to '....'
20+
4. See error
21+
22+
## Code Example
23+
24+
```typescript
25+
// Minimal code to reproduce the issue
26+
import { filter } from '@mcabreradev/filter';
27+
28+
const data = [
29+
{ name: 'Alice', age: 30 },
30+
{ name: 'Bob', age: 25 }
31+
];
32+
33+
const result = filter(data, { age: { $gte: 18 } });
34+
console.log(result);
35+
```
36+
37+
## Expected Behavior
38+
39+
A clear and concise description of what you expected to happen.
40+
41+
## Actual Behavior
42+
43+
A clear and concise description of what actually happened.
44+
45+
## Error Messages
46+
47+
```
48+
If applicable, paste any error messages here
49+
```
50+
51+
## Environment
52+
53+
- **@mcabreradev/filter version:** [e.g. 5.6.1]
54+
- **Node.js version:** [e.g. 20.0.0]
55+
- **TypeScript version:** [e.g. 5.0.0]
56+
- **Package manager:** [e.g. npm 10.0.0, yarn 1.22.0, pnpm 8.0.0]
57+
- **Operating System:** [e.g. macOS 14.0, Ubuntu 22.04, Windows 11]
58+
59+
## Additional Context
60+
61+
Add any other context about the problem here (screenshots, related issues, etc.)
62+
63+
## Checklist
64+
65+
- [ ] I have searched existing issues to ensure this is not a duplicate
66+
- [ ] I have provided a minimal code example to reproduce the issue
67+
- [ ] I have included my environment information
68+
- [ ] I am using the latest version of @mcabreradev/filter
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: '[FEATURE] '
5+
labels: enhancement
6+
assignees: ''
7+
---
8+
9+
## Feature Description
10+
11+
A clear and concise description of the feature you'd like to see.
12+
13+
## Problem Statement
14+
15+
**Is your feature request related to a problem? Please describe.**
16+
17+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
18+
19+
## Proposed Solution
20+
21+
**Describe the solution you'd like**
22+
23+
A clear and concise description of what you want to happen.
24+
25+
## Usage Example
26+
27+
```typescript
28+
// How you envision using this feature
29+
import { filter } from '@mcabreradev/filter';
30+
31+
const result = filter(data, {
32+
// Your proposed syntax here
33+
});
34+
```
35+
36+
## Alternatives Considered
37+
38+
**Describe alternatives you've considered**
39+
40+
A clear and concise description of any alternative solutions or features you've considered.
41+
42+
## Additional Context
43+
44+
Add any other context, screenshots, or examples about the feature request here.
45+
46+
## Benefits
47+
48+
- Benefit 1
49+
- Benefit 2
50+
- Benefit 3
51+
52+
## Potential Drawbacks
53+
54+
- Drawback 1 (if any)
55+
- Drawback 2 (if any)
56+
57+
## Checklist
58+
59+
- [ ] I have searched existing issues/PRs to ensure this is not a duplicate
60+
- [ ] I have provided a clear use case for this feature
61+
- [ ] I have considered backwards compatibility
62+
- [ ] I am willing to contribute to the implementation

.github/dependabot.yml

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,28 +8,46 @@ updates:
88
day: "monday"
99
time: "09:00"
1010
open-pull-requests-limit: 10
11+
reviewers:
12+
- "mcabreradev"
1113
assignees:
1214
- "mcabreradev"
1315
commit-message:
1416
prefix: "chore"
1517
include: "scope"
1618
labels:
1719
- "dependencies"
18-
- "security"
20+
- "automated"
21+
groups:
22+
# Group all production dependencies
23+
production-dependencies:
24+
dependency-type: "production"
25+
update-types:
26+
- "minor"
27+
- "patch"
28+
# Group all development dependencies
29+
development-dependencies:
30+
dependency-type: "development"
31+
update-types:
32+
- "minor"
33+
- "patch"
34+
# Ignore specific packages if needed
35+
ignore:
36+
- dependency-name: "zod"
37+
update-types: ["version-update:semver-major"]
1938

2039
# GitHub Actions
2140
- package-ecosystem: "github-actions"
2241
directory: "/"
2342
schedule:
2443
interval: "weekly"
2544
day: "monday"
26-
time: "09:00"
27-
open-pull-requests-limit: 5
45+
reviewers:
46+
- "mcabreradev"
2847
assignees:
2948
- "mcabreradev"
3049
commit-message:
31-
prefix: "chore(ci)"
32-
include: "scope"
50+
prefix: "ci"
3351
labels:
34-
- "dependencies"
35-
- "ci"
52+
- "github-actions"
53+
- "automated"

.github/workflows/npm-publish-manual.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: 📥 Setup pnpm
3535
uses: pnpm/action-setup@v4
3636
with:
37-
version: 9
37+
version: 10
3838
run_install: false
3939

4040
- name: 📦 Install dependencies

.github/workflows/size-check.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
name: Bundle Size Check
2+
3+
on:
4+
pull_request:
5+
branches: [main, develop]
6+
push:
7+
branches: [main, develop]
8+
9+
jobs:
10+
size:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout code
14+
uses: actions/checkout@v4
15+
16+
- name: Setup pnpm
17+
uses: pnpm/action-setup@v2
18+
with:
19+
version: 10
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: '20'
25+
cache: 'pnpm'
26+
27+
- name: Install dependencies
28+
run: pnpm install --frozen-lockfile
29+
30+
- name: Build project
31+
run: pnpm build
32+
33+
- name: Check bundle size
34+
run: pnpm size

.github/workflows/testing.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- name: 📦 Setup pnpm
3535
uses: pnpm/action-setup@v4
3636
with:
37-
version: 9
37+
version: 10
3838

3939
- name: ⎔ Setup Node.js ${{ matrix.node-version }}
4040
uses: actions/setup-node@v6

.npmignore

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Source files
2+
src/
3+
__test__/
4+
__tests__/
5+
6+
# Documentation
7+
docs/
8+
examples/
9+
.vitepress/
10+
11+
# Config files
12+
tsconfig.json
13+
tsconfig.tsd.json
14+
tsd.json
15+
vitest.config.ts
16+
vitest.docs.config.ts
17+
eslint.config.js
18+
typedoc.json
19+
.prettierrc
20+
.editorconfig
21+
22+
# CI/CD
23+
.github/
24+
.husky/
25+
26+
# Development files
27+
*.test.ts
28+
*.test.tsx
29+
*.spec.ts
30+
*.spec.tsx
31+
test-d/
32+
33+
# Misc
34+
.DS_Store
35+
*.log
36+
.env
37+
.env.local
38+
coverage/
39+
.nyc_output/
40+
41+
# Documentation files
42+
CONTRIBUTING.md
43+
CLAUDE.md
44+
FIXED_ISSUES.md
45+
GEOSPATIAL_EXAMPLES_UPDATE.md
46+
PLAYGROUND_FIX.md
47+
techstack.md
48+
techstack.yml
49+
TYPESCRIPT_IMPLEMENTATION_SUMMARY.md
50+
RESTRUCTURING.md
51+
52+
# Keep only build output and essential files
53+
!build/
54+
!package.json
55+
!README.md
56+
!LICENSE.md

.size-limit.json

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
[
2+
{
3+
"name": "Full Library (no dependencies)",
4+
"path": "build/index.js",
5+
"limit": "15 KB",
6+
"gzip": true,
7+
"ignore": ["zod", "@vercel/analytics", "@vue-leaflet/vue-leaflet", "leaflet"]
8+
},
9+
{
10+
"name": "Operators - All",
11+
"path": "build/operators/index.js",
12+
"limit": "5 KB",
13+
"gzip": true,
14+
"ignore": ["zod"]
15+
},
16+
{
17+
"name": "Operators - Comparison",
18+
"path": "build/operators/comparison.operators.js",
19+
"limit": "500 B",
20+
"gzip": true,
21+
"ignore": ["zod"]
22+
},
23+
{
24+
"name": "Operators - String",
25+
"path": "build/operators/string.operators.js",
26+
"limit": "1.5 KB",
27+
"gzip": true,
28+
"ignore": ["zod"]
29+
},
30+
{
31+
"name": "Operators - Array",
32+
"path": "build/operators/array.operators.js",
33+
"limit": "300 B",
34+
"gzip": true,
35+
"ignore": ["zod"]
36+
},
37+
{
38+
"name": "Operators - Logical",
39+
"path": "build/operators/logical.operators.js",
40+
"limit": "5 KB",
41+
"gzip": true,
42+
"ignore": ["zod"]
43+
},
44+
{
45+
"name": "Operators - Geospatial",
46+
"path": "build/operators/geospatial.operators.js",
47+
"limit": "1 KB",
48+
"gzip": true,
49+
"ignore": ["zod"]
50+
},
51+
{
52+
"name": "Operators - DateTime",
53+
"path": "build/operators/datetime.operators.js",
54+
"limit": "1 KB",
55+
"gzip": true,
56+
"ignore": ["zod"]
57+
}
58+
]

0 commit comments

Comments
 (0)