浏览代码

Merge pull request #16393 from overleaf/em-typescript-libraries

Add type checking to libraries

GitOrigin-RevId: bed79f5123081773d6ac6e27698246726184c5e6
Eric Mc Sween 2 年之前
父节点
当前提交
d227dfba0c

+ 12 - 7
libraries/access-token-encryptor/package.json

@@ -3,13 +3,17 @@
   "version": "3.0.0",
   "description": "",
   "main": "index.js",
+  "types": "./types/index.js",
   "scripts": {
-    "test": "mocha test/**/*.js",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "",
   "license": "AGPL-3.0-only",
@@ -22,6 +26,7 @@
   "devDependencies": {
     "chai": "^4.3.6",
     "mocha": "^10.2.0",
-    "sandboxed-module": "^2.0.4"
+    "sandboxed-module": "^2.0.4",
+    "typescript": "^5.0.4"
   }
 }

+ 7 - 0
libraries/access-token-encryptor/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 12 - 8
libraries/fetch-utils/package.json

@@ -3,14 +3,17 @@
   "version": "0.1.0",
   "description": "utilities for node-fetch",
   "main": "index.js",
+  "types": "types/index.js",
   "scripts": {
-    "test": "npm run lint && npm run format && npm run test:unit",
-    "test:unit": "mocha",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test:unit"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",
@@ -19,7 +22,8 @@
     "chai": "^4.3.6",
     "chai-as-promised": "^7.1.1",
     "express": "^4.18.2",
-    "mocha": "^10.2.0"
+    "mocha": "^10.2.0",
+    "typescript": "^5.0.4"
   },
   "dependencies": {
     "@overleaf/o-error": "*",

+ 7 - 0
libraries/fetch-utils/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 13 - 7
libraries/logger/package.json

@@ -6,15 +6,20 @@
     "type": "git",
     "url": "https://github.com/overleaf/overleaf"
   },
+  "main": "index.js",
+  "types": "types/index.js",
   "license": "AGPL-3.0-only",
   "version": "3.1.1",
   "scripts": {
-    "test": "mocha --grep=$MOCHA_GREP test/**/*.js",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "test:ci": "npm run test"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "dependencies": {
     "@google-cloud/logging-bunyan": "^5.0.0",
@@ -28,7 +33,8 @@
     "mocha": "^10.2.0",
     "sandboxed-module": "^2.0.4",
     "sinon": "^9.2.4",
-    "sinon-chai": "^3.7.0"
+    "sinon-chai": "^3.7.0",
+    "typescript": "^5.0.4"
   },
   "peerDependencies": {
     "@overleaf/metrics": "*"

+ 7 - 0
libraries/logger/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 13 - 8
libraries/metrics/package.json

@@ -6,6 +6,8 @@
     "type": "git",
     "url": "https://github.com/overleaf/metrics-module.git"
   },
+  "main": "index.js",
+  "types": "types/index.js",
   "dependencies": {
     "@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
     "@google-cloud/profiler": "^6.0.0",
@@ -24,17 +26,20 @@
     "chai": "^4.3.6",
     "mocha": "^10.2.0",
     "sandboxed-module": "^2.0.4",
-    "sinon": "^9.2.4"
+    "sinon": "^9.2.4",
+    "typescript": "^5.0.4"
   },
   "scripts": {
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "test:unit": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/unit",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "test:acceptance": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/acceptance",
-    "test": "npm run test:unit && npm run test:acceptance",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "peerDependencies": {
     "@overleaf/logger": "*"

+ 7 - 0
libraries/metrics/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 10 - 7
libraries/o-error/package.json

@@ -13,6 +13,7 @@
     "verror"
   ],
   "main": "index.cjs",
+  "types": "types/index.cjs",
   "files": [
     "index.cjs",
     "index.d.ts"
@@ -21,15 +22,17 @@
     "build": "npm run --silent typecheck && npm run --silent test && npm run --silent declaration:build && npm run --silent update-readme",
     "declaration:build": "rm -f index.d.ts && tsc --allowJs --declaration --emitDeclarationOnly --moduleResolution node --target ES6 index.js",
     "declaration:check": "git diff --exit-code -- index.d.ts",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
     "prepublishOnly": "npm run --silent declaration:build && npm run --silent declaration:check",
-    "test": "mocha",
-    "typecheck": "tsc --allowJs --checkJs --noEmit --skipLibCheck --moduleResolution node --strict --target ES6 *.cjs test/**/*.js",
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "typecheck": "tsc --noEmit",
     "update-readme": "doc/update-readme.js",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run typecheck && npm run test"
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "MIT",

+ 7 - 0
libraries/o-error/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 12 - 8
libraries/object-persistor/package.json

@@ -3,14 +3,17 @@
   "version": "1.0.2",
   "description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them",
   "main": "index.js",
+  "types": "types/index.js",
   "scripts": {
-    "test": "npm run lint && npm run format && npm run test:unit",
-    "test:unit": "mocha",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test:unit"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "repository": {
     "type": "git",
@@ -39,6 +42,7 @@
     "mongodb": "^6.1.0",
     "sandboxed-module": "^2.0.4",
     "sinon": "^9.2.4",
-    "sinon-chai": "^3.7.0"
+    "sinon-chai": "^3.7.0",
+    "typescript": "^5.0.4"
   }
 }

+ 7 - 0
libraries/object-persistor/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 10 - 6
libraries/overleaf-editor-core/package.json

@@ -3,13 +3,17 @@
   "version": "1.0.0",
   "description": "Library shared between the editor server and clients.",
   "main": "index.js",
+  "types": "types/index.js",
   "scripts": {
-    "test": "mocha",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "lint": "eslint --max-warnings 0 --format unix lib test && tsc",
-    "lint:fix": "eslint --fix lib test",
-    "test:ci": "npm run test"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "team@overleaf.com",
   "license": "Proprietary",

+ 2 - 2
libraries/overleaf-editor-core/test/operation.test.js

@@ -62,8 +62,8 @@ describe('Operation', function () {
 
     return {
       snapshot: snapshotA,
-      operations: operations,
-      primeOperations: primeOperations,
+      operations,
+      primeOperations,
 
       log() {
         console.log(this)

+ 5 - 12
libraries/overleaf-editor-core/tsconfig.json

@@ -1,14 +1,7 @@
 {
-  "compilerOptions": {
-    "allowJs": true,
-    "allowSyntheticDefaultImports": true,
-    "checkJs": true,
-    "esModuleInterop": true,
-    "lib": ["es2022"],
-    "module": "commonjs",
-    "noEmit": true,
-    "resolveJsonModule": true,
-    "skipLibCheck": true
-  },
-  "include": ["lib/**/*", "typings/**/*"]
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
 }

+ 11 - 8
libraries/promise-utils/package.json

@@ -4,20 +4,23 @@
   "description": "utilities to help working with promises",
   "main": "index.js",
   "scripts": {
-    "test": "npm run lint && npm run format && npm run test:unit",
-    "test:unit": "mocha",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test:unit"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",
   "devDependencies": {
     "chai": "^4.3.10",
     "chai-as-promised": "^7.1.1",
-    "mocha": "^10.2.0"
+    "mocha": "^10.2.0",
+    "typescript": "^5.0.4"
   },
   "dependencies": {
     "p-limit": "^2.3.0"

+ 7 - 0
libraries/promise-utils/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 11 - 7
libraries/ranges-tracker/package.json

@@ -8,14 +8,18 @@
   "author": "Overleaf (https://www.overleaf.com)",
   "private": true,
   "scripts": {
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test": "mocha --recursive test/unit/src/",
-    "test:ci": "npm run test"
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "devDependencies": {
-    "mocha": "^10.2.0"
+    "mocha": "^10.2.0",
+    "typescript": "^5.0.4"
   }
 }

+ 1 - 0
libraries/ranges-tracker/test/notests.js

@@ -0,0 +1 @@
+// There are no tests yet

+ 7 - 0
libraries/ranges-tracker/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 11 - 7
libraries/redis-wrapper/package.json

@@ -13,12 +13,15 @@
   "repository": "github:overleaf/redis-wrapper",
   "license": "ISC",
   "scripts": {
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test": "mocha --recursive test/unit/src/",
-    "test:ci": "npm run test"
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "peerDependencies": {
     "@overleaf/logger": "*",
@@ -35,6 +38,7 @@
     "chai": "^4.3.6",
     "mocha": "^10.2.0",
     "sandboxed-module": "^2.0.4",
-    "sinon": "^9.2.4"
+    "sinon": "^9.2.4",
+    "typescript": "^5.0.4"
   }
 }

+ 7 - 0
libraries/redis-wrapper/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 13 - 6
libraries/settings/package.json

@@ -4,11 +4,18 @@
   "version": "3.0.0",
   "repository": "overleaf/settings-module",
   "scripts": {
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test": "echo noop",
-    "test:ci": "echo noop"
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
+  },
+  "devDependencies": {
+    "mocha": "^10.2.0",
+    "typescript": "^5.0.4"
   }
 }

+ 1 - 0
libraries/settings/test/notests.js

@@ -0,0 +1 @@
+// There are no tests yet

+ 7 - 0
libraries/settings/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 13 - 9
libraries/stream-utils/package.json

@@ -3,20 +3,24 @@
   "version": "0.1.0",
   "description": "stream handling utilities",
   "main": "index.js",
+  "types": "types/index.js",
   "scripts": {
-    "test": "npm run lint && npm run format && npm run test:unit",
-    "test:unit": "mocha",
-    "lint": "eslint --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix .",
-    "format": "prettier --list-different $PWD/'**/*.js'",
-    "format:fix": "prettier --write $PWD/'**/*.js'",
-    "test:ci": "npm run test:unit"
+    "test": "npm run lint && npm run format && npm run typecheck && npm run test:unit",
+    "test:unit": "mocha --exit test/**/*.{js,cjs}",
+    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "test:ci": "npm run test:unit",
+    "typecheck": "tsc --noEmit",
+    "update-types": "rm -rf types && tsc --emitDeclarationOnly"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",
-  "devDependencies":{
+  "devDependencies": {
     "chai": "^4.3.6",
     "chai-as-promised": "^7.1.1",
-    "mocha": "^10.2.0"
+    "mocha": "^10.2.0",
+    "typescript": "^5.0.4"
   }
 }

+ 7 - 0
libraries/stream-utils/tsconfig.json

@@ -0,0 +1,7 @@
+{
+  "extends": "../../tsconfig.backend.json",
+  "include": [
+    "**/*.js",
+    "**/*.cjs"
+  ]
+}

+ 49 - 21
package-lock.json

@@ -86,7 +86,8 @@
       "devDependencies": {
         "chai": "^4.3.6",
         "mocha": "^10.2.0",
-        "sandboxed-module": "^2.0.4"
+        "sandboxed-module": "^2.0.4",
+        "typescript": "^5.0.4"
       },
       "peerDependencies": {
         "mongodb": "*"
@@ -117,7 +118,8 @@
         "chai": "^4.3.6",
         "chai-as-promised": "^7.1.1",
         "express": "^4.18.2",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "libraries/fetch-utils/node_modules/body-parser": {
@@ -284,7 +286,8 @@
         "mocha": "^10.2.0",
         "sandboxed-module": "^2.0.4",
         "sinon": "^9.2.4",
-        "sinon-chai": "^3.7.0"
+        "sinon-chai": "^3.7.0",
+        "typescript": "^5.0.4"
       },
       "peerDependencies": {
         "@overleaf/metrics": "*"
@@ -311,7 +314,8 @@
         "chai": "^4.3.6",
         "mocha": "^10.2.0",
         "sandboxed-module": "^2.0.4",
-        "sinon": "^9.2.4"
+        "sinon": "^9.2.4",
+        "typescript": "^5.0.4"
       },
       "peerDependencies": {
         "@overleaf/logger": "*"
@@ -359,7 +363,8 @@
         "mongodb": "^6.1.0",
         "sandboxed-module": "^2.0.4",
         "sinon": "^9.2.4",
-        "sinon-chai": "^3.7.0"
+        "sinon-chai": "^3.7.0",
+        "typescript": "^5.0.4"
       },
       "peerDependencies": {
         "@overleaf/logger": "*"
@@ -509,7 +514,8 @@
       "license": "Proprietary",
       "devDependencies": {
         "chai": "^4.3.6",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "libraries/promise-utils": {
@@ -522,7 +528,8 @@
       "devDependencies": {
         "chai": "^4.3.10",
         "chai-as-promised": "^7.1.1",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "libraries/promise-utils/node_modules/chai": {
@@ -572,7 +579,8 @@
     "libraries/ranges-tracker": {
       "name": "@overleaf/ranges-tracker",
       "devDependencies": {
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "libraries/redis-wrapper": {
@@ -589,7 +597,8 @@
         "chai": "^4.3.6",
         "mocha": "^10.2.0",
         "sandboxed-module": "^2.0.4",
-        "sinon": "^9.2.4"
+        "sinon": "^9.2.4",
+        "typescript": "^5.0.4"
       },
       "peerDependencies": {
         "@overleaf/logger": "*",
@@ -599,7 +608,11 @@
     },
     "libraries/settings": {
       "name": "@overleaf/settings",
-      "version": "3.0.0"
+      "version": "3.0.0",
+      "devDependencies": {
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
+      }
     },
     "libraries/stream-utils": {
       "name": "@overleaf/stream-utils",
@@ -608,7 +621,8 @@
       "devDependencies": {
         "chai": "^4.3.6",
         "chai-as-promised": "^7.1.1",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "node_modules/@aashutoshrathi/word-wrap": {
@@ -53677,7 +53691,8 @@
         "chai": "^4.3.6",
         "lodash": "^4.17.21",
         "mocha": "^10.2.0",
-        "sandboxed-module": "^2.0.4"
+        "sandboxed-module": "^2.0.4",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/analytics": {
@@ -54173,7 +54188,8 @@
         "express": "^4.18.2",
         "lodash": "^4.17.21",
         "mocha": "^10.2.0",
-        "node-fetch": "^2.6.11"
+        "node-fetch": "^2.6.11",
+        "typescript": "^5.0.4"
       },
       "dependencies": {
         "body-parser": {
@@ -54474,7 +54490,8 @@
         "mocha": "^10.2.0",
         "sandboxed-module": "^2.0.4",
         "sinon": "^9.2.4",
-        "sinon-chai": "^3.7.0"
+        "sinon-chai": "^3.7.0",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/metrics": {
@@ -54495,6 +54512,7 @@
         "prom-client": "^14.1.1",
         "sandboxed-module": "^2.0.4",
         "sinon": "^9.2.4",
+        "typescript": "^5.0.4",
         "yn": "^3.1.1"
       },
       "dependencies": {
@@ -54583,7 +54601,8 @@
         "sandboxed-module": "^2.0.4",
         "sinon": "^9.2.4",
         "sinon-chai": "^3.7.0",
-        "tiny-async-pool": "^1.1.0"
+        "tiny-async-pool": "^1.1.0",
+        "typescript": "^5.0.4"
       },
       "dependencies": {
         "bson": {
@@ -54621,7 +54640,8 @@
       "version": "file:libraries/piece-table",
       "requires": {
         "chai": "^4.3.6",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/project-history": {
@@ -54770,7 +54790,8 @@
         "chai": "^4.3.10",
         "chai-as-promised": "^7.1.1",
         "mocha": "^10.2.0",
-        "p-limit": "^2.3.0"
+        "p-limit": "^2.3.0",
+        "typescript": "^5.0.4"
       },
       "dependencies": {
         "chai": {
@@ -54810,7 +54831,8 @@
     "@overleaf/ranges-tracker": {
       "version": "file:libraries/ranges-tracker",
       "requires": {
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/real-time": {
@@ -54879,7 +54901,8 @@
         "ioredis": "~4.27.1",
         "mocha": "^10.2.0",
         "sandboxed-module": "^2.0.4",
-        "sinon": "^9.2.4"
+        "sinon": "^9.2.4",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/references": {
@@ -54907,7 +54930,11 @@
       }
     },
     "@overleaf/settings": {
-      "version": "file:libraries/settings"
+      "version": "file:libraries/settings",
+      "requires": {
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
+      }
     },
     "@overleaf/spelling": {
       "version": "file:services/spelling",
@@ -54943,7 +54970,8 @@
       "requires": {
         "chai": "^4.3.6",
         "chai-as-promised": "^7.1.1",
-        "mocha": "^10.2.0"
+        "mocha": "^10.2.0",
+        "typescript": "^5.0.4"
       }
     },
     "@overleaf/templates": {