Skip to content

NODEJS-680: Update and Automate TypeScript Support #439

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 81 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
a003557
tsconfig
SiyaoIsHiding Jan 16, 2025
8078d90
tests can run
SiyaoIsHiding Jan 21, 2025
9dc0a4c
can run tests and emit files
SiyaoIsHiding Jan 21, 2025
2628567
auth folder migrated to es6 export, tests break
SiyaoIsHiding Jan 21, 2025
5efc443
change test files to ts, can run by "npx ts-mocha test/unit --extensi…
SiyaoIsHiding Jan 22, 2025
5fefb6f
Merge branch 'ts-migration' of github.com:SiyaoIsHiding/nodejs-driver…
SiyaoIsHiding Jan 22, 2025
add7bcc
fix imports
SiyaoIsHiding Jan 22, 2025
965b456
for private publish
SiyaoIsHiding Jan 23, 2025
48ec973
can work with both esm and cjs syntax
SiyaoIsHiding Feb 7, 2025
c276779
run ts2esm. Still need to change export to export default {...}
SiyaoIsHiding Feb 12, 2025
1becd83
works! export both default and named. Works for both esm and cjs. Cjs…
SiyaoIsHiding Mar 4, 2025
e00a159
rm tsdoc-metadata.json
SiyaoIsHiding Mar 5, 2025
64787f2
Merge remote-tracking branch 'upstream/master' into ts-migration
SiyaoIsHiding Mar 5, 2025
cbf355e
the auth folder to ES6
SiyaoIsHiding Mar 5, 2025
f478589
delete ".js" in import
SiyaoIsHiding Mar 6, 2025
a61e2b4
Merge branch 'ts-migration' into ts-migration-es6
SiyaoIsHiding Mar 6, 2025
e71a034
refactor encoder
SiyaoIsHiding Mar 7, 2025
2f1eb9f
Update import syntax for tests. Pass tests except for constructor errors
SiyaoIsHiding Mar 11, 2025
ee1c9a0
Merge branch 'ts-migration' into ts-migration-es6
SiyaoIsHiding Mar 11, 2025
8238fb1
Fix Long
SiyaoIsHiding Mar 11, 2025
3d16cec
BigDecimal
SiyaoIsHiding Mar 11, 2025
4d4386f
half of the types
SiyaoIsHiding Mar 13, 2025
4aae437
add typescript eslint
SiyaoIsHiding Mar 13, 2025
3c1051f
add typescript eslint
SiyaoIsHiding Mar 13, 2025
9567a33
delete "use strict";
SiyaoIsHiding Mar 13, 2025
73ddf85
revert package name
SiyaoIsHiding Mar 13, 2025
9a30509
Fixing indentation
SiyaoIsHiding Mar 13, 2025
0fdf8b1
clear some eslint errors. delete index.d.ts
SiyaoIsHiding Mar 13, 2025
6772695
Merge branch 'ts-migration' into ts-migration-es6
SiyaoIsHiding Mar 13, 2025
afcd0d6
eslint fix
SiyaoIsHiding Mar 13, 2025
fc5e85f
add "@stylistic/eslint-plugin": "^3.1.0",
SiyaoIsHiding Mar 13, 2025
a122886
Merge branch 'ts-migration' into ts-migration-es6
SiyaoIsHiding Mar 13, 2025
ae0ed20
merge conflict of Integer
SiyaoIsHiding Mar 13, 2025
3c25058
everything in types done
SiyaoIsHiding Mar 13, 2025
a7bc975
errors, host, opration-states, utils
SiyaoIsHiding Mar 17, 2025
302181c
graph folder
SiyaoIsHiding Mar 18, 2025
0c3e490
search and geometry
SiyaoIsHiding Mar 18, 2025
36e55f8
policies folder
SiyaoIsHiding Mar 18, 2025
98c8ce1
metadata folder
SiyaoIsHiding Mar 19, 2025
6949193
request-tracker
SiyaoIsHiding Mar 19, 2025
b46f7d9
lib/ files. Mapping and ClientOptions left.
SiyaoIsHiding Mar 21, 2025
6b10719
mapping folder
SiyaoIsHiding Mar 21, 2025
a037546
metrics
SiyaoIsHiding Mar 21, 2025
0563c86
Massive removal of circular dependency
SiyaoIsHiding Mar 25, 2025
5a38264
madge
SiyaoIsHiding Mar 25, 2025
c7d66e7
client-tests refactored to use sinon for mocking instead of proxyquire
SiyaoIsHiding Mar 26, 2025
99a6ecf
control connection tests fixed
SiyaoIsHiding Mar 26, 2025
6b6fb4a
map error fixed. proxyquire cleared from unit tests
SiyaoIsHiding Mar 26, 2025
9b55259
pass unit tests except for API exposure
SiyaoIsHiding Mar 26, 2025
ea4df5d
should not use implement but extends
SiyaoIsHiding Mar 26, 2025
001e3a1
sth wrong with .d.ts rollup
SiyaoIsHiding Mar 26, 2025
f5c871a
fix some tests
SiyaoIsHiding Mar 27, 2025
2085e95
fix client ValueCallback
SiyaoIsHiding Mar 28, 2025
410d4bd
rollup and api-extractor configured. started fixing auth API
SiyaoIsHiding Apr 2, 2025
f3c6ed7
fixing API exposures. Fixed auth, concurrent, datastax
SiyaoIsHiding Apr 2, 2025
64de65a
geography and mapping API fixed
SiyaoIsHiding Apr 3, 2025
399d822
All folders except for types
SiyaoIsHiding Apr 4, 2025
d08dc12
Fixed all API exposres. Clear api-extractor warnings
SiyaoIsHiding Apr 4, 2025
56fda2f
pass all tests
SiyaoIsHiding Apr 22, 2025
3ed2b29
fix type exports
SiyaoIsHiding Apr 22, 2025
648f47e
clean eslint errors
SiyaoIsHiding Apr 22, 2025
7a232cd
massive organize imports
SiyaoIsHiding Apr 22, 2025
6960b72
roll up and api-extractor and gitignore
SiyaoIsHiding Apr 25, 2025
5e7a6ac
mocha reporters
SiyaoIsHiding Apr 26, 2025
928c2bc
fix encoder failing test
SiyaoIsHiding Apr 26, 2025
2181072
Merge remote-tracking branch 'upstream/master' into ts-migration-es6
SiyaoIsHiding Apr 26, 2025
71dd3fd
add linting and bundling to Jenkinsfile
SiyaoIsHiding Apr 26, 2025
89c9146
install ts-mocha
SiyaoIsHiding Apr 26, 2025
ff88a23
utils.log.bind(this)
SiyaoIsHiding Apr 26, 2025
719a3f6
add api-extractor
SiyaoIsHiding Apr 26, 2025
a807ce1
fix DefaultRetryPolicy
SiyaoIsHiding Apr 26, 2025
f914726
rowParser
SiyaoIsHiding Apr 28, 2025
195d4e8
remove proxyquire, sni.address
SiyaoIsHiding Apr 28, 2025
392e685
OperationState and ResultSet
SiyaoIsHiding Apr 29, 2025
63fbd3a
CI of appending namespaces
SiyaoIsHiding May 1, 2025
7b48823
Travis CI
SiyaoIsHiding May 1, 2025
1eab31b
npm install
SiyaoIsHiding May 1, 2025
7a099d0
move typescriipt tests to test/other/typescript
SiyaoIsHiding May 1, 2025
162c85f
eslint ignore typescript test files
SiyaoIsHiding May 1, 2025
b9ccb69
Fix some cassandra-driver-public.d.ts errors
SiyaoIsHiding May 14, 2025
c691447
Expose Edge etc.
SiyaoIsHiding May 14, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 4 additions & 2 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# TypeScript: js files are generated using tsc transpiler
/test/unit/typescript/*.js
/test/other/typescript/*

# Integer is part of the Closure Library
/lib/types/integer.js

# TinkerPop-based files
/lib/datastax/graph/type-serializers.js
/lib/datastax/graph/type-serializers.js

/out/**/*.js
36 changes: 32 additions & 4 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
module.exports = {
plugins: [
"@stylistic",
'@typescript-eslint'
],
parser: '@typescript-eslint/parser',
"env": {
"commonjs": true,
"es6": true
},
"parserOptions": {
"ecmaVersion": 2017
},
"extends": "eslint:recommended",
"extends": ["eslint:recommended", "plugin:@typescript-eslint/eslint-recommended", 'plugin:@typescript-eslint/recommended'],
"rules": {
"indent": [
"error",
Expand All @@ -32,7 +37,16 @@ module.exports = {
"strict": ["error", "global"],
"array-callback-return": "error",
"curly": "error",
"no-unused-vars": ["error", { "args": "none" }],
"no-prototype-builtins": "off",
"@typescript-eslint/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-duplicate-enum-values": "off",
"@typescript-eslint/no-unused-vars": ["error", {
"argsIgnorePattern": "^_",
"caughtErrorsIgnorePattern": "^_"
}],
"@typescript-eslint/no-unsafe-function-type": "off",
"@typescript-eslint/ban-ts-comment": "off",
"global-require": "error",
"eqeqeq": ["error", "allow-null"],

Expand Down Expand Up @@ -67,7 +81,7 @@ module.exports = {
"no-new-wrappers": "error",
"no-octal-escape": "error",
"no-proto": "error",
"no-redeclare": "error",
"no-redeclare": "off",
"no-restricted-properties": ["error", {
object: "arguments",
property: "callee",
Expand All @@ -88,6 +102,8 @@ module.exports = {
allowShortCircuit: false,
allowTernary: false,
}],
"@typescript-eslint/no-this-alias": "off",
"@typescript-eslint/no-explicit-any": "off",
"no-useless-call": "off",
"no-useless-concat": "error",
"no-useless-escape": "error",
Expand All @@ -104,7 +120,19 @@ module.exports = {
"yoda": "error",
"constructor-super": "error",
"require-await": "error",
"require-atomic-updates": "off"
"require-atomic-updates": "off",
"prefer-rest-params": "off",
"sort-imports":
[
"error",
{
"ignoreCase": true,
"ignoreDeclarationSort": true
}
],
"@typescript-eslint/no-require-imports": "off",
"prefer-spread": "off",
"@typescript-eslint/no-unsafe-function-types": "off",
},
"globals": {
"Buffer": false,
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,6 @@ out/
/docs
**/typescript/*.js
**/typescript/*.js.map
**/typescript/generated.ts

tsdoc-metadata.json
temp
8 changes: 8 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
}
},
"fileExtensions": ["ts"]
}
12 changes: 5 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,15 @@ jobs:
include:
- stage: "tests"
name: "Run eslint"
script: "npm install -g eslint@4; npm run eslint;"
script: "npm run eslint;"
node_js: "18"
- name: "TypeScript 4.9 generation and compilation tests"
node_js: "18"
script:
- npm install -g [email protected];
- pushd test/unit/typescript/
- pushd test/other/typescript/
- npm install
- tsc -p .
- node -e "require('./api-generation-test').generate()" > generated.ts
- tsc generated.ts
- name: "Unit tests - Node.js 20"
node_js: "20"
script: "npm test"
Expand All @@ -39,7 +38,6 @@ jobs:
node_js: "18"
script:
- npm install -g typescript;
- pushd test/unit/typescript/
- pushd test/other/typescript/
- npm install
- tsc -p .
- node -e "require('./api-generation-test').generate()" > generated.ts
- tsc generated.ts
12 changes: 6 additions & 6 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,15 @@ def installDriverAndDependencies() {
'''

sh label: 'Install driver dependencies', script: '''#!/bin/bash -lex
npm install mocha-jenkins-reporter@0
npm install kerberos@1
npm install -g eslint@4
'''
}

def executeLinter() {
sh label: 'Perform static analysis of source code', script: '''#!/bin/bash -lex
def executeStaticAnalysisAndBundler() {
sh label: 'Perform static analysis and bundling of source code', script: '''#!/bin/bash -lex
npm run eslint
npm run circular-dep
npm run bundle
'''
}

Expand Down Expand Up @@ -219,7 +219,7 @@ def describeAdhocTestingStage() {
def describeInstallAndLint(){
describePerCommitStage()
installDriverAndDependencies()
executeLinter()
executeStaticAnalysisAndBundler()
}

// branch pattern for cron
Expand Down Expand Up @@ -556,7 +556,7 @@ pipeline {
}
stage('Execute-Linter') {
steps {
executeLinter()
executeStaticAnalysisAndBundler()
}
}
stage('Execute-Tests') {
Expand Down
Loading