π Major Release: Prisma 6.x Support & New Features
This release brings Prisma 6.x compatibility along with powerful new features that transform how you generate mock data for your REST APIs.
β¨ New Features
π Configurable Data Volume
Control exactly how many records to generate per model:
{
"recordCounts": {
"User": 100,
"Product": 500,
"Order": 1000
}
}π Custom Faker Patterns
Generate realistic data with 50+ faker.js patterns:
{
"customPatterns": {
"User.email": "{{internet.email}}",
"Product.price": "{{commerce.price}}",
"User.avatar": "{{image.avatar}}"
}
}π± Seed Data Support
Load existing data and generate additional records:
{
"seedData": {
"enabled": true,
"seedDataPath": "./seeds/",
"generateAdditionalRecords": true
}
}π§ External Configuration
Organize settings in a dedicated JSON file:
generator json_server {
provider = "prisma-json-server-generator"
config = "./prisma/config.json"
}π Breaking Changes & Upgrades
- Prisma 6.14.0 - Full compatibility with latest Prisma version
- faker.js v9.9.0 - Updated to latest faker API
- TypeScript 5.9.2 - Modern TypeScript support
- Zod validation - Robust configuration validation
π§ͺ Testing & Quality
- Added comprehensive test suite with Vitest
- 95%+ test coverage across all features
- Enhanced error handling and validation
- Improved TypeScript strict mode compliance
π Documentation
- Modernized README with visual improvements
- Real-world examples for e-commerce and social media apps
- Comprehensive configuration guides
- GitHub Sponsors integration
π οΈ Technical Improvements
- Fixed model plural mapping for Prisma 6
- Enhanced faker pattern evaluation
- Better error messages and debugging
- Streamlined build process
π¦ Installation
npm install [email protected] --save-devπ Quick Start
- Add to your
schema.prisma:
generator json_server {
provider = "prisma-json-server-generator"
}- Generate data:
npx prisma generate
json-server --watch db.json --port 3001Your REST API is now live at http://localhost:3001! π
Full Changelog: v0.2.5...v0.3.0