Background
Following the resolution of issue #59 and PR #60, we identified several areas for improvement in our dependency management and testing strategy.
Issues Identified
1. Dependency Classification Bug
- Problem:
json-to-graphql-query was incorrectly placed in devDependencies instead of dependencies
- Impact: Runtime errors for consumers using v2.0.2+ (
Cannot find module 'json-to-graphql-query')
- Root Cause: No automated testing of the published package in isolation
2. Testing Gap
- Problem: Our current test suite runs against the local development environment where
devDependencies are installed
- Impact: Dependency classification bugs go undetected until users report them
- Solution Needed: Integration tests that use the published package directly
Proposed Improvements
A. Short-term: Add Package Integration Tests
Create tests that validate the published package works correctly:
-
Add npm pack/install test workflow:
# In CI, test the actual published package
npm pack
cd test-integration
npm install ../package-name-*.tgz
npm test
-
Create integration test directory (test-integration/):
- Separate
package.json with only production dependencies
- Tests that import and use the published package
- Focus on runtime dependency validation
B. Long-term: Evaluate EnumType Dependency
As suggested by @rickschubert in #59, consider whether the json-to-graphql-query dependency is necessary:
Option 1: Keep Current Approach ✅ (Recommended for now)
- Maintains compatibility with
json-to-graphql-query
- Preserves the library's promise of being "the reverse of json-to-graphql-query"
- Minimal maintenance overhead
Option 2: Remove EnumType Dependency (Future consideration)
- Would eliminate the runtime dependency
- Breaking change - requires major version bump
- Need to define custom enum representation format
- Loss of direct compatibility with
json-to-graphql-query
Option 3: Make EnumType Optional
- Allow users to opt-in to
json-to-graphql-query compatibility
- More complex API surface
- Potential for confusion
C. Development Process Improvements
-
Pre-release testing checklist:
-
CI/CD enhancements:
- Add workflow step to test packed package
- Validate dependency classification automatically
Implementation Plan
Phase 1: Immediate (Next Release)
Phase 2: Future Consideration (Major Version)
References
Questions for Discussion
- Should we prioritize eliminating the
json-to-graphql-query dependency in a future major version?
- What's the preferred approach for integration testing - separate directory or inline?
- Should we add automated dependency classification validation to prevent future issues?
Background
Following the resolution of issue #59 and PR #60, we identified several areas for improvement in our dependency management and testing strategy.
Issues Identified
1. Dependency Classification Bug
json-to-graphql-querywas incorrectly placed indevDependenciesinstead ofdependenciesCannot find module 'json-to-graphql-query')2. Testing Gap
devDependenciesare installedProposed Improvements
A. Short-term: Add Package Integration Tests
Create tests that validate the published package works correctly:
Add npm pack/install test workflow:
Create integration test directory (
test-integration/):package.jsonwith only production dependenciesB. Long-term: Evaluate EnumType Dependency
As suggested by @rickschubert in #59, consider whether the
json-to-graphql-querydependency is necessary:Option 1: Keep Current Approach ✅ (Recommended for now)
json-to-graphql-queryOption 2: Remove EnumType Dependency (Future consideration)
json-to-graphql-queryOption 3: Make EnumType Optional
json-to-graphql-querycompatibilityC. Development Process Improvements
Pre-release testing checklist:
dependenciesCI/CD enhancements:
Implementation Plan
Phase 1: Immediate (Next Release)
Phase 2: Future Consideration (Major Version)
References
Questions for Discussion
json-to-graphql-querydependency in a future major version?