refactor(cli): migrate resolve-openshell, version, chat-filter to TypeScript#1357
Closed
prekshivyas wants to merge 1 commit intomainfrom
Closed
refactor(cli): migrate resolve-openshell, version, chat-filter to TypeScript#1357prekshivyas wants to merge 1 commit intomainfrom
prekshivyas wants to merge 1 commit intomainfrom
Conversation
…eScript (#1298) Move CJS implementations in `bin/lib/` to TypeScript in `src/lib/`, compiled via `tsconfig.src.json` to `dist/lib/`. Replaces the inline CJS with thin re-export shims following the pattern from #1262, #1265. - Add `src/lib/resolve-openshell.ts` with typed DI options interface - Add `src/lib/version.ts` preserving existing getVersion() string API (git describe → .version file → package.json fallback chain) - Add `src/lib/chat-filter.ts` preserving existing array-based API - Add co-located tests importing from `../../dist/lib/` for coverage - Replace `bin/lib/` full implementations with thin shims - Use platform-neutral paths in version tests (node:path join) No API changes — all consumers (bin/nemoclaw.js, scripts/telegram-bridge.js) continue to work without modification. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
|
Caution Review failedPull request was closed or merged during review 📝 WalkthroughWalkthroughMigrates three CommonJS modules (chat-filter.js, resolve-openshell.js, version.js) from bin/lib/ to TypeScript in src/lib/, replacing the originals with thin re-export shims pointing to compiled dist versions. Includes comprehensive test suites for each module. Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 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)
Comment |
Contributor
Author
|
Closing — will address feedback in the original PR #1306 instead. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #1298. Part of #924 shell consolidation. Supersedes #1306 (addresses all review feedback from @cv and CodeRabbit).
Changes from v1 (#1306):
src/lib/(repo root) per @cv — compiled viatsconfig.src.jsonto CJS indist/lib/, matching the pattern from refactor(cli): migrate preflight.js to TypeScript #1262, refactor(cli): migrate inference-config.js to TypeScript #1265, refactor(cli): migrate nim.js to TypeScript #1271getVersion()string API — no consumer changes neededisChatAllowed(allowedChats, chatId)array-based API — no consumer changes neededFiles changed
src/lib/resolve-openshell.tssrc/lib/version.tssrc/lib/chat-filter.tssrc/lib/*.test.ts../../dist/lib/bin/lib/resolve-openshell.jsbin/lib/version.jsbin/lib/chat-filter.jsTest plan
npm test— all 874 tests pass (45 files)npm run typecheck:cli— cleannode -e "require(...)"— backward compatible🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Tests