@rmdes/indiekit-endpoint-github 1.2.4 → 1.2.5

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.
@@ -86,21 +86,20 @@ export async function annotateWithLists(db, lists) {
86
86
  }
87
87
  }
88
88
 
89
- // Single ordered bulkWrite: reset all, then set per-repo lists
90
- const ops = [
91
- { updateMany: { filter: {}, update: { $set: { lists: [] } } } },
92
- ...[...repoToLists.entries()].map(([fullName, slugs]) => ({
93
- updateOne: {
94
- filter: { fullName },
95
- update: { $set: { lists: slugs } },
96
- },
97
- })),
98
- ];
89
+ // Reset all repos' lists first, then annotate per-repo
90
+ await collection.updateMany({}, { $set: { lists: [] } });
91
+
92
+ const annotateOps = [...repoToLists.entries()].map(([fullName, slugs]) => ({
93
+ updateOne: {
94
+ filter: { fullName },
95
+ update: { $set: { lists: slugs } },
96
+ },
97
+ }));
99
98
 
100
99
  // Process in batches of 1000 to avoid MongoDB limits
101
100
  let reposAnnotated = 0;
102
- for (let i = 0; i < ops.length; i += 1000) {
103
- const batch = ops.slice(i, i + 1000);
101
+ for (let i = 0; i < annotateOps.length; i += 1000) {
102
+ const batch = annotateOps.slice(i, i + 1000);
104
103
  const result = await collection.bulkWrite(batch, { ordered: true });
105
104
  reposAnnotated += result.modifiedCount;
106
105
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rmdes/indiekit-endpoint-github",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "GitHub activity endpoint for Indiekit. Display commits, stars, contributions, and featured repositories.",
5
5
  "keywords": [
6
6
  "indiekit",