chore(examples): add package.json + tsconfig so examples are self-contained#1034
Conversation
Examples carried only lobu.config.ts and relied on the monorepo workspace to
resolve @lobu/cli/config and @lobu/connector-sdk, so they didn't match what
`lobu init` scaffolds (scaffoldProjectPackaging writes package.json +
tsconfig.json) and couldn't be copied out and typechecked standalone. Only
personal-finance had a package.json (and it lacked the SDK devDeps + tsconfig).
Give every example the init-style package.json (@lobu/cli + @lobu/connector-sdk
at ^9.2.0) and a tsconfig whose include covers the dirs actually present
(agents/connectors/reactions/models). Adding tsconfig surfaced pre-existing type
errors in code nothing had ever typechecked:
- 4 OAuth connectors missing requiredScopes (salesforce, quickbooks, linear, docusign)
- 3 connectors using a stale env auth shape (type:"env"/{name} -> env_keys/{key})
- all 7 connectors missing the required EventEnvelope.payload_text
- 2 invalid direct casts (finance reaction, office-bot deliveroo skill)
All 12 examples now typecheck clean against the shipped SDK.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (12)
✅ Files skipped from review due to trivial changes (3)
📝 WalkthroughWalkthroughThis PR standardizes package and TypeScript configs across examples, modernizes connector authentication schemas to use environment keys and explicit OAuth scopes, and enriches connector events with new ChangesExample Workspace Setup and Connector Updates
🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
@lobu/cli 9.2.0 was never published (versions jump 9.1.1 -> 9.3.0); ^9.2.0 only resolved by floating up to 9.3.0. Pin the actual published latest so the pins are honest and match what `lobu init` stamps today. Verified standalone (outside the monorepo, against published 9.3.0): bun install + tsc --noEmit + `lobu validate` all green for 11/12 examples. personal-finance can't install standalone due to its pre-existing file:../../packages/promptfoo-provider dep, but typechecks inside the monorepo.
What
Every example carried only
lobu.config.tsand relied on the monorepo workspace to resolve@lobu/cli/configand@lobu/connector-sdk. So they:lobu initscaffolds —scaffoldProjectPackaging(packages/cli/src/commands/init.ts:167) writes apackage.json(with@lobu/cli+@lobu/connector-sdkdevDeps) and atsconfig.jsonfor exactly this reason: "solobu apply(jiti) and the editor can resolve the SDK imports outside this monorepo."personal-financehad apackage.json, and even it lacked the SDK devDeps + had no tsconfig.The gap, fixed
Give every example the init-style
package.json(@lobu/cli+@lobu/connector-sdkat^9.2.0, matchingscaffoldProjectPackaging) and atsconfig.jsonwhoseincludecovers the dirs actually present (agents/connectors/reactions/models— the examples put reactions undermodels/, which the stock init globs wouldn't catch).Adding the tsconfigs surfaced pre-existing type errors in example code that nothing had ever typechecked (8 of 12 examples failed). Fixed against the shipped SDK contract:
requiredScopes— salesforce, quickbooks, linear, docusign (ConnectorAuthOAuth.requiredScopesis required).type: "env"+{ name }fields →type: "env_keys"+{ key }(discourse, shopify, exa).EventEnvelope.payload_text.Record<string,unknown>→ReconciliationData) and office-bot deliveroo skill (cookie array); both nowas unknown as.Validation
bunx tsc -p examples/<name>/tsconfig.json --noEmitis green for all 12 examples.biome checkclean. No example*.config.tssemantics changed — only packaging added + type errors fixed.Examples stay standalone (not added to the root workspace), matching the existing
personal-financeconvention.Summary by CodeRabbit
New Features
Bug Fixes
Chores