Centralize prettier configuration to root level (#30501)
* Merge all .prettierignore files into top-level config * Merge all .prettierrc files into top-level config * Replace service-specific glob patterns in package.json format scripts with `prettier .` * Add template files with Jinja2, Go template, envsubst, and Handlebars syntax to .prettierignore * Ignore GitHub templates * Ignore PUG templates to format them separately with `format:pug` * Encourage double quotes for YAML, YML files * Move prettier for PUG source format script to the root * Move prettier for styles source format script to the root * Remove prettier for jenkins files from web * Remove prettier source format script from all services * Make .prettierrc more readable * Update format scripts by file type * Organise `.prettierignore` * Add `--cache` flag to prettier scripts for faster runs * Format all files with prettier * Format all or format services * Remove `format`/`format:fix` scripts from services since now it runs from root `package.json` * Avoid conlficts with yamllint configuration * Remove `--cache` flag from prettier scripts * Update all service Makefiles to use root-level prettier configuration * Update all Jenkinsfile to use root-level prettier configuration * Ignore auto-generated files by build_scripts * Update package-lock.json * Update root Makefile format targets * Update SP Jenkinsfile format target * Update E2E Makefile format script * Udpate `format_js` to work in both local and CI env * Add docker-mailtrap to .prettierignore docker-mailtrap is a third-party git-ignored directory used for testing * Added Docker env detection to prevent nested Docker spawning * Ignore handlebars templates * Add cryptographic files and test output to `.prettierignore` * Add terraform modules to `.gitignore` * Remove prettier-plugin-groovy * Use npx directly instead of Docker for local formatting for faster formatting * Auto-generate Makefiles * Revert "Remove prettier-plugin-groovy" This reverts commit 194a33589a2e1e4d2225d10c67e9f025e4222025. * Mount monorepo root in RUN_LINT_FORMAT for prettier config access * Prettier ignores all `node_modules` by default regardless of location * Show only changed files in format output * Ignore LICENSE files * Enable prettier on rendered build_scripts outputs * Ignoring all the template folders by prettier * Remove the public/minjs entry since it does not exist * Remove all non-existent paths * Sync `.prettierignore` with ignored files by `.gitignore` and `.dockerignore` files * Revert "Auto-generate Makefiles" This reverts commit c0233e490de1bc95fe437219d65e0b66e0331ec9. * Revert "Use npx directly instead of Docker for local formatting for faster formatting" This reverts commit 1d2b2cf1a6c6974c76885852a90dd55e84167e41. * Ignore dashboard JSON files * Ignore files generated by bin/update_build_scripts * Remove unsupported file types from `.prettierignore` * Ignore test fixture generated files * Ignore README file types by prettier * Ignore generate snapshots by prettier * Allow to format generated bin/update_build_scripts by prettier * Ensure build script outputs prettier-compatible tsconfig.json * Fix build script output to match prettier formatting - Fix Jinja2 whitespace in docker-compose templates - Change YAML quotes from single to double * Don't read cryptographic files by prettier * Ignore google verification files by prettier * Revert npx prettier formatting * Ignore domain verification files * Show only changed files in format output * Make `.github` prettier * Allow all files to be formatted in jobs by prettier * Allow server-ce/server-pro files to be formatted by prettier * Ignore more folders in clsi, filestory, git-bridge by prettier * Update build script with `RUN_LINTING_CI_MONOREPO` * Ignore docker-mailtrap and downloads in server-ce by prettier * Restore prettier configs and prettierignore for V1 since it has its own prettier (an older version) * Source format GitOrigin-RevId: 637adc3cc422d1f20c86d6ebc8ec514d60758287
This commit is contained in:
@@ -4,7 +4,6 @@ about: Report a bug
|
||||
title: ''
|
||||
labels: type:bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
<!--
|
||||
@@ -18,11 +17,10 @@ Note: If you are using www.overleaf.com and have a problem,
|
||||
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<!-- BUG REPORT TEMPLATE -->
|
||||
|
||||
## Steps to Reproduce
|
||||
|
||||
<!-- Describe the steps leading up to when / where you found the bug. -->
|
||||
<!-- Screenshots may be helpful here. -->
|
||||
|
||||
@@ -31,23 +29,28 @@ Note: If you are using www.overleaf.com and have a problem,
|
||||
3.
|
||||
|
||||
## Expected Behaviour
|
||||
|
||||
<!-- What should have happened when you completed the steps above? -->
|
||||
|
||||
## Observed Behaviour
|
||||
|
||||
<!-- What actually happened when you completed the steps above? -->
|
||||
<!-- Screenshots may be helpful here. -->
|
||||
|
||||
## Context
|
||||
|
||||
<!-- How has this issue affected you? What were you trying to accomplish? -->
|
||||
|
||||
## Technical Info
|
||||
|
||||
<!-- Provide any technical details that may be applicable (or N/A if not applicable). -->
|
||||
|
||||
* URL:
|
||||
* Browser Name and version:
|
||||
* Operating System and version (desktop or mobile):
|
||||
* Signed in as:
|
||||
* Project and/or file:
|
||||
- URL:
|
||||
- Browser Name and version:
|
||||
- Operating System and version (desktop or mobile):
|
||||
- Signed in as:
|
||||
- Project and/or file:
|
||||
|
||||
## Analysis
|
||||
|
||||
<!--- Optionally, document investigation of / suggest a fix for the bug, e.g. 'comes from this line / commit' -->
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
## Description
|
||||
|
||||
<!-- Goal of the pull request -->
|
||||
|
||||
|
||||
## Related issues / Pull Requests
|
||||
<!-- Fixes #xyz, Contributes to #xyz, Related to #xyz-->
|
||||
|
||||
<!-- Fixes #xyz, Contributes to #xyz, Related to #xyz-->
|
||||
|
||||
## Contributor Agreement
|
||||
|
||||
|
||||
+5
-10
@@ -1,11 +1,9 @@
|
||||
Contributing to Overleaf
|
||||
==========================
|
||||
# Contributing to Overleaf
|
||||
|
||||
Thank you for reading this! If you'd like to report a bug or join in the development
|
||||
of Overleaf, then here are some notes on how to do that.
|
||||
|
||||
Reporting bugs and opening issues
|
||||
---------------------------------
|
||||
## Reporting bugs and opening issues
|
||||
|
||||
If you'd like to report a bug or open an issue, please **[check if there is an existing issue](https://github.com/overleaf/overleaf/issues).**
|
||||
If there is then please add any more information that you have, or give it a 👍.
|
||||
@@ -16,8 +14,7 @@ If you can include a screenshot for front end issues that is very helpful.
|
||||
|
||||
**Note**: If you are using [www.overleaf.com](www.overleaf.com) and have a problem, or if you would like to request a new feature, please contact the Support team at support@overleaf.com. Raise an issue here only to report bugs in the Community Edition release of Overleaf.
|
||||
|
||||
Pull Requests
|
||||
-------------
|
||||
## Pull Requests
|
||||
|
||||
See [our wiki](https://github.com/overleaf/overleaf/wiki)
|
||||
for how to manage the Overleaf development environment and for our developer guidelines.
|
||||
@@ -28,13 +25,11 @@ to get your changes merged into Overleaf.
|
||||
|
||||
If you're looking for something to work on, have a look at the [open issues](https://github.com/overleaf/overleaf/issues).
|
||||
|
||||
Security
|
||||
--------
|
||||
## Security
|
||||
|
||||
Please see [our security policy](https://github.com/overleaf/overleaf/security/policy) if you would like to report a potential security vulnerability.
|
||||
|
||||
Contributor License Agreement
|
||||
-----------------------------
|
||||
## Contributor License Agreement
|
||||
|
||||
Before we can accept any contributions of code, we need you to agree to our
|
||||
[Contributor License Agreement](https://docs.google.com/forms/d/e/1FAIpQLSef79XH3mb7yIiMzZw-yALEegS-wyFetvjTiNBfZvf_IHD2KA/viewform?usp=sf_link).
|
||||
|
||||
@@ -65,7 +65,6 @@ in which to run the Overleaf services. Baseimage uses the `runit` service
|
||||
manager to manage services, and we add our init-scripts from the `server-ce/runit`
|
||||
folder.
|
||||
|
||||
|
||||
## Contributing
|
||||
|
||||
Please see the [CONTRIBUTING](CONTRIBUTING.md) file for information on contributing to the development of Overleaf.
|
||||
|
||||
@@ -166,7 +166,8 @@ services:
|
||||
context: ..
|
||||
dockerfile: services/web/Dockerfile
|
||||
target: webpack
|
||||
command: ["npx", "webpack", "serve", "--config", "webpack.config.dev-env.js"]
|
||||
command:
|
||||
["npx", "webpack", "serve", "--config", "webpack.config.dev-env.js"]
|
||||
ports:
|
||||
- "127.0.0.1:80:3808"
|
||||
volumes:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version: '2.2'
|
||||
version: "2.2"
|
||||
services:
|
||||
sharelatex:
|
||||
ports:
|
||||
@@ -20,4 +20,4 @@ services:
|
||||
- 30070:30070
|
||||
- 30400:30400
|
||||
environment:
|
||||
DEBUG_NODE: 'true'
|
||||
DEBUG_NODE: "true"
|
||||
|
||||
+9
-11
@@ -21,7 +21,6 @@ services:
|
||||
########################################################################
|
||||
# - /var/run/docker.sock:/var/run/docker.sock
|
||||
environment:
|
||||
|
||||
OVERLEAF_APP_NAME: Overleaf Community Edition
|
||||
|
||||
OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex
|
||||
@@ -31,13 +30,13 @@ services:
|
||||
OVERLEAF_REDIS_HOST: redis
|
||||
REDIS_HOST: redis
|
||||
|
||||
ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file'
|
||||
ENABLED_LINKED_FILE_TYPES: "project_file,project_output_file"
|
||||
|
||||
# Enables Thumbnail generation using ImageMagick
|
||||
ENABLE_CONVERSIONS: 'true'
|
||||
ENABLE_CONVERSIONS: "true"
|
||||
|
||||
# Disables email confirmation requirement
|
||||
EMAIL_CONFIRMATION_DISABLED: 'true'
|
||||
EMAIL_CONFIRMATION_DISABLED: "true"
|
||||
|
||||
## Set for SSL via nginx-proxy
|
||||
#VIRTUAL_HOST: 103.112.212.22
|
||||
@@ -77,14 +76,14 @@ services:
|
||||
## so the following environment variables must be commented out to avoid compile issues.
|
||||
##
|
||||
## Sandboxed Compiles: https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/server-pro-only-configuration/sandboxed-compiles
|
||||
SANDBOXED_COMPILES: 'true'
|
||||
SANDBOXED_COMPILES: "true"
|
||||
### Bind-mount source for /var/lib/overleaf/data/compiles inside the container.
|
||||
SANDBOXED_COMPILES_HOST_DIR_COMPILES: '/home/user/sharelatex_data/data/compiles'
|
||||
SANDBOXED_COMPILES_HOST_DIR_COMPILES: "/home/user/sharelatex_data/data/compiles"
|
||||
### Bind-mount source for /var/lib/overleaf/data/output inside the container.
|
||||
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: '/home/user/sharelatex_data/data/output'
|
||||
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: "/home/user/sharelatex_data/data/output"
|
||||
### Backwards compatibility (before Server Pro 5.5)
|
||||
DOCKER_RUNNER: 'true'
|
||||
SANDBOXED_COMPILES_SIBLING_CONTAINERS: 'true'
|
||||
DOCKER_RUNNER: "true"
|
||||
SANDBOXED_COMPILES_SIBLING_CONTAINERS: "true"
|
||||
|
||||
## Works with test LDAP server shown at bottom of docker compose
|
||||
# OVERLEAF_LDAP_URL: 'ldap://ldap:389'
|
||||
@@ -100,14 +99,13 @@ services:
|
||||
# OVERLEAF_TEMPLATES_USER_ID: "578773160210479700917ee5"
|
||||
# OVERLEAF_NEW_PROJECT_TEMPLATE_LINKS: '[ {"name":"All Templates","url":"/templates/all"}]'
|
||||
|
||||
|
||||
# OVERLEAF_PROXY_LEARN: "true"
|
||||
|
||||
mongo:
|
||||
restart: always
|
||||
image: mongo:6.0
|
||||
container_name: mongo
|
||||
command: '--replSet overleaf'
|
||||
command: "--replSet overleaf"
|
||||
volumes:
|
||||
- ~/mongo_data:/data/db
|
||||
- ./bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
]
|
||||
"include": ["**/*.js"]
|
||||
}
|
||||
|
||||
@@ -4,11 +4,9 @@
|
||||
"description": "utilities for node-fetch",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
## v3.1.1
|
||||
|
||||
* Handle malformed requests in the req serializer
|
||||
- Handle malformed requests in the req serializer
|
||||
|
||||
## v3.0.0
|
||||
|
||||
* Improve logging in Google Cloud Platform. Set environment variable `GCP_LOGGING=true` to enable.
|
||||
- Improve logging in Google Cloud Platform. Set environment variable `GCP_LOGGING=true` to enable.
|
||||
|
||||
This version of the metrics module only works with versions of the `@overleaf/metrics` module greater than v4.0.0
|
||||
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"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,ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
|
||||
"test:ci": "npm run test:unit",
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
## v4.1.0
|
||||
|
||||
* Allows skipping the `sampleRate` argument.
|
||||
- Allows skipping the `sampleRate` argument.
|
||||
|
||||
## v4.0.0
|
||||
|
||||
* Send unmodified request and response to logger.
|
||||
- Send unmodified request and response to logger.
|
||||
|
||||
This version of the metrics module only works with versions of the `@overleaf/logger` module greater than v3.0.0
|
||||
|
||||
@@ -35,9 +35,7 @@
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"test:acceptance": "mocha --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,ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:ci": "npm run test:unit",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
"description": "utilities to help working with mongo",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
+49
-35
@@ -16,23 +16,23 @@ Light-weight helpers for handling JavaScript Errors in node.js and the browser.
|
||||
<!-- toc -->
|
||||
|
||||
- [Long Stack Traces with `OError.tag`](#long-stack-traces-with-oerrortag)
|
||||
* [The Problem](#the-problem)
|
||||
* [The Solution](#the-solution)
|
||||
* [Adding More Info](#adding-more-info)
|
||||
* [`async`/`await`](#asyncawait)
|
||||
* [Better Async Stack Traces in Node 12+](#better-async-stack-traces-in-node-12)
|
||||
* [Caveat: Shared Error Instances](#caveat-shared-error-instances)
|
||||
- [The Problem](#the-problem)
|
||||
- [The Solution](#the-solution)
|
||||
- [Adding More Info](#adding-more-info)
|
||||
- [`async`/`await`](#asyncawait)
|
||||
- [Better Async Stack Traces in Node 12+](#better-async-stack-traces-in-node-12)
|
||||
- [Caveat: Shared Error Instances](#caveat-shared-error-instances)
|
||||
- [Create Custom Error Classes](#create-custom-error-classes)
|
||||
* [Attaching Extra Info](#attaching-extra-info)
|
||||
* [Wrapping an Internal Error](#wrapping-an-internal-error)
|
||||
- [Attaching Extra Info](#attaching-extra-info)
|
||||
- [Wrapping an Internal Error](#wrapping-an-internal-error)
|
||||
- [OError API Reference](#oerror-api-reference)
|
||||
* [new OError(message, [info], [cause])](#new-oerrormessage-info-cause)
|
||||
* [oError.withInfo(info) ⇒ this](#oerrorwithinfoinfo--this)
|
||||
* [oError.withCause(cause) ⇒ this](#oerrorwithcausecause--this)
|
||||
* [OError.maxTags : Number](#oerrormaxtags--number)
|
||||
* [OError.tag(error, [message], [info]) ⇒ Error](#oerrortagerror-message-info--error)
|
||||
* [OError.getFullInfo(error) ⇒ Object](#oerrorgetfullinfoerror--object)
|
||||
* [OError.getFullStack(error) ⇒ string](#oerrorgetfullstackerror--string)
|
||||
- [new OError(message, [info], [cause])](#new-oerrormessage-info-cause)
|
||||
- [oError.withInfo(info) ⇒ this](#oerrorwithinfoinfo--this)
|
||||
- [oError.withCause(cause) ⇒ this](#oerrorwithcausecause--this)
|
||||
- [OError.maxTags : Number](#oerrormaxtags--number)
|
||||
- [OError.tag(error, [message], [info]) ⇒ Error](#oerrortagerror-message-info--error)
|
||||
- [OError.getFullInfo(error) ⇒ Object](#oerrorgetfullinfoerror--object)
|
||||
- [OError.getFullStack(error) ⇒ string](#oerrorgetfullstackerror--string)
|
||||
- [References](#references)
|
||||
|
||||
<!-- tocstop -->
|
||||
@@ -345,23 +345,24 @@ caused by:
|
||||
## OError API Reference
|
||||
|
||||
<a name="OError"></a>
|
||||
* [OError](#OError)
|
||||
* [new OError(message, [info], [cause])](#new_OError_new)
|
||||
* _instance_
|
||||
* [.withInfo(info)](#OError+withInfo) ⇒ <code>this</code>
|
||||
* [.withCause(cause)](#OError+withCause) ⇒ <code>this</code>
|
||||
* _static_
|
||||
* [.maxTags](#OError.maxTags) : <code>Number</code>
|
||||
* [.tag(error, [message], [info])](#OError.tag) ⇒ <code>Error</code>
|
||||
* [.getFullInfo(error)](#OError.getFullInfo) ⇒ <code>Object</code>
|
||||
* [.getFullStack(error)](#OError.getFullStack) ⇒ <code>string</code>
|
||||
|
||||
- [OError](#OError)
|
||||
- [new OError(message, [info], [cause])](#new_OError_new)
|
||||
- _instance_
|
||||
- [.withInfo(info)](#OError+withInfo) ⇒ <code>this</code>
|
||||
- [.withCause(cause)](#OError+withCause) ⇒ <code>this</code>
|
||||
- _static_
|
||||
- [.maxTags](#OError.maxTags) : <code>Number</code>
|
||||
- [.tag(error, [message], [info])](#OError.tag) ⇒ <code>Error</code>
|
||||
- [.getFullInfo(error)](#OError.getFullInfo) ⇒ <code>Object</code>
|
||||
- [.getFullStack(error)](#OError.getFullStack) ⇒ <code>string</code>
|
||||
|
||||
<a name="new_OError_new"></a>
|
||||
|
||||
### new OError(message, [info], [cause])
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ------- | ------------------- | ----------------------------------------- |
|
||||
| message | <code>string</code> | as for built-in Error |
|
||||
| [info] | <code>Object</code> | extra data to attach to the error |
|
||||
| [cause] | <code>Error</code> | the internal error that caused this error |
|
||||
@@ -369,28 +370,31 @@ caused by:
|
||||
<a name="OError+withInfo"></a>
|
||||
|
||||
### oError.withInfo(info) ⇒ <code>this</code>
|
||||
|
||||
Set the extra info object for this error.
|
||||
|
||||
**Kind**: instance method of [<code>OError</code>](#OError)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ----- | ------------------- | --------------------------------- |
|
||||
| info | <code>Object</code> | extra data to attach to the error |
|
||||
|
||||
<a name="OError+withCause"></a>
|
||||
|
||||
### oError.withCause(cause) ⇒ <code>this</code>
|
||||
|
||||
Wrap the given error, which caused this error.
|
||||
|
||||
**Kind**: instance method of [<code>OError</code>](#OError)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ----- | ------------------ | ----------------------------------------- |
|
||||
| cause | <code>Error</code> | the internal error that caused this error |
|
||||
|
||||
<a name="OError.maxTags"></a>
|
||||
|
||||
### OError.maxTags : <code>Number</code>
|
||||
|
||||
Maximum number of tags to apply to any one error instance. This is to avoid
|
||||
a resource leak in the (hopefully unlikely) case that a singleton error
|
||||
instance is returned to many callbacks. If tags have been dropped, the full
|
||||
@@ -402,6 +406,7 @@ Defaults to 100. Must be at least 1.
|
||||
<a name="OError.tag"></a>
|
||||
|
||||
### OError.tag(error, [message], [info]) ⇒ <code>Error</code>
|
||||
|
||||
Tag debugging information onto any error (whether an OError or not) and
|
||||
return it.
|
||||
|
||||
@@ -409,12 +414,13 @@ return it.
|
||||
**Returns**: <code>Error</code> - the modified `error` argument
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| --------- | ------------------- | ----------------------------------- |
|
||||
| error | <code>Error</code> | the error to tag |
|
||||
| [message] | <code>string</code> | message with which to tag `error` |
|
||||
| [info] | <code>Object</code> | extra data with wich to tag `error` |
|
||||
|
||||
**Example** *(An error in a callback)*
|
||||
**Example** _(An error in a callback)_
|
||||
|
||||
```js
|
||||
function findUser(name, callback) {
|
||||
fs.readFile('/etc/passwd', (err, data) => {
|
||||
@@ -423,13 +429,17 @@ function findUser(name, callback) {
|
||||
})
|
||||
}
|
||||
```
|
||||
**Example** *(A possible error in a callback)*
|
||||
|
||||
**Example** _(A possible error in a callback)_
|
||||
|
||||
```js
|
||||
function cleanup(callback) {
|
||||
fs.unlink('/tmp/scratch', (err) => callback(err && OError.tag(err)))
|
||||
fs.unlink('/tmp/scratch', err => callback(err && OError.tag(err)))
|
||||
}
|
||||
```
|
||||
**Example** *(An error with async/await)*
|
||||
|
||||
**Example** _(An error with async/await)_
|
||||
|
||||
```js
|
||||
async function cleanup() {
|
||||
try {
|
||||
@@ -439,9 +449,11 @@ async function cleanup() {
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
<a name="OError.getFullInfo"></a>
|
||||
|
||||
### OError.getFullInfo(error) ⇒ <code>Object</code>
|
||||
|
||||
The merged info from any `tag`s and causes on the given error.
|
||||
|
||||
If an info property is repeated, the last one wins.
|
||||
@@ -449,20 +461,22 @@ If an info property is repeated, the last one wins.
|
||||
**Kind**: static method of [<code>OError</code>](#OError)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ----- | ----------------------------------------------------------------- | ----------------------------------------- |
|
||||
| error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) |
|
||||
|
||||
<a name="OError.getFullStack"></a>
|
||||
|
||||
### OError.getFullStack(error) ⇒ <code>string</code>
|
||||
|
||||
Return the `stack` property from `error`, including the `stack`s for any
|
||||
tagged errors added with `OError.tag` and for any `cause`s.
|
||||
|
||||
**Kind**: static method of [<code>OError</code>](#OError)
|
||||
|
||||
| Param | Type | Description |
|
||||
| --- | --- | --- |
|
||||
| ----- | ----------------------------------------------------------------- | ----------------------------------------- |
|
||||
| error | <code>Error</code> \| <code>null</code> \| <code>undefined</code> | any error (may or may not be an `OError`) |
|
||||
|
||||
<!-- END API REFERENCE -->
|
||||
|
||||
## References
|
||||
|
||||
@@ -20,9 +20,7 @@
|
||||
"build": "npm run --silent test",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:ci": "npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"types:check": "tsc --noEmit"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
node_modules
|
||||
@@ -4,12 +4,10 @@
|
||||
"description": "Module for storing objects in multiple backends, with fallback on 404 to assist migration between them",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -4,9 +4,7 @@
|
||||
"description": "Library shared between the editor server and clients.",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
|
||||
"test:ci": "npm run test:unit",
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
"description": "utilities to help working with promises",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -11,9 +11,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:ci": "npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"types:check": "tsc --noEmit"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:ci": "npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"types:check": "tsc --noEmit"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -1,11 +1,9 @@
|
||||
@overleaf/settings
|
||||
===================
|
||||
# @overleaf/settings
|
||||
|
||||
A small module to allow global config settings to be set for all services
|
||||
within the Overleaf architecture.
|
||||
|
||||
Settings file location
|
||||
----------------------
|
||||
## Settings file location
|
||||
|
||||
You can specify a custom location for the settings file by setting the
|
||||
`OVERLEAF_CONFIG` environment variable. E.g.
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
"scripts": {
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:ci": "npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"types:check": "tsc --noEmit"
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -4,12 +4,10 @@
|
||||
"description": "stream handling utilities",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"test:unit": "mocha --exit test/**/*.{js,cjs}",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.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"
|
||||
},
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"test": "npm run lint && npm run format && npm run types:check && npm run test:unit",
|
||||
"format": "prettier --list-different $PWD/'**/*.{js,cjs,ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,cjs,ts}'",
|
||||
"test": "npm run lint && npm run types:check && npm run test:unit",
|
||||
"lint": "eslint --ext .cjs,.js,.jsx,.mjs,.ts --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix --ext .cjs,.js,.jsx,.mjs,.ts .",
|
||||
"test:ci": "npm run test:unit",
|
||||
|
||||
@@ -1,8 +1,4 @@
|
||||
{
|
||||
"extends": "../../tsconfig.backend.json",
|
||||
"include": [
|
||||
"**/*.js",
|
||||
"**/*.cjs",
|
||||
"**/*.ts"
|
||||
]
|
||||
"include": ["**/*.js", "**/*.cjs", "**/*.ts"]
|
||||
}
|
||||
|
||||
Generated
+1
-1
@@ -40,6 +40,7 @@
|
||||
"patch-package": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-pug": "^3.4.0",
|
||||
"@types/chai": "^4.3.0",
|
||||
"@types/chai-as-promised": "^7.1.8",
|
||||
"@types/mocha": "^10.0.6",
|
||||
@@ -58397,7 +58398,6 @@
|
||||
"@pollyjs/adapter-node-http": "^6.0.6",
|
||||
"@pollyjs/core": "^6.0.6",
|
||||
"@pollyjs/persister-fs": "^6.0.6",
|
||||
"@prettier/plugin-pug": "^3.4.0",
|
||||
"@replit/codemirror-emacs": "overleaf/codemirror-emacs#4394c03858f27053f8768258e9493866e06e938e",
|
||||
"@replit/codemirror-indentation-markers": "overleaf/codemirror-indentation-markers#371ce3b56f453a392eb0d3b85ab019c185c68e1f",
|
||||
"@replit/codemirror-vim": "overleaf/codemirror-vim#1bef138382d948018f3f9b8a4d7a70ab61774e4b",
|
||||
|
||||
+9
-4
@@ -5,6 +5,7 @@
|
||||
"patch-package": "^8.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@prettier/plugin-pug": "^3.4.0",
|
||||
"@types/chai": "^4.3.0",
|
||||
"@types/chai-as-promised": "^7.1.8",
|
||||
"@types/mocha": "^10.0.6",
|
||||
@@ -41,10 +42,14 @@
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"format": "prettier --list-different $PWD/'**/*.js'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.js'",
|
||||
"format:jenkins": "prettier --list-different $PWD/'**/Jenkinsfile'",
|
||||
"format:jenkins:fix": "prettier --write $PWD/'**/Jenkinsfile'",
|
||||
"format": "prettier --list-different",
|
||||
"format:fix": "prettier --write --list-different",
|
||||
"format:styles": "prettier --list-different '**/*.{css,scss}'",
|
||||
"format:styles:fix": "prettier --write --list-different '**/*.{css,scss}'",
|
||||
"format:pug": "prettier --list-different '**/*.pug'",
|
||||
"format:pug:fix": "prettier --write --list-different '**/*.pug'",
|
||||
"format:jenkins": "prettier --list-different '**/Jenkinsfile'",
|
||||
"format:jenkins:fix": "prettier --write --list-different '**/Jenkinsfile'",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"postinstall": "patch-package"
|
||||
|
||||
@@ -1,11 +1,10 @@
|
||||
---
|
||||
|
||||
steps:
|
||||
- id: build_base
|
||||
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
|
||||
dir: server-ce
|
||||
args:
|
||||
- 'build-base'
|
||||
- "build-base"
|
||||
- id: tag_main_latest_base
|
||||
name: gcr.io/cloud-builders/docker
|
||||
script: |
|
||||
@@ -26,7 +25,7 @@ steps:
|
||||
exit 0
|
||||
automapSubstitutions: true
|
||||
waitFor:
|
||||
- '-'
|
||||
- "-"
|
||||
- id: build_community
|
||||
name: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/cloud-builder
|
||||
dir: server-ce
|
||||
@@ -51,27 +50,27 @@ timeout: 3600s
|
||||
options:
|
||||
machineType: E2_HIGHCPU_32
|
||||
env:
|
||||
- 'BRANCH_NAME=${BRANCH_NAME}'
|
||||
- "BRANCH_NAME=${BRANCH_NAME}"
|
||||
# docker build
|
||||
- 'OVERLEAF_BASE_BRANCH=${_IMAGE_BASE_BRANCH}'
|
||||
- 'OVERLEAF_BASE_LATEST=${_IMAGE_BASE_LATEST}'
|
||||
- 'OVERLEAF_BASE_TAG=${_IMAGE_BASE}'
|
||||
- 'OVERLEAF_BRANCH=${_IMAGE_TAG_BRANCH}'
|
||||
- 'OVERLEAF_LATEST=${_IMAGE_TAG_LATEST}'
|
||||
- 'OVERLEAF_TAG=${_IMAGE_TAG}'
|
||||
- "OVERLEAF_BASE_BRANCH=${_IMAGE_BASE_BRANCH}"
|
||||
- "OVERLEAF_BASE_LATEST=${_IMAGE_BASE_LATEST}"
|
||||
- "OVERLEAF_BASE_TAG=${_IMAGE_BASE}"
|
||||
- "OVERLEAF_BRANCH=${_IMAGE_TAG_BRANCH}"
|
||||
- "OVERLEAF_LATEST=${_IMAGE_TAG_LATEST}"
|
||||
- "OVERLEAF_TAG=${_IMAGE_TAG}"
|
||||
images:
|
||||
- '${_IMAGE_BASE}'
|
||||
- '${_IMAGE_BASE_BRANCH}'
|
||||
- '${_IMAGE_TAG}'
|
||||
- '${_IMAGE_TAG_BRANCH}'
|
||||
- "${_IMAGE_BASE}"
|
||||
- "${_IMAGE_BASE_BRANCH}"
|
||||
- "${_IMAGE_TAG}"
|
||||
- "${_IMAGE_TAG_BRANCH}"
|
||||
substitutions:
|
||||
_IMAGE_BASE: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}'
|
||||
_IMAGE_BASE_BRANCH: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}'
|
||||
_IMAGE_BASE_LATEST: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:latest'
|
||||
_IMAGE_TAG_BRANCH: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}'
|
||||
_IMAGE_TAG_LATEST: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:latest'
|
||||
_IMAGE_TAG: 'us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}'
|
||||
_IMAGE_BASE: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}"
|
||||
_IMAGE_BASE_BRANCH: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:${BRANCH_NAME}"
|
||||
_IMAGE_BASE_LATEST: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf-base:latest"
|
||||
_IMAGE_TAG_BRANCH: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}"
|
||||
_IMAGE_TAG_LATEST: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:latest"
|
||||
_IMAGE_TAG: "us-east1-docker.pkg.dev/overleaf-ops/ol-docker/overleaf:${BRANCH_NAME}-${SHORT_SHA}_${BUILD_ID}"
|
||||
tags:
|
||||
- 'overleaf-public'
|
||||
- '${BRANCH_NAME}'
|
||||
- '${SHORT_SHA}'
|
||||
- "overleaf-public"
|
||||
- "${BRANCH_NAME}"
|
||||
- "${SHORT_SHA}"
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
version: '2.2'
|
||||
version: "2.2"
|
||||
services:
|
||||
sharelatex:
|
||||
ports:
|
||||
- "127.0.0.1:80:80"
|
||||
environment:
|
||||
OVERLEAF_SITE_URL: 'http://localhost'
|
||||
OVERLEAF_SITE_URL: "http://localhost"
|
||||
|
||||
host-admin:
|
||||
ports:
|
||||
- "127.0.0.1:8081:80"
|
||||
environment:
|
||||
NATIVE_CYPRESS: 'true'
|
||||
ACCESS_CONTROL_ALLOW_ORIGIN: 'http://localhost'
|
||||
NATIVE_CYPRESS: "true"
|
||||
ACCESS_CONTROL_ALLOW_ORIGIN: "http://localhost"
|
||||
|
||||
saml:
|
||||
ports:
|
||||
- 127.0.0.1:8082:80
|
||||
environment:
|
||||
SAML_BASE_URL_PATH: 'http://localhost:8082/simplesaml/'
|
||||
SAML_TEST_SP_LOCATION: 'http://localhost/saml/callback'
|
||||
SAML_BASE_URL_PATH: "http://localhost:8082/simplesaml/"
|
||||
SAML_TEST_SP_LOCATION: "http://localhost/saml/callback"
|
||||
|
||||
mailtrap:
|
||||
ports:
|
||||
|
||||
@@ -10,18 +10,18 @@ services:
|
||||
mailtrap:
|
||||
condition: service_started
|
||||
environment:
|
||||
OVERLEAF_SITE_URL: 'http://sharelatex'
|
||||
OVERLEAF_SITE_URL: "http://sharelatex"
|
||||
OVERLEAF_APP_NAME: E2E test
|
||||
OVERLEAF_MONGO_URL: mongodb://mongo/sharelatex?directConnection=true
|
||||
OVERLEAF_REDIS_HOST: redis
|
||||
REDIS_HOST: redis
|
||||
OVERLEAF_EMAIL_FROM_ADDRESS: 'welcome@example.com'
|
||||
OVERLEAF_EMAIL_SMTP_HOST: 'mailtrap'
|
||||
OVERLEAF_EMAIL_SMTP_PORT: '25'
|
||||
OVERLEAF_EMAIL_SMTP_IGNORE_TLS: 'true'
|
||||
ENABLED_LINKED_FILE_TYPES: 'project_file,project_output_file'
|
||||
ENABLE_CONVERSIONS: 'true'
|
||||
EMAIL_CONFIRMATION_DISABLED: 'true'
|
||||
OVERLEAF_EMAIL_FROM_ADDRESS: "welcome@example.com"
|
||||
OVERLEAF_EMAIL_SMTP_HOST: "mailtrap"
|
||||
OVERLEAF_EMAIL_SMTP_PORT: "25"
|
||||
OVERLEAF_EMAIL_SMTP_IGNORE_TLS: "true"
|
||||
ENABLED_LINKED_FILE_TYPES: "project_file,project_output_file"
|
||||
ENABLE_CONVERSIONS: "true"
|
||||
EMAIL_CONFIRMATION_DISABLED: "true"
|
||||
healthcheck:
|
||||
test: curl --fail http://localhost:3000/status
|
||||
interval: 3s
|
||||
@@ -31,11 +31,11 @@ services:
|
||||
mailtrap:
|
||||
image: mailtrap
|
||||
environment:
|
||||
MAILTRAP_PASSWORD: 'password-for-mailtrap'
|
||||
MAILTRAP_PASSWORD: "password-for-mailtrap"
|
||||
|
||||
mongo:
|
||||
image: mongo:8.0.11
|
||||
command: '--replSet overleaf'
|
||||
command: "--replSet overleaf"
|
||||
volumes:
|
||||
- ../bin/shared/mongodb-init-replica-set.js:/docker-entrypoint-initdb.d/mongodb-init-replica-set.js
|
||||
- ../bin/shared/mongodb-docker-entrypoint-wait.sh:/mongodb-docker-entrypoint-wait.sh
|
||||
@@ -129,9 +129,9 @@ services:
|
||||
restart: always
|
||||
image: us-east1-docker.pkg.dev/overleaf-ops/ol-docker/saml-test
|
||||
environment:
|
||||
SAML_TEST_SP_ENTITY_ID: 'sharelatex-test-saml'
|
||||
SAML_BASE_URL_PATH: 'http://saml/simplesaml/'
|
||||
SAML_TEST_SP_LOCATION: 'http://sharelatex/saml/callback'
|
||||
SAML_TEST_SP_ENTITY_ID: "sharelatex-test-saml"
|
||||
SAML_BASE_URL_PATH: "http://saml/simplesaml/"
|
||||
SAML_TEST_SP_LOCATION: "http://sharelatex/saml/callback"
|
||||
|
||||
ldap:
|
||||
restart: always
|
||||
@@ -140,6 +140,6 @@ services:
|
||||
# REF: https://github.com/moby/moby/issues/8231#issuecomment-63877553
|
||||
# REF: https://github.com/moby/moby/issues/8231#issuecomment-63871343
|
||||
command:
|
||||
- 'bash'
|
||||
- '-c'
|
||||
- 'ulimit -n 1024 && exec bash /run.sh'
|
||||
- "bash"
|
||||
- "-c"
|
||||
- "ulimit -n 1024 && exec bash /run.sh"
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
"scripts": {
|
||||
"cypress:open": "cypress open --e2e --browser chrome",
|
||||
"cypress:run": "cypress run --e2e --browser chrome",
|
||||
"format": "prettier --list-different $PWD/'**/*.{js,mjs,ts,tsx}'",
|
||||
"format:fix": "prettier --write $PWD/'**/*.{js,mjs,ts,tsx}'",
|
||||
"lint": "eslint --max-warnings 0 --format unix --ext .js,.jsx,.mjs,.ts,.tsx .",
|
||||
"lint:fix": "eslint --fix --ext .js,.jsx,.mjs,.ts,.tsx ."
|
||||
},
|
||||
|
||||
@@ -52,11 +52,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/chat/reports:/overleaf/services/chat/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -77,13 +76,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/chat
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/chat
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/chat
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
overleaf/chat
|
||||
===============
|
||||
# overleaf/chat
|
||||
|
||||
The backend API that powers the chat service in Overleaf
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
|
||||
|
||||
|
||||
+56
-56
@@ -3,12 +3,12 @@ x-stoplight:
|
||||
id: okoe8mh50pjec
|
||||
info:
|
||||
title: chat
|
||||
version: '1.0'
|
||||
version: "1.0"
|
||||
servers:
|
||||
- url: 'http://chat:3010'
|
||||
- url: "http://chat:3010"
|
||||
x-exegesis-controller: messagesController
|
||||
paths:
|
||||
'/project/{projectId}/messages':
|
||||
"/project/{projectId}/messages":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -19,14 +19,14 @@ paths:
|
||||
summary: Get Global messages
|
||||
tags: []
|
||||
responses:
|
||||
'201':
|
||||
"201":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Message'
|
||||
$ref: "#/components/schemas/Message"
|
||||
operationId: getGlobalMessages
|
||||
description: Get global messages for the project with Project ID provided
|
||||
parameters:
|
||||
@@ -42,21 +42,21 @@ paths:
|
||||
summary: Send Global message
|
||||
operationId: sendGlobalMessage
|
||||
responses:
|
||||
'201':
|
||||
"201":
|
||||
description: OK
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Message'
|
||||
$ref: "#/components/schemas/Message"
|
||||
examples:
|
||||
example-1:
|
||||
value:
|
||||
user_id: string
|
||||
content: string
|
||||
description: 'UserID and Content of the message to be posted. '
|
||||
description: "UserID and Content of the message to be posted. "
|
||||
description: Send global message for the project with Project ID provided
|
||||
'/project/{projectId}/messages/{messageId}':
|
||||
"/project/{projectId}/messages/{messageId}":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -72,13 +72,13 @@ paths:
|
||||
summary: Get single global message
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Message'
|
||||
'404':
|
||||
$ref: "#/components/schemas/Message"
|
||||
"404":
|
||||
description: Message not found
|
||||
operationId: getGlobalMessage
|
||||
description: Get a single global message by message ID for the project with Project ID provided
|
||||
@@ -86,10 +86,10 @@ paths:
|
||||
summary: Delete global message
|
||||
operationId: deleteGlobalMessage
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
description: 'Delete global message'
|
||||
'/project/{projectId}/thread/{threadId}/messages':
|
||||
description: "Delete global message"
|
||||
"/project/{projectId}/thread/{threadId}/messages":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -105,19 +105,19 @@ paths:
|
||||
summary: Send message
|
||||
operationId: sendMessage
|
||||
responses:
|
||||
'201':
|
||||
"201":
|
||||
description: Created
|
||||
description: Add a message to the thread with thread ID provided from the Project with Project ID provided.
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Message'
|
||||
$ref: "#/components/schemas/Message"
|
||||
description: |-
|
||||
JSON object with :
|
||||
- user_id: Id of the user
|
||||
- content: Content of the message
|
||||
'/project/{projectId}/threads':
|
||||
"/project/{projectId}/threads":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -128,20 +128,20 @@ paths:
|
||||
summary: Get Threads
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Thread'
|
||||
$ref: "#/components/schemas/Thread"
|
||||
examples: {}
|
||||
'404':
|
||||
"404":
|
||||
description: Not Found
|
||||
operationId: getThreads
|
||||
description: Get the list of threads for the project with Project ID provided
|
||||
'/project/{projectId}/thread/{threadId}/messages/{messageId}/edit':
|
||||
"/project/{projectId}/thread/{threadId}/messages/{messageId}/edit":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -162,9 +162,9 @@ paths:
|
||||
summary: Edit message
|
||||
operationId: editMessage
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
'404':
|
||||
"404":
|
||||
description: Not Found
|
||||
requestBody:
|
||||
content:
|
||||
@@ -186,7 +186,7 @@ paths:
|
||||
- user_id: Id of the user (optional)
|
||||
description: |
|
||||
Update message with Message ID provided from the Thread ID and Project ID provided
|
||||
'/project/{projectId}/messages/{messageId}/edit':
|
||||
"/project/{projectId}/messages/{messageId}/edit":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -202,9 +202,9 @@ paths:
|
||||
summary: Edit global message
|
||||
operationId: editGlobalMessage
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
'404':
|
||||
"404":
|
||||
description: Not Found
|
||||
requestBody:
|
||||
content:
|
||||
@@ -226,7 +226,7 @@ paths:
|
||||
- user_id: Id of the user (optional)
|
||||
description: |
|
||||
Update global message with Message ID provided from the Project ID provided
|
||||
'/project/{projectId}/thread/{threadId}/messages/{messageId}':
|
||||
"/project/{projectId}/thread/{threadId}/messages/{messageId}":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -247,13 +247,13 @@ paths:
|
||||
summary: Get thread message
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Message'
|
||||
'404':
|
||||
$ref: "#/components/schemas/Message"
|
||||
"404":
|
||||
description: Message not found
|
||||
operationId: getThreadMessage
|
||||
description: Get a specific message by message ID from the thread with Thread ID and Project ID provided
|
||||
@@ -261,10 +261,10 @@ paths:
|
||||
summary: Delete message
|
||||
operationId: deleteMessage
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
description: 'Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided'
|
||||
'/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}':
|
||||
description: "Delete message with Message ID provided, from the Thread with ThreadID and ProjectID provided"
|
||||
"/project/{projectId}/thread/{threadId}/user/{userId}/messages/{messageId}":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -290,9 +290,9 @@ paths:
|
||||
summary: Delete message written by a given user
|
||||
operationId: deleteUserMessage
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
'/project/{projectId}/thread/{threadId}/resolve':
|
||||
"/project/{projectId}/thread/{threadId}/resolve":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -308,7 +308,7 @@ paths:
|
||||
summary: Resolve Thread
|
||||
operationId: resolveThread
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
requestBody:
|
||||
content:
|
||||
@@ -324,7 +324,7 @@ paths:
|
||||
JSON object with :
|
||||
- user_id: Id of the user.
|
||||
description: Mark Thread with ThreadID and ProjectID provided owned by the user with UserID provided as resolved.
|
||||
'/project/{projectId}/thread/{threadId}/reopen':
|
||||
"/project/{projectId}/thread/{threadId}/reopen":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -340,12 +340,12 @@ paths:
|
||||
summary: Reopen Thread
|
||||
operationId: reopenThread
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
description: |-
|
||||
Reopen Thread with ThreadID and ProjectID provided.
|
||||
i.e unmark it as resolved.
|
||||
'/project/{projectId}/thread/{threadId}':
|
||||
"/project/{projectId}/thread/{threadId}":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -361,13 +361,13 @@ paths:
|
||||
summary: Get Thread
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/Thread'
|
||||
'404':
|
||||
$ref: "#/components/schemas/Thread"
|
||||
"404":
|
||||
description: Thread not found
|
||||
operationId: getThread
|
||||
description: Get a thread with ThreadID and ProjectID provided
|
||||
@@ -375,10 +375,10 @@ paths:
|
||||
summary: Delete thread
|
||||
operationId: deleteThread
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
description: Delete thread with ThreadID and ProjectID provided
|
||||
'/project/{projectId}/resolved-thread-ids':
|
||||
"/project/{projectId}/resolved-thread-ids":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -389,9 +389,9 @@ paths:
|
||||
summary: Get resolved thread ids
|
||||
operationId: getResolvedThreadIds
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: Resolved thread ids
|
||||
'/project/{projectId}':
|
||||
"/project/{projectId}":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -402,15 +402,15 @@ paths:
|
||||
summary: Destroy project
|
||||
operationId: destroyProject
|
||||
responses:
|
||||
'204':
|
||||
"204":
|
||||
description: No Content
|
||||
description: 'Delete all threads from Project with Project ID provided, and all messages in those threads.'
|
||||
description: "Delete all threads from Project with Project ID provided, and all messages in those threads."
|
||||
/status:
|
||||
get:
|
||||
summary: Check status
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
@@ -423,7 +423,7 @@ paths:
|
||||
summary: Check status
|
||||
tags: []
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
description: OK
|
||||
content:
|
||||
application/json:
|
||||
@@ -432,7 +432,7 @@ paths:
|
||||
description: chat is alive
|
||||
operationId: getStatus
|
||||
description: Check that the Chat service is alive
|
||||
'/project/{projectId}/duplicate-comment-threads':
|
||||
"/project/{projectId}/duplicate-comment-threads":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -453,7 +453,7 @@ paths:
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
@@ -463,7 +463,7 @@ paths:
|
||||
type: object
|
||||
description: Mapping of old thread ids to their duplicated thread ids
|
||||
description: Duplicate a list of comment threads
|
||||
'/project/{projectId}/generate-thread-data':
|
||||
"/project/{projectId}/generate-thread-data":
|
||||
parameters:
|
||||
- schema:
|
||||
type: string
|
||||
@@ -484,7 +484,7 @@ paths:
|
||||
items:
|
||||
type: string
|
||||
responses:
|
||||
'200':
|
||||
"200":
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
@@ -514,4 +514,4 @@ components:
|
||||
id: 0ppt3jw4h5bua
|
||||
type: array
|
||||
items:
|
||||
$ref: '#/components/schemas/Message'
|
||||
$ref: "#/components/schemas/Message"
|
||||
|
||||
@@ -20,7 +20,6 @@ services:
|
||||
mongo:
|
||||
condition: service_started
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -41,7 +40,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -49,6 +47,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
mongo:
|
||||
image: mongo:8.0.11
|
||||
command: --replSet overleaf --notablescan
|
||||
|
||||
@@ -62,4 +62,3 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js",
|
||||
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -52,11 +52,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/clsi/reports:/overleaf/services/clsi/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/clsi/reports:/overleaf/services/clsi/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -77,13 +76,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/clsi
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/clsi
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/clsi
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -16,7 +16,6 @@ services:
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
VITEST_NO_CACHE: true
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -43,7 +42,6 @@ services:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
|
||||
@@ -51,4 +51,3 @@ services:
|
||||
SANDBOXED_COMPILES_HOST_DIR_COMPILES: $PWD/compiles
|
||||
SANDBOXED_COMPILES_HOST_DIR_OUTPUT: $PWD/output
|
||||
command: npm run --silent test:acceptance
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"test:unit": "npm run test:unit:_run",
|
||||
"nodemon": "node --watch app.js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -52,11 +52,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/contacts/reports:/overleaf/services/contacts/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/contacts/reports:/overleaf/services/contacts/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -77,13 +76,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/contacts
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/contacts
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/contacts
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
overleaf/contacts
|
||||
===================
|
||||
# overleaf/contacts
|
||||
|
||||
An API for tracking contacts of a user
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ services:
|
||||
mongo:
|
||||
condition: service_started
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -41,7 +40,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -49,6 +47,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
mongo:
|
||||
image: mongo:8.0.11
|
||||
command: --replSet overleaf --notablescan
|
||||
|
||||
@@ -62,4 +62,3 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
|
||||
"nodemon": "node --watch app.js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -54,11 +54,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/docstore/reports:/overleaf/services/docstore/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/docstore/reports:/overleaf/services/docstore/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -79,13 +78,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/docstore
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/docstore
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/docstore
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
overleaf/docstore
|
||||
===================
|
||||
# overleaf/docstore
|
||||
|
||||
A CRUD API for storing and updating text documents in projects
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
|
||||
|
||||
|
||||
@@ -22,7 +22,6 @@ services:
|
||||
mongo:
|
||||
condition: service_started
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -48,7 +47,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -56,6 +54,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
mongo:
|
||||
image: mongo:8.0.11
|
||||
command: --replSet overleaf --notablescan
|
||||
@@ -70,6 +69,7 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
gcs:
|
||||
image: fsouza/fake-gcs-server:1.52.3
|
||||
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"test:unit": "npm run test:unit:_run",
|
||||
"nodemon": "node --watch app.js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -55,11 +55,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/reports:/overleaf/services/document-updater/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/reports:/overleaf/services/document-updater/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -80,13 +79,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/document-updater
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/document-updater
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/document-updater
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,12 +1,9 @@
|
||||
overleaf/document-updater
|
||||
===========================
|
||||
# overleaf/document-updater
|
||||
|
||||
An API for applying incoming updates to documents in real-time.
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
|
||||
|
||||
Copyright (c) Overleaf, 2014-2019.
|
||||
|
||||
|
||||
@@ -3,4 +3,3 @@ This folder contains a modified version of the ShareJS source code, forked from
|
||||
The original CoffeeScript code has been decaffeinated to JavaScript, and further modified. Some folders have been removed. See https://github.com/josephg/ShareJS/blob/v0.5.0/src/types/README.md for the original README.
|
||||
|
||||
The original code, and the current modified code in this directory, are published under the MIT license.
|
||||
|
||||
|
||||
@@ -3,7 +3,6 @@ This directory contains all the operational transform code. Each file defines a
|
||||
Most of the types in here are for testing or demonstration. The only types which are sent to the webclient
|
||||
are `text` and `json`.
|
||||
|
||||
|
||||
# An OT type
|
||||
|
||||
All OT types have the following fields:
|
||||
@@ -18,7 +17,6 @@ Given op1, op2, `apply(s, op2, transform(op1, op2, 'left')) == apply(s, op1, tra
|
||||
|
||||
Transform and apply must never modify their arguments.
|
||||
|
||||
|
||||
Optional properties:
|
||||
|
||||
`tp2`: _(bool)_ True if the transform function supports TP2. This allows p2p architectures to work.
|
||||
@@ -29,14 +27,12 @@ Optional properties:
|
||||
`normalize(op) -> op`: Fix up an op to make it valid. Eg, remove skips of size zero.
|
||||
`api`: _(object)_ Set of helper methods which will be mixed in to the client document object for manipulating documents. See below.
|
||||
|
||||
|
||||
# Examples
|
||||
|
||||
`count` and `simple` are two trivial OT type definitions if you want to take a look. JSON defines
|
||||
the ot-for-JSON type (see the wiki for documentation) and all the text types define different text
|
||||
implementations. (I still have no idea which one I like the most, and they're fun to write!)
|
||||
|
||||
|
||||
# API
|
||||
|
||||
Types can also define API functions. These methods are mixed into the client's Doc object when a document is created.
|
||||
|
||||
@@ -27,7 +27,6 @@ services:
|
||||
redis_test:
|
||||
condition: service_healthy
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -55,7 +54,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -63,6 +61,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
redis_test:
|
||||
image: redis:7.4.3
|
||||
healthcheck:
|
||||
|
||||
@@ -83,4 +83,3 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"nodemon": "node --watch app.js",
|
||||
"benchmark:apply": "node benchmarks/apply",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -1 +0,0 @@
|
||||
node_modules
|
||||
@@ -52,11 +52,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/filestore/reports:/overleaf/services/filestore/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/filestore/reports:/overleaf/services/filestore/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -77,13 +76,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/filestore
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/filestore
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/filestore
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,21 +1,19 @@
|
||||
overleaf/filestore
|
||||
====================
|
||||
# overleaf/filestore
|
||||
|
||||
An API for CRUD operations on binary files stored in S3
|
||||
|
||||
filestore acts as a proxy between the CLSIs and (currently) Amazon S3 storage, presenting a RESTful HTTP interface to the CLSIs on port 3009 by default. Urls are mapped to node functions in https://github.com/overleaf/filestore/blob/master/app.coffee . URLs are of the form:
|
||||
|
||||
* `/project/:project_id/file/:file_id`
|
||||
* `/template/:template_id/v/:version/:format`
|
||||
* `/project/:project_id/public/:public_file_id`
|
||||
* `/project/:project_id/size`
|
||||
* `/bucket/:bucket/key/*`
|
||||
* `/shutdown`
|
||||
* `/status` - returns HTTP 200 `filestore is up` or HTTP 503 when shutting down
|
||||
* `/health_check`
|
||||
- `/project/:project_id/file/:file_id`
|
||||
- `/template/:template_id/v/:version/:format`
|
||||
- `/project/:project_id/public/:public_file_id`
|
||||
- `/project/:project_id/size`
|
||||
- `/bucket/:bucket/key/*`
|
||||
- `/shutdown`
|
||||
- `/status` - returns HTTP 200 `filestore is up` or HTTP 503 when shutting down
|
||||
- `/health_check`
|
||||
|
||||
License
|
||||
-------
|
||||
## License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3. A copy can be found in the `LICENSE` file.
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ services:
|
||||
NODE_OPTIONS: "--unhandled-rejections=strict"
|
||||
VITEST_NO_CACHE: true
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -29,7 +28,7 @@ services:
|
||||
MONGO_HOST: mongo
|
||||
POSTGRES_HOST: postgres
|
||||
AWS_S3_ENDPOINT: https://minio:9000
|
||||
AWS_S3_PATH_STYLE: 'true'
|
||||
AWS_S3_PATH_STYLE: "true"
|
||||
DELETE_OBJECTS_MD5_FALLBACK: true
|
||||
AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
|
||||
AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY
|
||||
@@ -64,7 +63,6 @@ services:
|
||||
user: node
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -72,6 +70,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
certs:
|
||||
build:
|
||||
dockerfile_inline: |
|
||||
@@ -83,7 +82,7 @@ services:
|
||||
working_dir: /certs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
if [ ! -f private.key ] || [ ! -f public.crt ]; then
|
||||
/certgen -host minio
|
||||
@@ -115,7 +114,7 @@ services:
|
||||
- minio-certs:/root/.mc/certs/CAs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
sleep 1
|
||||
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
|
||||
@@ -218,6 +217,7 @@ services:
|
||||
mc admin policy create s3 overleaf-filestore policy-filestore.json
|
||||
mc admin policy attach s3 overleaf-filestore \
|
||||
--user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
|
||||
|
||||
gcs:
|
||||
image: fsouza/fake-gcs-server:1.52.3
|
||||
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
|
||||
|
||||
@@ -41,7 +41,7 @@ services:
|
||||
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
|
||||
POSTGRES_HOST: postgres
|
||||
AWS_S3_ENDPOINT: https://minio:9000
|
||||
AWS_S3_PATH_STYLE: 'true'
|
||||
AWS_S3_PATH_STYLE: "true"
|
||||
DELETE_OBJECTS_MD5_FALLBACK: true
|
||||
AWS_ACCESS_KEY_ID: OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
|
||||
AWS_SECRET_ACCESS_KEY: OVERLEAF_FILESTORE_S3_SECRET_ACCESS_KEY
|
||||
@@ -85,7 +85,7 @@ services:
|
||||
working_dir: /certs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
if [ ! -f private.key ] || [ ! -f public.crt ]; then
|
||||
/certgen -host minio
|
||||
@@ -117,7 +117,7 @@ services:
|
||||
- minio-certs:/root/.mc/certs/CAs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
sleep 1
|
||||
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
|
||||
@@ -220,6 +220,7 @@ services:
|
||||
mc admin policy create s3 overleaf-filestore policy-filestore.json
|
||||
mc admin policy attach s3 overleaf-filestore \
|
||||
--user=OVERLEAF_FILESTORE_S3_ACCESS_KEY_ID
|
||||
|
||||
gcs:
|
||||
image: fsouza/fake-gcs-server:1.52.3
|
||||
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"start": "node app.js",
|
||||
"nodemon": "node --watch app.js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"test:acceptance:_run": "mocha --recursive --timeout 15000 --exit $@ test/acceptance/js",
|
||||
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
|
||||
"lint:fix": "eslint --fix .",
|
||||
|
||||
@@ -17,8 +17,8 @@ docker run -v `pwd`/conf/local.json:/conf/runtime.json writelatex-git-bridge
|
||||
|
||||
### Required packages
|
||||
|
||||
* `maven` (for building, running tests and packaging)
|
||||
* `jdk-8` (for compiling and running)
|
||||
- `maven` (for building, running tests and packaging)
|
||||
- `jdk-8` (for compiling and running)
|
||||
|
||||
### Commands
|
||||
|
||||
@@ -114,7 +114,6 @@ The configuration file is in `.json` format.
|
||||
|
||||
You have to restart the server for configuration changes to take effect.
|
||||
|
||||
|
||||
## Creating OAuth app
|
||||
|
||||
In dev-env, run the following command in mongo to create the oauth application
|
||||
|
||||
@@ -57,11 +57,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/history-v1/reports:/overleaf/services/history-v1/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/history-v1/reports:/overleaf/services/history-v1/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -82,13 +81,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/history-v1
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/history-v1
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/history-v1
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -3,11 +3,13 @@
|
||||
The history service uses knex to manage PostgreSQL migrations.
|
||||
|
||||
To create a new migrations, run:
|
||||
|
||||
```
|
||||
npx knex migrate:make migration_name
|
||||
```
|
||||
|
||||
To apply migrations, run:
|
||||
|
||||
```
|
||||
npx knex migrate:latest
|
||||
```
|
||||
|
||||
@@ -30,7 +30,6 @@ services:
|
||||
redis_test:
|
||||
condition: service_healthy
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -44,7 +43,7 @@ services:
|
||||
MONGO_HOST: mongo
|
||||
POSTGRES_HOST: postgres
|
||||
AWS_S3_ENDPOINT: https://minio:9000
|
||||
AWS_S3_PATH_STYLE: 'true'
|
||||
AWS_S3_PATH_STYLE: "true"
|
||||
DELETE_OBJECTS_MD5_FALLBACK: true
|
||||
AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
|
||||
AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY
|
||||
@@ -79,7 +78,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -87,6 +85,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
redis_test:
|
||||
image: redis:7.4.3
|
||||
healthcheck:
|
||||
@@ -108,6 +107,7 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
postgres:
|
||||
image: postgres:10
|
||||
environment:
|
||||
@@ -132,7 +132,7 @@ services:
|
||||
working_dir: /certs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
if [ ! -f private.key ] || [ ! -f public.crt ]; then
|
||||
/certgen -host minio
|
||||
@@ -164,7 +164,7 @@ services:
|
||||
- minio-certs:/root/.mc/certs/CAs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
sleep 1
|
||||
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
|
||||
@@ -267,6 +267,7 @@ services:
|
||||
mc admin policy create s3 overleaf-history policy-history.json
|
||||
mc admin policy attach s3 overleaf-history \
|
||||
--user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
|
||||
|
||||
gcs:
|
||||
image: fsouza/fake-gcs-server:1.52.3
|
||||
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
|
||||
|
||||
@@ -60,7 +60,7 @@ services:
|
||||
MONGO_CONNECTION_STRING: mongodb://mongo/test-overleaf
|
||||
POSTGRES_HOST: postgres
|
||||
AWS_S3_ENDPOINT: https://minio:9000
|
||||
AWS_S3_PATH_STYLE: 'true'
|
||||
AWS_S3_PATH_STYLE: "true"
|
||||
DELETE_OBJECTS_MD5_FALLBACK: true
|
||||
AWS_ACCESS_KEY_ID: OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
|
||||
AWS_SECRET_ACCESS_KEY: OVERLEAF_HISTORY_S3_SECRET_ACCESS_KEY
|
||||
@@ -138,7 +138,7 @@ services:
|
||||
working_dir: /certs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
if [ ! -f private.key ] || [ ! -f public.crt ]; then
|
||||
/certgen -host minio
|
||||
@@ -170,7 +170,7 @@ services:
|
||||
- minio-certs:/root/.mc/certs/CAs
|
||||
entrypoint: sh
|
||||
command:
|
||||
- '-cex'
|
||||
- "-cex"
|
||||
- |
|
||||
sleep 1
|
||||
mc alias set s3 https://minio:9000 MINIO_ROOT_USER MINIO_ROOT_PASSWORD \
|
||||
@@ -273,6 +273,7 @@ services:
|
||||
mc admin policy create s3 overleaf-history policy-history.json
|
||||
mc admin policy attach s3 overleaf-history \
|
||||
--user=OVERLEAF_HISTORY_S3_ACCESS_KEY_ID
|
||||
|
||||
gcs:
|
||||
image: fsouza/fake-gcs-server:1.52.3
|
||||
command: ["--port=9090", "--scheme=http", "--external-url=http://gcs:9090"]
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
"start": "node app.js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"test:unit": "npm run test:unit:_run -- --grep=$MOCHA_GREP",
|
||||
"test:acceptance": "npm run test:acceptance:_run -- --grep=$MOCHA_GREP",
|
||||
"test:unit:_run": "mocha --recursive --exit $@ test/unit/js",
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
Scripts in this directory were used when we cleaned up the global blobs table,
|
||||
ensuring that it only contained global blobs. The scripts are meant to be run in this order:
|
||||
|
||||
* `01-create-blob-hashes-table.sql`
|
||||
* `02-set-global-flag.sql`
|
||||
* `03-create-global-blobs-table.sql`
|
||||
* `04-swap-global-blob-tables.sql`
|
||||
- `01-create-blob-hashes-table.sql`
|
||||
- `02-set-global-flag.sql`
|
||||
- `03-create-global-blobs-table.sql`
|
||||
- `04-swap-global-blob-tables.sql`
|
||||
|
||||
The `rollback.sql` can be run to reverse the effect of `03-swap-global-blob-tables.sql`.
|
||||
|
||||
@@ -53,11 +53,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/notifications/reports:/overleaf/services/notifications/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/notifications/reports:/overleaf/services/notifications/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -78,13 +77,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/notifications
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/notifications
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/notifications
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
overleaf/notifications
|
||||
===============
|
||||
# overleaf/notifications
|
||||
|
||||
An API for managing user notifications in Overleaf
|
||||
|
||||
|
||||
database indexes
|
||||
================
|
||||
# database indexes
|
||||
|
||||
For notification expiry to work, a TTL index on `notifications.expires` must be created:
|
||||
|
||||
@@ -13,8 +10,8 @@ For notification expiry to work, a TTL index on `notifications.expires` must be
|
||||
db.notifications.createIndex({ expires: 1 }, { expireAfterSeconds: 10 })
|
||||
```
|
||||
|
||||
License
|
||||
=======
|
||||
# License
|
||||
|
||||
The code in this repository is released under the GNU AFFERO GENERAL PUBLIC LICENSE, version 3.
|
||||
|
||||
Copyright (c) Overleaf, 2016–2019.
|
||||
|
||||
@@ -22,7 +22,6 @@ services:
|
||||
mongo:
|
||||
condition: service_started
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -44,7 +43,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -52,6 +50,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
mongo:
|
||||
image: mongo:8.0.11
|
||||
command: --replSet overleaf --notablescan
|
||||
|
||||
@@ -64,4 +64,3 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
"test:unit:_run": "vitest --config ./vitest.config.unit.cjs",
|
||||
"test:unit": "npm run test:unit:_run",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit",
|
||||
"nodemon": "node --watch app.ts"
|
||||
|
||||
@@ -56,11 +56,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/app/js/types.ts:/overleaf/services/document-updater/app/js/types.ts --volume $(MONOREPO)/services/project-history/reports:/overleaf/services/project-history/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/document-updater/app/js/types.ts:/overleaf/services/document-updater/app/js/types.ts --volume $(MONOREPO)/services/project-history/reports:/overleaf/services/project-history/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -81,13 +80,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/project-history
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/project-history
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/project-history
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
@overleaf/project-history
|
||||
==========================
|
||||
# @overleaf/project-history
|
||||
|
||||
An API for converting raw editor updates into a compressed and browseable history.
|
||||
|
||||
Running project-history
|
||||
-----------------------
|
||||
## Running project-history
|
||||
|
||||
The app runs natively using npm and Node on the local system:
|
||||
|
||||
@@ -13,8 +11,7 @@ npm install
|
||||
npm run start
|
||||
```
|
||||
|
||||
Unit Tests
|
||||
----------
|
||||
## Unit Tests
|
||||
|
||||
The test suites run in Docker.
|
||||
|
||||
@@ -33,8 +30,7 @@ During development it is often useful to only run a subset of tests, which can b
|
||||
make test_unit MOCHA_ARGS='--grep=AuthorizationManager'
|
||||
```
|
||||
|
||||
Acceptance Tests
|
||||
----------------
|
||||
## Acceptance Tests
|
||||
|
||||
Acceptance tests are run against a live service, which runs in the `acceptance_test` container defined in `docker-compose.tests.yml`.
|
||||
|
||||
@@ -61,8 +57,7 @@ During development it is often useful to only run a subset of tests, which can b
|
||||
make test_acceptance_run MOCHA_ARGS='--grep=AuthorizationManager'
|
||||
```
|
||||
|
||||
Makefile and npm scripts
|
||||
------------------------
|
||||
## Makefile and npm scripts
|
||||
|
||||
The commands used to compile the app and tests, to run the mocha tests, and to run the app are all in `package.json`. These commands call out to `coffee`, `mocha`, etc which are available to `npm` in the local `node_modules/.bin` directory, using the local versions. Normally, these commands should not be run directly, but instead run in docker via make.
|
||||
|
||||
|
||||
@@ -27,7 +27,6 @@ services:
|
||||
redis_test:
|
||||
condition: service_healthy
|
||||
|
||||
|
||||
test_acceptance:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -55,7 +54,6 @@ services:
|
||||
entrypoint: /overleaf/bin/shared/wait_for_it mongo:27017 --timeout=60 --
|
||||
command: npm run test:acceptance
|
||||
|
||||
|
||||
tar:
|
||||
build: .
|
||||
image: ci/$PROJECT_NAME:$BRANCH_NAME-$BUILD_NUMBER
|
||||
@@ -63,6 +61,7 @@ services:
|
||||
- ./:/tmp/build/
|
||||
command: tar -czf /tmp/build/build.tar.gz --exclude=build.tar.gz --exclude-vcs .
|
||||
user: root
|
||||
|
||||
redis_test:
|
||||
image: redis:7.4.3
|
||||
healthcheck:
|
||||
|
||||
@@ -83,4 +83,3 @@ services:
|
||||
# replica set. This override is not needed when running the setup after
|
||||
# starting up mongo.
|
||||
- mongo:127.0.0.1
|
||||
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
"test:acceptance:_run": "mocha --loader=esmock --recursive --timeout 15000 --exit $@ test/acceptance/js",
|
||||
"test:unit:_run": "mocha --loader=esmock --recursive --exit $@ test/unit/js",
|
||||
"lint": "eslint --max-warnings 0 --format unix .",
|
||||
"format": "prettier --list-different $PWD/'**/{*.*js,*.ts}'",
|
||||
"format:fix": "prettier --write $PWD/'**/{*.*js,*.ts}'",
|
||||
"lint:fix": "eslint --fix .",
|
||||
"types:check": "tsc --noEmit"
|
||||
},
|
||||
|
||||
@@ -21,17 +21,11 @@
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "main.tex",
|
||||
"textOperation": [
|
||||
1912,
|
||||
"Hello world",
|
||||
18726
|
||||
]
|
||||
"textOperation": [1912, "Hello world", 18726]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:23:35.633Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
@@ -41,24 +35,17 @@
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:27:26.874Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "foo.tex",
|
||||
"textOperation": [
|
||||
26,
|
||||
"\n\nFour five six"
|
||||
]
|
||||
"textOperation": [26, "\n\nFour five six"]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:28:33.724Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -21,32 +21,21 @@
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "foo.tex",
|
||||
"textOperation": [
|
||||
41,
|
||||
"\n\nSeven eight nince"
|
||||
]
|
||||
"textOperation": [41, "\n\nSeven eight nince"]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:29:17.786Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "foo.tex",
|
||||
"textOperation": [
|
||||
58,
|
||||
-1,
|
||||
1
|
||||
]
|
||||
"textOperation": [58, -1, 1]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:29:22.905Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
@@ -56,9 +45,7 @@
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:29:26.120Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -21,33 +21,21 @@
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "main.tex",
|
||||
"textOperation": [
|
||||
1923,
|
||||
" also updated",
|
||||
18726
|
||||
]
|
||||
"textOperation": [1923, " also updated", 18726]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:32:47.277Z",
|
||||
"authors": [
|
||||
31
|
||||
]
|
||||
"authors": [31]
|
||||
},
|
||||
{
|
||||
"operations": [
|
||||
{
|
||||
"pathname": "bar.tex",
|
||||
"textOperation": [
|
||||
28,
|
||||
-15,
|
||||
16
|
||||
]
|
||||
"textOperation": [28, -15, 16]
|
||||
}
|
||||
],
|
||||
"timestamp": "2017-12-04T10:32:52.877Z",
|
||||
"v2Authors": [
|
||||
"5a5637efdac84e81b71014c4"
|
||||
]
|
||||
"v2Authors": ["5a5637efdac84e81b71014c4"]
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -51,11 +51,10 @@ clean:
|
||||
# Run the linting commands in the scope of the monorepo.
|
||||
# Eslint and prettier (plus some configs) are on the root.
|
||||
RUN_LINTING = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(HERE) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
|
||||
RUN_LINTING_CI = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/real-time/reports:/overleaf/services/real-time/reports $(IMAGE_CI) npm run --silent
|
||||
|
||||
# Same but from the top of the monorepo
|
||||
RUN_LINTING_MONOREPO = docker run --rm -v $(MONOREPO):$(MONOREPO) -w $(MONOREPO) node:24.13.0 npm run --silent
|
||||
RUN_LINTING_CI_MONOREPO = docker run --rm --volume $(MONOREPO)/.editorconfig:/overleaf/.editorconfig --volume $(MONOREPO)/.eslintignore:/overleaf/.eslintignore --volume $(MONOREPO)/.eslintrc:/overleaf/.eslintrc --volume $(MONOREPO)/.prettierignore:/overleaf/.prettierignore --volume $(MONOREPO)/.prettierrc:/overleaf/.prettierrc --volume $(MONOREPO)/tsconfig.backend.json:/overleaf/tsconfig.backend.json --volume $(MONOREPO)/services/real-time/reports:/overleaf/services/real-time/reports -w /overleaf $(IMAGE_CI) npm run --silent
|
||||
|
||||
SHELLCHECK_OPTS = \
|
||||
--shell=bash \
|
||||
@@ -76,13 +75,13 @@ shellcheck_fix:
|
||||
done
|
||||
|
||||
format:
|
||||
$(RUN_LINTING) format
|
||||
$(RUN_LINTING_MONOREPO) format -- services/real-time
|
||||
|
||||
format_ci:
|
||||
$(RUN_LINTING_CI) format
|
||||
$(RUN_LINTING_CI_MONOREPO) format -- services/real-time
|
||||
|
||||
format_fix:
|
||||
$(RUN_LINTING) format:fix
|
||||
$(RUN_LINTING_MONOREPO) format:fix -- services/real-time
|
||||
|
||||
lint:
|
||||
$(RUN_LINTING) lint
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user