Skip to content

CASSNODEJS-8: First TypeScript PR: Massive rename#461

Open
SiyaoIsHiding wants to merge 4 commits into
apache:typescriptfrom
SiyaoIsHiding:ts/rename
Open

CASSNODEJS-8: First TypeScript PR: Massive rename#461
SiyaoIsHiding wants to merge 4 commits into
apache:typescriptfrom
SiyaoIsHiding:ts/rename

Conversation

@SiyaoIsHiding
Copy link
Copy Markdown
Contributor

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 diff will 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.ts to ensure things mostly work so far.

@SiyaoIsHiding
Copy link
Copy Markdown
Contributor Author

GH does not allow me to request @toptobes 's review, but I'd appreciate it

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and index.js to .ts and removed .js suffixes from internal require() paths.
  • Added tsconfig.json (CommonJS, ES2015, allowJs, declaration) and added ts-mocha/typescript as devDependencies.
  • Removed the "types": "./index.d.ts" entry from package.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.

Comment thread package.json
@@ -18,7 +18,6 @@
"graphdb"
],
"license": "Apache-2.0",
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, but we will fix those later, because we will add roll-up and api-extractor.

Comment thread package.json
Comment on lines +33 to +35
"temp": ">= 0.8.3",
"ts-mocha": "^10.0.0",
"typescript": "^5.7.3"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct, we will need to fix those scripts and other project setup later.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants