jpie 0.4.0 → 0.4.2
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.
- checksums.yaml +4 -4
- data/{.aiconfig → .cursorrules} +21 -5
- data/.overcommit.yml +35 -0
- data/CHANGELOG.md +33 -0
- data/README.md +97 -1063
- data/examples/basic_example.md +146 -0
- data/examples/including_related_resources.md +491 -0
- data/examples/pagination.md +303 -0
- data/examples/resource_attribute_configuration.md +147 -0
- data/examples/resource_meta_configuration.md +244 -0
- data/examples/single_table_inheritance.md +160 -0
- data/lib/jpie/controller/crud_actions.rb +33 -2
- data/lib/jpie/controller/error_handling/handler_setup.rb +124 -0
- data/lib/jpie/controller/error_handling/handlers.rb +109 -0
- data/lib/jpie/controller/error_handling.rb +10 -28
- data/lib/jpie/controller/json_api_validation.rb +193 -0
- data/lib/jpie/controller/parameter_parsing.rb +43 -0
- data/lib/jpie/controller/rendering.rb +95 -1
- data/lib/jpie/controller.rb +2 -0
- data/lib/jpie/errors.rb +41 -0
- data/lib/jpie/resource/attributable.rb +16 -2
- data/lib/jpie/resource.rb +40 -0
- data/lib/jpie/version.rb +1 -1
- metadata +13 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f0e1d1634f188bca4057e3550479af557bd00ba0d262c919ba221aa99997490e
|
4
|
+
data.tar.gz: 89db580da555f310a1b840daad204e2315fcb8b7828278b328271412d3bc321d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2ced2be2db661db82e08200be2e5df033c072dcbf249565719336d3b08532d2cb01c4bbcec78cfb5e14fbbbadddb0c127292b70a9b970da3ecc20891bc8c8ab
|
7
|
+
data.tar.gz: 5d1ac4453eb74ba6a8ea04036f00065e26a54c2ff85a603525dd90106bd4f82a839ed3985083c5ff60d087b6bb1239c7a618a7a024e7e3fa1955c82d863aefa8
|
data/{.aiconfig → .cursorrules}
RENAMED
@@ -5,6 +5,10 @@
|
|
5
5
|
- Follow Ruby style guide and RuboCop rules defined in .rubocop.yml
|
6
6
|
- Prefer rubocop autocorrect
|
7
7
|
- Always pass rubocop before committing to git
|
8
|
+
- Use `{data:}` rather than `{data: data}`
|
9
|
+
- Only use code comments when abasolutely necessary
|
10
|
+
- Keep any code comments short and concise
|
11
|
+
- Don't update the .rubocop.yml unless it's absolutely necessarry
|
8
12
|
|
9
13
|
# Documentation requirements
|
10
14
|
- Keep README.md up to date with installation and usage instructions
|
@@ -22,7 +26,7 @@
|
|
22
26
|
# Git commit guidelines
|
23
27
|
- Write clear, descriptive commit messages
|
24
28
|
- Keep commits focused and atomic
|
25
|
-
- Run tests before committing
|
29
|
+
- Run and pass tests before committing
|
26
30
|
- Update documentation in the same commit as code changes
|
27
31
|
- Ignore spec/examples.txt and other files listed in .gitignore
|
28
32
|
- Include Ruby/Rails version requirements in relevant commits
|
@@ -33,6 +37,8 @@
|
|
33
37
|
- Place tests in spec/jpie/
|
34
38
|
- Use proper namespacing (JPie module)
|
35
39
|
- Follow Ruby gem best practices
|
40
|
+
- Do not update the spec/jpie/database.rb unless it's absolutely necessarry
|
41
|
+
- Do not update the spec/jpie/resources.rb unless it's absolutely necessarry
|
36
42
|
|
37
43
|
# Dependency management
|
38
44
|
- Keep dependencies minimal and justified
|
@@ -56,10 +62,20 @@
|
|
56
62
|
- Support Rails 8+ integration
|
57
63
|
- Follow JSON:API specification strictly
|
58
64
|
|
59
|
-
# Styleguide
|
60
|
-
- Use `{data:}` rather than `{data: data}`
|
61
|
-
|
62
65
|
# When implementing new features or refactoring
|
63
66
|
- Always read the .aiconfig file
|
64
67
|
- Always implement code slowly and methodically
|
65
|
-
- Always test as you go
|
68
|
+
- Always test as you go
|
69
|
+
- Always make sure rubocop passes
|
70
|
+
- Do not add any functionality for the new feature to existing tests unless absolutely necessarry.
|
71
|
+
|
72
|
+
# Examples
|
73
|
+
- The examples must _only_ include _required_ code
|
74
|
+
- The examples must not include any unrelated or supurflous code
|
75
|
+
- Examples must be a single markdown file
|
76
|
+
- Examples must use the `http` code blocks for its exampels
|
77
|
+
- Examples must only include the minium number of examples
|
78
|
+
- Examples must never include migrations.
|
79
|
+
- Examples must not include a features section or similar
|
80
|
+
- Examples must include an introduction to the example
|
81
|
+
- Examples live in /examples/*.md
|
data/.overcommit.yml
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Use this file to configure the Overcommit hooks you wish to use. This will
|
2
|
+
# extend the default configuration defined in:
|
3
|
+
# https://github.com/sds/overcommit/blob/master/config/default.yml
|
4
|
+
|
5
|
+
# Global settings
|
6
|
+
verify_signatures: false
|
7
|
+
|
8
|
+
PreCommit:
|
9
|
+
ALL:
|
10
|
+
problem_on_unmodified_line: ignore
|
11
|
+
requires_files: true
|
12
|
+
quiet: false
|
13
|
+
|
14
|
+
# Run RuboCop on Ruby files before commit
|
15
|
+
RuboCop:
|
16
|
+
enabled: true
|
17
|
+
command: ['bundle', 'exec', 'rubocop']
|
18
|
+
flags: ['--force-exclusion']
|
19
|
+
on_warn: fail
|
20
|
+
|
21
|
+
# Check for trailing whitespace
|
22
|
+
TrailingWhitespace:
|
23
|
+
enabled: true
|
24
|
+
exclude:
|
25
|
+
- '**/*.md'
|
26
|
+
|
27
|
+
# Check for merge conflicts
|
28
|
+
MergeConflicts:
|
29
|
+
enabled: true
|
30
|
+
|
31
|
+
PrePush:
|
32
|
+
# Run RSpec tests before push
|
33
|
+
RSpec:
|
34
|
+
enabled: true
|
35
|
+
command: ['bundle', 'exec', 'rspec']
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,39 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
7
7
|
|
8
8
|
## [Unreleased]
|
9
9
|
|
10
|
+
## [0.4.2] - 2025-01-25
|
11
|
+
|
12
|
+
### Added
|
13
|
+
- **Pagination Example**: Comprehensive pagination example demonstrating both simple and JSON:API standard pagination formats
|
14
|
+
- Simple pagination parameters (`page`, `per_page`)
|
15
|
+
- JSON:API standard pagination format (`page[number]`, `page[size]`)
|
16
|
+
- Pagination combined with sorting functionality
|
17
|
+
- Edge cases including last page and empty results
|
18
|
+
- Complete HTTP request/response examples following project format
|
19
|
+
|
20
|
+
### Enhanced
|
21
|
+
- **Documentation**: Improved example coverage with detailed pagination use cases
|
22
|
+
- **Developer Experience**: Clear examples for implementing pagination in JPie applications
|
23
|
+
|
24
|
+
## [0.4.1] - 2025-01-25
|
25
|
+
|
26
|
+
### Fixed
|
27
|
+
- **Test Suite Stability**: Fixed require statements in spec files that were incorrectly requiring `rails_helper` instead of `spec_helper`
|
28
|
+
- Fixed `spec/jpie/automatic_crud_spec.rb`
|
29
|
+
- Fixed `spec/jpie/polymorphic_crud_spec.rb`
|
30
|
+
- Fixed `spec/jpie/through_associations_crud_spec.rb`
|
31
|
+
- **Code Quality**: Addressed RuboCop warnings and improved code style compliance
|
32
|
+
- **Error Handling**: Improved error message consistency for unsupported sort fields and include parameters
|
33
|
+
|
34
|
+
### Enhanced
|
35
|
+
- **Test Coverage**: Maintained high test coverage (93.39%) with improved test reliability
|
36
|
+
- **Documentation**: Updated gem publishing workflow and development guidelines
|
37
|
+
|
38
|
+
### Technical Details
|
39
|
+
- All spec files now correctly use `spec_helper` for consistent test environment setup
|
40
|
+
- Improved gem build process with proper dependency management
|
41
|
+
- Enhanced RuboCop configuration for better code quality enforcement
|
42
|
+
|
10
43
|
## [0.4.0] - 2025-01-25
|
11
44
|
|
12
45
|
### Added
|