-
Notifications
You must be signed in to change notification settings - Fork 0
chore: upgrade dependencies and migrate to ESLint v9 #74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ESLint v9 migration: - Replace .eslintrc.cjs with eslint.config.js (flat config format) - Add typescript-eslint, @eslint/js, @eslint/eslintrc, eslint-formatter-unix Dependency updates: - eslint: ^8.57.1 → ^9.39.1 - @towns-protocol/bot|proto|web3: ^0.0.414 → ^0.0.427 - hono: ^4.7.11 → ^4.10.7 - viem: ^2.29.3 → ^2.40.3 - zod: ^4.1.12 → ^4.1.13 - @types/node: ^20.14.8 → ^24.10.1 - prettier: ^3.6.2 → ^3.7.3 - eslint-plugin-tsdoc: ^0.3.0 → ^0.5.0 SDK breaking changes: - bot.start() now returns Hono app directly (handles webhook/metadata internally) - Remove manual /webhook and /.well-known/agent-metadata.json routes Other: - Bump bun version: 1.3.0 → 1.3.3 - Reorder README sections (Usage before Setup) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
WalkthroughThis pull request replaces the legacy CommonJS ESLint config (.eslintrc.cjs removed) with a new flat configuration (eslint.config.js), updates multiple dependencies (ESLint/TS toolchain, runtime and libs), bumps Bun version (.bun-version), modifies tsconfig.json to remove Node types, refactors application bootstrap in src/index.ts to use bot.start() and consolidates routing/static asset handling, and updates README content by consolidating and expanding the Usage section. No exported/public API signatures were added or removed. Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (3)
🚧 Files skipped from review as they are similar to previous changes (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2025-11-25T03:24:12.463ZApplied to files:
📚 Learning: 2025-11-17T23:50:17.552ZApplied to files:
🔇 Additional comments (6)
Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (1)
package.json (1)
40-41: Consider aligning @types/node with Bun's Node.js compatibility level."The major version and minor version tagged in the semver string of @types/node is exactly corresponding to the node's version." Since this project uses Bun (based on learnings), "Node LTS is at major 22 but 24 is already out", and @types/node v24 corresponds to Node.js v24 APIs.
Bun's Node.js compatibility may not cover all Node.js v24 APIs. If you encounter type errors for APIs Bun doesn't support, consider pinning to
@types/node@^22instead.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
.bun-version(1 hunks).eslintrc.cjs(0 hunks)README.md(1 hunks)eslint.config.js(1 hunks)package.json(1 hunks)src/index.ts(1 hunks)
💤 Files with no reviewable changes (1)
- .eslintrc.cjs
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx,js,jsx}
📄 CodeRabbit inference engine (AGENTS.md)
Provide alt text for image attachments and use appropriate MIME types for chunked attachments (videos, screenshots)
Files:
eslint.config.jssrc/index.ts
**/*.ts
📄 CodeRabbit inference engine (AGENTS.md)
**/*.ts: Store context externally - maintain stateless bot architecture with no message history, thread context, or conversation memory
Use<@{userId}>for mentions in messages AND add mentions in sendMessage options - do not use @username format
Implement event handlers for onMessage, onSlashCommand, onReaction, onTip, and onInteractionResponse to respond to Towns Protocol events
Define slash commands in src/commands.ts as a const array with name and description properties, then register handlers using bot.onSlashCommand()
Set ID in interaction requests and match ID in responses to correlate form submissions, button clicks, and transaction/signature responses
Use readContract for reading smart contract state, writeContract for SimpleAccount operations, and execute() for external contract interactions
Fund bot.appAddress (Smart Account) for on-chain operations, not bot.botId (Gas Wallet/EOA)
Use bot.* handler methods directly (outside event handlers) for unprompted messages via webhooks, timers, or tasks - requires channelId, spaceId, or other context stored externally
Always check permissions using handler.hasAdminPermission() before performing admin operations like ban, redact, or pin
User IDs are hex addresses in format 0x..., not usernames - use them consistently throughout event handling and message sending
Slash commands do not trigger onMessage - register slash command handlers using bot.onSlashCommand() instead
Use getSmartAccountFromUserId() to retrieve a user's wallet address from their userId
Include required environment variables: APP_PRIVATE_DATA (bot credentials) and JWT_SECRET (webhook security token)
Files:
src/index.ts
🧠 Learnings (3)
📓 Common learnings
Learnt from: shuhuiluo
Repo: HereNotThere/bot-github PR: 26
File: src/github-app/app.ts:1-3
Timestamp: 2025-11-17T23:50:17.552Z
Learning: The HereNotThere/bot-github project uses Bun as its package manager, with dependencies locked in bun.lock rather than package-lock.json.
📚 Learning: 2025-11-25T03:24:12.463Z
Learnt from: CR
Repo: HereNotThere/bot-github PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-11-25T03:24:12.463Z
Learning: Applies to **/*.ts : Include required environment variables: APP_PRIVATE_DATA (bot credentials) and JWT_SECRET (webhook security token)
Applied to files:
package.json
📚 Learning: 2025-11-17T23:50:17.552Z
Learnt from: shuhuiluo
Repo: HereNotThere/bot-github PR: 26
File: src/github-app/app.ts:1-3
Timestamp: 2025-11-17T23:50:17.552Z
Learning: The HereNotThere/bot-github project uses Bun as its package manager, with dependencies locked in bun.lock rather than package-lock.json.
Applied to files:
package.json
🔇 Additional comments (7)
.bun-version (1)
1-1: LGTM!Bun version bump to 1.3.3 aligns with the
@types/bunversion in package.json.README.md (1)
39-109: LGTM!Documentation is well-structured with clear command examples, event types, and delivery mode explanations. Moving Usage before Setup improves the reader experience by showing what the bot does before explaining how to set it up.
eslint.config.js (1)
52-86: Rules configuration looks reasonable for the project.The configuration appropriately:
- Enforces Prettier formatting
- Uses underscore pattern for unused variables
- Allows flexibility in template expressions
- Provides TSDoc syntax warnings
The relaxed type-safety rules (
no-explicit-any,no-unsafe-assignment) are a conscious trade-off for development velocity in this bot application.package.json (3)
25-33: LGTM!Dependency updates are well-coordinated:
- Towns Protocol packages updated together to ^0.0.427
- Hono, viem, and zod updated to current versions
- Zod remains at v4, utilizing the unified error customization and other v4 features per the library documentation
36-56: ESLint v9 migration tooling looks complete.All necessary packages for ESLint v9 flat config are included:
@eslint/jsand@eslint/eslintrcfor base configurationstypescript-eslintfor TypeScript supporteslint-formatter-unixfor the lint script output format- Updated
@typescript-eslint/*packages to v8.48.1 for ESLint v9 compatibility
40-41: No issues with @types/node v24 upgrade.@types/node v24 aligns with Bun's current Node.js v24 compatibility. The project correctly configures both
@types/nodeand@types/bunin tsconfig.json withskipLibCheckenabled, which prevents type conflicts between the two packages. This is a valid and expected setup for Bun projects.src/index.ts (1)
169-178: LGTM! The migration tobot.start()aligns with the SDK update (^0.0.427), which now returns the Hono app directly. The static asset serving configuration correctly rewrites/assets/*paths to serve from the./assetsdirectory root, and the architecture maintains the stateless bot pattern with proper event handler registration.
- Remove @types/node dependency (@types/bun provides Node.js compat types) - Update tsconfig.json types to only include "bun" - Remove dead test override from eslint config (tests/** is ignored) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
ESLint v9 migration:
Dependency updates:
SDK breaking changes:
Other:
🤖 Generated with Claude Code
Summary by CodeRabbit
Documentation
Chores
Behavior
✏️ Tip: You can customize this high-level summary in your review settings.