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

Simpler Typescript setup in the backend

GitOrigin-RevId: 3a90f26a5ac8029d14203faa98008375ce933e7d
This commit is contained in:
Eric Mc Sween 2024-05-06 07:57:39 -04:00 committed by Copybot
parent 5da8662fa8
commit e87df4a791
43 changed files with 63 additions and 155 deletions

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,6 @@
"version": "1.0.2", "version": "1.0.2",
"description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them", "description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them",
"main": "index.js", "main": "index.js",
"types": "types/index.d.ts",
"scripts": { "scripts": {
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit", "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
"test:unit": "mocha --exit test/**/*.{js,cjs}", "test:unit": "mocha --exit test/**/*.{js,cjs}",
@ -12,9 +11,7 @@
"format": "prettier --list-different $PWD/'**/*.{js,cjs}'", "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
"format:fix": "prettier --write $PWD/'**/*.{js,cjs}'", "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
"test:ci": "npm run test:unit", "test:ci": "npm run test:unit",
"types:build": "[ -d types ] || tsc --noEmit false --emitDeclarationOnly", "types:check": "tsc --noEmit"
"types:check": "tsc --noEmit",
"types:rebuild": "rm -rf types && npm run types:build"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

12
package-lock.json generated
View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -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 * An update coming from the editor

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -5,6 +5,21 @@
"moduleResolution": "node", "moduleResolution": "node",
"noEmit": true, "noEmit": true,
"noImplicitAny": false, "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, "skipLibCheck": true,
"strict": true, "strict": true,
"target": "ES2022" "target": "ES2022"