|
| 1 | +# Implementation Tasks: Replace ts-node with tsx |
| 2 | + |
| 3 | +**PRD Source**: [replace-ts-node-with-tsx.md](replace-ts-node-with-tsx.md) |
| 4 | +**Generated**: 2026-01-22 |
| 5 | +**Repository**: Agent365-nodejs |
| 6 | + |
| 7 | +--- |
| 8 | + |
| 9 | +## Overview |
| 10 | + |
| 11 | +This task list implements the migration from `ts-node` to `tsx` in the Agent365-nodejs repository. The migration affects only test sample packages and does not impact core SDK functionality. |
| 12 | + |
| 13 | +--- |
| 14 | + |
| 15 | +## Task List |
| 16 | + |
| 17 | +### Phase 1: Preparation |
| 18 | + |
| 19 | +| ID | Task | Priority | Dependencies | Status | |
| 20 | +|----|------|----------|--------------|--------| |
| 21 | +| **T1.1** | Document baseline: Record current dev server startup times for both sample packages | P1 | None | Pending | |
| 22 | +| **T1.2** | Run existing test suite to confirm all tests pass pre-migration | P0 | None | Pending | |
| 23 | +| **T1.3** | Run `pnpm build` to confirm build succeeds pre-migration | P0 | None | Pending | |
| 24 | + |
| 25 | +--- |
| 26 | + |
| 27 | +### Phase 2: Core Implementation |
| 28 | + |
| 29 | +| ID | Task | Priority | Dependencies | Status | |
| 30 | +|----|------|----------|--------------|--------| |
| 31 | +| **T2.1** | Update `pnpm-workspace.yaml`: Replace `"ts-node": "^10.9.2"` with `"tsx": "^4.21.0"` in catalog (line 66) | P0 | T1.2, T1.3 | Pending | |
| 32 | +| **T2.2** | Update `tests-agent/basic-agent-sdk-sample/package.json`: Change `dev` script from `ts-node` to `tsx` (line 9) | P0 | T2.1 | Pending | |
| 33 | +| **T2.3** | Update `tests-agent/basic-agent-sdk-sample/package.json`: Change devDependency from `"ts-node": "^10.9.2"` to `"tsx": "catalog:"` (line 34) | P0 | T2.1 | Pending | |
| 34 | +| **T2.4** | Update `tests-agent/openai-agent-auto-instrument-sample/package.json`: Change `dev` script from `ts-node` to `tsx` (line 9) | P0 | T2.1 | Pending | |
| 35 | +| **T2.5** | Update `tests-agent/openai-agent-auto-instrument-sample/package.json`: Change `test:setup` script from `ts-node` to `tsx` (line 13) | P0 | T2.1 | Pending | |
| 36 | +| **T2.6** | Update `tests-agent/openai-agent-auto-instrument-sample/package.json`: Change devDependency from `"ts-node": "catalog:"` to `"tsx": "catalog:"` (line 54) | P0 | T2.1 | Pending | |
| 37 | + |
| 38 | +--- |
| 39 | + |
| 40 | +### Phase 3: Dependency Installation |
| 41 | + |
| 42 | +| ID | Task | Priority | Dependencies | Status | |
| 43 | +|----|------|----------|--------------|--------| |
| 44 | +| **T3.1** | Run `pnpm install` to update dependencies and regenerate lockfile | P0 | T2.1-T2.6 | Pending | |
| 45 | + |
| 46 | +--- |
| 47 | + |
| 48 | +### Phase 4: Verification |
| 49 | + |
| 50 | +| ID | Task | Priority | Dependencies | Status | |
| 51 | +|----|------|----------|--------------|--------| |
| 52 | +| **T4.1** | Verify tsx installation: Run `pnpm list tsx --depth=0` and confirm tsx is listed | P0 | T3.1 | Pending | |
| 53 | +| **T4.2** | Verify ts-node removal: Search codebase for any remaining ts-node references in `.json` and `.yaml` files | P0 | T3.1 | Pending | |
| 54 | +| **T4.3** | Test basic-agent-sdk-sample dev server: Run `cd tests-agent/basic-agent-sdk-sample && pnpm dev` and verify it starts successfully | P0 | T3.1 | Pending | |
| 55 | +| **T4.4** | Test openai-agent-auto-instrument-sample dev server: Run `cd tests-agent/openai-agent-auto-instrument-sample && pnpm dev` and verify it starts successfully | P0 | T3.1 | Pending | |
| 56 | +| **T4.5** | Test openai-agent-auto-instrument-sample test:setup: Run `cd tests-agent/openai-agent-auto-instrument-sample && pnpm test:setup` and verify it executes | P0 | T3.1 | Pending | |
| 57 | +| **T4.6** | Run unit tests: Execute `pnpm test` from repository root and confirm all tests pass | P0 | T3.1 | Pending | |
| 58 | +| **T4.7** | Run integration tests: Execute `pnpm test:integration` from repository root and confirm all tests pass | P0 | T3.1 | Pending | |
| 59 | +| **T4.8** | Run build: Execute `pnpm build` from repository root and confirm build succeeds | P0 | T3.1 | Pending | |
| 60 | +| **T4.9** | Performance verification: Measure dev server startup times and compare to baseline (target: >50% reduction) | P1 | T4.3, T4.4 | Pending | |
| 61 | + |
| 62 | +--- |
| 63 | + |
| 64 | +### Phase 5: Finalization |
| 65 | + |
| 66 | +| ID | Task | Priority | Dependencies | Status | |
| 67 | +|----|------|----------|--------------|--------| |
| 68 | +| **T5.1** | Run linter: Execute `pnpm lint` to verify no linting errors introduced | P1 | T4.6-T4.8 | Pending | |
| 69 | +| **T5.2** | Create commit with descriptive message summarizing the ts-node to tsx migration | P0 | T4.1-T4.8 | Pending | |
| 70 | +| **T5.3** | Create pull request with summary of changes and verification results | P0 | T5.2 | Pending | |
| 71 | + |
| 72 | +--- |
| 73 | + |
| 74 | +## Detailed Task Specifications |
| 75 | + |
| 76 | +### T2.1: Update pnpm-workspace.yaml |
| 77 | + |
| 78 | +**File**: `pnpm-workspace.yaml` |
| 79 | +**Line**: 66 |
| 80 | + |
| 81 | +**Current**: |
| 82 | +```yaml |
| 83 | + "ts-node": "^10.9.2" |
| 84 | +``` |
| 85 | +
|
| 86 | +**Updated**: |
| 87 | +```yaml |
| 88 | + "tsx": "^4.21.0" |
| 89 | +``` |
| 90 | +
|
| 91 | +--- |
| 92 | +
|
| 93 | +### T2.2 & T2.3: Update basic-agent-sdk-sample/package.json |
| 94 | +
|
| 95 | +**File**: `tests-agent/basic-agent-sdk-sample/package.json` |
| 96 | + |
| 97 | +**Script Change (line 9)**: |
| 98 | +- Current: `"dev": "nodemon --watch src/*.ts --exec ts-node src/index.ts"` |
| 99 | +- Updated: `"dev": "nodemon --watch src/*.ts --exec tsx src/index.ts"` |
| 100 | + |
| 101 | +**Dependency Change (line 34)**: |
| 102 | +- Current: `"ts-node": "^10.9.2"` |
| 103 | +- Updated: `"tsx": "catalog:"` |
| 104 | + |
| 105 | +--- |
| 106 | + |
| 107 | +### T2.4, T2.5 & T2.6: Update openai-agent-auto-instrument-sample/package.json |
| 108 | + |
| 109 | +**File**: `tests-agent/openai-agent-auto-instrument-sample/package.json` |
| 110 | + |
| 111 | +**Script Changes**: |
| 112 | +- Line 9 - Current: `"dev": "nodemon --watch src/*.ts --exec ts-node src/index.ts"` |
| 113 | +- Line 9 - Updated: `"dev": "nodemon --watch src/*.ts --exec tsx src/index.ts"` |
| 114 | +- Line 13 - Current: `"test:setup": "ts-node ../../tests/integration/setup.ts"` |
| 115 | +- Line 13 - Updated: `"test:setup": "tsx ../../tests/integration/setup.ts"` |
| 116 | + |
| 117 | +**Dependency Change (line 54)**: |
| 118 | +- Current: `"ts-node": "catalog:"` |
| 119 | +- Updated: `"tsx": "catalog:"` |
| 120 | + |
| 121 | +--- |
| 122 | + |
| 123 | +## Verification Commands Reference |
| 124 | + |
| 125 | +```bash |
| 126 | +# Dependency verification |
| 127 | +pnpm list tsx --depth=0 |
| 128 | +
|
| 129 | +# Search for remaining ts-node references (should return no results) |
| 130 | +# Use grep to search .json and .yaml files for "ts-node" |
| 131 | +
|
| 132 | +# Functional testing |
| 133 | +cd tests-agent/basic-agent-sdk-sample && pnpm dev |
| 134 | +cd tests-agent/openai-agent-auto-instrument-sample && pnpm dev |
| 135 | +cd tests-agent/openai-agent-auto-instrument-sample && pnpm test:setup |
| 136 | +
|
| 137 | +# Test suite |
| 138 | +pnpm test |
| 139 | +pnpm test:integration |
| 140 | +pnpm build |
| 141 | +pnpm lint |
| 142 | +``` |
| 143 | + |
| 144 | +--- |
| 145 | + |
| 146 | +## Rollback Plan |
| 147 | + |
| 148 | +If issues are discovered post-migration: |
| 149 | + |
| 150 | +1. Revert `pnpm-workspace.yaml` - change `"tsx": "^4.21.0"` back to `"ts-node": "^10.9.2"` |
| 151 | +2. Revert `tests-agent/basic-agent-sdk-sample/package.json` - restore ts-node script and dependency |
| 152 | +3. Revert `tests-agent/openai-agent-auto-instrument-sample/package.json` - restore ts-node scripts and dependency |
| 153 | +4. Run `pnpm install` to restore ts-node |
| 154 | +5. Document issues encountered for future resolution |
| 155 | + |
| 156 | +--- |
| 157 | + |
| 158 | +## Success Criteria |
| 159 | + |
| 160 | +- [ ] Zero references to `ts-node` exist in the repository (excluding documentation) |
| 161 | +- [ ] All sample dev servers start and operate correctly with tsx |
| 162 | +- [ ] All unit and integration tests pass without modification |
| 163 | +- [ ] `pnpm build` completes without errors |
| 164 | +- [ ] Dev server startup time is equal to or faster than before |
| 165 | +- [ ] PR is created and ready for review |
| 166 | + |
| 167 | +--- |
| 168 | + |
| 169 | +## Files Modified Summary |
| 170 | + |
| 171 | +| File | Type of Change | |
| 172 | +|------|----------------| |
| 173 | +| `pnpm-workspace.yaml` | Catalog entry update (ts-node -> tsx) | |
| 174 | +| `tests-agent/basic-agent-sdk-sample/package.json` | Script update + devDependency update | |
| 175 | +| `tests-agent/openai-agent-auto-instrument-sample/package.json` | Script updates (2) + devDependency update | |
| 176 | + |
| 177 | +**Total files modified**: 3 |
0 commit comments