feat(examples): working npm-downloads custom connector for lobu-crm#1108
Conversation
Restores the connectorFromFile showcase the example lost when the dead funnel-form connector was removed (#1107) — but with a connector that actually works. Polls the public npm download-counts API (api.npmjs.org, no auth) for @lobu/cli and emits one event per new weekly period, deduped via a typed rolling checkpoint of seen period-end dates. Weekly npm pulls are a real top-of-funnel adoption signal, so it sits naturally next to the stars/mentions/HN connections. Verified end-to-end against the live endpoint: first sync emits one event (954 downloads, 2026-05-20 → 2026-05-26); re-sync with the checkpoint dedups to zero.
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughThis PR adds a new npm downloads connector to the lobu CRM example. The connector polls weekly npm download statistics from the public npm registry, maintains a rolling checkpoint to avoid duplicate events, and is wired into the example configuration with weekly feed scheduling. Documentation was updated to reflect the new data source. ChangesNPM Downloads Connector Feature
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint skipped: no ESLint configuration detected in root package.json. To enable, add Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
What
Adds
examples/lobu-crm/npm-downloads.connector.ts— a minimal but working custom connector — and wires it into the example viaconnectorFromFile+ anpm-downloads-lobu-cliconnection.Why
#1107 removed the
funnel-formconnector because its endpoint was dead (404, zero events). That was the example's onlyconnectorFromFiledemonstration. This restores the showcase with a connector that actually works:api.npmjs.org, no auth) for@lobu/cli.Verification (ran against the live endpoint)
bunx tsc --noEmit(workspace resolution): no errors inlobu.config.tsornpm-downloads.connector.ts.tsc+biomepass.Note
This is example/repo content; it isn't auto-applied to the live lobu-crm org (which is now UI-managed and has drifted from this config).
Summary by CodeRabbit
New Features
Documentation