-
Notifications
You must be signed in to change notification settings - Fork 2.1k
refactor(cli): migrate remaining unblocked CJS modules to TypeScript #1298
Copy link
Copy link
Open
Labels
NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).Use this label to identify issues with the NemoClaw command-line interface (CLI).refactorThis is a refactor of the code and/or architecture.This is a refactor of the code and/or architecture.
Description
Summary
Migrate the 3 remaining unblocked CJS modules in bin/lib/ to TypeScript:
| File | Lines | Notes |
|---|---|---|
resolve-openshell.js |
58 | Path resolution for openshell binary, DI-friendly |
version.js |
43 | Reads package.json + git describe for CLI version |
chat-filter.js |
29 | New file, small utility |
Total: ~130 lines. This completes the "everything not blocked is converted" goal.
Approach
For each file:
- Write the TS implementation in
src/lib/ - Replace
bin/lib/*.jswith a thin re-export shim:module.exports = require("../../dist/lib/...") - Co-locate tests in
src/lib/*.test.ts, importing from../../dist/lib/for coverage attribution - Follow the established pattern from refactor(cli): extract pure functions from onboard.js to typed TypeScript modules #1240, refactor(cli): migrate preflight.js to TypeScript #1262, refactor(cli): migrate inference-config.js to TypeScript #1265, refactor(cli): migrate runtime-recovery.js to TypeScript #1268, refactor(cli): migrate local-inference.js to TypeScript #1270, refactor(cli): migrate nim.js to TypeScript #1271, refactor(cli): migrate onboard-session.js to TypeScript #1272
Can be done as one PR (all 3 files are small and independent) or three separate PRs.
Context
- Part of refactor(cli): shell consolidation, TypeScript migration & oclif #924 shell consolidation
- No blocker PRs touch these files — safe to proceed immediately
- Coverage ratchet must pass — add tests, never lower thresholds
- Use flat interfaces (not discriminated unions) for types consumed by JS files to avoid narrowing issues
Not blocked by
Any of the #924 blocker PRs (#781, #782, #819, #672, #794, #634).
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
NemoClaw CLIUse this label to identify issues with the NemoClaw command-line interface (CLI).Use this label to identify issues with the NemoClaw command-line interface (CLI).refactorThis is a refactor of the code and/or architecture.This is a refactor of the code and/or architecture.