CASSNODEJS-8: First TypeScript PR: Massive rename#461
Conversation
|
GH does not allow me to request @toptobes 's review, but I'd appreciate it |
There was a problem hiding this comment.
Pull request overview
This is the first PR in a planned TypeScript migration of the Node.js Cassandra driver. The bulk of the change is a mechanical rename of .js source and test files to .ts so that future code-level migration diffs remain readable in git history. A minimal tsconfig.json and the ts-mocha/typescript devDependencies are added so the renamed files can still be exercised individually via npx ts-mocha. The file contents are essentially untouched aside from dropping .js extensions in internal require(...) calls and (in package.json) removing the "types" field.
Changes:
- Renamed nearly all
lib/**/*.js,test/**/*.js, andindex.jsto.tsand removed.jssuffixes from internalrequire()paths. - Added
tsconfig.json(CommonJS, ES2015,allowJs,declaration) and addedts-mocha/typescriptas devDependencies. - Removed the
"types": "./index.d.ts"entry frompackage.json.
Reviewed changes
Copilot reviewed 25 out of 230 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.json | New minimal TS config; only includes lib/**/*.ts and index.ts (excludes tests). |
| package.json | Adds ts-mocha/typescript devDeps; drops types field. |
| index.ts | Renamed from index.js; same exports. |
| lib/**/*.ts | Renamed from .js; require paths updated to drop .js. |
| test/unit//*.ts, test/integration//.ts, test/other/**/.ts | Test files renamed from .js; require paths updated. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -18,7 +18,6 @@ | |||
| "graphdb" | |||
| ], | |||
| "license": "Apache-2.0", | |||
There was a problem hiding this comment.
Correct, but we will fix those later, because we will add roll-up and api-extractor.
| "temp": ">= 0.8.3", | ||
| "ts-mocha": "^10.0.0", | ||
| "typescript": "^5.7.3" |
There was a problem hiding this comment.
Correct, we will need to fix those scripts and other project setup later.
A lot of things broke, but don't panic!
This is the first PR for the typescript migration, mainly for the file extension rename, so that
git diffwill actually work in the future.A very simple tsconfig is included so that you can at least run a command like
npx ts-mocha test/unit/metadata-tests.tsto ensure things mostly work so far.