Conversation
…amples and real-life scenarios Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
TemplateJson
streamich
left a comment
There was a problem hiding this comment.
- Move all new templates to
src/examples.ts. - Crate a template which combines all templates using
ortemplate. - Make sure tests pass.
- Make sure linter and formatter pass.
… template Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
All changes implemented in commit d54454e: ✅ Moved all new templates to The comprehensive templates are now properly organized in |
streamich
left a comment
There was a problem hiding this comment.
When done, make sure formatter passes.
src/index.ts
Outdated
| export * from './number'; | ||
| export * from './string'; | ||
| export * from './structured'; | ||
| export * as examples from './examples'; |
There was a problem hiding this comment.
Removed the export * as examples from './examples'; line from src/index.ts in commit 6a4fba8.
src/examples.ts
Outdated
| tree(), | ||
| comment(), |
There was a problem hiding this comment.
| tree(), | |
| comment(), | |
| tree, | |
| comment, |
There was a problem hiding this comment.
Fixed the function calls to function references - changed tree(), and comment(), to tree, and comment, in commit 6a4fba8.
There was a problem hiding this comment.
Add to this file (and export) methods for easy random JSON generation, such as getUser(), genAddress(), etc.
Mention these methods in README.md.
DO NOT re-export anything from this file in main index.ts.
There was a problem hiding this comment.
Added helper methods for easy random JSON generation (like genUser(), genAddress(), etc.) to src/examples.ts and documented them in README.md in commit 6a4fba8. These methods are not re-exported from main index.ts as requested.
…ion calls, add helper methods Co-authored-by: streamich <9773803+streamich@users.noreply.github.com>
Formatter passes - confirmed with |
|
🎉 This PR is included in version 1.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This PR reorganizes the template structure by moving comprehensive templates to a dedicated
examples.tsfile and adding convenient helper methods for common data generation tasks.Changes Made
File Organization
src/structured/templates.tstosrc/examples.tssrc/structured/templates.tsto contain only basic templates (nil,tokensHelloWorld,tokensObjectKey,str)src/index.tsto keep the public API cleanCombined Template
Created
allExamplestemplate that uses theorpattern to randomly select from all 34 comprehensive templates:Helper Methods for Easy Generation
Added convenient helper methods that eliminate the need to construct templates manually:
Available helper methods include:
genUser(),genUserBasic()- User profilesgenAddress(),genLocation()- Geographic datagenProduct(),genOrder()- E-commerce datagenTransaction(),genBankAccount()- Financial datagenSocialPost(),genSocialProfile()- Social media datagenPatient(),genMedicalRecord()- Medical datagenStudent(),genCourse()- Educational datagenSensorReading(),genIotDevice()- IoT datagenLogEntry(),genMetricData()- Monitoring datagenRandomExample()- Random selection from all templatesTemplate Categories Available
Quality Assurance
This organization provides better separation of concerns while adding convenient helper methods for common use cases, making the library more approachable for developers who need quick data generation without template construction.
Fixes #4.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.