docs: add updateMany/bulkUpdate JSDoc and method ordering pipeline#144
docs: add updateMany/bulkUpdate JSDoc and method ordering pipeline#144
Conversation
|
Claude finished @wixysam's task —— View job Claude Code is reviewing this PR... Review Tasks
JSDoc ReviewThe JSDoc additions for Strengths
Code QualityThe method ordering post-processor ( Strengths
Minor Suggestions
Performance & Security
Overall AssessmentThis is a high-quality PR that adds comprehensive documentation for the new bulk update methods and implements a clever solution for method ordering in generated docs. The code is clean, well-structured, and follows good practices. The documentation improvements will significantly help developers understand and use these methods correctly. |
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/sdk@0.8.22-pr.144.d5f4c16Prefer not to change any import paths? Install using npm alias so your code still imports npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.22-pr.144.d5f4c16"Or add it to your {
"dependencies": {
"@base44/sdk": "npm:@base44-preview/sdk@0.8.22-pr.144.d5f4c16"
}
}
Preview published to npm registry — try new features instantly! |
Address review feedback — warn that the query should exclude already-updated records to avoid re-processing when looping through batches of 500+. Made-with: Cursor
|
Claude finished @wixysam's task —— View job Review Tasks
JSDoc ReviewThe JSDoc additions for Strengths
Improvement SuggestionI agree with @danshw's review comment. The Suggested enhancement for line 406: * Results are batched in groups of up to 500. When `has_more` is `true`
* in the response, call `updateMany` again with the same query to update
* the next batch. **Important**: Design your query to exclude already-updated
* records to avoid infinite loops. For example, filter by `status: 'pending'`
* when setting status to `'processed'`, or by `active: true` when setting
* to `false`.Method Ordering Post-ProcessorThe new method ordering functionality in Implementation Review
Code Quality Observations
Configuration ChangesThe configuration changes are appropriate and well-structured: types-to-expose.json
types-to-delete-after-processing.json
method-order.json
Code QualityOverall, the code quality is excellent: Best Practices Followed
Minor Suggestions
Potential IssuesCleanupTruncatedParamTypes FixThe new content.replace(
/type="Partial<\.\.\.> & object\[\]"/g,
'type="(Partial<T> & { id: string })[]"'
);Potential issue: This assumes all truncated Suggestion: Consider making this more generic or adding a comment explaining this specific case applies to Method Ordering Edge CasesThe Mitigation: The code handles this gracefully by returning unmodified content if no methods are found, so this is low risk. Performance ConsiderationsThe post-processing script performs well for documentation generation: Efficient File Processing
Scalability
Build Time ImpactThe script adds minimal overhead to the documentation build process. The multiple processing passes (link fixing, signature cleanup, method ordering, etc.) are justified by the improved documentation quality. Security ConsiderationsThe changes introduce no security concerns: Documentation-Only Changes
Build Script Security
Test CoverageCurrent TestingThe PR mentions successful testing with
Suggestions for Enhanced Testing
SummaryThis is a high-quality PR that significantly improves the SDK documentation. The new JSDoc for bulk update methods is comprehensive and well-structured. The method ordering post-processor is a clever solution that will improve documentation readability by grouping related CRUD operations together. The only significant feedback is to incorporate @danshw's suggestion about emphasizing query design to avoid re-processing records in batched updates. All other observations are minor suggestions for future improvements. The code is production-ready and will enhance the developer experience for SDK users. |

Summary
updateMany()andbulkUpdate()entity methods, including cross-links between all three update methods, links to MongoDB query/update operator docs, and realistic examplesUpdateManyResulttype in the doc generation pipeline (types-to-expose.json,types-to-delete-after-processing.json)method-order.json— reorders### method()blocks in generated MDX based on a config file, and relocates displaced type-definition blocks to the## Type DefinitionssectionParamFieldtypes for intersection types (e.g.Partial<...> & object[]→(Partial<T> & { id: string })[])Method ordering mechanism
New file
scripts/mintlify-post-processing/method-order.jsonmaps MDX filenames to desired method order. To reorder methods in any other module, just add a new key. The post-processor also fixes a pre-existing issue where type definitions (EntityRecord, EntityTypeRegistry, SortField) appeared in the methods TOC section instead of under Type Definitions.Test plan
npm run create-docs-localruns without errors## Type Definitions, not in methods sectionMade with Cursor