Jelajahi Sumber

Merge pull request #18167 from overleaf/em-simpler-typescript-backend

Simpler Typescript setup in the backend

GitOrigin-RevId: 3a90f26a5ac8029d14203faa98008375ce933e7d
Eric Mc Sween 2 tahun lalu
induk
melakukan
e87df4a791
43 mengubah file dengan 63 tambahan dan 155 penghapusan
  1. 1 4
      libraries/access-token-encryptor/package.json
  2. 0 4
      libraries/access-token-encryptor/tsconfig.json
  3. 1 4
      libraries/fetch-utils/package.json
  4. 0 4
      libraries/fetch-utils/tsconfig.json
  5. 1 4
      libraries/logger/package.json
  6. 0 4
      libraries/logger/tsconfig.json
  7. 1 4
      libraries/metrics/package.json
  8. 0 4
      libraries/metrics/tsconfig.json
  9. 2 6
      libraries/o-error/package.json
  10. 0 4
      libraries/o-error/tsconfig.json
  11. 1 4
      libraries/object-persistor/package.json
  12. 0 4
      libraries/object-persistor/tsconfig.json
  13. 1 4
      libraries/overleaf-editor-core/package.json
  14. 0 4
      libraries/overleaf-editor-core/tsconfig.json
  15. 1 4
      libraries/promise-utils/package.json
  16. 0 4
      libraries/promise-utils/tsconfig.json
  17. 0 1
      libraries/ranges-tracker/index.cjs
  18. 1 4
      libraries/ranges-tracker/package.json
  19. 0 4
      libraries/ranges-tracker/tsconfig.json
  20. 12 0
      libraries/redis-wrapper/RedisLocker.js
  21. 1 4
      libraries/redis-wrapper/package.json
  22. 0 4
      libraries/redis-wrapper/tsconfig.json
  23. 1 4
      libraries/settings/package.json
  24. 0 4
      libraries/settings/tsconfig.json
  25. 1 4
      libraries/stream-utils/package.json
  26. 0 4
      libraries/stream-utils/tsconfig.json
  27. 6 6
      package-lock.json
  28. 1 4
      services/chat/Makefile
  29. 1 4
      services/clsi/Makefile
  30. 1 4
      services/contacts/Makefile
  31. 1 4
      services/docstore/Makefile
  32. 1 4
      services/document-updater/Makefile
  33. 1 1
      services/document-updater/app/js/types.ts
  34. 1 4
      services/filestore/Makefile
  35. 1 4
      services/history-v1/Makefile
  36. 1 1
      services/history-v1/storage/lib/project_archive.js
  37. 1 4
      services/notifications/Makefile
  38. 1 4
      services/project-history/Makefile
  39. 1 4
      services/real-time/Makefile
  40. 1 4
      services/spelling/Makefile
  41. 1 3
      services/web/Dockerfile
  42. 3 1
      services/web/tsconfig.json
  43. 15 0
      tsconfig.backend.json

+ 1 - 4
libraries/access-token-encryptor/package.json

@@ -3,7 +3,6 @@
   "version": "3.0.0",
   "description": "",
   "main": "index.js",
-  "types": "./types/index.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
@@ -12,9 +11,7 @@
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "",
   "license": "AGPL-3.0-only",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/fetch-utils/package.json

@@ -3,7 +3,6 @@
   "version": "0.1.0",
   "description": "utilities for node-fetch",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
@@ -12,9 +11,7 @@
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/logger/package.json

@@ -7,7 +7,6 @@
     "url": "https://github.com/overleaf/overleaf"
   },
   "main": "index.js",
-  "types": "types/index.d.ts",
   "license": "AGPL-3.0-only",
   "version": "3.1.1",
   "scripts": {
@@ -18,9 +17,7 @@
     "lint:fix": "eslint --fix --ext .js --ext .cjs .",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "dependencies": {
     "@google-cloud/logging-bunyan": "^5.0.0",

+ 0 - 4
libraries/logger/tsconfig.json

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/metrics/package.json

@@ -7,7 +7,6 @@
     "url": "https://github.com/overleaf/metrics-module.git"
   },
   "main": "index.js",
-  "types": "types/index.d.ts",
   "dependencies": {
     "@google-cloud/opentelemetry-cloud-trace-exporter": "^2.1.0",
     "@google-cloud/profiler": "^6.0.0",
@@ -38,9 +37,7 @@
     "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "peerDependencies": {
     "@overleaf/logger": "*"

+ 0 - 4
libraries/metrics/tsconfig.json

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 2 - 6
libraries/o-error/package.json

@@ -13,10 +13,8 @@
     "verror"
   ],
   "main": "index.cjs",
-  "types": "types/index.d.cts",
   "files": [
-    "index.cjs",
-    "types/index.d.cts"
+    "index.cjs"
   ],
   "scripts": {
     "build": "npm run --silent test",
@@ -27,9 +25,7 @@
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "MIT",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/object-persistor/package.json

@@ -3,7 +3,6 @@
   "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.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
@@ -12,9 +11,7 @@
     "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "repository": {
     "type": "git",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/overleaf-editor-core/package.json

@@ -3,7 +3,6 @@
   "version": "1.0.0",
   "description": "Library shared between the editor server and clients.",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
@@ -12,9 +11,7 @@
     "lint:fix": "eslint --fix --ext .js --ext .cjs .",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "team@overleaf.com",
   "license": "Proprietary",

+ 0 - 4
libraries/overleaf-editor-core/tsconfig.json

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/promise-utils/package.json

@@ -3,7 +3,6 @@
   "version": "0.1.0",
   "description": "utilities to help working with promises",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
@@ -12,9 +11,7 @@
     "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 0 - 1
libraries/ranges-tracker/index.cjs

@@ -1,4 +1,3 @@
-// @ts-check
 /**
  * The purpose of this class is to track a set of inserts and deletes to a document, like
  * track changes in Word. We store these as a set of ShareJs style ranges:

+ 1 - 4
libraries/ranges-tracker/package.json

@@ -2,7 +2,6 @@
   "name": "@overleaf/ranges-tracker",
   "description": "Shared logic for syncing comments and tracked changes with operational transforms",
   "main": "index.cjs",
-  "types": "types/index.d.cts",
   "files": [
     "index.cjs",
     "types"
@@ -17,9 +16,7 @@
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "devDependencies": {
     "mocha": "^10.2.0",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 12 - 0
libraries/redis-wrapper/RedisLocker.js

@@ -96,6 +96,9 @@ module.exports = class RedisLocker {
     return `locked:host=${HOST}:pid=${PID}:random=${RND}:time=${time}:count=${COUNT++}`
   }
 
+  /**
+   * @param {Callback} callback
+   */
   tryLock(id, callback) {
     if (callback == null) {
       callback = function () {}
@@ -135,6 +138,9 @@ module.exports = class RedisLocker {
     )
   }
 
+  /**
+   * @param {Callback} callback
+   */
   getLock(id, callback) {
     if (callback == null) {
       callback = function () {}
@@ -166,6 +172,9 @@ module.exports = class RedisLocker {
     attempt()
   }
 
+  /**
+   * @param {Callback} callback
+   */
   checkLock(id, callback) {
     if (callback == null) {
       callback = function () {}
@@ -186,6 +195,9 @@ module.exports = class RedisLocker {
     })
   }
 
+  /**
+   * @param {Callback} callback
+   */
   releaseLock(id, lockValue, callback) {
     const key = this.getKey(id)
     return this.rclient.eval(

+ 1 - 4
libraries/redis-wrapper/package.json

@@ -3,7 +3,6 @@
   "version": "2.1.0",
   "description": "Redis wrapper for node which will either use cluster or single instance redis",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "files": [
     "index.js",
     "Errors.js",
@@ -21,9 +20,7 @@
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "peerDependencies": {
     "@overleaf/logger": "*",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/settings/package.json

@@ -4,7 +4,6 @@
   "version": "3.0.0",
   "repository": "overleaf/settings-module",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "scripts": {
     "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
     "lint:fix": "eslint --fix --ext .js --ext .cjs .",
@@ -13,9 +12,7 @@
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "devDependencies": {
     "mocha": "^10.2.0",

+ 0 - 4
libraries/settings/tsconfig.json

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 1 - 4
libraries/stream-utils/package.json

@@ -3,7 +3,6 @@
   "version": "0.1.0",
   "description": "stream handling utilities",
   "main": "index.js",
-  "types": "types/index.d.ts",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
@@ -12,9 +11,7 @@
     "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
     "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
     "test:ci": "npm run test:unit",
-    "types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly",
-    "types:check": "tsc --noEmit",
-    "types:rebuild": "rm -rf types && npm run types:build"
+    "types:check": "tsc --noEmit"
   },
   "author": "Overleaf (https://www.overleaf.com)",
   "license": "AGPL-3.0-only",

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

@@ -1,9 +1,5 @@
 {
   "extends": "../../tsconfig.backend.json",
-  "compilerOptions": {
-    "declaration": true,
-    "outDir": "types"
-  },
   "include": [
     "**/*.js",
     "**/*.cjs"

+ 6 - 6
package-lock.json

@@ -38926,9 +38926,9 @@
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
     },
     "node_modules/typescript": {
-      "version": "5.2.2",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
-      "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+      "version": "5.4.5",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
+      "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
       "dev": true,
       "bin": {
         "tsc": "bin/tsc",
@@ -77933,9 +77933,9 @@
       "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c="
     },
     "typescript": {
-      "version": "5.2.2",
-      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.2.2.tgz",
-      "integrity": "sha512-mI4WrpHsbCIcwT9cF4FZvr80QUeKvsUsUvKDoR+X/7XHQH98xYD8YHZg7ANtz2GtZt/CBq2QJ0thkGJMHfqc1w==",
+      "version": "5.4.5",
+      "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.4.5.tgz",
+      "integrity": "sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==",
       "dev": true
     },
     "typical": {

+ 1 - 4
services/chat/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/clsi/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/contacts/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/docstore/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/document-updater/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 1
services/document-updater/app/js/types.ts

@@ -1,4 +1,4 @@
-import { TrackingPropsRawData } from 'overleaf-editor-core/types/lib/types'
+import { TrackingPropsRawData } from 'overleaf-editor-core/lib/types'
 
 /**
  * An update coming from the editor

+ 1 - 4
services/filestore/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/history-v1/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 1
services/history-v1/storage/lib/project_archive.js

@@ -1,7 +1,7 @@
 // @ts-check
 'use strict'
 
-/** @typedef {import('overleaf-editor-core/types').Snapshot} Snapshot */
+/** @typedef {import('overleaf-editor-core').Snapshot} Snapshot */
 
 const Archive = require('archiver')
 const BPromise = require('bluebird')

+ 1 - 4
services/notifications/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/project-history/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/real-time/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 4
services/spelling/Makefile

@@ -48,10 +48,7 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-build_types:
-	$(RUN_LINTING_MONOREPO) --workspaces --if-present types:build
-
-typecheck: build_types
+typecheck:
 	$(RUN_LINTING) types:check
 
 test: format lint typecheck test_unit test_acceptance

+ 1 - 3
services/web/Dockerfile

@@ -35,9 +35,7 @@ FROM deps-prod as deps
 ENV CYPRESS_INSTALL_BINARY=0
 
 COPY tsconfig.backend.json /overleaf/
-RUN cd /overleaf \
- && npm install \
- && npm run --workspaces --if-present types:build
+RUN cd /overleaf && npm install
 
 # the web image with only production dependencies but no webpack production build, for development
 FROM deps-prod as app-only

+ 3 - 1
services/web/tsconfig.json

@@ -12,7 +12,9 @@
     "skipLibCheck": true /* Skip type checking of declaration files. */,
     "forceConsistentCasingInFileNames": true /* Disallow inconsistently-cased references to the same file. */,
     "paths": {
-      "@/*": ["./frontend/js/*"]
+      "@/*": ["./frontend/js/*"],
+      "@overleaf/o-error": ["../../libraries/o-error"],
+      "@overleaf/ranges-tracker": ["../../libraries/ranges-tracker"]
     },
     "types": ["cypress", "@testing-library/cypress"]
   },

+ 15 - 0
tsconfig.backend.json

@@ -5,6 +5,21 @@
     "moduleResolution": "node",
     "noEmit": true,
     "noImplicitAny": false,
+    "paths": {
+      "@overleaf/access-token-encryptor": ["./libraries/access-token-encryptor"],
+      "@overleaf/fetch-utils": ["./libraries/fetch-utils"],
+      "@overleaf/logger": ["./libraries/logger"],
+      "@overleaf/metrics": ["./libraries/metrics"],
+      "@overleaf/object-persistor": ["./libraries/object-persistor"],
+      "@overleaf/o-error": ["./libraries/o-error"],
+      "overleaf-editor-core": ["./libraries/overleaf-editor-core"],
+      "@overleaf/piece-table": ["./libraries/piece-table"],
+      "@overleaf/promise-utils": ["./libraries/promise-utils"],
+      "@overleaf/ranges-tracker": ["./libraries/ranges-tracker"],
+      "@overleaf/redis-wrapper": ["./libraries/redis-wrapper"],
+      "@overleaf/settings": ["./libraries/settings"],
+      "@overleaf/stream-utils": ["./libraries/stream-utils"]
+    },
     "skipLibCheck": true,
     "strict": true,
     "target": "ES2022"