Browse Source

Merge pull request #20331 from overleaf/jpa-build-scripts-sync

 [misc] sync build scripts

GitOrigin-RevId: 343fd861b6c7b3d81b21babbd41bbb968f0fd448
Jakob Ackermann 1 year ago
parent
commit
84be385550

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

@@ -5,10 +5,10 @@
   "main": "index.js",
   "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 .",
-    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
-    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
-    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "types:check": "tsc --noEmit"

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

@@ -5,10 +5,10 @@
   "main": "index.js",
   "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 .",
-    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
-    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
-    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "types:check": "tsc --noEmit"

+ 4 - 4
libraries/logger/package.json

@@ -11,10 +11,10 @@
   "version": "3.1.1",
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && 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 .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "types:check": "tsc --noEmit"

+ 4 - 4
libraries/metrics/package.json

@@ -29,13 +29,13 @@
     "typescript": "^5.0.4"
   },
   "scripts": {
-    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "test:acceptance": "mocha --reporter spec --recursive --exit --grep=$MOCHA_GREP test/acceptance",
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
-    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
-    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "types:check": "tsc --noEmit"
   },

+ 4 - 4
libraries/o-error/package.json

@@ -18,11 +18,11 @@
   ],
   "scripts": {
     "build": "npm run --silent test",
-    "lint": "eslint --ext .js --ext .cjs --max-warnings 0 --format unix .",
-    "lint:fix": "eslint --fix --ext .js --ext .cjs .",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
     "test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
-    "format": "prettier --list-different $PWD/'**/*.{js,cjs}'",
-    "format:fix": "prettier --write $PWD/'**/*.{js,cjs}'",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "test:unit": "mocha --exit test/**/*.{js,cjs}",
     "types:check": "tsc --noEmit"

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

@@ -6,10 +6,10 @@
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && 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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "types:check": "tsc --noEmit"
   },

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

@@ -6,10 +6,10 @@
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && 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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "types:check": "tsc --noEmit"
   },

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

@@ -9,10 +9,10 @@
   "author": "Overleaf (https://www.overleaf.com)",
   "private": true,
   "scripts": {
-    "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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "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}",

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

@@ -13,10 +13,10 @@
   "repository": "github:overleaf/redis-wrapper",
   "license": "ISC",
   "scripts": {
-    "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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "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}",

+ 4 - 4
libraries/settings/package.json

@@ -5,10 +5,10 @@
   "repository": "overleaf/settings-module",
   "main": "index.js",
   "scripts": {
-    "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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "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}",

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

@@ -6,10 +6,10 @@
   "scripts": {
     "test": "npm run lint && npm run format && npm run types:check && 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}'",
+    "lint": "eslint --ext .js --ext .cjs --ext .ts --max-warnings 0 --format unix .",
+    "lint:fix": "eslint --fix --ext .js --ext .cjs --ext .ts .",
+    "format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
+    "format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
     "test:ci": "npm run test:unit",
     "types:check": "tsc --noEmit"
   },

+ 3 - 1
services/chat/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/clsi/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/contacts/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/docstore/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 1 - 1
services/document-updater/expire_docops.js → services/document-updater/scripts/expire_docops.js

@@ -4,7 +4,7 @@ const rclient = require('@overleaf/redis-wrapper').createClient(
 )
 let keys = Settings.redis.documentupdater.key_schema
 const async = require('async')
-const RedisManager = require('./app/js/RedisManager')
+const RedisManager = require('../app/js/RedisManager')
 
 const getKeysFromNode = function (node, pattern, callback) {
   let cursor = 0 // redis iterator

+ 2 - 2
services/document-updater/tsconfig.json

@@ -2,11 +2,11 @@
   "extends": "../../tsconfig.backend.json",
   "include": [
     "app.js",
-    "expire_docops.js",
     "app/js/**/*",
     "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 0 - 6
services/filestore/Makefile

@@ -50,12 +50,6 @@ lint:
 lint_fix:
 	$(RUN_LINTING) lint:fix
 
-lint_styles:
-	$(RUN_LINTING) lint:styles
-
-lint_styles_fix:
-	$(RUN_LINTING) lint:styles:fix
-
 typecheck:
 	$(RUN_LINTING) types:check
 

+ 3 - 1
services/filestore/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 1 - 0
services/history-v1/buildscript.txt

@@ -7,3 +7,4 @@ history-v1
 --node-version=18.20.2
 --public-repo=False
 --script-version=4.5.0
+--tsconfig-extra-includes=api/**/*,migrations/**/*,storage/**/*

+ 4 - 3
services/history-v1/tsconfig.json

@@ -1,14 +1,15 @@
 {
   "extends": "../../tsconfig.backend.json",
   "include": [
-    "app.js",
     "api/**/*",
+    "app.js",
     "app/js/**/*",
     "benchmarks/**/*",
     "config/**/*",
     "migrations/**/*",
-    "storage/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "storage/**/*",
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/notifications/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/project-history/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/real-time/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }

+ 3 - 1
services/spelling/tsconfig.json

@@ -3,8 +3,10 @@
   "include": [
     "app.js",
     "app/js/**/*",
+    "benchmarks/**/*",
     "config/**/*",
     "scripts/**/*",
-    "test/**/*"
+    "test/**/*",
+    "types"
   ]
 }